1 |
/** |
2 |
* os_tabletest.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: os_tabletest.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: os_tabletest.C,v 1.4 2007-09-16 18:54:43 pippijn Exp $"; |
20 |
|
21 |
REGISTER_MODULE ("operserv/tabletest", false, "The Ermyth Team <http://ermyth.xinutec.org>"); |
22 |
|
23 |
static void os_cmd_tabletest (sourceinfo_t *si, int parc, char *parv[]); |
24 |
|
25 |
command_t const os_tabletest = { "TABLETEST", "Table test.", AC_NONE, 0, os_cmd_tabletest }; |
26 |
|
27 |
E cmdvec os_cmdtree; |
28 |
|
29 |
bool |
30 |
_modinit (module *m) |
31 |
{ |
32 |
os_cmdtree << os_tabletest; |
33 |
|
34 |
return true; |
35 |
} |
36 |
|
37 |
void |
38 |
_moddeinit () |
39 |
{ |
40 |
os_cmdtree >> os_tabletest; |
41 |
} |
42 |
|
43 |
static void |
44 |
os_cmd_tabletest (sourceinfo_t *si, int parc, char *parv[]) |
45 |
{ |
46 |
table_t *t = table_new ("Table \2test\2"); |
47 |
table_row_t *r = table_row_new (t); |
48 |
|
49 |
table_cell_associate (r, "foo", "bar"); |
50 |
table_cell_associate (r, "F", "-"); |
51 |
table_cell_associate (r, "baz", "splork"); |
52 |
|
53 |
r = table_row_new (t); |
54 |
|
55 |
table_cell_associate (r, "foo", "1"); |
56 |
table_cell_associate (r, "F", "+"); |
57 |
table_cell_associate (r, "baz", "2"); |
58 |
|
59 |
r = table_row_new (t); |
60 |
|
61 |
table_cell_associate (r, "foo", "beagle4"); |
62 |
table_cell_associate (r, "F", "+"); |
63 |
table_cell_associate (r, "baz", "boo"); |
64 |
|
65 |
command_success_table (si, t); |
66 |
|
67 |
object_unref (t); |
68 |
} |