コード例 #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);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: Lua.cs プロジェクト: raymanyu/KeraLua
        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;
        }
コード例 #4
0
ファイル: Lua.cs プロジェクト: TASVideos/KeraLua
        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);
        }
コード例 #5
0
ファイル: Lua.cs プロジェクト: raymanyu/KeraLua
        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;
        }
コード例 #6
0
ファイル: NativeMethods.cs プロジェクト: attackgithub/KeraLua
 internal static extern string lua_setlocal(lua_State luaState, ref LuaDebug ar, int n);
コード例 #7
0
ファイル: NativeMethods.cs プロジェクト: attackgithub/KeraLua
 internal static extern int lua_getstack(lua_State luaState, int level, ref LuaDebug n);
コード例 #8
0
ファイル: NativeMethods.cs プロジェクト: attackgithub/KeraLua
 internal static extern int lua_getinfo(lua_State luaState, string what, ref LuaDebug ar);
コード例 #9
0
ファイル: Lua.cs プロジェクト: ZoneBeat/FAForeverMapEditor
		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;
		}