1 #include "atheme.h"
2 #include "serno.h"
3
4 DECLARE_MODULE_V1
5 (
6 "chanserv/version", false, _modinit, _moddeinit,
7 PACKAGE_STRING,
8 VENDOR_STRING
9 );
10
11 static void cs_cmd_version(sourceinfo_t *si, int parc, char *parv[]);
12
13 command_t cs_version = { "VERSION", N_("Displays version information of the services."),
14 AC_NONE, 0, cs_cmd_version, { .path = "" } };
15
_modinit(module_t * m)16 void _modinit(module_t *m)
17 {
18 service_named_bind_command("chanserv", &cs_version);
19 }
20
_moddeinit(module_unload_intent_t intent)21 void _moddeinit(module_unload_intent_t intent)
22 {
23 service_named_unbind_command("chanserv", &cs_version);
24 }
25
cs_cmd_version(sourceinfo_t * si,int parc,char * parv[])26 static void cs_cmd_version(sourceinfo_t *si, int parc, char *parv[])
27 {
28 char buf[BUFSIZE];
29 snprintf(buf, BUFSIZE, "%s [%s]", PACKAGE_STRING, SERNO);
30 command_success_string(si, buf, "%s", buf);
31 return;
32 }
33
34 /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
35 * vim:ts=8
36 * vim:sw=8
37 * vim:noexpandtab
38 */
39