DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T g

⟦e15a867b0⟧ TextFile

    Length: 622 (0x26e)
    Types: TextFile
    Names: »getrel.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Empire.V/V1.1/EMPSUBS/getrel.c« 

TextFile

#define D_NATSTR
#include        "empdef.h"

getrel(c1, c2)
int     c1, c2;
{
        register        word, shift;

        if( getnat(c1) == -1 ) return(-1);
        word = c2;
        word >>= 3;
        shift = 14 - ((c2 % 7) << 1);
        return((nat.nat_relate[word]>>shift) & 03);
}

putrel(c1, c2, rel)
int     c1, c2, rel;
{
        register        word, shift;

        if( getnat(c1) == -1 ) return(-1);
        word = c2;
        word >>= 3;
        shift = 14 - ((c2 % 7) << 1);
        nat.nat_relate[word] &= ~(3<<shift);
        nat.nat_relate[word] |= rel<<shift;
        putnat(c1);
        return(0);
}