sourcehook/sourcehook_impl.h
changeset 162 a95db73792e5
parent 157 064f77cac7ab
child 163 377bdd31c28d
     1.1 --- a/sourcehook/sourcehook_impl.h	Thu Dec 22 21:00:54 2005 +0000
     1.2 +++ b/sourcehook/sourcehook_impl.h	Fri Dec 23 11:58:11 2005 +0000
     1.3 @@ -76,6 +76,7 @@
     1.4  				virtual ~CIter();
     1.5  
     1.6  				void GoToBegin();
     1.7 +				void Set(CIter *pOther);
     1.8  
     1.9  				bool End();
    1.10  				void Next();
    1.11 @@ -89,7 +90,16 @@
    1.12  			};
    1.13  
    1.14  			CIter *m_FreeIters;
    1.15 -			CIter *m_UsedIters;
    1.16 +			CIter *m_UsedIters;		// The last returned and not-yet-released iter is always m_UsedIters
    1.17 +
    1.18 +			// For recalls
    1.19 +			bool m_Recall;
    1.20 +
    1.21 +			void SetRecallState();	// Sets the list into a state where the next returned
    1.22 +									// iterator (from GetIter) will be a copy of the last
    1.23 +									// returned iterator, incremented by one. This is used in Recalls.
    1.24 +									// The hook resets this state automatically on:
    1.25 +									// GetIter, ReleaseIter
    1.26  
    1.27  			CHookList();
    1.28  			CHookList(const CHookList &other);
    1.29 @@ -165,6 +175,8 @@
    1.30  
    1.31  			VfnPtrList m_VfnPtrs;
    1.32  
    1.33 +			int m_HookFuncVersion;
    1.34 +
    1.35  		public:
    1.36  			virtual ~CHookManagerInfo();
    1.37  
    1.38 @@ -221,10 +233,11 @@
    1.39  			META_RES *pCurRes;
    1.40  
    1.41  			bool shouldContinue;
    1.42 +			bool recall;							//!< True if we're in a recall, eh.
    1.43  
    1.44  			IIface *pCurIface;
    1.45  			const void *pOrigRet;
    1.46 -			const void *pOverrideRet;
    1.47 +			void *pOverrideRet;
    1.48  			void **pIfacePtrPtr;
    1.49  		};
    1.50  		typedef CStack<HookLoopInfo> HookLoopInfoStack;
    1.51 @@ -357,7 +370,7 @@
    1.52  		void SetStatusPtr(META_RES *mres);			//!< Sets pointer to the status variable
    1.53  		void SetIfacePtrPtr(void **pp);				//!< Sets pointer to the interface this pointer
    1.54  		void SetOrigRetPtr(const void *ptr);		//!< Sets the original return pointer
    1.55 -		void SetOverrideRetPtr(const void *ptr);	//!< Sets the override result pointer
    1.56 +		void SetOverrideRetPtr(void *ptr);			//!< Sets the override result pointer
    1.57  		bool ShouldContinue();						//!< Returns false if the hook loop should exit
    1.58  
    1.59  		/**
    1.60 @@ -367,6 +380,11 @@
    1.61  		*   @param pubFunc The hook manager's info function
    1.62  		*/
    1.63  		virtual void RemoveHookManager(Plugin plug, HookManagerPubFunc pubFunc);
    1.64 +		virtual void DoRecall();					//!< Initiates a recall sequence
    1.65 +		virtual void *GetOverrideRetPtr();			//!< Returns the pointer set by SetOverrideRetPtr
    1.66 +
    1.67 +		virtual void *SetupHookLoop(META_RES *statusPtr, META_RES *prevResPtr, META_RES *curResPtr,
    1.68 +			void **ifacePtrPtr, const void *origRetPtr, void *overrideRetPtr);
    1.69  	};
    1.70  }
    1.71