Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
60WS_DLL_PUBLIC
63 GHashFunc hash_func, GEqualFunc eql_func)
64G_GNUC_MALLOC;
65
80WS_DLL_PUBLIC
83 GHashFunc hash_func, GEqualFunc eql_func)
84G_GNUC_MALLOC;
85
93WS_DLL_PUBLIC
94void *
95wmem_map_insert(wmem_map_t *map, const void *key, void *value);
96
103WS_DLL_PUBLIC
104bool
105wmem_map_contains(wmem_map_t *map, const void *key);
106
113WS_DLL_PUBLIC
114void *
115wmem_map_lookup(wmem_map_t *map, const void *key);
116
126WS_DLL_PUBLIC
127bool
128wmem_map_lookup_extended(wmem_map_t *map, const void *key, const void **orig_key, void **value);
129
137WS_DLL_PUBLIC
138void *
139wmem_map_remove(wmem_map_t *map, const void *key);
140
148WS_DLL_PUBLIC
149bool
150wmem_map_steal(wmem_map_t *map, const void *key);
151
158WS_DLL_PUBLIC
160wmem_map_get_keys(wmem_allocator_t *list_allocator, wmem_map_t *map);
161
170WS_DLL_PUBLIC
171void
172wmem_map_foreach(wmem_map_t *map, GHFunc foreach_func, void * user_data);
173
184WS_DLL_PUBLIC
185unsigned
186wmem_map_foreach_remove(wmem_map_t *map, GHRFunc foreach_func, void * user_data);
187
200WS_DLL_PUBLIC
201void *
202wmem_map_find(wmem_map_t *map, GHRFunc foreach_func, void * user_data);
203
209WS_DLL_PUBLIC
210unsigned
212
225WS_DLL_PUBLIC
226size_t
227wmem_map_reserve(wmem_map_t *map, uint64_t capacity);
228
243WS_DLL_PUBLIC
244void
245wmem_map_destroy(wmem_map_t *map, bool free_keys, bool free_values);
246
257WS_DLL_PUBLIC
258uint32_t
259wmem_strong_hash(const uint8_t *buf, const size_t len);
260
264WS_DLL_PUBLIC
265unsigned
266wmem_str_hash(const void *key);
267
271WS_DLL_PUBLIC
272unsigned
273wmem_int64_hash(const void *key);
274
278WS_DLL_PUBLIC
279unsigned
280wmem_double_hash(const void *key);
281
285#ifdef __cplusplus
286}
287#endif /* __cplusplus */
288
289#endif /* __WMEM_MAP_H__ */
290
291/*
292 * Editor modelines - https://www.wireshark.org/tools/modelines.html
293 *
294 * Local variables:
295 * c-basic-offset: 4
296 * tab-width: 8
297 * indent-tabs-mode: nil
298 * End:
299 *
300 * vi: set shiftwidth=4 tabstop=8 expandtab:
301 * :indentSize=4:tabSize=8:noTabs=true:
302 */
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:140
WS_DLL_PUBLIC unsigned wmem_int64_hash(const void *key)
Definition wmem_map.c:669
WS_DLL_PUBLIC void * wmem_map_remove(wmem_map_t *map, const void *key)
Definition wmem_map.c:424
WS_DLL_PUBLIC unsigned wmem_map_foreach_remove(wmem_map_t *map, GHRFunc foreach_func, void *user_data)
Definition wmem_map.c:555
WS_DLL_PUBLIC unsigned wmem_double_hash(const void *key)
Definition wmem_map.c:675
WS_DLL_PUBLIC unsigned wmem_map_size(wmem_map_t *map)
Definition wmem_map.c:584
WS_DLL_PUBLIC unsigned wmem_str_hash(const void *key)
Definition wmem_map.c:658
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:393
WS_DLL_PUBLIC uint32_t wmem_strong_hash(const uint8_t *buf, const size_t len)
Definition wmem_map.c:618
WS_DLL_PUBLIC wmem_list_t * wmem_map_get_keys(wmem_allocator_t *list_allocator, wmem_map_t *map)
Definition wmem_map.c:488
WS_DLL_PUBLIC bool wmem_map_contains(wmem_map_t *map, const void *key)
Definition wmem_map.c:343
WS_DLL_PUBLIC bool wmem_map_steal(wmem_map_t *map, const void *key)
Definition wmem_map.c:457
WS_DLL_PUBLIC void wmem_map_foreach(wmem_map_t *map, GHFunc foreach_func, void *user_data)
Definition wmem_map.c:511
WS_DLL_PUBLIC void * wmem_map_find(wmem_map_t *map, GHRFunc foreach_func, void *user_data)
Definition wmem_map.c:531
WS_DLL_PUBLIC void * wmem_map_insert(wmem_map_t *map, const void *key, void *value)
Definition wmem_map.c:293
WS_DLL_PUBLIC size_t wmem_map_reserve(wmem_map_t *map, uint64_t capacity)
Definition wmem_map.c:590
WS_DLL_PUBLIC void * wmem_map_lookup(wmem_map_t *map, const void *key)
Definition wmem_map.c:368
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:188
WS_DLL_PUBLIC void wmem_map_destroy(wmem_map_t *map, bool free_keys, bool free_values)
Definition wmem_map.c:267
Definition wmem_allocator.h:27
Definition wmem_list.c:23
Definition wmem_map.c:59