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

1.1     ! root        1: # include      <ingres.h>
        !             2: # include      <access.h>
        !             3: # include      <sccs.h>
        !             4: 
        !             5: SCCSID(@(#)utility.c   7.1     2/5/81)
        !             6: 
        !             7: dumptid(tid)
        !             8: register TID   *tid;
        !             9: {
        !            10:        long    pageid;
        !            11: 
        !            12:        pluck_page(tid, &pageid);
        !            13:        printf("tid: %ld/%d\n", pageid, (tid->line_id & I1MASK));
        !            14:        return (0);
        !            15: }
        !            16: 
        !            17: /*
        !            18: **     struct for extracting page number from a tid
        !            19: **     and storing in a long
        !            20: **
        !            21: **     We want the line number (lpgx) to be in the low-order part of
        !            22: **     a long.  Since PDP's and VAXes have the order of the half-
        !            23: **     words reversed, this structure must be different.
        !            24: */
        !            25: 
        !            26: struct lpage
        !            27: {
        !            28: # ifdef PDP11
        !            29:        char    lpg0, lpgx;
        !            30:        char    lpg2, lpg1;
        !            31: # else
        !            32:        char    lpg2, lpg1, lpg0, lpgx;
        !            33: # endif
        !            34: };
        !            35: /*  PLUCK_PAGE
        !            36: **
        !            37: **     pluck_page extracts the three byte page_id from a TID
        !            38: **     and puts it into a long variable with proper allignment.
        !            39: */
        !            40: 
        !            41: pluck_page(t, var)
        !            42: register TID   *t;
        !            43: long           *var;
        !            44: {
        !            45:        register struct lpage   *v;
        !            46: 
        !            47:        v = (struct lpage *) var;
        !            48:        v->lpg0 = t->pg0;
        !            49:        v->lpg1 = t->pg1;
        !            50:        v->lpg2 = t->pg2;
        !            51:        v->lpgx = 0;
        !            52:        return (0);
        !            53: }
        !            54: 
        !            55: /*     stuff_page is the reverse of pluck_page */
        !            56: stuff_page(t, var)
        !            57: register TID   *t;
        !            58: long           *var;
        !            59: {
        !            60:        register struct lpage   *v;
        !            61: 
        !            62:        v = (struct lpage *) var;
        !            63:        t->pg0 = v->lpg0;
        !            64:        t->pg1 = v->lpg1;
        !            65:        t->pg2 = v->lpg2;
        !            66:        return (0);
        !            67: }

unix.superglobalmegacorp.com

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