diff options
author | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-12-03 06:07:44 +0000 |
---|---|---|
committer | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-12-03 06:07:44 +0000 |
commit | 1aaeba38f4e5f3169ad1f17bbf28ceaae0af9f8a (patch) | |
tree | 22c3896351bc7634005a52958a5c993b1afa3c75 /src/commands.c | |
parent | f18d506cad80b9ed28f02ee33f35332320f3ea04 (diff) |
BUILD : 1.7.6 (469) BUGS : N/A NOTES : 1. ultimate3 setting the wrong channel mode on botserv bots 2. helpserv.c is doxygen ready, did some code clean up 3. Services Clients (+S) now override channel modes (yeah no more deopping NeoStats), this only works on ircds where there is a clear services mode (Unreal, Viagra, Ultimeate2/3) 4. send.c is doxygen ready, did some code clean up 5. commands.c id doxygen ready, did some code clean up
git-svn-id: svn://svn.anope.org/anope/trunk@469 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@323 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/commands.c')
-rw-r--r-- | src/commands.c | 74 |
1 files changed, 66 insertions, 8 deletions
diff --git a/src/commands.c b/src/commands.c index 6d3bfb5b3..e37eb574b 100644 --- a/src/commands.c +++ b/src/commands.c @@ -18,33 +18,53 @@ /*************************************************************************/ -/* Return the Command corresponding to the given name, or NULL if no such +/** + * Return the Command corresponding to the given name, or NULL if no such * command exists. + * @param list Command struct + * @param cmd Command to look up + * @return Command Struct for the given cmd */ - Command *lookup_cmd(Command * list, char *cmd) { Command *c; for (c = list; c->name; c++) { - if (stricmp(c->name, cmd) == 0) + if (stricmp(c->name, cmd) == 0) { return c; + } } return NULL; } /*************************************************************************/ -/* Run the routine for the given command, if it exists and the user has +/** + * Run the routine for the given command, if it exists and the user has * privilege to do so; if not, print an appropriate error message. + * @param services Services Client + * @param u User Struct + * @param list Command struct + * @param cmd Command + * @return void */ - void run_cmd(char *service, User * u, Command * list, char *cmd) { Command *c = lookup_cmd(list, cmd); do_run_cmd(service, u, c, cmd); } +/*************************************************************************/ + +/** + * Run the routine for the given command, if it exists and the user has + * privilege to do so; if not, print an appropriate error message. + * @param services Services Client + * @param u User Struct + * @param Command Hash Table + * @param cmd Command + * @return void + */ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *cmd) { @@ -52,6 +72,17 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], do_run_cmd(service, u, c, cmd); } + +/*************************************************************************/ + +/** + * Run the given command + * @param services Services Client + * @param u User Struct + * @param c Command Struct + * @param cmd Command + * @return void + */ void do_run_cmd(char *service, User * u, Command * c, const char *cmd) { int retVal = 0; @@ -86,15 +117,22 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd) } } } else { - if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u)) + if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u)) { notice_lang(service, u, UNKNOWN_COMMAND_HELP, cmd, service); + } } } /*************************************************************************/ -/* Print a help message for the given command. */ - +/** + * Print a help message for the given command. + * @param services Services Client + * @param u User Struct + * @param c Command Struct + * @param cmd Command + * @return void + */ void do_help_cmd(char *service, User * u, Command * c, const char *cmd) { Command *current; @@ -158,12 +196,32 @@ void do_help_cmd(char *service, User * u, Command * c, const char *cmd) } } +/*************************************************************************/ + +/** + * Find the Help Command + * @param services Services Client + * @param u User Struct + * @param c Command Struct + * @param cmd Command + * @return void + */ void help_cmd(char *service, User * u, Command * list, char *cmd) { Command *c = lookup_cmd(list, cmd); do_help_cmd(service, u, c, cmd); } +/*************************************************************************/ + +/** + * Find the Help Command + * @param services Services Client + * @param u User Struct + * @param Command Hash Table + * @param cmd Command + * @return void + */ void mod_help_cmd(char *service, User * u, CommandHash * cmdTable[], const char *cmd) { |