The Class "df" - Data File
==========================


df(char* dname, char* fname)
----------------------------
Loads the Data File stored in dname/fname; if the Data File does not exist
it is created.

~df()
-----
Closes the Data File.

field* fetch(int pno, field *rec, field *res)
----------------------------------------------
Copies into res any records from page pno which match rec.  It is assumed
that res is large enough to contain all such retrieved records.  A pointer
to the first free field of res is returned.

int insert(int pno, field *rec)
-------------------------------
Inserts into page pno the record rec.  There is no check to ensure that rec
is not already present in the page.  If the insertion succeeds then 1 is
returned; otherwise 0 is returned.

int remove(int pno, field *saf)
-------------------------------
Removes from page pno any records which match saf.  If at least one record
was removed then 1 is returned; otherwise 0 is returned.

int alloc(int info)
-------------------
Allocates a free page, sets the local information of the page to info, and
returns the page number.

int ginfo(int pno)
------------------
Returns the local information of page pno.

int pinfo(int pno, int info)
----------------------------
Sets the local information of page pno to info.


Implementation
--------------
A Data File comprises a number of pages, each containing a number of fields
(determined by the constant DFDataSize), together with a single integer for
other (user-defined) information.  New pages can be allocated, although once
allocated a page cannot be freed.  Records can be stored in, removed from
and fetched from designated pages.  A record is an array of fields, and is
defined as follows :
	(1) a field whose tag is not Size is a record; and
	(2) a field whose tag is Size and whose value is ct is a record if
	    the (ct-1) following fields are records;
Some examples of records follow :
	(Chr,'a')
	(Size,4) (Chr,'a') (Int,3) (Var,v)
	(Size,6) (Chr,'a') (Size,4) (Chr,'a') (Int,3) (Var,v)


Bugs and Comments
-----------------
There should be a provision to "return" pages to the page pool.


Further Information
-------------------
field.h			//	The class Field
