1: #
   2: /*
   3: **  ACCESS.H -- definitions relating to the access methods.
   4: **
   5: **	Version:
   6: **		@(#)access.h	1.5	8/24/80
   7: */
   8: 
   9: # ifndef PGSIZE
  10: 
  11: 
  12: # define    PGSIZE      512     /* size of page */
  13: # define    PGPTRSIZ    4       /* size of a tid */
  14: # define    MAXTUPS     100     /* maximum number of tups */
  15: 
  16: /* storage structure flags; < 0 means compressed */
  17: # define    M_HEAP      5       /* paged heap */
  18: # define    M_ISAM      11      /* indexed sequential */
  19: # define    M_HASH      21      /* random hash */
  20: # define    M_BTREE     31      /* BTREES */
  21: # define    M_TRUNC     99      /* internal pseudo-mode: truncated */
  22: 
  23: # define    NACCBUFS    3       /* number of access method buffers */
  24: 
  25: /* error flags */
  26: # define    AMREAD_ERR  -1
  27: # define    AMWRITE_ERR -2
  28: # define    AMNOFILE_ERR    -3  /* can't open file for a relation */
  29: # define    AMREL_ERR   -4  /* can't open relation relation */
  30: # define    AMATTR_ERR  -5  /* can't open attribute relation */
  31: # define    AMNOATTS_ERR    -6  /* attribute missing or xtra in att-rel */
  32: # define    AMCLOSE_ERR -7  /* can't close relation */
  33: # define    AMFIND_ERR  -8  /* unidentifiable stora  Petructure in find */
  34: # define    AMINVL_ERR  -9  /* invalid TID */
  35: # define    AMOPNVIEW_ERR   -10 /* attempt to open a view for rd or wr */
  36: 
  37: /* the following is the access methods buffer */
  38: struct accbuf
  39: {
  40:     /* this stuff is actually stored in the relation */
  41:     long        mainpg;     /* next main page (0 - eof) */
  42:     long        ovflopg;    /* next ovflo page (0 - none) */
  43:     short       nxtlino;    /* next avail line no for this page */
  44:     char        firstup[PGSIZE - 12];   /* tuple space */
  45:     short       linetab[1]; /* line table at end of buffer - grows down */
  46:                     /* linetab[lineno] is offset into
  47: 					** the buffer for that line; linetab[nxtlino]
  48: 					** is free space pointer */
  49: 
  50:     /* this stuff is not stored in the relation */
  51:     long        rel_tupid;  /* unique relation id */
  52:     long        thispage;   /* page number of the current page */
  53:     int     filedesc;   /* file descriptor for this reln */
  54:     struct accbuf   *modf;      /* use time link list forward pointer */
  55:     struct accbuf   *modb;      /* back pointer */
  56:     int     bufstatus;  /* various bits defined below */
  57: };
  58: 
  59: /* The following assignments are status bits for accbuf.bufstatus */
  60: # define    BUF_DIRTY   001 /* page has been changed */
  61: # define    BUF_LOCKED  002 /* page has a page lock on it */
  62: # define    BUF_DIRECT  004 /* this is a page from isam direct */
  63: 
  64: /* access method buffer typed differently for various internal operations */
  65: struct raw_accbuf
  66: {
  67:     char    acc_buf[NACCBUFS];
  68: };
  69: 
  70: /* pointers to maintain the buffer */
  71: extern struct accbuf    *Acc_head;  /* head of the LRU list */
  72: extern struct accbuf    *Acc_tail;  /* tail of the LRU list */
  73: extern struct accbuf    Acc_buf[NACCBUFS];  /* the buffers themselves */
  74: 
  75: 
  76: /*
  77: **  ADMIN file struct
  78: **
  79: **	The ADMIN struct describes the initial part of the ADMIN file
  80: **	which exists in each database.  This file is used to initially
  81: **	create the database, to maintain some information about the
  82: **	database, and to access the RELATION and ATTRIBUTE relations
  83: **	on OPENR calls.
  84: */
  85: 
  86: struct adminhdr
  87: {
  88:     char    adowner[2]; /* user code of data base owner */
  89:     short   adflags;    /* database flags */
  90: };
  91: 
  92: struct admin
  93: {
  94:     struct adminhdr     adhdr;
  95:     struct descriptor   adreld;
  96:     struct descriptor   adattd;
  97: };
  98: 
  99: /*
 100: **  Admin status bits
 101: **
 102: **	These bits define the status of the database.  They are
 103: **	contained in the adflags field of the admin struct.
 104: */
 105: 
 106: # define    A_DBCONCUR  0000001     /* set database concurrency */
 107: # define    A_QRYMOD    0000002     /* database uses query modification */
 108: # define    A_NEWFMT    0000004     /* database is post-6.2 */
 109: 
 110: 
 111: /* following is buffer space for data from admin file */
 112: extern struct admin     Admin;
 113: 
 114: /*
 115: **  PGTUPLE -- btree index key (a tid and an index key)
 116: */
 117: 
 118: struct pgtuple
 119: {
 120:     struct tup_id   childtid;       /* the pointer comes before */
 121:     char        childtup[MAXTUP];
 122: };
 123: 
 124: /*
 125: ** global counters for the number of UNIX read and write
 126: **  requests issued by the access methods.
 127: */
 128: 
 129: extern long Accuread, Accuwrite;
 130: 
 131: /*
 132: **	Global values used by everything
 133: */
 134: 
 135: char        *Acctuple;      /* pointer to canonical tuple */
 136: int     Accerror;       /* error no for fatal errors */
 137: char        Accanon[MAXTUP];    /* canonical tuple buffer */
 138: 
 139: # endif PGSIZE

Defined variables

Accanon defined in line 137; used 3 times
Accerror defined in line 136; used 3 times

Defined struct's

adminhdr defined in line 86; used 2 times
  • in line 94(2)
pgtuple defined in line 118; never used

Defined macros

AMATTR_ERR defined in line 30; never used
AMFIND_ERR defined in line 33; used 1 times
AMNOATTS_ERR defined in line 31; used 1 times
AMNOFILE_ERR defined in line 28; used 1 times
AMREL_ERR defined in line 29; never used
AMWRITE_ERR defined in line 27; used 1 times
A_NEWFMT defined in line 108; used 1 times
MAXTUPS defined in line 14; never used
M_BTREE defined in line 20; never used
M_HASH defined in line 19; used 5 times
M_ISAM defined in line 18; used 7 times
M_TRUNC defined in line 21; used 3 times
NACCBUFS defined in line 23; used 4 times
PGPTRSIZ defined in line 13; never used

Usage of this include

access.h used 75 times
Last modified: 1995-02-12
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4360
Valid CSS Valid XHTML 1.0 Strict