home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progc / itcoct90.arj / DBASE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-07  |  1.6 KB  |  45 lines

  1. /****************************************************************
  2. * DBASE.H - dBASE file I/O routine prototypes &    typedefs ...    *
  3. *                                                                *
  4. * 900514 MCMason - written in MSC 5.1                            *
  5. ****************************************************************/
  6.  
  7. #define TRUE    (1==1)
  8. #define FALSE    (!TRUE)
  9.  
  10. struct _dbfFLD
  11.     {
  12.     char    Name[12];        /* Field name                        */
  13.     char    Type;            /* Field type                        */
  14.     int        Length;            /* Field length                        */
  15.     int        Dec;            /* location of decimal point        */
  16.     };
  17. typedef struct _dbfFLD dbfFLD;
  18.  
  19. struct _dbfFILE
  20.     {
  21.     int        Version;        /* version of dBASE file (3)        */
  22.     char    update[3];        /* last date the file was updated    */
  23.     long    NumRex;            /* number of records in the file    */
  24.     int        HdrLen;            /* length of the dBASE Header        */
  25.     int        RecLen;            /* length of each record            */
  26.     int        NumFlds;        /* number of fields in each record    */
  27.     long    FileSize;        /* number of bytes in the file        */
  28.     FILE    *file;            /* File pointer for the dBASE file    */
  29.     dbfFLD    (*fld)[];        /* pointer to field data array        */
  30.     int        Modified;        /* File modified flag                */
  31.     };
  32. typedef struct _dbfFILE *dbfFILE;
  33.  
  34. extern dbfFILE dbfOpen(char const *fname);
  35. extern int dbfClose(dbfFILE dbf);
  36. extern void dbfDspHdr(dbfFILE hdr, FILE *out);
  37. extern void dbfDispStru(dbfFILE hdr, FILE *out);
  38. extern int dbfReadRec(dbfFILE hdr,long Rec,char *b);
  39. extern void dbfPrintRec(dbfFILE hdr,FILE *out,long Rec,char *b);
  40. extern void dbfList(dbfFILE d, FILE *out);
  41. extern int dbfCreate(dbfFILE hdr, char *name);
  42. extern dbfFILE dbfInputStr(char *name);
  43. extern int dbfWriteRec(dbfFILE hdr,long Rec,char *b);
  44. extern long dbfAllocRec(dbfFILE hdr);
  45.