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))
262#define a_avl_foreach_reverse(cur, root) \
263 for (a_avl_node *cur = a_avl_tail(root); cur; cur = a_avl_prev(cur))
281#define a_avl_pre_foreach(cur, root) \
282 for (a_avl_node *cur = (root)->node; cur; cur = a_avl_pre_next(cur))
300#define a_avl_pre_foreach_reverse(cur, root) \
301 for (a_avl_node *cur = (root)->node; cur; cur = a_avl_pre_prev(cur))
319#define a_avl_post_foreach(cur, root) \
320 for (a_avl_node *cur = a_avl_post_head(root); cur; cur = a_avl_post_next(cur))
338#define a_avl_post_foreach_reverse(cur, root) \
339 for (a_avl_node *cur = a_avl_post_tail(root); cur; cur = a_avl_post_prev(cur))
358#define a_avl_fortear(cur, next, root) \
359 for (a_avl_node *next = A_NULL, *cur = a_avl_tear(root, &next); cur; cur = a_avl_tear(root, &next))
struct a_avl_node a_avl_node
instance structure for AVL binary search tree node
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
union a_avl a_avl
instance structure for AVL binary search tree root
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)
Definition a.h:580
#define a_uptr
Definition a.h:583
instance structure for AVL binary search tree node
Definition avl.h:25
uintptr_t 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
root node
Definition avl.h:85