Relicense BabelTrace library to MIT (BSD-style)
[babeltrace.git] / formats / ctf / ctf.c
1 /*
2 * BabelTrace - Common Trace Format (CTF)
3 *
4 * Format registration.
5 *
6 * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 *
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:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 */
18
19 #include <babeltrace/format.h>
20 #include <babeltrace/ctf/types.h>
21
22 void __attribute__((constructor)) ctf_init(void);
23
24 static const struct format ctf_format = {
25 .uint_read = ctf_uint_read,
26 .int_read = ctf_int_read,
27 .uint_write = ctf_uint_write,
28 .int_write = ctf_int_write,
29 .double_read = ctf_double_read,
30 .double_write = ctf_double_write,
31 .float_copy = ctf_float_copy,
32 .string_copy = ctf_string_copy,
33 .string_read = ctf_string_read,
34 .string_write = ctf_string_write,
35 .string_free_temp = ctf_string_free_temp,
36 .enum_read = ctf_enum_read,
37 .enum_write = ctf_enum_write,
38 .struct_begin = ctf_struct_begin,
39 .struct_end = ctf_struct_end,
40 .array_begin = ctf_array_begin,
41 .array_end = ctf_array_end,
42 .sequence_begin = ctf_sequence_begin,
43 .sequence_end = ctf_sequence_end,
44 };
45
46 void ctf_init(void)
47 {
48 int ret;
49
50 ctf_format->name = g_quark_from_static_string("ctf");
51 ret = bt_register_format(&ctf_format);
52 assert(!ret);
53 }
54
55 /* TODO: finalize */
This page took 0.042214 seconds and 4 git commands to generate.