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
120WS_DLL_PUBLIC
121void *
122wmem_tree_lookup32_le_full(wmem_tree_t *tree, uint32_t key, uint32_t *orig_key);
123
128WS_DLL_PUBLIC
129void *
130wmem_tree_lookup32_ge(wmem_tree_t *tree, uint32_t key);
131
137WS_DLL_PUBLIC
138void *
139wmem_tree_lookup32_ge_full(wmem_tree_t *tree, uint32_t key, uint32_t *orig_key);
140
146WS_DLL_PUBLIC
147void *
148wmem_tree_remove32(wmem_tree_t *tree, uint32_t key);
149
151#define WMEM_TREE_STRING_NOCASE 0x00000001
159WS_DLL_PUBLIC
160void
161wmem_tree_insert_string(wmem_tree_t *tree, const char* key, void *data,
162 uint32_t flags);
163
167WS_DLL_PUBLIC
168void *
169wmem_tree_lookup_string(wmem_tree_t* tree, const char* key, uint32_t flags);
170
174WS_DLL_PUBLIC
175void *
176wmem_tree_remove_string(wmem_tree_t* tree, const char* key, uint32_t flags);
177
178typedef struct _wmem_tree_key_t {
179 uint32_t length;
180 uint32_t *key;
182
218WS_DLL_PUBLIC
219void
221
225WS_DLL_PUBLIC
226void *
228
239WS_DLL_PUBLIC
240void *
242
247typedef bool (*wmem_foreach_func)(const void *key, void *value, void *userdata);
248
249
251typedef void (*wmem_printer_func)(const void *data);
252
253
259WS_DLL_PUBLIC
260bool
262 void *user_data);
263
264
265/* Accepts callbacks to print the key and/or data (both printers can be null) */
266WS_DLL_PUBLIC
267void
268wmem_print_tree(wmem_tree_t *tree, wmem_printer_func key_printer, wmem_printer_func data_printer);
269
273#ifdef __cplusplus
274}
275#endif /* __cplusplus */
276
277#endif /* __WMEM_TREE_H__ */
278
279/*
280 * Editor modelines - https://www.wireshark.org/tools/modelines.html
281 *
282 * Local variables:
283 * c-basic-offset: 4
284 * tab-width: 8
285 * indent-tabs-mode: nil
286 * End:
287 *
288 * vi: set shiftwidth=4 tabstop=8 expandtab:
289 * :indentSize=4:tabSize=8:noTabs=true:
290 */
WS_DLL_PUBLIC void wmem_tree_insert_string(wmem_tree_t *tree, const char *key, void *data, uint32_t flags)
Definition wmem_tree.c:919
WS_DLL_PUBLIC bool wmem_tree_is_empty(wmem_tree_t *tree)
Definition wmem_tree.c:459
WS_DLL_PUBLIC void * wmem_tree_lookup32_le_full(wmem_tree_t *tree, uint32_t key, uint32_t *orig_key)
Definition wmem_tree.c:800
WS_DLL_PUBLIC void wmem_tree_insert32(wmem_tree_t *tree, uint32_t key, void *data)
Definition wmem_tree.c:660
void(* wmem_printer_func)(const void *data)
Definition wmem_tree.h:251
WS_DLL_PUBLIC void * wmem_tree_lookup32_ge(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:878
WS_DLL_PUBLIC void * wmem_tree_lookup32(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:713
WS_DLL_PUBLIC void * wmem_tree_lookup32_array(wmem_tree_t *tree, wmem_tree_key_t *key)
Definition wmem_tree.c:1027
WS_DLL_PUBLIC bool wmem_tree_contains32(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:665
WS_DLL_PUBLIC void * wmem_tree_lookup_string(wmem_tree_t *tree, const char *key, uint32_t flags)
Definition wmem_tree.c:936
WS_DLL_PUBLIC unsigned wmem_tree_count(wmem_tree_t *tree)
Definition wmem_tree.c:473
WS_DLL_PUBLIC void * wmem_tree_lookup32_le(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:789
WS_DLL_PUBLIC void wmem_tree_insert32_array(wmem_tree_t *tree, wmem_tree_key_t *key, void *data)
Definition wmem_tree.c:967
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:399
WS_DLL_PUBLIC void * wmem_tree_lookup32_ge_full(wmem_tree_t *tree, uint32_t key, uint32_t *orig_key)
Definition wmem_tree.c:889
WS_DLL_PUBLIC wmem_tree_t * wmem_tree_new(wmem_allocator_t *allocator) G_GNUC_MALLOC
Definition wmem_tree.c:360
WS_DLL_PUBLIC void * wmem_tree_remove_string(wmem_tree_t *tree, const char *key, uint32_t flags)
Definition wmem_tree.c:950
WS_DLL_PUBLIC bool wmem_tree_foreach(wmem_tree_t *tree, wmem_foreach_func callback, void *user_data)
Definition wmem_tree.c:1076
WS_DLL_PUBLIC void wmem_tree_destroy(wmem_tree_t *tree, bool free_keys, bool free_values)
Definition wmem_tree.c:446
WS_DLL_PUBLIC void * wmem_tree_lookup32_array_le(wmem_tree_t *tree, wmem_tree_key_t *key)
Definition wmem_tree.c:1033
bool(* wmem_foreach_func)(const void *key, void *value, void *userdata)
Definition wmem_tree.h:247
WS_DLL_PUBLIC void * wmem_tree_remove32(wmem_tree_t *tree, uint32_t key)
Definition wmem_tree.c:901
Definition wmem_allocator.h:27
Definition wmem_tree.h:178
uint32_t length
Definition wmem_tree.h:179
Definition wmem_tree-int.h:48