4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since aef91e2 was
953c53f,
checked in by Perry Lorier <perry@…>, 17 years ago
|
forgot to add the output.h
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
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; |
---|
16 | }; |
---|
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 | }; |
---|
34 | extern struct output_type_t output_csv; |
---|
35 | extern struct output_type_t output_html; |
---|
36 | extern struct output_type_t output_png; |
---|
37 | |
---|
38 | |
---|
39 | struct output_data_t *output_init(char *title, char *format); |
---|
40 | void output_add_column(struct output_data_t *out, char *col); |
---|
41 | void output_flush_headings(struct output_data_t *out); |
---|
42 | void output_set_data_int(struct output_data_t *out,int col,uint64_t data); |
---|
43 | void output_set_data_str(struct output_data_t *out,int col,char *data); |
---|
44 | void output_set_data_float(struct output_data_t *out,int col,double data); |
---|
45 | void output_set_data_time(struct output_data_t *out,int col,double data); |
---|
46 | void output_flush_row(struct output_data_t *out); |
---|
47 | void output_destroy(struct output_data_t *out); |
---|
48 | |
---|
49 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.