Annotation of 42BSD/ingres/source/iutil/tmputil.c, revision 1.1.1.1

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

unix.superglobalmegacorp.com

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