Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
wmem_tree.h
Go to the documentation of this file.
1
13#ifndef __WMEM_TREE_H__
14#define __WMEM_TREE_H__
15
16#include "wmem_core.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
36struct _wmem_tree_t;
37typedef struct _wmem_tree_t wmem_tree_t;
38
41WS_DLL_PUBLIC
44G_GNUC_MALLOC;
45
58WS_DLL_PUBLIC
61G_GNUC_MALLOC;
62
64WS_DLL_PUBLIC
65void
66wmem_tree_destroy(wmem_tree_t *tree, bool free_keys, bool free_values);
67
69WS_DLL_PUBLIC
70bool
72
74WS_DLL_PUBLIC
75unsigned
77
89WS_DLL_PUBLIC
90void
91wmem_tree_insert32(wmem_tree_t *tree, uint32_t key, void *data);
92
96WS_DLL_PUBLIC
97bool
98wmem_tree_contains32(wmem_tree_t *tree, uint32_t key);
99
103WS_DLL_PUBLIC
104void *
105wmem_tree_lookup32(wmem_tree_t *tree, uint32_t key);
106
111WS_DLL_PUBLIC
112void *
113wmem_tree_lookup32_le(wmem_tree_t *tree, uint32_t key);
114
119WS_DLL_PUBLIC
120void *
121wmem_tree_remove32(wmem_tree_t *tree, uint32_t key);
122
124#define WMEM_TREE_STRING_NOCASE 0x00000001
132WS_DLL_PUBLIC
133void
134wmem_tree_insert_string(wmem_tree_t *tree, const char* key, void *data,
135 uint32_t flags);
136
140WS_DLL_PUBLIC
141void *
142wmem_tree_lookup_string(wmem_tree_t* tree, const char* key, uint32_t flags);
143
147WS_DLL_PUBLIC
148void *
149wmem_tree_remove_string(wmem_tree_t* tree, const char* key, uint32_t flags);
150
151typedef struct _wmem_tree_key_t {
152 uint32_t length;
153 uint32_t *key;
155
191WS_DLL_PUBLIC
192void
194
198WS_DLL_PUBLIC
199void *
201
212WS_DLL_PUBLIC
213void *
215
220typedef bool (*wmem_foreach_func)(const void *key, void *value, void *userdata);
221
222
224typedef void (*wmem_printer_func)(const void *data);
225
226
232WS_DLL_PUBLIC
233bool
235 void *user_data);
236
237
238/* Accepts callbacks to print the key and/or data (both printers can be null) */
239WS_DLL_PUBLIC
240void
241wmem_print_tree(wmem_tree_t *tree, wmem_printer_func key_printer, wmem_printer_func data_printer);
242
246#ifdef __cplusplus
247}
248#endif /* __cplusplus */
249
250#endif /* __WMEM_TREE_H__ */
251
252/*
253 * Editor modelines - https://www.wireshark.org/tools/modelines.html
254 *
255 * Local variables:
256 * c-basic-offset: 4
257 * tab-width: 8
258 * indent-tabs-mode: nil
259 * End:
260 *
261 * vi: set shiftwidth=4 tabstop=8 expandtab:
262 * :indentSize=4:tabSize=8:noTabs=true:
263 */
WS_DLL_PUBLIC void wmem_tree_insert_string(wmem_tree_t *tree, const char *key, void *data, uint32_t flags)
Definition wmem_tree.c:626
WS_DLL_PUBLIC bool wmem_tree_is_empty(wmem_tree_t *tree)
Definition wmem_tree.c:295
WS_DLL_PUBLIC void wmem_tree_insert32(wmem_tree_t *tree, uint32_t key, void *data)
Definition wmem_tree.c:496
void(* wmem_printer_func)(const void *data)
Definition wmem_tree.h:224
WS_DLL_PUBLIC void * wmem_tree_lookup32(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:525
WS_DLL_PUBLIC void * wmem_tree_lookup32_array(wmem_tree_t *tree, wmem_tree_key_t *key)
Definition wmem_tree.c:734
WS_DLL_PUBLIC bool wmem_tree_contains32(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:501
WS_DLL_PUBLIC void * wmem_tree_lookup_string(wmem_tree_t *tree, const char *key, uint32_t flags)
Definition wmem_tree.c:643
WS_DLL_PUBLIC unsigned wmem_tree_count(wmem_tree_t *tree)
Definition wmem_tree.c:309
WS_DLL_PUBLIC void * wmem_tree_lookup32_le(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:549
WS_DLL_PUBLIC void wmem_tree_insert32_array(wmem_tree_t *tree, wmem_tree_key_t *key, void *data)
Definition wmem_tree.c:674
WS_DLL_PUBLIC wmem_tree_t * wmem_tree_new_autoreset(wmem_allocator_t *metadata_scope, wmem_allocator_t *data_scope) G_GNUC_MALLOC
Definition wmem_tree.c:235
WS_DLL_PUBLIC wmem_tree_t * wmem_tree_new(wmem_allocator_t *allocator) G_GNUC_MALLOC
Definition wmem_tree.c:196
WS_DLL_PUBLIC void * wmem_tree_remove_string(wmem_tree_t *tree, const char *key, uint32_t flags)
Definition wmem_tree.c:657
WS_DLL_PUBLIC bool wmem_tree_foreach(wmem_tree_t *tree, wmem_foreach_func callback, void *user_data)
Definition wmem_tree.c:783
WS_DLL_PUBLIC void wmem_tree_destroy(wmem_tree_t *tree, bool free_keys, bool free_values)
Definition wmem_tree.c:282
WS_DLL_PUBLIC void * wmem_tree_lookup32_array_le(wmem_tree_t *tree, wmem_tree_key_t *key)
Definition wmem_tree.c:740
bool(* wmem_foreach_func)(const void *key, void *value, void *userdata)
Definition wmem_tree.h:220
WS_DLL_PUBLIC void * wmem_tree_remove32(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:615
Definition wmem_allocator.h:27
Definition wmem_tree.h:151
uint32_t length
Definition wmem_tree.h:152
Definition wmem_tree-int.h:48