summaryrefslogtreecommitdiff
path: root/src/common/HPMi.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-09 17:06:32 -0200
committershennetsind <ind@henn.et>2013-11-09 17:06:45 -0200
commit1be53db78a321436d0ebe6093595b769f10874b6 (patch)
treebb76bc0cfc48402e8f0b60b4abf667d73be3d7e1 /src/common/HPMi.h
parent8ed38f98894fb04b4403b44dc0f36281cfd36326 (diff)
downloadhercules-1be53db78a321436d0ebe6093595b769f10874b6.tar.gz
hercules-1be53db78a321436d0ebe6093595b769f10874b6.tar.bz2
hercules-1be53db78a321436d0ebe6093595b769f10874b6.tar.xz
hercules-1be53db78a321436d0ebe6093595b769f10874b6.zip
HPM Support for plugin-implemented "--args" (options)
As a necessary measure for the upcoming bot that will keep .sql files in sync with their .txt counterparts. Special Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/HPMi.h')
-rw-r--r--src/common/HPMi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 9c2a6184e..f071bf09e 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -56,6 +56,7 @@ enum hp_event_types {
HPET_FINAL,/* server is shutting down */
HPET_READY,/* server is ready (online) */
HPET_POST_FINAL,/* server is done shutting down */
+ HPET_PRE_INIT,/* server is about to start (used to e.g. add custom "--args" handling) */
HPET_MAX,
};
@@ -83,6 +84,8 @@ enum HPluginHookType {
#define hookStop() HPMi->HookStop(__func__,HPMi->pid)
#define hookStopped() HPMi->HookStopped()
+#define addArg(name,param,func,help) HPMi->addArg(HPMi->pid,name,param,func,help)
+
/* Hercules Plugin Mananger Include Interface */
HPExport struct HPMi_interface {
/* */
@@ -106,6 +109,8 @@ HPExport struct HPMi_interface {
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,void (*func) (char *param),void (*help) (void));
} HPMi_s;
#ifndef _HPM_H_
HPExport struct HPMi_interface *HPMi;