ack/mach/proto/cg/glosym.c

43 lines
844 B
C
Raw Normal View History

2019-05-10 17:11:54 +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".
*
* Author: Hans van Staveren
*/
#include <stdlib.h>
#include <string.h>
1984-05-18 21:27:39 +00:00
#include "param.h"
#include "tables.h"
#include "types.h"
#include "glosym.h"
2019-05-10 17:11:54 +00:00
#include "salloc.h"
1984-05-18 21:27:39 +00:00
glosym_p glolist= (glosym_p) 0;
2019-05-10 17:11:54 +00:00
void enterglo(string name,word *romp)
{
1984-05-18 21:27:39 +00:00
register glosym_p gp;
2019-05-10 17:11:54 +00:00
register int i;
1984-05-18 21:27:39 +00:00
gp = (glosym_p) myalloc(sizeof *gp);
gp->gl_next = glolist;
gp->gl_name = (string) myalloc(strlen(name)+1);
strcpy(gp->gl_name,name);
for (i=0;i<=MAXROM;i++)
gp->gl_rom[i] = romp[i];
glolist = gp;
}
2019-05-10 17:11:54 +00:00
glosym_p lookglo(string name)
{
1984-05-18 21:27:39 +00:00
register glosym_p gp;
for (gp=glolist;gp != (glosym_p) 0; gp=gp->gl_next)
if (strcmp(gp->gl_name,name)==0)
return(gp);
return((glosym_p) 0);
}