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