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); }
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); }
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; }
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); }
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; }
internal static extern string lua_setlocal(lua_State luaState, ref LuaDebug ar, int n);
internal static extern int lua_getstack(lua_State luaState, int level, ref LuaDebug n);
internal static extern int lua_getinfo(lua_State luaState, string what, ref LuaDebug ar);
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; }