2 * UCW Library -- Table printer
4 * (c) 2014 Robert Kessl <robert.kessl@economia.cz>
7 #ifndef _UCW_TABLE_TYPES_H
8 #define _UCW_TABLE_TYPES_H
10 #include <ucw/table.h>
21 enum timestamp_format {
26 #define COL_TYPE_SIZE COL_TYPE_UCW
27 #define COL_TYPE_TIMESTAMP (COL_TYPE_UCW+1)
29 extern struct table_user_type table_type_timestamp;
30 extern struct table_user_type table_type_size;
32 #define TBL_COL_SIZE(_name, _width) { .name = _name, .width = _width, .fmt = "%llu", .type = COL_TYPE_SIZE, .type_def = &table_type_size }
33 #define TBL_COL_TIMESTAMP(_name, _width) { .name = _name, .width = _width, .fmt = "%lld", .type = COL_TYPE_TIMESTAMP, .type_def = &table_type_timestamp }
35 #define TBL_COL_SIZE_FMT(_name, _width, _units) { .name = _name, .width = _width, .fmt = "%llu", .type = COL_TYPE_SIZE, .type_def = &table_type_size }
36 #define TBL_COL_TIMESTAMP_FMT(_name, _width, _fmt) { .name = _name, .width = _width, .fmt = "%lld", .type = COL_TYPE_TIMESTAMP, .type_def = &table_type_timestamp }
38 void table_col_size_name(struct table *tbl, const char *col_name, u64 val);
39 void table_col_timestamp_name(struct table *tbl, const char * col_name, u64 val);
41 void table_col_size(struct table *tbl, int col, u64 val);
42 void table_col_timestamp(struct table *tbl, int col, u64 val);