C Standard Library Extensions
1.2.3
|
27 typedef struct _cx_tnode_ *cx_tree_iterator;
28 typedef const struct _cx_tnode_ *cx_tree_const_iterator;
30 typedef struct _cx_tree_ cx_tree;
121 cx_tree_iterator
cx_tree_next(
const cx_tree *, cx_tree_const_iterator);
cxbool(* cx_tree_compare_func)(cxcptr, cxcptr)
The tree's key comparison operator function.
Definition: cxtree.h:72
cxsize cx_tree_count(const cx_tree *tree, cxcptr key)
Get the number of elements matching a key.
Definition: cxtree.c:1616
cx_tree_iterator cx_tree_end(const cx_tree *tree)
Get an iterator for the position after the last pair in the tree.
Definition: cxtree.c:1056
cx_tree_iterator cx_tree_upper_bound(const cx_tree *tree, cxcptr key)
Find the end of a subsequence.
Definition: cxtree.c:1557
void cx_tree_equal_range(const cx_tree *tree, cxcptr key, cx_tree_iterator *begin, cx_tree_iterator *end)
Find a subsequence matching a given key.
Definition: cxtree.c:1588
cx_tree_iterator cx_tree_find(const cx_tree *tree, cxcptr key)
Locate an element in the tree.
Definition: cxtree.c:1499
cx_tree_iterator cx_tree_next(const cx_tree *tree, cx_tree_const_iterator position)
Get an iterator for the next pair in the tree.
Definition: cxtree.c:1083
cxptr cx_tree_get_value(const cx_tree *tree, cx_tree_const_iterator position)
Get the data from a given iterator position.
Definition: cxtree.c:1468
cx_tree_iterator cx_tree_insert_equal(cx_tree *tree, cxcptr key, cxcptr data)
Insert data into a tree.
Definition: cxtree.c:1688
cx_tree_iterator cx_tree_lower_bound(const cx_tree *tree, cxcptr key)
Find the beginning of a subsequence.
Definition: cxtree.c:1528
void cx_tree_erase_position(cx_tree *tree, cx_tree_iterator position)
Erase an element from a tree.
Definition: cxtree.c:1715
cxptr cx_malloc(cxsize nbytes)
Allocate nbytes bytes.
Definition: cxmemory.c:280
void cx_tree_clear(cx_tree *tree)
Remove all pairs from a tree.
Definition: cxtree.c:1148
cxsize cx_tree_erase(cx_tree *tree, cxcptr key)
Erase all elements from a tree matching the provided key.
Definition: cxtree.c:1785
cx_tree * cx_tree_new(cx_tree_compare_func compare, cx_free_func key_destroy, cx_free_func value_destroy)
Create a new tree without any elements.
Definition: cxtree.c:1212
cx_tree_iterator cx_tree_previous(const cx_tree *tree, cx_tree_const_iterator position)
Get an iterator for the previous pair in the tree.
Definition: cxtree.c:1117
cx_tree_iterator cx_tree_begin(const cx_tree *tree)
Get an iterator to the first pair in the tree.
Definition: cxtree.c:1030
void cx_free(cxptr memory)
Memory block deallocation.
Definition: cxmemory.c:486
cx_tree_compare_func cx_tree_key_comp(const cx_tree *tree)
Get the key comparison function.
Definition: cxtree.c:1326
cxsize cx_tree_max_size(const cx_tree *tree)
Get the maximum number of pairs possible.
Definition: cxtree.c:1299
cx_tree_iterator cx_tree_insert_unique(cx_tree *tree, cxcptr key, cxcptr data)
Attempt to insert data into a tree.
Definition: cxtree.c:1661
void cx_tree_erase_range(cx_tree *tree, cx_tree_iterator begin, cx_tree_iterator end)
Erase a range of elements from a tree.
Definition: cxtree.c:1749
cxbool cx_tree_verify(const cx_tree *tree)
Validate a tree.
Definition: cxtree.c:1825
cxptr cx_tree_assign(cx_tree *tree, cx_tree_iterator position, cxcptr data)
Assign data to an iterator position.
Definition: cxtree.c:1404
void cx_tree_delete(cx_tree *tree)
Destroy a tree and all its elements.
Definition: cxtree.c:1250
cxptr cx_tree_get_key(const cx_tree *tree, cx_tree_const_iterator position)
Get the key from a given iterator position.
Definition: cxtree.c:1441
void cx_tree_swap(cx_tree *tree1, cx_tree *tree2)
Swap the contents of two trees.
Definition: cxtree.c:1352
cxbool cx_tree_empty(const cx_tree *tree)
Check whether a tree is empty.
Definition: cxtree.c:1176
cxsize cx_tree_size(const cx_tree *tree)
Get the actual number of pairs in the tree.
Definition: cxtree.c:1276