Debian Codegraph @

modules/contrib/src/ircd_catserv.c

raw
1 /*
2 * Copyright (c) 2005 William Pitcock, et al.
3 * The rights to this code are as documented under doc/LICENSE.
4 *
5 * Meow!
6 */
7
8 #include "atheme-compat.h"
9
10 static service_t *catserv = NULL;
11
12 static void
13 catserv_cmd_meow(sourceinfo_t *si, int parc, char *parv[])
14 {
15 command_success_nodata(si, "Meow!");
16 }
17
18 static void
19 catserv_cmd_help(sourceinfo_t *si, int parc, char *parv[])
20 {
21 command_help(si, si->service->commands);
22 }
23
24 static command_t catserv_meow = {
25 .name = "MEOW",
26 .desc = N_("Makes the cute little kitty-cat meow!"),
27 .access = AC_NONE,
28 .maxparc = 0,
29 .cmd = &catserv_cmd_meow,
30 .help = { .path = "" },
31 };
32
33 static command_t catserv_help = {
34 .name = "HELP",
35 .desc = N_("Displays contextual help information."),
36 .access = AC_NONE,
37 .maxparc = 1,
38 .cmd = &catserv_cmd_help,
39 .help = { .path = "help" },
40 };
41
42 static void
43 mod_init(module_t *const restrict m)
44 {
45 catserv = service_add("catserv", NULL);
46
47 service_bind_command(catserv, &catserv_meow);
48 service_bind_command(catserv, &catserv_help);
49 }
50
51 static void
52 mod_deinit(const module_unload_intent_t intent)
53 {
54 service_unbind_command(catserv, &catserv_meow);
55 service_unbind_command(catserv, &catserv_help);
56
57 service_delete(catserv);
58 }
59
60 SIMPLE_DECLARE_MODULE_V1("contrib/ircd_catserv", MODULE_UNLOAD_CAPABILITY_OK)