1: # include   "../ingres.h"
   2: # include   "../access.h"
   3: 
   4: dumptid(tid1)
   5: struct tup_id   *tid1;
   6: {
   7:     register struct tup_id  *tid;
   8:     long            pageid;
   9: 
  10:     tid = tid1;
  11: 
  12:     pluck_page(tid, &pageid);
  13:     printf("tid: %s/%d\n", locv(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: 
  22: struct lpage
  23: {
  24:     char    lpg0, lpgx;
  25:     char    lpg2, lpg1;
  26: };
  27: 
  28: /* pluck_page extracts the three byte page_id from the tup_id struct
  29: ** and puts it into a long variable with proper allignment.
  30: */
  31: 
  32: pluck_page(tid, var)
  33: struct tup_id   *tid;
  34: long        *var;
  35: {
  36:     register struct tup_id  *t;
  37:     register struct lpage   *v;
  38: 
  39:     t = tid;
  40:     v = (struct lpage *) var;
  41:     v->lpg0 = t->pg0;
  42:     v->lpg1 = t->pg1;
  43:     v->lpg2 = t->pg2;
  44:     v->lpgx = 0;
  45:     return (0);
  46: }
  47: 
  48: /*	stuff_page is the reverse of pluck_page	*/
  49: 
  50: stuff_page(tid, var)
  51: struct tup_id   *tid;
  52: long        *var;
  53: {
  54:     register struct tup_id  *t;
  55:     register struct lpage   *v;
  56: 
  57:     v = (struct lpage *) var;
  58:     t = tid;
  59:     t->pg0 = v->lpg0;
  60:     t->pg1 = v->lpg1;
  61:     t->pg2 = v->lpg2;
  62:     return (0);
  63: }

Defined functions

Defined struct's

lpage defined in line 22; used 8 times
Last modified: 1995-02-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2271
Valid CSS Valid XHTML 1.0 Strict