2 * Definitions for the Wireshark Memory Manager Stack
3 * Copyright 2012, Evan Huus <eapache@gmail.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #ifndef __WMEM_STACK_H__
27 #define __WMEM_STACK_H__
32 #include "wmem_core.h"
33 #include "wmem_list.h"
37 #endif /* __cplusplus */
41 * @defgroup wmem-stack Stack
43 * A stack implementation on top of wmem.
48 /* Wmem stack is implemented as a simple wrapper over Wmem list */
49 typedef wmem_list_t wmem_stack_t
;
51 #define wmem_stack_count(X) wmem_list_count(X)
55 wmem_stack_peek(const wmem_stack_t
*stack
);
59 wmem_stack_pop(wmem_stack_t
*stack
);
61 #define wmem_stack_push(STACK, DATA) wmem_list_prepend((STACK), (DATA))
63 #define wmem_stack_new(ALLOCATOR) wmem_list_new(ALLOCATOR)
70 #endif /* __cplusplus */
72 #endif /* __WMEM_STACK_H__ */
75 * Editor modelines - http://www.wireshark.org/tools/modelines.html
80 * indent-tabs-mode: nil
83 * vi: set shiftwidth=4 tabstop=8 expandtab:
84 * :indentSize=4:tabSize=8:noTabs=true: