75#include "xtc_export.h"
82typedef struct xtc_chash xtc_chash_t;
88typedef int (*xtc_chash_cmp_fn)(
const void *a,
const void *b);
92typedef uint64_t (*xtc_chash_hash_fn)(
const void *key);
111XTC_API
int xtc_chash_create(xtc_chash_cmp_fn cmp, xtc_chash_hash_fn hash,
112 size_t initial_capacity, xtc_chash_t **out);
121XTC_API
void xtc_chash_destroy(xtc_chash_t *h);
132XTC_API
int xtc_chash_get(xtc_chash_t *h,
const void *key,
void **out_value);
144XTC_API
int xtc_chash_insert(xtc_chash_t *h,
void *key,
void *value,
145 void **out_old_value);
155XTC_API
int xtc_chash_remove(xtc_chash_t *h,
const void *key,
void **out_value);
160XTC_API
size_t xtc_chash_size(
const xtc_chash_t *h);
178XTC_API
void xtc_chash_set_auto_shrink(xtc_chash_t *h,
int on);
179XTC_API
int xtc_chash_get_auto_shrink(
const xtc_chash_t *h);