diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2009-02-10 03:54:55 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2009-02-10 03:54:55 +0000 |
commit | f904f42f9da356bcc70377046c7f6617e5bcba4b (patch) | |
tree | 3b043a447bd4dd271a3877bdbcd0773a3cde939c /epan/stats_tree.h | |
parent | ba78d5f30e5a6f3873fcec88fc95ae3ce320a76a (diff) |
Remove an ugly hack:
There was an ugly hack while creating the menu, that tried to detect the stat_group a stats_tree belongs to by looking at the name string. That makes it unnecessarily hard to understand how the menu is really created.
Fix: Add a new function stats_tree_register_with_group() that takes the stat_group as a parameter. Use this function where a stats_tree doesn't fit into the default "unsorted" group.
svn path=/trunk/; revision=27407
Diffstat (limited to 'epan/stats_tree.h')
-rw-r--r-- | epan/stats_tree.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/epan/stats_tree.h b/epan/stats_tree.h index 207a0670cd..66a0c556cd 100644 --- a/epan/stats_tree.h +++ b/epan/stats_tree.h @@ -30,6 +30,7 @@ #include <epan/packet_info.h> #include <epan/to_str.h> #include <epan/tap.h> +#include "../stat_menu.h" #include "../register.h" #define STAT_TREE_ROOT "root" @@ -49,11 +50,12 @@ typedef void (*stat_tree_init_cb)(stats_tree*); /* stats_tree cleanup callback */ typedef void (*stat_tree_cleanup_cb)(stats_tree*); -/* registers a new stats tree +/* registers a new stats tree with default group REGISTER_STAT_GROUP_UNSORTED * abbr: protocol abbr * name: protocol display name * packet: per packet callback * init: tree initialization callback + * cleanup: cleanup callback */ extern void stats_tree_register(const gchar *tapname, const gchar *abbr, @@ -62,6 +64,22 @@ extern void stats_tree_register(const gchar *tapname, stat_tree_init_cb init, stat_tree_cleanup_cb cleanup); +/* registers a new stats tree + * abbr: protocol abbr + * name: protocol display name + * packet: per packet callback + * init: tree initialization callback + * cleanup: cleanup callback + * stat_group: the group this stat belongs to + */ +extern void stats_tree_register_with_group(const gchar *tapname, + const gchar *abbr, + const gchar *name, + stat_tree_packet_cb packet, + stat_tree_init_cb init, + stat_tree_cleanup_cb cleanup, + register_stat_group_t stat_group); + extern int stats_tree_parent_id_by_name(stats_tree *st, const gchar *parent_name); /* Creates a node in the tree (to be used in the in init_cb) |