home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / OOFILE / Buildable, limited OOFILE / c-tree headers / ctopt2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-12  |  19.8 KB  |  898 lines  |  [TEXT/CWIE]

  1. /*
  2.  *    This program is the CONFIDENTIAL and PROPRIETARY property 
  3.  *    of FairCom(R) Corporation. Any unauthorized use, reproduction or
  4.  *    transfer of this computer program is strictly prohibited.
  5.  *
  6.  *      Copyright (c) 1984 - 1994 FairCom Corporation.
  7.  *    This is an unpublished work, and is subject to limited distribution and
  8.  *    restricted disclosure only. ALL RIGHTS RESERVED.
  9.  *
  10.  *            RESTRICTED RIGHTS LEGEND
  11.  *    Use, duplication, or disclosure by the Government is subject to
  12.  *    restrictions set forth in subparagraph (c)(1)(ii) of the Rights in
  13.  *     Technical Data and Computer Software clause at DFARS 252.227-7013.
  14.  *    FairCom Corporation, 4006 West Broadway, Columbia, MO 65203.
  15.  *
  16.  *    c-tree PLUS(tm)    Version 6.4
  17.  *            Release B
  18.  *            October 19, 1994
  19.  */
  20.  
  21. #ifndef ctOPT2H
  22. #define ctOPT2H
  23.  
  24. #ifdef VINES
  25. /* added for the definintion of size_t */
  26. #include <sys/types.h>
  27. #endif
  28.  
  29. /* ***                Capacity Constants                *** */
  30.  
  31. #define BFRSIZ        2048    /* default data file buffer size    */
  32. #define DATABUFS    100    /* default # of data buffers        */
  33. #define MAXLEN        255    /* maximum key length            */
  34. #define MAX_NAME    255    /* maximum file name length        */
  35. #define RESNAME_LEN    64    /* resource logical name limit        */
  36. #ifndef MAXVFIL
  37. #define    MAXVFIL        500    /* maximum virtual files open at same time */
  38. #endif
  39.  
  40. /* ***            Variable Length Key & Field Constants        *** */
  41.  
  42. #define PADDING        ' '    /* trailing key padding            */
  43. #define FIELD_DELIM    '\0'    /* var length field delimiter        */
  44.  
  45. /* ***            SUPERFILE NAME DELIMITER            *** */
  46. #define CTSUPSEP    '!'
  47.  
  48. /* ***               MIRROR NAME DELIMITER            *** */
  49. #define ctMIRROR_SEPchr    '|'
  50. #define ctMIRROR_SEPstr    "|"
  51.  
  52. /*
  53.  * The following capacity constants are used only by the ISAM routines and
  54.  * the REBUILD routines.
  55.  */
  56.  
  57. #ifdef ctMAXFIL
  58. #define MAXFIL        ctMAXFIL
  59. #else
  60. /* maximum number of files (non-server) - may be overrided in ctoptn.h     */
  61. #define MAXFIL        50    
  62. #endif
  63. #ifdef MULTITRD
  64. #define MAX_DAT_KEY    ctmaxdatkey
  65. #define ctMAX_DAT_KEY    32
  66. #else
  67. #define MAX_DAT_KEY    32    /* maximum number of indices per data   */
  68.                 /* file                    */
  69. #endif
  70.  
  71. /* ************* ************* ************* ************ ************* */
  72. #define ctHLflavor    1
  73. #define ctLHflavor    2
  74.  
  75. #define ctBYTEORDER    0
  76. #define ctALIGNMENT    1
  77. #define ctPNTRSIZE    2
  78.  
  79. #ifdef ctMIRROR
  80. #ifdef ctMIRRORsave
  81. #define ctsave        mbsave
  82. #endif
  83. #else
  84. #define ctopen        mbopen
  85. #define ctsave        mbsave
  86. #endif
  87.  
  88. #ifdef MULTITRD
  89.  
  90. #ifndef CTBOUND
  91. #define ctSRVR
  92. #endif
  93.  
  94. #ifndef ctSEMBLK
  95. #define ctblkrqs    ctsemrqs
  96. #define ctblkclr    ctsemclr
  97. #define ctblkwat    ctsemwat
  98. #endif
  99.  
  100. #endif
  101.  
  102. #ifndef CTBOUND
  103. #ifndef ctSRVR
  104.  
  105. #define ctCLIENT
  106. #ifndef ctLOCFH
  107. #define ctLOCFH
  108. #endif
  109.  
  110. #endif
  111. #endif
  112.  
  113. #ifdef ctSRVR
  114.  
  115. #define MAX_KEY_SEG    ctmaxkeyseg
  116. #ifndef ctMAX_KEY_SEG
  117. #define ctMAX_KEY_SEG    12
  118. #endif
  119.  
  120. #else /* ctSRVR */
  121.  
  122. #ifdef ctMAX_KEY_SEG
  123. #define MAX_KEY_SEG    ctMAX_KEY_SEG
  124. #else
  125. #define MAX_KEY_SEG    12    /* maximum number of segments per key    */
  126. #endif
  127.  
  128. #endif /* ctSRVR */
  129.  
  130. /* ******************************************************************** */
  131. /* ************************     S T O P    **************************** */
  132. /* ***     D O   N O T   C H A N G E   T H E    F O L L O W I N G   *** */
  133. /* ***   W I T H O U T   C H E C K I N G   W I T H   F A I R C O M  *** */
  134. /* ******************************************************************** */
  135.  
  136. #ifdef ctMIRROR
  137. #ifdef FPUTFGET
  138.    *** Mirrored files are not supported under FPUTFGET ***
  139. #endif
  140. #endif
  141.  
  142. #ifdef MSWINDOWS
  143. #ifndef WINNT
  144. #ifndef MULTITRD
  145. #ifndef ctNOGLOBALS
  146. #define ctNOGLOBALS
  147. #endif
  148. #endif
  149. #endif
  150. #endif
  151.  
  152. #ifdef ctLOCLIB
  153. #ifndef ctNOGLOBALS
  154. #define ctNOGLOBALS
  155. #endif
  156. #ifndef ctCONV
  157. #define ctCONV
  158. #endif
  159. #endif
  160.  
  161. #ifndef ctMEMCHRtxt
  162. #define ctMEMCHRtxt    pVOID
  163. #endif
  164.  
  165. #ifndef SIZEOF
  166. #define SIZEOF(X) ((UINT)sizeof(X))
  167. #endif
  168.  
  169. #ifndef ctSIZET
  170. #define ctSIZET    size_t
  171. #endif
  172.  
  173. #ifndef ctALLOC
  174. #define ct_alloc(n,s)    calloc(((ctSIZET) (n)),((ctSIZET)(s)))
  175. #define ctafree(p)    free(p)
  176. #endif
  177.  
  178. #ifndef ctVDECL
  179. #define ctVDECL ctDECL
  180. #endif
  181.  
  182. #ifdef ctCONV
  183. #define PARM2 ,((COUNT) 0)
  184. #define PARM3 ,((pVOID)NULL)
  185. #define PARM4 ,((pLONG)NULL)
  186. #define PARM5 ,((pVOID)NULL)
  187. #define PARM6 ,((pVRLEN)NULL)
  188. #define PARM7 ,((COUNT)0)
  189. #else
  190. #define ctreeCONV
  191. #define ctCONV
  192. #endif
  193.  
  194. #define ctMAXUSERS    200
  195. #define ADMUSERS    4
  196. #define MAXCOMMP    10
  197. #define MXU2        (ctMAXUSERS + ADMUSERS + MAXCOMMP + 1)
  198. #ifndef MAXAPPS
  199. #define MAXAPPS        (ctMAXUSERS + 1)
  200. #endif
  201.  
  202. #define    ITIMretry    10
  203.  
  204. #define TRD_SQL        0x0001
  205. #define TRD_COMMP    0x0002
  206. #define TRD_SBLD    0x0004
  207. #define TRD_ISAM    0x0008
  208. #define TRD_DUMP    0x0010
  209. #define TRD_ADMIN    0x0020
  210. #define TRD_SMON    0x0040
  211. /* 0x0080 and 0x0100 and 0x0200 reserved for 3 additional monitors */
  212. #define TRD_LOGON    0x0400
  213.  
  214. #define USE_DEFAULT    (-2L)
  215. #define SUSE_DEFAULT    (-2)
  216. #define UDLK_TRN    (-3)
  217.  
  218. #define CLN_CHKACT    1
  219. #define CLN_CHKABT    2
  220. #define CLN_GETNOD    (4 | CLN_CHKACT | CLN_CHKABT)
  221. #define CLN_GETRCV    8
  222. #define CLN_CLOSE    (16 | CLN_CHKACT)
  223. #define CLN_STRIP    (32 | CLN_CHKABT)
  224. #define CLN_ABTNOD    (64 | CLN_CHKACT | CLN_CHKABT)
  225. #define CLN_SPLNOD    (128 | CLN_CHKACT | CLN_CHKABT)
  226. #define CLN_RTRY    (-1)
  227. #define CLN_SKIP    0
  228. #define CLN_COMMIT    1
  229. #define CLN_UNDO    2
  230.  
  231. /* compatability definitions */
  232. #define ctCompat5000    ((LONG) 0x01)
  233. #define ctCompatLogon    ((LONG) 0x02)
  234.  
  235. #define C254        (C255 - 1)
  236.  
  237. #define    LOGTYPE        0
  238. #define    STRFILE        2
  239. #define QNAMES        4
  240. #define IDXLOG        6
  241. #define DATLOG        8
  242.  
  243. #define MRKSIZE        4
  244. #define RESIDSIZE    (2 * SIZEOF(LONG))
  245. #define RESHDRSIZ    (SIZEOF(UCOUNT) + 2 * SIZEOF(VRLEN) + 3 * SIZEOF(LONG))
  246. #define FRESHDRINC    RESHDRSIZ
  247. #define VRESHDRINC    (3 * SIZEOF(LONG))
  248.  
  249. #define CONVERT_NUL    0
  250. #define CONVERT_IN    1
  251. #define CONVERT_OUT    2
  252.  
  253. #define LOGON        0
  254. #define LOGOFF        1
  255. #define STOPSRVR    2
  256. #define STARTSRVR    3
  257.  
  258. #define COMMIT_DELAY    10L    /* milliseconds */
  259. #define CHECK_DELAY    50L
  260. #ifndef ctMILLISECOND
  261. #define ctMILLISECOND(t)    (t)
  262. #endif
  263.  
  264. #define WAIT        -1L    /* inifinite    */
  265. #define WAITnodebug    -2L
  266. #define NOWAIT        0L
  267. #define SHORTWAIT    1L    /* smallest tick */
  268. #define NOT_OP_RCV    -3
  269. #define NOT_OP_FID    -4
  270.  
  271. #define SHRINKQ        0
  272. #define CHKPNTQ        1
  273. #define ctQUEUE        2
  274. #define MONITORQ0    3
  275. #define ctMAX_MONITOR    2
  276.  
  277. #ifndef ctSTACKSIZE
  278. #define ctSTACKSIZE    16384
  279. #endif
  280. #define QCHUNK_SIZE    10000L
  281. #define ctAbsMem    4
  282. #define ctGidMem    2
  283.  
  284. #define SETBIT        0
  285. #define TSTBIT        1
  286. #define SHDHBINS    128
  287. #define LOKHBINS    16
  288. #define ctCONBINS    6
  289. #define ctMEMSIG    0x4385
  290.  
  291. #define SEQNXT    1
  292. #define SEQPRV    2
  293.  
  294. #define EXS        0    /* exists            */
  295. #define SPC        1    /* pending            */
  296. #define UND        2    /* undoing pending        */
  297. #define RVS        3    /* part of SPC pair        */
  298. /* -------------------------------------------------------------*/
  299. #define SPC_DIF        4    /* pending for dif tran        */
  300. #define UND_DIF        5    /* undoing pending for dif tran    */
  301.  
  302. #define FN_MASK        0x00ff
  303. #define FN_MASK_ISAM    0x0100
  304. #define FN_MASK_LONG    0x0200
  305. #define FN_MASK_VRLEN    0x0400
  306. #define FN_MASK_OUTPUT    0x0800
  307. #define FN_MASK_LOGON    0x1000
  308. #define FN_MASK_NFCHK    0x2000
  309. #define FN_MASK_OUTRET    0x4000
  310.  
  311. #define FN_BASE_LONG    150
  312. #define FN_BASE_VRLEN    180
  313. #define FN_BASE_TEXT    188
  314.  
  315. /* control structure list types for ctgetlst() & ctputlst() */
  316. #define PI_UNIT        16
  317.  
  318. #define SHDTYP        0
  319. #define RS2TYP        1    /* available for use */
  320. #define PI1TYP        2
  321. #define PI2TYP        3
  322. #define PI4TYP        4
  323. #define PI8TYP        5
  324. #define PIwTYP        6
  325. #define PIxTYP        7
  326. #define PIyTYP        8
  327. #define PIzTYP        9
  328. #define BATTYP        10
  329. #define ILKTYP        11
  330. #define RS1TYP        12    /* available for use */
  331.  
  332. #define SEMTYP        13    /* These types do not require semaphore control */
  333. #define COMTYP        13
  334. #define ABTTYP        14
  335. #define IXCTYP        15
  336. #define DTCTYP        16
  337. #define CTCTYP        17
  338. #define LOKTYP        18
  339. #define RS3TYP        19    /* available for use */
  340. #define IXBTYP        20
  341. #define DTBTYP        21
  342. #define NUMCTLIST    22
  343. #ifdef MULTITRD
  344. #define CTSORTBUF    16000
  345. #define CTLISTBLK    16384        /* list   alloc block size    */
  346. #define CTLISTBUF    64000        /* buffer alloc block size    */
  347. #define CTDELSIZ    ((UINT) 32768)    /* ct_del[] size        */
  348. #else
  349. #define CTSORTBUF    16000
  350. #define CTLISTBLK    2048        /* list   alloc block size      */
  351. #define CTDELSIZ    ((UINT) 2048)    /* ct_del[] size (must be >= 512) */
  352. #endif
  353.  
  354. #define COMMONOWN    ct_cmnown
  355.  
  356.  
  357. /* ************         ctNOGLOBALS REQUIRES CTS_ISAM      ************* */
  358. #ifdef ctNOGLOBALS
  359. #ifndef CTS_ISAM
  360. #define CTS_ISAM
  361. #endif
  362. #ifndef ISAM_VARS
  363. #define ISAM_VARS
  364. #endif
  365. #endif
  366.  
  367. /* *********        DISABLE FEATURES DEPENDENT ON CTS_ISAM      ******** */
  368. #ifndef CTS_ISAM
  369.  
  370. #ifdef RTREE
  371. #undef RTREE
  372. #define NO_RTREE
  373. #endif
  374.  
  375. #ifdef CTBATCH
  376. #undef CTBATCH
  377. #define NO_CTBATCH
  378. #endif
  379.  
  380. #ifdef PARMFILE
  381. #undef PARMFILE
  382. #define NO_PARMFILE
  383. #endif
  384.  
  385. #endif /* ~CTS_ISAM */
  386.  
  387. /* ***********        FPUTONLY NO LONGER SUPPORTED          *********** */
  388. #ifdef FPUTONLY
  389. This configuartion option is no longer supported. Use NOTFORCE and
  390. a file mode including WRITETHRU to force updates (on a file by file basis)
  391. to disk. DO NOT USE WRITETHRU WITH A FILE SUPPORTING TRANSACTION LOGGING.
  392. #endif
  393.  
  394. /* ***********          NO_BOUND IMPLIES NOTFORCE          *********** */
  395. #ifndef CTBOUND
  396. #ifdef FPUTFGET
  397. #undef FPUTFGET
  398. #define NOTFORCE
  399. #endif
  400. #endif
  401.  
  402. /* ***********        CTSUPER & RESOURCE IMPLY VARLDATA    *********** */
  403. #ifdef CTSUPER
  404. #ifndef VARLDATA
  405. #define VARLDATA
  406. #endif
  407. #endif
  408. #ifdef RESOURCE
  409. #ifndef VARLDATA
  410. #define VARLDATA
  411. #endif
  412. #endif
  413.  
  414. /* ***********       FPUTFGET CANNOT SUPPORT TRANPROC       *********** */
  415. #ifdef FPUTFGET
  416. #ifdef TRANPROC
  417. #undef TRANPROC
  418. #endif
  419. #endif
  420.  
  421. /* ***********    DEFINE MLTORTRN IF MULTITRD OR TRANPROC   *********** */
  422. #undef MLTORTRN
  423. #ifdef MULTITRD
  424. #define MLTORTRN
  425. #endif
  426. #ifdef TRANPROC
  427. #ifndef MLTORTRN
  428. #define MLTORTRN
  429. #endif
  430. #endif
  431.  
  432. /* ***********   CTSERVER & MULTITRD ARE MUTUALLY EXCLUSIVE  ********* */
  433. #ifdef CTSERVER
  434. #ifdef MULTITRD
  435.     *** CTSERVER & MULTITRD are mutually exclusive ***
  436. #endif
  437. #endif
  438.  
  439. /* ***********  GNSERVER indicates either CTSERVER or MULTITRD  ****** */
  440. #ifdef GNSERVER
  441. #undef GNSERVER
  442. #endif
  443. #ifdef CTSERVER
  444. #define GNSERVER
  445. #endif
  446. #ifdef MULTITRD
  447. #define GNSERVER
  448. #endif
  449.  
  450. /* ***********     FPUTFGET CANNOT BE USED WITH THE SERVER    ********* */
  451. #ifdef GNSERVER
  452. #ifdef FPUTFGET
  453. #undef FPUTFGET
  454. #define NOTFORCE
  455. #endif
  456. #endif
  457.  
  458. /* ***********   MUSTFRCE indicates multi-user requirements  ********* */
  459. #ifdef MUSTFRCE
  460. #undef MUSTFRCE
  461. #endif
  462. #ifdef FPUTFGET
  463. #define MUSTFRCE
  464. #endif
  465. #ifdef GNSERVER
  466. #define MUSTFRCE
  467. #endif
  468.  
  469. /* ***********       DOSFLUSH APPLIES ONLY TO FPUTFGET       ********* */
  470. #ifdef NOTFORCE
  471. #ifdef DOSFLUSH
  472. #undef  DOSFLUSH
  473. #define NO_FLUSH
  474. #endif
  475. #endif
  476.  
  477. /* ***********       CTASYNCR APPLIES ONLY TO MULTITRD       ********** */
  478. #ifdef CTASYNCR
  479. #ifndef MULTITRD
  480. #undef CTASYNCR
  481. #endif
  482. #endif
  483.  
  484. /* *************     UNIFRMAT APPLIES ONLY TO HIGH_LOW    ************* */
  485. #ifdef LOW_HIGH
  486. #ifdef UNIFRMAT
  487. #undef  UNIFRMAT
  488. #define NO_UNIFM
  489. #endif
  490. #endif
  491.  
  492. /* *************     UNIFRMAT DOES NOT SUPPORT TRANPROC    ************* */
  493. #ifdef UNIFRMAT
  494. #ifdef TRANPROC
  495. ???? cannot compile a UNIFRMAT/TRANPROC c-tree LIBRARY ????
  496. #endif
  497. #endif
  498.  
  499. /* ************* ************* ************* ************ ************* */
  500.  
  501. #define PERMFLAG    (VLENGTH | PREIMG | LOGFIL | WRITETHRU | CHECKLOCK | SUPERFILE | CHECKREAD)
  502.  
  503. #define NUMCHANEL    2    /* # io channels per file when DUPCHANEL on */
  504. #define MRKSIZ        4    /* exceptional element marks per byte */
  505.  
  506. #define MAXLEV        11    /* maximum height of B-Tree + 1        */
  507. #define    VARI_LEN    (SIZEOF(VRLEN) + 2 * SIZEOF(LONG))
  508. #define STATUS        18
  509.  
  510. #define HDRSIZ   128
  511. /* permanent header information */
  512. #define DHDRSIZ  HDRSIZ
  513.  
  514. #define PDZ    2     /* padding size */
  515. #define EXZ    8     /* Maximum IFIL name extension size           */
  516. #define PWZ    10     /* Maximum password length (including terminator) */
  517. #define IDZ    32     /* Maximum ID name length  (including terminator) */
  518. #define DSZ    64     /* group/user description information           */
  519. #define FNZ    256     /* parm block maximum name size           */
  520.  
  521. #ifdef VINES
  522. #define STZ    64     /* streettalk length                     */
  523. #endif
  524.  
  525. #ifdef  FPUTFGET
  526. #define PRDRPEAT    10    /* # of times to retry predsr node    */
  527. #else
  528. #define PRDRPEAT    0
  529. #endif
  530.  
  531. #define    MAXMEMB        31    /* maximum additional index members    */
  532.  
  533. typedef struct ugrup {
  534.     TEXT     groupid[IDZ];    /* ASCIIZ group id        */
  535.     } UGRUP;
  536. #ifdef ctSP
  537. typedef UGRUP far   *    pUGRUP;
  538. #else
  539. typedef UGRUP ctMEM *    pUGRUP;
  540. #endif
  541. #define MAX_UGRUP    128    /* maximum number of user groups    */
  542.  
  543. #ifndef CTBOUND
  544. #define MAXVABS            3        /* input segments */
  545. #define OUTSEG            (MAXVABS + 1)    /* output segment */
  546. #define BEGMSG_OFFSET        (OUTSEG * SIZEOF(VRLEN))
  547. #define INPUT_OFFSET        (BEGMSG_OFFSET + SIZEOF(reqPARMB))
  548. #define OUTPUT_OFFSET        (BEGMSG_OFFSET + SIZEOF(rspPARMB))
  549. #ifdef ctSP
  550. #define MsgLen(mp,i)        *(((VRLEN far *) mp) + i - 1)
  551. #else
  552. #define MsgLen(mp,i)        *(((VRLEN *) mp) + i - 1)
  553. #endif
  554. #endif
  555.  
  556. /* ******************************************************************** */
  557. /* ***            SYMBOLIC CONSTANTS               ***  */
  558. /* ******************************************************************** */
  559.  
  560. #define    DRNZERO         (ctRECPT) 0
  561. #define    NODEZERO    (LONG   ) 0
  562.  
  563. #define MIRRORD     0x0001    /* xflmod */
  564. #define ADMOPEN     0x1000 /* flmode */
  565.  
  566. #define FRCEADJ     16
  567. #define THRUADJ     32
  568. #define CTREAD     0
  569. #define CTWRITE     1
  570. #define CTWASYN  2
  571. #define CTNONE     3
  572. #define CTXTND     4
  573. #define CTCLRBF     5
  574. #define CTREADP     8
  575. #define CTFRED     (CTREAD  | FRCEADJ)
  576. #define CTFWRT     (CTWRITE | FRCEADJ)
  577. #define CTURED     (CTREAD  | THRUADJ)
  578. #define CTUWRT     (CTWRITE | THRUADJ)
  579.  
  580. #ifdef ctSQL
  581. #define SSO    1    /* SS (strict serializer) logical Open lock */
  582. #define SSCI    2    /* SS commit intent lock */
  583. #define SSC    3    /* SS commit lock */
  584. #define NSCI    4    /* NS (nonstrict serializer) commit intent lock */
  585. #define NSC    5    /* NS commit lock */
  586. #endif
  587. #define RDL    6    /* read lock */
  588. /* #define    WRL    7    ** write lock held to reader commits */
  589. /* #define    CIL    8    ** pending WRL to WXL promotion */
  590. #define WXL    9    /* exclusive write lock */
  591. #define WXH    10    /* exclusive write lock (no aggregate check) */
  592.  
  593. #define RES_SRVR    256
  594.  
  595. #define LEAF     1
  596. #define NOLEAF   0
  597.  
  598. #define ALPHAKEY    '\0'
  599.  
  600. /*
  601. ** obsolete key types: no longer supported.
  602. **
  603.     INTKEY
  604.     SFLOATKEY
  605.     DFLOATKEY
  606. **
  607. */
  608.  
  609. #define COL_PREFIX    '\4'    /* leading character compression    */
  610. #define COL_SUFFIX    '\10'    /*  8 decimal: padding compression    */
  611. #define COL_BOTH    '\14'    /* 12 decimal: both of the above    */
  612. #define ALT_SEQ        '\20'    /* 16 decimal: alternative col sequence    */
  613. #define MSK_ALT        ~ALT_SEQ
  614.  
  615. #define DUPKEY   '\1'
  616. #define NODUPKEY '\0'
  617.  
  618. #define REGULAR  '\1'
  619. #define DUPLEAF  '\0'
  620. #define DUPNONL     '\3'
  621.  
  622. #define DAT_CLOSE 0
  623. #define IDX_CLOSE 1
  624. #define VAT_CLOSE 2
  625.  
  626. #define NON_SUPER 0
  627. #define HST_SUPER 1
  628. #define MBR_SUPER 2
  629. #define IDX_SUPER 6
  630. #define SUPADD      16
  631. #define MODMODE      32
  632. #define CHGADD      64
  633.  
  634. #define SECSIZ   128        /* logical sector size. DO NOT CHANGE.    */
  635. #define CTBUFSIZ (MAX_NAME + 1)    /* ct_buf[] size */
  636. #define UPDATED  C255        /* C255 defined in ctcmpl.h */
  637. #define DELFLG     C255
  638. #define RESFLG     C254
  639. #define COMPACT  '\143'        /* file compaction flag: must rebuild indices */
  640. #define CTBADOPN '\122'        /* file corrupt on open */
  641. #define CTBADLOP '\114'        /* leaf level loop: must rebuild indices */
  642. #define CMPMSK     0x00ff
  643.  
  644. #define MAXAGE    0xffff    /* max age of lru counter before roll-over */
  645. #define MAXSRLPOS 0xffff    /* no serial segment flag           */
  646.  
  647. #define    LH_VER     0x0001            /* LOW_HIGH option         */
  648. #define    HL_VER     0x0002            /* HIGH_LOW   "            */
  649.  
  650. #define ADD_LOCK    0    /* cts_lok() flag: adding a lock    */
  651. #define RED_LOCK    1    /*           check if red locked    */
  652. #define MST_LOCK    2    /*           check if wrt locked    */
  653.  
  654. /* ***********     DEFINE LOCKING REQUIREMENTS & TESTS      *********** */
  655. #define LOCK_TEST MST_LOCK
  656.  
  657. #define SHDSRCH        64    /* no preimg search */
  658. #define TRANMSK        (~SHDSRCH)
  659.  
  660. #define LHDRCOMP    1
  661. #define SH_HDRCP    (LHDRCOMP | SHDSRCH)
  662. #define LADDKEY        2
  663. #define SH_ADDKY    (LADDKEY | SHDSRCH)
  664. #define LADDSI        (LADDKEY + 1)
  665. #define LDELKEY        4
  666. #define SH_DELKY    (LDELKEY | SHDSRCH)
  667. #define LDELSI        (LDELKEY + 1)
  668. #define SH_INVLD    6
  669. #define BEGTRAN        7
  670. #define SH_BEGTRAN    (BEGTRAN | SHDSRCH)
  671. #define ENDTRAN        8
  672. #define ABRTRAN        9
  673. #define SH_NLINK    10
  674. #define NEWLINK        SH_NLINK
  675. #define SH_VLINK    11
  676. #define SH_IMAGE    12
  677. #define NEWIMAGE    SH_IMAGE
  678. #define OLDFILL        13
  679. #define OLDIMAGE    14
  680. #define DIFIMAGE    15
  681. #define RDYTRAN        16
  682. #define LHDRSHST    17
  683. #define LOGEXTFIL    18
  684. #define SH_EXTFIL    (LOGEXTFIL | SHDSRCH)
  685. #define NODEXTFIL    19
  686. #define SH_QNODE    20
  687. #define LHDRWORD    21
  688. #define SH_HDRWORD    (LHDRWORD | SHDSRCH)
  689. #define UNDTRAN        22
  690. #define BEG2FASE    23
  691. #define ACK2FASE    24
  692. #define SH_RSTFIL    25
  693. #define LOGRSTFIL    SH_RSTFIL
  694.  
  695. #define CHKPNT        26
  696. #define OPNTRAN        27
  697. #define CRETRAN        28
  698. #define DELTRAN        29
  699. #define CLSTRAN        30
  700. #define LLOGIN        31
  701. #define LLOGOFF        32
  702. #define UPDTRAN        33
  703. #define ENDLOG        34
  704. #define LPRMIDX        35
  705.  
  706. #define RESTRAN        36
  707. #define SH_WRITE    37
  708. #define SH_REUSE    (38 | SHDSRCH)
  709. #define SH_RSTRUS    39
  710. #define ABNTRAN        40
  711. #define LPABYTE        41
  712. /* reserve 42 through 50 for tran types that get their own trannum */
  713. #define getTRANNUM    50
  714. #define CMPTRAN        51
  715. /* reserve 52 through 63 for tran types that use current trannum */
  716.  
  717. #define FILEOFFS    12
  718. #define COMITRAN    1L
  719. #define FIRSTRAN    2L
  720.  
  721. #define NOCTCLUP    1
  722. #define BUFRLOCK    2
  723. #define GNS        3
  724.  
  725. #define TRN_AFLAG    1
  726. #define TRN_ANODE    1
  727. #define TRN_ADATA    3
  728. #define TRN_AABRT    5
  729.  
  730. #define TRN_DNODE    2
  731. #define TRN_DDATA    4
  732. #define TRN_DABRT    6
  733.  
  734.  
  735. #define DL_SRCH        0
  736. #define DL_ADDR        1
  737. #define DL_DLTR        2
  738. #define DL_RVRS        3
  739. #define DL_TADR        4
  740. #define DL_TDLT        5
  741.  
  742. #define CURKEY        0
  743. #define TMPKEY        1
  744.  
  745. #define AVLIST        0        /*    bhl[0] bavl[0] */
  746. #define DALIST        1        /* datbhl[0] bavl[1] */
  747. #define INLIST        2        /*    bhl[1] bhla[0] */
  748. #define DULIST        3        /* datbhl[1] bhla[1] */
  749. #define NUMANCHOR    2
  750. #ifdef MULTITRD
  751. #define PNLIST        4        /*    bhl[2] bhla[2] */
  752. #define DPLIST        5        /* datbhl[2] bhla[3] */
  753. #undef  NUMANCHOR
  754. #define NUMANCHOR    4
  755. #endif
  756.  
  757. /*
  758. **
  759. ** The following modules all use the FCS file extent:  ctopt2.h, ctscrt.h,
  760. **   ctclb2.c, ctclb3.c, ctdump.c, ctldmp.c, ctrdmp.c, ctsadm.c ctsrvr.c.
  761. **
  762. */
  763. #define FAIRCOMS    "FAIRCOMS"
  764.  
  765. #define ADMIN        "ADMIN"
  766. #define GUEST        "GUEST"
  767. #ifdef MLTORTRN
  768. #define FAIRSQLS    "SQL.FCS"
  769. #endif
  770.  
  771. #define CT_V60    0            /* Version 6 Release Flag */
  772. #define NEWIFIL
  773.  
  774. /* File Format Indicators */
  775. #define CT_V6     0x0080            /* c-tree version 6.0        */
  776.  
  777. #define    DEF_MASK_IFIL2    0x0001L        /* extended IFIL structures    */
  778. #define DEF_MASK_SPCMGT    0x0002L        /* unambig superfile space mgmt    */
  779. #define DEF_MASK_PSCL24    0x0004L        /* complete Pascal string def    */
  780.  
  781. #ifdef ctPASCALst
  782. #ifndef ctNotPASCAL24
  783. #define ctPASCAL24
  784. #endif
  785. #endif
  786.  
  787. #ifndef FPUTFGET
  788. #define gtroot(knum)    (knum->root)
  789. #endif
  790. #ifdef GNSERVER
  791. #define cthkey(knum)    (knum->hmem)
  792. #else
  793. #define cthkey(knum)    (knum->kmem ? ctkey(knum->filnum - knum->kmem) : knum)
  794. #endif
  795.  
  796. #define ctDATEXT    ".dat"
  797. #define ctIDXEXT    ".idx"
  798. #define UGFNAME    "FAIRCOM.FCS"
  799. #define UGFMODE    (SHARED | TRNLOG | SUPERFILE | ADMOPEN)
  800.  
  801. #ifndef ctSQL
  802. #define ctNONSQL
  803. #else
  804. #define NOEXITREPLACEMENT
  805. #endif
  806. #include "ctssql.h"
  807.  
  808. typedef struct align_test {
  809.     LONG    m1;
  810.     char    m2;
  811.     LONG    m3;
  812.     } ALIGN_TEST;
  813. typedef struct align_bcd {
  814.     double        m1;
  815.     char        m2;
  816.     SQL_DEC        m3;
  817.     } ALIGN_BCD;
  818. typedef struct align_tim {
  819.     double        m1;
  820.     char        m2;
  821.     SQL_D_TIME    m3;
  822.     } ALIGN_TIM;
  823.  
  824. #ifndef ALIGNMENT_COMP
  825. #define ALIGNMENT_COMP    (SegOff(ALIGN_TEST,m3) - SegOff(ALIGN_TEST,m2))
  826. #endif
  827. #define ALIGNMENT_BCD    (SegOff(ALIGN_BCD ,m3) - SegOff(ALIGN_BCD ,m2))
  828. #define ALIGNMENT_TIM    (SegOff(ALIGN_TIM ,m3) - SegOff(ALIGN_TIM ,m2))
  829.  
  830. #ifdef REVBIN
  831. #undef REVBIN
  832. #endif
  833. #ifdef LOW_HIGH
  834. #define REVBIN
  835. #endif
  836. #ifdef HIGH_LOW
  837. #ifdef UNIFRMAT
  838. #define REVBIN
  839. #endif
  840. #endif
  841.  
  842. #define NAMILEN        12
  843. #define NAMINDX        0
  844. #define LOGINDX        1
  845.  
  846. #define CO_BASE        1
  847. #define CO_CREATE    2
  848. #define CO_MEMBER    3
  849. #define CO_REGULAR    4
  850.  
  851. #define ctSQL_FILES    8
  852. #define ctTRN_FILES    3
  853. #define ctRT_FILES    3
  854.  
  855. #ifndef PARM2
  856. #define  ctreeVARLST
  857. #define  PARM2
  858. #define  PARM3
  859. #define  PARM4
  860. #define  PARM5
  861. #define  PARM6
  862. #define  PARM7
  863. #endif
  864.  
  865. #ifdef ctLOCLIB
  866. #ifdef PROTOTYPE
  867. #ifdef ctreeVARLST
  868. typedef ctCONV  COUNT (ctVDECL *pCEPFNC)();
  869. #else
  870. typedef ctCONV COUNT (ctVDECL *pCEPFNC)(COUNT ,COUNT ,pVOID ,pLONG ,
  871.                 pVOID ,pVRLEN ,COUNT );
  872. #endif
  873. #else /* PROTOTYPE */
  874. typedef ctCONV  COUNT (ctVDECL *pCEPFNC)();
  875. #endif /* PROTOTYPE */
  876. #endif /* ctLOCLIB */
  877.  
  878. #ifdef ctNOGLOBALS
  879. #define ctREG_DEF_ID    "ctREG_DEF_ID"
  880. #endif
  881.  
  882. #define ctSRVRSIDE    1
  883. #define ctCLNTSIDE    2
  884. #ifdef ctSEMCOM
  885. #define LCLNT        3
  886. #define LSRVR        4
  887. #else
  888. #define LCLNT    lclnt
  889. #define LSRVR    lsrvr
  890. #define ctcomrqs(l,sem,wait,by)    ctblkrqs(&l->sem,wait,-2)
  891. #define ctcomwat(l,sem,wait,by)    ctblkwat(&l->sem,wait,-1)
  892. #define ctcomclr(l,sem,by)    ctblkclr(&l->sem,-1)
  893. #endif
  894.  
  895. #endif /* ctOPT2H */
  896.  
  897. /* end of ctopt2.h */
  898.