diff --git a/src/lua_civet.h b/src/civetweb_private_lua.h similarity index 72% rename from src/lua_civet.h rename to src/civetweb_private_lua.h index 394fcd83..7e2057f5 100644 --- a/src/lua_civet.h +++ b/src/civetweb_private_lua.h @@ -2,4 +2,4 @@ /* Project internal header to allow main.c to call a non-public function in * mod_lua.inl */ -void lua_civet_open_all_libs(lua_State *L); +void civetweb_open_lua_libs(lua_State *L); diff --git a/src/main.c b/src/main.c index 454c8451..05493dde 100644 --- a/src/main.c +++ b/src/main.c @@ -651,15 +651,9 @@ static void set_absolute_path(char *options[], } #ifdef USE_LUA -#include "lua.h" -#include "lauxlib.h" -#include "lua_civet.h" - -#if LUA_VERSION_NUM == 501 -/* Lua 5.1 detected */ -#define LUA_OK 0 -#endif +#include "civetweb_lua.h" +#include "civetweb_private_lua.h" static int run_lua(const char *file_name) { @@ -677,7 +671,7 @@ static int run_lua(const char *file_name) fprintf(stderr, "Error: Cannot create Lua state\n"); return EXIT_FAILURE; } - lua_civet_open_all_libs(L); + civetweb_open_lua_libs(L); lua_ret = luaL_loadfile(L, file_name); if (lua_ret != LUA_OK) { diff --git a/src/mod_lua.inl b/src/mod_lua.inl index a0f5d680..be8ce0a4 100644 --- a/src/mod_lua.inl +++ b/src/mod_lua.inl @@ -1,6 +1,5 @@ #include "civetweb_lua.h" - -#include "lua_civet.h" +#include "civetweb_private_lua.h" #ifdef _WIN32 static void * @@ -1100,7 +1099,7 @@ static void prepare_lua_request_info(struct mg_connection *conn, lua_State *L) lua_rawset(L, -3); } -void lua_civet_open_all_libs(lua_State *L) +void civetweb_open_lua_libs(lua_State *L) { { extern void luaL_openlibs(lua_State *); @@ -1144,7 +1143,7 @@ static void prepare_lua_environment(struct mg_context *ctx, const char *script_name, int lua_env_type) { - lua_civet_open_all_libs(L); + civetweb_open_lua_libs(L); #if LUA_VERSION_NUM != 501 luaL_newmetatable(L, LUASOCKET);