74#include "xtc_export.h"
81typedef struct xtc_chash xtc_chash_t;
87typedef int (*xtc_chash_cmp_fn)(
const void *a,
const void *b);
91typedef uint64_t (*xtc_chash_hash_fn)(
const void *key);
110XTC_API
int xtc_chash_create(xtc_chash_cmp_fn cmp, xtc_chash_hash_fn hash,
111 size_t initial_capacity, xtc_chash_t **out);
120XTC_API
void xtc_chash_destroy(xtc_chash_t *h);
131XTC_API
int xtc_chash_get(xtc_chash_t *h,
const void *key,
void **out_value);
143XTC_API
int xtc_chash_insert(xtc_chash_t *h,
void *key,
void *value,
144 void **out_old_value);
154XTC_API
int xtc_chash_remove(xtc_chash_t *h,
const void *key,
void **out_value);
159XTC_API
size_t xtc_chash_size(
const xtc_chash_t *h);
177XTC_API
void xtc_chash_set_auto_shrink(xtc_chash_t *h,
int on);
178XTC_API
int xtc_chash_get_auto_shrink(
const xtc_chash_t *h);