xBase 3 has 2 structs. The first is DB_HEADER and it has
This structure (struct) is used to describe the xBase file.xBase version. Whether there is a memo fields. Year, Month, and Day last modified. Number of records. Offset to first record. Each record length. And a reserved fields.
typedef struct {
unsigned int Ver:7; //xBase version. (2,3,4 for xBase)
unsigned int Memo:1; //If true there is a memo field.
unsigned int Year_m:8; //Year last modified.
unsigned int Month_m; //Month last modified.
unsigned int Day_m; //Day last modified.
long int Number_records; //Number of records.
short int R_offset; //Offset to first record.
short int R_length; //Each record length.
unsigned int Reserved[20]; //Do not use.
} DB_HEADER;
The secound decribes the column or field.
typedef struct {
char column_name[11] //Name of the column, upto 10 charters.
char char_type; //Not used by most xBase files.
//Used to determine the beginning of each column. (delete status first byte).
long res_field;
//Used to tell the format of the numbers in the column. (0 is integer, grater then 0 is a floating point).
unsigned char Col_length;
unsigned char Col_type; //What type of column this is.
char Reserved[14]; //Do not use.
} DB_COLUMN;
There are some defines we need to know too.
<HTML> <HEAD> <TITLE> HTML xBase 3 programming. </TITLE> </HEAD> <BODY> <CENTER>xBase 3 entree form.</CENTER> First Name <FORM METHOD=POST ACTION="http://127.0.0.1/cgi-bin/xBase_input.cgi"> <INPUT NAME="fname" TYPE="TEXT" SIZE=30> Last Name <INPUT NAME="lname" TYPE="TEXT" SIZE=30> Age <INPUT NAME="age" TYPE="TEXT" SIZE=4> <input type="submit" name="Send" VALUE="Run Script"> </FORM> </BODY> </HTML>