Add float type class to babeltrace types
[babeltrace.git] / formats / ctf / ctf.c
CommitLineData
fc93b2bd
MD
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
26void __attribute__((constructor)) ctf_init(void);
27
28static 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 .bitfield_unsigned_read = ctf_bitfield_unsigned_read,
34 .bitfield_signed_read = ctf_bitfield_signed_read,
35 .bitfield_unsigned_write = ctf_bitfield_unsigned_write,
36 .bitfield_signed_write = ctf_bitfield_signed_write,
0a46062b
MD
37 .double_read = ctf_double_read,
38 .double_write = ctf_double_write,
fc93b2bd
MD
39 .float_copy = ctf_float_copy,
40 .string_copy = ctf_string_copy,
41 .enum_uint_to_quark = ctf_enum_uint_to_quark,
42 .enum_int_to_quark = ctf_enum_int_to_quark,
43 .enum_quark_to_uint = ctf_enum_quark_to_uint,
44 .enum_quark_to_int = ctf_enum_quark_to_int,
45};
46
47void ctf_init(void)
48{
49 int ret;
50
51 ctf_format->name = g_quark_from_static_string("ctf");
52 ret = bt_register_format(&ctf_format);
53 assert(!ret);
54}
698f0fe4
MD
55
56/* TODO: finalize */
This page took 0.023801 seconds and 4 git commands to generate.