The Class "hf" - Hash File
==========================


hf(df& data, char* dir, char* name)
-----------------------------------
Opens the Hash File dir/name over the Data File data; if the Hash File does
not exist it is created.

~hf()
-----
Closes the Hash File.

int fetch (df& data, field* saf, field* res)
------------------------------------------------
saf is hashed to identify which pages of the Data File data may contain
records which match saf.  These pages are then searched and any records
matching saf are copied into res.  A pointer the the first free field of res
is returned.

int insert(df& data, field* rec)
--------------------------------
rec is hashed to identify the page of the Data File data in which it should
be stored.  rec is then written to this page if it is not already present,
and 1 is returned; otherwise 0 is returned.

int remove(df& data, field* saf)
--------------------------------
saf is hashed to identify in which pages of the Data File data any records
matching saf are stored.  Any such matching records are then removed from
data.  If at least one record is removed the result 1 is returned; otherwise
0 is returned.


Implementation
--------------
A Hash File is an extendible hashing file (with directory) which indexes
into a Data File.  For more information on extendible hashing consult :
	R.J. Enbody and H.C. Du
	Dynamic Hashing Schemes
	A.C.M. Computing Surveys, 20(2), June 1988, 85-114

A saf (a simple associative form) is essentially a record containing "wild
cards", where a wild card is simply a field whose tag is set to Any.  A
record, r, matches a saf, s, if r is identical to the s except for any
sub-records of r which match a wild card in s.  Examples of records which
match the saf :
	(Size,4) (Chr,'a') (Any,0) (Var,v)
include :
	(Size,4) (Chr,'a') (Chr,'b') (Var,v)
	(Size,6) (Chr,'a') (Size 3) (Chr,'b') (Int,4) (Var,v)
but not :
	(Size,4) (Chr,'b') (Chr,'b') (Var,v)
	(Size,6) (Chr,'a') (Var v) (Size 3) (Chr,'b') (Int,4)


Bugs and Comments
-----------------
Highly correlated data distributions will cause a rapid growth in the size
of this file, and since overflow chains are not supported performance will
quickly degrade.


Further Information
-------------------
field.h			//	The class Field
df.h			//	The class Data File
