From 67ea82152179c604daf2ac9dae0d09dc16e961e1 Mon Sep 17 00:00:00 2001 From: Mats Klepsland Date: Tue, 20 Oct 2015 15:59:48 +0200 Subject: [PATCH] util-lua: add (wrapper) function to push integer to lua scripts --- src/util-lua.c | 6 ++++++ src/util-lua.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/util-lua.c b/src/util-lua.c index 54524826bd..7f1d44348c 100644 --- a/src/util-lua.c +++ b/src/util-lua.c @@ -271,4 +271,10 @@ int LuaPushStringBuffer(lua_State *luastate, const uint8_t *input, size_t input_ return 1; } +int LuaPushInteger(lua_State *luastate, lua_Integer n) +{ + lua_pushinteger(luastate, n); + return 1; +} + #endif /* HAVE_LUA */ diff --git a/src/util-lua.h b/src/util-lua.h index 492007a62a..30431e74e8 100644 --- a/src/util-lua.h +++ b/src/util-lua.h @@ -80,6 +80,8 @@ void LuaPrintStack(lua_State *state); int LuaPushStringBuffer(lua_State *luastate, const uint8_t *input, size_t input_len); +int LuaPushInteger(lua_State *luastate, lua_Integer n); + #endif /* HAVE_LUA */ #endif /* __UTIL_LUA_H__ */ -- 2.47.2