ack/mach/proto/ncg/glosym.c
George Koehler e04166b85d More prototypes, less register in mach/proto/ncg
Files that #include "equiv.h" must do so after including "data.h", now
that a function prototype in equiv.h uses type rl_p from data.h.

Adjust style, changing some `for(...)` to `for (...)`.  The style in
mach/proto/ncg is less than consistent; the big annoyance now is that
some files want tabs at 4 spaces, others want tabs at 8 spaces.
2017-11-13 12:44:17 -05:00

42 lines
857 B
C

#ifndef NORCSID
static char rcsid[] = "$Id$";
#endif
#include <stdlib.h>
#include <string.h>
#include "param.h"
#include "tables.h"
#include "types.h"
#include "glosym.h"
/*
* (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
*/
static glosym_p glolist= (glosym_p) 0;
void enterglo(string name, word *romp) {
glosym_p gp;
int i;
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;
}
glosym_p lookglo(string name) {
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);
}