Debian Codegraph @

modules/helpserv/services.c

raw
1 /*
2 * Copyright (c) 2005-2006 Atheme Development Group
3 * Rights to this code are documented in doc/LICENSE.
4 *
5 * This file contains functionality which implements the HelpServ SERVICES command.
6 *
7 */
8
9 #include "atheme.h"
10 #include "uplink.h"
11
12 DECLARE_MODULE_V1
13 (
14 "helpserv/services", false, _modinit, _moddeinit,
15 PACKAGE_STRING,
16 VENDOR_STRING
17 );
18
19 static void helpserv_cmd_services(sourceinfo_t *si, int parc, char *parv[]);
20
21 command_t helpserv_services = { "SERVICES", N_("List all services currently running on the network."), AC_NONE, 1, helpserv_cmd_services, { .path = "helpserv/services" } };
22
23 void _modinit(module_t *m)
24 {
25 service_named_bind_command("helpserv", &helpserv_services);
26 }
27
28 void _moddeinit(module_unload_intent_t intent)
29 {
30 service_named_unbind_command("helpserv", &helpserv_services);
31 }
32
33 static void helpserv_cmd_services(sourceinfo_t *si, int parc, char *parv[])
34 {
35 service_t *sptr;
36 mowgli_patricia_iteration_state_t state;
37
38 command_success_nodata(si, _("Services running on %s:"), me.netname);
39
40 MOWGLI_PATRICIA_FOREACH(sptr, &state, services_nick)
41 {
42 if (!sptr->botonly)
43 command_success_nodata(si, "%s", sptr->nick);
44 }
45
46 command_success_nodata(si, _("More information on each service is available by messaging it like so: /msg service help"));
47
48 return;
49 }
50 /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
51 * vim:ts=8
52 * vim:sw=8
53 * vim:noexpandtab
54 */