100 #ifndef __TOMMYTREE_H
101 #define __TOMMYTREE_H
void tommy_tree_foreach(tommy_tree *tree, tommy_foreach_func *func)
Calls the specified function for each element in the tree.
tommy_count_t tommy_tree_count(tommy_tree *tree)
Gets the number of elements.
Definition: tommytree.h:216
tommy_uint32_t tommy_count_t
Generic unsigned integer for counting objects.
Definition: tommytypes.h:67
tommy_tree_node * root
Root node.
Definition: tommytree.h:119
void * tommy_tree_remove_existing(tommy_tree *tree, tommy_tree_node *node)
Removes an element from the tree.
Tree container type.
Definition: tommytree.h:118
int tommy_compare_func(const void *obj_a, const void *obj_b)
Compare function for elements.
Definition: tommytypes.h:240
tommy_count_t count
Number of elements.
Definition: tommytree.h:121
struct tommy_tree_struct tommy_tree
Tree container type.
void * tommy_tree_search(tommy_tree *tree, void *data)
Searches an element in the tree.
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.
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_compare_func * cmp
Comparison function.
Definition: tommytree.h:120
void * tommy_tree_insert(tommy_tree *tree, tommy_tree_node *node, void *data)
Inserts an element in the tree.
void * tommy_tree_remove(tommy_tree *tree, void *data)
Searches and removes an element.
Data structure node.
Definition: tommytypes.h:183
void tommy_foreach_func(void *obj)
Foreach function.
Definition: tommytypes.h:289
tommy_node tommy_tree_node
Tree node.
Definition: tommytree.h:112
size_t tommy_size_t
Generic size_t type.
Definition: tommytypes.h:50
void tommy_tree_init(tommy_tree *tree, tommy_compare_func *cmp)
Initializes the tree.
void tommy_foreach_arg_func(void *arg, void *obj)
Foreach function with an argument.
Definition: tommytypes.h:296
tommy_size_t tommy_tree_memory_usage(tommy_tree *tree)
Gets the size of allocated memory.