4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since 3bfeb7d was
130a0e4,
checked in by Perry Lorier <perry@…>, 17 years ago
|
Added tracestats into the right place in the lt tree
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Line | |
---|
1 | #define _GNU_SOURCE |
---|
2 | #include <stdio.h> |
---|
3 | |
---|
4 | enum stats_output_format_t { |
---|
5 | CSV, TXT, HTML, XML, ODOC |
---|
6 | }; |
---|
7 | struct stats_output_t { |
---|
8 | enum stats_output_format_t type; |
---|
9 | }; |
---|
10 | |
---|
11 | struct stats_output_t *create_stats(enum stats_output_format_t format) |
---|
12 | { |
---|
13 | struct stats_output_t *output=malloc(sizeof(struct stats_output_t)); |
---|
14 | output->type=format; |
---|
15 | switch (type) { |
---|
16 | case CSV: |
---|
17 | break; |
---|
18 | case HTML: |
---|
19 | printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"); |
---|
20 | printf("<html>\n"); |
---|
21 | printf("<head>\n"); |
---|
22 | printf(" <title>Report</title>\n"); |
---|
23 | printf(" <style>\n"); |
---|
24 | printf(" .table { border-collapse: collapse; }\n"); |
---|
25 | printf(" td { border: thin black solid; }\n"); |
---|
26 | printf(" .numeric { text-align: right; }\n"); |
---|
27 | printf(" .even { background: #a0e0e0; }\n"); |
---|
28 | printf(" .odd { background: #ffffff; }\n"); |
---|
29 | printf(" .rowheading { text-align: right; }\n"); |
---|
30 | printf(" </style>\n"); |
---|
31 | printf("</head>\n"); |
---|
32 | printf("<body>\n"); |
---|
33 | printf("<h1>Report</h1>\n"); |
---|
34 | printf("<table>\n"); |
---|
35 | printf(" <tr>\n"); |
---|
36 | break; |
---|
37 | case XML: |
---|
38 | printf("<?xml version=\"1.0\" charset=\"utf-8\"?>\n"); |
---|
39 | printf("<results>\n"); |
---|
40 | printf(" <columnheadings>\n"); |
---|
41 | break; |
---|
42 | default: |
---|
43 | fprintf(stderr,"Unknown format\n"); |
---|
44 | break; |
---|
45 | } |
---|
46 | return output; |
---|
47 | } |
---|
48 | |
---|
49 | struct stats_output_t *add_column_heading(struct stats_output_t *out,char *heading,...) |
---|
50 | { |
---|
51 | va_list va; |
---|
52 | va_start(va,heading); |
---|
53 | vasprintf(&buf,heading,va); |
---|
54 | switch (out->type) { |
---|
55 | case CSV: |
---|
56 | } |
---|
57 | va_end(va); |
---|
58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.