// dbase.h - Definitions to gain access to DBase-files
// Written by Stefan Pfeiffer, DL1ELY, 940911
// Last modification: 950726
// (C) 1994 by Stefan Pfeiffer, DL1ELY

#ifndef DBASE_H

#define DBASE_H

#define REC_VALID    0x20
#define REC_DELETED  0x2A

#define FIELD_CHAR     'C'
#define FIELD_NUMBER   'N'
#define FIELD_LOGICAL  'L'
#define FIELD_DATE     'D'

#define FIELD_TERMINATOR  0x0D

typedef unsigned char byte;
typedef unsigned long ulong;
typedef unsigned int uint;

struct db_header
{
  byte version;  // 0x02 = DBase II, 0x03 = DBase III (0x83 = with memo)
  byte last_access[3];
  ulong rec_count;
  uint header_len;
  uint rec_len;
  byte reserved[20];
};

struct db_rec_def
{
  byte name[11];
  byte type;
  ulong address;
  byte len;
  byte decimals;
  byte reserved[14];
};

#endif
    
