Lines Matching refs:key_hash
61 struct key_hash { struct
62 SLIST_ENTRY(key_hash) link;
69 SLIST_HEAD(key_hash_head, key_hash); argument
181 struct key_hash *key_hash; in cdbw_put_key() local
191 SLIST_FOREACH(key_hash, head, link) { in cdbw_put_key()
192 if (key_hash->keylen != keylen) in cdbw_put_key()
194 if (key_hash->hashes[0] != hashes[0]) in cdbw_put_key()
196 if (key_hash->hashes[1] != hashes[1]) in cdbw_put_key()
198 if (key_hash->hashes[2] != hashes[2]) in cdbw_put_key()
200 if (memcmp(key, key_hash->key, keylen)) in cdbw_put_key()
204 key_hash = malloc(sizeof(*key_hash)); in cdbw_put_key()
205 if (key_hash == NULL) in cdbw_put_key()
207 key_hash->key = malloc(keylen); in cdbw_put_key()
208 if (key_hash->key == NULL) { in cdbw_put_key()
209 free(key_hash); in cdbw_put_key()
212 memcpy(key_hash->key, key, keylen); in cdbw_put_key()
213 key_hash->hashes[0] = hashes[0]; in cdbw_put_key()
214 key_hash->hashes[1] = hashes[1]; in cdbw_put_key()
215 key_hash->hashes[2] = hashes[2]; in cdbw_put_key()
216 key_hash->keylen = keylen; in cdbw_put_key()
217 key_hash->idx = idx; in cdbw_put_key()
218 SLIST_INSERT_HEAD(head, key_hash, link); in cdbw_put_key()
237 while ((key_hash = SLIST_FIRST(head)) != NULL) { in cdbw_put_key()
240 (key_hash->hashes[0] & (new_hash_size - 1)); in cdbw_put_key()
241 SLIST_INSERT_HEAD(head2, key_hash, link); in cdbw_put_key()
255 struct key_hash *key_hash; in cdbw_close() local
260 while ((key_hash = SLIST_FIRST(head)) != NULL) { in cdbw_close()
262 free(key_hash->key); in cdbw_close()
263 free(key_hash); in cdbw_close()
373 struct key_hash *key_hash; in build_graph() local
382 SLIST_FOREACH(key_hash, head, link) { in build_graph()
383 e->idx = key_hash->idx; in build_graph()
384 mi_vector_hash(key_hash->key, key_hash->keylen, in build_graph()