public void OpenLibraries(LuaState state) { LuaBindings.luaL_requiref(state, "package", luaopen_package, 1); LuaBindingMacros.lua_pop(state, 1); LuaBindings.luaL_requiref(state, "io", luaopen_io, 1); LuaBindingMacros.lua_pop(state, 1); LuaBindings.luaL_requiref(state, "os", luaopen_os, 1); LuaBindingMacros.lua_pop(state, 1); }
public static void OpenLibraries(LuaState state) { if (state == IntPtr.Zero) { throw new Exception("Lua state is null"); } LuaBindings.luaL_requiref(state, "package", luaopen_package, 1); LuaBindingMacros.lua_pop(state, 1); LuaBindings.luaL_requiref(state, "io", luaopen_io, 1); LuaBindingMacros.lua_pop(state, 1); LuaBindings.luaL_requiref(state, "os", luaopen_os, 1); LuaBindingMacros.lua_pop(state, 1); }