API cleanups, offset by bit.
[babeltrace.git] / include / babeltrace / ctf / types.h
1 #ifndef _BABELTRACE_CTF_TYPES_H
2 #define _BABELTRACE_CTF_TYPES_H
3
4 /*
5 * Common Trace Format
6 *
7 * Type header
8 *
9 * Copyright (c) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26 #include <stdint.h>
27 #include <glib.h>
28
29 /*
30 * IMPORTANT: All lengths (len) and offsets (start, end) are expressed in bits,
31 * *not* in bytes.
32 *
33 * All write primitives, as well as read for dynamically sized entities, can
34 * receive a NULL ptr/dest parameter. In this case, no write is performed, but
35 * the size is returned.
36 */
37
38 uint64_t ctf_uint_read(struct stream_pos *pos,
39 const struct type_class_integer *int_class);
40 int64_t ctf_int_read(struct stream_pos *pos,
41 const struct type_class_integer *int_class);
42 void ctf_uint_write(struct stream_pos *pos,
43 const struct type_class_integer *int_class,
44 uint64_t v);
45 void ctf_int_write(struct stream_pos *pos,
46 const struct type_class_integer *int_class,
47 int64_t v);
48
49 uint64_t ctf_bitfield_unsigned_read(struct stream_pos *pos,
50 const struct type_class_bitfield *bitfield_class);
51 int64_t ctf_bitfield_signed_read(struct stream_pos *pos,
52 const struct type_class_bitfield *bitfield_class);
53 void ctf_bitfield_unsigned_write(struct stream_pos *pos,
54 const struct type_class_bitfield *bitfield_class,
55 uint64_t v);
56 void ctf_bitfield_signed_write(struct stream_pos *pos,
57 const struct type_class_bitfield *bitfield_class,
58 int64_t v);
59
60 double ctf_double_read(struct stream_pos *pos,
61 const struct type_class_float *src);
62 void ctf_double_write(struct stream_pos *pos,
63 const struct type_class_float *dest,
64 double v);
65 long double ctf_ldouble_read(struct stream_pos *pos,
66 const struct type_class_float *src);
67 void ctf_ldouble_write(struct stream_pos *pos,
68 const struct type_class_float *dest,
69 long double v);
70 void ctf_float_copy(struct stream_pos *destp, const struct type_class_float *dest,
71 struct stream_pos *srcp, const struct type_class_float *src);
72
73 void ctf_string_copy(struct stream_pos *dest, struct stream_pos *src,
74 const struct type_class_string *string_class);
75
76 GQuark ctf_enum_read(struct stream_pos *pos,
77 const struct type_class_enum *src);
78 void ctf_enum_write(struct stream_pos *pos,
79 const struct type_class_enum *dest,
80 GQuark q);
81
82 #endif /* _BABELTRACE_CTF_TYPES_H */
This page took 0.030147 seconds and 4 git commands to generate.