| 1 |
#include "atheme-compat.h" |
| 2 |
|
| 3 |
static void |
| 4 |
os_cmd_tabletest(sourceinfo_t *si, int parc, char *parv[]) |
| 5 |
{ |
| 6 |
table_t *t = table_new("Table \2test\2"); |
| 7 |
table_row_t *r = table_row_new(t); |
| 8 |
|
| 9 |
table_cell_associate(r, "foo", "bar"); |
| 10 |
table_cell_associate(r, "F", "-"); |
| 11 |
table_cell_associate(r, "baz", "splork"); |
| 12 |
|
| 13 |
r = table_row_new(t); |
| 14 |
|
| 15 |
table_cell_associate(r, "foo", "1"); |
| 16 |
table_cell_associate(r, "F", "+"); |
| 17 |
table_cell_associate(r, "baz", "2"); |
| 18 |
|
| 19 |
r = table_row_new(t); |
| 20 |
|
| 21 |
table_cell_associate(r, "foo", "beagle4"); |
| 22 |
table_cell_associate(r, "F", "+"); |
| 23 |
table_cell_associate(r, "baz", "boo"); |
| 24 |
|
| 25 |
command_success_table(si, t); |
| 26 |
|
| 27 |
atheme_object_unref(t); |
| 28 |
} |
| 29 |
|
| 30 |
static command_t os_tabletest = { |
| 31 |
.name = "TABLETEST", |
| 32 |
.desc = N_("Table test."), |
| 33 |
.access = AC_NONE, |
| 34 |
.maxparc = 0, |
| 35 |
.cmd = &os_cmd_tabletest, |
| 36 |
.help = { .path = "" }, |
| 37 |
}; |
| 38 |
|
| 39 |
static void |
| 40 |
mod_init(module_t *const restrict m) |
| 41 |
{ |
| 42 |
service_named_bind_command("operserv", &os_tabletest); |
| 43 |
} |
| 44 |
|
| 45 |
static void |
| 46 |
mod_deinit(const module_unload_intent_t intent) |
| 47 |
{ |
| 48 |
service_named_unbind_command("operserv", &os_tabletest); |
| 49 |
} |
| 50 |
|
| 51 |
SIMPLE_DECLARE_MODULE_V1("contrib/os_tabletest", MODULE_UNLOAD_CAPABILITY_OK) |