4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since ddfc46d was
e3b0188,
checked in by Daniel Lawson <dlawson@…>, 17 years ago
|
a lot of changes for cross-compilation support
- header ordering
- os-specific headers
- an lt_inttypes.h which defines PRIu64 etc for platforms that don't have them
- removed daglegacy.h, merged with dagformat.h
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[953c53f] | 1 | #ifndef OUTPUT_H |
---|
| 2 | #define OUTPUT_H |
---|
| 3 | #include <inttypes.h> |
---|
| 4 | |
---|
| 5 | typedef char *TYPE__str; |
---|
| 6 | typedef uint64_t TYPE__int; |
---|
| 7 | typedef double TYPE__float; |
---|
| 8 | typedef double TYPE__time; |
---|
| 9 | struct data_t { |
---|
| 10 | enum { TYPE_str, TYPE_int, TYPE_float, TYPE_time } type; |
---|
| 11 | union { |
---|
| 12 | TYPE__str d_str; |
---|
| 13 | TYPE__int d_int; |
---|
| 14 | TYPE__float d_float; |
---|
| 15 | TYPE__time d_time; |
---|
[e3b0188] | 16 | } d; |
---|
[953c53f] | 17 | }; |
---|
| 18 | |
---|
| 19 | typedef struct output_data_t { |
---|
| 20 | char *title; |
---|
| 21 | int columns; |
---|
| 22 | char **labels; |
---|
| 23 | struct data_t *data; |
---|
| 24 | struct output_type_t *format; |
---|
| 25 | void *private_format_data; |
---|
| 26 | } output_data_t; |
---|
| 27 | |
---|
| 28 | struct output_type_t { |
---|
| 29 | char *name; |
---|
| 30 | void (*init)(struct output_data_t *); |
---|
| 31 | void (*flush)(struct output_data_t *); |
---|
| 32 | void (*destroy)(struct output_data_t *); |
---|
| 33 | }; |
---|
[9c13ab0] | 34 | extern struct output_type_t output_txt; |
---|
[953c53f] | 35 | extern struct output_type_t output_csv; |
---|
| 36 | extern struct output_type_t output_html; |
---|
| 37 | extern struct output_type_t output_png; |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | struct output_data_t *output_init(char *title, char *format); |
---|
| 41 | void output_add_column(struct output_data_t *out, char *col); |
---|
| 42 | void output_flush_headings(struct output_data_t *out); |
---|
| 43 | void output_set_data_int(struct output_data_t *out,int col,uint64_t data); |
---|
| 44 | void output_set_data_str(struct output_data_t *out,int col,char *data); |
---|
| 45 | void output_set_data_float(struct output_data_t *out,int col,double data); |
---|
| 46 | void output_set_data_time(struct output_data_t *out,int col,double data); |
---|
| 47 | void output_flush_row(struct output_data_t *out); |
---|
| 48 | void output_destroy(struct output_data_t *out); |
---|
| 49 | |
---|
| 50 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.