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.
24 #include <babeltrace/babeltrace.h>
25 #include <babeltrace/ctf/metadata.h>
26 #include "ctf-scanner.h"
27 #include "ctf-parser.h"
30 int babeltrace_verbose
, babeltrace_debug
;
32 int main(int argc
, char **argv
)
34 struct ctf_scanner
*scanner
;
35 struct ctf_trace
*trace
;
39 babeltrace_verbose
= 1;
40 scanner
= ctf_scanner_alloc(stdin
);
42 fprintf(stdout
, "Error allocating scanner\n");
45 ret
= ctf_scanner_append_ast(scanner
);
47 fprintf(stdout
, "Error creating AST\n");
51 ret
= ctf_visitor_print_xml(stdout
, 0, &scanner
->ast
->root
);
53 fprintf(stdout
, "Error visiting AST for XML output\n");
57 ret
= ctf_visitor_semantic_check(stdout
, 0, &scanner
->ast
->root
);
59 fprintf(stdout
, "Error in CTF semantic validation %d\n", ret
);
62 trace
= malloc(sizeof(*trace
));
63 ret
= ctf_visitor_construct_metadata(stdout
, 0, &scanner
->ast
->root
,
66 fprintf(stdout
, "Error in CTF metadata constructor %d\n", ret
);
72 ctf_scanner_free(scanner
);
This page took 0.03085 seconds and 4 git commands to generate.