aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2011-10-02 13:39:35 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2011-10-02 13:39:35 +0000
commit3e75b436a0088ba55225bc65e39ce2bda2bcfa78 (patch)
treefd4a099c4ea2cb39be772a48e625f64922f871b2 /epan/wslua
parent18ed55e1e6607d9c0ed8c3920dcdc0c618e09aa0 (diff)
Added register action for loading Lua plugins.
Removed an unused argument to wslua_init(). svn path=/trunk/; revision=39214
Diffstat (limited to 'epan/wslua')
-rw-r--r--epan/wslua/init_wslua.c14
-rw-r--r--epan/wslua/wslua.h2
2 files changed, 10 insertions, 6 deletions
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c
index 37410a0829..ede501fd38 100644
--- a/epan/wslua/init_wslua.c
+++ b/epan/wslua/init_wslua.c
@@ -317,11 +317,18 @@ static void lua_load_plugins (const char *dirname)
}
}
-int wslua_init(lua_State* LS) {
+int wslua_init(register_cb cb, gpointer client_data) {
gchar* filename;
const funnel_ops_t* ops = funnel_get_funnel_ops();
gboolean run_anyway = FALSE;
+ /*
+ ** TBD: count the number of lua scripts to load in splash_update()
+ ** and call cb for each file instead of once for all files.
+ */
+ if(cb)
+ (*cb)(RA_LUA_PLUGINS, NULL, client_data);
+
/* set up the logger */
g_log_set_handler(LOG_DOMAIN_LUA, G_LOG_LEVEL_CRITICAL|
G_LOG_LEVEL_WARNING|
@@ -331,10 +338,7 @@ int wslua_init(lua_State* LS) {
ops ? ops->logger : basic_logger, NULL);
if (!L) {
- if (LS)
- L = LS;
- else
- L = luaL_newstate();
+ L = luaL_newstate();
}
WSLUA_INIT(L);
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h
index a5d38d6658..a7a6447354 100644
--- a/epan/wslua/wslua.h
+++ b/epan/wslua/wslua.h
@@ -403,7 +403,7 @@ extern void clear_outstanding_TreeItem(void);
extern void wslua_print_stack(char* s, lua_State* L);
-extern int wslua_init(lua_State* L);
+extern int wslua_init(register_cb cb, gpointer client_data);
extern tap_extractor_t wslua_get_tap_extractor(const gchar* name);
extern int wslua_set_tap_enums(lua_State* L);