LuaInterface.LuaDLL.lua_checkstack C# (CSharp) Method

lua_checkstack() public static method

public static lua_checkstack ( IntPtr luaState, int extra ) : bool
luaState System.IntPtr
extra int
return bool
        public static bool lua_checkstack(IntPtr luaState, int extra)
        {
            return LuaDLLWrapper.lua_checkstack(luaState, extra) > 0;
        }
        [DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]

Usage Example

示例#1
0
文件: Lua.cs 项目: weimingtom/pap2
        /*
         * Calls the object as a function with the provided arguments,
         * returning the function's returned values inside an array
         */
        internal object[] callFunction(object function, object[] args)
        {
            int nArgs  = 0;
            int oldTop = LuaDLL.lua_gettop(luaState);

            if (args != null && !LuaDLL.lua_checkstack(luaState, args.Length + 6))
            {
                throw new LuaException("Lua stack overflow");
            }
            translator.push(luaState, function);
            if (args != null)
            {
                nArgs = args.Length;
                for (int i = 0; i < args.Length; i++)
                {
                    translator.push(luaState, args[i]);
                }
            }
            int error = LuaDLL.lua_pcall(luaState, nArgs, -1, 0);

            if (error != 0)
            {
                ThrowExceptionFromError(oldTop);
            }

//             object[] results = translator.popValues(luaState, oldTop);
//             if (results != null && results.Length < 1)
//             {
//                 return null;
//             }
//             return results;
            return(translator.popValues(luaState, oldTop));
        }
All Usage Examples Of LuaInterface.LuaDLL::lua_checkstack
LuaDLL