130 if (cmp_cb ==
NULL) {
135 while (node && found == 0) {
139 switch (cmp_cb(node, search_data)) {
177 if (cmp_cb ==
NULL) {
182 while (node && found == 0) {
186 switch (cmp_cb(node, search_data)) {
212 return (found == 1) ? (node) : (
NULL);
223 if (cmp_cb ==
NULL) {
232 if (cmp_cb(node, search_data) > 0) {
253 if (cmp_cb ==
NULL) {
262 if (cmp_cb(node, search_data) < 0) {
287 if (node && node->
parent) {
296 if (node && node->
parent) {
470 if (node && node->
parent && gp) {
542 if (cmp_cb ==
NULL) {
546 if (new_cb ==
NULL) {
561 switch (cmp_cb(parNode,
data)) {
567 parNode->
left = node;
576 parNode->
right = node;
585 update_cb(node,
data);
void(* DLRBT_NFree_FP)(void *node)
void(* DLRBT_NUpdate_FP)(void *node, void *data)
DLRBT_Node *(* DLRBT_NAlloc_FP)(void *data)
short(* DLRBT_Comparator_FP)(void *node, void *data)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
DLRBT_Node * BLI_dlrbTree_search(const DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
void BLI_dlrbTree_init(DLRBT_Tree *tree)
DLRBT_Node * BLI_dlrbTree_search_next(const DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
static void rotate_left(DLRBT_Tree *tree, DLRBT_Node *root)
static void recursive_tree_free_nodes(DLRBT_Node *node, DLRBT_NFree_FP free_cb)
static DLRBT_Node * get_uncle(DLRBT_Node *node)
static DLRBT_Node * get_sibling(DLRBT_Node *node)
DLRBT_Node * BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, DLRBT_NAlloc_FP new_cb, DLRBT_NUpdate_FP update_cb, void *data)
static void insert_check_1(DLRBT_Tree *tree, DLRBT_Node *node)
void BLI_dlrbTree_linkedlist_sync(DLRBT_Tree *tree)
static void rotate_right(DLRBT_Tree *tree, DLRBT_Node *root)
static DLRBT_Node * get_grandparent(DLRBT_Node *node)
short BLI_dlrbTree_contains(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
void BLI_dlrbTree_free(DLRBT_Tree *tree, DLRBT_NFree_FP free_cb)
void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node)
DLRBT_Tree * BLI_dlrbTree_new(void)
static void insert_check_2(DLRBT_Tree *tree, DLRBT_Node *node)
DLRBT_Node * BLI_dlrbTree_search_exact(const DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
static void insert_check_3(DLRBT_Tree *tree, DLRBT_Node *node)
static void linkedlist_sync_add_node(DLRBT_Tree *tree, DLRBT_Node *node)
DLRBT_Node * BLI_dlrbTree_search_prev(const DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
Read Guarded memory(de)allocation.
void *(* MEM_callocN)(size_t len, const char *str)
struct DLRBT_Node * parent
struct DLRBT_Node * right