The Class db - DataBase
-----------------------

db(char* dir)
-------------
Opens the database which is stored in the directory dir; the database is
created if it does not exist.  The directory is assumed to exist, and
results will be unpredictable if it does not.

~db()
-----
The database is closed.

int fetch(char* rel, field* saf, field* res)
------------------------------------------
Fetches from the relation rel any records which match saf.  The records are
copied into res, and a pointer to the first free field in res is returned.


int insert(char* rel, field* rec)
-------------------------------
Inserts rec into the relation rel.  If the insertion succeeds 1 is returned;
otherwise 0 is returned.

int remove(char* rel, field* saf)
-------------------------------
Removes any records matching saf from the relation rel.  If at least one
record is deleted 1 is returned; otherwise 0 is returned.


Implementation
--------------
All tuples of all relations are stored in a Data File.  For each relation a
Hash File is created which indexes into the Data File.  Because Hash Files
are main-memory resident, only a limited number (defined using the constant
FileCount) can be open simultaneously, and these are held in a cache which
is re-used on a cyclical basis.


Bugs and Comments
-----------------
Simultaneous access to more than FileCount relations will result in poor
performance.

An example of the use of a DataBase can be found in the file Example.c.


Further Information
-------------------

field.h		//	The class Field
tc.h		//	The class Token Converter
df.h		//	The class Data File
hf.h		//	The class Hash File
