Anope IRC Services  Version 1.8
he_help.c
Go to the documentation of this file.
1 /* HelpServ core functions
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  *
11  *
12  */
13 /*************************************************************************/
14 
15 #include "module.h"
16 
17 static int do_help(User * u);
18 
25 int AnopeInit(int argc, char **argv)
26 {
27  Command *c;
28 
29  moduleAddAuthor("Anope");
30  moduleAddVersion(VERSION_STRING);
32 
33  c = createCommand("HELP", do_help, NULL, -1, -1, -1, -1, -1);
35 
36  return MOD_CONT;
37 }
38 
42 void AnopeFini(void)
43 {
44 
45 }
46 
47 
48 
57 static int do_help(User * u)
58 {
59  char *cmd = strtok(NULL, "");
60 
61  if (!cmd) {
63  s_MemoServ);
64  if (s_BotServ) {
65  notice_help(s_HelpServ, u, HELP_HELP_BOT, s_BotServ);
66  }
67  if (s_HostServ) {
68  notice_help(s_HelpServ, u, HELP_HELP_HOST, s_HostServ);
69  }
70  moduleDisplayHelp(7, u);
71  } else {
73  }
74  return MOD_CONT;
75 }
E char * s_BotServ
Definition: extern.h:287
MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[], const char *cmd)
Definition: commands.c:266
MDE void moduleAddAuthor(const char *author)
Definition: modules.c:1772
MDE void moduleSetType(MODType type)
Definition: modules.c:818
E char * s_MemoServ
Definition: extern.h:286
E char * s_HelpServ
Definition: extern.h:288
MDE void moduleAddVersion(const char *version)
Definition: modules.c:1760
MDE void moduleDisplayHelp(int service, User *u)
Definition: modules.c:2162
Command * c
Definition: ns_recover.c:17
E void notice_help(char *source, User *dest, int message,...)
Definition: send.c:220
#define MOD_CONT
Definition: modules.h:54
int AnopeInit(int argc, char **argv)
Definition: he_help.c:25
#define HELPSERV
Definition: modules.h:61
static int do_help(User *u)
Definition: he_help.c:57
E char * s_HostServ
Definition: extern.h:303
Definition: modules.h:99
MDE Command * createCommand(const char *name, int(*func)(User *u), int(*has_priv)(User *u), int help_all, int help_reg, int help_oper, int help_admin, int help_root)
Definition: modules.c:987
void AnopeFini(void)
Definition: he_help.c:42
E char * s_ChanServ
Definition: extern.h:285
E char * s_NickServ
Definition: extern.h:284
MDE int moduleAddCommand(CommandHash *cmdTable[], Command *c, int pos)
Definition: modules.c:1082
#define MOD_UNIQUE
Definition: module.h:11