tap-driver.sh: flush stdout after each test result
[babeltrace.git] / include / babeltrace2 / ctf-writer / field-types-internal.h
CommitLineData
3dca2276
PP
1#ifndef BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
2#define BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
3
4/*
3dca2276
PP
5 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 *
7 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * The Common Trace Format (CTF) Specification is available at
28 * http://www.efficios.com/ctf
29 */
30
31#include <stdint.h>
32#include <stddef.h>
33
67d2ce02 34#include <babeltrace2/ctf-writer/assert-pre-internal.h>
3fadfbc0
MJ
35#include <babeltrace2/babeltrace-internal.h>
36#include <babeltrace2/ctf-writer/clock-class-internal.h>
37#include <babeltrace2/ctf-writer/field-types.h>
38#include <babeltrace2/ctf-writer/writer-internal.h>
39#include <babeltrace2/ctf-writer/object-internal.h>
40#include <babeltrace2/types.h>
16ca5ff0 41
67d2ce02
MJ
42#define BT_CTF_ASSERT_PRE_CTF_FT_COMMON_HAS_ID(_ft, _type_id, _name) \
43 BT_CTF_ASSERT_PRE(((struct bt_ctf_field_type_common *) (_ft))->id == (_type_id), \
16ca5ff0
PP
44 _name " has the wrong type ID: expected-type-id=%s, " \
45 "ft-addr=%p", bt_ctf_field_type_id_string(_type_id), (_ft))
46
67d2ce02
MJ
47#define BT_CTF_ASSERT_PRE_CTF_FT_HOT(_ft, _name) \
48 BT_CTF_ASSERT_PRE_HOT((_ft), (_name), ": ft-addr=%p", (_ft))
16ca5ff0
PP
49
50#define BT_CTF_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(_ft, _index) \
51 (&g_array_index(((struct bt_ctf_field_type_common_structure *) (_ft))->fields, \
52 struct bt_ctf_field_type_common_structure_field, (_index)))
53
54#define BT_CTF_FIELD_TYPE_COMMON_VARIANT_CHOICE_AT_INDEX(_ft, _index) \
55 (&g_array_index(((struct bt_ctf_field_type_common_variant *) (_ft))->choices, \
56 struct bt_ctf_field_type_common_variant_choice, (_index)))
57
58struct bt_ctf_field_common;
59struct bt_ctf_field_type_common;
60
61typedef void (*bt_ctf_field_type_common_method_freeze)(
62 struct bt_ctf_field_type_common *);
63typedef int (*bt_ctf_field_type_common_method_validate)(
64 struct bt_ctf_field_type_common *);
65typedef void (*bt_ctf_field_type_common_method_set_byte_order)(
66 struct bt_ctf_field_type_common *, enum bt_ctf_byte_order);
67typedef struct bt_ctf_field_type_common *(*bt_ctf_field_type_common_method_copy)(
68 struct bt_ctf_field_type_common *);
69typedef int (*bt_ctf_field_type_common_method_compare)(
70 struct bt_ctf_field_type_common *,
71 struct bt_ctf_field_type_common *);
72
73struct bt_ctf_field_type_common_methods {
74 bt_ctf_field_type_common_method_freeze freeze;
75 bt_ctf_field_type_common_method_validate validate;
76 bt_ctf_field_type_common_method_set_byte_order set_byte_order;
77 bt_ctf_field_type_common_method_copy copy;
78 bt_ctf_field_type_common_method_compare compare;
79};
80
81struct bt_ctf_field_type_common {
e1e02a22 82 struct bt_ctf_object base;
16ca5ff0
PP
83 enum bt_ctf_field_type_id id;
84 unsigned int alignment;
85
86 /* Virtual table */
87 struct bt_ctf_field_type_common_methods *methods;
88
89 /*
90 * A type can't be modified once it is added to an event or after a
91 * a field has been instanciated from it.
92 */
93 int frozen;
94
95 /*
96 * This flag indicates if the field type is valid. A valid
97 * field type is _always_ frozen. All the nested field types of
98 * a valid field type are also valid (and thus frozen).
99 */
100 int valid;
101
102 /*
103 * Specialized data for either CTF IR or CTF writer APIs.
104 * Having this here ensures that:
105 *
106 * * The type-specific common data is always found at the same
107 * offset when the common API has a `struct
108 * bt_ctf_field_type_common *` so that you can cast it to `struct
109 * bt_ctf_field_type_common_integer *` for example and access the
110 * common integer field type fields.
111 *
112 * * The specific CTF IR and CTF writer APIs can access their
113 * specific field type fields in this union at an offset known
114 * at build time. This avoids a pointer to specific data so
115 * that all the fields, common or specific, of a CTF IR
116 * integer field type or of a CTF writer integer field type,
117 * for example, are contained within the same contiguous block
118 * of memory.
119 */
120 union {
121 struct {
122 } ir;
123 struct {
124 void *serialize_func;
125 } writer;
126 } spec;
127};
128
129struct bt_ctf_field_type_common_integer {
130 struct bt_ctf_field_type_common common;
131
132 /* Owned by this */
133 struct bt_ctf_clock_class *mapped_clock_class;
134
135 enum bt_ctf_byte_order user_byte_order;
136 bt_bool is_signed;
137 unsigned int size;
138 enum bt_ctf_integer_base base;
139 enum bt_ctf_string_encoding encoding;
140};
141
142struct bt_ctf_enumeration_mapping {
143 union {
144 uint64_t _unsigned;
145 int64_t _signed;
146 } range_start;
147 union {
148 uint64_t _unsigned;
149 int64_t _signed;
150 } range_end;
151 GQuark string;
152};
153
154struct bt_ctf_field_type_common_enumeration {
155 struct bt_ctf_field_type_common common;
156
157 /* Owned by this */
158 struct bt_ctf_field_type_common_integer *container_ft;
159
160 /* Array of `struct bt_ctf_enumeration_mapping *`, owned by this */
161 GPtrArray *entries;
162
163 /* Only set during validation */
164 bt_bool has_overlapping_ranges;
165};
166
167enum bt_ctf_field_type_enumeration_mapping_iterator_type {
168 CTF_ITERATOR_BY_NAME,
169 CTF_ITERATOR_BY_SIGNED_VALUE,
170 CTF_ITERATOR_BY_UNSIGNED_VALUE,
171};
172
173struct bt_ctf_field_type_enumeration_mapping_iterator {
e1e02a22 174 struct bt_ctf_object base;
16ca5ff0
PP
175
176 /* Owned by this */
177 struct bt_ctf_field_type_common_enumeration *enumeration_ft;
178
179 enum bt_ctf_field_type_enumeration_mapping_iterator_type type;
180 int index;
181 union {
182 GQuark name_quark;
183 int64_t signed_value;
184 uint64_t unsigned_value;
185 } u;
186};
187
188struct bt_ctf_field_type_common_floating_point {
189 struct bt_ctf_field_type_common common;
190 enum bt_ctf_byte_order user_byte_order;
191 unsigned int exp_dig;
192 unsigned int mant_dig;
193};
194
195struct bt_ctf_field_type_common_structure_field {
196 GQuark name;
197
198 /* Owned by this */
199 struct bt_ctf_field_type_common *type;
200};
201
202struct bt_ctf_field_type_common_structure {
203 struct bt_ctf_field_type_common common;
204 GHashTable *field_name_to_index;
205
206 /*
207 * Array of `struct bt_ctf_field_type_common_structure_field`,
208 * owned by this
209 */
210 GArray *fields;
211};
212
213struct bt_ctf_field_type_common_variant_choice_range {
214 union {
215 int64_t i;
216 uint64_t u;
217 } lower;
218 union {
219 int64_t i;
220 uint64_t u;
221 } upper;
222};
223
224struct bt_ctf_field_type_common_variant_choice {
225 GQuark name;
226
227 /* Owned by this */
228 struct bt_ctf_field_type_common *type;
229
230 /* Array of `struct bt_ctf_field_type_common_variant_choice_range` */
231 GArray *ranges;
232};
233
234struct bt_ctf_field_type_common_variant {
235 struct bt_ctf_field_type_common common;
236 GString *tag_name;
237 bool choices_up_to_date;
238
239 /* Owned by this */
240 struct bt_ctf_field_type_common_enumeration *tag_ft;
241
242 /* Owned by this */
243 struct bt_ctf_field_path *tag_field_path;
244
245 GHashTable *choice_name_to_index;
246
247 /*
248 * Array of `struct bt_ctf_field_type_common_variant_choice`,
249 * owned by this */
250 GArray *choices;
251};
252
253struct bt_ctf_field_type_common_array {
254 struct bt_ctf_field_type_common common;
255
256 /* Owned by this */
257 struct bt_ctf_field_type_common *element_ft;
258
259 unsigned int length;
260};
261
262struct bt_ctf_field_type_common_sequence {
263 struct bt_ctf_field_type_common common;
264
265 /* Owned by this */
266 struct bt_ctf_field_type_common *element_ft;
267
268 GString *length_field_name;
269
270 /* Owned by this */
271 struct bt_ctf_field_path *length_field_path;
272};
273
274struct bt_ctf_field_type_common_string {
275 struct bt_ctf_field_type_common common;
276 enum bt_ctf_string_encoding encoding;
277};
278
279typedef struct bt_ctf_field_common *(* bt_ctf_field_common_create_func)(
280 struct bt_ctf_field_type_common *);
281
282BT_HIDDEN
283void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft,
e1e02a22 284 bool init_bo, bt_ctf_object_release_func release_func,
16ca5ff0
PP
285 struct bt_ctf_field_type_common_methods *methods);
286
287BT_HIDDEN
288void bt_ctf_field_type_common_integer_initialize(
289 struct bt_ctf_field_type_common *ft,
e1e02a22 290 unsigned int size, bt_ctf_object_release_func release_func,
16ca5ff0
PP
291 struct bt_ctf_field_type_common_methods *methods);
292
293BT_HIDDEN
294void bt_ctf_field_type_common_floating_point_initialize(
295 struct bt_ctf_field_type_common *ft,
e1e02a22 296 bt_ctf_object_release_func release_func,
16ca5ff0
PP
297 struct bt_ctf_field_type_common_methods *methods);
298
299BT_HIDDEN
300void bt_ctf_field_type_common_enumeration_initialize(
301 struct bt_ctf_field_type_common *ft,
302 struct bt_ctf_field_type_common *container_ft,
e1e02a22 303 bt_ctf_object_release_func release_func,
16ca5ff0
PP
304 struct bt_ctf_field_type_common_methods *methods);
305
306BT_HIDDEN
307void bt_ctf_field_type_common_string_initialize(
308 struct bt_ctf_field_type_common *ft,
e1e02a22 309 bt_ctf_object_release_func release_func,
16ca5ff0
PP
310 struct bt_ctf_field_type_common_methods *methods);
311
312BT_HIDDEN
313void bt_ctf_field_type_common_structure_initialize(
314 struct bt_ctf_field_type_common *ft,
e1e02a22 315 bt_ctf_object_release_func release_func,
16ca5ff0
PP
316 struct bt_ctf_field_type_common_methods *methods);
317
318BT_HIDDEN
319void bt_ctf_field_type_common_array_initialize(
320 struct bt_ctf_field_type_common *ft,
321 struct bt_ctf_field_type_common *element_ft,
e1e02a22 322 unsigned int length, bt_ctf_object_release_func release_func,
16ca5ff0
PP
323 struct bt_ctf_field_type_common_methods *methods);
324
325BT_HIDDEN
326void bt_ctf_field_type_common_sequence_initialize(
327 struct bt_ctf_field_type_common *ft,
328 struct bt_ctf_field_type_common *element_ft,
329 const char *length_field_name,
e1e02a22 330 bt_ctf_object_release_func release_func,
16ca5ff0
PP
331 struct bt_ctf_field_type_common_methods *methods);
332
333BT_HIDDEN
334void bt_ctf_field_type_common_variant_initialize(
335 struct bt_ctf_field_type_common *ft,
336 struct bt_ctf_field_type_common *tag_ft,
337 const char *tag_name,
e1e02a22 338 bt_ctf_object_release_func release_func,
16ca5ff0
PP
339 struct bt_ctf_field_type_common_methods *methods);
340
341BT_HIDDEN
e1e02a22 342void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj);
16ca5ff0
PP
343
344BT_HIDDEN
e1e02a22 345void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj);
16ca5ff0
PP
346
347BT_HIDDEN
e1e02a22 348void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
349
350BT_HIDDEN
e1e02a22 351void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object *obj);
16ca5ff0
PP
352
353BT_HIDDEN
e1e02a22 354void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
355
356BT_HIDDEN
e1e02a22 357void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
358
359BT_HIDDEN
e1e02a22 360void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
361
362BT_HIDDEN
e1e02a22 363void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
364
365BT_HIDDEN
366int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common *ft);
367
368BT_HIDDEN
369int bt_ctf_field_type_common_enumeration_validate_recursive(
370 struct bt_ctf_field_type_common *ft);
371
372BT_HIDDEN
373int bt_ctf_field_type_common_sequence_validate_recursive(
374 struct bt_ctf_field_type_common *ft);
375
376BT_HIDDEN
377int bt_ctf_field_type_common_array_validate_recursive(
378 struct bt_ctf_field_type_common *ft);
379
380BT_HIDDEN
381int bt_ctf_field_type_common_structure_validate_recursive(
382 struct bt_ctf_field_type_common *ft);
383
384BT_HIDDEN
385int bt_ctf_field_type_common_variant_validate_recursive(
386 struct bt_ctf_field_type_common *type);
387
388BT_HIDDEN
389int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common *ft);
390
391BT_HIDDEN
392int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft);
393
394BT_HIDDEN
395bt_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft);
396
397BT_HIDDEN
398int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft,
399 bt_bool is_signed);
400
401BT_HIDDEN
402int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft,
403 unsigned int size);
404
405BT_HIDDEN
406enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base(
407 struct bt_ctf_field_type_common *ft);
408
409BT_HIDDEN
410int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common *ft,
411 enum bt_ctf_integer_base base);
412
413BT_HIDDEN
414enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding(
415 struct bt_ctf_field_type_common *ft);
416
417BT_HIDDEN
418int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common *ft,
419 enum bt_ctf_string_encoding encoding);
420
421BT_HIDDEN
422struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
423 struct bt_ctf_field_type_common *ft);
424
425BT_HIDDEN
426int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
427 struct bt_ctf_field_type_common *ft,
428 struct bt_ctf_clock_class *clock_class);
429
430BT_HIDDEN
431int bt_ctf_field_type_common_integer_set_mapped_clock_class(
432 struct bt_ctf_field_type_common *ft,
433 struct bt_ctf_clock_class *clock_class);
434
435BT_HIDDEN
436struct bt_ctf_field_type_enumeration_mapping_iterator *
437bt_ctf_field_type_common_enumeration_find_mappings_by_name(
438 struct bt_ctf_field_type_common *ft, const char *name);
439
440BT_HIDDEN
441struct bt_ctf_field_type_enumeration_mapping_iterator *
442bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
443 struct bt_ctf_field_type_common *ft, int64_t value);
444
445BT_HIDDEN
446struct bt_ctf_field_type_enumeration_mapping_iterator *
447bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
448 struct bt_ctf_field_type_common *ft, uint64_t value);
449
450BT_HIDDEN
451int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
452 struct bt_ctf_field_type_common *ft, uint64_t index,
453 const char **mapping_name, int64_t *range_begin,
454 int64_t *range_end);
455
456BT_HIDDEN
457int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
458 struct bt_ctf_field_type_common *ft, uint64_t index,
459 const char **mapping_name, uint64_t *range_begin,
460 uint64_t *range_end);
461
462BT_HIDDEN
463struct bt_ctf_field_type_common *
464bt_ctf_field_type_common_enumeration_borrow_container_field_type(
465 struct bt_ctf_field_type_common *ft);
466
467BT_HIDDEN
468int bt_ctf_field_type_common_enumeration_signed_add_mapping(
469 struct bt_ctf_field_type_common *ft, const char *string,
470 int64_t range_start, int64_t range_end);
471
472BT_HIDDEN
473int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
474 struct bt_ctf_field_type_common *ft, const char *string,
475 uint64_t range_start, uint64_t range_end);
476
477BT_HIDDEN
478int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
479 struct bt_ctf_field_type_common *ft);
480
481BT_HIDDEN
482int bt_ctf_field_type_common_floating_point_get_exponent_digits(
483 struct bt_ctf_field_type_common *ft);
484
485BT_HIDDEN
486int bt_ctf_field_type_common_floating_point_set_exponent_digits(
487 struct bt_ctf_field_type_common *ft,
488 unsigned int exponent_digits);
489
490BT_HIDDEN
491int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
492 struct bt_ctf_field_type_common *type);
493
494BT_HIDDEN
495int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
496 struct bt_ctf_field_type_common *ft, unsigned int mantissa_digits);
497
498BT_HIDDEN
499int bt_ctf_field_type_common_structure_replace_field(
500 struct bt_ctf_field_type_common *ft,
501 const char *field_name,
502 struct bt_ctf_field_type_common *field_type);
503
504BT_HIDDEN
505int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common *ft,
506 struct bt_ctf_field_type_common *field_type,
507 const char *field_name);
508
509BT_HIDDEN
510int64_t bt_ctf_field_type_common_structure_get_field_count(
511 struct bt_ctf_field_type_common *ft);
512
513BT_HIDDEN
514int bt_ctf_field_type_common_structure_borrow_field_by_index(
515 struct bt_ctf_field_type_common *ft,
516 const char **field_name,
517 struct bt_ctf_field_type_common **field_type, uint64_t index);
518
519BT_HIDDEN
520struct bt_ctf_field_type_common *
521bt_ctf_field_type_common_structure_borrow_field_type_by_name(
522 struct bt_ctf_field_type_common *ft, const char *name);
523
524BT_HIDDEN
525struct bt_ctf_field_type_common *
526bt_ctf_field_type_common_variant_borrow_tag_field_type(
527 struct bt_ctf_field_type_common *ft);
528
529BT_HIDDEN
530const char *bt_ctf_field_type_common_variant_get_tag_name(
531 struct bt_ctf_field_type_common *ft);
532
533BT_HIDDEN
534int bt_ctf_field_type_common_variant_set_tag_name(
535 struct bt_ctf_field_type_common *ft, const char *name);
536
537BT_HIDDEN
538int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common *ft,
539 struct bt_ctf_field_type_common *field_type,
540 const char *field_name);
541
542BT_HIDDEN
543int bt_ctf_field_type_common_variant_update_choices(
544 struct bt_ctf_field_type_common *ft);
545
546BT_HIDDEN
547struct bt_ctf_field_type_common *
548bt_ctf_field_type_common_variant_borrow_field_type_by_name(
549 struct bt_ctf_field_type_common *ft,
550 const char *field_name);
551
552BT_HIDDEN
553int64_t bt_ctf_field_type_common_variant_get_field_count(
554 struct bt_ctf_field_type_common *ft);
555
556BT_HIDDEN
557int bt_ctf_field_type_common_variant_borrow_field_by_index(
558 struct bt_ctf_field_type_common *ft,
559 const char **field_name,
560 struct bt_ctf_field_type_common **field_type, uint64_t index);
561
562BT_HIDDEN
563struct bt_ctf_field_type_common *
564bt_ctf_field_type_common_array_borrow_element_field_type(
565 struct bt_ctf_field_type_common *ft);
566
567BT_HIDDEN
568int bt_ctf_field_type_common_array_set_element_field_type(
569 struct bt_ctf_field_type_common *ft,
570 struct bt_ctf_field_type_common *element_ft);
571
572BT_HIDDEN
573int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common *ft);
574
575BT_HIDDEN
576struct bt_ctf_field_type_common *
577bt_ctf_field_type_common_sequence_borrow_element_field_type(
578 struct bt_ctf_field_type_common *ft);
579
580BT_HIDDEN
581int bt_ctf_field_type_common_sequence_set_element_field_type(
582 struct bt_ctf_field_type_common *ft,
583 struct bt_ctf_field_type_common *element_ft);
584
585BT_HIDDEN
586const char *bt_ctf_field_type_common_sequence_get_length_field_name(
587 struct bt_ctf_field_type_common *ft);
588
589BT_HIDDEN
590enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding(
591 struct bt_ctf_field_type_common *ft);
592
593BT_HIDDEN
594int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common *ft,
595 enum bt_ctf_string_encoding encoding);
596
597BT_HIDDEN
598int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *type);
599
600BT_HIDDEN
601int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common *ft,
602 unsigned int alignment);
603
604BT_HIDDEN
605enum bt_ctf_byte_order bt_ctf_field_type_common_get_byte_order(
606 struct bt_ctf_field_type_common *ft);
607
608BT_HIDDEN
609int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common *ft,
610 enum bt_ctf_byte_order byte_order);
611
612BT_HIDDEN
613enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id(
614 struct bt_ctf_field_type_common *ft);
615
616BT_HIDDEN
617void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common *ft);
618
619BT_HIDDEN
620struct bt_ctf_field_type_common *
621bt_ctf_field_type_common_variant_borrow_field_type_signed(
622 struct bt_ctf_field_type_common_variant *var_ft,
623 int64_t tag_value);
624
625BT_HIDDEN
626struct bt_ctf_field_type_common *
627bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
628 struct bt_ctf_field_type_common_variant *var_ft,
629 uint64_t tag_value);
630
631BT_HIDDEN
632struct bt_ctf_field_type_common *bt_ctf_field_type_common_copy(
633 struct bt_ctf_field_type_common *ft);
634
635BT_HIDDEN
636int bt_ctf_field_type_common_structure_get_field_name_index(
637 struct bt_ctf_field_type_common *ft, const char *name);
638
639BT_HIDDEN
640int bt_ctf_field_type_common_variant_get_field_name_index(
641 struct bt_ctf_field_type_common *ft, const char *name);
642
643BT_HIDDEN
644int bt_ctf_field_type_common_sequence_set_length_field_path(
645 struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path);
646
647BT_HIDDEN
648int bt_ctf_field_type_common_variant_set_tag_field_path(
649 struct bt_ctf_field_type_common *ft,
650 struct bt_ctf_field_path *path);
651
652BT_HIDDEN
653int bt_ctf_field_type_common_variant_set_tag_field_type(
654 struct bt_ctf_field_type_common *ft,
655 struct bt_ctf_field_type_common *tag_ft);
656
657BT_HIDDEN
658void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common *ft);
659
660BT_HIDDEN
661void bt_ctf_field_type_common_enumeration_freeze_recursive(
662 struct bt_ctf_field_type_common *ft);
663
664BT_HIDDEN
665void bt_ctf_field_type_common_structure_freeze_recursive(
666 struct bt_ctf_field_type_common *ft);
667
668BT_HIDDEN
669void bt_ctf_field_type_common_variant_freeze_recursive(
670 struct bt_ctf_field_type_common *ft);
671
672BT_HIDDEN
673void bt_ctf_field_type_common_array_freeze_recursive(
674 struct bt_ctf_field_type_common *ft);
675
676BT_HIDDEN
677void bt_ctf_field_type_common_sequence_freeze_recursive(
678 struct bt_ctf_field_type_common *type);
679
680BT_HIDDEN
681void bt_ctf_field_type_common_integer_set_byte_order(
682 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
683
684BT_HIDDEN
685void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
686 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
687
688BT_HIDDEN
689void bt_ctf_field_type_common_floating_point_set_byte_order(
690 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
691
692BT_HIDDEN
693void bt_ctf_field_type_common_structure_set_byte_order_recursive(
694 struct bt_ctf_field_type_common *ft,
695 enum bt_ctf_byte_order byte_order);
696
697BT_HIDDEN
698void bt_ctf_field_type_common_variant_set_byte_order_recursive(
699 struct bt_ctf_field_type_common *ft,
700 enum bt_ctf_byte_order byte_order);
701
702BT_HIDDEN
703void bt_ctf_field_type_common_array_set_byte_order_recursive(
704 struct bt_ctf_field_type_common *ft,
705 enum bt_ctf_byte_order byte_order);
706
707BT_HIDDEN
708void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
709 struct bt_ctf_field_type_common *ft,
710 enum bt_ctf_byte_order byte_order);
711
712BT_HIDDEN
713int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common *ft_a,
714 struct bt_ctf_field_type_common *ft_b);
715
716BT_HIDDEN
717int bt_ctf_field_type_common_floating_point_compare(
718 struct bt_ctf_field_type_common *ft_a,
719 struct bt_ctf_field_type_common *ft_b);
720
721BT_HIDDEN
722int bt_ctf_field_type_common_enumeration_compare_recursive(
723 struct bt_ctf_field_type_common *ft_a,
724 struct bt_ctf_field_type_common *ft_b);
725
726BT_HIDDEN
727int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common *ft_a,
728 struct bt_ctf_field_type_common *ft_b);
729
730BT_HIDDEN
731int bt_ctf_field_type_common_structure_compare_recursive(
732 struct bt_ctf_field_type_common *ft_a,
733 struct bt_ctf_field_type_common *ft_b);
734
735BT_HIDDEN
736int bt_ctf_field_type_common_variant_compare_recursive(
737 struct bt_ctf_field_type_common *ft_a,
738 struct bt_ctf_field_type_common *ft_b);
739
740BT_HIDDEN
741int bt_ctf_field_type_common_array_compare_recursive(
742 struct bt_ctf_field_type_common *ft_a,
743 struct bt_ctf_field_type_common *ft_b);
744
745BT_HIDDEN
746int bt_ctf_field_type_common_sequence_compare_recursive(
747 struct bt_ctf_field_type_common *ft_a,
748 struct bt_ctf_field_type_common *ft_b);
749
750BT_HIDDEN
751int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common *ft_a,
752 struct bt_ctf_field_type_common *ft_b);
753
754BT_HIDDEN
755int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common *ft);
756
757BT_HIDDEN
758struct bt_ctf_field_type_common *bt_ctf_field_type_common_borrow_field_at_index(
759 struct bt_ctf_field_type_common *ft, int index);
760
761BT_HIDDEN
762int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft,
763 const char *name);
764
765BT_HIDDEN
766struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path(
767 struct bt_ctf_field_type_common *ft);
768
769BT_HIDDEN
770struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_path(
771 struct bt_ctf_field_type_common *ft);
772
773BT_HIDDEN
774int bt_ctf_field_type_common_validate_single_clock_class(
775 struct bt_ctf_field_type_common *ft,
776 struct bt_ctf_clock_class **expected_clock_class);
777
778BT_HIDDEN
779int64_t bt_ctf_field_type_common_variant_find_choice_index(
780 struct bt_ctf_field_type_common *ft, uint64_t uval,
781 bool is_signed);
3dca2276
PP
782
783BT_HIDDEN
784int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type,
785 struct metadata_context *context);
786
787BT_HIDDEN
788struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *ft);
789
790#endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */
This page took 0.058342 seconds and 4 git commands to generate.