2 #ifndef TW_C_SDK_TWMAP_H
3 #define TW_C_SDK_TWMAP_H
5 #ifndef TW_FOREACH_CONTINUE
6 #define TW_FOREACH_CONTINUE 0
7 #define TW_FOREACH_EXIT 1
10 #define TW_MAP_MISSING -3
11 #define TW_MAP_FULL -2
12 #define TW_MAP_OMEM -1
36 int twMap_put(twMap* in,
const char* key,
void * value);
41 int twMap_get(twMap* in,
const char* key,
void * *arg);
46 int twMap_remove(twMap* in,
const char* key);
51 void twMap_free(twMap* in);
56 int twMap_length(twMap* in);
60 typedef void (*map_del_func) (
void * item);
61 typedef const char* (*map_key_parse_func) (
void * item);
62 twMap * twMap_Create(map_del_func delete_function,map_key_parse_func parse_func);
63 int twMap_Delete(twMap* in);
64 int twMap_Clear(twMap* in);
66 int twMap_Add(twMap* in,
void *value);
67 int twMap_Remove(twMap* in,
void * item,
char deleteValue);
69 typedef int (*twMap_foreach_fn)(
void *key,
size_t key_size,
void *data,
size_t data_size,
void *arg);
71 size_t twMap_Foreach(twMap* in, twMap_foreach_fn listHandler,
void *userData);
74 int twMap_Find(twMap* in,
void* query,
void** results);
76 int twMap_GetCount(twMap* in);
77 int twMap_ReplaceValue(twMap* in,
void * value,
void * new_value,
char dispose);