| 1 |
/** |
| 2 |
* version.C: Some module TODO |
| 3 |
* |
| 4 |
* Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
| 5 |
* Rights to this code are as documented in COPYING. |
| 6 |
* |
| 7 |
* |
| 8 |
* Portions of this file were derived from sources bearing the following license: |
| 9 |
* Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
| 10 |
* Copyright © 2007 Atheme Development Group |
| 11 |
* Rights to this code are as documented in doc/pod/license.pod. |
| 12 |
* |
| 13 |
* $Id: version.C,v 1.4 2007-09-16 18:54:43 pippijn Exp $ |
| 14 |
*/ |
| 15 |
|
| 16 |
#include "atheme.h" |
| 17 |
#include <ermyth/module.h> |
| 18 |
|
| 19 |
static char const rcsid[] = "$Id: version.C,v 1.4 2007-09-16 18:54:43 pippijn Exp $"; |
| 20 |
|
| 21 |
REGISTER_MODULE ("chanserv/version", false, "The Ermyth Team <http://ermyth.xinutec.org>"); |
| 22 |
|
| 23 |
static void cs_cmd_version (sourceinfo_t *si, int parc, char *parv[]); |
| 24 |
|
| 25 |
command_t const cs_version = { "VERSION", N_("Displays version information of the services."), AC_NONE, 0, cs_cmd_version }; |
| 26 |
|
| 27 |
E cmdvec cs_cmdtree; |
| 28 |
|
| 29 |
bool |
| 30 |
_modinit (module *m) |
| 31 |
{ |
| 32 |
cs_cmdtree << cs_version; |
| 33 |
|
| 34 |
return true; |
| 35 |
} |
| 36 |
|
| 37 |
void |
| 38 |
_moddeinit () |
| 39 |
{ |
| 40 |
cs_cmdtree >> cs_version; |
| 41 |
} |
| 42 |
|
| 43 |
static void |
| 44 |
cs_cmd_version (sourceinfo_t *si, int parc, char *parv[]) |
| 45 |
{ |
| 46 |
char buf[BUFSIZE]; |
| 47 |
snprintf (buf, BUFSIZE, PACKAGE_NAME " %s #%s", version, generation); |
| 48 |
command_success_string (si, buf, "%s", buf); |
| 49 |
return; |
| 50 |
} |