10 #ifndef ABC__misc__avl__avl_h
11 #define ABC__misc__avl__avl_h
20 #define ARGS(protos) protos
23 #define MAX(a,b) ((a) > (b) ? (a) : (b))
27 #define ALLOC(type, num) \
28 ((type *) malloc(sizeof(type) * (num)))
29 #define REALLOC(type, obj, num) \
30 ((type *) realloc((char *) obj, sizeof(type) * (num)))
63 #define AVL_BACKWARD 1
81 #define avl_is_member(tree, key) avl_lookup(tree, key, (char **) 0)
83 #define avl_foreach_item(table, gen, dir, key_p, value_p) \
84 for(gen = avl_init_gen(table, dir); \
85 avl_gen(gen, key_p, value_p) || (avl_free_gen(gen),0);)
void avl_free_table(avl_tree *tree, void(*)() key_free, void(*)() value_free)
avl_find_or_add(avl_tree *tree, char *key, char ***slot_p)
void avl_free_gen(avl_generator *gen)
avl_delete(avl_tree *tree, char **key_p, char **value_p)
avl_insert(avl_tree *tree, char *key, char *value)
int avl_count(avl_tree *tree)
void avl_foreach(avl_tree *tree, void(*)() func, int direction)
avl_last(avl_tree *tree, char **key_p, char **value_p)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
avl_gen(avl_generator *gen, char **key_p, char **value_p)
#define ABC_NAMESPACE_HEADER_END
avl_tree * avl_init_table(int(*)() compar)
avl_lookup(avl_tree *tree, char *key, char **value_p)
avl_first(avl_tree *tree, char **key_p, char **value_p)
avl_generator * avl_init_gen(avl_tree *tree, int dir)
int avl_numcmp(char *x, char *y)