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
Defined struct's
accbuf
defined in line
38; used 90 times
- in line 54-55(4),
71-73(6)
- in /usr/ingres/source/access/acc_addbuf.c line
9-12(4)
- in /usr/ingres/source/access/accbuf.c line
12-14(6),
33(2),
41(2),
70-71(4),
121-123(4),
156(2),
188(2),
200-202(4)
- in /usr/ingres/source/access/add_ovflo.c line
17-22(4)
- in /usr/ingres/source/access/add_prim.c line
18(2)
- in /usr/ingres/source/access/closer.c line
24(2)
- in /usr/ingres/source/access/findbest.c line
148(2)
- in /usr/ingres/source/access/formatpg.c line
8(2)
- in /usr/ingres/source/access/last_page.c line
12-16(4)
- in /usr/ingres/source/access/noclose.c line
24(2)
- in /usr/ingres/source/access/page.c line
22-25(6),
88-90(4)
- in /usr/ingres/source/access/put_tuple.c line
145(2),
155(2)
- in /usr/ingres/source/dbu/ksort.c line
530(2),
540(2),
574(2)
- in /usr/ingres/source/dbu/modify.c line
792(2)
- in /usr/ingres/source/decomp/call_ovqp70.c line
399(2)
- in /usr/ingres/source/iutil/pglocks.c line
10-12(4),
38-40(4)
admin
defined in line
92; used 16 times
Defined macros
M_HEAP
defined in line
17; used 18 times
PGSIZE
defined in line
12; used 19 times
Usage of this include