home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / PROCINST.ZIP / HELP.ZIP / IODEF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-07  |  4.9 KB  |  135 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. /*
  39.  * key info array will terminate with a value of -1 for segcount
  40. */
  41.  
  42. struct keyinfo                            /* definition for key information */
  43. {
  44.    int segcount;                           /* number of segments in the key */
  45.    int keytype;                             /* duplicate or unique key type */
  46.    int segstart[MAX_SEGS];              /* offset of field into data record */
  47.    int seglen[MAX_SEGS];
  48.    int fldindex[MAX_SEGS];       /* index into fldinfo array for this field */
  49. };
  50.  
  51.  
  52. /*
  53.  * field info array will terminate with NULL fieldname
  54.  * NOTE this is called fldinfx, not fldinfo : this is to avoid conflicts
  55.  *      with existing header files during testing
  56. */
  57.  
  58. struct fldinfx      /* Field Information */
  59. {
  60.    char *fldname;
  61.    int fldtype;                                          /* field data type */
  62.    int fldlen;
  63.    int fldstart;                        /* offset of field into data record */
  64.    char *fldmask;
  65. };
  66.  
  67.  
  68. /*
  69.  * Some of the things in fd_def are specific to individual file managers:
  70.  * since the array index (fd_sys) reflects the file sequence in all cases,
  71.  * parallel structure arrays could be defined in the individual modules to
  72.  * hold this information, rather than including it here.
  73. */
  74.  
  75. struct fd_def                         /* standard file definition structure */
  76. {
  77.    int fd_num;
  78.     int dbnum;
  79.    int cur_key;
  80.    int rec_len;
  81.    int fld_cnt;
  82.    int key_cnt;
  83.    int lockmode;
  84.    int openmode;      /* used for UPDATE or OUTPUT - not part of spec docmt */
  85.    int exact;                  /* indicates exact match (1) or GTE only (0) */
  86.    struct fldinfx *flds;
  87.    struct keyinfo *keys;
  88.    char filname[PATHNAME_LEN];
  89.    char active;                   /* 1 for active, 0 for not currently used */
  90.    char got_rec;
  91. };
  92.  
  93. extern PROTO (int (*Fntab[][25]), (int, char *));
  94.  
  95. extern struct fd_def fd[];
  96.  
  97. /****************************************************************************/
  98. /*                         Function Prototypes                              */
  99. /****************************************************************************/
  100.  
  101. PROTO (int appendrec, (int, char *));
  102. PROTO (int checkrec, (int, char *, int));
  103. PROTO (int close_file, (int));
  104. PROTO (int commit, (int));
  105. PROTO (int findkey, (int, char *));
  106. PROTO (int firstkey, (int, char *));
  107. PROTO (int init_file, (char *, char *, char *, int));
  108. PROTO (int io_error, (int, int, char *, char *));
  109. PROTO (int lastkey, (int, char *));
  110. PROTO (int lock_rec, (int, char *));
  111. PROTO (int login, (char *, char *, int));
  112. PROTO (int logoff, (int));
  113. PROTO (int nextrec, (int, char *));
  114. PROTO (int open_file, (char *, int, struct keyinfo *, struct fldinfx *, int, int));
  115. PROTO (int prevrec, (int, char *));
  116. PROTO (int removerec, (int, char *));
  117. PROTO (int rollback, (int));
  118. PROTO (int transact, (int));
  119. PROTO (int ulock_rec, (int, char *));
  120. PROTO (int updrec, (int, char *));
  121. PROTO (int extract_key, (int, char *, char *));
  122. PROTO (void selectinx, (int, int, int, int));
  123. PROTO (void assign_IO_AS, (int));
  124. PROTO (void assign_IO_BT, (int));
  125. PROTO (void assign_IO_CB, (int));
  126. PROTO (void assign_IO_CI, (int));
  127. PROTO (void assign_IO_CL, (int));
  128. PROTO (void assign_IO_CT, (int));
  129. PROTO (void assign_IO_DB, (int));
  130. PROTO (void assign_IO_IF, (int));
  131. PROTO (void assign_IO_OR, (int));
  132. PROTO (void assign_IO_PT, (int));
  133. PROTO (void assign_IO_PX, (int));
  134.  
  135.