diff options
author | Gerald Combs <gerald@wireshark.org> | 2019-04-03 14:32:30 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-04-04 04:03:38 +0000 |
commit | 8d3ac3af866ecc7b847dd5b621d828872fe9ba18 (patch) | |
tree | 3fa7aa1a57e1b828f636829f08d1adb9dfb5b395 /epan/wslua | |
parent | bdf26a35f696a1524364945a2c868e57c97d1729 (diff) |
epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.
Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/init_wslua.c | 4 | ||||
-rw-r--r-- | epan/wslua/wslua_tree.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index 58db9ce736..1b76f28e92 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -182,7 +182,7 @@ int dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data push_Tvb(L,tvb); push_Pinfo(L,pinfo); lua_tree = push_TreeItem(L, tree, proto_tree_add_item(tree, hf_wslua_fake, tvb, 0, 0, ENC_NA)); - PROTO_ITEM_SET_HIDDEN(lua_tree->item); + proto_item_set_hidden(lua_tree->item); if ( lua_pcall(L,3,1,0) ) { proto_tree_add_expert_format(tree, pinfo, &ei_lua_error, tvb, 0, 0, "Lua Error: %s", lua_tostring(L,-1)); @@ -281,7 +281,7 @@ gboolean heur_dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, v push_Tvb(L,tvb); push_Pinfo(L,pinfo); lua_tree = push_TreeItem(L, tree, proto_tree_add_item(tree, hf_wslua_fake, tvb, 0, 0, ENC_NA)); - PROTO_ITEM_SET_HIDDEN(lua_tree->item); + proto_item_set_hidden(lua_tree->item); if ( lua_pcall(L,3,1,0) ) { proto_tree_add_expert_format(tree, pinfo, &ei_lua_error, tvb, 0, 0, diff --git a/epan/wslua/wslua_tree.c b/epan/wslua/wslua_tree.c index 641ec02ed8..ecf0d7045d 100644 --- a/epan/wslua/wslua_tree.c +++ b/epan/wslua/wslua_tree.c @@ -767,7 +767,7 @@ static int TreeItem_get_visible(lua_State* L) { static int TreeItem_get_generated(lua_State* L) { TreeItem ti = checkTreeItem(L,1); - lua_pushboolean(L, PROTO_ITEM_IS_GENERATED(ti->item)); + lua_pushboolean(L, proto_item_is_generated(ti->item)); return 1; } @@ -785,7 +785,7 @@ WSLUA_METHOD TreeItem_set_generated(lua_State *L) { gboolean set = wslua_optbool(L, WSLUA_OPTARG_TreeItem_set_generated_BOOL, TRUE); if (set) { - PROTO_ITEM_SET_GENERATED(ti->item); + proto_item_set_generated(ti->item); } else { if (ti->item) FI_RESET_FLAG(PITEM_FINFO(ti->item), FI_GENERATED); @@ -804,7 +804,7 @@ WSLUA_METHOD TreeItem_set_generated(lua_State *L) { static int TreeItem_get_hidden(lua_State* L) { TreeItem ti = checkTreeItem(L,1); - lua_pushboolean(L, PROTO_ITEM_IS_HIDDEN(ti->item)); + lua_pushboolean(L, proto_item_is_hidden(ti->item)); return 1; } @@ -822,9 +822,9 @@ WSLUA_METHOD TreeItem_set_hidden(lua_State *L) { gboolean set = wslua_optbool(L, WSLUA_OPTARG_TreeItem_set_hidden_BOOL, TRUE); if (set) { - PROTO_ITEM_SET_HIDDEN(ti->item); + proto_item_set_hidden(ti->item); } else { - PROTO_ITEM_SET_VISIBLE(ti->item); + proto_item_set_visible(ti->item); } /* copy the TreeItem userdata so we give it back */ |