48c62c02f6d3dff1be4db96f968e5d345d437c05
[babeltrace.git] / formats / ctf / ctf.c
1 /*
2 * BabelTrace - Common Trace Format (CTF)
3 *
4 * Format registration.
5 *
6 * Copyright (c) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #include <babeltrace/format.h>
24 #include <babeltrace/ctf/types.h>
25
26 void __attribute__((constructor)) ctf_init(void);
27
28 static const struct format ctf_format = {
29 .uint_read = ctf_uint_read,
30 .int_read = ctf_int_read,
31 .uint_write = ctf_uint_write,
32 .int_write = ctf_int_write,
33 .double_read = ctf_double_read,
34 .double_write = ctf_double_write,
35 .float_copy = ctf_float_copy,
36 .string_copy = ctf_string_copy,
37 .string_read = ctf_string_read,
38 .string_write = ctf_string_write,
39 .string_free_temp = ctf_string_free_temp,
40 .enum_read = ctf_enum_read,
41 .enum_write = ctf_enum_write,
42 .struct_begin = ctf_struct_begin,
43 .struct_end = ctf_struct_end,
44 .array_begin = ctf_array_begin,
45 .array_end = ctf_array_end,
46 .sequence_begin = ctf_sequence_begin,
47 .sequence_end = ctf_sequence_end,
48 };
49
50 void ctf_init(void)
51 {
52 int ret;
53
54 ctf_format->name = g_quark_from_static_string("ctf");
55 ret = bt_register_format(&ctf_format);
56 assert(!ret);
57 }
58
59 /* TODO: finalize */
This page took 0.029366 seconds and 3 git commands to generate.