Lua: Disabled debug library.

This commit is contained in:
Birunthan Mohanathas
2012-03-09 13:19:49 +00:00
parent ad2a986e88
commit e196ac08db
5 changed files with 26 additions and 8 deletions

View File

@@ -29,9 +29,27 @@ void LuaManager::Initialize()
{
// Initialize Lua
c_State = lua_open();
// Load Lua base libraries
luaL_openlibs(c_State);
// Initialize standard libraries except debug, modified from linit.c
const luaL_Reg lualibs[] =
{
{ "", luaopen_base },
{ LUA_LOADLIBNAME, luaopen_package },
{ LUA_TABLIBNAME, luaopen_table },
{ LUA_IOLIBNAME, luaopen_io },
{ LUA_OSLIBNAME, luaopen_os },
{ LUA_STRLIBNAME, luaopen_string },
{ LUA_MATHLIBNAME, luaopen_math },
{ NULL, NULL }
};
const luaL_Reg* lib = lualibs;
for (; lib->func; lib++)
{
lua_pushcfunction(c_State, lib->func);
lua_pushstring(c_State, lib->name);
lua_call(c_State, 1, 0);
}
// Register custom types and functions
RegisterGlobal(c_State);