Data structure node.
Definition: tommytypes.h:211
Tree container type.
Definition: tommytree.h:118
tommy_tree_node * root
Root node.
Definition: tommytree.h:119
tommy_size_t count
Number of elements.
Definition: tommytree.h:121
tommy_compare_func * cmp
Comparison function.
Definition: tommytree.h:120
TOMMY_API void tommy_tree_foreach(tommy_tree *tree, tommy_foreach_func *func)
Calls the specified function for each element in the tree.
tommy_node tommy_tree_node
Tree node.
Definition: tommytree.h:112
TOMMY_API void * tommy_tree_remove_existing(tommy_tree *tree, tommy_tree_node *node)
Removes an element from the tree.
struct tommy_tree_struct tommy_tree
Tree container type.
TOMMY_API void * tommy_tree_insert(tommy_tree *tree, tommy_tree_node *node, void *data)
Inserts an element in the tree.
tommy_size_t tommy_tree_count(tommy_tree *tree)
Gets the number of elements.
Definition: tommytree.h:216
TOMMY_API void * tommy_tree_search_compare(tommy_tree *tree, tommy_compare_func *cmp, void *cmp_arg)
Searches an element in the tree with a specific comparison function.
TOMMY_API void * tommy_tree_remove(tommy_tree *tree, void *data)
Searches and removes an element.
TOMMY_API tommy_size_t tommy_tree_memory_usage(tommy_tree *tree)
Gets the size of allocated memory.
TOMMY_API void tommy_tree_init(tommy_tree *tree, tommy_compare_func *cmp)
Initializes the tree.
TOMMY_API void tommy_tree_foreach_arg(tommy_tree *tree, tommy_foreach_arg_func *func, void *arg)
Calls the specified function with an argument for each element in the tree.
TOMMY_API void * tommy_tree_search(tommy_tree *tree, void *data)
Searches an element in the tree.
int tommy_compare_func(const void *obj_a, const void *obj_b)
Compare function for elements.
Definition: tommytypes.h:269
uint64_t tommy_size_t
Generic size_t type.
Definition: tommytypes.h:60
void tommy_foreach_func(void *obj)
Foreach function.
Definition: tommytypes.h:318
void tommy_foreach_arg_func(void *arg, void *obj)
Foreach function with an argument.
Definition: tommytypes.h:325