
With the help of a set  of functions; CDBFAPI.DLL, it is possible to
make  any programs  to facilitate  the processing  of DBF  files. 
Of  course,  some cognizance  of  DBF  files  is necessary,  but  an
extensive knowledge is not required.


In several words: 
- At begin of DBF-file is located a header - 32 bytes.
  Further located  the  information  about fields - each field is
  allocated in 32 bytes, too.
  Usually, the description of fields is finished by symbol 0x0d.
- Then there are records of DBF file.

The first 32 bytes contains:
- Type of DBF-file (type of memo-fields)
- Date of last update
- Number of records in data file
- Length of header (an offset of a first record)
- Length of each record 

The fields has the following attributes:
- A name (up  to 10 symbols), a type, a length, an offset inside the
  record.

The majority of functions of CDBFAPI.DLL work with the structure
'struct DBF'. This structure contains much information.
The basic components of structure are:

struct DBF {
	[...]
	char	*filename;	        // the name of DBF-file
	char	*filename_memo;		// the name of a memo-file (DBT or FPT)
        char	*filename_hdr;  	// the name of header-file (HDR)
    
        struct	Header hdr;   		// the first 32 bytes of header
        struct	Field fld[2048]; 	// the description of fields
        char  	als[2048][32];   	// headers of fields
    
        int    	Fieldorder[2048];	// the order of  fields
    
        struct 	Options opt; 		// options
    
        unsigned short num_fld; 	// the number of fields
        [...] 	
        int	memo_field; 		// the current memo-field or -1, 
        				// if a memo-fields is not present
        [...] 	
        char	*record_block; 		// pointer to area of reading/writing
        char	*str; 			// pointer to area of the return of lines
        char	*memo_block; 		// pointer to memo-fields
        [...]
        char 	*copy_of_record; 	// copy of record
        [...]
};

In structure Options most important are:

Date format:
    int dt_type; 			// 0-as is, 1-dmy, 2-mdy, 3-ymd
Codepage:
    int charset; 			// 0-OEM, 1-Ansi
Codepage of the memo-fields:
    int memo_charset; 			// 0-OEM, 1-Ansi
A filter and a sorting:
    BOOL ignore_case; 			// 0-no, 1-ignore
    BOOL descending; 			// 0-false, 1=true


Basically, functions of the library do not require direct access to
other elements of structure.

As an example of using CDBFAPI.DLL, we will create a program for the
comparison of two DBF-files.
