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