* Copyright (c) 1989 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Ozan Yigit at York University.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)look.c 5.5 (Berkeley) %G%";
* Facility: m4 macro processor
register unsigned long h
= 0;
h
= (h
<< 5) + h
+ *name
++;
* find name in the hash table
for (p
= hashtab
[hash(name
)]; p
!= nil
; p
= p
->nxtptr
)
if (STREQ(name
, p
->name
))
* hash and create an entry in the hash table.
* The new entry is added in front of a hash bucket.
p
= (ndptr
) xalloc(sizeof(struct ndblock
));
if (!(p
->type
& STATIC
)) {
* remove an entry from the hashtable
register ndptr xp
, tp
, mp
;
if (STREQ(mp
->name
, name
)) {