source: tools/tracertstats/output.h @ 2e22196d

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 2e22196d was e3b0188, checked in by Daniel Lawson <dlawson@…>, 16 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
Line 
1#ifndef OUTPUT_H
2#define OUTPUT_H
3#include <inttypes.h>
4
5typedef char *TYPE__str;
6typedef uint64_t TYPE__int;
7typedef double TYPE__float;
8typedef double TYPE__time;
9struct 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        } d;
17};
18
19typedef 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
28struct 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};
34extern struct output_type_t output_txt;
35extern struct output_type_t output_csv;
36extern struct output_type_t output_html;
37extern struct output_type_t output_png;
38
39
40struct output_data_t *output_init(char *title, char *format);
41void output_add_column(struct output_data_t *out, char *col);
42void output_flush_headings(struct output_data_t *out);
43void output_set_data_int(struct output_data_t *out,int col,uint64_t data);
44void output_set_data_str(struct output_data_t *out,int col,char *data);
45void output_set_data_float(struct output_data_t *out,int col,double data);
46void output_set_data_time(struct output_data_t *out,int col,double data);
47void output_flush_row(struct output_data_t *out);
48void output_destroy(struct output_data_t *out);
49
50#endif
Note: See TracBrowser for help on using the repository browser.