home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / PROCWRKB.ZIP / BENCH1.ZIP / HDR / PTMISC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-27  |  5.5 KB  |  123 lines

  1. /***( ptmisc.h )*************************************************************
  2. *                      Pro-TREE Configuration Settings                      *
  3. *****************************************************************************
  4. *                                                                           *
  5. *  PRO-TREE v1.21  -  Copyright (c) 1988, 1990 Vestronix Inc.               *
  6. *                                                                           *
  7. *  Features:                                                                *
  8. *     - Dynamic leveling                                                    *
  9. *     - Free list for data file and each key in the index file              *
  10. *     - Single-user or Multi-user with appropriate index file locking       *
  11. *     - Single record locking on the data file                              *
  12. *                                                                           *
  13. *  Original : NIG 24-Feb-88, GEO 23-Mar-88, VVA Dec-88 (indexing functs)    *
  14. *  Changed  : JZ Apr-89                                                     *
  15. *  Changed  : BRC 22-Aug-90 (record packing and memo fields)                *
  16. *                                                                           *
  17. ****************************************************************************/
  18.  
  19. /*
  20. **  Modifications
  21. **
  22. **  22-Aug-90  BRC - record packing and memo fields
  23. **  12-Feb-90  BRC - IOGEN'd version
  24. **   4-Dec-89  BRC - multi-user, dynamic levels, free space reuse
  25. **     Apr-89  JZ  - Rewrote the indexing functions for single user
  26. **     Dec-88  VvA - Wrote indexing functions for ASCII file manager
  27. **  23-Mar-88  GEO - Changes ASCII file manager
  28. **  24-Feb-88  NIG - Wrote ASCII file manager
  29. */
  30.  
  31. #if !defined(H_BENCH)
  32. #include <bench.h>
  33. #endif
  34.  
  35. /****************************************************************************
  36. *     Machine Specific Definitions -- MUST BE CONFIGURED FOR OS AND CPU     *
  37. *---------------------------------------------------------------------------*
  38. *   Use PROTEST to help determine the correct settings for the following.   *
  39. ****************************************************************************/
  40. #define NO_PT_MULTI_USER        /* record locking is enabled if defined    */
  41. #define    SWAP_WORD8           /* pairs of bytes are swapped              */
  42. #define    SWAP_WORD16          /* pairs of 2-byte words are swapped       */
  43. #define    SWAP_WORD32          /* pairs of 4-byte long words are swapped  */
  44. #define    WORD8    char        /* type for a one byte integer             */
  45. #define    WORD16   short       /* type for a two byte integer             */
  46. #define    WORD32   long        /* type for a four byte integer            */
  47. #define    FLOAT32  float       /* type for a four byte IEEE fp number     */
  48. #define    FLOAT64  double      /* type for an eight byte IEEE fp number   */
  49.  
  50.  
  51. /****************************************************************************
  52. *   Configuration Specific Settings -- SHOULD BE TUNED FOR INTENDED USAGE   *
  53. *---------------------------------------------------------------------------*
  54. *   Use PROTEST to determine help the correct settings for the following.   *
  55. ****************************************************************************/
  56. #define PT_MAXELTS    50    /* RANGE: [2..1000] (50 is best)           */
  57. #define PT_MAXSEGS    5    /* RANGE: [1..100] (5 is best)             */
  58. #define PT_MAXLOCKS    0    /* RANGE: 0, [1..10]                       */
  59. #define PT_MAXLOCKTRYS    100    /* RANGE: -1, [1..10000] (-1 or >=100)     */
  60. #define PT_FLUSH_LEVEL    50    /* RANGE: 0, [1..10000] (50 is best)       */
  61.  
  62.  
  63. /****************************************************************************
  64. *                          Pro-TREE internal codes                          *
  65. *---------------------------------------------------------------------------*
  66. *       WARNING: ANY CHANGES HERE WILL CAUSE Pro-TREE TO MALFUNCTION        *
  67. ****************************************************************************/
  68. #define PT_VERSION_110    "110"
  69. #define PT_VERSION_120    "120"
  70. #define PT_VERSION_121    "121"
  71. #define PT_NAME_LEN    20
  72. #define PT_READ_LOCK    1
  73. #define PT_WRITE_LOCK    -1
  74. #define PT_FILE_LOCK    -2
  75. #define PT_NOPTR    -1L   /* error indicating no record offset */
  76. #define PT_DUPSEG    PT_MAXSEGS
  77.  
  78. #if !defined(IODATSEEK)
  79. #define IODATSEEK    IOERROR
  80. #define IOIDXSEEK    IOERROR
  81. #define IODATWRITE    IOERROR
  82. #define IOIDXWRITE    IOERROR
  83. #define IODATREAD    IOERROR
  84. #define IOIDXREAD    IOERROR
  85. #define IOOLDVER    IOBADOPEN
  86. #define IONEWVER    IOBADOPEN
  87. #define IODATOPEN    IOBADOPEN
  88. #define IOIDXOPEN    IOBADOPEN
  89. #define IOFLDDEF    IOBADOPEN
  90. #define IOKEYDEF    IOBADOPEN
  91. #define IOFLDPERM    IOERROR
  92. #define IOIDXPERM    IOBADOPEN
  93. #define IODATPERM    IOBADOPEN
  94. #define IOFILLOCK    IOBADOPEN
  95. #define IONOSERVER    IOERROR
  96. #define IOCONFIG    IOBADOPEN
  97. #define IOFTABLE    IOBADOPEN
  98. #define IOILOCKED    IOLOCKED
  99. #define IOINOLOCK    IONOLOCK
  100. #endif
  101.  
  102. #if !defined(NOARGS)
  103. #define NOARGS /*nothing*/
  104. #endif
  105.  
  106. /* don't waste a call if there is no swapping */
  107. #if defined(SWAP_WORD8) && defined(SWAP_WORD16) && defined(SWAP_WORD32)
  108. #define PT_swapper(x,y) /*NO_SWAP*/
  109. #else
  110. extern PROTO (void PT_swapper, (char *, int)); /*SWAP*/
  111. #endif
  112.  
  113. /* route calls PT_debug to errmsg if not in use */
  114. #if defined(PTDEBUG)
  115. extern PROTO (void CDECL PT_debug, (char * DOTS));
  116. #else
  117. #define PT_debug errmsg
  118. #endif
  119.  
  120. extern PROTO (char *PT_stat, (int));
  121. extern PROTO (int PT_readnum, (int, char *, int));
  122. extern PROTO (int PT_writenum, (int, char *, int));
  123.