-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdict.h
24 lines (21 loc) · 931 Bytes
/
dict.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
Dictionary based on code by Morten Eriksen <[email protected]>.
*/
typedef struct dict Dict;
extern Dict *dict_init(unsigned int (*key2hash) (void *),
int (*key_cmp) (void *, void *));
extern void dict_clear(Dict *d);
extern int dict_enter(Dict *d, void *key, void *value);
extern void *dict_find_entry(Dict *d, void *key);
extern void dict_apply_to_all(Dict *d,
void (*func) (void *key, void *value, void *data),
void *data);
extern unsigned int dict_key2hash_string(void *key);
extern int dict_key_cmp_string(void *key1, void *key2);
extern unsigned int dict_key2hash_int(void *key);
extern int dict_key_cmp_int(void *key1, void *key2);
extern Dict * dict_clone(Dict *old, void * (*key_clone)(void*), void * (*value_clone)(void*));
extern Dict * dict_clone2(Dict * old,
void * (* key_clone)(void * key, void * data),
void * (* value_clone)(void * value, void * data),
void * data);