2
/* Author : Stephen Smalley, <sds@epoch.ncsc.mil> */
7
* Implementation of the symbol table type.
12
static unsigned int symhash(hashtab_t h, hashtab_key_t key)
22
for (p = keyp; ((size_t)(p - keyp)) < size; p++)
23
val = (val << 4 | (val >> (8*sizeof(unsigned int)-4))) ^ (*p);
24
return val & (h->size - 1);
27
static int symcmp(hashtab_t h __attribute__ ((unused)), hashtab_key_t key1, hashtab_key_t key2)
32
keyp1 = (char *) key1;
33
keyp2 = (char *) key2;
34
return strcmp(keyp1, keyp2);
38
int symtab_init(symtab_t * s, unsigned int size)
40
s->table = hashtab_create(symhash, symcmp, size);