45 if (allocator ==
NULL)
112 da[k++] = dir = cmp > 0;
206 return p ==
NULL || *p == item ?
NULL : *p;
217 if (p ==
NULL || *p == item)
682 copy_error_recovery(
struct avl_node **stack,
int height,
687 for (; height > 2; height -= 2)
719 if (new->avl_count == 0)
723 y = (
struct avl_node *)&
new->avl_root;
729 new->avl_alloc->libavl_malloc(new->avl_alloc,
732 if (y != (
struct avl_node *)&new->avl_root) {
737 copy_error_recovery(stack, height,
new, destroy);
741 stack[height++] = (
struct avl_node *)x;
756 copy_error_recovery(stack, height,
new, destroy);
763 new->avl_alloc->libavl_malloc(new->avl_alloc,
766 copy_error_recovery(stack, height,
new, destroy);
struct avl_table * avl_copy(const struct avl_table *org, avl_copy_func *copy, avl_item_func *destroy, struct libavl_allocator *allocator)
void avl_destroy(struct avl_table *tree, avl_item_func *destroy)
void avl_item_func(void *avl_item, void *avl_param)
void * avl_delete(struct avl_table *tree, const void *item)
void *(* libavl_malloc)(struct libavl_allocator *, size_t libavl_size)
void * avl_t_next(struct avl_traverser *trav)
struct avl_node * avl_node
void *() avl_assert_delete(struct avl_table *table, void *item)
unsigned long avl_generation
struct avl_table * avl_create(avl_comparison_func *compare, void *param, struct libavl_allocator *allocator)
void * avl_t_insert(struct avl_traverser *trav, struct avl_table *tree, void *item)
struct avl_node * avl_link[2]
void() avl_assert_insert(struct avl_table *table, void *item)
unsigned long avl_generation
void(* libavl_free)(struct libavl_allocator *, void *libavl_block)
void avl_free(struct libavl_allocator *allocator, void *block)
void * avl_copy_func(void *avl_item, void *avl_param)
void * avl_insert(struct avl_table *table, void *item)
void * avl_t_find(struct avl_traverser *trav, struct avl_table *tree, void *item)
void * avl_t_prev(struct avl_traverser *trav)
void * avl_find(const struct avl_table *tree, const void *item)
void * avl_t_cur(struct avl_traverser *trav)
struct avl_node * avl_stack[AVL_MAX_HEIGHT]
#define assert(condition)
void * avl_t_replace(struct avl_traverser *trav, void *new)
int avl_comparison_func(const void *avl_a, const void *avl_b, void *avl_param)
void ** avl_probe(struct avl_table *tree, void *item)
struct avl_node * avl_root
struct libavl_allocator avl_allocator_default
void * avl_t_copy(struct avl_traverser *trav, const struct avl_traverser *src)
void * avl_replace(struct avl_table *table, void *item)
void * avl_t_first(struct avl_traverser *trav, struct avl_table *tree)
int compare(const void *a, const void *b)
avl_comparison_func * avl_compare
struct libavl_allocator * avl_alloc
void * avl_malloc(struct libavl_allocator *allocator, size_t size)
void avl_t_init(struct avl_traverser *trav, struct avl_table *tree)
struct avl_table * avl_table
void * avl_t_last(struct avl_traverser *trav, struct avl_table *tree)