diff options
author | Haru <haru@dotalux.com> | 2016-02-28 02:12:48 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-04-30 15:57:45 +0200 |
commit | 1ec93281b66061f7f7cff509450299bdcbf813b4 (patch) | |
tree | 737a9b2ea7cf5bc1e64f521d3987ea2997b688f5 /src/common/HPMi.h | |
parent | 1a2a4f1477ebddcaefd132c141f7bbf64b23f016 (diff) | |
download | hercules-1ec93281b66061f7f7cff509450299bdcbf813b4.tar.gz hercules-1ec93281b66061f7f7cff509450299bdcbf813b4.tar.bz2 hercules-1ec93281b66061f7f7cff509450299bdcbf813b4.tar.xz hercules-1ec93281b66061f7f7cff509450299bdcbf813b4.zip |
Moved HPMHooking-related definitions to plugins/HPMHooking.h
- Plugins that want to make use of the HPMHooking must now include
"plugins/HPMHooking.h".
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/HPMi.h')
-rw-r--r-- | src/common/HPMi.h | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/common/HPMi.h b/src/common/HPMi.h index 72640b382..e16eb1d75 100644 --- a/src/common/HPMi.h +++ b/src/common/HPMi.h @@ -25,6 +25,7 @@ #include "common/core.h" #include "common/showmsg.h" +struct HPMHooking_interface; struct Sql; // common/sql.h struct script_state; struct AtCommandInfo; @@ -32,7 +33,7 @@ struct socket_data; struct map_session_data; struct hplugin_data_store; -#define HPM_VERSION "1.1" +#define HPM_VERSION "1.2" #define HPM_ADDCONF_LENGTH 40 struct hplugin_info { @@ -71,11 +72,6 @@ enum HPluginPacketHookingPoints { hpPHP_MAX, }; -enum HPluginHookType { - HOOK_TYPE_PRE, - HOOK_TYPE_POST, -}; - /** * Data types for plugin custom data. */ @@ -107,13 +103,6 @@ enum HPluginConfType { HPCT_MAX, }; -#define addHookPre(tname,hook) (HPMi->AddHook(HOOK_TYPE_PRE,(tname),(hook),HPMi->pid)) -#define addHookPost(tname,hook) (HPMi->AddHook(HOOK_TYPE_POST,(tname),(hook),HPMi->pid)) -/* need better names ;/ */ -/* will not run the original function after pre-hook processing is complete (other hooks will run) */ -#define hookStop() (HPMi->HookStop(__func__,HPMi->pid)) -#define hookStopped() (HPMi->HookStopped()) - #define addArg(name, param,func,help) (HPMi->addArg(HPMi->pid,(name),(param),(cmdline_arg_ ## func),(help))) /* HPData handy redirects */ /* session[] */ @@ -231,10 +220,6 @@ struct HPMi_interface { void (*removeFromHPData) (enum HPluginDataTypes type, uint32 pluginID, struct hplugin_data_store *store, uint32 classid); /* packet */ bool (*addPacket) (unsigned short cmd, unsigned short length, void (*receive)(int fd), unsigned int point, unsigned int pluginID); - /* Hooking */ - bool (*AddHook) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID); - void (*HookStop) (const char *func, unsigned int pID); - bool (*HookStopped) (void); /* program --arg/-a */ bool (*addArg) (unsigned int pluginID, char *name, bool has_param, CmdlineExecFunc func, const char *help); /* battle-config recv param */ @@ -243,6 +228,9 @@ struct HPMi_interface { void (*addPCGPermission) (unsigned int pluginID, char *name, unsigned int *mask); struct Sql *sql_handle; + + /* Hooking */ + struct HPMHooking_interface *hooking; }; #ifdef HERCULES_CORE #define HPM_SYMBOL(n, s) (HPM->share((s), (n)), true) |