18#define A_AVL_ROOT {A_NULL}
38#if defined(A_SIZE_POINTER) && (A_SIZE_POINTER + 0 > 3)
54#if defined(A_SIZE_POINTER) && (A_SIZE_POINTER + 0 > 3)
69#if defined(A_SIZE_POINTER) && (A_SIZE_POINTER + 0 > 3)
72 node->parent = parent;
94#if defined(__cplusplus)
215#if defined(__cplusplus)
225#define a_avl_entry(ptr, type, member) a_container_of(ptr, type, member)
243#define a_avl_foreach(cur, root) \
244 for (a_avl_node *cur = a_avl_head(root); cur; cur = a_avl_next(cur))
245#define A_AVL_FOREACH(cur, root) \
246 for (cur = a_avl_head(root); cur; cur = a_avl_next(cur))
264#define a_avl_foreach_reverse(cur, root) \
265 for (a_avl_node *cur = a_avl_tail(root); cur; cur = a_avl_prev(cur))
266#define A_AVL_FOREACH_REVERSE(cur, root) \
267 for (cur = a_avl_tail(root); cur; cur = a_avl_prev(cur))
285#define a_avl_pre_foreach(cur, root) \
286 for (a_avl_node *cur = (root)->node; cur; cur = a_avl_pre_next(cur))
287#define A_AVL_PRE_FOREACH(cur, root) \
288 for (cur = (root)->node; cur; cur = a_avl_pre_next(cur))
306#define a_avl_pre_foreach_reverse(cur, root) \
307 for (a_avl_node *cur = (root)->node; cur; cur = a_avl_pre_prev(cur))
308#define A_AVL_PRE_FOREACH_REVERSE(cur, root) \
309 for (cur = (root)->node; cur; cur = a_avl_pre_prev(cur))
327#define a_avl_post_foreach(cur, root) \
328 for (a_avl_node *cur = a_avl_post_head(root); cur; cur = a_avl_post_next(cur))
329#define A_AVL_POST_FOREACH(cur, root) \
330 for (cur = a_avl_post_head(root); cur; cur = a_avl_post_next(cur))
348#define a_avl_post_foreach_reverse(cur, root) \
349 for (a_avl_node *cur = a_avl_post_tail(root); cur; cur = a_avl_post_prev(cur))
350#define A_AVL_POST_FOREACH_REVERSE(cur, root) \
351 for (cur = a_avl_post_tail(root); cur; cur = a_avl_post_prev(cur))
370#define a_avl_fortear(cur, next, root) \
371 for (a_avl_node *next = A_NULL, *cur = a_avl_tear(root, &next); cur; cur = a_avl_tear(root, &next))
372#define A_AVL_FORTEAR(cur, next, root) \
373 for ((void)(next = A_NULL), cur = a_avl_tear(root, &next); cur; cur = a_avl_tear(root, &next))
a_avl_node * a_avl_insert(a_avl *root, a_avl_node *node, int(*cmp)(void const *, void const *))
insert specified node into AVL binary search tree
a_avl_node * a_avl_tear(a_avl *root, a_avl_node **next)
tear a node from AVL binary search tree
a_avl_node * a_avl_post_prev(a_avl_node *node)
access prev node of AVL binary search tree node postorder
a_avl_node * a_avl_post_next(a_avl_node *node)
access next node of AVL binary search tree node postorder
a_avl_node * a_avl_prev(a_avl_node *node)
access prev node of AVL binary search tree node in-order
a_avl_node * a_avl_init(a_avl_node *node, a_avl_node *parent)
initialize for AVL binary search tree node
Definition avl.h:67
a_avl_node * a_avl_head(a_avl const *root)
access head node of AVL binary search tree in-order
a_avl_node * a_avl_pre_next(a_avl_node *node)
access next node of AVL binary search tree node preorder
a_avl_node * a_avl_pre_prev(a_avl_node *node)
access prev node of AVL binary search tree node preorder
a_avl_node * a_avl_tail(a_avl const *root)
access tail node of AVL binary search tree in-order
a_avl_node * a_avl_search(a_avl const *root, void const *ctx, int(*cmp)(void const *, void const *))
search specified content from AVL binary search tree
void a_avl_insert_adjust(a_avl *root, a_avl_node *node)
rebalance the tree after insertion of the specified node
a_avl_node * a_avl_post_head(a_avl const *root)
access head node of AVL binary search tree postorder
void a_avl_root(a_avl *root)
initialize for AVL binary search tree root
Definition avl.h:92
a_avl_node * a_avl_post_tail(a_avl const *root)
access tail node of AVL binary search tree postorder
a_avl_node * a_avl_parent(a_avl_node const *node)
access parent of AVL binary search tree node
Definition avl.h:52
void a_avl_remove(a_avl *root, a_avl_node *node)
remove specified node from AVL binary search tree
a_avl_node * a_avl_next(a_avl_node *node)
access next node of AVL binary search tree node in-order
#define a_uptr_c(x)
static cast to a_uptr
Definition a.h:735
unsigned long a_uptr
unsigned integer type capable of holding a pointer to void
Definition a.h:738
instance structure for AVL binary search tree node
Definition avl.h:25
a_uptr parent_
Definition avl.h:39
struct a_avl_node * right
Definition avl.h:27
struct a_avl_node * left
Definition avl.h:26
instance structure for AVL binary search tree root
Definition avl.h:84
struct a_avl_node * node
Definition avl.h:85