ack/util/ncgg/strlookup.c

28 lines
565 B
C
Raw Permalink Normal View History

1987-03-09 19:15:41 +00:00
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
1985-01-08 09:59:28 +00:00
#ifndef NORCSID
static char rcsid[] = "$Id$";
1985-01-08 09:59:28 +00:00
#endif
#include <string.h>
1985-01-08 09:59:28 +00:00
#include "param.h"
#include "subr.h"
#include "extern.h"
1985-01-08 09:59:28 +00:00
int nstrings = 0;
1985-01-08 09:59:28 +00:00
char *l_strings[MAXSTRINGS];
int strlookup(char *str)
{
register int i;
1985-01-08 09:59:28 +00:00
for (i = 0; i < nstrings; i++)
if (strcmp(str, l_strings[i]) == 0)
return (i);
NEXT(nstrings, MAXSTRINGS, "String table");
1985-01-08 09:59:28 +00:00
l_strings[i] = mystrcpy(str);
return (i);
1985-01-08 09:59:28 +00:00
}