diff -r bb01f2691cd1 -r 4803fd7d28bb sourcehook/sourcehook_impl.h --- a/sourcehook/sourcehook_impl.h Thu Apr 14 16:19:07 2005 +0000 +++ b/sourcehook/sourcehook_impl.h Sat Apr 16 16:55:53 2005 +0000 @@ -22,9 +22,26 @@ class CSourceHookImpl : public ISourceHook { /** - * @brief A list of HookerInfo structures + * @brief A hook can be removed if you have this information */ - typedef std::list HookerInfoList; + struct RemoveHookInfo + { + RemoveHookInfo(Plugin p, void *i, HookManagerPubFunc h, ISHDelegate *hd, bool ps) + : plug(p), iface(i), hpf(h), handler(hd), post(ps) + { + } + + Plugin plug; + void *iface; + HookManagerPubFunc hpf; + ISHDelegate *handler; + bool post; + }; + + /** + * @brief A list of HookManagerInfo structures + */ + typedef std::list HookManInfoList; /** @@ -33,14 +50,14 @@ typedef std::list Impl_CallClassList; Impl_CallClassList m_CallClasses; //!< A list of already generated callclasses - HookerInfoList m_Hookers; //!< A list of hookers + HookManInfoList m_HookMans; //!< A list of hook managers int m_PageSize; //!< Stores the system's page size /** - * @brief Finds a hooker for a function based on a text-prototype, a vtable offset and a vtable index + * @brief Finds a hook manager for a function based on a text-prototype, a vtable offset and a vtable index */ - HookerInfoList::iterator FindHooker(HookerInfoList::iterator begin, HookerInfoList::iterator end, + HookManInfoList::iterator FindHookMan(HookManInfoList::iterator begin, HookManInfoList::iterator end, const char *proto, int vtblofs, int vtblidx, int thisptrofs); void FreeCallClass(CallClass &cc); @@ -57,12 +74,12 @@ ~CSourceHookImpl(); /** - * @brief Make sure that a plugin is not used by any other plugins anymore, and unregister all its hookers + * @brief Make sure that a plugin is not used by any other plugins anymore, and unregister all its hook managers */ void UnloadPlugin(Plugin plug); /** - * @brief Shut down the whole system, unregister all hookers + * @brief Shut down the whole system, unregister all hook managers */ void CompleteShutdown(); @@ -73,11 +90,12 @@ * * @param plug The unique identifier of the plugin that calls this function * @param iface The interface pointer - * @param myHooker A hooker (hook manager) function that should be capable of handling the corresponding function + * @param ifacesize The size of the class iface points to + * @param myHookMan A hook manager function that should be capable of handling the function * @param handler A pointer to a FastDelegate containing the hook handler * @param post Set to true if you want a post handler */ - bool AddHook(Plugin plug, void *iface, int ifacesize, Hooker myHooker, ISHDelegate *handler, bool post); + bool AddHook(Plugin plug, void *iface, int ifacesize, HookManagerPubFunc myHookMan, ISHDelegate *handler, bool post); /** * @brief Removes a hook. @@ -86,16 +104,14 @@ * * @param plug The unique identifier of the plugin that calls this function * @param iface The interface pointer - * @param vtableoffset Offset to the vtable, in bytes - * @param vtableidx Pointer to the vtable index of the function - * @param proto A text version of the function prototype; generated by the macros + * @param myHookMan A hook manager function that should be capable of handling the function * @param handler A pointer to a FastDelegate containing the hook handler * @param post Set to true if you want a post handler */ - bool RemoveHook(Plugin plug, void *iface, Hooker myHooker, ISHDelegate *handler, bool post); + bool RemoveHook(Plugin plug, void *iface, HookManagerPubFunc myHookMan, ISHDelegate *handler, bool post); /** - * @brief Checks whether a plugin has (a) hooker(s) that is/are currently used by other plugins + * @brief Checks whether a plugin has (a) hook manager(s) that is/are currently used by other plugins * * @param plug The unique identifier of the plugin in question */ @@ -123,7 +139,7 @@ virtual void *GetIfacePtr(); //!< Gets the interface pointer ////////////////////////////////////////////////////////////////////////// - // For hookers + // For hook managers virtual META_RES &GetCurResRef(); //!< Gets the pointer to the current meta result virtual META_RES &GetPrevResRef(); //!< Gets the pointer to the previous meta result virtual META_RES &GetStatusRef(); //!< Gets the pointer to the status variable