aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r--src/lua/lua_common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
index ec5215edf..fc64ccd28 100644
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -19,6 +19,11 @@
#define luaL_reg luaL_Reg
#endif
+#define LUA_ENUM(L, name, val) \
+ lua_pushlstring(L, #name, sizeof(#name)-1); \
+ lua_pushnumber(L, val); \
+ lua_settable(L, -3);
+
#if LUA_VERSION_NUM > 501
static inline void
luaL_register (lua_State *L, const gchar *name, const struct luaL_reg *methods)
@@ -129,6 +134,11 @@ void lua_ip_push (lua_State *L, int af, gpointer data);
void lua_ip_push_fromstring (lua_State *L, const gchar *ip_str);
/**
+ * Create type error
+ */
+int rspamd_lua_typerror (lua_State *L, int narg, const char *tname);
+
+/**
* Lua IP address structure
*/
struct rspamd_lua_ip {