
#define DBASE_EXT ".dbf"

//definition of Field type
#define TYPE_CHAR 'C'
#define TYPE_DATE 'D'
#define TYPE_FLOAT 'F'
#define TYPE_DECIMAL 'N'
#define TYPE_LOGICAL 'L'
#define TYPE_MEMO 'M'

//this struct holds information of .dbf file header excluding field information
#define SIZEOF_DBASEHEADER 32
struct DBaseHeader{
	BYTE Info;
	BYTE LastModified[3];
	INT RecordNum;
	WORD HeaderLength;//the unit is BYTE
	WORD RecordLength;//the unit is BYTE
	BYTE NoUse1[2] ; //
	BYTE TFlag; //
	BYTE CFlag; //
	BYTE NoUse2[12]; //
	BYTE Mdx;
	BYTE DriverID;
	BYTE NoUse3[2];
};

//this struct holds one field information
#define SIZEOF_DBASEFIELD 32
struct DBaseField{
	char FieldName[11];
	char FieldType;
	BYTE NoUse1[4];
	BYTE FieldLength;
	BYTE DecimalLength;
	BYTE NoUse2[2];
	BYTE WorkSpaceID;
	BYTE NoUse3[10];
	BYTE Mdx;
};

