public void ProcessString(string str) { CApi.luaL_loadbufferx(lua_State, Encoding.ASCII.GetBytes(str), (UIntPtr)str.Length, "ProcessStringChunk", null); LuaError ret; ret = (LuaError)CApi.lua_pcallk(lua_State, 0, LUA_MULTIRET, 0, IntPtr.Zero, IntPtr.Zero); if (ret != LuaError.OK) { ErrorCodeToException(ret); } }
public void ProcessFile(string fileName) { LuaError ret; ret = (LuaError)CApi.luaL_loadfilex(lua_State, fileName, null); if (ret != LuaError.OK) { ErrorCodeToException(ret); } ret = (LuaError)CApi.lua_pcallk(lua_State, 0, LUA_MULTIRET, 0, IntPtr.Zero, IntPtr.Zero); if (ret != LuaError.OK) { ErrorCodeToException(ret); } }