diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-15 14:00:33 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-15 14:00:33 +0000 |
commit | 83f4454b042f8c2b62e52ce447748823c7e52365 (patch) | |
tree | f1424bf2661356ea2675e35ad56379f7ad3d9c1d /src/lua/lua_common.h | |
parent | 7a580591aabfda1fc1474c8baba45b8b9a679195 (diff) | |
download | rspamd-83f4454b042f8c2b62e52ce447748823c7e52365.tar.gz rspamd-83f4454b042f8c2b62e52ce447748823c7e52365.zip |
[Minor] Allow to require some Lua function in C
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r-- | src/lua/lua_common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h index 0d95d9092..310a5504c 100644 --- a/src/lua/lua_common.h +++ b/src/lua/lua_common.h @@ -390,5 +390,15 @@ gboolean rspamd_lua_run_postloads (lua_State *L, struct rspamd_config *cfg, void rspamd_lua_add_ref_dtor (lua_State *L, rspamd_mempool_t *pool, gint ref); +/** + * Tries to load some module using `require` and get some method from it + * @param L + * @param modname + * @param funcname + * @return TRUE if function exists in that module, the function is pushed in stack, otherwise stack is unchanged and FALSE is returned + */ +gboolean rspamd_lua_require_function (lua_State *L, const gchar *modname, + const gchar *funcname); + #endif /* WITH_LUA */ #endif /* RSPAMD_LUA_H */ |