aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wmem/wmem_stack.h
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2012-11-03 17:34:28 +0000
committerEvan Huus <eapache@gmail.com>2012-11-03 17:34:28 +0000
commit5d6b30639182184d817eb419f1ac393d06e68a7e (patch)
tree89885529fe9a67bfa205bef94582661213117596 /epan/wmem/wmem_stack.h
parentcc87609f31e406c24954897957e2e75eafd627a1 (diff)
Wmem stack implementation using the wmem slab implementation to allocate frames.
svn path=/trunk/; revision=45881
Diffstat (limited to 'epan/wmem/wmem_stack.h')
-rw-r--r--epan/wmem/wmem_stack.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/epan/wmem/wmem_stack.h b/epan/wmem/wmem_stack.h
new file mode 100644
index 0000000000..64ed23b4b4
--- /dev/null
+++ b/epan/wmem/wmem_stack.h
@@ -0,0 +1,74 @@
+/* wmem_stack.h
+ * Definitions for the Wireshark Memory Manager Stack
+ * Copyright 2012, Evan Huus <eapache@gmail.com>
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __WMEM_STACK_H__
+#define __WMEM_STACK_H__
+
+#include <string.h>
+#include <glib.h>
+
+#include "wmem_core.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _wmem_stack_t;
+
+typedef struct _wmem_stack_t wmem_stack_t;
+
+guint
+wmem_stack_count(wmem_stack_t *stack);
+
+void *
+wmem_stack_peek(wmem_stack_t *stack);
+
+void *
+wmem_stack_pop(wmem_stack_t *stack);
+
+void
+wmem_stack_push(wmem_stack_t *stack, void *data);
+
+wmem_stack_t *
+wmem_create_stack(wmem_allocator_t *allocator);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __WMEM_STACK_H__ */
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */