summaryrefslogtreecommitdiff
path: root/epan/prefs.c
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2007-11-29 07:52:52 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2007-11-29 07:52:52 +0000
commita5ca7ec3848a18fb25834774e87a8e5e84a78d0f (patch)
tree20d8805d5bb0184271472dcf21f6b1dadbe07b18 /epan/prefs.c
parent7f4df19970e0669d38f7560ffe45a43e901cfe55 (diff)
downloadwireshark-a5ca7ec3848a18fb25834774e87a8e5e84a78d0f.tar.gz
hide implementation of module list
(it makes easier change from GList to GTree as we have many modules now and GList implementation is slow for searching) svn path=/trunk/; revision=23669
Diffstat (limited to 'epan/prefs.c')
-rw-r--r--epan/prefs.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 684d1494d5..23f2c0e533 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -452,7 +452,7 @@ find_subtree(module_t *parent, const char *name)
* silently ignored in preference files. Does not ignore subtrees,
* as this can be used when walking the display tree of modules.
*/
-guint
+static guint
prefs_module_list_foreach(GList *module_list, module_cb callback,
gpointer user_data)
{
@@ -476,6 +476,14 @@ prefs_module_list_foreach(GList *module_list, module_cb callback,
}
/*
+ * Returns TRUE if module has any submodules
+ */
+gboolean prefs_module_has_submodules(module_t *module)
+{
+ return (module->submodules != NULL);
+}
+
+/*
* Call a callback function, with a specified argument, for each module
* in the list of all modules. (This list does not include subtrees.)
*
@@ -489,6 +497,22 @@ prefs_modules_foreach(module_cb callback, gpointer user_data)
return prefs_module_list_foreach(modules, callback, user_data);
}
+/*
+ * Call a callback function, with a specified argument, for each submodule
+ * of specified modules. If the module is NULL, goes through the top-level
+ * list in the display tree of modules.
+ *
+ * Ignores "obsolete" modules; their sole purpose is to allow old
+ * preferences for dissectors that no longer have preferences to be
+ * silently ignored in preference files. Does not ignore subtrees,
+ * as this can be used when walking the display tree of modules.
+ */
+guint
+prefs_modules_foreach_submodules(module_t *module, module_cb callback, gpointer user_data)
+{
+ return prefs_module_list_foreach((module)?module->submodules:top_level_modules, callback, user_data);
+}
+
static void
call_apply_cb(gpointer data, gpointer user_data _U_)
{