Ejemplo n.º 1
0
        /*
         * Lets go of a previously allocated reference to a table, function
         * or userdata
         */
        #region lua debug functions
        /// <summary>
        /// Activates the debug hook
        /// </summary>
        /// <param name = "mask">Mask</param>
        /// <param name = "count">Count</param>
        /// <returns>see lua docs. -1 if hook is already set</returns>
        /// <author>Reinhard Ostermeier</author>
        public int SetDebugHook(EventMasks mask, int count)
        {
            if (hookCallback.IsNull())
            {
                hookCallback = new LuaCore.lua_Hook(DebugHookCallback);
                return(LuaCore.lua_sethook(luaState, hookCallback, (int)mask, count));
            }

            return(-1);
        }
Ejemplo n.º 2
0
Archivo: Lua.cs Proyecto: Azhei/NLua
		/// <summary>
		/// Removes the debug hook
		/// </summary>
		/// <returns>see lua docs</returns>
		/// <author>Reinhard Ostermeier</author>
		public int RemoveDebugHook ()
		{
			hookCallback = null;
			return LuaCore.lua_sethook (luaState, null, 0, 0);
		}
Ejemplo n.º 3
0
Archivo: Lua.cs Proyecto: Azhei/NLua
		/*
		 * Lets go of a previously allocated reference to a table, function
		 * or userdata
		 */
		#region lua debug functions
		/// <summary>
		/// Activates the debug hook
		/// </summary>
		/// <param name = "mask">Mask</param>
		/// <param name = "count">Count</param>
		/// <returns>see lua docs. -1 if hook is already set</returns>
		/// <author>Reinhard Ostermeier</author>
		public int SetDebugHook (EventMasks mask, int count)
		{
			if (hookCallback.IsNull ()) {
				hookCallback = new LuaCore.lua_Hook (Lua.DebugHookCallback);
				return LuaCore.lua_sethook (luaState, hookCallback, (int)mask, count);
			}

			return -1;
		}
Ejemplo n.º 4
0
 /// <summary>
 /// Removes the debug hook
 /// </summary>
 /// <returns>see lua docs</returns>
 /// <author>Reinhard Ostermeier</author>
 public int RemoveDebugHook()
 {
     hookCallback = null;
     return(LuaCore.lua_sethook(luaState, null, 0, 0));
 }