Lines Matching refs:key
24 char key[0];
66 memcpy(n->key, str, len);
142 static struct dm_hash_node **_find(struct dm_hash_table *t, const char *key,
145 unsigned h = _hash(key, len) & (t->num_slots - 1);
152 if (!memcmp(key, (*c)->key, len))
159 void *dm_hash_lookup_binary(struct dm_hash_table *t, const char *key,
162 struct dm_hash_node **c = _find(t, key, len);
167 int dm_hash_insert_binary(struct dm_hash_table *t, const char *key,
170 struct dm_hash_node **c = _find(t, key, len);
175 struct dm_hash_node *n = _create_node(key, len);
189 void dm_hash_remove_binary(struct dm_hash_table *t, const char *key,
192 struct dm_hash_node **c = _find(t, key, len);
202 void *dm_hash_lookup(struct dm_hash_table *t, const char *key)
204 return dm_hash_lookup_binary(t, key, strlen(key) + 1);
207 int dm_hash_insert(struct dm_hash_table *t, const char *key, void *data)
209 return dm_hash_insert_binary(t, key, strlen(key) + 1, data);
212 void dm_hash_remove(struct dm_hash_table *t, const char *key)
214 dm_hash_remove_binary(t, key, strlen(key) + 1);
244 return n->key;
271 unsigned h = _hash(n->key, n->keylen) & (t->num_slots - 1);