glosym.c 911 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef NORCSID
  2. static char rcsid[] = "$Id$";
  3. #endif
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include "param.h"
  7. #include "tables.h"
  8. #include "types.h"
  9. #include "glosym.h"
  10. /*
  11. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  12. * See the copyright notice in the ACK home directory, in the file "Copyright".
  13. *
  14. * Author: Hans van Staveren
  15. */
  16. extern string myalloc();
  17. glosym_p glolist= (glosym_p) 0;
  18. enterglo(name,romp) string name; word *romp; {
  19. register glosym_p gp;
  20. register i;
  21. gp = (glosym_p) myalloc(sizeof *gp);
  22. gp->gl_next = glolist;
  23. gp->gl_name = (string) myalloc(strlen(name)+1);
  24. strcpy(gp->gl_name,name);
  25. for (i=0;i<=MAXROM;i++)
  26. gp->gl_rom[i] = romp[i];
  27. glolist = gp;
  28. }
  29. glosym_p lookglo(name) string name; {
  30. register glosym_p gp;
  31. for (gp=glolist;gp != (glosym_p) 0; gp=gp->gl_next)
  32. if (strcmp(gp->gl_name,name)==0)
  33. return(gp);
  34. return((glosym_p) 0);
  35. }