Wireshark  4.3.0
The Wireshark network protocol analyzer
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
21 extern "C" {
22 #endif /* __cplusplus */
23 
37 struct _wmem_map_t;
38 typedef struct _wmem_map_t wmem_map_t;
39 
56 WS_DLL_PUBLIC
57 wmem_map_t *
59  GHashFunc hash_func, GEqualFunc eql_func)
60 G_GNUC_MALLOC;
61 
74 WS_DLL_PUBLIC
75 wmem_map_t *
76 wmem_map_new_autoreset(wmem_allocator_t *metadata_scope, wmem_allocator_t *data_scope,
77  GHashFunc hash_func, GEqualFunc eql_func)
78 G_GNUC_MALLOC;
79 
87 WS_DLL_PUBLIC
88 void *
89 wmem_map_insert(wmem_map_t *map, const void *key, void *value);
90 
97 WS_DLL_PUBLIC
98 bool
99 wmem_map_contains(wmem_map_t *map, const void *key);
100 
107 WS_DLL_PUBLIC
108 void *
109 wmem_map_lookup(wmem_map_t *map, const void *key);
110 
120 WS_DLL_PUBLIC
121 bool
122 wmem_map_lookup_extended(wmem_map_t *map, const void *key, const void **orig_key, void **value);
123 
131 WS_DLL_PUBLIC
132 void *
133 wmem_map_remove(wmem_map_t *map, const void *key);
134 
142 WS_DLL_PUBLIC
143 bool
144 wmem_map_steal(wmem_map_t *map, const void *key);
145 
152 WS_DLL_PUBLIC
154 wmem_map_get_keys(wmem_allocator_t *list_allocator, wmem_map_t *map);
155 
164 WS_DLL_PUBLIC
165 void
166 wmem_map_foreach(wmem_map_t *map, GHFunc foreach_func, void * user_data);
167 
178 WS_DLL_PUBLIC
179 unsigned
180 wmem_map_foreach_remove(wmem_map_t *map, GHRFunc foreach_func, void * user_data);
181 
187 WS_DLL_PUBLIC
188 unsigned
190 
201 WS_DLL_PUBLIC
202 uint32_t
203 wmem_strong_hash(const uint8_t *buf, const size_t len);
204 
208 WS_DLL_PUBLIC
209 unsigned
210 wmem_str_hash(gconstpointer key);
211 
215 WS_DLL_PUBLIC
216 unsigned
217 wmem_int64_hash(gconstpointer key);
218 
222 WS_DLL_PUBLIC
223 unsigned
224 wmem_double_hash(gconstpointer 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 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_int64_hash(gconstpointer key)
Definition: wmem_map.c:493
WS_DLL_PUBLIC unsigned wmem_map_size(wmem_map_t *map)
Definition: wmem_map.c:440
WS_DLL_PUBLIC unsigned wmem_str_hash(gconstpointer key)
Definition: wmem_map.c:487
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
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(wmem_allocator_t *allocator, GHashFunc hash_func, GEqualFunc eql_func) G_GNUC_MALLOC
Definition: wmem_map.c:88
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 void * wmem_map_insert(wmem_map_t *map, const void *key, void *value)
Definition: wmem_map.c:187
WS_DLL_PUBLIC bool wmem_map_contains(wmem_map_t *map, const void *key)
Definition: wmem_map.c:230
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 unsigned wmem_double_hash(gconstpointer key)
Definition: wmem_map.c:499
WS_DLL_PUBLIC void * wmem_map_remove(wmem_map_t *map, const void *key)
Definition: wmem_map.c:308
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
Definition: wmem_allocator.h:27
Definition: wmem_list.c:23
Definition: wmem_map.c:44