From 6af0e4e0023dd512f95eb7e9f21d5c4f169a000c Mon Sep 17 00:00:00 2001 From: Jaap Keuter Date: Fri, 11 Dec 2009 17:35:10 +0000 Subject: [PATCH] From Richard Pecl: Adding prefs_register_protocol_subtree to libwireshark.def svn path=/trunk/; revision=31246 --- doc/README.developer | 16 ++++++++++++++++ epan/libwireshark.def | 1 + 2 files changed, 17 insertions(+) diff --git a/doc/README.developer b/doc/README.developer index d3fb0e53b6..fd6147ed22 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -961,6 +961,16 @@ proto_register_PROTOABBREV(void) PROTOABBREV_module = prefs_register_protocol(proto_PROTOABBREV, proto_reg_handoff_PROTOABBREV); +/* Register preferences module under preferences subtree. + Use this function instead of prefs_register_protocol if you want to group + preferences of several protocols under one preferences subtree. + Argument subtree identifies grouping tree node name, several subnodes can be + specified usign slash '/' (e.g. "OSI/X.500" - protocol preferences will be + accessible under Protocols->OSI->X.500-> preferences node. +*/ + PROTOABBREV_module = prefs_register_protocol_subtree(const char *subtree, + proto_PROTOABBREV, proto_reg_handoff_PROTOABBREV); + /* Register a sample preference */ prefs_register_bool_preference(PROTOABBREV_module, "show_hex", "Display numbers in Hex", @@ -3387,11 +3397,17 @@ to a configuration dialog. You must register the module with the preferences routine with - module_t *prefs_register_protocol(proto_id, void (*apply_cb)(void)) + or + module_t *prefs_register_protocol_subtree(const char *subtree, int id, + void (*apply_cb)(void)); + Where: proto_id - the value returned by "proto_register_protocol()" when the protocol was registered. apply_cb - Callback routine that is called when preferences are applied. It may be NULL, which inhibits the callback. + subtree - grouping preferences tree node name (several protocols can + be grouped under one preferences subtree) Then you can register the fields that can be configured by the user with these routines - diff --git a/epan/libwireshark.def b/epan/libwireshark.def index a7e1be7bb0..e9cf02bcf8 100644 --- a/epan/libwireshark.def +++ b/epan/libwireshark.def @@ -667,6 +667,7 @@ prefs_register_enum_preference prefs_register_modules prefs_register_obsolete_preference prefs_register_protocol +prefs_register_protocol_subtree prefs_register_range_preference prefs_register_static_text_preference prefs_register_string_preference