Commit | Line | Data |
---|---|---|
d79865b9 MD |
1 | #ifndef _BABELTRACE_CTF_TYPES_H |
2 | #define _BABELTRACE_CTF_TYPES_H | |
6dc2ca62 MD |
3 | |
4 | /* | |
5 | * Common Trace Format | |
6 | * | |
7 | * Type header | |
8 | * | |
de0ba614 | 9 | * Copyright (c) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
6dc2ca62 | 10 | * |
de0ba614 MD |
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 | |
6dc2ca62 MD |
24 | */ |
25 | ||
26 | #include <stdint.h> | |
27 | #include <glib.h> | |
28 | ||
29 | /* | |
de0ba614 MD |
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 | |
6dc2ca62 MD |
34 | * receive a NULL ptr/dest parameter. In this case, no write is performed, but |
35 | * the size is returned. | |
36 | */ | |
37 | ||
bed864a7 MD |
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); | |
6dc2ca62 | 48 | |
bed864a7 MD |
49 | double ctf_double_read(struct stream_pos *pos, |
50 | const struct type_class_float *src); | |
51 | void ctf_double_write(struct stream_pos *pos, | |
52 | const struct type_class_float *dest, | |
53 | double v); | |
54 | long double ctf_ldouble_read(struct stream_pos *pos, | |
0a46062b | 55 | const struct type_class_float *src); |
bed864a7 MD |
56 | void ctf_ldouble_write(struct stream_pos *pos, |
57 | const struct type_class_float *dest, | |
58 | long double v); | |
59 | void ctf_float_copy(struct stream_pos *destp, const struct type_class_float *dest, | |
60 | struct stream_pos *srcp, const struct type_class_float *src); | |
6dc2ca62 | 61 | |
bed864a7 MD |
62 | void ctf_string_copy(struct stream_pos *dest, struct stream_pos *src, |
63 | const struct type_class_string *string_class); | |
a52d7f6a MD |
64 | void ctf_string_read(unsigned char **dest, struct stream_pos *src, |
65 | const struct type_class_string *string_class); | |
66 | void ctf_string_write(struct stream_pos *dest, const unsigned char *src, | |
67 | const struct type_class_string *string_class); | |
68 | void ctf_string_free_temp(unsigned char *string); | |
6dc2ca62 | 69 | |
bed864a7 MD |
70 | GQuark ctf_enum_read(struct stream_pos *pos, |
71 | const struct type_class_enum *src); | |
72 | void ctf_enum_write(struct stream_pos *pos, | |
73 | const struct type_class_enum *dest, | |
74 | GQuark q); | |
11796b96 MD |
75 | void ctf_struct_begin(struct stream_pos *pos, |
76 | const struct type_class_struct *struct_class); | |
77 | void ctf_struct_end(struct stream_pos *pos, | |
78 | const struct type_class_struct *struct_class); | |
d06d03db MD |
79 | void ctf_array_begin(struct stream_pos *pos, |
80 | const struct type_class_array *array_class); | |
81 | void ctf_array_end(struct stream_pos *pos, | |
82 | const struct type_class_array *array_class); | |
83 | void ctf_sequence_begin(struct stream_pos *pos, | |
84 | const struct type_class_sequence *sequence_class); | |
85 | void ctf_sequence_end(struct stream_pos *pos, | |
86 | const struct type_class_sequence *sequence_class); | |
6dc2ca62 | 87 | |
d79865b9 | 88 | #endif /* _BABELTRACE_CTF_TYPES_H */ |