ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/operserv/modlist.C
Revision: 1.3
Committed: Sat Jul 21 13:23:21 2007 UTC (19 years, 3 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.2: +2 -2 lines
Log Message:
- added rcsid to some files
- more documentation tweaks
- made most protocol commands local to phandler.C
- added ircd metadata (inspircd only for now)
- added inspircd swhois support

File Contents

# User Rev Content
1 pippijn 1.1 /*
2     * Copyright © 2005-2006 William Pitcock, et al.
3 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
4 pippijn 1.1 *
5     * Module listing.
6     *
7 pippijn 1.3 * $Id: modlist.C,v 1.2 2007-07-21 01:29:09 pippijn Exp $
8 pippijn 1.1 */
9    
10     #include "atheme.h"
11    
12 pippijn 1.3 static char const rcsid[] = "$Id$";
13 pippijn 1.1
14     struct os_modlist_listeners : callback::has_listeners
15     {
16     };
17    
18     os_modlist_listeners listeners;
19    
20     DECLARE_MODULE_V1 ("operserv/modlist", false, _modinit, _moddeinit, rcsid, "The Ermyth Team <http://ermyth.schmorp.de>");
21    
22     static void os_cmd_modlist (sourceinfo_t *si, int parc, char *parv[]);
23    
24     command_t os_modlist = { "MODLIST", N_("Lists loaded modules."), PRIV_SERVER_AUSPEX, 0,
25     os_cmd_modlist
26     };
27    
28     cmdvec *os_cmdtree;
29     helpvec *os_helptree;
30     extern list_t modules;
31    
32     void
33     _modinit (module_t *m)
34     {
35     MODULE_USE_SYMBOL_T (os_cmdtree, cmdvec, "operserv/main", "os_cmdtree");
36     MODULE_USE_SYMBOL_T (os_helptree, helpvec, "operserv/main", "os_helptree");
37    
38     os_cmdtree << os_modlist;
39     help_addentry (os_helptree, "MODLIST", "help/oservice/modlist", NULL);
40     }
41    
42     void
43     _moddeinit ()
44     {
45     os_cmdtree >> os_modlist;
46     help_delentry (os_helptree, "MODLIST");
47     }
48    
49     static void
50     os_cmd_modlist (sourceinfo_t *si, int parc, char *parv[])
51     {
52     node_t *n;
53     unsigned int i = 0;
54     command_success_nodata (si, _("Loaded modules:"));
55    
56     LIST_FOREACH (n, modules.head)
57     {
58     module_t *m = static_cast < module_t *>(n->data);
59    
60     command_success_nodata (si, _("%2d: %-20s [loaded at 0x%lx]"), ++i, m->header->name, m->address);
61     }
62    
63     command_success_nodata (si, _("\2%d\2 modules loaded."), i);
64     logcommand (si, CMDLOG_GET, "MODLIST");
65     }
66    
67     /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
68     * vim:ts=8
69     * vim:sw=8
70     * vim:noexpandtab
71     */