From 00eeb591b48ec7bdb85794858241f0db3ca44f80 Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Mon, 3 Apr 1989 17:48:31 +0000 Subject: [PATCH] ING_DB --- WEGA/contrib/ingres/dbs/src/h/batch.h | 45 +++++++++++++++ WEGA/contrib/ingres/dbs/src/h/scanner.h | 77 +++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 WEGA/contrib/ingres/dbs/src/h/batch.h create mode 100644 WEGA/contrib/ingres/dbs/src/h/scanner.h diff --git a/WEGA/contrib/ingres/dbs/src/h/batch.h b/WEGA/contrib/ingres/dbs/src/h/batch.h new file mode 100644 index 0000000..e6dd988 --- /dev/null +++ b/WEGA/contrib/ingres/dbs/src/h/batch.h @@ -0,0 +1,45 @@ +# define IDSIZE 6 /* size of file id */ + + /* available buffer space */ +# define BATCHSIZE (PGSIZE - IDSIZE) + +struct batchbuf +{ + char file_id[IDSIZE]; /* unique file name identifier */ + char bbuf[BATCHSIZE]; /* buffer for batch storage */ +}; + + +struct si_doms +{ + int rel_off; /* offset in primary tuple */ + int tupo_off; /* offset in saved tuple-old */ + int dom_size; /* width of the domain */ + /* if zero then domain not used */ +}; +struct batchhd +{ + char db_name[MAXNAME + 1]; /* data base name */ + char rel_name[MAXNAME + 1]; /* relation name */ + char userid[2]; /* DBS user code */ + long num_updts; /* actual number of tuples to be updated */ + short mode_up; /* type of update */ + short tido_size; /* width of old_tuple_id field */ + short tupo_size; /* width of old tuple */ + short tupn_size; /* width of new tuple */ + short tidn_size; /* width of new_tuple_id field */ + short si_dcount; /* number of sec. index domains affected */ + struct si_doms si[MAXDOM + 1]; /* entry for each domain with sec. index */ +}; + + + +extern int Batch_fp; /* file descriptor for batch file */ +extern int Batch_cnt; /* no of bytes taken from the current buffer */ +extern int Batch_dirty; /* used during update to mark a dirty page */ +extern int Batch_lread; /* number of bytes last read in readbatch() */ +extern int Batch_recovery; /* TRUE is this is recovery, else FALSE */ +extern struct batchbuf Batchbuf; +extern struct batchhd Batchhd; + +extern char *Fileset; /* unique id of batch maker */ diff --git a/WEGA/contrib/ingres/dbs/src/h/scanner.h b/WEGA/contrib/ingres/dbs/src/h/scanner.h new file mode 100644 index 0000000..dd3d75b --- /dev/null +++ b/WEGA/contrib/ingres/dbs/src/h/scanner.h @@ -0,0 +1,77 @@ +/* SCANNER.H */ +/* contains the global structures and variable declarations needed */ +/* by the lexical analyzer. This includes Manifest Constants and */ +/* certain vars for internal communication purposes. Therefore, */ +/* extreme care should be exercised when modifying this file. */ + + +/* MANIFEST CONSTANTS */ +# define SBUFSIZ 2000 /* max size of symbol table for */ +# define MAXSTRING 255 /* max length of strings */ +# define GOVAL -1 /* semantic value for cmd names */ + +/* CHARACTER TYPES */ +# define ALPHA 1 +# define NUMBR 2 +# define OPATR 3 +# define PUNCT 4 +# define CNTRL 5 + +/* Modes for input from EQL front end */ +# define CVAR_I2 '\1' /* 2 byte integer */ +# define CVAR_F8 '\4' /* 8 byte floating number */ +# define CVAR_S '\3' /* string with null byte */ +# define CVAR_I4 '\6' /* 4 byte integer */ + +/* error number definitions */ +# define SYMERR 2500 /* syntactic error */ +# define STRTERM 2700 /* non term string */ +# define STRLONG 2701 /* string too long */ +# define BADOP 2702 /* can't find operator in table */ +# define NAMELONG 2703 /* name too long */ +# define SBUFOFLO 2704 /* over flow symbol table */ +# define COMMTERM 2705 /* non term comment */ +# define FCONSTERR 2707 /* float constant error */ +# define CNTRLCHR 2708 /* control char from EQL */ +# define NUMBUFOFLO 2709 /* buffer oflo in number.c */ + +/* KEYWORD and OPERATOR TABLE */ +struct optab /* key word/operator tables */ +{ + char *term; /* key word/operator body */ + short token; /* associated parser token */ + short opcode; /* associated parser opcode */ +}; + +/* SPECIAL TOKENS for scanner */ +struct special +{ + short sconst; + short bgncmnt; + short endcmnt; + short i2const; + short i4const; +# ifndef NO_F4 + short f4const; +# endif + short f8const; + short name; +}; + +/* last token struct */ +struct lastok +{ + short toktyp; + char *tok; + short tokop; +}; + +/* declarations */ +extern struct special Tokens; /* special tokens table */ +extern struct optab Optab[]; /* operator table */ +extern struct optab Keyword[]; /* keyword table */ +extern struct lastok Lastok; +extern int Lcase; /* UPPER->lower conversion flag */ +extern int Pars; /* flag for call getcvar or not */ +extern int Keyent; /* # of entries in the Keyword table */ +