match_strval > try_val_to_str
[wireshark-wip.git] / epan / wmem / wmem_stack.h
blobe2435c9b96150af506fda7d54beb13c513175c1e
1 /* wmem_stack.h
2 * Definitions for the Wireshark Memory Manager Stack
3 * Copyright 2012, Evan Huus <eapache@gmail.com>
5 * $Id$
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__
29 #include <string.h>
30 #include <glib.h>
32 #include "wmem_core.h"
33 #include "wmem_list.h"
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
39 /** @addtogroup wmem
40 * @{
41 * @defgroup wmem-stack Stack
43 * A stack implementation on top of wmem.
45 * @{
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)
53 WS_DLL_PUBLIC
54 void *
55 wmem_stack_peek(const wmem_stack_t *stack);
57 WS_DLL_PUBLIC
58 void *
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)
65 /** @}
66 * @} */
68 #ifdef __cplusplus
70 #endif /* __cplusplus */
72 #endif /* __WMEM_STACK_H__ */
75 * Editor modelines - http://www.wireshark.org/tools/modelines.html
77 * Local variables:
78 * c-basic-offset: 4
79 * tab-width: 8
80 * indent-tabs-mode: nil
81 * End:
83 * vi: set shiftwidth=4 tabstop=8 expandtab:
84 * :indentSize=4:tabSize=8:noTabs=true: