*/
LUA_FUNCTION_DEF (config, init_modules);
+/***
+ * @method rspamd_config:get_tld_path()
+ * Returns path to TLD file
+ * @return {string} path to tld file
+ */
+LUA_FUNCTION_DEF (config, get_tld_path);
+
static const struct luaL_reg configlib_m[] = {
LUA_INTERFACE_DEF (config, get_module_opt),
LUA_INTERFACE_DEF (config, get_mempool),
LUA_INTERFACE_DEF (config, load_ucl),
LUA_INTERFACE_DEF (config, parse_rcl),
LUA_INTERFACE_DEF (config, init_modules),
+ LUA_INTERFACE_DEF (config, get_tld_path),
{"__tostring", rspamd_lua_class_tostring},
{"__newindex", lua_config_newindex},
{NULL, NULL}
return 1;
}
+static gint
+lua_config_get_tld_path (lua_State *L)
+{
+ struct rspamd_config *cfg = lua_check_config (L, 1);
+
+ if (cfg != NULL) {
+ lua_pushstring (L, cfg->tld_file);
+ }
+ else {
+ return luaL_error (L, "invalid arguments");
+ }
+
+ return 1;
+}
+
static gint
lua_monitored_alive (lua_State *L)
{