home *** CD-ROM | disk | FTP | other *** search
- /* ==( hdr/iodef.h )== */
-
- /* ----------------------------------------------- */
- /* Pro-C - Copyright (C) 1988, 1989 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
-
- /* Definitions and declarations for the Pro-C General I/O Interface */
-
- /****************************************************************************/
- /* General definitions */
- /****************************************************************************/
-
- #define MAX_FILES 8 /* PRO-C limit */
- #define MAX_FLDS 128
- #define MAX_KEYS 64 /* PRO-C limit */
- #define MAX_SEGS 5 /* PRO-C limit */
- #define MAX_FLDLEN 1023 /* PRO-C limit */
- #define MAX_RECLEN 2048 /* PRO-C limit */
- #define FLDNAME_LEN 10
- #define PATHNAME_LEN 50
- #define FILENAME_LEN 15
- #define UNUSED -1 /* note: file descript of 0 is valid */
- #define YES 1
- #define NO 0
- #define UNQ 0
- #define DUP 1
- #define WAIT 1
- #define NOWAIT 0
- #define NEXT 1
- #define PREV 0
-
- #define INNULL (int(*)())0
-
- /*
- * field info array will terminate with NULL fieldname
- * NOTE this is called fldinfx, not fldinfo : this is to avoid conflicts
- * with existing header files during testing
- */
-
- struct keyinfo /* definition for key information */
- {
- int segcount; /* number of segments in the key */
- int keytype; /* duplicate or unique key type */
- int segstart[MAX_SEGS]; /* offset of field into data record */
- int seglen[MAX_SEGS];
- int fldindex[MAX_SEGS]; /* index into fldinfo array for this field */
- };
-
- /*
- * key info array will terminate with a value of -1 for segcount
- */
-
-
- /*
- * Some of the things in fd_def are specific to individual file managers:
- * since the array index (fd_sys) reflects the file sequence in all cases,
- * parallel structure arrays could be defined in the individual modules to
- * hold this information, rather than including it here.
- */
-
- struct fldinfx /* Field Information */
- {
- char *fldname;
- int fldtype; /* field data type */
- int fldlen;
- int fldstart; /* offset of field into data record */
- char *fldmask;
- };
-
-
- struct fd_def /* standard file definition structure */
- {
- int fd_num;
- int dbnum;
- int cur_key;
- int rec_len;
- int fld_cnt;
- int key_cnt;
- int lockmode;
- int openmode; /* used for UPDATE or OUTPUT - not part of spec docmt */
- int exact; /* indicates exact match (1) or GTE only (0) */
- struct fldinfx *flds;
- struct keyinfo *keys;
- char filname[PATHNAME_LEN];
- char active; /* 1 for active, 0 for not currently used */
- char got_rec;
- };
-
- #ifdef ANSI
- extern int (*Fntab[][25])(int, char *);
- #else
- extern int (*Fntab[][25])();
- #endif
-
- extern struct fd_def fd[];
-
- /****************************************************************************/
- /* Function Prototypes */
- /****************************************************************************/
-
- # ifdef ANSI
- int appendrec(int, char *);
- int checkrec(int, char *, int);
- int close_file(int);
- int commit(int);
- int findkey(int, char *);
- int firstkey(int, char *);
- int init_file(char *, char *, char *, int);
- int io_error(int, int, char *, char *);
- int lastkey(int, char *);
- int lock_rec(int, char *);
- int login(char *, char *, int);
- int logoff(int);
- int nextrec(int, char *);
- int open_file(char *, int, struct keyinfo *, struct fldinfx *, int, int);
- int prevrec(int, char *);
- int removerec(int, char *);
- int rollback(int);
- int transact(int);
- int ulock_rec(int, char *);
- int updrec(int, char *);
- int extract_key(int, char *, char *);
- void selectinx(int, int, int, int);
- void assign_IO_AS(int);
- void assign_IO_BT(int);
- void assign_IO_CB(int);
- void assign_IO_CI(int);
- void assign_IO_CL(int);
- void assign_IO_CT(int);
- void assign_IO_DB(int);
- void assign_IO_OR(int);
- void assign_IO_PT(int);
- void assign_IO_PX(int);
- # else
- int appendrec();
- int checkrec();
- int close_file();
- int commit();
- int findkey();
- int firstkey();
- int init_file();
- int io_error();
- int lastkey();
- int lock_rec();
- int login();
- int logoff();
- int nextrec();
- int open_file();
- int prevrec();
- int removerec();
- int rollback();
- int transact();
- int ulock_rec();
- int updrec();
- int extract_key();
- void selectinx();
- void assign_IO_AS();
- void assign_IO_BT();
- void assign_IO_CB();
- void assign_IO_CI();
- void assign_IO_CL();
- void assign_IO_CT();
- void assign_IO_DB();
- void assign_IO_OR();
- void assign_IO_PT();
- void assign_IO_PX();
- # endif
-
-