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
-
-
- /*
- * key info array will terminate with a value of -1 for segcount
- */
-
- 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 */
- };
-
-
- /*
- * 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 fldinfx /* Field Information */
- {
- char *fldname;
- int fldtype; /* field data type */
- int fldlen;
- int fldstart; /* offset of field into data record */
- char *fldmask;
- };
-
-
- /*
- * 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 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;
- };
-
- extern PROTO (int (*Fntab[][25]), (int, char *));
-
- extern struct fd_def fd[];
-
- /****************************************************************************/
- /* Function Prototypes */
- /****************************************************************************/
-
- PROTO (int appendrec, (int, char *));
- PROTO (int checkrec, (int, char *, int));
- PROTO (int close_file, (int));
- PROTO (int commit, (int));
- PROTO (int findkey, (int, char *));
- PROTO (int firstkey, (int, char *));
- PROTO (int init_file, (char *, char *, char *, int));
- PROTO (int io_error, (int, int, char *, char *));
- PROTO (int lastkey, (int, char *));
- PROTO (int lock_rec, (int, char *));
- PROTO (int login, (char *, char *, int));
- PROTO (int logoff, (int));
- PROTO (int nextrec, (int, char *));
- PROTO (int open_file, (char *, int, struct keyinfo *, struct fldinfx *, int, int));
- PROTO (int prevrec, (int, char *));
- PROTO (int removerec, (int, char *));
- PROTO (int rollback, (int));
- PROTO (int transact, (int));
- PROTO (int ulock_rec, (int, char *));
- PROTO (int updrec, (int, char *));
- PROTO (int extract_key, (int, char *, char *));
- PROTO (void selectinx, (int, int, int, int));
- PROTO (void assign_IO_AS, (int));
- PROTO (void assign_IO_BT, (int));
- PROTO (void assign_IO_CB, (int));
- PROTO (void assign_IO_CI, (int));
- PROTO (void assign_IO_CL, (int));
- PROTO (void assign_IO_CT, (int));
- PROTO (void assign_IO_DB, (int));
- PROTO (void assign_IO_IF, (int));
- PROTO (void assign_IO_OR, (int));
- PROTO (void assign_IO_PT, (int));
- PROTO (void assign_IO_PX, (int));
-
-