6#ifndef CLIBS_DICTIONARY_H
7#define CLIBS_DICTIONARY_H
72bool dict_has_key(
const struct dictionary *,
const void *key,
size_t key_size );
74const void *
dict_get_val(
const struct dictionary *,
const void *key,
size_t key_size );
98#define dict_printn( DICTIONARY ) \
101 printf( "\"" #DICTIONARY "\" " ); \
102 dict_print( DICTIONARY ); \
106#define dict_printn_as( DICTIONARY, KEY_PRINT_FUNC, VAL_PRINT_FUNC ) \
109 printf( "\"" #DICTIONARY "\" " ); \
110 dict_print_as( DICTIONARY, KEY_PRINT_FUNC, VAL_PRINT_FUNC ); \
int dict_item_val_cmp(const void *, const void *)
struct dictionary * dict_init(void)
void dict_print_as(const struct dictionary *, PrintFunction key_print, PrintFunction val_print)
enum DictRemoveRV dict_remove(struct dictionary *, const void *key_data, size_t key_size)
void dict_destroy(struct dictionary *)
size_t dict_size(const struct dictionary *)
int dict_insert_f(struct dictionary *, const void *key, size_t key_size, const void *val, size_t val_size, PrintFunction key_print, PrintFunction val_print)
const void * dict_get_val(const struct dictionary *, const void *key, size_t key_size)
bool dict_has_key(const struct dictionary *, const void *key, size_t key_size)
DictInsertRV
Definition dictionary.h:20
@ DICTINSERT_INSERTED
Definition dictionary.h:21
@ DICTINSERT_WAS_IN
Definition dictionary.h:22
int dict_insert(struct dictionary *, const void *key, size_t key_size, const void *val, size_t val_size)
int dict_set_val(struct dictionary *, const void *key, size_t key_size, const void *val, size_t val_size)
struct dictionary Dictionary
Definition dictionary.h:12
int dict_item_cmp(const void *, const void *)
DictRemoveRV
Definition dictionary.h:15
@ DICTREMOVE_REMOVED
Definition dictionary.h:16
@ DICTREMOVE_NOT_FOUND
Definition dictionary.h:17
void dict_print(const struct dictionary *)
int dict_item_key_cmp(const void *, const void *)
void(* PrintFunction)(const void *, size_t)
Interface for functions that print data.
Definition item_print_functions.h:17