home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c004 / 3.ddi / NOVELL / CTSRVE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-04-18  |  4.0 KB  |  205 lines

  1. /*
  2.  *    c-tree Server Environment Dependent Code
  3.  *
  4.  *    This program is the CONFIDENTIAL and PROPRIETARY property 
  5.  *    of FairCom(R) Corporation. Any unauthorized use, reproduction or
  6.  *    transfer of this program is strictly prohibited.
  7.  *
  8.  *      Copyright (c) 1987, 1988, 1989 FairCom Corporation
  9.  *    (Subject to limited distribution and
  10.  *     restricted disclosure only.)
  11.  *    *** ALL RIGHTS RESERVED ***
  12.  *
  13.  *    4006 West Broadway
  14.  *    Columbia, MO 65203
  15.  *
  16.  *
  17.  *    c-tree(R)    Version 4.3
  18.  *            Release C
  19.  *            February 7, 1989 17:30
  20.  *
  21.  */
  22.  
  23. #include "ctstdr.h"
  24. #include "ctoptn.h"
  25. #include "ctstrc.h"
  26. #include "ctgvar.h"
  27. #include "cterrc.h"
  28. #include "ctcomm.h"
  29.  
  30. extern SSTATUS cts_stat;
  31. extern COUNT   cts_mxusr,cts_mxfil;
  32. TEXT         **chkcopy();
  33.  
  34. #define    rqsts    cts_stat.srqsts
  35. #define    redo    cts_stat.sredo
  36. #define    sets    cts_stat.ssets
  37. #define    waks    cts_stat.swaks
  38. #define    uwaks    cts_stat.suwaks
  39. #define    retry    cts_stat.sretry
  40. #define cts_wl    cts_stat.scts_wl
  41. #define cts_rl    cts_stat.scts_rl
  42. #define cts_ul    cts_stat.scts_ul
  43.  
  44. VOID stopsrvr()
  45. {
  46.     stpsrv(1L,2,-1);
  47. }
  48.  
  49. VOID prploop()
  50. {
  51.     initcomp();
  52. }
  53.  
  54. VOID  getsenv(pblk,argc,argv)
  55. SRVPRM         *pblk;
  56. int               argc;
  57. char               *argv[];
  58. {
  59.     TEXT *cp,**tpa;
  60.     COUNT i;
  61.  
  62.     pblk->spns  = CTS_NODSEC;
  63.     pblk->spbf  = CTS_BUFFER;
  64.     pblk->spsz  = CTS_MAXSMSG;
  65.     pblk->splk  = CTS_MAXLOK;
  66.     pblk->spky  = CTS_KEYOPS;
  67.  
  68. /*
  69.  * The c-tree Source Code License Agreement expressly prohibits you from
  70.  * modifying the copyright legend displayed by the following code.
  71.  */
  72.  
  73.     tpa = chkcopy();
  74.     for (i = 0; i < 7; i++) {
  75.         display("\n\r");
  76.         display(tpa[i]);
  77.     }
  78.  
  79.     display("\n\n\rusers:"); numdis(cts_mxusr);
  80.     display("  files:"); numdis(cts_mxfil);
  81.     display("  buffers:"); numdis(pblk->spbf);
  82.     display("\n\rnode sectors:"); numdis(pblk->spns);
  83.     display("  message size:"); numdis(pblk->spsz);
  84.     display("  locks:"); numdis(pblk->splk);
  85.     display("  key ops:"); numdis(pblk->spky);
  86.     display("\n\rlogin:"); numdis(login());
  87.     display ("\n\r");
  88.  
  89.     if (cts_mxusr < 1)
  90.         srvexit("Bad user value:",cts_mxusr,0);
  91.         
  92.     if (pblk->spsz < 256 || pblk->spsz < MAXLEN)
  93.         srvexit("Bad message length:",pblk->spsz,0);
  94. }
  95.  
  96. VOID signoff(ffrq,ausrcon,ausrmap,ausrtrn)
  97. LONG         ffrq[];
  98. USRCON         *ausrcon;
  99. COUNT             *ausrmap;
  100. LONG                 *ausrtrn;
  101. {
  102.     FAST CTFILE *ctnum;
  103.     FAST USRCON *u;
  104.     FAST RECLOK *r;
  105.     UCOUNT         sum;
  106.  
  107.     display("\n\rServer requests:");
  108.     lngdis(rqsts);
  109.  
  110.     display("\n\rWrite locks / Read locks / Unlocks: ");
  111.     lngdis(cts_wl); lngdis(cts_rl); lngdis(cts_ul);
  112.     display("\n\rRemaining locks:");
  113.     sum = 0;
  114.     for (ctnum = ct_key; ctnum < ct_key + cts_mxfil; ctnum++) {
  115.         r = ctnum->rlokh;
  116.         while (r != NULL) {
  117.             sum++;
  118.             r = r->rllink;
  119.         }
  120.     }
  121.     numdis(sum);
  122.  
  123.     display("\n\rRetries w/o block:");
  124.     lngdis(redo);
  125.  
  126.     display("\n\rBlock history: seg ops / seg clr / usr wak: ");
  127.     lngdis(sets); lngdis(waks); lngdis(uwaks);
  128.  
  129.     display("\n\rRetries after block:");
  130.     lngdis(retry);
  131.  
  132.     display("\n\rRemaining Segment Blocks:");
  133.     sum = 0;
  134.     for (u = ausrcon; u < ausrcon + cts_mxusr; u++) {
  135.         if (u->ucsgop != CTNONE || u->ucslep > -1)
  136.             sum++;
  137.     }
  138.     numdis(sum);
  139.     display("\n\n\r");
  140.  
  141.     for (sum = 0; sum < MAX_FUNC; sum++)
  142.         if (ffrq[sum] > 0) {
  143.             display("   F");
  144.             numdis(sum);
  145.             lngdis(ffrq[sum]);
  146.         }
  147.  
  148. #ifdef CTDEBUG
  149.     arep(0);
  150. #endif
  151.  
  152.     display("\n\r");
  153.     for (sum = 0; sum < cts_mxusr; sum++)
  154.         if (ausrtrn[sum]) {
  155.             display("  TRN/U");
  156.             numdis(sum);
  157.         } else if (ausrmap[sum]) {
  158.             display("  LOG/U");
  159.             numdis(sum);
  160.         }
  161. }
  162.  
  163. srvexit(msg,i,j)
  164. TEXT   *msg;
  165. int        i,j;
  166. {
  167.     srvmesg(msg,i,j);
  168.     display("\n\r");
  169.     killvap();
  170. }
  171.  
  172. srvmesg(msg,i,j)
  173. TEXT   *msg;
  174. int        i,j;
  175. {
  176.     display("\n\r");
  177.     display(msg);
  178.     if (i || j) {
  179.         display(": ");
  180.         numdis(i);
  181.         numdis(j);
  182.     }
  183.     return(0);
  184. }
  185.  
  186. transact(mode,usrn,usrtrn)
  187. COUNT     mode,usrn;
  188. LONG          *usrtrn;
  189. {
  190.     switch (mode) {
  191. case BEGTRAN:
  192.     usrtrn[usrn] = 1L;
  193.     break;
  194. case ENDTRAN:
  195.     usrtrn[usrn] = 0L;
  196.     break;
  197. default:
  198.     usrtrn[usrn] = 0L;
  199.     break;
  200.     }
  201.     return(NO_ERROR);
  202. }
  203.  
  204. /* end of ctsrve.c */
  205.