• Home
  • Raw
  • Download

Lines Matching refs:ht

79 	struct util_hash_table *ht;  in util_hash_table_create()  local
81 ht = malloc(sizeof(struct util_hash_table)); in util_hash_table_create()
82 if(!ht) in util_hash_table_create()
85 ht->head = util_hash_create(); in util_hash_table_create()
86 if(!ht->head) { in util_hash_table_create()
87 free(ht); in util_hash_table_create()
91 ht->make_hash = hash; in util_hash_table_create()
92 ht->compare = compare; in util_hash_table_create()
94 return ht; in util_hash_table_create()
98 util_hash_table_find_iter(struct util_hash_table *ht, in util_hash_table_find_iter() argument
104 iter = util_hash_find(ht->head, key_hash); in util_hash_table_find_iter()
107 if (!ht->compare(item->key, key)) in util_hash_table_find_iter()
116 util_hash_table_find_item(struct util_hash_table *ht, in util_hash_table_find_item() argument
122 iter = util_hash_find(ht->head, key_hash); in util_hash_table_find_item()
125 if (!ht->compare(item->key, key)) in util_hash_table_find_item()
134 util_hash_table_set(struct util_hash_table *ht, void *key, void *value) in util_hash_table_set() argument
140 assert(ht); in util_hash_table_set()
141 if (!ht) in util_hash_table_set()
144 key_hash = ht->make_hash(key); in util_hash_table_set()
146 item = util_hash_table_find_item(ht, key, key_hash); in util_hash_table_set()
160 iter = util_hash_insert(ht->head, key_hash, item); in util_hash_table_set()
167 drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key) in util_hash_table_get() argument
172 assert(ht); in util_hash_table_get()
173 if (!ht) in util_hash_table_get()
176 key_hash = ht->make_hash(key); in util_hash_table_get()
178 item = util_hash_table_find_item(ht, key, key_hash); in util_hash_table_get()
185 drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key) in util_hash_table_remove() argument
191 assert(ht); in util_hash_table_remove()
192 if (!ht) in util_hash_table_remove()
195 key_hash = ht->make_hash(key); in util_hash_table_remove()
197 iter = util_hash_table_find_iter(ht, key, key_hash); in util_hash_table_remove()
205 util_hash_erase(ht->head, iter); in util_hash_table_remove()
208 drm_private void util_hash_table_clear(struct util_hash_table *ht) in util_hash_table_clear() argument
213 assert(ht); in util_hash_table_clear()
214 if (!ht) in util_hash_table_clear()
217 iter = util_hash_first_node(ht->head); in util_hash_table_clear()
219 item = (struct util_hash_table_item *)util_hash_take(ht->head, util_hash_iter_key(iter)); in util_hash_table_clear()
221 iter = util_hash_first_node(ht->head); in util_hash_table_clear()
225 drm_private void util_hash_table_foreach(struct util_hash_table *ht, in util_hash_table_foreach() argument
232 assert(ht); in util_hash_table_foreach()
233 if (!ht) in util_hash_table_foreach()
236 iter = util_hash_first_node(ht->head); in util_hash_table_foreach()
244 drm_private void util_hash_table_destroy(struct util_hash_table *ht) in util_hash_table_destroy() argument
249 assert(ht); in util_hash_table_destroy()
250 if (!ht) in util_hash_table_destroy()
253 iter = util_hash_first_node(ht->head); in util_hash_table_destroy()
260 util_hash_delete(ht->head); in util_hash_table_destroy()
261 free(ht); in util_hash_table_destroy()