15 #define HAT_HT_SUCCESS 0
16 #define HAT_HT_ERROR (-1)
int hat_ht_iter_key(hat_ht_iter_t i, uint8_t **key, size_t *key_size)
Get current key.
size_t hat_ht_count(hat_ht_t *t)
Number of elements in table.
int hat_ht_iter_key_u64(hat_ht_iter_t i, uint64_t *key)
Get current key (uint64_t key)
int hat_ht_set_i64(hat_ht_t *t, int64_t key, void *value)
Set element in table (int64_t key)
int hat_ht_del(hat_ht_t *t, uint8_t *key, size_t key_size)
Delete element from table.
size_t hat_ht_avg_count(hat_ht_t *t)
Initially estimated number of elements in table.
int hat_ht_del_u64(hat_ht_t *t, uint64_t key)
Delete element from table (uint64_t key)
int hat_ht_iter_key_s(hat_ht_iter_t i, char **key)
Get current key (string key)
int hat_ht_del_i64(hat_ht_t *t, int64_t key)
Delete element from table (int64_t key)
hat_ht_t * hat_ht_create(hat_allocator_t *a, size_t avg_count)
Create new hash table.
void * hat_ht_get_s(hat_ht_t *t, char *key)
Get element from table (string key)
void * hat_ht_get(hat_ht_t *t, uint8_t *key, size_t key_size)
Get element from table.
int hat_ht_iter_key_i64(hat_ht_iter_t i, int64_t *key)
Get current key (int64_t key)
int hat_ht_set_s(hat_ht_t *t, char *key, void *value)
Set element in table (string key)
void hat_ht_destroy(hat_ht_t *t)
Destroy hash table.
void * hat_ht_get_u64(hat_ht_t *t, uint64_t key)
Get element from table (uint64_t key)
int hat_ht_set_u64(hat_ht_t *t, uint64_t key, void *value)
Set element in table (uint64_t key)
int hat_ht_set(hat_ht_t *t, uint8_t *key, size_t key_size, void *value)
Set element in table.
int hat_ht_del_s(hat_ht_t *t, char *key)
Delete element from table (string key)
void * hat_ht_get_i64(hat_ht_t *t, int64_t key)
Get element from table (int64_t key)
struct hat_ht_t hat_ht_t
Hash table.
Definition: ht.h:23
hat_ht_iter_t hat_ht_iter_next(hat_ht_t *t, hat_ht_iter_t prev)
Get next iterator position.
int hat_ht_resize(hat_ht_t *t, size_t avg_count)
Reallocate hash table based on new average count.
int hat_ht_iter_value(hat_ht_iter_t i, void **value)
Get current value.
void * hat_ht_iter_t
Hash table iterator.
Definition: ht.h:26
Allocator base struct.
Definition: allocator.h:36