Commit | Line | Data |
---|---|---|
fc93b2bd MD |
1 | /* |
2 | * BabelTrace - Common Trace Format (CTF) | |
3 | * | |
4 | * Format registration. | |
5 | * | |
c054553d | 6 | * Copyright 2010, 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
fc93b2bd | 7 | * |
ccd7e1c8 MD |
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: | |
fc93b2bd | 14 | * |
ccd7e1c8 MD |
15 | * The above copyright notice and this permission notice shall be included in |
16 | * all copies or substantial portions of the Software. | |
fc93b2bd MD |
17 | */ |
18 | ||
19 | #include <babeltrace/format.h> | |
20 | #include <babeltrace/ctf/types.h> | |
21 | ||
22 | void __attribute__((constructor)) ctf_init(void); | |
23 | ||
4c8bfb7e | 24 | static struct format ctf_format = { |
fc93b2bd MD |
25 | .uint_read = ctf_uint_read, |
26 | .int_read = ctf_int_read, | |
27 | .uint_write = ctf_uint_write, | |
28 | .int_write = ctf_int_write, | |
0a46062b MD |
29 | .double_read = ctf_double_read, |
30 | .double_write = ctf_double_write, | |
fc93b2bd MD |
31 | .float_copy = ctf_float_copy, |
32 | .string_copy = ctf_string_copy, | |
a52d7f6a MD |
33 | .string_read = ctf_string_read, |
34 | .string_write = ctf_string_write, | |
35 | .string_free_temp = ctf_string_free_temp, | |
448d3cc7 MD |
36 | .enum_read = ctf_enum_read, |
37 | .enum_write = ctf_enum_write, | |
11796b96 MD |
38 | .struct_begin = ctf_struct_begin, |
39 | .struct_end = ctf_struct_end, | |
c054553d MD |
40 | .variant_begin = ctf_variant_begin, |
41 | .variant_end = ctf_variant_end, | |
d06d03db MD |
42 | .array_begin = ctf_array_begin, |
43 | .array_end = ctf_array_end, | |
44 | .sequence_begin = ctf_sequence_begin, | |
45 | .sequence_end = ctf_sequence_end, | |
fc93b2bd MD |
46 | }; |
47 | ||
48 | void ctf_init(void) | |
49 | { | |
50 | int ret; | |
51 | ||
4c8bfb7e | 52 | ctf_format.name = g_quark_from_static_string("ctf"); |
fc93b2bd MD |
53 | ret = bt_register_format(&ctf_format); |
54 | assert(!ret); | |
55 | } | |
698f0fe4 MD |
56 | |
57 | /* TODO: finalize */ |