lua: move lua includes to util-lua.h

Moves Lua includes to util-lua.h instead of suricata-common
so plugins (or library users) don't need to be aware of the
Lua that Suricata was built with. Instead only source files
that need to be Lua aware can include util-lua.h.
pull/6404/head
Jason Ish 3 years ago
parent 42da0fb5c5
commit 102f0c74ff

@ -26,6 +26,8 @@
#ifdef HAVE_LUA
#include "util-lua.h"
typedef struct DetectLuaThreadData {
lua_State *luastate;
uint32_t flags;

@ -18,6 +18,7 @@
#ifndef __RUST_H__
#define __RUST_H__
#include "util-lua.h"
#include "rust-context.h"
#include "rust-bindings.h"

@ -503,16 +503,6 @@ typedef enum {
#include "util-path.h"
#include "util-conf.h"
#ifdef HAVE_LUA
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#else
/* If we don't have Lua, create a typedef for lua_State so the
* exported Lua functions don't fail the build. */
typedef void lua_State;
#endif
#ifndef HAVE_STRLCAT
size_t strlcat(char *, const char *src, size_t siz);
#endif

@ -24,7 +24,17 @@
#ifndef __UTIL_LUA_H__
#define __UTIL_LUA_H__
#ifdef HAVE_LUA
#ifndef HAVE_LUA
/* If we don't have Lua, create a typedef for lua_State so the
* exported Lua functions don't fail the build. */
typedef void lua_State;
#else
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#include "util-luajit.h"

Loading…
Cancel
Save