fur%netscape.com d6c51785c1 Added Todd Proebsting's BURG to the tree, now that it's in the public domain.
git-svn-id: svn://10.0.0.236/trunk@16557 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-17 06:36:50 +00:00

39 lines
583 B
C

char rcsid_symtab[] = "$Id: symtab.c,v 1.1 1998-12-17 06:36:49 fur%netscape.com Exp $";
#include <stdio.h>
#include <string.h>
#include "b.h"
#include "fe.h"
static List symtab;
Symbol
newSymbol(name) char *name;
{
Symbol s;
s = (Symbol) zalloc(sizeof(struct symbol));
assert(s);
s->name = name;
return s;
}
Symbol
enter(name, new) char *name; int *new;
{
List l;
Symbol s;
*new = 0;
for (l = symtab; l; l = l->next) {
s = (Symbol) l->x;
if (!strcmp(name, s->name)) {
return s;
}
}
*new = 1;
s = newSymbol(name);
symtab = newList(s, symtab);
return s;
}