sourcehook/sourcehook.h
changeset 8 07e339563a28
parent 6 4803fd7d28bb
child 10 406d8e5ddfc4
     1.1 --- a/sourcehook/sourcehook.h	Sat Apr 16 19:59:26 2005 +0000
     1.2 +++ b/sourcehook/sourcehook.h	Sat Apr 16 20:26:33 2005 +0000
     1.3 @@ -17,7 +17,7 @@
     1.4  #endif
     1.5  
     1.6  #ifndef SH_GLOB_PLUGPTR
     1.7 -#define SH_GLOB_PLUGPTR g_Plug
     1.8 +#define SH_GLOB_PLUGPTR g_PLID
     1.9  #endif
    1.10  
    1.11  #define SH_ASSERT(x) if (!(x)) __asm { int 3 }
    1.12 @@ -79,7 +79,7 @@
    1.13  	*	SourceHook doesn't really care what this is. As long as the ==, != and = operators work on it
    1.14  	*	and every plugin has a unique identifier, everything is ok.
    1.15  	*/
    1.16 -	typedef void* Plugin;
    1.17 +	typedef int Plugin;
    1.18  
    1.19  	enum HookManagerAction
    1.20  	{
    1.21 @@ -141,6 +141,7 @@
    1.22  			struct Hook
    1.23  			{
    1.24  				ISHDelegate *handler;			//!< Pointer to the handler
    1.25 +				bool paused;					//!< If true, the hook should not be executed
    1.26  				Plugin plug;					//!< The owner plugin
    1.27  			};
    1.28  			void *callclass;					//!< Stores a call class for this interface
    1.29 @@ -397,6 +398,7 @@
    1.30  	prev_res = MRES_IGNORED; \
    1.31  	for (std::list<HookManagerInfo::Iface::Hook>::iterator hiter = post##list.begin(); hiter != post##list.end(); ++hiter) \
    1.32  	{ \
    1.33 +		if (hiter->paused) continue; \
    1.34  		cur_res = MRES_IGNORED; \
    1.35  		plugin_ret = reinterpret_cast<CSHDelegate<FD>*>(hiter->handler)->GetDeleg() params; \
    1.36  		prev_res = cur_res; \
    1.37 @@ -448,6 +450,7 @@
    1.38  	prev_res = MRES_IGNORED; \
    1.39  	for (std::list<HookManagerInfo::Iface::Hook>::iterator hiter = post##list.begin(); hiter != post##list.end(); ++hiter) \
    1.40  	{ \
    1.41 +		if (hiter->paused) continue; \
    1.42  		cur_res = MRES_IGNORED; \
    1.43  		reinterpret_cast<CSHDelegate<FD>*>(hiter->handler)->GetDeleg() params; \
    1.44  		prev_res = cur_res; \