Lines Matching refs:bucket
294 dict_bucket_t *bucket; in dict_get() local
297 for (bucket = hdl->dh_buckets[i]; bucket != NULL; in dict_get()
298 bucket = bucket->db_next) in dict_get()
299 if ((*hdl->dh_cmp)(key, bucket->db_key) == 0) in dict_get()
301 return (bucket ? bucket->db_value : NULL); in dict_get()
312 dict_bucket_t *bucket; in dict_put() local
316 for (bucket = hdl->dh_buckets[i]; bucket != NULL; in dict_put()
317 bucket = bucket->db_next) in dict_put()
318 if ((*hdl->dh_cmp)(key, bucket->db_key) == 0) in dict_put()
320 if (bucket) { in dict_put()
321 prev = bucket->db_value; in dict_put()
323 bucket = malloc(sizeof (dict_bucket_t)); in dict_put()
324 bucket->db_key = key; in dict_put()
325 bucket->db_next = hdl->dh_buckets[i]; in dict_put()
326 hdl->dh_buckets[i] = bucket; in dict_put()
330 bucket->db_value = value; in dict_put()
350 dict_bucket_t *bucket = *pbucket; in dict_remove() local
351 void *value = bucket->db_value; in dict_remove()
353 *pbucket = bucket->db_next; in dict_remove()
354 free(bucket); in dict_remove()
373 dict_bucket_t *bucket = NULL; in dict_map() local
377 for (bucket = hdl->dh_buckets[i]; bucket != NULL; in dict_map()
378 bucket = bucket->db_next) { in dict_map()
379 apply(bucket->db_key, &bucket->db_value, cl); in dict_map()