home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 125.img / PRO-C4.ZIP / BENCH1.ZIP / HDR / IODEF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-28  |  5.2 KB  |  172 lines

  1. /* ==( hdr/iodef.h )== */
  2.  
  3. /* ----------------------------------------------- */
  4. /* Pro-C - Copyright (C) 1988, 1989 Vestronix Inc. */
  5. /* Modification to this source is not supported    */
  6. /* by Vestronix Inc.                               */
  7. /*            All Rights Reserved                  */
  8. /* ----------------------------------------------- */
  9.  
  10. /*  Definitions and declarations for the Pro-C General I/O Interface  */
  11.  
  12. /****************************************************************************/
  13. /*                           General definitions                            */
  14. /****************************************************************************/
  15.  
  16. #define  MAX_FILES        8                                  /* PRO-C limit */
  17. #define  MAX_FLDS       128
  18. #define  MAX_KEYS        64                                  /* PRO-C limit */
  19. #define  MAX_SEGS         5                                  /* PRO-C limit */
  20. #define  MAX_FLDLEN    1023                                  /* PRO-C limit */
  21. #define  MAX_RECLEN    2048                                  /* PRO-C limit */
  22. #define  FLDNAME_LEN     10
  23. #define  PATHNAME_LEN    50
  24. #define  FILENAME_LEN    15
  25. #define  UNUSED          -1            /* note: file descript of 0 is valid */
  26. #define  YES              1
  27. #define  NO               0
  28. #define  UNQ              0
  29. #define  DUP              1
  30. #define  WAIT             1
  31. #define  NOWAIT           0
  32. #define  NEXT             1
  33. #define  PREV             0
  34.  
  35. #define  INNULL      (int(*)())0
  36.  
  37. /*
  38.  * field info array will terminate with NULL fieldname
  39.  * NOTE this is called fldinfx, not fldinfo : this is to avoid conflicts
  40.  *      with existing header files during testing
  41. */
  42.  
  43. struct keyinfo                            /* definition for key information */
  44. {
  45.    int segcount;                           /* number of segments in the key */
  46.    int keytype;                             /* duplicate or unique key type */
  47.    int segstart[MAX_SEGS];              /* offset of field into data record */
  48.    int seglen[MAX_SEGS];
  49.    int fldindex[MAX_SEGS];       /* index into fldinfo array for this field */
  50. };
  51.  
  52. /*
  53.  * key info array will terminate with a value of -1 for segcount
  54. */
  55.  
  56.  
  57. /*
  58.  * Some of the things in fd_def are specific to individual file managers:
  59.  * since the array index (fd_sys) reflects the file sequence in all cases,
  60.  * parallel structure arrays could be defined in the individual modules to
  61.  * hold this information, rather than including it here.
  62. */
  63.  
  64. struct fldinfx      /* Field Information */
  65. {
  66.    char *fldname;
  67.    int fldtype;                                          /* field data type */
  68.    int fldlen;
  69.    int fldstart;                        /* offset of field into data record */
  70.    char *fldmask;
  71. };
  72.  
  73.  
  74. struct fd_def                         /* standard file definition structure */
  75. {
  76.    int fd_num;
  77.     int dbnum;
  78.    int cur_key;
  79.    int rec_len;
  80.    int fld_cnt;
  81.    int key_cnt;
  82.    int lockmode;
  83.    int openmode;      /* used for UPDATE or OUTPUT - not part of spec docmt */
  84.    int exact;                  /* indicates exact match (1) or GTE only (0) */
  85.    struct fldinfx *flds;
  86.    struct keyinfo *keys;
  87.    char filname[PATHNAME_LEN];
  88.    char active;                   /* 1 for active, 0 for not currently used */
  89.    char got_rec;
  90. };
  91.  
  92. #ifdef ANSI
  93. extern int (*Fntab[][25])(int, char *);
  94. #else
  95. extern int (*Fntab[][25])();
  96. #endif
  97.  
  98. extern struct fd_def fd[];
  99.  
  100. /****************************************************************************/
  101. /*                         Function Prototypes                              */
  102. /****************************************************************************/
  103.  
  104. # ifdef ANSI
  105. int appendrec(int, char *);
  106. int checkrec(int, char *, int);
  107. int close_file(int);
  108. int commit(int);
  109. int findkey(int, char *);
  110. int firstkey(int, char *);
  111. int init_file(char *, char *, char *, int);
  112. int io_error(int, int, char *, char *);
  113. int lastkey(int, char *);
  114. int lock_rec(int, char *);
  115. int login(char *, char *, int);
  116. int logoff(int);
  117. int nextrec(int, char *);
  118. int open_file(char *, int, struct keyinfo *, struct fldinfx *, int, int);
  119. int prevrec(int, char *);
  120. int removerec(int, char *);
  121. int rollback(int);
  122. int transact(int);
  123. int ulock_rec(int, char *);
  124. int updrec(int, char *);
  125. int extract_key(int, char *, char *);
  126. void selectinx(int, int, int, int);
  127. void assign_IO_AS(int);
  128. void assign_IO_BT(int);
  129. void assign_IO_CB(int);
  130. void assign_IO_CI(int);
  131. void assign_IO_CL(int);
  132. void assign_IO_CT(int);
  133. void assign_IO_DB(int);
  134. void assign_IO_OR(int);
  135. void assign_IO_PT(int);
  136. void assign_IO_PX(int);
  137. # else
  138. int appendrec();
  139. int checkrec();
  140. int close_file();
  141. int commit();
  142. int findkey();
  143. int firstkey();
  144. int init_file();
  145. int io_error();
  146. int lastkey();
  147. int lock_rec();
  148. int login();
  149. int logoff();
  150. int nextrec();
  151. int open_file();
  152. int prevrec();
  153. int removerec();
  154. int rollback();
  155. int transact();
  156. int ulock_rec();
  157. int updrec();
  158. int extract_key();
  159. void selectinx();
  160. void assign_IO_AS();
  161. void assign_IO_BT();
  162. void assign_IO_CB();
  163. void assign_IO_CI();
  164. void assign_IO_CL();
  165. void assign_IO_CT();
  166. void assign_IO_DB();
  167. void assign_IO_OR();
  168. void assign_IO_PT();
  169. void assign_IO_PX();
  170. # endif
  171.  
  172.