Category : C Source Code
Archive   : BTREEC.ZIP
Filename : ACCESS.H

 
Output of file : ACCESS.H contained in archive : BTREEC.ZIP
char * getrec (datafile * dfp, int recno, char * buff);
/*
* Get the recno record of the datafile *dfp and place the record
* where buff points to. Getrec returns this same pointer value.
*/
int putrec (datafile * dfp, int recno, char * buff);
/*
* Write the record pointed to by buff as record number recno
* to the datafile *dfp. Return the value 1 if successful.
*/
datafile * makefile (char * fname, int recsize);
/*
* Make a file, fname, to have record size equal to recsize.
*/
datafile * openfile (char *);
void closefile (datafile *);
int newrec (datafile * dfp);
/*
* Get a new record. Return the record number of this new record.
*/
int addrec (datafile * dfp, char * buff);
/*
* Add the data pointed to by buff as a new record to the
* datafile * dfp. Return the record number of this new record.
*/
void deleterec (datafile * dfp, int recno);
/*
* delete the data item with record number recno from the
* datafile *dfp. (Actually, mark as deleted. Space will be
* recovered for use when new records are added. Neither the
* data file nor the index files will be shortened in its life
* unless special routines are written to manipulate the files.)
*/
int usedrecs (datafile * dfp);
/*
* Return the number of active record of the datafile * dfp.
*/
void initindex (void);
/*
* initialize the stack for the index pages.
*/
void tapack (tapagerec * ppagrec);
void taunpack (tapagerec * ppagrec);
/*
* When writing a page to disk, we do a little packing to conserve
* disk space. Conversely, we must do a little unpacking when we
* read an index page from disk.
*/
indexfile * makeindex (char * fname, int keylength, int dupsallowed);
/*
* Make an indexfile named fname with key length keylength and
* duplicates will be allowed if dupsallowed is not zero.
* Return a pointer to the indexfile if successful, else NULL.
*/
indexfile * openindex (char * fname);
void closeindex (indexfile * fname);
void talast (int i);
/*
* talast makes the ith page on the pagerec stack the most
* recently accessed page. Used in paging algorithm to determine
* which page is to remain in ram (on the stack) and which is to
* written to storage.
*/

tapagerec * tagetpage (indexfile * dfp, int pageref);
/*
* Read a page from disk, if necessary, to the page stack. The record
* number of the page is pageref associated with the indexfile * dfp.
* Return a pointer to where the page is on the stack.
*/
tapagerec * tanewpage (indexfile * nfp);
/*
* Find space on the page stack and initialize a new page to be
* associated with the indexfile *nfp. Return a pointer pointing
* to the page record on the stack.
*/
void tareturnpage (tapage * pageptr);
/*
* delete the page pointed by the page pointer pageptr.
*/
void taxkey (char * key, int keylen);
/*
* Chop off the key if it is longer than keylen.
*/
int tacompkeys (char * key1, char * key2,
int datref1, int datref2, int dupsallowed);
/*
* Compare two keys. Return the strcmp() value if not equal.
* If equal then
* if dups are allowed
* return datref1 - datref2
* Otherwise
* return 0.
*/
void clearkey (indexfile * nfp);
/*
* initialize the search path to no current path for the indexfile *nfp.
*/

  3 Responses to “Category : C Source Code
Archive   : BTREEC.ZIP
Filename : ACCESS.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/