Go to the documentation of this file.
40 int (*
cmp)(
const void *
key,
const void *
b),
void *next[2])
46 next[v >> 31] = t->
elem;
83 int i = (v >> 31) ^ !!*next;
87 if (!(t->
state & 1)) {
109 if ((*child)->state * 2 == -t->
state) {
110 *tp = (*child)->
child[
i ^ 1];
114 (*tp)->child[
i ^ 1] = t;
117 (*tp)->child[1]->state = (*tp)->state < 0;
122 (*tp)->child[
i ^ 1] = t;
127 (*tp)->state = -t->
state;
131 if (!(*tp)->state ^ !!*next)
156 int (*
cmp)(
void *opaque,
void *
elem),
157 int (*enu)(
void *opaque,
void *
elem))
164 enu(opaque, t->
elem);
AVS_FilterInfo AVS_Value child
void * av_tree_insert(AVTreeNode **tp, void *key, int(*cmp)(const void *key, const void *b), AVTreeNode **next)
Insert or remove an element.
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
void av_tree_enumerate(AVTreeNode *t, void *opaque, int(*cmp)(void *opaque, void *elem), int(*enu)(void *opaque, void *elem))
Apply enu(opaque, &elem) to all the elements in the tree in a given range.
const int av_tree_node_size
struct AVTreeNode * child[2]
void av_tree_destroy(AVTreeNode *t)
static int cmp(const void *a, const void *b)
#define i(width, name, range_min, range_max)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * av_tree_find(const AVTreeNode *t, void *key, int(*cmp)(const void *key, const void *b), void *next[2])