aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-21 13:09:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-21 13:09:16 +0100
commitd4bd976fd9b084d845829fc659fc56b736a6d0af (patch)
tree1379c8d5dc7b32284c37eefa32e016cc0aa8cd9c /src/lua/lua_common.h
parentcfcecb66f88448272a3a0c77e0a4782f6924a822 (diff)
downloadrspamd-d4bd976fd9b084d845829fc659fc56b736a6d0af.tar.gz
rspamd-d4bd976fd9b084d845829fc659fc56b736a6d0af.zip
[Rework] Rework urls extraction
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r--src/lua/lua_common.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
index 5edec663b..296b8f326 100644
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -63,11 +63,9 @@ static inline void lua_rawsetp (lua_State *L, int i, const void *p) {
#endif
/* Interface definitions */
-#define LUA_FUNCTION_DEF(class, name) static int lua_ ## class ## _ ## name ( \
- lua_State * L)
-#define LUA_PUBLIC_FUNCTION_DEF(class, name) int lua_ ## class ## _ ## name ( \
- lua_State * L)
-#define LUA_INTERFACE_DEF(class, name) { # name, lua_ ## class ## _ ## name }
+#define LUA_FUNCTION_DEF(class, name) static int lua_##class##_##name (lua_State * L)
+#define LUA_PUBLIC_FUNCTION_DEF(class, name) int lua_##class##_##name (lua_State * L)
+#define LUA_INTERFACE_DEF(class, name) { #name, lua_##class##_##name }
#ifdef __cplusplus
extern "C" {
@@ -162,6 +160,13 @@ void rspamd_lua_new_class (lua_State *L,
void rspamd_lua_setclass (lua_State *L, const gchar *classname, gint objidx);
/**
+ * Pushes the metatable for specific class on top of the stack
+ * @param L
+ * @param classname
+ */
+void rspamd_lua_class_metatable (lua_State *L, const gchar *classname);
+
+/**
* Adds a new field to the class (metatable) identified by `classname`
* @param L
* @param classname