home *** CD-ROM | disk | FTP | other *** search
- /***( ptmisc.h )*************************************************************
- * Pro-TREE Configuration Settings *
- *****************************************************************************
- * *
- * PRO-TREE v1.21 - Copyright (c) 1988, 1990 Vestronix Inc. *
- * *
- * Features: *
- * - Dynamic leveling *
- * - Free list for data file and each key in the index file *
- * - Single-user or Multi-user with appropriate index file locking *
- * - Single record locking on the data file *
- * *
- * Original : NIG 24-Feb-88, GEO 23-Mar-88, VVA Dec-88 (indexing functs) *
- * Changed : JZ Apr-89 *
- * Changed : BRC 22-Aug-90 (record packing and memo fields) *
- * *
- ****************************************************************************/
-
- /*
- ** Modifications
- **
- ** 22-Aug-90 BRC - record packing and memo fields
- ** 12-Feb-90 BRC - IOGEN'd version
- ** 4-Dec-89 BRC - multi-user, dynamic levels, free space reuse
- ** Apr-89 JZ - Rewrote the indexing functions for single user
- ** Dec-88 VvA - Wrote indexing functions for ASCII file manager
- ** 23-Mar-88 GEO - Changes ASCII file manager
- ** 24-Feb-88 NIG - Wrote ASCII file manager
- */
-
- #if !defined(H_BENCH)
- #include <bench.h>
- #endif
-
- /****************************************************************************
- * Machine Specific Definitions -- MUST BE CONFIGURED FOR OS AND CPU *
- *---------------------------------------------------------------------------*
- * Use PROTEST to help determine the correct settings for the following. *
- ****************************************************************************/
- #define NO_PT_MULTI_USER /* record locking is enabled if defined */
- #define SWAP_WORD8 /* pairs of bytes are swapped */
- #define SWAP_WORD16 /* pairs of 2-byte words are swapped */
- #define SWAP_WORD32 /* pairs of 4-byte long words are swapped */
- #define WORD8 char /* type for a one byte integer */
- #define WORD16 short /* type for a two byte integer */
- #define WORD32 long /* type for a four byte integer */
- #define FLOAT32 float /* type for a four byte IEEE fp number */
- #define FLOAT64 double /* type for an eight byte IEEE fp number */
-
-
- /****************************************************************************
- * Configuration Specific Settings -- SHOULD BE TUNED FOR INTENDED USAGE *
- *---------------------------------------------------------------------------*
- * Use PROTEST to determine help the correct settings for the following. *
- ****************************************************************************/
- #define PT_MAXELTS 50 /* RANGE: [2..1000] (50 is best) */
- #define PT_MAXSEGS 5 /* RANGE: [1..100] (5 is best) */
- #define PT_MAXLOCKS 0 /* RANGE: 0, [1..10] */
- #define PT_MAXLOCKTRYS 100 /* RANGE: -1, [1..10000] (-1 or >=100) */
- #define PT_FLUSH_LEVEL 50 /* RANGE: 0, [1..10000] (50 is best) */
-
-
- /****************************************************************************
- * Pro-TREE internal codes *
- *---------------------------------------------------------------------------*
- * WARNING: ANY CHANGES HERE WILL CAUSE Pro-TREE TO MALFUNCTION *
- ****************************************************************************/
- #define PT_VERSION_110 "110"
- #define PT_VERSION_120 "120"
- #define PT_VERSION_121 "121"
- #define PT_NAME_LEN 20
- #define PT_READ_LOCK 1
- #define PT_WRITE_LOCK -1
- #define PT_FILE_LOCK -2
- #define PT_NOPTR -1L /* error indicating no record offset */
- #define PT_DUPSEG PT_MAXSEGS
-
- #if !defined(IODATSEEK)
- #define IODATSEEK IOERROR
- #define IOIDXSEEK IOERROR
- #define IODATWRITE IOERROR
- #define IOIDXWRITE IOERROR
- #define IODATREAD IOERROR
- #define IOIDXREAD IOERROR
- #define IOOLDVER IOBADOPEN
- #define IONEWVER IOBADOPEN
- #define IODATOPEN IOBADOPEN
- #define IOIDXOPEN IOBADOPEN
- #define IOFLDDEF IOBADOPEN
- #define IOKEYDEF IOBADOPEN
- #define IOFLDPERM IOERROR
- #define IOIDXPERM IOBADOPEN
- #define IODATPERM IOBADOPEN
- #define IOFILLOCK IOBADOPEN
- #define IONOSERVER IOERROR
- #define IOCONFIG IOBADOPEN
- #define IOFTABLE IOBADOPEN
- #define IOILOCKED IOLOCKED
- #define IOINOLOCK IONOLOCK
- #endif
-
- #if !defined(NOARGS)
- #define NOARGS /*nothing*/
- #endif
-
- /* don't waste a call if there is no swapping */
- #if defined(SWAP_WORD8) && defined(SWAP_WORD16) && defined(SWAP_WORD32)
- #define PT_swapper(x,y) /*NO_SWAP*/
- #else
- extern PROTO (void PT_swapper, (char *, int)); /*SWAP*/
- #endif
-
- /* route calls PT_debug to errmsg if not in use */
- #if defined(PTDEBUG)
- extern PROTO (void CDECL PT_debug, (char * DOTS));
- #else
- #define PT_debug errmsg
- #endif
-
- extern PROTO (char *PT_stat, (int));
- extern PROTO (int PT_readnum, (int, char *, int));
- extern PROTO (int PT_writenum, (int, char *, int));
-