ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/memoserv/help.C
Revision: 1.4
Committed: Tue Aug 28 17:08:09 2007 UTC (19 years, 2 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.3: +20 -24 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# User Rev Content
1 pippijn 1.1 /*
2 pippijn 1.4 * Copyright © 2005 Atheme Development Group
3 pippijn 1.2 * Rights to this code are documented in doc/pod/license.pod.
4 pippijn 1.1 *
5     * This file contains routines to handle the MemoServ HELP command.
6     *
7 pippijn 1.4 * $Id: help.C,v 1.3 2007-07-21 13:23:20 pippijn Exp $
8 pippijn 1.1 */
9    
10     #include "atheme.h"
11 pippijn 1.4 #include <ermyth/module.h>
12 pippijn 1.1
13 pippijn 1.4 static char const rcsid[] = "$Id: help.C,v 1.3 2007-07-21 13:23:20 pippijn Exp $";
14 pippijn 1.1
15 pippijn 1.4 REGISTER_MODULE ("memoserv/help", false, "The Ermyth Team <http://ermyth.schmorp.de>");
16 pippijn 1.1
17 pippijn 1.4 E cmdvec ms_cmdtree;
18     E helpvec ms_helptree;
19 pippijn 1.1
20     static void ms_cmd_help (sourceinfo_t *si, int parc, char *parv[]);
21    
22 pippijn 1.4 command_t const ms_help = { "HELP", N_(N_("Displays contextual help information.")), AC_NONE, 2, ms_cmd_help };
23 pippijn 1.1
24 pippijn 1.4 bool
25     _modinit (module *m)
26 pippijn 1.1 {
27     ms_cmdtree << ms_help;
28     help_addentry (ms_helptree, "HELP", "help/help", NULL);
29 pippijn 1.4
30     return true;
31 pippijn 1.1 }
32    
33     void
34     _moddeinit ()
35     {
36     ms_cmdtree >> ms_help;
37     help_delentry (ms_helptree, "HELP");
38     }
39    
40     /* HELP <command> [params] */
41     void
42     ms_cmd_help (sourceinfo_t *si, int parc, char *parv[])
43     {
44     char *command = parv[0];
45    
46     if (!command)
47     {
48     command_success_nodata (si, _("***** \2%s Help\2 *****"), memosvs.nick);
49     command_success_nodata (si, _("\2%s\2 allows users to send memos to registered users."), memosvs.nick);
50     command_success_nodata (si, " ");
51     command_success_nodata (si, _("For more information on a command, type:"));
52     command_success_nodata (si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", memosvs.disp);
53     command_success_nodata (si, " ");
54    
55     command_help (si, ms_cmdtree);
56    
57     command_success_nodata (si, _("***** \2End of Help\2 *****"));
58     return;
59     }
60    
61 pippijn 1.4 if (!strcasecmp ("COMMANDS", command))
62     {
63     command_success_nodata (si, _("***** \2%s Help\2 *****"), nicksvs.nick);
64     command_help (si, ms_cmdtree);
65     command_success_nodata (si, _("***** \2End of Help\2 *****"));
66     return;
67     }
68    
69 pippijn 1.1 /* take the command through the hash table */
70     help_display (si, command, ms_helptree);
71     }