Lines Matching refs:ht

208 	HT *ht;  in HT_new()  local
211 ht = xmalloc(sizeof *ht); in HT_new()
212 ht->size = 0; in HT_new()
213 ht->num_buckets = 8; in HT_new()
214 ht->buckets = xmalloc(ht->num_buckets * sizeof(ht_elt *)); in HT_new()
215 for (u = 0; u < ht->num_buckets; u ++) { in HT_new()
216 ht->buckets[u] = NULL; in HT_new()
218 return ht; in HT_new()
265 HT_expand(HT *ht) in HT_expand() argument
270 n = ht->num_buckets; in HT_expand()
280 for (e = ht->buckets[u]; e != NULL; e = f) { in HT_expand()
291 xfree(ht->buckets); in HT_expand()
292 ht->buckets = new_buckets; in HT_expand()
293 ht->num_buckets = n2; in HT_expand()
297 HT_put(HT *ht, const char *name, void *value) in HT_put() argument
304 k = (size_t)(hc & ((uint32_t)ht->num_buckets - 1)); in HT_put()
305 prev = &ht->buckets[k]; in HT_put()
316 ht->size --; in HT_put()
329 e->next = ht->buckets[k]; in HT_put()
330 ht->buckets[k] = e; in HT_put()
331 ht->size ++; in HT_put()
332 if (ht->size > ht->num_buckets) { in HT_put()
333 HT_expand(ht); in HT_put()
348 HT_get(const HT *ht, const char *name) in HT_get() argument
355 k = (size_t)(hc & ((uint32_t)ht->num_buckets - 1)); in HT_get()
356 for (e = ht->buckets[k]; e != NULL; e = e->next) { in HT_get()
365 HT_clear(HT *ht, void (*free_value)(void *value)) in HT_clear() argument
369 for (u = 0; u < ht->num_buckets; u ++) { in HT_clear()
373 for (e = ht->buckets[u]; e != NULL; e = f) { in HT_clear()
381 ht->buckets[u] = NULL; in HT_clear()
383 ht->size = 0; in HT_clear()
387 HT_free(HT *ht, void (*free_value)(void *value)) in HT_free() argument
389 HT_clear(ht, free_value); in HT_free()
390 xfree(ht->buckets); in HT_free()
391 xfree(ht); in HT_free()