13#ifndef __WMEM_TREE_H__
14#define __WMEM_TREE_H__
226#define WMEM_TREE_STRING_NOCASE 0x00000001
WS_DLL_PUBLIC wmem_tree_t * wmem_tree_new_autoreset(wmem_allocator_t *metadata_scope, wmem_allocator_t *data_scope)
Creates a tree with two allocator scopes.
Definition wmem_tree.c:399
WS_DLL_PUBLIC void wmem_tree_insert_string(wmem_tree_t *tree, const char *key, void *data, uint32_t flags)
Insert a new value under a string key.
Definition wmem_tree.c:919
WS_DLL_PUBLIC unsigned wmem_tree_count(const wmem_tree_t *tree)
Returns number of nodes in tree.
Definition wmem_tree.c:473
WS_DLL_PUBLIC void wmem_print_tree(const wmem_tree_t *tree, wmem_printer_func key_printer, wmem_printer_func data_printer)
Print the contents of a tree using optional key and data printer callbacks.
Definition wmem_tree.c:1146
WS_DLL_PUBLIC bool wmem_tree_is_empty(const wmem_tree_t *tree)
Returns true if the tree is empty (has no nodes).
Definition wmem_tree.c:459
WS_DLL_PUBLIC void * wmem_tree_lookup32_ge(const wmem_tree_t *tree, uint32_t key)
Look up a node in the tree indexed by a uint32_t integer value.
Definition wmem_tree.c:878
WS_DLL_PUBLIC bool wmem_tree_contains32(const wmem_tree_t *tree, uint32_t key)
Look up a node in the tree indexed by a uint32_t integer value.
Definition wmem_tree.c:665
WS_DLL_PUBLIC void wmem_tree_insert32(wmem_tree_t *tree, uint32_t key, void *data)
Insert a node indexed by a uint32_t key value.
Definition wmem_tree.c:660
void(* wmem_printer_func)(const void *data)
Function type to print key/data of nodes in wmem_print_tree_verbose.
Definition wmem_tree.h:378
WS_DLL_PUBLIC wmem_tree_t * wmem_tree_new(wmem_allocator_t *allocator)
Creates a tree with the given allocator scope. When the scope is emptied, the tree is fully destroyed...
Definition wmem_tree.c:360
WS_DLL_PUBLIC void * wmem_tree_lookup32_le_full(const wmem_tree_t *tree, uint32_t key, uint32_t *orig_key)
Look up a node in the tree indexed by a uint32_t integer value.
Definition wmem_tree.c:800
WS_DLL_PUBLIC void * wmem_tree_lookup32_array_le(const wmem_tree_t *tree, wmem_tree_key_t *key)
Look up a node in the tree indexed by a multi-part tree value.
Definition wmem_tree.c:1033
WS_DLL_PUBLIC void wmem_tree_insert32_array(wmem_tree_t *tree, wmem_tree_key_t *key, void *data)
Insert a node indexed by a sequence of uint32_t key values.
Definition wmem_tree.c:967
WS_DLL_PUBLIC void * wmem_tree_lookup32_ge_full(const wmem_tree_t *tree, uint32_t key, uint32_t *orig_key)
Look up a node in the tree indexed by a uint32_t integer value.
Definition wmem_tree.c:889
WS_DLL_PUBLIC void * wmem_tree_remove_string(wmem_tree_t *tree, const char *key, uint32_t flags)
Remove the value under a string key.
Definition wmem_tree.c:950
WS_DLL_PUBLIC void * wmem_tree_lookup_string(const wmem_tree_t *tree, const char *key, uint32_t flags)
Lookup the value under a string key.
Definition wmem_tree.c:936
WS_DLL_PUBLIC void * wmem_tree_lookup32(const wmem_tree_t *tree, uint32_t key)
Look up a node in the tree indexed by a uint32_t integer value.
Definition wmem_tree.c:713
WS_DLL_PUBLIC void * wmem_tree_lookup32_array(const wmem_tree_t *tree, wmem_tree_key_t *key)
Look up a node in the tree indexed by a sequence of uint32_t integer values.
Definition wmem_tree.c:1027
WS_DLL_PUBLIC void wmem_tree_destroy(wmem_tree_t *tree, bool free_keys, bool free_values)
Cleanup memory used by tree.
Definition wmem_tree.c:446
WS_DLL_PUBLIC void * wmem_tree_lookup32_le(const wmem_tree_t *tree, uint32_t key)
Look up a node in the tree indexed by a uint32_t integer value.
Definition wmem_tree.c:789
bool(* wmem_foreach_func)(const void *key, void *value, void *userdata)
Function type for processing one node of a tree during a traversal.
Definition wmem_tree.h:370
WS_DLL_PUBLIC void * wmem_tree_remove32(wmem_tree_t *tree, uint32_t key)
Remove a node in the tree indexed by a uint32_t integer value.
Definition wmem_tree.c:901
WS_DLL_PUBLIC bool wmem_tree_foreach(const wmem_tree_t *tree, wmem_foreach_func callback, void *user_data)
Inorder traversal (left/parent/right) of the tree.
Definition wmem_tree.c:1076
Definition wmem_allocator.h:27
Definition wmem_tree.h:278
uint32_t * key
Definition wmem_tree.h:280
uint32_t length
Definition wmem_tree.h:279
Definition wmem_tree-int.h:48