diff options
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r-- | src/lua/lua_config.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index 4e8e6eb6d..48686ff03 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -341,50 +341,6 @@ lua_config_register_function (lua_State *L) static gint lua_config_register_module_option (lua_State *L) { - struct config_file *cfg = lua_check_config (L); - const gchar *mname, *optname, *stype; - enum module_opt_type type; - - if (cfg) { - mname = memory_pool_strdup (cfg->cfg_pool, luaL_checkstring (L, 2)); - optname = memory_pool_strdup (cfg->cfg_pool, luaL_checkstring (L, 3)); - stype = memory_pool_strdup (cfg->cfg_pool, luaL_checkstring (L, 4)); - if (mname && optname) { - if (stype == NULL) { - stype = "string"; - } - if (g_ascii_strcasecmp (stype, "string") == 0) { - type = MODULE_OPT_TYPE_STRING; - } - else if (g_ascii_strcasecmp (stype, "int") == 0) { - type = MODULE_OPT_TYPE_INT; - } - else if (g_ascii_strcasecmp (stype, "uint") == 0) { - type = MODULE_OPT_TYPE_UINT; - } - else if (g_ascii_strcasecmp (stype, "time") == 0) { - type = MODULE_OPT_TYPE_TIME; - } - else if (g_ascii_strcasecmp (stype, "size") == 0) { - type = MODULE_OPT_TYPE_SIZE; - } - else if (g_ascii_strcasecmp (stype, "map") == 0) { - type = MODULE_OPT_TYPE_MAP; - } - else if (g_ascii_strcasecmp (stype, "double") == 0) { - type = MODULE_OPT_TYPE_DOUBLE; - } - else { - msg_err ("unknown type '%s' for option: %s, for module: %s", stype, optname, mname); - luaL_error (L, "unknown type '%s' for option: %s, for module: %s", stype, optname, mname); - return 0; - } - register_module_opt (mname, optname, type); - return 1; - } - luaL_error (L, "bad arguments for register module option, must be: register_module_option(modulename, optionname, optiontype)"); - } - return 0; } |