Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
last version of tesh
[simgrid.git] / tools / tesh2 / include / dictionary.h
1 #ifndef __dictionary_H
2 #define __dictionary_H
3
4 #include <htable.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 #ifndef __FN_FINALIZE_T_DEFINED
11 typedef int (*fn_finalize_t)(void**);
12 #define __FN_FINALIZE_T_DEFINED
13 #endif
14
15 typedef struct s_dictionary
16 {
17         htable_t htable;
18 }s_dictionary_t,* dictionary_t;
19
20
21 dictionary_t
22 dictionary_new(fn_finalize_t fn_finalize);
23
24 int
25 dictionary_set(dictionary_t dictionary,const char* key, const void* val);
26
27 void*
28 dictionary_get(dictionary_t dictionary,const char* key);
29
30 int
31 dictionary_free(dictionary_t* dictionaryptr);
32
33 int
34 dictionary_clear(dictionary_t dictionary);
35
36 int
37 dictionary_get_size(dictionary_t dictionary);
38
39 int
40 dictionary_is_empty(dictionary_t dictionary);
41
42 void*
43 dictionary_remove(dictionary_t dictionary,const char* key);
44
45 #ifdef __cplusplus
46 }
47 #endif
48
49
50 #endif /* !__dictionary_H */