|
static void | cstl_hash_init (struct cstl_hash *const h, const size_t off) |
| Initialize a hash object.
|
|
size_t | cstl_hash_size (const struct cstl_hash *const h) |
| Get the number of objects in the hash.
|
|
float | cstl_hash_load (const struct cstl_hash *const h) |
| Get the average number of nodes per bucket.
|
|
void | cstl_hash_shrink_to_fit (struct cstl_hash *h) |
| Free memory associated with excess buckets.
|
|
void | cstl_hash_resize (struct cstl_hash *h, size_t n, cstl_hash_func_t *f) |
| Resize the hash table.
|
|
void | cstl_hash_rehash (struct cstl_hash *h) |
| Rehash the hash table.
|
|
void | cstl_hash_insert (struct cstl_hash *h, size_t k, void *e) |
| Insert an item into the hash.
|
|
void * | cstl_hash_find (struct cstl_hash *h, size_t k, cstl_const_visit_func_t *visit, void *priv) |
| Lookup/find a previously inserted object in the hash.
|
|
void | cstl_hash_erase (struct cstl_hash *h, void *e) |
| Remove an object from the hash.
|
|
int | cstl_hash_foreach (struct cstl_hash *h, cstl_visit_func_t *visit, void *priv) |
| Visit each object within a hash table.
|
|
int | cstl_hash_foreach_const (const struct cstl_hash *h, cstl_const_visit_func_t *visit, void *priv) |
| Visit each object within a hash table.
|
|
void | cstl_hash_clear (struct cstl_hash *h, cstl_xtor_func_t *clr) |
| Remove all elements from the hash.
|
|
static void | cstl_hash_swap (struct cstl_hash *const a, struct cstl_hash *const b) |
| Swap the hash objects at the two given locations.
|
|
|
size_t | cstl_hash_div (size_t k, size_t m) |
| Hash by division.
|
|
size_t | cstl_hash_mul (size_t k, size_t m) |
| Hash by multiplication.
|
|