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
194WS_DLL_PUBLIC
195void *
196wmem_map_find(wmem_map_t *map, GHRFunc foreach_func, void * user_data);
197
203WS_DLL_PUBLIC
204unsigned
206
217WS_DLL_PUBLIC
218uint32_t
219wmem_strong_hash(const uint8_t *buf, const size_t len);
220
224WS_DLL_PUBLIC
225unsigned
226wmem_str_hash(const void *key);
227
231WS_DLL_PUBLIC
232unsigned
233wmem_int64_hash(const void *key);
234
238WS_DLL_PUBLIC
239unsigned
240wmem_double_hash(const void *key);
241
245#ifdef __cplusplus
246}
247#endif /* __cplusplus */
248
249#endif /* __WMEM_MAP_H__ */
250
251/*
252 * Editor modelines - https://www.wireshark.org/tools/modelines.html
253 *
254 * Local variables:
255 * c-basic-offset: 4
256 * tab-width: 8
257 * indent-tabs-mode: nil
258 * End:
259 *
260 * vi: set shiftwidth=4 tabstop=8 expandtab:
261 * :indentSize=4:tabSize=8:noTabs=true:
262 */
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:517
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:436
WS_DLL_PUBLIC unsigned wmem_double_hash(const void *key)
Definition wmem_map.c:523
WS_DLL_PUBLIC unsigned wmem_map_size(wmem_map_t *map)
Definition wmem_map.c:464
WS_DLL_PUBLIC unsigned wmem_str_hash(const void *key)
Definition wmem_map.c:511
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:475
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_find(wmem_map_t *map, GHRFunc foreach_func, void *user_data)
Definition wmem_map.c:412
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