Beispiel #1
0
        public static CharPtr LuaSetLocal(IntPtr luaState, LuaDebug ar, int n)
        {
            IntPtr  pDebug = Marshal.AllocHGlobal(Marshal.SizeOf(ar));
            CharPtr local  = IntPtr.Zero;

            try {
                Marshal.StructureToPtr(ar, pDebug, false);
                local = NativeMethods.LuaSetLocal(luaState, pDebug, n);
            } finally {
                Marshal.FreeHGlobal(pDebug);
            }
            return(local);
        }
Beispiel #2
0
        public static int LuaGetStack(IntPtr luaState, int level, ref LuaDebug ar)
        {
            IntPtr pDebug = Marshal.AllocHGlobal(Marshal.SizeOf(ar));
            int    ret    = 0;

            try {
                Marshal.StructureToPtr(ar, pDebug, false);
                ret = NativeMethods.LuaGetStack(luaState, level, pDebug);
                ar  = (LuaDebug)Marshal.PtrToStructure(pDebug, typeof(LuaDebug));
            } finally {
                Marshal.FreeHGlobal(pDebug);
            }
            return(ret);
        }