27 #ifndef ACL_AVL_IMPL_H 28 #define ACL_AVL_IMPL_H 36 #include <sys/types.h> 43 #elif defined(_WIN32) || defined(_WIN64) 50 # define _UINTPTR_T_DEFINED 51 # ifdef UINTPTR_ULONG_INT 94 #define AVL_XPARENT(n) ((n)->avl_parent) 95 #define AVL_SETPARENT(n, p) ((n)->avl_parent = (p)) 97 #define AVL_XCHILD(n) ((n)->avl_child_index) 98 #define AVL_SETCHILD(n, c) ((n)->avl_child_index = (unsigned short)(c)) 100 #define AVL_XBALANCE(n) ((n)->avl_balance) 101 #define AVL_SETBALANCE(n, b) ((n)->avl_balance = (short)(b)) 127 #define AVL_XPARENT(n) ((struct avl_node *)((n)->avl_pcb & ~7)) 128 #define AVL_SETPARENT(n, p) \ 129 ((n)->avl_pcb = (((n)->avl_pcb & 7) | (uintptr_t)(p))) 134 #define AVL_XCHILD(n) (((n)->avl_pcb >> 2) & 1) 135 #define AVL_SETCHILD(n, c) \ 136 ((n)->avl_pcb = (uintptr_t)(((n)->avl_pcb & ~4) | ((c) << 2))) 143 #define AVL_XBALANCE(n) ((int)(((n)->avl_pcb & 3) - 1)) 144 #define AVL_SETBALANCE(n, b) \ 145 ((n)->avl_pcb = (uintptr_t)((((n)->avl_pcb & ~3) | ((b) + 1)))) 155 #define AVL_NODE2DATA(n, o) ((void *)((uintptr_t)(n) - (o))) 156 #define AVL_DATA2NODE(d, o) ((struct avl_node *)((uintptr_t)(d) + (o))) 161 #define AVL_INDEX2NODE(x) ((avl_node_t *)((x) & ~1)) 162 #define AVL_INDEX2CHILD(x) ((x) & 1) 163 #define AVL_MKINDEX(n, c) ((avl_index_t)(n) | (c))
struct avl_node * avl_root
unsigned short avl_child_index
struct avl_node * avl_child[2]
ACL_API void * avl_walk(struct avl_tree *, void *, int)
int(* avl_compar)(const void *, const void *)
struct avl_node * avl_parent