diff options
author | Michael Mann <mmann78@netscape.net> | 2014-06-20 02:52:37 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-06-20 06:58:12 +0000 |
commit | 28e8ce59cc5d83fdf426d56924fe01edd31d480d (patch) | |
tree | bf911d9f35ee67690c965de5d2f2396e29163b44 /epan/proto.h | |
parent | ee2885f9e8203e07c690d73c9613a28f7810b5ff (diff) |
Add proto_tree_add_subtree and proto_tree_add_subtree_format
This is intended as a replacement for all of the proto_tree_add_text followed by proto_item_add_subtree calls.
Change-Id: I892136d7b9d8b4e100996097eff62ce7af9512d2
Reviewed-on: https://code.wireshark.org/review/2472
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/epan/proto.h b/epan/proto.h index 70fbb1ac10..0f85750848 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -879,6 +879,35 @@ proto_item * proto_tree_add_text_valist(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *format, va_list ap); +/** Add a text-only node that creates a subtree underneath. + proto_tree_add_text + proto_item_add_subtree + @param tree the tree to append this item to + @param tvb the tv buffer of the current data + @param start start of data in tvb + @param length length of data in tvb + @param idx one of the ett_ array elements registered with proto_register_subtree_array() + @param tree_item item returned with tree creation. + @param Can be NULL if going to be unused + @param text label for the tree + @return the newly created tree */ +proto_tree * +proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, gint idx, proto_item **tree_item, const char *text); + +/** Add a text-only node that creates a subtree underneath. + proto_tree_add_text + proto_item_add_subtree + @param tree the tree to append this item to + @param tvb the tv buffer of the current data + @param start start of data in tvb + @param length length of data in tvb + @param idx one of the ett_ array elements registered with proto_register_subtree_array() + @param tree_item item returned with tree creation. + @param Can be NULL if going to be unused + @param format printf like format string + @param ... printf like parameters + @return the newly created tree */ +proto_tree * +proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, gint idx, proto_item **tree_item, const char *format, + ...) G_GNUC_PRINTF(5,6); /** Add a text-only node to a proto_tree with tvb_format_text() string. */ proto_item * |