public static LuaProto LoadBinary(ILuaState lua, ILoadInfo loadinfo, string name) { try { var reader = new BinaryBytesReader(loadinfo); var undump = new Undump(reader); undump.LoadHeader(); return(undump.LoadFunction()); } catch (UndumpException e) { var Lua = (LuaState)lua; Lua.O_PushString(string.Format( "{0}: {1} precompiled chunk", name, e.Why)); Lua.D_Throw(ThreadStatus.LUA_ERRSYNTAX); return(null); } }
private Undump(BinaryBytesReader reader) { Reader = reader; }