Revision: | 1.3 |
Committed: | Tue Aug 28 17:08:07 2007 UTC (16 years, 9 months ago) by pippijn |
Content type: | text/plain |
Branch: | MAIN |
Changes since 1.2: | +8 -8 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 |
# | Content |
---|---|
1 | /* |
2 | * Copyright © 2007 William Pitcock <nenolod -at- sacredspiral.co.uk> |
3 | * Rights to this code are as documented in doc/pod/license.pod. |
4 | * |
5 | * Table rendering class. |
6 | * |
7 | * $Id: table.h,v 1.2 2007-07-21 01:29:07 pippijn Exp $ |
8 | */ |
9 | |
10 | #ifndef ATHEME_TABLE_H |
11 | #define ATHEME_TABLE_H |
12 | |
13 | struct table_t : zero_initialised |
14 | { |
15 | object_t parent; |
16 | list_t rows; |
17 | }; |
18 | |
19 | struct table_row_t : zero_initialised |
20 | { |
21 | int id; |
22 | list_t cells; |
23 | }; |
24 | |
25 | struct table_cell_t : zero_initialised |
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 (char const * const fmt, ...); |
36 | |
37 | /* |
38 | * Renders a table, each line going to callback(). |
39 | */ |
40 | E void table_render (table_t * t, void (*callback) (char const * const 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, char const * const name, char const * const 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 |