aboutsummaryrefslogtreecommitdiffstats
path: root/epan/emem.h
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2007-12-03 22:47:23 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2007-12-03 22:47:23 +0000
commitd8709d698d79eda6f06e649aa86efbabc734c802 (patch)
tree8cba89bbc0dfbe24568e61e8168fc69274f1c7cc /epan/emem.h
parentb953ffe1dab27ef9799b5cfa983f06b263a5cc45 (diff)
add tree traversal functions
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23725 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/emem.h')
-rw-r--r--epan/emem.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/epan/emem.h b/epan/emem.h
index a440b9f61f..414652ebed 100644
--- a/epan/emem.h
+++ b/epan/emem.h
@@ -258,6 +258,9 @@ emem_tree_t *se_tree_create_non_persistent(int type, const char *name);
/* Lookup the value under a string key */
#define se_tree_lookup_string emem_tree_lookup_string
+/* Traverse a tree */
+#define se_tree_foreach emem_tree_foreach
+
/* *******************************************************************
* Tree functions for PE memory allocation scope
@@ -272,6 +275,7 @@ emem_tree_t *pe_tree_create(int type, char *name);
#define pe_tree_lookup32_array emem_tree_lookup32_array
#define pe_tree_insert_string emem_tree_insert_string
#define pe_tree_lookup_string emem_tree_lookup_string
+#define pe_tree_foreach emem_tree_foreach
@@ -349,6 +353,11 @@ void emem_tree_insert_string(emem_tree_t* h, const gchar* k, void* v);
void* emem_tree_lookup_string(emem_tree_t* h, const gchar* k);
+/* traverse a tree. if the callback returns TRUE the traversal will end */
+typedef gboolean (*tree_foreach_func)(void *value, void *userdata);
+
+void emem_tree_foreach(emem_tree_t* emem_tree, tree_foreach_func callback, void *user_data);
+