120 if (tree->
root == NULL)
125 return diff == 0 ?
node : NULL;
141 if (tree->
root == NULL)
183 if (tree->
root == NULL)
233 if (tree->
root == NULL) {
264 if (
node->balance == 1) {
273 if (
node->balance == -1) {
358 diff = (*comp) (
key,
node->key, cmp_ptr);
362 if (
node->left != NULL)
369 if (
node->right != NULL)
403 if (
node->left != NULL)
435 if (
node->right != NULL)
461 if (
node->balance == -1) {
481 if (
node->balance == 1) {
576 while (
node->left != NULL)
586 while (
node->right != NULL)
600 if (
node->left == NULL &&
node->right == NULL) {
665 if (
node->left == NULL) {
668 node->right->parent = NULL;
685 if (
node->right == NULL) {
688 node->left->parent = NULL;
713 if (min->
left != NULL)
716 if (min->
right != NULL)
struct avl_node * avl_find(const struct avl_tree *tree, const void *key)
static int avl_min(int x, int y)
static void post_insert(struct avl_tree *tree, struct avl_node *node)
static struct avl_node * avl_find_rec(struct avl_node *node, const void *key, avl_tree_comp comp, void *ptr, int *cmp_result)
static void avl_remove(struct avl_tree *tree, struct avl_node *node)
static void avl_rotate_left(struct avl_tree *tree, struct avl_node *node)
static struct avl_node * avl_next(struct avl_node *node)
static struct avl_node * avl_local_min(struct avl_node *node)
static int avl_max(int x, int y)
struct avl_node * avl_find_lessequal(const struct avl_tree *tree, const void *key)
static void avl_insert_before(struct avl_tree *tree, struct avl_node *pos_node, struct avl_node *node)
static void avl_rotate_right(struct avl_tree *tree, struct avl_node *node)
int avl_insert(struct avl_tree *tree, struct avl_node *new)
static void avl_insert_after(struct avl_tree *tree, struct avl_node *pos_node, struct avl_node *node)
static void avl_post_delete(struct avl_tree *tree, struct avl_node *node)
static void avl_delete_worker(struct avl_tree *tree, struct avl_node *node)
struct avl_node * avl_find_greaterequal(const struct avl_tree *tree, const void *key)
void avl_init(struct avl_tree *tree, avl_tree_comp comp, bool allow_dups, void *ptr)
void avl_delete(struct avl_tree *tree, struct avl_node *node)
int(* avl_tree_comp)(const void *k1, const void *k2, void *ptr)
static bool list_is_first(const struct list_head *list, const struct list_head *head)
static void list_add_tail(struct list_head *_new, struct list_head *head)
static void list_add(struct list_head *_new, struct list_head *head)
static void list_del(struct list_head *entry)
static bool list_is_last(const struct list_head *list, const struct list_head *head)
#define list_entry(ptr, type, field)
static void INIT_LIST_HEAD(struct list_head *list)
struct list_head list_head