Lines Matching refs:bucket
296 dict_bucket_t *bucket; in dict_get() local
299 for (bucket = hdl->dh_buckets[i]; bucket != NULL; in dict_get()
300 bucket = bucket->db_next) in dict_get()
301 if ((*hdl->dh_cmp)(key, bucket->db_key) == 0) in dict_get()
303 return (bucket ? bucket->db_value : NULL); in dict_get()
314 dict_bucket_t *bucket; in dict_put() local
318 for (bucket = hdl->dh_buckets[i]; bucket != NULL; in dict_put()
319 bucket = bucket->db_next) in dict_put()
320 if ((*hdl->dh_cmp)(key, bucket->db_key) == 0) in dict_put()
322 if (bucket) { in dict_put()
323 prev = bucket->db_value; in dict_put()
325 bucket = malloc(sizeof (dict_bucket_t)); in dict_put()
326 bucket->db_key = key; in dict_put()
327 bucket->db_next = hdl->dh_buckets[i]; in dict_put()
328 hdl->dh_buckets[i] = bucket; in dict_put()
332 bucket->db_value = value; in dict_put()
352 dict_bucket_t *bucket = *pbucket; in dict_remove() local
353 void *value = bucket->db_value; in dict_remove()
355 *pbucket = bucket->db_next; in dict_remove()
356 free(bucket); in dict_remove()
375 dict_bucket_t *bucket = NULL; in dict_map() local
379 for (bucket = hdl->dh_buckets[i]; bucket != NULL; in dict_map()
380 bucket = bucket->db_next) { in dict_map()
381 apply(bucket->db_key, &bucket->db_value, cl); in dict_map()