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 stopsrvr()
- {
- stpsrv(1L,2,-1);
- }
-
- VOID prploop()
- {
- initcomp();
- }
-
- 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.
- */
-
- tpa = chkcopy();
- for (i = 0; i < 7; i++) {
- display("\n\r");
- display(tpa[i]);
- }
-
- display("\n\n\rusers:"); numdis(cts_mxusr);
- display(" files:"); numdis(cts_mxfil);
- display(" buffers:"); numdis(pblk->spbf);
- display("\n\rnode sectors:"); numdis(pblk->spns);
- display(" message size:"); numdis(pblk->spsz);
- display(" locks:"); numdis(pblk->splk);
- display(" key ops:"); numdis(pblk->spky);
- display("\n\rlogin:"); numdis(login());
- display ("\n\r");
-
- 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 signoff(ffrq,ausrcon,ausrmap,ausrtrn)
- LONG ffrq[];
- USRCON *ausrcon;
- COUNT *ausrmap;
- LONG *ausrtrn;
- {
- FAST CTFILE *ctnum;
- FAST USRCON *u;
- FAST RECLOK *r;
- UCOUNT sum;
-
- display("\n\rServer requests:");
- lngdis(rqsts);
-
- display("\n\rWrite locks / Read locks / Unlocks: ");
- lngdis(cts_wl); lngdis(cts_rl); lngdis(cts_ul);
- display("\n\rRemaining locks:");
- sum = 0;
- for (ctnum = ct_key; ctnum < ct_key + cts_mxfil; ctnum++) {
- r = ctnum->rlokh;
- while (r != NULL) {
- sum++;
- r = r->rllink;
- }
- }
- numdis(sum);
-
- display("\n\rRetries w/o block:");
- lngdis(redo);
-
- display("\n\rBlock history: seg ops / seg clr / usr wak: ");
- lngdis(sets); lngdis(waks); lngdis(uwaks);
-
- display("\n\rRetries after block:");
- lngdis(retry);
-
- display("\n\rRemaining Segment Blocks:");
- sum = 0;
- for (u = ausrcon; u < ausrcon + cts_mxusr; u++) {
- if (u->ucsgop != CTNONE || u->ucslep > -1)
- sum++;
- }
- numdis(sum);
- display("\n\n\r");
-
- for (sum = 0; sum < MAX_FUNC; sum++)
- if (ffrq[sum] > 0) {
- display(" F");
- numdis(sum);
- lngdis(ffrq[sum]);
- }
-
- #ifdef CTDEBUG
- arep(0);
- #endif
-
- display("\n\r");
- for (sum = 0; sum < cts_mxusr; sum++)
- if (ausrtrn[sum]) {
- display(" TRN/U");
- numdis(sum);
- } else if (ausrmap[sum]) {
- display(" LOG/U");
- numdis(sum);
- }
- }
-
- srvexit(msg,i,j)
- TEXT *msg;
- int i,j;
- {
- srvmesg(msg,i,j);
- display("\n\r");
- killvap();
- }
-
- srvmesg(msg,i,j)
- TEXT *msg;
- int i,j;
- {
- display("\n\r");
- display(msg);
- if (i || j) {
- display(": ");
- numdis(i);
- numdis(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 */
-