void luaLoadLibraries(lua_State *lua) { luaLoadLib(lua, "", luaopen_base); luaLoadLib(lua, LUA_TABLIBNAME, luaopen_table); luaLoadLib(lua, LUA_STRLIBNAME, luaopen_string); luaLoadLib(lua, LUA_MATHLIBNAME, luaopen_math); luaLoadLib(lua, LUA_DBLIBNAME, luaopen_debug); luaLoadLib(lua, "cjson", luaopen_cjson); luaLoadLib(lua, "struct", luaopen_struct); luaLoadLib(lua, "cmsgpack", luaopen_cmsgpack); #if 0 /* Stuff that we don't load currently, for sandboxing concerns. */ luaLoadLib(lua, LUA_LOADLIBNAME, luaopen_package); luaLoadLib(lua, LUA_OSLIBNAME, luaopen_os); #endif }
int LUAInterpreter::LoadLibs() { luaLoadLib(m_lua, "", luaopen_base); luaLoadLib(m_lua, LUA_TABLIBNAME, luaopen_table); luaLoadLib(m_lua, LUA_STRLIBNAME, luaopen_string); luaLoadLib(m_lua, LUA_MATHLIBNAME, luaopen_math); luaLoadLib(m_lua, LUA_DBLIBNAME, luaopen_debug); luaLoadLib(m_lua, "cjson", luaopen_cjson); luaLoadLib(m_lua, "struct", luaopen_struct); luaLoadLib(m_lua, "cmsgpack", luaopen_cmsgpack); return 0; }