home *** CD-ROM | disk | FTP | other *** search
- /*
- * c-tree Server Environment Dependent Code
- *
- * This program is the CONFIDENTIAL and PROPRIETARY property
- * of FairCom(R) Corporation. Any unauthorized use, reproduction or
- * transfer of this program is strictly prohibited.
- *
- * Copyright (c) 1987, 1988, 1989 FairCom Corporation
- * (Subject to limited distribution and
- * restricted disclosure only.)
- * *** ALL RIGHTS RESERVED ***
- *
- * 4006 West Broadway
- * Columbia, MO 65203
- *
- *
- * c-tree(R) Version 4.3
- * Release C
- * February 7, 1989 17:30
- *
- */
-
- #include "ctstdr.h"
- #include "ctoptn.h"
- #include "ctstrc.h"
- #include "ctgvar.h"
- #include "cterrc.h"
- #include "ctcomm.h"
-
- extern SSTATUS cts_stat;
- extern COUNT cts_mxusr,cts_mxfil;
- TEXT **chkcopy();
-
- #define rqsts cts_stat.srqsts
- #define redo cts_stat.sredo
- #define sets cts_stat.ssets
- #define waks cts_stat.swaks
- #define uwaks cts_stat.suwaks
- #define retry cts_stat.sretry
- #define cts_wl cts_stat.scts_wl
- #define cts_rl cts_stat.scts_rl
- #define cts_ul cts_stat.scts_ul
-
- VOID getsenv(pblk,argc,argv)
- SRVPRM *pblk;
- int argc;
- char *argv[];
- {
- TEXT *cp,**tpa;
- COUNT i;
-
- pblk->spns = CTS_NODSEC;
- pblk->spbf = CTS_BUFFER;
- pblk->spsz = CTS_MAXSMSG;
- pblk->splk = CTS_MAXLOK;
- pblk->spky = CTS_KEYOPS;
-
- /*
- * The c-tree Source Code License Agreement expressly prohibits you from
- * modifying the copyright legend displayed by the following code.
- */
- printf("\n\n\n\t\tc-tree(R) SERVER V4.3 Release C\n");
- tpa = chkcopy();
- for (i = 0; i < 7; i++)
- printf("\n%s",tpa[i]);
-
- while (argc-- > 1) {
- switch (*(cp = *++argv)) {
-
- case 'K':
- case 'k':
- pblk->spky = atoi(++cp);
- break;
- case 'U':
- case 'u':
- cts_mxusr = atoi(++cp);
- break;
- case 'F':
- case 'f':
- cts_mxfil = atoi(++cp);
- break;
- case 'N':
- case 'n':
- pblk->spns = atoi(++cp);
- break;
- case 'Z':
- case 'z':
- pblk->spsz = atoi(++cp);
- break;
- case 'B':
- case 'b':
- pblk->spbf = atoi(++cp);
- break;
- case 'L':
- case 'l':
- pblk->splk = atoi(++cp);
- break;
- default:
- printf("\"%s\" is not recognized\n",cp);
- break;
- }
- }
-
- printf(
- "\n\nusers=%d files=%d buffers=%d sectors=%d message=%d locks=%d keyops=%d\n",
- cts_mxusr,cts_mxfil,pblk->spbf,pblk->spns,pblk->spsz,
- pblk->splk,pblk->spky);
-
- if (cts_mxusr < 1)
- srvexit("Bad user value:",cts_mxusr,0);
-
- if (pblk->spsz < 256 || pblk->spsz < MAXLEN)
- srvexit("Bad message length:",pblk->spsz,0);
- }
-
- VOID prploop()
- {
- }
-
- VOID signoff(ffrq,ausrcon,ausrmap,ausrtrn)
- LONG ffrq[];
- USRCON *ausrcon;
- COUNT *ausrmap;
- LONG *ausrtrn;
- {
- FAST CTFILE *ctnum;
- FAST USRCON *u;
- FAST RECLOK *r;
- UCOUNT sum;
-
- printf("\nServer requests: %ld",rqsts);
-
- printf("\nWrite locks: %ld Read locks: %ld Unlocks: %ld",
- cts_wl,cts_rl,cts_ul);
- printf("\nRemaining locks: ");
- sum = 0;
- for (ctnum = ct_key; ctnum < ct_key + cts_mxfil; ctnum++) {
- r = ctnum->rlokh;
- while (r != NULL) {
- sum++;
- r = r->rllink;
- }
- }
- printf("%d",sum);
-
- printf("\nRetries w/o block: %ld",redo);
-
- printf("\nBlock history: seg ops = %ld seg clr = %ld usr wak = %ld",
- sets,waks,uwaks);
- printf("\nRetries after block: %ld",retry);
-
- printf("\nRemaining Segment Blocks: ");
- sum = 0;
- for (u = ausrcon; u < ausrcon + cts_mxusr; u++) {
- if (u->ucsgop != CTNONE || u->ucslep > -1)
- sum++;
- }
- printf("%d\n\n",sum);
-
- for (sum = 0; sum < MAX_FUNC; sum++)
- if (ffrq[sum] > 0)
- printf("F%03d %5ld ",sum,ffrq[sum]);
- #ifdef CTDEBUG
- arep(0); /* dynamic memory analysis: supported in CTCLB2.C */
- #endif
-
- printf("\n");
- for (sum = 0; sum < cts_mxusr; sum++)
- if (ausrtrn[sum]) printf("U%03d TRN ",sum);
- else if (ausrmap[sum]) printf("U%03d LOG ",sum);
- }
-
- srvexit(msg,i,j)
- TEXT *msg;
- int i,j;
- {
- srvmesg(msg,i,j);
- printf("\n");
- exit(i);
- }
-
- srvmesg(msg,i,j)
- TEXT *msg;
- int i,j;
- {
- printf("\n%s",msg);
- if (i || j)
- printf(" %d %d",i,j);
- return(0);
- }
-
- transact(mode,usrn,usrtrn)
- COUNT mode,usrn;
- LONG *usrtrn;
- {
- switch (mode) {
- case BEGTRAN:
- usrtrn[usrn] = 1L;
- break;
- case ENDTRAN:
- usrtrn[usrn] = 0L;
- break;
- default:
- usrtrn[usrn] = 0L;
- break;
- }
- return(NO_ERROR);
- }
-
- /* end of ctsrve.c */
-