1: /* $Header$ */ 2: 3: /* 4: * Author: Peter J. Nicklin 5: */ 6: 7: /* 8: * htlookup() returns a pointer to a hash table entry if found, otherwise null. 9: */ 10: #include "null.h" 11: #include "hash.h" 12: #include "macro.h" 13: 14: HASHBLK * 15: htlookup(key, hash) 16: char *key; /* key for hash table entry */ 17: HASH *hash; /* hash table */ 18: { 19: HASHBLK *htb; /* hash table entry block */ 20: int hthash(); /* calculate hash value */ 21: 22: for (htb = (hash->hashtab)[hthash(key, hash)]; htb != NULL; htb = htb->h_next) 23: if (EQUAL(htb->h_key, key)) 24: return(htb); /* found */ 25: return(NULL); /* not found */ 26: }