Exemple #1
0
        public static int lua_cpcall(lua_State L, lua_CFunction func, object ud)
        {
            CCallS c = new CCallS();

            c.func = func;
            c.ud   = ud;
            return(luaD_pcall(L, f_Ccall, c, savestack(L, L.top), 0));
        }
Exemple #2
0
        public static int lua_cpcall(lua_State L, lua_CFunction func, object ud)
        {
            CCallS c = new CCallS();
            int    status;

            lua_lock(L);
            c.func = func;
            c.ud   = ud;
            status = luaD_pcall(L, f_Ccall, c, savestack(L, L.top), 0);
            lua_unlock(L);
            return(status);
        }
Exemple #3
0
        public static int LuaCPCall(LuaState L, LuaNativeFunction func, object ud)
        {
            CCallS c = new CCallS();
            int    status;

            LuaLock(L);
            c.func = func;
            c.ud   = ud;
            status = LuaDPCall(L, FunctionCCall, c, SaveStack(L, L.top), 0);
            LuaUnlock(L);
            return(status);
        }
Exemple #4
0
        public static int LinyeeCPCall(LinyeeState L, LinyeeNativeFunction func, object ud)
        {
            CCallS c = new CCallS();
            int    status;

            LinyeeLock(L);
            c.func = func;
            c.ud   = ud;
            status = LinyeeDPCall(L, FunctionCCall, c, SaveStack(L, L.top), 0);
            LinyeeUnlock(L);
            return(status);
        }
Exemple #5
0
        static void f_Ccall(lua_State L, object ud)
        {
            CCallS  c = ud as CCallS;
            Closure cl;

            cl     = luaF_newCclosure(L, 0, getcurrenv(L));
            cl.c.f = c.func;
            setclvalue(L, L.top, cl);      /* push function */
            api_incr_top(L);
            setpvalue(L.top, c.ud);        /* push only argument */
            api_incr_top(L);
            luaD_call(L, L.top - 2, 0);
        }
Exemple #6
0
        static void FunctionCCall(LuaState L, object ud)
        {
            CCallS  c = ud as CCallS;
            Closure cl;

            cl     = LuaFNewCclosure(L, 0, GetCurrentEnv(L));
            cl.c.f = c.func;
            SetCLValue(L, L.top, cl);      /* push function */
            IncrementTop(L);
            SetPValue(L.top, c.ud);        /* push only argument */
            IncrementTop(L);
            LuaDCall(L, L.top - 2, 0);
        }
Exemple #7
0
 public static int lua_cpcall(lua_State L, lua_CFunction func, object ud)
 {
     CCallS c = new CCallS();
       int status;
       lua_lock(L);
       c.func = func;
       c.ud = ud;
       status = luaD_pcall(L, f_Ccall, c, savestack(L, L.top), 0);
       lua_unlock(L);
       return status;
 }
Exemple #8
0
 public static int LuaCPCall(LuaState L, LuaNativeFunction func, object ud)
 {
     CCallS c = new CCallS();
     int status;
     LuaLock(L);
     c.func = func;
     c.ud = ud;
     status = LuaDPCall(L, FunctionCCall, c, SaveStack(L, L.top), 0);
     LuaUnlock(L);
     return status;
 }