strlookup.c 521 B

1234567891011121314151617181920212223242526
  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$";
  7. #endif
  8. #include <string.h>
  9. #include "param.h"
  10. #include "extern.h"
  11. int nstrings=0;
  12. char *l_strings[MAXSTRINGS];
  13. int strlookup(char *str)
  14. {
  15. int i;
  16. for(i=0;i<nstrings;i++)
  17. if (strcmp(str,l_strings[i])==0)
  18. return(i);
  19. NEXT(nstrings,MAXSTRINGS,"String table");
  20. l_strings[i] = mystrcpy(str);
  21. return(i);
  22. }