Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
wmem_map.h
Go to the documentation of this file.
1
12#ifndef __WMEM_MAP_H__
13#define __WMEM_MAP_H__
14
15#include <glib.h>
16
17#include "wmem_core.h"
18#include "wmem_list.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif /* __cplusplus */
23
37struct _wmem_map_t;
38typedef struct _wmem_map_t wmem_map_t;
39
56WS_DLL_PUBLIC
59 GHashFunc hash_func, GEqualFunc eql_func)
60G_GNUC_MALLOC;
61
74WS_DLL_PUBLIC
77 GHashFunc hash_func, GEqualFunc eql_func)
78G_GNUC_MALLOC;
79
87WS_DLL_PUBLIC
88void *
89wmem_map_insert(wmem_map_t *map, const void *key, void *value);
90
97WS_DLL_PUBLIC
98bool
99wmem_map_contains(wmem_map_t *map, const void *key);
100
107WS_DLL_PUBLIC
108void *
109wmem_map_lookup(wmem_map_t *map, const void *key);
110
120WS_DLL_PUBLIC
121bool
122wmem_map_lookup_extended(wmem_map_t *map, const void *key, const void **orig_key, void **value);
123
131WS_DLL_PUBLIC
132void *
133wmem_map_remove(wmem_map_t *map, const void *key);
134
142WS_DLL_PUBLIC
143bool
144wmem_map_steal(wmem_map_t *map, const void *key);
145
152WS_DLL_PUBLIC
154wmem_map_get_keys(wmem_allocator_t *list_allocator, wmem_map_t *map);
155
164WS_DLL_PUBLIC
165void
166wmem_map_foreach(wmem_map_t *map, GHFunc foreach_func, void * user_data);
167
178WS_DLL_PUBLIC
179unsigned
180wmem_map_foreach_remove(wmem_map_t *map, GHRFunc foreach_func, void * user_data);
181
187WS_DLL_PUBLIC
188unsigned
190
201WS_DLL_PUBLIC
202uint32_t
203wmem_strong_hash(const uint8_t *buf, const size_t len);
204
208WS_DLL_PUBLIC
209unsigned
210wmem_str_hash(const void *key);
211
215WS_DLL_PUBLIC
216unsigned
217wmem_int64_hash(const void *key);
218
222WS_DLL_PUBLIC
223unsigned
224wmem_double_hash(const void *key);
225
229#ifdef __cplusplus
230}
231#endif /* __cplusplus */
232
233#endif /* __WMEM_MAP_H__ */
234
235/*
236 * Editor modelines - https://www.wireshark.org/tools/modelines.html
237 *
238 * Local variables:
239 * c-basic-offset: 4
240 * tab-width: 8
241 * indent-tabs-mode: nil
242 * End:
243 *
244 * vi: set shiftwidth=4 tabstop=8 expandtab:
245 * :indentSize=4:tabSize=8:noTabs=true:
246 */
WS_DLL_PUBLIC wmem_map_t * wmem_map_new(wmem_allocator_t *allocator, GHashFunc hash_func, GEqualFunc eql_func) G_GNUC_MALLOC
Definition wmem_map.c:88
WS_DLL_PUBLIC unsigned wmem_int64_hash(const void *key)
Definition wmem_map.c:493
WS_DLL_PUBLIC void * wmem_map_remove(wmem_map_t *map, const void *key)
Definition wmem_map.c:308
WS_DLL_PUBLIC unsigned wmem_map_foreach_remove(wmem_map_t *map, GHRFunc foreach_func, void *user_data)
Definition wmem_map.c:412
WS_DLL_PUBLIC unsigned wmem_double_hash(const void *key)
Definition wmem_map.c:499
WS_DLL_PUBLIC unsigned wmem_map_size(wmem_map_t *map)
Definition wmem_map.c:440
WS_DLL_PUBLIC unsigned wmem_str_hash(const void *key)
Definition wmem_map.c:487
WS_DLL_PUBLIC bool wmem_map_lookup_extended(wmem_map_t *map, const void *key, const void **orig_key, void **value)
Definition wmem_map.c:278
WS_DLL_PUBLIC uint32_t wmem_strong_hash(const uint8_t *buf, const size_t len)
Definition wmem_map.c:451
WS_DLL_PUBLIC wmem_list_t * wmem_map_get_keys(wmem_allocator_t *list_allocator, wmem_map_t *map)
Definition wmem_map.c:369
WS_DLL_PUBLIC bool wmem_map_contains(wmem_map_t *map, const void *key)
Definition wmem_map.c:230
WS_DLL_PUBLIC bool wmem_map_steal(wmem_map_t *map, const void *key)
Definition wmem_map.c:340
WS_DLL_PUBLIC void wmem_map_foreach(wmem_map_t *map, GHFunc foreach_func, void *user_data)
Definition wmem_map.c:392
WS_DLL_PUBLIC void * wmem_map_insert(wmem_map_t *map, const void *key, void *value)
Definition wmem_map.c:187
WS_DLL_PUBLIC void * wmem_map_lookup(wmem_map_t *map, const void *key)
Definition wmem_map.c:254
WS_DLL_PUBLIC wmem_map_t * wmem_map_new_autoreset(wmem_allocator_t *metadata_scope, wmem_allocator_t *data_scope, GHashFunc hash_func, GEqualFunc eql_func) G_GNUC_MALLOC
Definition wmem_map.c:134
Definition wmem_allocator.h:27
Definition wmem_list.c:23
Definition wmem_map.c:44