diff options
| author | Adam <Adam@drink-coca-cola.info> | 2010-06-03 23:09:22 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-06-18 21:04:09 -0400 |
| commit | e6447fa2c40270d2e2435229127dd970194b47d9 (patch) | |
| tree | 65778fc16c1789517595b2b4cbfcb2c9330b022e /include | |
| parent | 6cd88494662c5c4af2da891926dcc82367596cb9 (diff) | |
Added in a subcommand system and switched ns_set and ns_saset to use it
Diffstat (limited to 'include')
| -rw-r--r-- | include/commands.h | 15 | ||||
| -rw-r--r-- | include/hashcomp.h | 3 | ||||
| -rw-r--r-- | include/services.h | 2 |
3 files changed, 16 insertions, 4 deletions
diff --git a/include/commands.h b/include/commands.h index 9e597204e..327d65736 100644 --- a/include/commands.h +++ b/include/commands.h @@ -23,7 +23,7 @@ class Command; typedef std::map<ci::string, Command *> CommandMap; /** The return value from commands. - * */ + */ enum CommandReturn { MOD_CONT, @@ -32,7 +32,8 @@ enum CommandReturn extern CoreExport Command *FindCommand(BotInfo *bi, const ci::string &cmd); extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, const ci::string &cmd); -extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const ci::string &cmd); +extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const std::string &message); +extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const ci::string &command, const ci::string &message); enum CommandFlag { @@ -101,6 +102,16 @@ class CoreExport Command : public Flags<CommandFlag> * @param reststr The permission required to successfully execute this command */ void SetPermission(const std::string &reststr); + + /** Add a subcommand to this command + * @param c The command + */ + virtual bool AddSubcommand(Command *c); + + /** Delete a subcommand from this command + * @param cname The subcommand name + */ + virtual bool DelSubcommand(const ci::string &cname); }; #endif diff --git a/include/hashcomp.h b/include/hashcomp.h index a0d456b40..6d4530dc6 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -16,7 +16,8 @@ #include <string> #ifndef _WIN32 - #ifdef HASHMAP_DEPRECATED /* If gcc ver > 4.3 */ +// #ifdef HASHMAP_DEPRECATED /* If gcc ver > 4.3 */ + #if 1 /* GCC4.3+ has deprecated hash_map and uses tr1. But of course, uses a different include to MSVC. */ #include <tr1/unordered_map> #define unordered_map_namespace std::tr1 diff --git a/include/services.h b/include/services.h index 9a7356bd2..4994984e0 100644 --- a/include/services.h +++ b/include/services.h @@ -52,7 +52,7 @@ #include <sys/stat.h> /* for umask() on some systems */ #include <sys/types.h> - +#include <assert.h> #include <fcntl.h> #ifndef _WIN32 |
