2
* Copyright (c) 1991, 1992, 1993 Brad Eacker,
3
* (Music, Intuition, Software, and Computers)
8
* dbf header structure on disk (pc dbase III)
10
* Basic info taken from:
11
* "File Formats for Popular PC Software"
13
* (c) 1986 John Wiley & Sons, Inc.
27
/* So we can use O_BINARY on non-Win32 systems. */
28
#if !defined(O_BINARY) && !defined(WIN32)
33
char dbh_dbt; /* memo (dbt) file present */
34
char dbh_date[3]; /* last update YY, MM, DD */
35
char dbh_records[4]; /* number of records LE */
36
char dbh_hlen[2]; /* header length LE */
37
char dbh_rlen[2]; /* record length LE */
38
char dbh_res[20]; /* padding */
40
#define DBH_DATE_YEAR 0 /* byte offset for year in dbh_date */
41
#define DBH_DATE_MONTH 1
42
#define DBH_DATE_DAY 2
45
* field description on disk
48
#define DBF_NAMELEN 11
51
char dbf_name[DBF_NAMELEN]; /* name of field */
52
char dbf_type; /* type of field */
53
char dbf_fda[4]; /* something for dbase III */
54
char dbf_flen[2]; /* field length [and decimal if N] */
55
char dbf_res[14]; /* padding */
59
char db_fname[DBF_NAMELEN+1]; /* 0 terminated */
60
char db_type; /* type of field */
61
int db_flen; /* length of field */
62
int db_fdc; /* number of decimals in field */
64
char *db_format; /* format for printing %s etc */
65
int db_foffset; /* offset within record */
67
typedef struct db_field dbfield_t;
71
unsigned char db_dbt; /* dbt present */
72
char db_date[9]; /* date of last update in db format */
73
long db_records; /* number of records */
74
int db_hlen; /* header length */
75
int db_rlen; /* record length */
77
int db_nfields; /* number of fields */
78
dbfield_t *db_fields; /* field info */
79
char *db_name; /* name of dbf file */
80
int db_cur_rec; /* current record */
82
typedef struct db_head dbhead_t;
84
#define DBH_TYPE_NORMAL 0x03
85
#define DBH_TYPE_MEMO 0x83
87
#define VALID_RECORD ' '
88
#define DELETED_RECORD '*'