1#ifndef TOOLBOX_HASHTABLE_H
2#define TOOLBOX_HASHTABLE_H
4#include "toolbox/return_codes.h"
10#ifndef HASHTABLE_SIZE_BYTES
11#define HASHTABLE_SIZE_BYTES (1024*1024)
20__attribute__((__pure__))
22hashtable_create(
void);
25hashtable_destroy(
struct hashtable **self);
27__attribute__((__pure__))
29hashtable_contain_item(
const struct hashtable *self
30 ,
const void* item,
const size_t item_size);
32__attribute__((__pure__))
34hashtable_contain_key(
const struct hashtable *self
37__attribute__((__pure__))
39hashtable_contain_key_hash(
const struct hashtable *self
40 ,
const size_t key_hash);
42__attribute__((__pure__))
47__attribute__((__pure__))
49hashtable_get_or_default(
const struct hashtable *self
51 ,
const void *default_item);
53__attribute__((__pure__))
55hashtable_is_empty(
const struct hashtable *self);
60 ,
const void *item,
const size_t item_size);
63hashtable_remove(
struct hashtable *self,
const char *key);
66hashtable_remove_if_equal(
struct hashtable *self
68 ,
const void *item,
const size_t item_size);
73 ,
const void *item,
const size_t item_size);
76hashtable_replace_if_equal(
struct hashtable *self
78 ,
const void *restrict old_item
79 ,
const size_t item_old_size
80 ,
const void *restrict new_item
81 ,
const size_t item_new_size);
84hashtable_used_size(
const struct hashtable *self);
88 ,
void (*for_each)(
void *item,
size_t *item_size));
Definition: hashtable.c:29