8 typedef struct word_map* word_map_t;
9 typedef struct word_map_node* word_node_t;
11 enum { AMAP_SORT_DESCENDING=0x00,
12 AMAP_SORT_ASCENDING=0x01 };
33 word_map_insert(word_map_t wm,
const char* key,
int val);
36 word_map_sort(word_map_t wm,
int(*compar)(
const void*,
const void*));
39 word_map_count(
const word_map_t wm);
42 word_count_inc(word_node_t node,
int value);
45 word_node_compare(
const word_node_t n1,
const word_node_t n2,
int opt);
word_map_t word_map_create(size_t n)
void word_map_foreach(const word_map_t wm, void(*fnct)(const char *, int))
apply a function to each item in word map
void word_map_nforeach(const word_map_t wm, void(*fnct)(const char *, int), int n)
apply a function to the first n word map items
void word_map_free(word_map_t words)
word_node_t word_map_find(const word_map_t wm, const char *word)