1 #ifndef ___COLL_AL_MAP_H___
2 #define ___COLL_AL_MAP_H___
21 #define COLL_AL_MAP_DEFAULT_CAPACITY 25
22 #define E_COLL_AL_MAP_ALLOC_FAILED 10
23 #define E_COLL_AL_MAP_NULL 11
24 #define E_COLL_AL_MAP_ALREADY_EXISTS 12
25 #define E_COLL_AL_MAP_KEY_NULL 13
26 #define E_COLL_AL_MAP_COMPARE_FN_NULL 15
27 #define E_COLL_AL_MAP_SUCCESS 0
29 typedef int (coll_al_map_compare_fn) (
void* first,
void* second);
31 typedef void (coll_al_map_iter_fn)(
size_t index,
void* key,
void* value);
34 coll_al_map_compare_fn* compare;
40 #define coll_al_map_keys(map) map->keys
41 #define coll_al_map_keys_length(map) arraylist_length(coll_al_map_keys(map))
42 #define coll_al_map_keys_get_idx(map, i) arraylist_get(coll_al_map_keys(map), i)
43 #define coll_al_map_values(map) map->values
44 #define coll_al_map_values_length(map) arraylist_length(coll_al_map_values(map))
45 #define coll_al_map_values_get_idx(map, i) arraylist_get(coll_al_map_values(map), i)
void free_coll_al_map(coll_al_map *map)
Definition: coll_arraylist_map.c:110
coll_al_map * make_coll_al_map_w_capacity(coll_al_map_compare_fn *compare, size_t initial_capacity)
Definition: coll_arraylist_map.c:8
bool coll_al_map_has(coll_al_map *map, void *key)
Definition: coll_arraylist_map.c:100
void * coll_al_map_get(coll_al_map *map, void *key)
Definition: coll_arraylist_map.c:56
void coll_al_map_foreach_fn(coll_al_map *map, coll_al_map_iter_fn *iter_fn)
Definition: coll_arraylist_map.c:118
bool coll_al_map_remove(coll_al_map *map, void *key, coll_al_map_iter_fn *iter_fn)
Definition: coll_arraylist_map.c:79
coll_al_map * make_coll_al_map(coll_al_map_compare_fn *compare)
Definition: coll_arraylist_map.c:4
int coll_al_map_put(coll_al_map *map, void *key, void *val)
Definition: coll_arraylist_map.c:33
Definition: coll_arraylist.h:80
Definition: coll_arraylist_map.h:33