home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / OOFILE / Buildable, limited OOFILE / c-tree headers / ctgvar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-12  |  38.4 KB  |  1,221 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 ctGVARH
  22. #define ctGVARH
  23.  
  24. #ifdef VINES
  25. #ifdef RUNTCBTABLE
  26. #include "tasker.h"
  27. #endif
  28. #endif
  29.  
  30. #ifdef MTDEBUG
  31. EXTERN int bomb;
  32. #endif
  33. #ifdef MTRCVR
  34. EXTERN int ebomb;
  35. #endif
  36. #include "ctrkey.h"
  37.  
  38. /* #ifndef ctCLIENT */
  39. #include "ctstrc.h"
  40. #ifdef TRANPROC
  41. #include "cttran.h"
  42. #endif
  43. /* #endif */
  44.  
  45. typedef struct {
  46. #ifdef RTREE
  47.     RKEY    s1usrkey;
  48.     RDAT    s1usrdat;
  49. #endif
  50.     COUNT    s1ct_dtmap;
  51.     COUNT    s1ct_rvmap;
  52. #ifdef ctCONDIDX
  53.     COUNT    s1ct_rlkey;
  54. #endif
  55.     COUNT    s1ct_nlkey;
  56.     TEXT    s1ct_nlchr;
  57.     TEXT    s1ct_vfin;
  58.     } CTIS1;
  59. typedef CTIS1 ctMEM *    pCTIS1;
  60.  
  61. typedef struct {
  62.     COUNT    s2ct_sgpos;
  63.     COUNT    s2ct_sglen;
  64.     COUNT    s2ct_sgmod;
  65.     } CTIS2;
  66. typedef CTIS2 ctMEM *    pCTIS2;
  67. typedef CTIS2 ctMEM * ctMEM * ppCTIS2;
  68.  
  69. typedef struct reblst {
  70.     struct reblst ctMEM *    nxtreb;
  71.     LONG            trnreb;
  72.     COUNT            numreb;
  73.     COUNT            flgreb;
  74.     TEXT            namreb[MAX_NAME];
  75.     TEXT            tmpreb[MAX_NAME];
  76.     } REBLST;
  77. typedef REBLST ctMEM *    pREBLST;
  78. typedef REBLST ctMEM * ctMEM * ppREBLST;
  79.  
  80.             /* Global Variables */
  81.  
  82. #ifdef ctNOGLOBALS
  83.  
  84. #ifdef ctLOCLIB
  85. #define CTBOUNDvar
  86. #define UNBOUNDvar
  87. EXTERN pCOUNT (*ctlfseggetp)();
  88. EXTERN VOID   (*ctlfsegputp)();
  89. EXTERN COUNT  (*ctgetseginfop)();
  90. #endif
  91.  
  92. #ifdef CTBOUND
  93. #ifndef CTBOUNDvar
  94. #define CTBOUNDvar
  95. #endif
  96. #else /* CTBOUND */
  97. #ifndef UNBOUNDvar
  98. #define UNBOUNDvar
  99. #endif
  100. #endif /* CTBOUND */
  101.  
  102. typedef struct ctgvars
  103. {
  104. #ifdef ctLOCLIB
  105.    pCEPFNC    ctcepfnc;
  106. #endif
  107.    struct ctgvars ctMEM
  108.            *pinstance;    /* instance link            */
  109.    pVOID    psysvar;    /* pointer to system-wide variables    */
  110.    LONG        sctnusers;    /* number of users            */
  111.    LONG        sctdivs;
  112.    LONG        sctops;        /* set operation state bit mask        */
  113.    VRLEN    sctxvlen;    /* vlen combined op max buffer length    */
  114.    VRLEN    ssql_len;
  115.    NINT        scthshift;    /* huge shift                */
  116.    NINT        sctmaxparm;
  117.    COUNT    suerr_cod;    /* user error cod */
  118.    COUNT    ssysiocod;    /* system error cod */
  119.    COUNT    sisam_err;
  120.    COUNT    sisam_fil;
  121.    COUNT    ssql_status1;
  122.    COUNT    ssql_status2;
  123.    COUNT    sct_mxfil;    /* maximum files specified in intree.     */
  124.    COUNT    sctusrprf;    /* user profile word */
  125. #ifdef ISAM_VARS
  126. #ifdef RTREE
  127.    COUNT    ssrtknm,ssrtdat,stmpdat;
  128. #endif
  129. #endif
  130.    TEXT        instname[IDZ];    /* name of this instance block    */
  131.    UTEXT     sct_uflvr;
  132.    UTEXT     sct_ualgn;
  133.    UTEXT    sct_upntr;    /* client pointer size */
  134.  
  135. #ifdef CTBOUNDvar
  136.    LSTANC    sctlist[NUMCTLIST];
  137.  
  138.    pFarCmdPtr    scommCmds[MAXCOMMP];
  139. #ifdef ctNOCOMMGLOBALS 
  140.    pVOID         commGbls[MAXCOMMP];
  141. #endif
  142.    CTFILE   sctfmru;
  143.    pCTFILE  sct_mru;
  144.    ppCTFILE sctfcbhdr;
  145.    ppctICON sctconanc;
  146.    pTREBUF     sct_btree;    /* ptr to beg of b-tree buffers        */
  147.    pDATBUF     sct_dbufr;    /* ptr to beg of data file buffers    */
  148.    pCTFILE     sct_key;    /* ptr to beg of ct_key file structures    */
  149.    pCTFILE     sct_dat;    /* ptr to beg of data file structures    */
  150.    pCTFILE     sct_vat;    /* ptr to beg of var data file struc    */
  151.    pLOKS     sct_locks[LOKHBINS];
  152.    pLOKS     sct_ltail[LOKHBINS];
  153.    LONG     sct_spc;
  154.    LONG  sct_dbrqs;    /* data buffer requests            */
  155.    LONG  sct_dbhit;    /* data buffer hits            */
  156.    LONG  sct_ibrqs;    /* index buffer requests        */
  157.    LONG  sct_ibhit;    /* index buffer hits            */
  158.    LONG  sct_rdops;    /* number of read operations        */
  159.    LONG  sct_rdbyt;    /* bytes read                */
  160.    LONG  sct_wrops;    /* number of write operations        */
  161.    LONG  sct_wrbyt;    /* bytes written            */
  162.    LONG     sct_abnod;    /* abort list node count        */
  163.    LONG     sct_cmnod;    /* pending node tran count        */
  164.    LONG     sct_cmdat;    /* pending data tran count        */
  165. #ifdef DBG749x
  166.    UINT  sctlstfrq;
  167. #endif
  168.    UINT  sct_tmpseq;    /* temporary file sequence number    */
  169.    UINT     sct_lhbins;
  170.    UINT  sctconbins;    /* context bins                */
  171.    NINT     sct_dq;    /* shrink task logical Q handle        */
  172.    NINT     sct_cq;     /* checkpoint task logical Q handle    */
  173.    NINT     sctfnz;    /* superfile member max name size    */
  174.    NINT  sctmiroff;    /* if YES, turn off all mirroring    */
  175.    COUNT sctconid;    /* last assigned context id        */
  176. #ifdef TRANPROC
  177.    pREBLST   sctrebhed;
  178.    pREBLST   sctcmphed;
  179.    pREBLST   sctmirhed;
  180.    pREBLST   sctiblhed;
  181.    ppSHADLST sct_ubit;
  182.    pTEXT sctmrklst;
  183.    pTEXT sct_usrsp;
  184.    pSHADLST sct_usrsl;
  185.    pTEXT sctlgbf;    /* transaction log buffer ptr */
  186.    ppSHADLST sctlstshd;    /* linked list tail for pre-image list */
  187.    ppSHADLST sctlstsav;    /* last save point pointer */
  188.    pCTFILE sctLnum;
  189.    pCTFILE sctUnum;
  190.    pCTFILE sctSnum;
  191.    CTFILE sctLfil;    /* log file header */
  192.    CTFILE sctUfil;    /* log file header */
  193.    CTFILE sctSfil[2];    /* start file headers */
  194.    LONG  sctusrsum;
  195.    LONG  sctusrtot;
  196.    LONG     sctdmptim;    /* dynamic dump beginn time */
  197.    LONG     sctdlgnum;    /* beginning log during dump */
  198.    LONG     sctelgnum;    /* ending log during dump */
  199.    LONG     sctdlgpos;    /* position in ctdlgnum */
  200.    LONG     sctelgpos;    /* position in ctelgnum */
  201.    LONG     sctcpcnt;    /* check point count */
  202.    LONG     sctcpchk;    /* check point count less delta */
  203.    LONG     sct_lstlog;    /* previous checkpoint log# */
  204.    LONG     sct_lstpos;    /* previous checkpoint log position */
  205.    LONG     sct_usrtr[MXU2];/* active transaction # for user or zero */
  206.    LONG     sct_usrtl[MXU2];/* log file sequence number for BEGTRAN */
  207.    VRLEN sct_lbfsiz;    /* log buffer size */
  208.    VRLEN sct_usrsz;
  209.    UINT     sct_shbins;
  210.    UINT     sct_shbyts;
  211.    NINT  sctfstr;
  212.    NINT     sct_chktrd;
  213.    NINT     sct_chkflg;    /* checkpoint in progress flag */
  214.    NINT     sct_logkep;    /* archive log count */
  215.    NINT  sctskpfil;    /* skip missing files during recovery */
  216.    NINT     sctskpmir;    /* skip missing mirrors during recovery */
  217.    COUNT sct_usrty[MXU2];/* SHADOW / LOGFIL transaction type */
  218.    COUNT sctshdlfil;    /* shadow swap file # */
  219.    COUNT sct_lgn;    /* current file# in log */
  220.    COUNT sctsflg;    /* ct_strip flag */
  221.    COUNT sctbflg;    /* BAKMOD flag */
  222.    COUNT sctdflg;    /* dynamic dump flag */
  223.    COUNT sct_actrns;    /* # active transactions */
  224.    COUNT sct_lerflg;    /* ctwrtlog error flag */
  225.    COUNT sct_usrsi;
  226.    COUNT sct_usrsv;
  227.    COUNT sct_rstflg;    /* TRANRST() flag */
  228.    TEXT     sct_chkpt[MXU2];/* check point flag */
  229. #endif /* TRANPROC */
  230.    VRLEN     sct_bfsiz;    /* data buffer size            */
  231.     COUNT     sctrdmp_flg;    /* signals dynamic dump recovery    */
  232.     COUNT     sctmdmp_flg;    /* signals dyn dump recovery had mirrors*/
  233.    COUNT     sctrflg;    /* automatic recovery flag        */
  234.    COUNT     sctrbflg;    /* rebuild flag                */
  235.    COUNT     sctfnstrat;    /* file name conversion startegy    */
  236.    COUNT     scttflg;    /* stop server in progress        */
  237.    COUNT     sct_mxu1;    /* max users plus origin        */
  238.    COUNT     sct_cmnown;    /* common onwer number (semaphores)    */
  239.    COUNT     sct_hshft;    /* hash shift parameter            */
  240.    COUNT     sct_hbins;    /* hash bins for buffers        */
  241.    COUNT     sct_dshft;    /* datbuf hash shift parm        */
  242.    COUNT     sct_dbins;    /* datbuf hash bins            */
  243.    BHL        sct_bavl[2];    /* buffer avl list anchors        */
  244.    ppBHL    sct_bhla[NUMANCHOR];/* buffer hash list anchors        */
  245.    pTEXT     sctsdname;    /* server directory name        */
  246.    pTEXT     sctsvname;    /* server name                */
  247.    pTEXT     sctsqname;    /* server SQL name            */
  248. #ifdef VINESLOG
  249.    TEXT         sctlgname[MAX_NAME];
  250.                 /* server status log name        */
  251. #endif
  252.  
  253.    pTEXT     sctscommp[MAXCOMMP];
  254.                 /* server comm protocol            */
  255.    pTEXT     sct_del;    /* constant 0xff array            */
  256.    UINT         sct_delsiz;    /* size of 0xff array            */
  257.    UINT          scts_list_m;    /* list memory block size        */
  258.    UINT          scts_sort_m;    /* sort memory buffer size        */
  259.    UINT          scts_bufr_m;    /* bufr memory block size        */
  260.    TEXT         sctifl_ext[2][EXZ];
  261.                 /* default IFIL extensions        */
  262.  
  263.    COUNT sct_mxbuf;        /* maximum buffers specified in intree     */
  264.    COUNT sct_dxbuf;        /* maximum data file buffers         */
  265.    COUNT sct_ndsec;        /* # of sectors per node specified in intree */
  266.    COUNT sct_maxvfil;        /* virtual file limit */
  267.    COUNT sct_numvfil;        /* number of virtual files open        */
  268.    COUNT sct_avlfil;        /* available file control block counter */
  269.    COUNT sct_ver;        /* defines configuration options */
  270.    TEXT  sctsupsep;
  271.  
  272.    COUNT scts_maxlok;        /* maximum locks */
  273.  
  274. #ifdef ctOldALCBAT
  275.    COUNT   sbatmax;
  276.    COUNT   sbatnum;
  277.    pBATHDR ssavbat;
  278. #else
  279.    pSAVBAT sbatnum;
  280.    ppSAVBAT
  281.        ssavbat;
  282. #endif
  283.    BATHDR  batch;
  284.    LONG    sct_npath[MAXLEV];    /* array to trace path down B-tree. Assumes  */
  285.                 /* maximum of MAXLEV - 1 levels in B-tree.   */
  286.    COUNT sct_nelem[MAXLEV];
  287.    COUNT sct_tight[MAXLEV];
  288.    COUNT sct_melem[MAXLEV];
  289.                     
  290.    TEXT sct_dupkey[MAXLEN+1];/* for searches of duplicate keys */
  291.    TEXT sspkey[MAXLEN+1];    /* temporary storage for key values during */
  292.                 /* node updates                */
  293.  
  294.    COUNT sct_elm;        /* position within B-Tree node    */
  295.    COUNT sct_tky;        /* result of comparison between target    */
  296.                 /* value and index entry.        */
  297.                 /* ct_tky < 0 => target < index entry    */
  298.                 /*      = 0 => target = index entry    */
  299.                 /*      > 0 => target > index entry     */
  300.    COUNT sct_tkp;        /* previous value of ct_tky        */
  301.    COUNT sct_sfxctp;        /* previous value of suffix count    */
  302.    LONG  sct_lnode;        /* last node found during walk down tree */
  303.    LONG  sct_fnode;        /* node found during search/retrieval    */
  304.    LONG  sct_nwnod;        /* pointer to new node */
  305.    LONG  sct_gsrl;        /* next serial number for data file */
  306.    COUNT sct_trdflg;        /* thread operation flag */
  307.    COUNT sbtlev;            /* b-tree level counter. used as index of */
  308.                 /* ct_npath                  */
  309.    TEXT  sct_buf[CTBUFSIZ];    /* temporary io buffer */
  310.  
  311. /*
  312. ** ISAM global variables from ctisam.h
  313. */
  314.  
  315. #ifdef ISAM_VARS
  316.    COUNT    sctskymap[MAXFIL][MAX_DAT_KEY];
  317.    CTIS1    sctis1[MAXFIL];
  318.    CTIS2    sctis2[MAXFIL][MAX_KEY_SEG];
  319.  
  320.    TEXT        sct_fndval[MAXLEN];
  321.  
  322.    COUNT    sct_nwrcfg;
  323.    COUNT    sct_vfsg;
  324.  
  325.    COUNT    sct_ismlk;
  326.  
  327. #ifdef ctOldALCSET
  328.    pSAVSET  sct_savset;
  329.  
  330.    COUNT   sseqlen;        /* significant length of key    */
  331.    COUNT   sseqkey;        /* current keyno        */
  332.    COUNT   sseqnum;        /* current set number        */
  333.    COUNT   smaxqset;
  334. #else
  335.    ppSAVSET
  336.        sct_savset;        /* pointer to hash anchors    */
  337.    pSAVSET sseqnum;        /* current set pointer        */
  338.    COUNT   sseqlen;        /* significant length of key    */
  339.    COUNT   sseqkey;        /* current keyno        */
  340. #endif
  341.    TEXT    sseqbuf[MAXLEN];    /* holds matching "partial" key */
  342. #ifdef MUSTFRCE
  343.    TEXT       sseqold[MAXLEN];
  344. #endif
  345. #endif
  346.  
  347.    TEXT sl_lastkey[MAXLEN];
  348.    LONG sl_begnod;
  349.    LONG sl_curnod;
  350.    LONG sl_prvnod;
  351.    LONG sl_numnod;
  352.    LONG sl_ct_nnods[MAXLEV];
  353.    COUNT sl_elem;
  354.    COUNT sl_started;
  355.    pTREBUF sl_savbp;
  356.    VRLEN sl_hdradj;
  357.  
  358.    COUNT stranactv;
  359.    COUNT stransavp;
  360.    UCOUNT slstsiz[NUMCTLIST];
  361. #ifdef DBG749x
  362.    UINT slstchk[NUMCTLIST];
  363. #endif
  364.    VRLEN slstcnt[NUMCTLIST];
  365. #endif /* CTBOUNDvar */
  366. #ifdef UNBOUNDvar
  367.    pTEXT    sctusrbuf;
  368. #ifdef ctCLIENT
  369.    pLQMSG    sctlqmsg;
  370.    pLOCLFILE    shlocl;
  371.    pLOCLAUX    shauxl;
  372. #else
  373.    pVOID    ctlqfake;
  374.    pVOID    hloclfake;
  375.    pVOID    hauxlfake;
  376. #endif
  377.    VRLEN    sctusrlen;
  378.    VRLEN    sctusrpos;
  379.    VRLEN    sctsrvlen;
  380.    UTEXT    sctsflvr[8];
  381.    TEXT        sctnodnam[IDZ];
  382.    NINT        sct_lq;        /* logon logical Q handle        */
  383.    NINT        sctautotfrm;
  384.    NINT        sctmaxdatkey;
  385.    NINT        sctisam_flg;
  386.    NINT        sct_autopos_clr;
  387.    COUNT    sctsrvver;
  388. #endif /* UNBOUNDvar */
  389.  
  390. } CTGVAR, ctMEM * pCTGVAR;
  391. EXTERN pCTGVAR ctWNGV;
  392.  
  393. #define ctumxfil    ct_mxfil
  394. #define cthghfil    ct_mxfil
  395. #ifdef CTBOUND
  396. #define ctrebhed    ctWNGV->sctrebhed
  397. #define ctcmphed    ctWNGV->sctcmphed
  398. #define ctmirhed    ctWNGV->sctmirhed
  399. #define ctiblhed    ctWNGV->sctiblhed
  400. #define lstsiz        ctWNGV->slstsiz
  401. #ifdef DBG749x
  402. #define lstchk        ctWNGV->slstchk
  403. #endif
  404. #define lstcnt        ctWNGV->slstcnt
  405. #define ctlist        ctWNGV->sctlist
  406.  
  407. #define commCmds    ctWNGV->scommCmds
  408. #ifdef ctNOCOMMGLOBALS
  409. #define commGbls    ctWNGV->commGbls
  410. #endif
  411. #define ctfmru        ctWNGV->sctfmru
  412. #define ct_mru        ctWNGV->sct_mru
  413. #define ctfcbhdr      ctWNGV->sctfcbhdr
  414. #define ctconanc      ctWNGV->sctconanc
  415. #define ctconid       ctWNGV->sctconid
  416. #define ctconbins     ctWNGV->sctconbins
  417. #define ct_btree      ctWNGV->sct_btree
  418. #define ct_dbufr      ctWNGV->sct_dbufr
  419. #define ct_key        ctWNGV->sct_key
  420. #define ct_dat        ctWNGV->sct_dat
  421. #define ct_vat        ctWNGV->sct_vat
  422. #ifdef DBG749x
  423. #define ctlstfrq      ctWNGV->sctlstfrq
  424. #endif
  425. #define ct_tmpseq     ctWNGV->sct_tmpseq
  426. #define ct_lhbins     ctWNGV->sct_lhbins
  427. #define ct_locks      ctWNGV->sct_locks
  428. #define ct_ltail      ctWNGV->sct_ltail
  429. #define ct_spc          ctWNGV->sct_spc
  430. #define ct_dbrqs      ctWNGV->sct_dbrqs
  431. #define ct_dbhit      ctWNGV->sct_dbhit
  432. #define ct_ibrqs      ctWNGV->sct_ibrqs
  433. #define ct_ibhit      ctWNGV->sct_ibhit
  434. #define ct_rdops      ctWNGV->sct_rdops
  435. #define ct_rdbyt      ctWNGV->sct_rdbyt
  436. #define ct_wrops      ctWNGV->sct_wrops
  437. #define ct_wrbyt      ctWNGV->sct_wrbyt
  438. #define ct_abnod      ctWNGV->sct_abnod
  439. #define ct_cmnod      ctWNGV->sct_cmnod
  440. #define ct_cmdat      ctWNGV->sct_cmdat
  441. #define ct_dq         ctWNGV->sct_dq
  442. #define ct_cq         ctWNGV->sct_cq
  443. #define ctfnz         ctWNGV->sctfnz
  444. #ifndef BOUND
  445. #define ct_lq         ctWNGV->sct_lq
  446. #endif
  447. #define ctmiroff    ctWNGV->sctmiroff
  448. #ifdef TRANPROC
  449. #define ct_ubit(owner)    ctWNGV->sct_ubit
  450. #define ctmrklst    ctWNGV->sctmrklst
  451. #define ct_usrsp    ctWNGV->sct_usrsp
  452. #define ct_usrsl    ctWNGV->sct_usrsl
  453. #define ct_usrsz    ctWNGV->sct_usrsz
  454. #define ctusrsum    ctWNGV->sctusrsum
  455. #define ctusrtot    ctWNGV->sctusrtot
  456. #define ct_usrsi    ctWNGV->sct_usrsi
  457. #define ct_usrsv    ctWNGV->sct_usrsv
  458. #define ct_rstflg    ctWNGV->sct_rstflg
  459. #define ct_shbins       ctWNGV->sct_shbins
  460. #define ct_shbyts       ctWNGV->sct_shbyts
  461. #define ctfstr        ctWNGV->sctfstr
  462. #define ct_chktrd       ctWNGV->sct_chktrd
  463. #define ctlgbf          ctWNGV->sctlgbf
  464. #define ctlstshd        ctWNGV->sctlstshd
  465. #define ctlstsav        ctWNGV->sctlstsav
  466. #define ctLnum          ctWNGV->sctLnum
  467. #define ctUnum          ctWNGV->sctUnum
  468. #define ctSnum          ctWNGV->sctSnum
  469. #define ctLfil          ctWNGV->sctLfil
  470. #define ctUfil          ctWNGV->sctUfil
  471. #define ctSfil          ctWNGV->sctSfil
  472. #define ctdmptim        ctWNGV->sctdmptim
  473. #define ctdlgnum        ctWNGV->sctdlgnum
  474. #define ctelgnum        ctWNGV->sctelgnum
  475. #define ctdlgpos        ctWNGV->sctdlgpos
  476. #define ctelgpos        ctWNGV->sctelgpos
  477. #define ctcpcnt         ctWNGV->sctcpcnt
  478. #define ctcpchk         ctWNGV->sctcpchk
  479. #define ct_lstlog       ctWNGV->sct_lstlog
  480. #define ct_lstpos       ctWNGV->sct_lstpos
  481. #define ct_usrtr        ctWNGV->sct_usrtr
  482. #define ct_usrtl        ctWNGV->sct_usrtl
  483. #define ct_lbfsiz       ctWNGV->sct_lbfsiz
  484. #define ct_chkflg       ctWNGV->sct_chkflg
  485. #define ct_logkep       ctWNGV->sct_logkep
  486. #define ctskpfil        ctWNGV->sctskpfil
  487. #define ctskpmir        ctWNGV->sctskpmir
  488. #define ct_usrty        ctWNGV->sct_usrty
  489. #define ctshdlfil       ctWNGV->sctshdlfil
  490. #define ct_lgn          ctWNGV->sct_lgn
  491. #define ctsflg          ctWNGV->sctsflg
  492. #define ctbflg          ctWNGV->sctbflg
  493. #define ctdflg          ctWNGV->sctdflg
  494. #define ct_actrns       ctWNGV->sct_actrns
  495. #define ct_lerflg       ctWNGV->sct_lerflg
  496. #define ct_chkpt        ctWNGV->sct_chkpt
  497. #endif
  498. #define ct_bfsiz      ctWNGV->sct_bfsiz
  499. #define ctrdmp_flg    ctWNGV->sctrdmp_flg
  500. #define ctmdmp_flg    ctWNGV->sctmdmp_flg
  501. #define ctrflg        ctWNGV->sctrflg
  502. #define ctrbflg       ctWNGV->sctrbflg
  503. #define ctfnstrat     ctWNGV->sctfnstrat
  504. #define cttflg        ctWNGV->scttflg
  505. #define ct_mxu1       ctWNGV->sct_mxu1
  506. #define ct_cmnown     ctWNGV->sct_cmnown
  507. #define ct_hshft      ctWNGV->sct_hshft
  508. #define ct_hbins      ctWNGV->sct_hbins
  509. #define ct_dshft      ctWNGV->sct_dshft
  510. #define ct_dbins      ctWNGV->sct_dbins
  511. #define ct_bavl       ctWNGV->sct_bavl
  512. #define ct_bhla       ctWNGV->sct_bhla
  513. #define ctsdname      ctWNGV->sctsdname
  514. #define ctsvname      ctWNGV->sctsvname
  515. #define ctsqname      ctWNGV->sctsqname
  516. #ifdef VINESLOG
  517. #define ctlgname      ctWNGV->sctlgname
  518. #endif
  519. #define ctscommp      ctWNGV->sctscommp
  520. #define cts_list_m    ctWNGV->scts_list_m
  521. #define cts_sort_m    ctWNGV->scts_sort_m
  522. #define cts_bufr_m    ctWNGV->scts_bufr_m
  523. #define ctifl_ext     ctWNGV->sctifl_ext
  524.  
  525. #define ct_mxbuf      ctWNGV->sct_mxbuf
  526. #define ct_dxbuf      ctWNGV->sct_dxbuf
  527. #define ct_ndsec      ctWNGV->sct_ndsec
  528. #define ct_maxvfil    ctWNGV->sct_maxvfil
  529. #define ct_numvfil    ctWNGV->sct_numvfil
  530. #define ct_avlfil     ctWNGV->sct_avlfil
  531. #define ct_ver        ctWNGV->sct_ver
  532. #define ct_del        ctWNGV->sct_del
  533. #define ct_delsiz     ctWNGV->sct_delsiz
  534. #define ctsupsep      ctWNGV->sctsupsep
  535. #define cts_maxlok    ctWNGV->scts_maxlok
  536. #define ct_savbat     ctWNGV->ssavbat
  537. #define ctbatnum      ctWNGV->sbatnum
  538. #define ctbatmax      ctWNGV->sbatmax
  539. #define ctbatch       ctWNGV->batch
  540. #define ct_npath      ctWNGV->sct_npath
  541.  
  542. #define ct_nelem      ctWNGV->sct_nelem
  543. #define ct_tight      ctWNGV->sct_tight
  544. #define ct_melem      ctWNGV->sct_melem
  545.                                        
  546. #define ct_dupkey     ctWNGV->sct_dupkey
  547. #define spkey         ctWNGV->sspkey
  548.  
  549. #define ct_elm        ctWNGV->sct_elm
  550. #define ct_tky        ctWNGV->sct_tky
  551.  
  552. #define ct_tkp        ctWNGV->sct_tkp
  553. #define ct_sfxctp     ctWNGV->sct_sfxctp
  554. #define ct_lnode      ctWNGV->sct_lnode
  555. #define ct_fnode      ctWNGV->sct_fnode
  556. #define ct_nwnod      ctWNGV->sct_nwnod
  557. #define ct_gsrl       ctWNGV->sct_gsrl
  558. #define ct_trdflg     ctWNGV->sct_trdflg
  559. #define btlev         ctWNGV->sbtlev
  560.  
  561. #define ct_buf        ctWNGV->sct_buf
  562.  
  563. #ifdef ISAM_VARS
  564. #define ctskymap      ctWNGV->sctskymap
  565. #define ctis1         ctWNGV->sctis1
  566. #define ctis2         ctWNGV->sctis2
  567.  
  568. #define ct_fndval     ctWNGV->sct_fndval
  569. #define ct_nwrcfg     ctWNGV->sct_nwrcfg
  570. #define ct_vfsg       ctWNGV->sct_vfsg
  571. #define ct_ismlk      ctWNGV->sct_ismlk
  572. #define ct_savset     ctWNGV->sct_savset
  573.  
  574. #define seqbuf          ctWNGV->sseqbuf
  575. #ifdef MUSTFRCE
  576. #define seqold          ctWNGV->sseqold
  577. #endif
  578. #define seqlen          ctWNGV->sseqlen
  579. #define seqkey          ctWNGV->sseqkey
  580. #define seqnum          ctWNGV->sseqnum
  581. #ifdef ctOldALCSET
  582. #define maxqset          ctWNGV->smaxqset
  583. #endif /* ctOldALCSET */
  584. #endif
  585. #else /* CTBOUND */
  586. #define ctusrbuf    ctWNGV->sctusrbuf
  587. #define ctlqmsg        ctWNGV->sctlqmsg
  588. #define hlocl        ctWNGV->shlocl
  589. #define hauxl        ctWNGV->shauxl
  590. #define ctusrlen    ctWNGV->sctusrlen
  591. #define ctusrpos    ctWNGV->sctusrpos
  592. #define ctsrvlen    ctWNGV->sctsrvlen
  593. #define ctsflvr        ctWNGV->sctsflvr
  594. #define ctnodnam    ctWNGV->sctnodnam
  595. #define ct_lq        ctWNGV->sct_lq
  596. #define ctautotfrm    ctWNGV->sctautotfrm
  597. #define ctmaxdatkey    ctWNGV->sctmaxdatkey
  598. #define ctisam_flg    ctWNGV->sctisam_flg
  599. #define ct_autopos_clr    ctWNGV->sct_autopos_clr
  600. #define ctsrvver    ctWNGV->sctsrvver
  601. #endif /* CTBOUND */
  602.  
  603. #define ctnusers      ctWNGV->sctnusers
  604. #define ctdivs        ctWNGV->sctdivs
  605. #define ctops          ctWNGV->sctops
  606. #define ctxvlen          ctWNGV->sctxvlen
  607. #define sql_len       ctWNGV->ssql_len
  608. #define cthshift      ctWNGV->scthshift
  609. #define ctmaxparm     ctWNGV->sctmaxparm
  610. #define uerr_cod      ctWNGV->suerr_cod
  611. #define sysiocod      ctWNGV->ssysiocod
  612. #define isam_err      ctWNGV->sisam_err
  613. #define isam_fil      ctWNGV->sisam_fil
  614. #define sql_status1   ctWNGV->ssql_status1
  615. #define sql_status2   ctWNGV->ssql_status2
  616. #define ct_mxfil      ctWNGV->sct_mxfil
  617. #define ctusrprf      ctWNGV->sctusrprf
  618. #ifdef ISAM_VARS
  619. #ifdef RTREE
  620. #define srtknm        ctWNGV->ssrtknm
  621. #define srtdat        ctWNGV->ssrtdat
  622. #define tmpdat        ctWNGV->stmpdat
  623. #endif
  624. #endif
  625. #define ct_uflvr      ctWNGV->sct_uflvr
  626. #define ct_ualgn      ctWNGV->sct_ualgn
  627. #define ct_upntr      ctWNGV->sct_upntr
  628.  
  629. #ifdef PROTOTYPE
  630. ctCONV pCTGVAR ctDECL GetCtreeGV( void );
  631. ctCONV void ctDECL SetCtreeGV( pCTGVAR );
  632. ctCONV pCTGVAR ctDECL InitCtreeGV( void );
  633. ctCONV int ctDECL ViewCtreeError( unsigned int );
  634. #else
  635. ctCONV pCTGVAR ctDECL GetCtreeGV();
  636. ctCONV void ctDECL SetCtreeGV();
  637. ctCONV pCTGVAR ctDECL InitCtreeGV();
  638. ctCONV int ctDECL ViewCtreeError();
  639. #endif
  640.  
  641.  
  642. #else /* ctNOGLOBALS */
  643.  
  644. #ifdef ctCLIENT
  645. EXTERN pTEXT    ctusrbuf;
  646. EXTERN pLQMSG    ctlqmsg;
  647. EXTERN pLOCLFILE hlocl;
  648. EXTERN pLOCLAUX  hauxl;
  649. EXTERN VRLEN    ctusrlen;
  650. EXTERN VRLEN    ctusrpos;
  651. EXTERN VRLEN    ctsrvlen;
  652. EXTERN UTEXT    ctsflvr[8];
  653. EXTERN TEXT    ctnodnam[IDZ];
  654. EXTERN NINT    ct_lq;
  655. EXTERN NINT    ctautotfrm;
  656. EXTERN NINT    ctmaxparm;
  657. EXTERN NINT    ctmaxdatkey;
  658. EXTERN NINT    ctisam_flg;
  659. EXTERN NINT    ct_autopos_clr;
  660. EXTERN COUNT    ctsrvver;
  661.  
  662. EXTERN LONG     ctnusers;    /* number of users            */
  663. EXTERN LONG     ctdivs;
  664. EXTERN LONG     ctops;        /* set operation state bit mask        */
  665. EXTERN VRLEN     ctxvlen;    /* vlen combined op max buffer length    */
  666. EXTERN VRLEN     sql_len;
  667. EXTERN NINT     cthshift;    /* huge shift                */
  668. EXTERN COUNT uerr_cod;        /* user error cod */
  669. EXTERN COUNT sysiocod;        /* system error cod */
  670. EXTERN COUNT isam_err;
  671. EXTERN COUNT isam_fil;
  672. EXTERN COUNT sql_status1;
  673. EXTERN COUNT sql_status2;
  674. EXTERN COUNT ct_mxfil;        /* maximum files specified in intree.     */
  675. EXTERN COUNT ctusrprf;        /* user profile word */
  676. #ifdef RTREE
  677. EXTERN COUNT    srtknm,srtdat,tmpdat;
  678. #endif
  679. EXTERN UTEXT             ct_uflvr;
  680. EXTERN UTEXT             ct_ualgn;
  681. EXTERN UTEXT            ct_upntr;
  682.  
  683. #else /* ctCLIENT */
  684.  
  685. EXTERN LSTANC    ctlist[NUMCTLIST];
  686.  
  687. #ifdef MULTITRD
  688. EXTERN pFarCmdPtr commCmds[MAXCOMMP];
  689. #ifdef ctNOCOMMGLOBALS
  690. EXTERN pVOID      commGbls[MAXCOMMP];
  691. #endif
  692. EXTERN ppCOUNT      ct_wf;
  693. EXTERN pCOUNT      ct_vf;
  694. EXTERN LONG      nodedtime;
  695. EXTERN NINT      ctmaxdatkey;
  696. EXTERN NINT      ctmaxkeyseg;
  697. EXTERN NINT      ctdnodeRunning;
  698. EXTERN NINT      ctqchkpRunning;
  699. EXTERN NINT      ct_mq[ctMAX_MONITOR];
  700. EXTERN NINT      ct_smon[ctMAX_MONITOR];
  701. EXTERN UINT      ct_trdmon[ctMAX_MONITOR];
  702. EXTERN COUNT      ctadmfiles;
  703. #endif /* MULTITRD */
  704. EXTERN CTFILE    ctfmru;
  705. EXTERN pCTFILE   ct_mru;
  706. EXTERN ppCTFILE  ctfcbhdr;
  707. EXTERN pTREBUF     ct_btree;    /* ptr to beg of b-tree buffers        */
  708. EXTERN pDATBUF     ct_dbufr;    /* ptr to beg of data file buffers    */
  709. EXTERN pCTFILE     ct_key;    /* ptr to beg of ct_key file structures    */
  710. EXTERN pCTFILE     ct_dat;    /* ptr to beg of data file structures    */
  711. EXTERN pCTFILE     ct_vat;    /* ptr to beg of var data file struc    */
  712. EXTERN pLONG     sctusrsum;    /* mem usage sum */
  713. EXTERN pLONG     sctusrtot;    /* mem usage limit */
  714. EXTERN LONG     ctmemtot;    /* space aggregate limit */
  715. EXTERN LONG     ctmemsum;    /* current aggregate sum */
  716. EXTERN LONG     ctmemusr;    /* system default user limit */
  717. EXTERN LONG     ctmemhgh;    /* system memory highwater mark */
  718. EXTERN LONG     ctmemup;    /* MEMORY_MONITOR limit */
  719. EXTERN LONG     ctmemdn;    /* MEMORY_MONITOR limit */
  720. EXTERN LONG     ctmemch;    /* MEMORY_MONITOR delta */
  721. EXTERN VRLEN     ct_qblock;    /* SQL record buffer block size        */
  722. EXTERN VRLEN     ct_gstmem;    /* guest memory limit            */
  723. EXTERN LONG     ct_timout;    /* inactive tran timeout        */
  724. EXTERN LONG     ct_usrmrl;    /* user memory attribute bits        */
  725. extern ULONG     ctghat[2];
  726. extern LONG     ctdivs;
  727. EXTERN LONG     ct_dbrqs;    /* data buffer requests            */
  728. EXTERN LONG     ct_dbhit;    /* data buffer hits            */
  729. EXTERN LONG     ct_ibrqs;    /* index buffer requests        */
  730. EXTERN LONG     ct_ibhit;    /* index buffer hits            */
  731. EXTERN LONG     ct_rdops;    /* number of read operations        */
  732. EXTERN LONG     ct_rdbyt;    /* bytes read                */
  733. EXTERN LONG     ct_wrops;    /* number of write operations        */
  734. EXTERN LONG     ct_wrbyt;    /* bytes written            */
  735. EXTERN LONG     ct_abnod;    /* abort list node count        */
  736. EXTERN LONG     ct_cmnod;    /* pending node tran count        */
  737. EXTERN LONG     ct_cmdat;    /* pending data tran count        */
  738. EXTERN LONG     ctquemon;    /* node queue monitor threshhold    */
  739. EXTERN LONG     ctnusers;    /* number of users            */
  740. #ifdef DBG749x
  741. EXTERN UINT     ctlstfrq;
  742. #endif
  743. EXTERN UINT     ct_tmpseq;    /* temporary file sequence number    */
  744. EXTERN NINT     ctmiroff;    /* if YES, turn off all mirroring    */
  745. EXTERN NINT     ctdedmon;    /* deadloack monitor flag        */
  746. EXTERN NINT     ctfncmon;    /* function request monitor        */
  747. EXTERN NINT     ctchkmon;    /* checkpoint monitor flag        */
  748. EXTERN NINT     ct_fhlimit;    /* override file handle limits/default    */
  749. EXTERN NINT     cthshift;    /* huge shift                */
  750. EXTERN NINT     ct_dq;        /* shrink task logical Q handle        */
  751. EXTERN NINT     ct_cq;     /* checkpoint task logical Q handle    */
  752. EXTERN NINT     ctfnz;        /* superfile member max name size    */
  753. #ifndef CTBOUND
  754. EXTERN NINT     ct_lq;        /* logon logical Q handle        */
  755. EXTERN pTEXT     ct_tmppth;    /* temporary file default server path    */
  756. #endif
  757. #ifdef TRANPROC
  758. EXTERN pREBLST     ctrebhed;    /* index rebuild list */
  759. EXTERN pREBLST     ctcmphed;    /* compress rebuild list */
  760. EXTERN pREBLST     ctmirhed;    /* mirror sync list */
  761. EXTERN pREBLST     ctiblhed;    /* data (IFIL) rebuild list */
  762. EXTERN UINT     ct_shbins;    /* shadow hash bins            */
  763. EXTERN UINT     ct_shbyts;    /* shadow hash bytes            */
  764. EXTERN NINT     ctfstr;    /* oldest start file #            */
  765. EXTERN NINT     ct_chktrd;    /* thread id of checkpoint thread    */
  766. #endif
  767. EXTERN UINT     ct_lhbins;    /* lock hash bins            */
  768. EXTERN UINT     ctconbins;    /* context bins                */
  769. #ifdef MULTITRD
  770. EXTERN NINT     ct_commp;    /* # of comm protocols in use        */
  771. #endif
  772. EXTERN VRLEN     ct_bfsiz;    /* data buffer size            */
  773. EXTERN COUNT     ctrdmp_flg;    /* signals dynamic dump recovery    */
  774. EXTERN COUNT     ctmdmp_flg;    /* signals dyn dump recovery had mirrors*/
  775. EXTERN COUNT     ctrflg;    /* automatic recovery flag        */
  776. EXTERN COUNT     ctfnstrat;    /* file name conversion startegy    */
  777. EXTERN COUNT     cttflg;    /* stop server in progress        */
  778. EXTERN COUNT     ct_mxu1;    /* max users plus origin        */
  779. EXTERN COUNT     ct_cmnown;    /* common onwer number (semaphores)    */
  780. EXTERN COUNT     ct_hshft;    /* hash shift parameter            */
  781. EXTERN COUNT     ct_hbins;    /* hash bins for buffers        */
  782. EXTERN COUNT     ct_dshft;    /* datbuf hash shift parm        */
  783. EXTERN COUNT     ct_dbins;    /* datbuf hash bins            */
  784. EXTERN BHL     ct_bavl[2];    /* buffer avl list anchors        */
  785. EXTERN ppBHL     ct_bhla[NUMANCHOR];
  786.                 /* buffer hash list anchors        */
  787. EXTERN pTEXT     ctsdname;    /* server directory name        */
  788. EXTERN pTEXT     ctsvname;    /* server name                */
  789. EXTERN pTEXT     ctsqname;    /* server SQL name            */
  790. #ifdef VINESLOG
  791. EXTERN TEXT     ctlgname[MAX_NAME];
  792.                 /* server status log name        */
  793. #endif
  794.  
  795. EXTERN pTEXT     ctscommp[MAXCOMMP];
  796.                 /* server comm protocol            */
  797. EXTERN pTEXT     ct_del;    /* constant 0xff array            */
  798. EXTERN UINT     ct_delsiz;    /* size of 0xff array            */
  799. EXTERN NINT     ct_sqlsupr;    /* sql superfile flag            */
  800. EXTERN UINT     cts_list_m;    /* list memory block size        */
  801. EXTERN UINT     cts_sort_m;    /* sort memory buffer size        */
  802. EXTERN UINT     cts_bufr_m;    /* bufr memory block size        */
  803. EXTERN TEXT     ctifl_ext[2][EXZ];
  804.                 /* default IFIL extensions        */
  805. #ifdef MULTITRD
  806. EXTERN UTEXT     ct_sflvr;    /* system flavor            */
  807. EXTERN UTEXT     ct_salgn;    /* system alignment            */
  808. EXTERN UTEXT     ct_spntr;    /* system pointer size            */
  809. #endif
  810.  
  811. EXTERN COUNT ct_mxfil;        /* maximum files specified in intree.     */
  812. EXTERN COUNT ct_mxbuf;        /* maximum buffers specified in intree     */
  813. EXTERN COUNT ct_dxbuf;        /* maximum data file buffers         */
  814. EXTERN COUNT ct_ndsec;        /* # of sectors per node specified in intree */
  815. #ifndef ctGINIT
  816. extern COUNT ct_maxvfil;    /* maximum virtual files opened        */
  817. #endif
  818. EXTERN COUNT ct_numvfil;    /* number of virtual files open        */
  819. EXTERN COUNT ct_avlfil;        /* available file control block counter */
  820. EXTERN COUNT ct_ver;        /* defines configuration options */
  821. EXTERN TEXT  ctsupsep;
  822. #ifdef MULTITRD
  823. EXTERN SEMA ct_gvsema;        /* ctgv semaphore */
  824. EXTERN SEMA ct_ismema;        /* ctismem semaphore */
  825. EXTERN SEMA ct_srvsema;
  826. EXTERN SEMA ct_gnsema;        /* get node (getnod) semaphore */
  827. EXTERN SEMA ct_ocsema;        /* open / create semaphore */
  828. EXTERN SEMA ct_vtsema;        /* vtclose semaphore */
  829. EXTERN SEMA ct_llsema;        /* lock list semaphore */
  830. EXTERN SEMA ct_facsema;        /* file lru access count */
  831. EXTERN SEMA ct_nmvsema;        /* ct_numvfil sema */
  832. EXTERN SEMA ct_avlsema;        /* available file counter */
  833. EXTERN SEMA ct_logsema;     /* log position/buffer semaphore */
  834. EXTERN SEMA ct_lflsema;        /* log file i/o semaphore */
  835. EXTERN SEMA ct_lfwsema;        /* wait for collective log flush */
  836. EXTERN SEMA ct_utrsema;     /* ct_usrtr[] semaphore */
  837. EXTERN SEMA ct_memsema;     /* memory allocation semaphore */
  838. EXTERN SEMA ct_chksema;        /* checkpoint semaphore */
  839. EXTERN SEMA ct_abtsema;        /* node abort list semaphore */
  840. EXTERN SEMA ct_comsema;        /* buffer commit list semaphore */
  841. EXTERN SEMA ct_uhnsema;        /* user handle semaphore */
  842. EXTERN COUNT ct_numusr;        /* active users */
  843. #endif
  844.  
  845. #ifndef TRANPROC
  846. EXTERN COUNT cts_maxlok;    /* maximum locks */
  847. #endif
  848.  
  849. #ifdef GNSERVER
  850. EXTERN pDEDLOK ctdedlok;    /* pointer to deadlock detection array */
  851. #endif
  852.  
  853. #ifdef MULTITRD
  854.  
  855. typedef struct {
  856. #ifdef ctCREATE_SEMA
  857.     SEMA     sresema;    /* reuseable semaphore for temp CTFILE    */
  858. #endif
  859.     BATHDR     batch;
  860. #ifdef ctOldALCBAT
  861.     COUNT     sbatmax;
  862.     COUNT     sbatnum;
  863.     pBATHDR     ssavbat;
  864. #else
  865.     pSAVBAT     sbatnum;
  866.     ppSAVBAT ssavbat;
  867. #endif
  868.  
  869.     LONG  sctops;        /* set operation state bit mask        */
  870.     VRLEN sctxvlen;        /* vlen combined op max buffer length    */
  871.     LONG  sresrv1;        /* spare members */
  872.     LONG  sresrv2;
  873.     LONG  sresrv3;
  874.  
  875. #ifndef CTBOUND
  876.     LONG  sresrv4;        /* spare members */
  877.     LONG  sresrv5;
  878.     LONG  sabnlog;        /* begtran log for abandoned tran    */
  879.     LONG  sctops_clr;    /* operation state clear mask        */
  880.     LONG  sautopos;        /* auto current ISAM position */
  881.     LONG  sautolen;        /* auto variable length size */
  882.     LONG  slogtime;        /* logon time */
  883.     LONG  strntime;        /* last begin tran time */
  884.     LONG  srqstime;        /* last request time */
  885.     NINT  snbrfile;        /* number of files in use */
  886.     NINT  sactflag;        /* active / inactive flag */
  887.     LONG  srqsfunc;        /* last rquest function # */
  888.     pVOID suserlqp;        /* user's request block */
  889.     LONG  susrrsvd[6];    /* spare members */
  890.     TEXT  snodname[32];    /* node name */
  891. #endif
  892.  
  893.     LONG  sfncret;        /* special function ret values: only MULTITRD */
  894.     LONG  sct_npath[MAXLEV];/* array to trace path down B-tree. Assumes  */
  895.                 /* maximum of MAXLEV - 1 levels in B-tree.   */
  896.     LONG  sct_lnode;    /* last node found during walk down tree */
  897.     LONG  sct_fnode;    /* node found during search/retrieval    */
  898.     LONG  sct_nwnod;    /* pointer to new node */
  899.     LONG  sct_gsrl;        /* next serial number for data file */
  900.     COUNT sct_trdflg;    /* thread operation flag */
  901.     COUNT sctconid;
  902.     TEXT  sct_userid[IDZ];    /* unique user id */
  903.     TEXT  spare[PWZ];    /* unused ???? */
  904.     UGRUP sct_userg[MAX_UGRUP];
  905.                 /* group list header */
  906.     pFUSR sct_fup;        /* FUSR pointer for current file */
  907.     ppctICON  sctconanc;    /* hash bins for context */
  908. #ifdef TRANPROC
  909.     ppSHADLST sct_ubit;    /* hash bins for srchshd */
  910.     pTEXT sctmrklst;    /* temp storage for exc marks during split */
  911.     pTEXT sct_usrsp;    /* pointer to shadow swap buffer */
  912.     pSHADLST sct_usrsl;    /* current shadow list element */
  913.     VRLEN sct_usrsz;    /* swap buffer size */
  914.     LONG  sct_usrtm;    /* activity time stamp (seconds) */
  915.     LONG  gvresv2;
  916.     COUNT sct_usrsv;    /* tran savepoint info */
  917.     COUNT sct_usrsi;    /* index update flag */
  918.     COUNT sct_rstflg;    /* TRANRST() flag */
  919. #endif
  920.     NINT  sctrbflg;        /* rebuild flag */
  921.     ppLOKS sct_locks;    /* user lock table head */
  922.     ppLOKS sct_ltail;    /* user lock table tail */
  923.     COUNT sctusrprf;    /* user profile word */
  924.     COUNT sctumxfil;    /* max files for user */
  925.     COUNT scthghfil;    /* highest file number limit */
  926.     COUNT sct_nelem[MAXLEV];
  927.     COUNT sct_tight[MAXLEV];
  928.     COUNT sct_melem[MAXLEV];
  929.     COUNT sct_tkp;        /* previous value of ct_tky        */
  930.     COUNT sct_sfxctp;    /* previous value of suffix count    */
  931.     COUNT sbtlev;        /* b-tree level counter. used as index of */
  932.                 /* ct_npath                  */
  933.     COUNT sct_elm;        /* position within B-Tree node    */
  934.     COUNT sct_tky;        /* result of comparison between target    */
  935.                 /* value and index entry.        */
  936.                 /* ct_tky < 0 => target < index entry    */
  937.                 /*      = 0 => target = index entry    */
  938.                 /*      > 0 => target > index entry     */
  939.                     
  940.     TEXT sct_dupkey[MAXLEN+1];/* for searches of duplicate keys */
  941.     TEXT sspkey[MAXLEN+1];    /* temporary storage for key values during */
  942.                 /* node updates                */
  943.  
  944.     TEXT sct_buf[CTBUFSIZ];    /* temporary io buffer */
  945.     UTEXT sct_uflvr;    /* user flavor */
  946.     UTEXT sct_ualgn;    /* user alignment */
  947.     UTEXT sct_upntr;    /* user pointer size */
  948.  
  949.     TEXT sl_lastkey[MAXLEN];
  950.     LONG sl_begnod;
  951.     LONG sl_curnod;
  952.     LONG sl_prvnod;
  953.     LONG sl_numnod;
  954.     LONG sl_ct_nnods[MAXLEV];
  955.     COUNT sl_elem;
  956.     COUNT sl_started;
  957.     pTREBUF sl_savbp;
  958.     VRLEN sl_hdradj;
  959.  
  960.     pTEXT sb_ct_rbuf;
  961.     pctRECPT sb_ct_pbuf;
  962.     COUNT sb_rerr_cod;
  963.     COUNT sb_rerr_fil;
  964.     COUNT sb_ct_fp;
  965.     COUNT sb_ct_redom;
  966.     VRLEN sb_ct_bsz;
  967.     LONG sb_ct_spc;
  968.  
  969.     pTEXT    sql_tbuf;
  970.     pTEXT    sql_spos;
  971.     LONG     sql_olen;
  972.     LONG     sql_rlen;
  973.     pVOID     sql_db;
  974.     } CTGV;
  975. typedef CTGV ctMEM *    pCTGV;
  976.  
  977. typedef struct {
  978.     pCTIS1  s1;
  979.     ppCTIS2 s2;
  980.     ppCOUNT sct_kymap;
  981. #ifdef ctOldALCSET
  982.     pSAVSET sct_savset;
  983.  
  984.     COUNT   sseqlen;        /* significant length of key    */
  985.     COUNT   sseqkey;        /* current keyno        */
  986.     COUNT   sseqnum;        /* current set number        */
  987.     COUNT   smaxqset;
  988. #else
  989.     ppSAVSET
  990.         sct_savset;        /* pointer to hash anchors    */
  991.     pSAVSET    sseqnum;        /* current set pointer        */
  992.     COUNT   sseqlen;        /* significant length of key    */
  993.     COUNT   sseqkey;        /* current keyno        */
  994. #endif
  995.     COUNT    sct_nwrcfg;
  996.     COUNT    sct_vfsg;
  997.     COUNT    sct_ismlk;
  998. #ifdef RTREE
  999.     COUNT    ssrtknm;
  1000.     COUNT    ssrtdat;
  1001.     COUNT    stmpdat;
  1002. #endif
  1003.  
  1004.     TEXT    sseqbuf[MAXLEN];    /* holds matching "partial" key */
  1005.     TEXT    sseqold[MAXLEN];    /* holds previous "partial" key */
  1006.     TEXT    sct_fndval[MAXLEN];
  1007.     } CTIS;
  1008. typedef CTIS ctMEM *    pCTIS;
  1009. typedef CTIS ctMEM * ctMEM * ppCTIS;
  1010.  
  1011. #ifndef CTBOUND
  1012. EXTERN pTEXT   sctusrbuf[MXU2]; /* user commbuffer */
  1013. EXTERN VRLEN   sctusrlen[MXU2]; /* commbuffer length */
  1014. EXTERN VRLEN   sctusrpos[MXU2]; /* position in buffer */
  1015. #endif
  1016. EXTERN COUNT   suerr_cod[MXU2];
  1017. EXTERN COUNT   ssysiocod[MXU2];
  1018. EXTERN COUNT   sisam_err[MXU2];
  1019. EXTERN COUNT   sisam_fil[MXU2];
  1020. EXTERN VRLEN   ssql_len[MXU2];
  1021. EXTERN COUNT   ssql_status1[MXU2];
  1022. EXTERN COUNT   ssql_status2[MXU2];
  1023. #ifdef VINES
  1024. #ifdef RUNTCBTABLE
  1025. EXTERN NINT    ctusrmapId;
  1026. EXTERN taskid  ctusrhmap[MXU2];
  1027. #else
  1028. EXTERN COUNT   ctusrhmap[MXU2];
  1029. #endif
  1030. #else
  1031. EXTERN COUNT   ctusrhmap[MXU2];
  1032. #endif
  1033.  
  1034. EXTERN pCTGV   ctgv[MXU2];
  1035. EXTERN TEXT    ctua[MXU2];
  1036. EXTERN TEXT    ctma[MXU2];
  1037. #ifdef ctNoThdParms
  1038. EXTERN NLONG   ctrcparm[MXU2];
  1039. #endif
  1040. #ifdef CTBOUND
  1041. EXTERN TEXT    ctst[MXU2];
  1042. #endif
  1043.  
  1044. EXTERN ppCTIS  ctis;
  1045.  
  1046. EXTERN ppFUSR  ct_fusr;
  1047. EXTERN pBLKLST ct_blk;
  1048.  
  1049. #define ct_ubit(owner)    ctgv[owner]->sct_ubit
  1050. #define ctconanc    lctgv->sctconanc
  1051. #define ctconid        lctgv->sctconid
  1052. #define ct_rstflg    lctgv->sct_rstflg
  1053. #ifndef CTBOUND
  1054. #define ctusrbuf    sctusrbuf[sOWNR]
  1055. #define ctusrlen    sctusrlen[sOWNR]
  1056. #define ctusrpos    sctusrpos[sOWNR]
  1057. #define abnlog        lctgv->sabnlog
  1058. #define ctops_clr    lctgv->sctops_clr
  1059. #endif
  1060. #define resema        lctgv->sresema
  1061. #define ctbatch        lctgv->batch
  1062. #define ctbatnum    lctgv->sbatnum
  1063. #define ctbatmax    lctgv->sbatmax
  1064. #define ct_savbat    lctgv->ssavbat
  1065. #define ct_locks    lctgv->sct_locks
  1066. #define ct_ltail    lctgv->sct_ltail
  1067. #define ctusrprf    lctgv->sctusrprf
  1068. #define ctumxfil    lctgv->sctumxfil
  1069. #define cthghfil    lctgv->scthghfil
  1070. #define ctops        lctgv->sctops
  1071. #define ctxvlen        lctgv->sctxvlen
  1072. #define autopos        lctgv->sautopos
  1073. #define autolen        lctgv->sautolen
  1074. #define logtime        lctgv->slogtime
  1075. #define trntime        lctgv->strntime
  1076. #define rqstime        lctgv->srqstime
  1077. #define rqsfunc        lctgv->srqsfunc
  1078. #define userlqp        lctgv->suserlqp
  1079. #define nodname        lctgv->snodname
  1080. #define nbrfile        lctgv->snbrfile
  1081. #define actflag        lctgv->sactflag
  1082. #define cominfo        lctgv->scominfo
  1083. #define fncret        lctgv->sfncret
  1084. #define ct_npath    lctgv->sct_npath
  1085. #define ct_nelem    lctgv->sct_nelem
  1086. #define ct_tight    lctgv->sct_tight
  1087. #define ct_melem    lctgv->sct_melem
  1088. #ifdef TRANPROC
  1089. #define ctmrklst    lctgv->sctmrklst
  1090. #define ctusrsum    sctusrsum[sOWNR]
  1091. #define ctusrtot    sctusrtot[sOWNR]
  1092. #define ct_usrsi    lctgv->sct_usrsi
  1093. #define ct_usrsv    lctgv->sct_usrsv
  1094. #define ct_usrsp    lctgv->sct_usrsp
  1095. #define ct_usrsl    lctgv->sct_usrsl
  1096. #define ct_usrsz    lctgv->sct_usrsz
  1097. #define ct_usrtm    lctgv->sct_usrtm
  1098. #endif
  1099. #define ctrbflg        lctgv->sctrbflg
  1100. #define ct_trdflg    lctgv->sct_trdflg
  1101. #define ct_userid    lctgv->sct_userid
  1102. #define ct_sqlpwd    lctgv->sct_sqlpwd
  1103. #define ct_userg    lctgv->sct_userg
  1104. #define ct_fup        lctgv->sct_fup
  1105. #define ct_dupkey    lctgv->sct_dupkey
  1106. #define spkey        lctgv->sspkey
  1107. #define ct_elm        lctgv->sct_elm
  1108. #define ct_tky        lctgv->sct_tky
  1109. #define ct_tkp        lctgv->sct_tkp
  1110. #define ct_sfxctp    lctgv->sct_sfxctp
  1111. #define ct_lnode    lctgv->sct_lnode
  1112. #define ct_fnode    lctgv->sct_fnode
  1113. #define ct_nwnod    lctgv->sct_nwnod
  1114. #define btlev        lctgv->sbtlev
  1115. #define uerr_cod    suerr_cod[sOWNR]
  1116. #define sysiocod    ssysiocod[sOWNR]
  1117. #define isam_err    sisam_err[sOWNR]
  1118. #define isam_fil    sisam_fil[sOWNR]
  1119. #define sql_len        ssql_len[sOWNR]
  1120. #define sql_status1    ssql_status1[sOWNR]
  1121. #define sql_status2    ssql_status2[sOWNR]
  1122. #define ct_uflvr    lctgv->sct_uflvr
  1123. #define ct_ualgn    lctgv->sct_ualgn
  1124. #define ct_upntr    lctgv->sct_upntr
  1125. #define ct_buf        lctgv->sct_buf
  1126. #define ct_gsrl        lctgv->sct_gsrl
  1127. #define ct_rbuf        lctgv->sb_ct_rbuf
  1128. #define ct_pbuf        lctgv->sb_ct_pbuf
  1129. #define rerr_cod    lctgv->sb_rerr_cod
  1130. #define rerr_fil    lctgv->sb_rerr_fil
  1131. #define ct_fp        lctgv->sb_ct_fp
  1132. #define ct_redom    lctgv->sb_ct_redom
  1133. #define ct_bsz        lctgv->sb_ct_bsz
  1134. #define ct_spc        lctgv->sb_ct_spc
  1135.  
  1136. #else /* MULTITRD */
  1137.  
  1138. EXTERN BATHDR  ctbatch;
  1139. EXTERN LONG    ct_spc;
  1140. EXTERN LONG    ct_npath[MAXLEV];/* array to trace path down B-tree. Assumes  */
  1141.                 /* maximum of MAXLEV - 1 levels in B-tree.   */
  1142. #ifdef ctOldALCBAT
  1143. EXTERN COUNT   ctbatnum;
  1144. EXTERN COUNT   ctbatmax;
  1145. EXTERN pBATHDR ct_savbat;
  1146. #else
  1147. EXTERN pSAVBAT ctbatnum;
  1148. EXTERN ppSAVBAT
  1149.            ct_savbat;
  1150. #endif
  1151. EXTERN COUNT ct_nelem[MAXLEV];
  1152. EXTERN COUNT ct_tight[MAXLEV];
  1153. EXTERN COUNT ct_melem[MAXLEV];
  1154. EXTERN COUNT ctconid;
  1155. EXTERN ppctICON
  1156.          ctconanc;    /* hash bins for context */
  1157. #ifdef TRANPROC
  1158. #define ct_ubit(owner)    sct_ubit
  1159. EXTERN ppSHADLST sct_ubit;    /* hash bins for srchshd */
  1160. EXTERN pTEXT ctmrklst;
  1161. EXTERN pTEXT ct_usrsp;
  1162. EXTERN pSHADLST ct_usrsl;
  1163. EXTERN VRLEN ct_usrsz;
  1164. EXTERN LONG  ctusrsum;
  1165. EXTERN LONG  ctusrtot;
  1166. EXTERN COUNT ct_usrsi;
  1167. EXTERN COUNT ct_usrsv;
  1168. EXTERN COUNT ct_rstflg;        /* TRANRST() flag */
  1169. #endif
  1170. EXTERN NINT  ctrbflg;
  1171. EXTERN ppLOKS ct_locks;
  1172. EXTERN ppLOKS ct_ltail;
  1173. EXTERN LONG   ctops;        /* set operation state bit mask        */
  1174. EXTERN VRLEN  ctxvlen;        /* vlen combined op max buffer length    */
  1175.                     
  1176. EXTERN TEXT ct_dupkey[MAXLEN+1];/* for searches of duplicate keys */
  1177. EXTERN TEXT spkey[MAXLEN+1];    /* temporary storage for key values during */
  1178.                 /* node updates                */
  1179.  
  1180. EXTERN COUNT ctusrprf;        /* user profile word */
  1181. EXTERN COUNT ct_elm;        /* position within B-Tree node    */
  1182. EXTERN COUNT ct_tky;        /* result of comparison between target    */
  1183.                 /* value and index entry.        */
  1184.                 /* ct_tky < 0 => target < index entry    */
  1185.                 /*      = 0 => target = index entry    */
  1186.                 /*      > 0 => target > index entry     */
  1187. EXTERN COUNT ct_tkp;        /* previous value of ct_tky        */
  1188. EXTERN COUNT ct_sfxctp;        /* previous value of suffix count    */
  1189. EXTERN LONG  ct_lnode;        /* last node found during walk down tree */
  1190. EXTERN LONG  ct_fnode;        /* node found during search/retrieval    */
  1191. EXTERN LONG  ct_nwnod;        /* pointer to new node */
  1192. EXTERN LONG  ct_gsrl;        /* next serial number for data file */
  1193. EXTERN COUNT ct_trdflg;        /* thread operation flag */
  1194. EXTERN COUNT btlev;        /* b-tree level counter. used as index of */
  1195.                 /* ct_npath                  */
  1196. EXTERN COUNT uerr_cod;        /* user error cod */
  1197. EXTERN COUNT sysiocod;        /* system error cod */
  1198. EXTERN COUNT isam_err;
  1199. EXTERN COUNT isam_fil;
  1200. EXTERN VRLEN sql_len;
  1201. EXTERN COUNT sql_status1;
  1202. EXTERN COUNT sql_status2;
  1203. EXTERN UTEXT ct_uflvr;
  1204. EXTERN UTEXT ct_ualgn;
  1205. EXTERN UTEXT ct_upntr;
  1206. EXTERN TEXT  ct_buf[CTBUFSIZ];    /* temporary io buffer */
  1207.  
  1208. #define ctumxfil    ct_mxfil
  1209. #define cthghfil    ct_mxfil
  1210.  
  1211. #endif
  1212.  
  1213. EXTERN UINT    ctlog9477;
  1214.  
  1215. #endif /* ctCLIENT */
  1216. #endif /* ctNOGLOBALS */
  1217.  
  1218. #endif /* ctGVARH */
  1219.  
  1220. /* end of ctgvar.h  */
  1221.