From: Mats Klepsland Date: Tue, 20 Oct 2015 13:59:48 +0000 (+0200) Subject: util-lua: add (wrapper) function to push integer to lua scripts X-Git-Tag: suricata-3.2beta1~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67ea82152179c604daf2ac9dae0d09dc16e961e1;p=thirdparty%2Fsuricata.git util-lua: add (wrapper) function to push integer to lua scripts --- 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__ */