Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
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
21extern "C" {
22#endif /* __cplusplus */
23
33struct _wmem_list_t;
35
36typedef struct _wmem_list_t wmem_list_t;
38
39WS_DLL_PUBLIC
40unsigned
41wmem_list_count(const wmem_list_t *list);
42
43WS_DLL_PUBLIC
45wmem_list_head(const wmem_list_t *list);
46
47WS_DLL_PUBLIC
49wmem_list_tail(const wmem_list_t *list);
50
51WS_DLL_PUBLIC
53wmem_list_frame_next(const wmem_list_frame_t *frame);
54
55WS_DLL_PUBLIC
57wmem_list_frame_prev(const wmem_list_frame_t *frame);
58
59WS_DLL_PUBLIC
60void *
61wmem_list_frame_data(const wmem_list_frame_t *frame);
62
63WS_DLL_PUBLIC
64void
65wmem_list_remove(wmem_list_t *list, void *data);
66
67WS_DLL_PUBLIC
68void
69wmem_list_remove_frame(wmem_list_t *list, wmem_list_frame_t *frame);
70
71/*
72 * Linear search, search is O(n)
73 */
74WS_DLL_PUBLIC
76wmem_list_find(wmem_list_t *list, const void *data);
77
78WS_DLL_PUBLIC
80wmem_list_find_custom(wmem_list_t *list, const void *data, GCompareFunc func);
81
82WS_DLL_PUBLIC
83void
84wmem_list_prepend(wmem_list_t *list, void *data);
85
86WS_DLL_PUBLIC
87void
88wmem_list_append(wmem_list_t *list, void *data);
89
90WS_DLL_PUBLIC
91void
92wmem_list_insert_sorted(wmem_list_t *list, void* data, GCompareFunc func);
93
94/*
95 * Appender Insertion (start search from the tail)
96 */
97WS_DLL_PUBLIC
98void
99wmem_list_append_sorted(wmem_list_t *list, void* data, GCompareFunc func);
100
101
102WS_DLL_PUBLIC
104wmem_list_new(wmem_allocator_t *allocator)
105G_GNUC_MALLOC;
106
107WS_DLL_PUBLIC
108void
109wmem_list_foreach(wmem_list_t *list, GFunc foreach_func, void * user_data);
110
111WS_DLL_PUBLIC
112void
113wmem_destroy_list(wmem_list_t *list);
114
118#ifdef __cplusplus
119}
120#endif /* __cplusplus */
121
122#endif /* __WMEM_LIST_H__ */
123
124/*
125 * Editor modelines - https://www.wireshark.org/tools/modelines.html
126 *
127 * Local variables:
128 * c-basic-offset: 4
129 * tab-width: 8
130 * indent-tabs-mode: nil
131 * End:
132 *
133 * vi: set shiftwidth=4 tabstop=8 expandtab:
134 * :indentSize=4:tabSize=8:noTabs=true:
135 */
Definition wmem_allocator.h:27
Definition wmem_list.c:18
Definition wmem_list.c:23