LuaInterface.LuaDLL.luaL_loadfile C# (CSharp) Method

luaL_loadfile() private method

private luaL_loadfile ( IntPtr luaState, string filename ) : int
luaState System.IntPtr
filename string
return int
        public static extern int luaL_loadfile(IntPtr luaState, string filename);
#endif

Usage Example

示例#1
0
        /*
         * Excutes a Lua file and returns all the chunk's return
         * values in an array
         */
        public object[] DoFile(string fileName)
        {
            int oldTop = LuaDLL.lua_gettop(luaState);

            if (LuaDLL.luaL_loadfile(luaState, fileName) == 0)
            {
                executing = true;
                try
                {
                    if (LuaDLL.lua_pcall(luaState, 0, -1, 0) == 0)
                    {
                        return(translator.popValues(luaState, oldTop));
                    }
                    else
                    {
                        ThrowExceptionFromError(oldTop);
                    }
                }
                finally { executing = false; }
            }
            else
            {
                ThrowExceptionFromError(oldTop);
            }

            return(null);            // Never reached - keeps compiler happy
        }
All Usage Examples Of LuaInterface.LuaDLL::luaL_loadfile
LuaDLL