summaryrefslogtreecommitdiff
path: root/src/common/HPM.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/HPM.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/HPM.h')
-rw-r--r--src/common/HPM.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common/HPM.h b/src/common/HPM.h
index 395555948..e685b3068 100644
--- a/src/common/HPM.h
+++ b/src/common/HPM.h
@@ -74,6 +74,14 @@ struct HPMFileNameCache {
char *name;
};
+struct HPMArgData {
+ unsigned int pluginID;
+ char *name;/* e.g. "--my-arg","-v","--whatever" */
+ void (*help) (void);/* to display when --help is used */
+ void (*func) (char *param);/* NULL when no param is available */
+ bool has_param;/* because of the weird "--arg<space>param" instead of the "--arg=param" */
+};
+
/* Hercules Plugin Manager Interface */
struct HPM_interface {
/* vars */
@@ -93,6 +101,8 @@ struct HPM_interface {
/* plugin file ptr caching */
struct HPMFileNameCache *fnames;
unsigned int fnamec;
+ /* --command-line */
+ DBMap *arg_db;
/* funcs */
void (*init) (void);
void (*final) (void);
@@ -112,6 +122,9 @@ struct HPM_interface {
unsigned char (*parse_packets) (int fd, enum HPluginPacketHookingPoints point);
void (*load_sub) (struct hplugin *plugin);
bool (*addhook_sub) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID);
+ bool (*parse_arg) (const char *arg, int* index, char *argv[], bool param);
+ void (*arg_help) (void);
+ int (*arg_db_clear_sub) (DBKey key, DBData *data, va_list args);
} HPM_s;
struct HPM_interface *HPM;