1 #ifndef BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
2 #define BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
5 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
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
27 * The Common Trace Format (CTF) Specification is available at
28 * http://www.efficios.com/ctf
34 #include <babeltrace/assert-pre-internal.h>
35 #include <babeltrace/babeltrace-internal.h>
36 #include <babeltrace/ctf-writer/clock-class-internal.h>
37 #include <babeltrace/ctf-writer/field-types.h>
38 #include <babeltrace/ctf-writer/writer-internal.h>
39 #include <babeltrace/ctf-writer/object-internal.h>
40 #include <babeltrace/types.h>
42 #define BT_ASSERT_PRE_CTF_FT_COMMON_HAS_ID(_ft, _type_id, _name) \
43 BT_ASSERT_PRE(((struct bt_ctf_field_type_common *) (_ft))->id == (_type_id), \
44 _name " has the wrong type ID: expected-type-id=%s, " \
45 "ft-addr=%p", bt_ctf_field_type_id_string(_type_id), (_ft))
47 #define BT_ASSERT_PRE_CTF_FT_HOT(_ft, _name) \
48 BT_ASSERT_PRE_HOT((_ft), (_name), ": ft-addr=%p", (_ft))
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)))
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)))
58 struct bt_ctf_field_common
;
59 struct bt_ctf_field_type_common
;
61 typedef void (*bt_ctf_field_type_common_method_freeze
)(
62 struct bt_ctf_field_type_common
*);
63 typedef int (*bt_ctf_field_type_common_method_validate
)(
64 struct bt_ctf_field_type_common
*);
65 typedef void (*bt_ctf_field_type_common_method_set_byte_order
)(
66 struct bt_ctf_field_type_common
*, enum bt_ctf_byte_order
);
67 typedef struct bt_ctf_field_type_common
*(*bt_ctf_field_type_common_method_copy
)(
68 struct bt_ctf_field_type_common
*);
69 typedef int (*bt_ctf_field_type_common_method_compare
)(
70 struct bt_ctf_field_type_common
*,
71 struct bt_ctf_field_type_common
*);
73 struct 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
;
81 struct bt_ctf_field_type_common
{
82 struct bt_ctf_object base
;
83 enum bt_ctf_field_type_id id
;
84 unsigned int alignment
;
87 struct bt_ctf_field_type_common_methods
*methods
;
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.
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).
103 * Specialized data for either CTF IR or CTF writer APIs.
104 * Having this here ensures that:
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.
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
124 void *serialize_func
;
129 struct bt_ctf_field_type_common_integer
{
130 struct bt_ctf_field_type_common common
;
133 struct bt_ctf_clock_class
*mapped_clock_class
;
135 enum bt_ctf_byte_order user_byte_order
;
138 enum bt_ctf_integer_base base
;
139 enum bt_ctf_string_encoding encoding
;
142 struct bt_ctf_enumeration_mapping
{
154 struct bt_ctf_field_type_common_enumeration
{
155 struct bt_ctf_field_type_common common
;
158 struct bt_ctf_field_type_common_integer
*container_ft
;
160 /* Array of `struct bt_ctf_enumeration_mapping *`, owned by this */
163 /* Only set during validation */
164 bt_bool has_overlapping_ranges
;
167 enum 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
,
173 struct bt_ctf_field_type_enumeration_mapping_iterator
{
174 struct bt_ctf_object base
;
177 struct bt_ctf_field_type_common_enumeration
*enumeration_ft
;
179 enum bt_ctf_field_type_enumeration_mapping_iterator_type type
;
183 int64_t signed_value
;
184 uint64_t unsigned_value
;
188 struct 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
;
195 struct bt_ctf_field_type_common_structure_field
{
199 struct bt_ctf_field_type_common
*type
;
202 struct bt_ctf_field_type_common_structure
{
203 struct bt_ctf_field_type_common common
;
204 GHashTable
*field_name_to_index
;
207 * Array of `struct bt_ctf_field_type_common_structure_field`,
213 struct bt_ctf_field_type_common_variant_choice_range
{
224 struct bt_ctf_field_type_common_variant_choice
{
228 struct bt_ctf_field_type_common
*type
;
230 /* Array of `struct bt_ctf_field_type_common_variant_choice_range` */
234 struct bt_ctf_field_type_common_variant
{
235 struct bt_ctf_field_type_common common
;
237 bool choices_up_to_date
;
240 struct bt_ctf_field_type_common_enumeration
*tag_ft
;
243 struct bt_ctf_field_path
*tag_field_path
;
245 GHashTable
*choice_name_to_index
;
248 * Array of `struct bt_ctf_field_type_common_variant_choice`,
253 struct bt_ctf_field_type_common_array
{
254 struct bt_ctf_field_type_common common
;
257 struct bt_ctf_field_type_common
*element_ft
;
262 struct bt_ctf_field_type_common_sequence
{
263 struct bt_ctf_field_type_common common
;
266 struct bt_ctf_field_type_common
*element_ft
;
268 GString
*length_field_name
;
271 struct bt_ctf_field_path
*length_field_path
;
274 struct bt_ctf_field_type_common_string
{
275 struct bt_ctf_field_type_common common
;
276 enum bt_ctf_string_encoding encoding
;
279 typedef struct bt_ctf_field_common
*(* bt_ctf_field_common_create_func
)(
280 struct bt_ctf_field_type_common
*);
283 void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common
*ft
,
284 bool init_bo
, bt_ctf_object_release_func release_func
,
285 struct bt_ctf_field_type_common_methods
*methods
);
288 void bt_ctf_field_type_common_integer_initialize(
289 struct bt_ctf_field_type_common
*ft
,
290 unsigned int size
, bt_ctf_object_release_func release_func
,
291 struct bt_ctf_field_type_common_methods
*methods
);
294 void bt_ctf_field_type_common_floating_point_initialize(
295 struct bt_ctf_field_type_common
*ft
,
296 bt_ctf_object_release_func release_func
,
297 struct bt_ctf_field_type_common_methods
*methods
);
300 void bt_ctf_field_type_common_enumeration_initialize(
301 struct bt_ctf_field_type_common
*ft
,
302 struct bt_ctf_field_type_common
*container_ft
,
303 bt_ctf_object_release_func release_func
,
304 struct bt_ctf_field_type_common_methods
*methods
);
307 void bt_ctf_field_type_common_string_initialize(
308 struct bt_ctf_field_type_common
*ft
,
309 bt_ctf_object_release_func release_func
,
310 struct bt_ctf_field_type_common_methods
*methods
);
313 void bt_ctf_field_type_common_structure_initialize(
314 struct bt_ctf_field_type_common
*ft
,
315 bt_ctf_object_release_func release_func
,
316 struct bt_ctf_field_type_common_methods
*methods
);
319 void bt_ctf_field_type_common_array_initialize(
320 struct bt_ctf_field_type_common
*ft
,
321 struct bt_ctf_field_type_common
*element_ft
,
322 unsigned int length
, bt_ctf_object_release_func release_func
,
323 struct bt_ctf_field_type_common_methods
*methods
);
326 void 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
,
330 bt_ctf_object_release_func release_func
,
331 struct bt_ctf_field_type_common_methods
*methods
);
334 void 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
,
338 bt_ctf_object_release_func release_func
,
339 struct bt_ctf_field_type_common_methods
*methods
);
342 void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object
*obj
);
345 void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object
*obj
);
348 void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object
*obj
);
351 void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object
*obj
);
354 void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object
*obj
);
357 void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object
*obj
);
360 void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object
*obj
);
363 void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object
*obj
);
366 int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common
*ft
);
369 int bt_ctf_field_type_common_enumeration_validate_recursive(
370 struct bt_ctf_field_type_common
*ft
);
373 int bt_ctf_field_type_common_sequence_validate_recursive(
374 struct bt_ctf_field_type_common
*ft
);
377 int bt_ctf_field_type_common_array_validate_recursive(
378 struct bt_ctf_field_type_common
*ft
);
381 int bt_ctf_field_type_common_structure_validate_recursive(
382 struct bt_ctf_field_type_common
*ft
);
385 int bt_ctf_field_type_common_variant_validate_recursive(
386 struct bt_ctf_field_type_common
*type
);
389 int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common
*ft
);
392 int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common
*ft
);
395 bt_bool
bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common
*ft
);
398 int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common
*ft
,
402 int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common
*ft
,
406 enum bt_ctf_integer_base
bt_ctf_field_type_common_integer_get_base(
407 struct bt_ctf_field_type_common
*ft
);
410 int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common
*ft
,
411 enum bt_ctf_integer_base base
);
414 enum bt_ctf_string_encoding
bt_ctf_field_type_common_integer_get_encoding(
415 struct bt_ctf_field_type_common
*ft
);
418 int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common
*ft
,
419 enum bt_ctf_string_encoding encoding
);
422 struct bt_ctf_clock_class
*bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
423 struct bt_ctf_field_type_common
*ft
);
426 int 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
);
431 int 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
);
436 struct bt_ctf_field_type_enumeration_mapping_iterator
*
437 bt_ctf_field_type_common_enumeration_find_mappings_by_name(
438 struct bt_ctf_field_type_common
*ft
, const char *name
);
441 struct bt_ctf_field_type_enumeration_mapping_iterator
*
442 bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
443 struct bt_ctf_field_type_common
*ft
, int64_t value
);
446 struct bt_ctf_field_type_enumeration_mapping_iterator
*
447 bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
448 struct bt_ctf_field_type_common
*ft
, uint64_t value
);
451 int 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
,
457 int 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
);
463 struct bt_ctf_field_type_common
*
464 bt_ctf_field_type_common_enumeration_borrow_container_field_type(
465 struct bt_ctf_field_type_common
*ft
);
468 int 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
);
473 int 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
);
478 int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
479 struct bt_ctf_field_type_common
*ft
);
482 int bt_ctf_field_type_common_floating_point_get_exponent_digits(
483 struct bt_ctf_field_type_common
*ft
);
486 int bt_ctf_field_type_common_floating_point_set_exponent_digits(
487 struct bt_ctf_field_type_common
*ft
,
488 unsigned int exponent_digits
);
491 int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
492 struct bt_ctf_field_type_common
*type
);
495 int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
496 struct bt_ctf_field_type_common
*ft
, unsigned int mantissa_digits
);
499 int 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
);
505 int 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
);
510 int64_t bt_ctf_field_type_common_structure_get_field_count(
511 struct bt_ctf_field_type_common
*ft
);
514 int 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
);
520 struct bt_ctf_field_type_common
*
521 bt_ctf_field_type_common_structure_borrow_field_type_by_name(
522 struct bt_ctf_field_type_common
*ft
, const char *name
);
525 struct bt_ctf_field_type_common
*
526 bt_ctf_field_type_common_variant_borrow_tag_field_type(
527 struct bt_ctf_field_type_common
*ft
);
530 const char *bt_ctf_field_type_common_variant_get_tag_name(
531 struct bt_ctf_field_type_common
*ft
);
534 int bt_ctf_field_type_common_variant_set_tag_name(
535 struct bt_ctf_field_type_common
*ft
, const char *name
);
538 int 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
);
543 int bt_ctf_field_type_common_variant_update_choices(
544 struct bt_ctf_field_type_common
*ft
);
547 struct bt_ctf_field_type_common
*
548 bt_ctf_field_type_common_variant_borrow_field_type_by_name(
549 struct bt_ctf_field_type_common
*ft
,
550 const char *field_name
);
553 int64_t bt_ctf_field_type_common_variant_get_field_count(
554 struct bt_ctf_field_type_common
*ft
);
557 int 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
);
563 struct bt_ctf_field_type_common
*
564 bt_ctf_field_type_common_array_borrow_element_field_type(
565 struct bt_ctf_field_type_common
*ft
);
568 int 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
);
573 int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common
*ft
);
576 struct bt_ctf_field_type_common
*
577 bt_ctf_field_type_common_sequence_borrow_element_field_type(
578 struct bt_ctf_field_type_common
*ft
);
581 int 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
);
586 const char *bt_ctf_field_type_common_sequence_get_length_field_name(
587 struct bt_ctf_field_type_common
*ft
);
590 enum bt_ctf_string_encoding
bt_ctf_field_type_common_string_get_encoding(
591 struct bt_ctf_field_type_common
*ft
);
594 int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common
*ft
,
595 enum bt_ctf_string_encoding encoding
);
598 int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common
*type
);
601 int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common
*ft
,
602 unsigned int alignment
);
605 enum bt_ctf_byte_order
bt_ctf_field_type_common_get_byte_order(
606 struct bt_ctf_field_type_common
*ft
);
609 int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common
*ft
,
610 enum bt_ctf_byte_order byte_order
);
613 enum bt_ctf_field_type_id
bt_ctf_field_type_common_get_type_id(
614 struct bt_ctf_field_type_common
*ft
);
617 void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common
*ft
);
620 struct bt_ctf_field_type_common
*
621 bt_ctf_field_type_common_variant_borrow_field_type_signed(
622 struct bt_ctf_field_type_common_variant
*var_ft
,
626 struct bt_ctf_field_type_common
*
627 bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
628 struct bt_ctf_field_type_common_variant
*var_ft
,
632 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_copy(
633 struct bt_ctf_field_type_common
*ft
);
636 int bt_ctf_field_type_common_structure_get_field_name_index(
637 struct bt_ctf_field_type_common
*ft
, const char *name
);
640 int bt_ctf_field_type_common_variant_get_field_name_index(
641 struct bt_ctf_field_type_common
*ft
, const char *name
);
644 int bt_ctf_field_type_common_sequence_set_length_field_path(
645 struct bt_ctf_field_type_common
*ft
, struct bt_ctf_field_path
*path
);
648 int 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
);
653 int 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
);
658 void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common
*ft
);
661 void bt_ctf_field_type_common_enumeration_freeze_recursive(
662 struct bt_ctf_field_type_common
*ft
);
665 void bt_ctf_field_type_common_structure_freeze_recursive(
666 struct bt_ctf_field_type_common
*ft
);
669 void bt_ctf_field_type_common_variant_freeze_recursive(
670 struct bt_ctf_field_type_common
*ft
);
673 void bt_ctf_field_type_common_array_freeze_recursive(
674 struct bt_ctf_field_type_common
*ft
);
677 void bt_ctf_field_type_common_sequence_freeze_recursive(
678 struct bt_ctf_field_type_common
*type
);
681 void bt_ctf_field_type_common_integer_set_byte_order(
682 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
685 void 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
);
689 void 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
);
693 void 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
);
698 void 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
);
703 void 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
);
708 void 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
);
713 int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common
*ft_a
,
714 struct bt_ctf_field_type_common
*ft_b
);
717 int 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
);
722 int 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
);
727 int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common
*ft_a
,
728 struct bt_ctf_field_type_common
*ft_b
);
731 int 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
);
736 int 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
);
741 int 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
);
746 int 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
);
751 int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common
*ft_a
,
752 struct bt_ctf_field_type_common
*ft_b
);
755 int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common
*ft
);
758 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_borrow_field_at_index(
759 struct bt_ctf_field_type_common
*ft
, int index
);
762 int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common
*ft
,
766 struct bt_ctf_field_path
*bt_ctf_field_type_common_variant_borrow_tag_field_path(
767 struct bt_ctf_field_type_common
*ft
);
770 struct bt_ctf_field_path
*bt_ctf_field_type_common_sequence_borrow_length_field_path(
771 struct bt_ctf_field_type_common
*ft
);
774 int 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
);
779 int64_t bt_ctf_field_type_common_variant_find_choice_index(
780 struct bt_ctf_field_type_common
*ft
, uint64_t uval
,
784 int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type
*type
,
785 struct metadata_context
*context
);
788 struct bt_ctf_field_type
*bt_ctf_field_type_copy(struct bt_ctf_field_type
*ft
);
790 #endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */