diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-07-07 16:33:49 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-07-07 16:33:49 +0000 |
commit | 792f35a28c4b528bc819fa4d30976c2cf84393c1 (patch) | |
tree | cd65b0897efde6ef949ab9223e0daba3273e3041 /epan | |
parent | cd7712fd2f3064945ce001e1d82109852c3b3191 (diff) |
Make tree_is_expanded array static, add setter/getter function.
svn path=/trunk/; revision=50433
Diffstat (limited to 'epan')
-rw-r--r-- | epan/proto.c | 16 | ||||
-rw-r--r-- | epan/proto.h | 13 |
2 files changed, 21 insertions, 8 deletions
diff --git a/epan/proto.c b/epan/proto.c index 2f4b033fe0..d873cc4a67 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -304,7 +304,7 @@ static void save_same_name_hfinfo(gpointer data) /* Points to the first element of an array of Booleans, indexed by a subtree item type; that array element is TRUE if subtrees of an item of that type are to be expanded. */ -gboolean *tree_is_expanded; +static gboolean *tree_is_expanded; /* Number of elements in that array. */ int num_tree_types; @@ -7404,6 +7404,20 @@ proto_check_field_name(const gchar *field_name) return wrs_check_charset(fld_abbrev_chars, field_name); } +gboolean +tree_expanded(int tree_type) +{ + g_assert(tree_type >= 0 && tree_type < num_tree_types); + return tree_is_expanded[tree_type]; +} + +void +tree_expanded_set(int tree_type, gboolean value) +{ + g_assert(tree_type >= 0 && tree_type < num_tree_types); + tree_is_expanded[tree_type] = value; +} + /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * diff --git a/epan/proto.h b/epan/proto.h index e82747f9c8..e224364cb0 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1852,17 +1852,16 @@ WS_DLL_PUBLIC void proto_registrar_dump_fields(void); WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void); - -/** Points to the first element of an array of Booleans, indexed by - a subtree item type. That array element is TRUE if subtrees of - an item of that type are to be expanded. With MSVC and a - libwireshark.dll, we need a special declaration. */ -WS_DLL_PUBLIC gboolean *tree_is_expanded; - /** Number of elements in the tree_is_expanded array. With MSVC and a * libwireshark.dll, we need a special declaration. */ WS_DLL_PUBLIC int num_tree_types; +/** Returns TRUE if subtrees of that type are to be expanded. */ +WS_DLL_PUBLIC gboolean tree_expanded(int tree_type); + +/** Sets if subtrees of that type are to be expanded. */ +WS_DLL_PUBLIC void tree_expanded_set(int tree_type, gboolean value); + /** glib doesn't have g_ptr_array_len of all things!*/ #ifndef g_ptr_array_len #define g_ptr_array_len(a) ((a)?(a)->len:0) |