Lines Matching refs:hash
37 hash_node_t **hash;
39 hash = (hash_node_t **)calloc(HASH_PRIME, sizeof (hash_node_t *));
40 return (hash);
44 nsc_insert_node(hash_node_t **hash, void *data, const char *key)
61 node->next = hash[ index ];
62 hash[ index ] = node;
71 * Searches the hash to find a node.
78 nsc_lookup(hash_node_t **hash, const char *key)
84 node = hash[ index ];
94 nsc_remove_node(hash_node_t **hash, char *key)
101 if (!hash[ index ]) {
105 if (strcmp(hash[ index ]->key, key) == 0) {
106 node = hash[ index ];
108 hash[ index ] = hash[ index ]->next;
113 prev = hash[ index ];
132 nsc_remove_all(hash_node_t **hash, void (*callback)(void *))
138 p = hash[ i ];
149 free(hash);
155 * Basic rotating hash, as per Knuth.
160 unsigned int hash, i;
162 for (hash = len, i = 0; i < len; i++) {
163 hash = (hash << 5) ^ (hash >> 27) ^ key[ i ];
165 return (hash % HASH_PRIME);