Fixed tags for mmsource-central
mmsource-1.00-RC1 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:41:34 2006 UTC
mmsource-1.00-RC2 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:35:20 2006 UTC
mmsource-1.00 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:30:40 2006 UTC
mmsource-1.1 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:25:09 2006 UTC
mmsource-1.1.1 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:22:23 2006 UTC
mmsource-1.1.2 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:14:00 2006 UTC
mmsource-1.2 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:10:47 2006 UTC
mmsource-1.2.1 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:01:35 2006 UTC
mmsource-1.2.2 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 07:57:26 2006 UTC
mmsource-1.2.3 - Not tagged originally, but eventually done by David Anderson <
[email protected]> on Wed Jul 12 17:33:59 2006 UTC
mmsource-1.3 - Originally tagged by Scott Ehlert <
[email protected]> on Thu Aug 17 03:19:55 2006 UTC
mmsource-1.3a - Originally tagged by Scott Ehlert <
[email protected]> on Wed Sep 6 07:17:37 2006 UTC
mmsource-1.3d - Originally tagged by Scott Ehlert <
[email protected]> on Fri Feb 2 05:30:56 2007 UTC
mmsource-1.4 - Originally tagged by Scott Ehlert <
[email protected]> on Sat Apr 7 05:00:28 2007 UTC
mmsource-1.6.0 - Originally tagged by David Anderson <
[email protected]> on Mon Feb 18 23:31:29 2008 UTC
mmsource-1.6.1 - Originally tagged by David Anderson <
[email protected]> on Mon Feb 25 17:15:44 2008 UTC
mmsource-1.6.2 - Originally tagged by David Anderson <
[email protected]> on Sat Jul 26 05:04:35 2008 UTC
1 /* ======== SourceHook ========
2 * Copyright (C) 2004-2008 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): Pavol "PM OnoTo" Marko
8 * ============================
11 #ifndef __SOURCEHOOK_IMPL_CHOOKMANINFO_H__
12 #define __SOURCEHOOK_IMPL_CHOOKMANINFO_H__
15 #include "sourcehook_impl_cproto.h"
23 class CHookManager : public IHookManagerInfo
27 HookManagerPubFunc m_PubFunc;
33 void *m_HookfuncVfnptr;
35 List<CVfnPtr*> m_VfnPtrs;
41 HookManagerPubFunc m_PubFunc;
42 Descriptor(Plugin ownerPlugin, HookManagerPubFunc pubFunc)
43 : m_OwnerPlugin(ownerPlugin), m_PubFunc(pubFunc)
49 inline CHookManager(Plugin ownerPlugin, HookManagerPubFunc pubFunc);
51 inline bool operator==(const Descriptor &other) const;
52 inline bool operator==(const CHookManager &other) const;
54 inline operator bool() const;
55 inline Plugin GetOwnerPlugin() const;
56 inline int GetVtblOffs() const;
57 inline int GetVtblIdx() const;
58 inline const CProto &GetProto() const;
59 inline int GetVersion() const;
60 inline void *GetHookFunc() const;
61 inline HookManagerPubFunc GetPubFunc() const;
63 inline void Register();
64 inline void Unregister();
66 inline void IncrRef(CVfnPtr *pVfnPtr);
67 inline void DecrRef(CVfnPtr *pVfnPtr);
69 List<CVfnPtr*> &GetVfnPtrList()
74 // *** IHookManagerInfo interface ***
75 void SetInfo(int hookman_version, int vtbloffs, int vtblidx,
76 ProtoInfo *proto, void *hookfunc_vfnptr);
79 class CHookManList : public List<CHookManager>
82 inline CHookManager *GetHookMan(Plugin plug, HookManagerPubFunc pubFunc);
83 inline CHookManager *GetHookMan(CHookManager &hm);
86 // *** Implementation ***
87 inline CHookManager::CHookManager(Plugin ownerPlugin, HookManagerPubFunc pubFunc)
88 : m_OwnerPlugin(ownerPlugin), m_PubFunc(pubFunc), m_Version(-1)
91 // -> Should call SetInfo and set all the other variables!
92 if (m_PubFunc(false, this) != 0)
99 inline CHookManager::operator bool() const
101 return m_Version != -1;
104 inline bool CHookManager::operator==(const Descriptor &other) const
106 return m_OwnerPlugin == other.m_OwnerPlugin
107 && m_PubFunc == other.m_PubFunc;
110 inline bool CHookManager::operator==(const CHookManager &other) const
112 return m_OwnerPlugin == other.m_OwnerPlugin
113 && m_PubFunc == other.m_PubFunc;
116 inline Plugin CHookManager::GetOwnerPlugin() const
118 return m_OwnerPlugin;
121 inline int CHookManager::GetVtblOffs() const
126 inline int CHookManager::GetVtblIdx() const
131 inline const CProto &CHookManager::GetProto() const
136 inline int CHookManager::GetVersion() const
141 inline void *CHookManager::GetHookFunc() const
143 return *reinterpret_cast<void**>(m_HookfuncVfnptr);
146 inline HookManagerPubFunc CHookManager::GetPubFunc() const
151 inline void CHookManager::Register()
153 m_PubFunc(true, this);
156 inline void CHookManager::Unregister()
158 m_PubFunc(true, NULL);
161 inline void CHookManager::IncrRef(CVfnPtr *pVfnPtr)
163 m_VfnPtrs.push_back(pVfnPtr);
164 if (m_VfnPtrs.size() == 1)
168 inline void CHookManager::DecrRef(CVfnPtr *pVfnPtr)
170 m_VfnPtrs.remove(pVfnPtr);
171 if (m_VfnPtrs.empty())
175 inline CHookManager *CHookManList::GetHookMan(Plugin plug, HookManagerPubFunc pubFunc)
177 CHookManager hm(plug, pubFunc);
178 return GetHookMan(hm);
181 inline CHookManager *CHookManList::GetHookMan(CHookManager &hm)
183 iterator iter = find(hm);