Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
wmem_stack.h
Go to the documentation of this file.
1
12#ifndef __WMEM_STACK_H__
13#define __WMEM_STACK_H__
14
15#include <string.h>
16#include <glib.h>
17
18#include "wmem_core.h"
19#include "wmem_list.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif /* __cplusplus */
24
43
44
55#define wmem_stack_count(X) wmem_list_count(X)
56
66WS_DLL_PUBLIC
67void *
68wmem_stack_peek(const wmem_stack_t *stack);
69
79WS_DLL_PUBLIC
80void *
82
93#define wmem_stack_push(STACK, DATA) wmem_list_prepend((STACK), (DATA))
94
105#define wmem_stack_new(ALLOCATOR) wmem_list_new(ALLOCATOR)
106
118#define wmem_destroy_stack(STACK) wmem_destroy_list(STACK)
119
123#ifdef __cplusplus
124}
125#endif /* __cplusplus */
126
127#endif /* __WMEM_STACK_H__ */
128
129/*
130 * Editor modelines - https://www.wireshark.org/tools/modelines.html
131 *
132 * Local variables:
133 * c-basic-offset: 4
134 * tab-width: 8
135 * indent-tabs-mode: nil
136 * End:
137 *
138 * vi: set shiftwidth=4 tabstop=8 expandtab:
139 * :indentSize=4:tabSize=8:noTabs=true:
140 */
WS_DLL_PUBLIC void * wmem_stack_peek(const wmem_stack_t *stack)
Peek at the top element of a wmem stack without removing it.
Definition wmem_stack.c:23
WS_DLL_PUBLIC void * wmem_stack_pop(wmem_stack_t *stack)
Pop the top element from a wmem stack.
Definition wmem_stack.c:35
wmem_list_t wmem_stack_t
A stack abstraction implemented as a wrapper over wmem_list_t.
Definition wmem_stack.h:42
Definition wmem_list.c:23