1: #
   2: /*
   3: **	COPYRIGHT
   4: **
   5: **	The Regents of the University of California
   6: **
   7: **	1977
   8: **
   9: **	This program material is the property of the
  10: **	Regents of the University of California and
  11: **	may not be reproduced or disclosed without
  12: **	the prior written permission of the owner.
  13: */
  14: 
  15: 
  16: 
  17: /*
  18: **	INDEX relation struct
  19: **
  20: **	The INDEX relation is used to determine what, if any,
  21: **	secondary indicies exist for relations.  If a relation
  22: **	has a secondary index, there will be one tuple in the
  23: **	INDEX relation for each such index.  There may be one
  24: **	or more domains indexed by one or many INDEX relations
  25: **	depending on whether single or combined indicies are
  26: **	being used.
  27: **
  28: **	Combined indices may use up to six domains to form the
  29: **	index.
  30: **
  31: **	The simple existance of a secondary index is better
  32: **	checked using the "relindxd" field in the RELATION
  33: **	relation, since that is more efficient.
  34: **
  35: **	The two values SECINDEX and SECBASE are the values for
  36: **	the relindxd field of the relation relation.  Implicitly
  37: **	SECINDEX must be < 0 and SECBASE must be > 0.
  38: */
  39: 
  40: # define    IRELIDP     1
  41: # define    IOWNERP     2
  42: # define    IRELIDI     3
  43: 
  44: # define    SECINDEX    -2  /* this value in rel.relindxd indicates
  45: 					** that the relation is a sec. index */
  46: # define    SECBASE     1   /* this value in rel.relindxd indicates
  47: 					** has a sec. index */
  48: 
  49: struct index
  50: {
  51:     char    irelidp[MAXNAME];   /*unique name of primary relation	*/
  52:     char    iownerp[2];     /*owner of primary relation*/
  53:     char    irelidi[MAXNAME];   /*unique name of index relation	*/
  54:     char    irelspeci;      /*relspec of index relation*/
  55:     char    idom[MAXKEYS];      /* domain number of primary relation */
  56:                     /* which corresponds to each index attribute */
  57:                     /* In the indexes relation these are stored as */
  58:                     /* idom1, idom2, ..,idom6 */
  59: };
  60: 
  61: 
  62: 
  63: /*
  64: **  TREE RELATION STRUCT
  65: **
  66: **	The TREE relation stores trees used by query modification and
  67: **	for distribution criteria.
  68: */
  69: 
  70: struct tree
  71: {
  72:     char    treerelid[MAXNAME]; /* relation name */
  73:     char    treeowner[2];       /* relation owner */
  74:     int treeid;         /* internal name of this tuple */
  75:     int treeseq;        /* sequence number in tree */
  76:     char    treetype;       /* type info for this tree */
  77:     char    treexxxx;
  78:     char    treetree[100];      /* contents of tree */
  79: };
  80: 
  81: # define    TREERELID   1
  82: # define    TREEOWNER   2
  83: # define    TREEID      3
  84: # define    TREESEQ     4
  85: # define    TREETYPE    5
  86: 
  87: 
  88: 
  89: /*
  90: **  STRUCT PROTECT -- protection catalog
  91: **
  92: **	This structure defines the format of the 'protect' catalog.
  93: **	One or two things should be noted.  First, the 'prodomset'
  94: **	field is actually four domains in the physical relation,
  95: **	since the best we know about is i4's, and we need an i16.
  96: **	Second, both the proopset and the prodomset fields
  97: **	are bit maps.
  98: */
  99: 
 100: struct protect
 101: {
 102:     char    prorelid[MAXNAME];  /* relation to which this applies */
 103:     char    prorelown[2];       /* owner */
 104:     int propermid;      /* permission sequence number */
 105:     char    prouser[2];     /* user code in PERMIT */
 106: #	ifndef xV7_UNIX
 107:     char    proterm;        /* terminal in PERMIT */
 108:     char    proopset;       /* operation set */
 109: #	endif
 110: #	ifdef xV7_UNIX
 111:     char    proterm[2];     /* two character terminal id */
 112:     char    proresvar;      /* result variable number */
 113:     char    proopset;       /* operation set */
 114: #	endif
 115:     int protodbgn;      /* beginning time of day */
 116:     int protodend;      /* ending time of day */
 117:     char    prodowbgn;      /* beginning day of week */
 118:     char    prodowend;      /* ending day of week */
 119:     int prodomset[8];       /* domain set permitted */
 120:     int protree;        /* link to qualification */
 121: #	ifndef xV7_UNIX
 122:     char    proresvar;      /* Resultvarno in tree */
 123: #	endif
 124: };
 125: 
 126: /* field numbers for find() calls */
 127: # define    PRORELID    1
 128: # define    PRORELOWN   2
 129: # define    PROPERMID   3
 130: # ifndef xV7_UNIX
 131: # define    PROTREE     15
 132: # endif
 133: # ifdef xV7_UNIX
 134: # define    PROTREE     16
 135: # endif
 136: 
 137: /* bit values for proopset */
 138: # define    PRO_RETR    0001    /* retrieve */
 139: # define    PRO_REPL    0002    /* replace */
 140: # define    PRO_DEL     0004    /* delete */
 141: # define    PRO_APP     0010    /* append */
 142: # define    PRO_TEST    0020    /* test in qualification */
 143: # define    PRO_AGGR    0040    /* retrieve aggregate value */
 144: 
 145: 
 146: 
 147: /*
 148: **  STRUCT INTEGRITY -- the descriptor for the integrity relation
 149: */
 150: 
 151: struct integrity
 152: {
 153:     char    intrelid[MAXNAME];  /* name of the relation */
 154:     char    intrelowner[2];     /* owner of the relation */
 155:     int intdomset[8];       /* set of domains this applies to */
 156:     int inttree;        /* pointer into the tree catalog */
 157:     char    intresvar;      /* primary variable number */
 158: };
 159: 
 160: # define    INTRELID    1
 161: # define    INTRELOWNER 2
 162: # define    INTTREE     7

Defined struct's

Defined macros

PROTREE defined in line 134; used 1 times
SECINDEX defined in line 44; used 1 times

Usage of this include

Last modified: 1980-12-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1046
Valid CSS Valid XHTML 1.0 Strict