13#define ANOMAP_DECLARE_COMPARE_FUNCTION(function_name, data_type) \
15 function_name(const void *a, const void *b) { \
16 if (*(data_type *)a == *(data_type *)b) return 0; \
17 return *(data_type *)a > *(data_type *)b ? 1 : -1; \
31 int (*cmp)(
const void *,
const void *));
58 void *key,
void *val);
61 size_t from_index,
size_t to_index,
62 void *keys,
void *vals);
64 size_t from_index,
size_t to_index,
65 void *keys,
void *vals);
size_t anomap_copy_range(struct anomap *map, size_t from_index, size_t to_index, void *keys, void *vals)
anomap_operation
Definition: anomap.h:20
@ anomap_update
Definition: anomap.h:22
@ anomap_insert
Definition: anomap.h:21
@ anomap_delete
Definition: anomap.h:24
@ anomap_getval
Definition: anomap.h:25
@ anomap_upsert
Definition: anomap.h:23
void anomap_on_item_changed(struct anomap *map, struct anomap_item_changed *item_changed)
Definition: anomap.h:44
bool anomap_at_index(struct anomap *map, size_t index, void *key, void *val)
enum anomap_operation anomap_do(struct anomap *map, enum anomap_operation operation, void *key, void *val)
size_t anomap_length(struct anomap *map)
bool anomap_index_of(struct anomap *map, void *key, size_t *index)
void anomap_set_on_item_changed(struct anomap *map, anomap_on_item_changed *on_changed, void *data)
void anomap_clear(struct anomap *map)
size_t anomap_delete_range(struct anomap *map, size_t from_index, size_t to_index, void *keys, void *vals)
struct anomap * anomap_create(size_t key_size, size_t val_size, int(*cmp)(const void *, const void *))
void anomap_destroy(struct anomap *map)
void * key
Definition: anomap.h:37
void * now
Definition: anomap.h:40
void * prev
Definition: anomap.h:39
void * data
Definition: anomap.h:35
struct anomap_item_changed::@12 val
enum anomap_operation op
Definition: anomap.h:36