aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-08-31 15:34:09 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-08-31 15:34:09 +0400
commit155f154d7aa04a7132a675b8040cbf7657b8dc68 (patch)
tree7f2e9ff7f5fc44e27c5b6e8065954a105fadbcb6 /src/lua/lua_common.h
parentd77c3021ccbdf4994c8a5681ec99b99d978cb044 (diff)
downloadrspamd-155f154d7aa04a7132a675b8040cbf7657b8dc68.tar.gz
rspamd-155f154d7aa04a7132a675b8040cbf7657b8dc68.zip
* Reorganze lua support in rspamd
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r--src/lua/lua_common.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
new file mode 100644
index 000000000..b72171e99
--- /dev/null
+++ b/src/lua/lua_common.h
@@ -0,0 +1,27 @@
+#ifndef RSPAMD_LUA_H
+#define RSPAMD_LUA_H
+
+#include "../config.h"
+#include "../main.h"
+#include "../cfg_file.h"
+#include <lua.h>
+#include <lauxlib.h>
+#include <lualib.h>
+
+/* Interface definitions */
+#define LUA_FUNCTION_DEF(class, name) static int lua_##class##_##name(lua_State *L)
+#define LUA_INTERFACE_DEF(class, name) { #name, lua_##class##_##name }
+
+void lua_newclass (lua_State *L, const char *classname, const struct luaL_reg *func);
+void lua_setclass (lua_State *L, const char *classname, int objidx);
+int luaopen_message (lua_State *L);
+int luaopen_task (lua_State *L);
+int luaopen_config (lua_State *L);
+void init_lua_filters (struct config_file *cfg);
+
+int lua_call_filter (const char *function, struct worker_task *task);
+int lua_call_chain_filter (const char *function, struct worker_task *task, int *marks, unsigned int number);
+double lua_consolidation_func (struct worker_task *task, const char *metric_name, const char *function_name);
+void add_luabuf (const char *line);
+
+#endif