ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/include/table.h
Revision: 1.3
Committed: Tue Aug 28 17:08:07 2007 UTC (19 years, 1 month 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

File Contents

# User Rev Content
1 pippijn 1.1 /*
2 pippijn 1.3 * Copyright © 2007 William Pitcock <nenolod -at- sacredspiral.co.uk>
3 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
4 pippijn 1.1 *
5     * Table rendering class.
6     *
7 pippijn 1.3 * $Id: table.h,v 1.2 2007-07-21 01:29:07 pippijn Exp $
8 pippijn 1.1 */
9    
10     #ifndef ATHEME_TABLE_H
11     #define ATHEME_TABLE_H
12    
13 pippijn 1.3 struct table_t : zero_initialised
14 pippijn 1.1 {
15     object_t parent;
16     list_t rows;
17     };
18    
19 pippijn 1.3 struct table_row_t : zero_initialised
20 pippijn 1.1 {
21     int id;
22     list_t cells;
23     };
24    
25 pippijn 1.3 struct table_cell_t : zero_initialised
26 pippijn 1.1 {
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 pippijn 1.3 E table_t *table_new (char const * const fmt, ...);
36 pippijn 1.1
37     /*
38     * Renders a table, each line going to callback().
39     */
40 pippijn 1.3 E void table_render (table_t * t, void (*callback) (char const * const line, void *data), void *data);
41 pippijn 1.1
42     /*
43     * Associates a value with a row.
44     */
45 pippijn 1.3 E void table_cell_associate (table_row_t * r, char const * const name, char const * const value);
46 pippijn 1.1
47     /*
48     * Associates a row with a table.
49     */
50     E table_row_t *table_row_new (table_t * t);
51    
52     #endif