ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/contrib/os_tabletest.C
Revision: 1.2
Committed: Tue Aug 28 17:08:09 2007 UTC (19 years, 3 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.1: +20 -7 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# User Rev Content
1 pippijn 1.2 /*
2     * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
3     * Copyright © 2007 Atheme Development Group
4     * Rights to this code are as documented in doc/pod/license.pod.
5     *
6     * Some module TODO
7     *
8     * $Id: jsonrpc.C,v 1.4 2007-07-25 00:03:21 pippijn Exp $
9     */
10    
11 pippijn 1.1 #include "atheme.h"
12 pippijn 1.2 #include <ermyth/module.h>
13    
14     static char const rcsid[] = "$Id$";
15 pippijn 1.1
16 pippijn 1.2 REGISTER_MODULE ("operserv/tabletest", false, "The Ermyth Team <http://ermyth.schmorp.de>");
17 pippijn 1.1
18     static void os_cmd_tabletest (sourceinfo_t *si, int parc, char *parv[]);
19    
20 pippijn 1.2 command_t const os_tabletest = { "TABLETEST", "Table test.", AC_NONE, 0, os_cmd_tabletest };
21 pippijn 1.1
22 pippijn 1.2 E cmdvec os_cmdtree;
23 pippijn 1.1
24 pippijn 1.2 bool
25     _modinit (module *m)
26 pippijn 1.1 {
27 pippijn 1.2 os_cmdtree << os_tabletest;
28 pippijn 1.1
29 pippijn 1.2 return true;
30 pippijn 1.1 }
31    
32     void
33     _moddeinit ()
34     {
35     os_cmdtree >> os_tabletest;
36     }
37    
38     static void
39     os_cmd_tabletest (sourceinfo_t *si, int parc, char *parv[])
40     {
41     table_t *t = table_new ("Table \2test\2");
42     table_row_t *r = table_row_new (t);
43    
44     table_cell_associate (r, "foo", "bar");
45     table_cell_associate (r, "F", "-");
46     table_cell_associate (r, "baz", "splork");
47    
48     r = table_row_new (t);
49    
50     table_cell_associate (r, "foo", "1");
51     table_cell_associate (r, "F", "+");
52     table_cell_associate (r, "baz", "2");
53    
54     r = table_row_new (t);
55    
56     table_cell_associate (r, "foo", "beagle4");
57     table_cell_associate (r, "F", "+");
58     table_cell_associate (r, "baz", "boo");
59    
60     command_success_table (si, t);
61    
62     object_unref (t);
63     }
64    
65     /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
66     * vim:ts=8
67     * vim:sw=8
68     * vim:noexpandtab
69     */