| 1 |
pippijn |
1.1 |
#include "atheme.h" |
| 2 |
|
|
|
| 3 |
|
|
DECLARE_MODULE_V1 ("operserv/tabletest", false, _modinit, _moddeinit, "$Id: os_tabletest.c 7997 2007-03-27 22:04:33Z jilles $", "Atheme Development Group <http://www.atheme.org>"); |
| 4 |
|
|
|
| 5 |
|
|
static void os_cmd_tabletest (sourceinfo_t *si, int parc, char *parv[]); |
| 6 |
|
|
|
| 7 |
|
|
command_t os_tabletest = { "TABLETEST", "Table test.", AC_NONE, 0, os_cmd_tabletest }; |
| 8 |
|
|
|
| 9 |
|
|
cmdvec *os_cmdtree; |
| 10 |
|
|
|
| 11 |
|
|
void |
| 12 |
|
|
_modinit (module_t *m) |
| 13 |
|
|
{ |
| 14 |
|
|
MODULE_USE_SYMBOL_T (os_cmdtree, cmdvec, "operserv/main", "os_cmdtree"); |
| 15 |
|
|
|
| 16 |
|
|
os_cmdtree << os_tabletest; |
| 17 |
|
|
} |
| 18 |
|
|
|
| 19 |
|
|
void |
| 20 |
|
|
_moddeinit () |
| 21 |
|
|
{ |
| 22 |
|
|
os_cmdtree >> os_tabletest; |
| 23 |
|
|
} |
| 24 |
|
|
|
| 25 |
|
|
static void |
| 26 |
|
|
os_cmd_tabletest (sourceinfo_t *si, int parc, char *parv[]) |
| 27 |
|
|
{ |
| 28 |
|
|
table_t *t = table_new ("Table \2test\2"); |
| 29 |
|
|
table_row_t *r = table_row_new (t); |
| 30 |
|
|
|
| 31 |
|
|
table_cell_associate (r, "foo", "bar"); |
| 32 |
|
|
table_cell_associate (r, "F", "-"); |
| 33 |
|
|
table_cell_associate (r, "baz", "splork"); |
| 34 |
|
|
|
| 35 |
|
|
r = table_row_new (t); |
| 36 |
|
|
|
| 37 |
|
|
table_cell_associate (r, "foo", "1"); |
| 38 |
|
|
table_cell_associate (r, "F", "+"); |
| 39 |
|
|
table_cell_associate (r, "baz", "2"); |
| 40 |
|
|
|
| 41 |
|
|
r = table_row_new (t); |
| 42 |
|
|
|
| 43 |
|
|
table_cell_associate (r, "foo", "beagle4"); |
| 44 |
|
|
table_cell_associate (r, "F", "+"); |
| 45 |
|
|
table_cell_associate (r, "baz", "boo"); |
| 46 |
|
|
|
| 47 |
|
|
command_success_table (si, t); |
| 48 |
|
|
|
| 49 |
|
|
object_unref (t); |
| 50 |
|
|
} |
| 51 |
|
|
|
| 52 |
|
|
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
| 53 |
|
|
* vim:ts=8 |
| 54 |
|
|
* vim:sw=8 |
| 55 |
|
|
* vim:noexpandtab |
| 56 |
|
|
*/ |