forked from XthemeOrg/xtheme-contrib-modules
/
os_tabletest.c
54 lines (40 loc) · 1.26 KB
/
os_tabletest.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
#include "atheme-compat.h"
DECLARE_MODULE_V1
(
"contrib/os_tabletest", false, _modinit, _moddeinit,
PACKAGE_STRING,
"Atheme Development Group <http://www.atheme.org>"
);
static void os_cmd_tabletest(sourceinfo_t *si, int parc, char *parv[]);
command_t os_tabletest = { "TABLETEST", "Table test.", AC_NONE, 0, os_cmd_tabletest, { .path = "" } };
void _modinit(module_t *m)
{
service_named_bind_command("operserv", &os_tabletest);
}
void _moddeinit(module_unload_intent_t intent)
{
service_named_unbind_command("operserv", &os_tabletest);
}
static void os_cmd_tabletest(sourceinfo_t *si, int parc, char *parv[])
{
table_t *t = table_new("Table \2test\2");
table_row_t *r = table_row_new(t);
table_cell_associate(r, "foo", "bar");
table_cell_associate(r, "F", "-");
table_cell_associate(r, "baz", "splork");
r = table_row_new(t);
table_cell_associate(r, "foo", "1");
table_cell_associate(r, "F", "+");
table_cell_associate(r, "baz", "2");
r = table_row_new(t);
table_cell_associate(r, "foo", "beagle4");
table_cell_associate(r, "F", "+");
table_cell_associate(r, "baz", "boo");
command_success_table(si, t);
object_unref(t);
}
/* 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
*/