4 * Common Trace Format Parser Test
6 * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 #include <babeltrace/endian.h>
32 #include <babeltrace/babeltrace-internal.h>
33 #include <babeltrace/ctf/metadata.h>
34 #include "ctf-scanner.h"
35 #include "ctf-parser.h"
38 int babeltrace_verbose
, babeltrace_debug
;
40 int main(int argc
, char **argv
)
42 struct ctf_scanner
*scanner
;
43 struct ctf_trace
*trace
;
47 babeltrace_verbose
= 1;
48 scanner
= ctf_scanner_alloc();
50 fprintf(stderr
, "Error allocating scanner\n");
53 ret
= ctf_scanner_append_ast(scanner
, stdin
);
55 fprintf(stderr
, "Error creating AST\n");
59 ret
= ctf_visitor_print_xml(stderr
, 0, &scanner
->ast
->root
);
61 fprintf(stderr
, "Error visiting AST for XML output\n");
65 ret
= ctf_visitor_semantic_check(stderr
, 0, &scanner
->ast
->root
);
67 fprintf(stderr
, "Error in CTF semantic validation %d\n", ret
);
70 trace
= malloc(sizeof(*trace
));
71 memset(trace
, 0, sizeof(*trace
));
72 ret
= ctf_visitor_construct_metadata(stderr
, 0, &scanner
->ast
->root
,
75 fprintf(stderr
, "Error in CTF metadata constructor %d\n", ret
);
81 ctf_scanner_free(scanner
);
This page took 0.030591 seconds and 4 git commands to generate.