#ifndef _DATABASE_H
#define _DATABASE_H

#ifndef _ANSI_H
#include <ansi.h>
#endif

/* Field list structure for fsd_excld, fsd_incld */
struct fld_list {
   short int fld_ptr;
   char fld_dyn;
   char fld_typ;
   short int fld_len;
   short int fld_resv;
};

/* Parameter definition usable with various routines */
union fsd_parameter {
   struct QLSTR type0;
   short int type1;
   long int type2;
   struct QLFLOAT type3;
};
typedef union fsd_parameter fsd___p;

extern long _dberr, _database;

int   fsd_addf     _PROTOTYPE((long *, int, int, int));
short fsd_appn     _PROTOTYPE((long));
long  fsd_close    _PROTOTYPE((long));
char  fsd_comp     _PROTOTYPE((long, int, void *, void *));
int   fsd_copy     _PROTOTYPE((long, long));
long  fsd_crt      _PROTOTYPE((long, int, short *));
short fsd_curr     _PROTOTYPE((long));
void *fsd_dbaddr   _PROTOTYPE((long));
short fsd_del      _PROTOTYPE((long));
short fsd_excld    _PROTOTYPE((long, int(*)(), void *));
long  fsd_expt     _PROTOTYPE((long, long, void *));
short fsd_find     _PROTOTYPE((long, void *));
short fsd_find_c   _PROTOTYPE((long, void *));
short fsd_fllen    _PROTOTYPE((long, int));
short fsd_flname   _PROTOTYPE((long, int, int, char *));
short fsd_flnfind  _PROTOTYPE((long, char *));
short fsd_flnum    _PROTOTYPE((long));
short fsd_fltyp    _PROTOTYPE((long, int));
short fsd_get      _PROTOTYPE((long, int, int, void *));
long  fsd_impt     _PROTOTYPE((long, long, short *));
short fsd_incld    _PROTOTYPE((long, int(*)(), void *));
short fsd_load_names _PROTOTYPE((long, int));
short fsd_locate   _PROTOTYPE((long, void *, void *, void *, void *));
short fsd_locate_c _PROTOTYPE((long, void *, void *, void *, void *));
long  fsd_open     _PROTOTYPE((long));
long  fsd_ordr     _PROTOTYPE((long, int, short *));
short fsd_posa     _PROTOTYPE((long, int));
short fsd_posr     _PROTOTYPE((long, int));
short fsd_put      _PROTOTYPE((long, int, int, void *));
short fsd_puts     _PROTOTYPE((long, int, char *));
short fsd_rcnt     _PROTOTYPE((long));
int   fsd_remf     _PROTOTYPE((long *, int));
short fsd_remove_names _PROTOTYPE((long));
long  fsd_res      _PROTOTYPE((long));
short fsd_save_names _PROTOTYPE((long));
void  fsd_scptr    _PROTOTYPE((long, char *));
short fsd_stname   _PROTOTYPE((long, int, char *));
short fsd_srch     _PROTOTYPE((long, int(*)(), void *));
short fsd_srch_c   _PROTOTYPE((long, int(*)(), void *));
short fsd_sf_add   _PROTOTYPE((long, int, int, int));
short fsd_sf_get   _PROTOTYPE((long, int, int *, int, char *));
short fsd_sf_getc  _PROTOTYPE((long, int, int *, int, char *));
short fsd_sf_getn  _PROTOTYPE((long, int, int *, int, char *));
short fsd_sf_num   _PROTOTYPE((long, int));
short fsd_sf_put   _PROTOTYPE((long, int, int, int, char *));
short fsd_sf_puts  _PROTOTYPE((long, int, int, char *));
short fsd_sf_putc  _PROTOTYPE((long, int, int, int, char *));
short fsd_sf_putcs _PROTOTYPE((long, int, int, char *));
short fsd_sf_rem   _PROTOTYPE((long, int, int, int));
short fsd_sf_snum  _PROTOTYPE((long, int, int));
long  fsd_unordr   _PROTOTYPE((long));
short fsd_updt     _PROTOTYPE((long));
short fsd_xtrl     _PROTOTYPE((long, int, int, char *));
long  fsd_xtrs     _PROTOTYPE((long, char *));

/*  Srch / incld / excld compare function:
   int function(long, void *, struct fld_list *, void *);
*/
#endif
