Wireshark 4.5.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
34/* Wmem stack is implemented as a simple wrapper over Wmem list */
36
37#define wmem_stack_count(X) wmem_list_count(X)
38
39WS_DLL_PUBLIC
40void *
41wmem_stack_peek(const wmem_stack_t *stack);
42
43WS_DLL_PUBLIC
44void *
45wmem_stack_pop(wmem_stack_t *stack);
46
47#define wmem_stack_push(STACK, DATA) wmem_list_prepend((STACK), (DATA))
48
49#define wmem_stack_new(ALLOCATOR) wmem_list_new(ALLOCATOR)
50
51#define wmem_destroy_stack(STACK) wmem_destroy_list(STACK)
52
56#ifdef __cplusplus
57}
58#endif /* __cplusplus */
59
60#endif /* __WMEM_STACK_H__ */
61
62/*
63 * Editor modelines - https://www.wireshark.org/tools/modelines.html
64 *
65 * Local variables:
66 * c-basic-offset: 4
67 * tab-width: 8
68 * indent-tabs-mode: nil
69 * End:
70 *
71 * vi: set shiftwidth=4 tabstop=8 expandtab:
72 * :indentSize=4:tabSize=8:noTabs=true:
73 */
Definition wmem_list.c:23