summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-12-14 20:41:34 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-12-14 20:41:34 +0300
commita9b60057092bcb44934ff515bbf034a6142024a4 (patch)
tree2f347ef43d85ef78af1bd899c62f4d6a4c70fe1d /src/lua/lua_common.h
parent78f53ec59aed754795c0d9195a05839adc306ea5 (diff)
downloadrspamd-a9b60057092bcb44934ff515bbf034a6142024a4.tar.gz
rspamd-a9b60057092bcb44934ff515bbf034a6142024a4.zip
* Now it is possible to specify local functions to every callback of rspamd lua API,
that will allow such things as passing different variables via lua closures mechanic. Use config pool for configuration allocation in lua API to avoid leaks on config reload.
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r--src/lua/lua_common.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
index 6ae8421fb..c1891a6a7 100644
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -16,13 +16,33 @@
extern const luaL_reg null_reg[];
-#define RSPAMD_LUA_API_VERSION 8
+#define RSPAMD_LUA_API_VERSION 9
/* Common utility functions */
+
+/**
+ * Create and register new class
+ */
void lua_newclass (lua_State *L, const gchar *classname, const struct luaL_reg *func);
+
+/**
+ * Set class name for object at @param objidx position
+ */
void lua_setclass (lua_State *L, const gchar *classname, gint objidx);
+
+/**
+ * Set index of table to value (like t['index'] = value)
+ */
void lua_set_table_index (lua_State *L, const gchar *index, const gchar *value);
+
+/**
+ * Convert classname to string
+ */
gint lua_class_tostring (lua_State *L);
+
+/**
+ * Open libraries functions
+ */
gint luaopen_message (lua_State *L);
gint luaopen_task (lua_State *L);
gint luaopen_config (lua_State *L);