Pristine Ack-5.5
[Ack-5.5.git] / mach / proto / cg / glosym.c
1 #ifndef NORCSID
2 static char rcsid[] = "$Id: glosym.c,v 2.3 1994/06/24 13:23:45 ceriel Exp $";
3 #endif
4
5 #include "param.h"
6 #include "tables.h"
7 #include "types.h"
8 #include "glosym.h"
9
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
17 extern string myalloc();
18
19 glosym_p glolist= (glosym_p) 0;
20
21 enterglo(name,romp) string name; word *romp; {
22         register glosym_p gp;
23         register i;
24
25         gp = (glosym_p) myalloc(sizeof *gp);
26         gp->gl_next = glolist;
27         gp->gl_name = (string) myalloc(strlen(name)+1);
28         strcpy(gp->gl_name,name);
29         for (i=0;i<=MAXROM;i++)
30                 gp->gl_rom[i] = romp[i];
31         glolist = gp;
32 }
33
34 glosym_p lookglo(name) string name; {
35         register glosym_p gp;
36
37         for (gp=glolist;gp != (glosym_p) 0; gp=gp->gl_next)
38                 if (strcmp(gp->gl_name,name)==0)
39                         return(gp);
40         return((glosym_p) 0);
41 }