TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / wsutil / wmem / wmem_stack.h
blobb4fd2d567683d2df1638c762796c45af51e68c5c
1 /** @file
2 * Definitions for the Wireshark Memory Manager Stack
3 * Copyright 2012, Evan Huus <eapache@gmail.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __WMEM_STACK_H__
13 #define __WMEM_STACK_H__
15 #include <string.h>
16 #include <glib.h>
18 #include "wmem_core.h"
19 #include "wmem_list.h"
21 #ifdef __cplusplus
22 extern "C" {
23 #endif /* __cplusplus */
25 /** @addtogroup wmem
26 * @{
27 * @defgroup wmem-stack Stack
29 * A stack implementation on top of wmem.
31 * @{
34 /* Wmem stack is implemented as a simple wrapper over Wmem list */
35 typedef wmem_list_t wmem_stack_t;
37 #define wmem_stack_count(X) wmem_list_count(X)
39 WS_DLL_PUBLIC
40 void *
41 wmem_stack_peek(const wmem_stack_t *stack);
43 WS_DLL_PUBLIC
44 void *
45 wmem_stack_pop(wmem_stack_t *stack);
47 #define wmem_stack_push(STACK, DATA) wmem_list_prepend((STACK), (DATA))
49 #define wmem_stack_new(ALLOCATOR) wmem_list_new(ALLOCATOR)
51 #define wmem_destroy_stack(STACK) wmem_destroy_list(STACK)
53 /** @}
54 * @} */
56 #ifdef __cplusplus
58 #endif /* __cplusplus */
60 #endif /* __WMEM_STACK_H__ */
63 * Editor modelines - https://www.wireshark.org/tools/modelines.html
65 * Local variables:
66 * c-basic-offset: 4
67 * tab-width: 8
68 * indent-tabs-mode: nil
69 * End:
71 * vi: set shiftwidth=4 tabstop=8 expandtab:
72 * :indentSize=4:tabSize=8:noTabs=true: