Annotation of 43BSD/ingres/source/iutil/utility.c, revision 1.1.1.1

1.1       root        1: # include      <ingres.h>
                      2: # include      <access.h>
                      3: # include      <sccs.h>
                      4: 
                      5: SCCSID(@(#)utility.c   8.2     12/8/85)
                      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 SUN's and VAXes have the order of the
                     23: **     words reversed, this structure must be different.
                     24: */
                     25: 
                     26: struct lpage
                     27: {
                     28: # ifdef VAX
                     29:        char    lpg2, lpg1, lpg0, lpgx;
                     30: # else
                     31:        char    lpgx, lpg0, lpg1, lpg2;
                     32: # endif
                     33: };
                     34: /*  PLUCK_PAGE
                     35: **
                     36: **     pluck_page extracts the three byte page_id from a TID
                     37: **     and puts it into a long variable with proper allignment.
                     38: */
                     39: 
                     40: pluck_page(t, var)
                     41: register TID   *t;
                     42: long           *var;
                     43: {
                     44:        register struct lpage   *v;
                     45: 
                     46:        v = (struct lpage *) var;
                     47:        v->lpg0 = t->pg0;
                     48:        v->lpg1 = t->pg1;
                     49:        v->lpg2 = t->pg2;
                     50:        v->lpgx = 0;
                     51:        return (0);
                     52: }
                     53: 
                     54: /*     stuff_page is the reverse of pluck_page */
                     55: stuff_page(t, var)
                     56: register TID   *t;
                     57: long           *var;
                     58: {
                     59:        register struct lpage   *v;
                     60: 
                     61:        v = (struct lpage *) var;
                     62:        t->pg0 = v->lpg0;
                     63:        t->pg1 = v->lpg1;
                     64:        t->pg2 = v->lpg2;
                     65:        return (0);
                     66: }

unix.superglobalmegacorp.com

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