diff options
Diffstat (limited to 'epan/wslua/init_wslua.c')
-rw-r--r-- | epan/wslua/init_wslua.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index 5e16c53bde..5c43c158ff 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -184,6 +184,17 @@ static void wslua_init_routine(void) { } +static int prefs_changed_error_handler(lua_State* LS) { + const gchar* error = lua_tostring(LS,1); + report_failure("Lua: Error During execution of prefs apply callback:\n %s",error); + return 0; +} + +void wslua_prefs_changed(void) { + if (L) { + iter_table_and_call(L, WSLUA_PREFS_CHANGED,prefs_changed_error_handler); + } +} static const char *getF(lua_State *LS _U_, void *ud, size_t *size) { @@ -381,6 +392,10 @@ int wslua_init(register_cb cb, gpointer client_data) { lua_newtable (L); lua_dissectors_table_ref = luaL_ref(L, LUA_REGISTRYINDEX); + /* the preferences apply_cb table (accessible by the user) */ + lua_newtable (L); + lua_setglobal(L, WSLUA_PREFS_CHANGED); + /* set running_superuser variable to its proper value */ WSLUA_REG_GLOBAL_BOOL(L,"running_superuser",started_with_special_privs()); |