diff --git a/daemon/bindings.h b/daemon/bindings.h index bb2fc1fe3595f027be601c2ced7ca63da63c0851..d0e2a93d3b1967f630a421c57908973324e01e04 100644 --- a/daemon/bindings.h +++ b/daemon/bindings.h @@ -19,6 +19,10 @@ */ #pragma once +#include <lua.h> +#include <lualib.h> +#include <lauxlib.h> + #include "daemon/engine.h" /** diff --git a/daemon/engine.c b/daemon/engine.c index 12a5fede3c9a4feee968f6257ebc8b8e8e4a65a3..39ea18d87a671ae59ac88b34f4774f59d25150b8 100644 --- a/daemon/engine.c +++ b/daemon/engine.c @@ -19,6 +19,7 @@ #include <libknot/internal/mem.h> #include "daemon/engine.h" +#include "daemon/bindings.h" #include "lib/cache.h" #include "lib/defines.h" diff --git a/daemon/engine.h b/daemon/engine.h index 44a6c6abcfc0f78798e63dc5dfd2fd5bc592c7c7..023d45cac8fe6ed8cf241fc530a4b9194b45f23b 100644 --- a/daemon/engine.h +++ b/daemon/engine.h @@ -16,9 +16,11 @@ #pragma once -#include <lua.h> -#include <lualib.h> -#include <lauxlib.h> +/* + * @internal These are forward decls to allow building modules with engine but without Lua. + */ +struct lua_State; +typedef int (*lua_CFunction) (struct lua_State *L); #include "lib/resolve.h" #include "lib/generic/array.h" @@ -27,7 +29,7 @@ struct engine { struct kr_context resolver; modulelist_t modules; mm_ctx_t *pool; - lua_State *L; + struct lua_State *L; }; int engine_init(struct engine *engine, mm_ctx_t *pool); @@ -39,4 +41,4 @@ int engine_register(struct engine *engine, const char *module); int engine_unregister(struct engine *engine, const char *module); /** Return engine light userdata. */ void engine_lualib(struct engine *engine, const char *name, lua_CFunction lib_cb); -struct engine *engine_luaget(lua_State *L); \ No newline at end of file +struct engine *engine_luaget(struct lua_State *L); \ No newline at end of file