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);
        }
Beispiel #3
0
        public static CharPtr LuaGetLocal(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.LuaGetLocal (luaState, pDebug, n);

            } finally {
                Marshal.FreeHGlobal (pDebug);
            }
            return local;
        }
Beispiel #4
0
        public static int LuaGetInfo(IntPtr luaState, string what, ref LuaDebug ar)
        {
            IntPtr pDebug = Marshal.AllocHGlobal(Marshal.SizeOf(ar));
            int    ret    = 0;

            try {
                Marshal.StructureToPtr(ar, pDebug, false);
                ret = NativeMethods.LuaGetInfo(luaState, what, pDebug);
#if NETFX_CORE
                ar = Marshal.PtrToStructure <LuaDebug> (pDebug);
#else
                ar = (LuaDebug)Marshal.PtrToStructure(pDebug, typeof(LuaDebug));
#endif
            } finally {
                Marshal.FreeHGlobal(pDebug);
            }
            return(ret);
        }
Beispiel #5
0
        public static int LuaGetInfo(IntPtr luaState, string what,ref LuaDebug ar)
        {
            IntPtr pDebug = Marshal.AllocHGlobal (Marshal.SizeOf (ar));
            int ret = 0;

            try {
                Marshal.StructureToPtr (ar, pDebug, false);
                ret = NativeMethods.LuaGetInfo (luaState, what, pDebug);
            #if NETFX_CORE
                ar = Marshal.PtrToStructure <LuaDebug> (pDebug);
            #else
                ar = (LuaDebug)Marshal.PtrToStructure (pDebug, typeof (LuaDebug));
            #endif
            } finally {
                Marshal.FreeHGlobal (pDebug);
            }
            return ret;
        }
Beispiel #6
0
 internal static extern string lua_setlocal(lua_State luaState, ref LuaDebug ar, int n);
Beispiel #7
0
 internal static extern int lua_getstack(lua_State luaState, int level, ref LuaDebug n);
Beispiel #8
0
 internal static extern int lua_getinfo(lua_State luaState, string what, ref LuaDebug ar);
Beispiel #9
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;
		}