2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
21 char *comname
= "/usr/lib/refer/eign";
25 static char cbuf
[COMNUM
*9];
26 static char *cwds
[COMTSIZE
];
30 extern char *trimnl();
32 static void cominit(void);
33 static int c_look(char *, int);
38 if (cgate
== 0) cominit();
39 return (c_look(s
, 1));
48 f
= fopen(comname
, "r");
52 for (i
= 0; i
< comcount
; i
++) {
53 if (fgets(cbp
, 15, f
) == NULL
)
64 c_look(char *s
, int fl
)
67 h
= hash(s
) % (COMTSIZE
);
68 while (cwds
[h
] != 0) {
69 if (strcmp(s
, cwds
[h
]) == 0)
71 h
= (h
+1) % (COMTSIZE
);