public static void lua_sethook(lua_State L, KyHookFunction hookFunction, LuaHookMask mask, int count) { #if SAVE_FUNC savedFn.TryAdd(hookFunction); #endif lua_sethook(L, hookFunction.ToFunctionPointer(), (int)mask, count); }
public int SetDebugHook(LuaHookMask mask, int count) { if (_hookCallback == null) { _hookCallback = DebugHookCallback; lua_sethook(L, _hookCallback, mask, count); } return(-1); }
public static IntPtr ToFunctionPointer(this KyHookFunction d) { if (d == null) { return(IntPtr.Zero); } #if NETFRAMEWORK return(Marshal.GetFunctionPointerForDelegate(d)); #else return(Marshal.GetFunctionPointerForDelegate <KyHookFunction>(d)); #endif }
public void RemoveDebugHook() { _hookCallback = null; lua_sethook(L, null, LuaHookMask.Disabled, 0); }