BRL-CAD
#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "bu/rb.h"
#include "./rb_internals.h"
Include dependency graph for rb_search.c:

Go to the source code of this file.

Functions

HIDDEN struct bu_rb_node_rb_search (struct bu_rb_node *root, int order_nm, int(*compare)(const void *, const void *), void *data)
 
void * bu_rb_search (struct bu_rb_tree *tree, int order, void *data)
 

Detailed Description

Routines to search for a node in a red-black tree

Definition in file rb_search.c.

Function Documentation

HIDDEN struct bu_rb_node* _rb_search ( struct bu_rb_node root,
int  order_nm,
int(*)(const void *, const void *)  compare,
void *  data 
)

Search for a node in a red-black tree

This function has four parameters: the root and order of the tree in which to search, the comparison function, and a data block containing the desired value of the key. On success, _rb_search() returns a pointer to the discovered node. Otherwise, it returns (tree->rbt_empty_node).

Definition at line 41 of file rb_search.c.

References BU_CKMAG, BU_RB_NODE_MAGIC, RB_CKORDER, RB_CURRENT, RB_DATA, RB_LEFT_CHILD, RB_NULL, RB_RIGHT_CHILD, and bu_rb_node::rbn_tree.

Referenced by bu_rb_search().