• Home
  • Raw
  • Download

Lines Matching refs:ht

75 	struct util_hash_table *ht;  in util_hash_table_create()  local
77 ht = malloc(sizeof(struct util_hash_table)); in util_hash_table_create()
78 if(!ht) in util_hash_table_create()
81 ht->head = util_hash_create(); in util_hash_table_create()
82 if(!ht->head) { in util_hash_table_create()
83 free(ht); in util_hash_table_create()
87 ht->make_hash = hash; in util_hash_table_create()
88 ht->compare = compare; in util_hash_table_create()
90 return ht; in util_hash_table_create()
94 util_hash_table_find_iter(struct util_hash_table *ht, in util_hash_table_find_iter() argument
100 iter = util_hash_find(ht->head, key_hash); in util_hash_table_find_iter()
103 if (!ht->compare(item->key, key)) in util_hash_table_find_iter()
112 util_hash_table_find_item(struct util_hash_table *ht, in util_hash_table_find_item() argument
118 iter = util_hash_find(ht->head, key_hash); in util_hash_table_find_item()
121 if (!ht->compare(item->key, key)) in util_hash_table_find_item()
130 util_hash_table_set(struct util_hash_table *ht, void *key, void *value) in util_hash_table_set() argument
136 assert(ht); in util_hash_table_set()
137 if (!ht) in util_hash_table_set()
140 key_hash = ht->make_hash(key); in util_hash_table_set()
142 item = util_hash_table_find_item(ht, key, key_hash); in util_hash_table_set()
156 iter = util_hash_insert(ht->head, key_hash, item); in util_hash_table_set()
163 drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key) in util_hash_table_get() argument
168 assert(ht); in util_hash_table_get()
169 if (!ht) in util_hash_table_get()
172 key_hash = ht->make_hash(key); in util_hash_table_get()
174 item = util_hash_table_find_item(ht, key, key_hash); in util_hash_table_get()
181 drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key) in util_hash_table_remove() argument
187 assert(ht); in util_hash_table_remove()
188 if (!ht) in util_hash_table_remove()
191 key_hash = ht->make_hash(key); in util_hash_table_remove()
193 iter = util_hash_table_find_iter(ht, key, key_hash); in util_hash_table_remove()
201 util_hash_erase(ht->head, iter); in util_hash_table_remove()
204 drm_private void util_hash_table_clear(struct util_hash_table *ht) in util_hash_table_clear() argument
209 assert(ht); in util_hash_table_clear()
210 if (!ht) in util_hash_table_clear()
213 iter = util_hash_first_node(ht->head); in util_hash_table_clear()
215 item = (struct util_hash_table_item *)util_hash_take(ht->head, util_hash_iter_key(iter)); in util_hash_table_clear()
217 iter = util_hash_first_node(ht->head); in util_hash_table_clear()
221 drm_private void util_hash_table_foreach(struct util_hash_table *ht, in util_hash_table_foreach() argument
228 assert(ht); in util_hash_table_foreach()
229 if (!ht) in util_hash_table_foreach()
232 iter = util_hash_first_node(ht->head); in util_hash_table_foreach()
240 drm_private void util_hash_table_destroy(struct util_hash_table *ht) in util_hash_table_destroy() argument
245 assert(ht); in util_hash_table_destroy()
246 if (!ht) in util_hash_table_destroy()
249 iter = util_hash_first_node(ht->head); in util_hash_table_destroy()
256 util_hash_delete(ht->head); in util_hash_table_destroy()
257 free(ht); in util_hash_table_destroy()