Category : C Source Code
Archive   : CDBF.ZIP
Filename : DBASE.DOC
Documentation for 'C' routines to access DBase III .dbf files
Soft-Sense
daniel lullo
1682 Valley Rd.
Millington, N.J. 07946
*/
Function : db_open(filnam, mode)
char *filnam; /* filename */
unsigned mode; /* access mode (ref dopen) */
Description : Open a DBase III file, allocate file information block,
header block, field descriptor block(s), and field buffers.
Returns : Pointer to the file information block if successful, otherwise
Null pointer.
Cautions : Call prior to using any other interface routines.
/*****************************************************************************/
Function : db_close(file)
DB_FILE *file; /* fib pointer */
Description : Close a DBase III file, free any buffers that were allocated,
and optionally update header.
Returns : None.
Cautions : If file->up_mode
/*****************************************************************************/
Function : db_seek(filnam, recnum)
DB_FILE *file; /* fib pointer */
unsigned long recnum; /* record number requested */
Description : Position the file character pointer to the requested record
in the file.
Returns : Integer value.
1 = successful.
0 = error in seek.
Cautions : Reference errno or _OSERR for more error information.
/*****************************************************************************/
Function : db_read(file, buffer, recnum, explode)
DB_FILE *file; /* fib pointer */
char buffer; /* I/O buffer */
unsigned long recnum; /* record number to read */
int explode; /* explode option */
Description : Read a specific record, optionally explode record into
individual field buffers. If explode option is used
file->del_byte will contain the record deletion status
byte.
Returns : Integer value.
1 = successful.
0 = record returned was marked for delete
file->del_byte contains the delete character.
-1 = error in seek.
-2 = number of bytes read was not correct record length.
Cautions : Reference errno or _OSERR for more error information.
File must have been opened for read access.
/*****************************************************************************/
Function : db_getnext(file, buffer, explode)
DB_FILE *file; /* fib pointer */
char *buffer; /* I/O buffer */
int explode; /* explode option */
Description : Read the next sequential record, optionally explode record into
individual field buffers. If explode option is used
file->del_byte will contain the record deletion status
byte.
Returns : Integer value.
1 = successful.
0 = record returned was marked for delete
file->del_byte contains the delete character.
-1 = error in seek.
-2 = number of bytes read was not correct record length.
Cautions : Reference errno or _OSERR for more error information.
File must have been opened for read access.
/*****************************************************************************/
Function : db_write(file, buffer, recnum, implode)
DB_FILE *file; /* fib pointer */
char *buffer; /* I/O buffer */
unsigned long recnum; /* record number to read */
int implode; /* implode option */
Description : Write a specific record, optionally implode record from
individual field buffers, or use data already in buffer.
If implode option is used, file->del_byte is used as the
record deletion status byte, this should be set to
for valid record or
Header record is written if file->up_mode = 0, otherwise
header is written only upon closing the file.
Returns : Integer value.
1 = successful.
-1 = error in seek.
-2 = number of bytes read was not correct record length.
-3 = error updating file header.
Cautions : Reference errno or _OSERR for more error information.
File must have been opened for write access.
/*****************************************************************************/
Function : db_append(file, buffer, implode)
DB_FILE *file; /* fib pointer */
char *buffer; /* I/O buffer */
int implode; /* implode option */
Description : Append a record at end of file, optionally implode record from
individual field buffers, or use data already in buffer.
If implode option is used, file->del_byte is used as the
record deletion status byte, this should be set to
for valid record or
Header record is written if file->up_mode = 0, otherwise
header is written only upon closing the file.
Returns : Integer value.
1 = successful.
-1 = error in seek.
-2 = number of bytes read was not correct record length.
-3 = error updating file header.
Cautions : Reference errno or _OSERR for more error information.
File must have been opened for write access.
/*****************************************************************************/
Function : db_explode(file, buffer)
DB_FILE *file; /* fib pointer */
char *buffer; /* I/O buffer */
Description : Explode data from the I/O record buffer into the corresponding
individual field buffers. These field buffers are null
terminated so they may be easier for the application to
work with.
Returns : None.
Cautions : file->del_byte will be set according to the record
deletion status.
/*****************************************************************************/
Function : db_implode(file, buffer)
DB_FILE *file; /* fib pointer */
char *buffer; /* I/O buffer */
Description : Implode data from the individual field buffers into the
I/O record buffer. The record deletion status byte is
set from file->del_byte.
Returns : None.
Cautions : file->del_byte should be set according to the record
deletion status desired.
/*****************************************************************************/
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/