1: # include "stdio.h"
   2: char *comname "/usr/lib/eign";
   3: static int cgate 0;
   4: extern char *comname;
   5: # define COMNUM 500
   6: # define COMTSIZE 997
   7: int comcount 100;
   8: static char cbuf[COMNUM*9];
   9: static char *cwds[COMTSIZE];
  10: static char *cbp;
  11: 
  12: common (s)
  13:     char *s;
  14: {
  15: if (cgate==0) cominit();
  16: return (c_look(s, 1));
  17: }
  18: cominit()
  19: {
  20: int i;
  21: FILE *f;
  22: cgate=1;
  23: f = fopen(comname, "r");
  24: if (f==NULL) return;
  25: cbp=cbuf;
  26: for(i=0; i<comcount; i++)
  27:     {
  28:     if (fgets(cbp, 15, f)==NULL)
  29:         break;
  30:     trimnl(cbp);
  31:     c_look (cbp, 0);
  32:     while (*cbp++);
  33:     }
  34: fclose(f);
  35: }
  36: c_look (s, fl)
  37:     char *s;
  38: {
  39: int h;
  40: h = hash(s) % (COMTSIZE);
  41: while (cwds[h] != 0)
  42:     {
  43:     if (strcmp(s, cwds[h])==0)
  44:         return(1);
  45:     h = (h+1) % (COMTSIZE);
  46:     }
  47: if (fl==0)
  48:     cwds[h] = s;
  49: return(0);
  50: }

Defined functions

c_look defined in line 36; used 2 times
cominit defined in line 18; used 1 times
  • in line 15

Defined variables

cbp defined in line 10; used 5 times
cbuf defined in line 8; used 1 times
  • in line 25
cgate defined in line 3; used 2 times
comcount defined in line 7; used 3 times
comname declared in line 4; defined in line 2; used 2 times
cwds defined in line 9; used 3 times

Defined macros

COMNUM defined in line 5; used 1 times
  • in line 8
COMTSIZE defined in line 6; used 3 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 684
Valid CSS Valid XHTML 1.0 Strict