ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/table.h
Revision: 1.1
Committed: Thu Jul 19 08:24:51 2007 UTC (16 years, 10 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Log Message:
initial import. the most important changes since Atheme are:
- fixed many memory leaks
- fixed many bugs
- converted to C++ and use more STL containers
- added a (not very enhanced yet) perl module
- greatly improved XML-RPC speed
- added a JSON-RPC module with code from json-cpp
- added a valgrind memcheck module to operserv
- added a more object oriented base64 implementation
- added a specialised unit test framework
- improved stability
- use gettimeofday() if available
- reworked adding/removing commands
- MemoServ IGNORE DEL can now remove indices

File Contents

# Content
1 /*
2 * Copyright © 2007 William Pitcock <nenolod -at- sacredspiral.co.uk>
3 * Rights to this code are as documented in doc/LICENSE.
4 *
5 * Table rendering class.
6 *
7 * $Id: table.h 7941 2007-03-13 07:16:52Z nenolod $
8 */
9
10 #ifndef ATHEME_TABLE_H
11 #define ATHEME_TABLE_H
12
13 struct table_t
14 {
15 object_t parent;
16 list_t rows;
17 };
18
19 struct table_row_t
20 {
21 int id;
22 list_t cells;
23 };
24
25 struct table_cell_t
26 {
27 int width; /* only if first row. */
28 char *name;
29 char *value;
30 };
31
32 /*
33 * Creates a new table object. Use object_unref() to destroy it.
34 */
35 E table_t *table_new (const char *fmt, ...);
36
37 /*
38 * Renders a table, each line going to callback().
39 */
40 E void table_render (table_t * t, void (*callback) (const char *line, void *data), void *data);
41
42 /*
43 * Associates a value with a row.
44 */
45 E void table_cell_associate (table_row_t * r, const char *name, const char *value);
46
47 /*
48 * Associates a row with a table.
49 */
50 E table_row_t *table_row_new (table_t * t);
51
52 #endif