1: # include "stdio.h"
2: hash (s)
3: char *s;
4: {
5: int c, n;
6: for(n=0; c= *s; s++)
7: n += (c*n+ c << (n%4));
8: return(n>0 ? n : -n);
9: }
10: err (s, a)
11: char *s;
12: {
13: fprintf(stderr, "Error: ");
14: fprintf(stderr, s, a);
15: putc('\n', stderr);
16: cleanup();
17: exit(1);
18: }
19: prefix(t, s)
20: char *t, *s;
21: {
22: int c, d;
23: while ( (c= *t++) == *s++)
24: if (c==0) return(1);
25: return(c==0 ? 1: 0);
26: }
27: mindex(s, c)
28: char *s;
29: {
30: register char *p;
31: for( p=s; *p; p++)
32: if (*p ==c)
33: return(p);
34: return(0);
35: }
36: zalloc(m,n)
37: {
38: int t;
39: # if D1
40: fprintf(stderr, "calling calloc for %d*%d bytes\n",m,n);
41: # endif
42: t = calloc(m,n);
43: # if D1
44: fprintf(stderr, "calloc returned %o\n", t);
45: # endif
46: return(t);
47: }
Defined functions
err
defined in line
10; used 20 times
hash
defined in line
2; used 2 times