forked from atheme/atheme-contrib-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathircd_catserv.c
58 lines (46 loc) · 1.4 KB
/
ircd_catserv.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (c) 2005 William Pitcock, et al.
* The rights to this code are as documented under doc/LICENSE.
*
* Meow!
*
*/
#include "atheme-compat.h"
DECLARE_MODULE_V1
(
"contrib/ircd_catserv", false, _modinit, _moddeinit,
PACKAGE_STRING,
"Atheme Development Group <http://www.atheme.org>"
);
service_t *catserv;
static void catserv_cmd_meow(sourceinfo_t *si, int parc, char *parv[]);
static void catserv_cmd_help(sourceinfo_t *si, int parc, char *parv[]);
command_t catserv_meow = { "MEOW", "Makes the cute little kitty-cat meow!",
AC_NONE, 0, catserv_cmd_meow, { .path = "" } };
command_t catserv_help = { "HELP", "Displays contextual help information.",
AC_NONE, 1, catserv_cmd_help, { .path = "help" } };
void _modinit(module_t *m)
{
catserv = service_add("catserv", NULL);
service_bind_command(catserv, &catserv_meow);
service_bind_command(catserv, &catserv_help);
}
void _moddeinit(module_unload_intent_t intent)
{
service_unbind_command(catserv, &catserv_meow);
service_unbind_command(catserv, &catserv_help);
service_delete(catserv);
}
static void catserv_cmd_meow(sourceinfo_t *si, int parc, char *parv[])
{
command_success_nodata(si, "Meow!");
}
static void catserv_cmd_help(sourceinfo_t *si, int parc, char *parv[])
{
command_help(si, si->service->commands);
}
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
* vim:ts=8
* vim:sw=8
* vim:noexpandtab
*/