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".
6 static char rcsid[]= "$Id: lookup.c,v 0.3 1994/06/24 10:37:40 ceriel Exp $";
16 symbol dumsym; /* dummy to return in case of error */
18 symbol *lookup(name,type,style)
25 for (sy_pp = &symhash[hashvalue(name)];(sy_p= *sy_pp) != 0;sy_pp= &sy_p->sy_next) {
26 if (strcmp(sy_p->sy_name,name)!=0)
34 if (type==symany || type==sy_p->sy_type)
38 error("%s already defined",name);
48 fatal("%s is unknown symbol",name);
54 sy_p->sy_name = mystrcpy(name);
62 hashvalue(s) register char *s; {
63 register unsigned sum=0;
66 for(i=0;*s;s++,i=(i+3)&07)