Wireshark  4.3.0
The Wireshark network protocol analyzer
wmem_list.h
Go to the documentation of this file.
1 
12 #ifndef __WMEM_LIST_H__
13 #define __WMEM_LIST_H__
14 
15 #include <string.h>
16 #include <glib.h>
17 
18 #include "wmem_core.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23 
33 struct _wmem_list_t;
34 struct _wmem_list_frame_t;
35 
36 typedef struct _wmem_list_t wmem_list_t;
38 
39 WS_DLL_PUBLIC
40 unsigned
41 wmem_list_count(const wmem_list_t *list);
42 
43 WS_DLL_PUBLIC
45 wmem_list_head(const wmem_list_t *list);
46 
47 WS_DLL_PUBLIC
49 wmem_list_tail(const wmem_list_t *list);
50 
51 WS_DLL_PUBLIC
53 wmem_list_frame_next(const wmem_list_frame_t *frame);
54 
55 WS_DLL_PUBLIC
57 wmem_list_frame_prev(const wmem_list_frame_t *frame);
58 
59 WS_DLL_PUBLIC
60 void *
61 wmem_list_frame_data(const wmem_list_frame_t *frame);
62 
63 WS_DLL_PUBLIC
64 void
65 wmem_list_remove(wmem_list_t *list, void *data);
66 
67 WS_DLL_PUBLIC
68 void
69 wmem_list_remove_frame(wmem_list_t *list, wmem_list_frame_t *frame);
70 
71 /*
72  * Linear search, search is O(n)
73  */
74 WS_DLL_PUBLIC
76 wmem_list_find(wmem_list_t *list, const void *data);
77 
78 WS_DLL_PUBLIC
80 wmem_list_find_custom(wmem_list_t *list, const void *data, GCompareFunc func);
81 
82 WS_DLL_PUBLIC
83 void
84 wmem_list_prepend(wmem_list_t *list, void *data);
85 
86 WS_DLL_PUBLIC
87 void
88 wmem_list_append(wmem_list_t *list, void *data);
89 
90 WS_DLL_PUBLIC
91 void
92 wmem_list_insert_sorted(wmem_list_t *list, void* data, GCompareFunc func);
93 
94 
95 WS_DLL_PUBLIC
97 wmem_list_new(wmem_allocator_t *allocator)
98 G_GNUC_MALLOC;
99 
100 WS_DLL_PUBLIC
101 void
102 wmem_list_foreach(wmem_list_t *list, GFunc foreach_func, void * user_data);
103 
104 WS_DLL_PUBLIC
105 void
106 wmem_destroy_list(wmem_list_t *list);
107 
111 #ifdef __cplusplus
112 }
113 #endif /* __cplusplus */
114 
115 #endif /* __WMEM_LIST_H__ */
116 
117 /*
118  * Editor modelines - https://www.wireshark.org/tools/modelines.html
119  *
120  * Local variables:
121  * c-basic-offset: 4
122  * tab-width: 8
123  * indent-tabs-mode: nil
124  * End:
125  *
126  * vi: set shiftwidth=4 tabstop=8 expandtab:
127  * :indentSize=4:tabSize=8:noTabs=true:
128  */
Definition: wmem_allocator.h:27
Definition: wmem_list.c:18
Definition: wmem_list.c:23