diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2016-01-03 13:48:39 +0100 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2016-01-11 07:43:36 +0000 |
commit | ebdaace0025749dd68a1cef7d0fd83b596861edf (patch) | |
tree | a89e4dadb12d879f9391b8959cf2b46d80457ac5 /epan/wslua | |
parent | 515502fd9b76228d5f82ccfae761b4f9e75e7ceb (diff) | |
download | wireshark-ebdaace0025749dd68a1cef7d0fd83b596861edf.tar.gz |
Lua: Added reload_lua_plugins
This makes it possible to trigger reloading Lua plugins from
within a Lua plugin. This can be used when having a plugin to
update local plugins from a external source.
Renamed reload() to reload_packets() to clarify what's reloaded,
and added a alias (marked as obsoleted) from reload().
Change-Id: I4e529992af5f651613950329e73718dbda317d2e
Reviewed-on: https://code.wireshark.org/review/13024
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_gui.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/epan/wslua/wslua_gui.c b/epan/wslua/wslua_gui.c index 1fc3baeee7..ab091092cb 100644 --- a/epan/wslua/wslua_gui.c +++ b/epan/wslua/wslua_gui.c @@ -824,14 +824,40 @@ WSLUA_FUNCTION wslua_apply_filter(lua_State* L) { /* Apply the filter in the mai } -WSLUA_FUNCTION wslua_reload(lua_State* L) { /* Reload the current capture file. */ +WSLUA_FUNCTION wslua_reload(lua_State* L) { /* Reload the current capture file. Obsolete, use reload_packets() */ - if (!ops->reload) { + if (!ops->reload_packets) { WSLUA_ERROR(reload, "GUI not available"); return 0; } - ops->reload(ops->ops_id); + ops->reload_packets(ops->ops_id); + + return 0; +} + + +WSLUA_FUNCTION wslua_reload_packets(lua_State* L) { /* Reload the current capture file. */ + + if (!ops->reload_packets) { + WSLUA_ERROR(reload, "GUI not available"); + return 0; + } + + ops->reload_packets(ops->ops_id); + + return 0; +} + + +WSLUA_FUNCTION wslua_reload_lua_plugins(lua_State* L) { /* Reload all Lua plugins. */ + + if (!ops->reload_lua_plugins) { + WSLUA_ERROR(reload_lua_plugins, "GUI not available"); + return 0; + } + + ops->reload_lua_plugins(ops->ops_id); return 0; } |