source: tools/tracertstats/output.h @ e78e408

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivendag_formatrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since e78e408 was ee6e802, checked in by Shane Alcock <salcock@…>, 5 years ago

Updated copyright blurb on all source files

In some cases, this meant adding copyright blurbs to files that
had never had them before.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 *
3 * Copyright (c) 2007-2016 The University of Waikato, Hamilton, New Zealand.
4 * All rights reserved.
5 *
6 * This file is part of libtrace.
7 *
8 * This code has been developed by the University of Waikato WAND
9 * research group. For further information please see http://www.wand.net.nz/
10 *
11 * libtrace is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * libtrace is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 *
24 *
25 */
26
27#ifndef OUTPUT_H
28#define OUTPUT_H
29#include <inttypes.h>
30
31typedef char *TYPE__str;
32typedef uint64_t TYPE__int;
33typedef double TYPE__float;
34typedef double TYPE__time;
35struct data_t {
36        enum { TYPE_str, TYPE_int, TYPE_float, TYPE_time } type;
37        union {
38                TYPE__str d_str;
39                TYPE__int d_int;
40                TYPE__float d_float;
41                TYPE__time d_time;
42        } d;
43};
44
45typedef struct output_data_t {
46        char *title;
47        int columns;
48        char **labels;
49        struct data_t *data;
50        struct output_type_t *format;
51        void *private_format_data;
52} output_data_t;
53
54struct output_type_t {
55        char *name;
56        void (*init)(struct output_data_t *);
57        void (*flush)(struct output_data_t *);
58        void (*destroy)(struct output_data_t *);
59};
60extern struct output_type_t output_txt;
61extern struct output_type_t output_csv;
62extern struct output_type_t output_html;
63extern struct output_type_t output_png;
64
65
66struct output_data_t *output_init(char *title, char *format);
67void output_add_column(struct output_data_t *out, char *col);
68void output_flush_headings(struct output_data_t *out);
69void output_set_data_int(struct output_data_t *out,int col,uint64_t data);
70void output_set_data_str(struct output_data_t *out,int col,char *data);
71void output_set_data_float(struct output_data_t *out,int col,double data);
72void output_set_data_time(struct output_data_t *out,int col,double data);
73void output_flush_row(struct output_data_t *out);
74void output_destroy(struct output_data_t *out);
75
76#endif
Note: See TracBrowser for help on using the repository browser.