/** * modlist.C: Module listing. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2005-2006 William Pitcock, et al. * Rights to this code are as documented in doc/pod/license.pod. * * $Id: modlist.C,v 1.7 2007/09/22 14:27:28 pippijn Exp $ */ #include #include "atheme.h" #include static char const rcsid[] = "$Id: modlist.C,v 1.7 2007/09/22 14:27:28 pippijn Exp $"; REGISTER_MODULE ("operserv/modlist", false, "The Ermyth Team "); static void os_cmd_modlist (sourceinfo_t *si, int parc, char *parv[]); command_t const os_modlist = { "MODLIST", N_("Lists loaded modules."), PRIV_SERVER_AUSPEX, 0, os_cmd_modlist }; E cmdvec os_cmdtree; E helpvec os_helptree; bool _modinit (module *m) { os_cmdtree << os_modlist; help_addentry (os_helptree, "MODLIST", "help/operserv/modlist", NULL); return true; } void _moddeinit () { os_cmdtree >> os_modlist; help_delentry (os_helptree, "MODLIST"); } static void os_cmd_modlist (sourceinfo_t *si, int parc, char *parv[]) { unsigned i = 0; command_success_nodata (si, _("Loaded modules:")); foreach (module const * const m, modules::list ()) if (m->enabled) command_success_nodata (si, _("%2d: %-20s"), ++i, m->name); command_success_nodata (si, _("\2%d\2 modules loaded."), i); logcommand (si, CMDLOG_GET, "MODLIST"); }