glosym.c 835 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. * Author: Hans van Staveren
  6. */
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include "param.h"
  10. #include "tables.h"
  11. #include "types.h"
  12. #include "glosym.h"
  13. #include "salloc.h"
  14. #include "glosym.h"
  15. glosym_p glolist= (glosym_p) 0;
  16. void enterglo(string name, word *romp)
  17. {
  18. glosym_p gp;
  19. int i;
  20. gp = (glosym_p) myalloc(sizeof *gp);
  21. gp->gl_next = glolist;
  22. gp->gl_name = (string) myalloc(strlen(name)+1);
  23. strcpy(gp->gl_name,name);
  24. for (i=0;i<=MAXROM;i++)
  25. gp->gl_rom[i] = romp[i];
  26. glolist = gp;
  27. }
  28. glosym_p lookglo(string name)
  29. {
  30. 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. }