Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
wmem_tree.h File Reference
#include "wmem_core.h"

Go to the source code of this file.

Classes

struct  _wmem_tree_key_t
 

Macros

#define WMEM_TREE_STRING_NOCASE   0x00000001
 

Typedefs

typedef struct _wmem_tree_t wmem_tree_t
 
typedef struct _wmem_tree_key_t wmem_tree_key_t
 
typedef bool(* wmem_foreach_func) (const void *key, void *value, void *userdata)
 Function type for processing one node of a tree during a traversal.
 
typedef void(* wmem_printer_func) (const void *data)
 Function type to print key/data of nodes in wmem_print_tree_verbose.
 

Functions

WS_DLL_PUBLIC wmem_tree_twmem_tree_new (wmem_allocator_t *allocator)
 Creates a tree with the given allocator scope. When the scope is emptied, the tree is fully destroyed.
 
WS_DLL_PUBLIC wmem_tree_twmem_tree_new_autoreset (wmem_allocator_t *metadata_scope, wmem_allocator_t *data_scope)
 Creates a tree with two allocator scopes.
 
WS_DLL_PUBLIC void wmem_tree_destroy (wmem_tree_t *tree, bool free_keys, bool free_values)
 Cleanup memory used by tree.
 
WS_DLL_PUBLIC bool wmem_tree_is_empty (const wmem_tree_t *tree)
 Returns true if the tree is empty (has no nodes).
 
WS_DLL_PUBLIC unsigned wmem_tree_count (const wmem_tree_t *tree)
 Returns number of nodes in tree.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

Detailed Description

Definitions for the Wireshark Memory Manager Red-Black Tree Based on the red-black tree implementation in epan/emem.* Copyright 2013, Evan Huus eapac.nosp@m.he@g.nosp@m.mail..nosp@m.com

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later