aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-01 13:35:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-01 13:35:13 +0100
commit6b80e5120a9edeebee4e266fc17c81e2a5ddaf40 (patch)
treef4bd1e271977503db3a4292e201f332aa367ace4 /src/lua/lua_common.h
parent760522c4da986f19e864da6123ba938f5e7d25d2 (diff)
downloadrspamd-6b80e5120a9edeebee4e266fc17c81e2a5ddaf40.tar.gz
rspamd-6b80e5120a9edeebee4e266fc17c81e2a5ddaf40.zip
[Minor] Add function to get a lua_reference from a string returning a function
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r--src/lua/lua_common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
index d9e4fcaec..b929ab864 100644
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -566,6 +566,15 @@ void rspamd_lua_add_ref_dtor (lua_State *L, rspamd_mempool_t *pool,
gint ref);
/**
+ * Returns a lua reference from a function like string, e.g. `return function(...) end`
+ * @param L
+ * @param str
+ * @return
+ */
+gint rspamd_lua_function_ref_from_str (lua_State *L, const gchar *str, gsize slen,
+ GError **err);
+
+/**
* Tries to load some module using `require` and get some method from it
* @param L
* @param modname