Annotation of 42BSD/ingres/source/iutil/paramd.c, revision 1.1

1.1     ! root        1: # include      <ingres.h>
        !             2: # include      <aux.h>
        !             3: # include      <catalog.h>
        !             4: # include      <access.h>
        !             5: # include      <sccs.h>
        !             6: 
        !             7: SCCSID(@(#)paramd.c    7.1     2/5/81)
        !             8: 
        !             9: 
        !            10: 
        !            11: /*
        !            12: **     get access parameters of a relation from its descriptor and return
        !            13: **     them in struct pointed to by "ap".
        !            14: */
        !            15: 
        !            16: 
        !            17: paramd(d, ap)
        !            18: register DESC                  *d;
        !            19: register struct accessparam    *ap;
        !            20: {
        !            21:        register int    i;
        !            22:        int             p;
        !            23: 
        !            24: 
        !            25:        ap->mode = getmode(d->reldum.relspec);
        !            26:        ap->sec_index = FALSE;  /* indicate that this isn't the index-rel */
        !            27: 
        !            28:        for (i = 0; i < MAXDOM+1; i++)
        !            29:                ap->keydno[i] = 0;
        !            30: 
        !            31:        for (p = 1; p <= d->reldum.relatts; p++)
        !            32:                if (i = d->relxtra[p])
        !            33:                        ap->keydno[i-1] = p;
        !            34:        return (0);
        !            35: }
        !            36: 
        !            37: parami(ip, param)
        !            38: struct index           *ip;
        !            39: struct accessparam     *param;
        !            40: {
        !            41:        register struct accessparam     *ap;
        !            42: 
        !            43:        ap  = param;
        !            44:        ap->mode = getmode(ip->irelspeci);
        !            45:        ap->sec_index = TRUE;   /* this is an index */
        !            46: 
        !            47:        bmove(ip->idom, ap->keydno, MAXKEYS);
        !            48:        ap->keydno[MAXKEYS] = 0;
        !            49:        return(0);
        !            50: }
        !            51: 
        !            52: 
        !            53: getmode(spec)
        !            54: int    spec;
        !            55: {
        !            56:        switch (abs(spec))
        !            57:        {
        !            58:          case M_HEAP:
        !            59:                return(NOKEY);
        !            60: 
        !            61:          case M_ISAM:
        !            62:                return(LRANGEKEY);
        !            63: 
        !            64:          case M_HASH:
        !            65:                return(EXACTKEY);
        !            66: 
        !            67:          default: 
        !            68:                syserr("getmode:bad relspec %d", spec);
        !            69:        }
        !            70: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.