Pristine Ack-5.5
[Ack-5.5.git] / util / ncgg / strlookup.c
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 #ifndef NORCSID
6 static char rcsid[]= "$Id: strlookup.c,v 0.3 1994/06/24 10:38:20 ceriel Exp $";
7 #endif
8
9 #include "param.h"
10
11 int nstrings=0;
12 char *l_strings[MAXSTRINGS];
13
14 strlookup(str) char *str; {
15         register i;
16         extern char *mystrcpy();
17
18         for(i=0;i<nstrings;i++)
19                 if (strcmp(str,l_strings[i])==0)
20                         return(i);
21         NEXT(nstrings,MAXSTRINGS,"String table");
22         l_strings[i] = mystrcpy(str);
23         return(i);
24 }