58 #define BST_NODES_UNIQUE 1
59 #define BST_NODES_DUPLICATES 0
80 int (*
comp)(
const void *,
const void *);
void * upd_bst_node(const struct bstree *tree, const void *updobj, size_t objsize)
Update a node's object.
Definition: bstree.c:581
void * find_next_bst_node(const struct bstree *tree, const void *searchobj)
Find the next node.
Definition: bstree.c:451
void * find_bst_node(const struct bstree *tree, const void *searchobj)
Find an exact object match.
Definition: bstree.c:330
struct bstree * del_bst_node(struct bstree *tree, const void *searchobj)
Delete a node.
Definition: bstree.c:650
int get_counter_bst_node(const struct bstree *tree, const void *searchobj)
Get the counter for a node.
Definition: bstree.c:390
struct bstree * add_bst_node(struct bstree *tree, const void *object, size_t objsize)
Add a node to a binary search tree.
Definition: bstree.c:208
struct bstree * cre_bst(int unique, int(*comp)(const void *, const void *))
Create a binary search tree.
Definition: bstree.c:159
void * find_prev_bst_node(const struct bstree *tree, const void *searchobj)
Find the previous node.
Definition: bstree.c:516
struct bstree * del_bst(struct bstree *tree)
Delete a bst.
Definition: bstree.c:773
Header file to ease portability.
#define BEGIN_C_DECLS
BEGIN_C_DECLS should be used at the beginning of declarations so that C++ compilers don't mangle thei...
Definition: mge-portability.h:48
#define END_C_DECLS
Use END_C_DECLS at the end of C declarations.
Definition: mge-portability.h:52
Binary search tree.
Definition: mge-bstree.h:74
int unique
Uniqueness of nodes.
Definition: mge-bstree.h:76
int node_total
Number of nodes in the tree.
Definition: mge-bstree.h:79
int count_total
Sum of all node counters.
Definition: mge-bstree.h:78
int(* comp)(const void *, const void *)
Comparison function.
Definition: mge-bstree.h:80
struct bstreenode * root
The root node of the tree.
Definition: mge-bstree.h:75
Binary search tree node.
Definition: mge-bstree.h:62
void * object
The object attached to the node.
Definition: mge-bstree.h:63
struct bstreenode * childgreater
Child node greater than this node.
Definition: mge-bstree.h:69
int count
The node counter.
Definition: mge-bstree.h:64
struct bstreenode * childless
Child node less than this node.
Definition: mge-bstree.h:68