2 * SPDX-License-Identifier: MIT
4 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 * The Common Trace Format (CTF) Specification is available at
7 * http://www.efficios.com/ctf
10 #ifndef BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
11 #define BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
17 #include <babeltrace2-ctf-writer/field-types.h>
18 #include <babeltrace2-ctf-writer/types.h>
20 #include "common/macros.h"
22 #include "assert-pre.h"
23 #include "clock-class.h"
27 #define BT_CTF_ASSERT_PRE_CTF_FT_COMMON_HAS_ID(_ft, _type_id, _name) \
28 BT_CTF_ASSERT_PRE(((struct bt_ctf_field_type_common *) (_ft))->id == (_type_id), \
29 _name " has the wrong type ID: expected-type-id=%s, " \
30 "ft-addr=%p", bt_ctf_field_type_id_string(_type_id), (_ft))
32 #define BT_CTF_ASSERT_PRE_CTF_FT_HOT(_ft, _name) \
33 BT_CTF_ASSERT_PRE_HOT((_ft), (_name), ": ft-addr=%p", (_ft))
35 #define BT_CTF_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(_ft, _index) \
36 (&g_array_index(((struct bt_ctf_field_type_common_structure *) (_ft))->fields, \
37 struct bt_ctf_field_type_common_structure_field, (_index)))
39 #define BT_CTF_FIELD_TYPE_COMMON_VARIANT_CHOICE_AT_INDEX(_ft, _index) \
40 (&g_array_index(((struct bt_ctf_field_type_common_variant *) (_ft))->choices, \
41 struct bt_ctf_field_type_common_variant_choice, (_index)))
43 struct bt_ctf_field_common
;
44 struct bt_ctf_field_type_common
;
46 typedef void (*bt_ctf_field_type_common_method_freeze
)(
47 struct bt_ctf_field_type_common
*);
48 typedef int (*bt_ctf_field_type_common_method_validate
)(
49 struct bt_ctf_field_type_common
*);
50 typedef void (*bt_ctf_field_type_common_method_set_byte_order
)(
51 struct bt_ctf_field_type_common
*, enum bt_ctf_byte_order
);
52 typedef struct bt_ctf_field_type_common
*(*bt_ctf_field_type_common_method_copy
)(
53 struct bt_ctf_field_type_common
*);
54 typedef int (*bt_ctf_field_type_common_method_compare
)(
55 struct bt_ctf_field_type_common
*,
56 struct bt_ctf_field_type_common
*);
58 struct bt_ctf_field_type_common_methods
{
59 bt_ctf_field_type_common_method_freeze freeze
;
60 bt_ctf_field_type_common_method_validate validate
;
61 bt_ctf_field_type_common_method_set_byte_order set_byte_order
;
62 bt_ctf_field_type_common_method_copy copy
;
63 bt_ctf_field_type_common_method_compare compare
;
66 struct bt_ctf_field_type_common
{
67 struct bt_ctf_object base
;
68 enum bt_ctf_field_type_id id
;
69 unsigned int alignment
;
72 struct bt_ctf_field_type_common_methods
*methods
;
75 * A type can't be modified once it is added to an event or after a
76 * a field has been instanciated from it.
81 * This flag indicates if the field type is valid. A valid
82 * field type is _always_ frozen. All the nested field types of
83 * a valid field type are also valid (and thus frozen).
88 * Specialized data for either CTF IR or CTF writer APIs.
89 * Having this here ensures that:
91 * * The type-specific common data is always found at the same
92 * offset when the common API has a `struct
93 * bt_ctf_field_type_common *` so that you can cast it to `struct
94 * bt_ctf_field_type_common_integer *` for example and access the
95 * common integer field type fields.
97 * * The specific CTF IR and CTF writer APIs can access their
98 * specific field type fields in this union at an offset known
99 * at build time. This avoids a pointer to specific data so
100 * that all the fields, common or specific, of a CTF IR
101 * integer field type or of a CTF writer integer field type,
102 * for example, are contained within the same contiguous block
109 void *serialize_func
;
114 struct bt_ctf_field_type_common_integer
{
115 struct bt_ctf_field_type_common common
;
118 struct bt_ctf_clock_class
*mapped_clock_class
;
120 enum bt_ctf_byte_order user_byte_order
;
121 bt_ctf_bool is_signed
;
123 enum bt_ctf_integer_base base
;
124 enum bt_ctf_string_encoding encoding
;
127 struct bt_ctf_enumeration_mapping
{
139 struct bt_ctf_field_type_common_enumeration
{
140 struct bt_ctf_field_type_common common
;
143 struct bt_ctf_field_type_common_integer
*container_ft
;
145 /* Array of `struct bt_ctf_enumeration_mapping *`, owned by this */
148 /* Only set during validation */
149 bt_ctf_bool has_overlapping_ranges
;
152 enum bt_ctf_field_type_enumeration_mapping_iterator_type
{
153 CTF_ITERATOR_BY_NAME
,
154 CTF_ITERATOR_BY_SIGNED_VALUE
,
155 CTF_ITERATOR_BY_UNSIGNED_VALUE
,
158 struct bt_ctf_field_type_enumeration_mapping_iterator
{
159 struct bt_ctf_object base
;
162 struct bt_ctf_field_type_common_enumeration
*enumeration_ft
;
164 enum bt_ctf_field_type_enumeration_mapping_iterator_type type
;
168 int64_t signed_value
;
169 uint64_t unsigned_value
;
173 struct bt_ctf_field_type_common_floating_point
{
174 struct bt_ctf_field_type_common common
;
175 enum bt_ctf_byte_order user_byte_order
;
176 unsigned int exp_dig
;
177 unsigned int mant_dig
;
180 struct bt_ctf_field_type_common_structure_field
{
184 struct bt_ctf_field_type_common
*type
;
187 struct bt_ctf_field_type_common_structure
{
188 struct bt_ctf_field_type_common common
;
189 GHashTable
*field_name_to_index
;
192 * Array of `struct bt_ctf_field_type_common_structure_field`,
198 struct bt_ctf_field_type_common_variant_choice_range
{
209 struct bt_ctf_field_type_common_variant_choice
{
213 struct bt_ctf_field_type_common
*type
;
215 /* Array of `struct bt_ctf_field_type_common_variant_choice_range` */
219 struct bt_ctf_field_type_common_variant
{
220 struct bt_ctf_field_type_common common
;
222 bool choices_up_to_date
;
225 struct bt_ctf_field_type_common_enumeration
*tag_ft
;
228 struct bt_ctf_field_path
*tag_field_path
;
230 GHashTable
*choice_name_to_index
;
233 * Array of `struct bt_ctf_field_type_common_variant_choice`,
238 struct bt_ctf_field_type_common_array
{
239 struct bt_ctf_field_type_common common
;
242 struct bt_ctf_field_type_common
*element_ft
;
247 struct bt_ctf_field_type_common_sequence
{
248 struct bt_ctf_field_type_common common
;
251 struct bt_ctf_field_type_common
*element_ft
;
253 GString
*length_field_name
;
256 struct bt_ctf_field_path
*length_field_path
;
259 struct bt_ctf_field_type_common_string
{
260 struct bt_ctf_field_type_common common
;
261 enum bt_ctf_string_encoding encoding
;
264 typedef struct bt_ctf_field_common
*(* bt_ctf_field_common_create_func
)(
265 struct bt_ctf_field_type_common
*);
268 void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common
*ft
,
269 bool init_bo
, bt_ctf_object_release_func release_func
,
270 struct bt_ctf_field_type_common_methods
*methods
);
273 void bt_ctf_field_type_common_integer_initialize(
274 struct bt_ctf_field_type_common
*ft
,
275 unsigned int size
, bt_ctf_object_release_func release_func
,
276 struct bt_ctf_field_type_common_methods
*methods
);
279 void bt_ctf_field_type_common_floating_point_initialize(
280 struct bt_ctf_field_type_common
*ft
,
281 bt_ctf_object_release_func release_func
,
282 struct bt_ctf_field_type_common_methods
*methods
);
285 void bt_ctf_field_type_common_enumeration_initialize(
286 struct bt_ctf_field_type_common
*ft
,
287 struct bt_ctf_field_type_common
*container_ft
,
288 bt_ctf_object_release_func release_func
,
289 struct bt_ctf_field_type_common_methods
*methods
);
292 void bt_ctf_field_type_common_string_initialize(
293 struct bt_ctf_field_type_common
*ft
,
294 bt_ctf_object_release_func release_func
,
295 struct bt_ctf_field_type_common_methods
*methods
);
298 void bt_ctf_field_type_common_structure_initialize(
299 struct bt_ctf_field_type_common
*ft
,
300 bt_ctf_object_release_func release_func
,
301 struct bt_ctf_field_type_common_methods
*methods
);
304 void bt_ctf_field_type_common_array_initialize(
305 struct bt_ctf_field_type_common
*ft
,
306 struct bt_ctf_field_type_common
*element_ft
,
307 unsigned int length
, bt_ctf_object_release_func release_func
,
308 struct bt_ctf_field_type_common_methods
*methods
);
311 void bt_ctf_field_type_common_sequence_initialize(
312 struct bt_ctf_field_type_common
*ft
,
313 struct bt_ctf_field_type_common
*element_ft
,
314 const char *length_field_name
,
315 bt_ctf_object_release_func release_func
,
316 struct bt_ctf_field_type_common_methods
*methods
);
319 void bt_ctf_field_type_common_variant_initialize(
320 struct bt_ctf_field_type_common
*ft
,
321 struct bt_ctf_field_type_common
*tag_ft
,
322 const char *tag_name
,
323 bt_ctf_object_release_func release_func
,
324 struct bt_ctf_field_type_common_methods
*methods
);
327 void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object
*obj
);
330 void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object
*obj
);
333 void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object
*obj
);
336 void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object
*obj
);
339 void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object
*obj
);
342 void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object
*obj
);
345 void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object
*obj
);
348 void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object
*obj
);
351 int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common
*ft
);
354 int bt_ctf_field_type_common_enumeration_validate_recursive(
355 struct bt_ctf_field_type_common
*ft
);
358 int bt_ctf_field_type_common_sequence_validate_recursive(
359 struct bt_ctf_field_type_common
*ft
);
362 int bt_ctf_field_type_common_array_validate_recursive(
363 struct bt_ctf_field_type_common
*ft
);
366 int bt_ctf_field_type_common_structure_validate_recursive(
367 struct bt_ctf_field_type_common
*ft
);
370 int bt_ctf_field_type_common_variant_validate_recursive(
371 struct bt_ctf_field_type_common
*type
);
374 int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common
*ft
);
377 int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common
*ft
);
380 bt_ctf_bool
bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common
*ft
);
383 int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common
*ft
,
384 bt_ctf_bool is_signed
);
387 int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common
*ft
,
391 enum bt_ctf_integer_base
bt_ctf_field_type_common_integer_get_base(
392 struct bt_ctf_field_type_common
*ft
);
395 int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common
*ft
,
396 enum bt_ctf_integer_base base
);
399 enum bt_ctf_string_encoding
bt_ctf_field_type_common_integer_get_encoding(
400 struct bt_ctf_field_type_common
*ft
);
403 int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common
*ft
,
404 enum bt_ctf_string_encoding encoding
);
407 struct bt_ctf_clock_class
*bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
408 struct bt_ctf_field_type_common
*ft
);
411 int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
412 struct bt_ctf_field_type_common
*ft
,
413 struct bt_ctf_clock_class
*clock_class
);
416 int bt_ctf_field_type_common_integer_set_mapped_clock_class(
417 struct bt_ctf_field_type_common
*ft
,
418 struct bt_ctf_clock_class
*clock_class
);
421 struct bt_ctf_field_type_enumeration_mapping_iterator
*
422 bt_ctf_field_type_common_enumeration_find_mappings_by_name(
423 struct bt_ctf_field_type_common
*ft
, const char *name
);
426 struct bt_ctf_field_type_enumeration_mapping_iterator
*
427 bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
428 struct bt_ctf_field_type_common
*ft
, int64_t value
);
431 struct bt_ctf_field_type_enumeration_mapping_iterator
*
432 bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
433 struct bt_ctf_field_type_common
*ft
, uint64_t value
);
436 int bt_ctf_field_type_enumeration_mapping_iterator_next(
437 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
);
440 int bt_ctf_field_type_enumeration_mapping_iterator_signed_get(
441 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
,
442 const char **mapping_name
, int64_t *range_begin
,
446 int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get(
447 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
,
448 const char **mapping_name
, uint64_t *range_begin
,
449 uint64_t *range_end
);
452 int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
453 struct bt_ctf_field_type_common
*ft
, uint64_t index
,
454 const char **mapping_name
, int64_t *range_begin
,
458 int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
459 struct bt_ctf_field_type_common
*ft
, uint64_t index
,
460 const char **mapping_name
, uint64_t *range_begin
,
461 uint64_t *range_end
);
464 struct bt_ctf_field_type_common
*
465 bt_ctf_field_type_common_enumeration_borrow_container_field_type(
466 struct bt_ctf_field_type_common
*ft
);
469 int bt_ctf_field_type_common_enumeration_signed_add_mapping(
470 struct bt_ctf_field_type_common
*ft
, const char *string
,
471 int64_t range_start
, int64_t range_end
);
474 int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
475 struct bt_ctf_field_type_common
*ft
, const char *string
,
476 uint64_t range_start
, uint64_t range_end
);
479 int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
480 struct bt_ctf_field_type_common
*ft
);
483 int bt_ctf_field_type_common_floating_point_get_exponent_digits(
484 struct bt_ctf_field_type_common
*ft
);
487 int bt_ctf_field_type_common_floating_point_set_exponent_digits(
488 struct bt_ctf_field_type_common
*ft
,
489 unsigned int exponent_digits
);
492 int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
493 struct bt_ctf_field_type_common
*type
);
496 int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
497 struct bt_ctf_field_type_common
*ft
, unsigned int mantissa_digits
);
500 int bt_ctf_field_type_common_structure_replace_field(
501 struct bt_ctf_field_type_common
*ft
,
502 const char *field_name
,
503 struct bt_ctf_field_type_common
*field_type
);
506 int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common
*ft
,
507 struct bt_ctf_field_type_common
*field_type
,
508 const char *field_name
);
511 int64_t bt_ctf_field_type_common_structure_get_field_count(
512 struct bt_ctf_field_type_common
*ft
);
515 int bt_ctf_field_type_common_structure_borrow_field_by_index(
516 struct bt_ctf_field_type_common
*ft
,
517 const char **field_name
,
518 struct bt_ctf_field_type_common
**field_type
, uint64_t index
);
521 struct bt_ctf_field_type_common
*
522 bt_ctf_field_type_common_structure_borrow_field_type_by_name(
523 struct bt_ctf_field_type_common
*ft
, const char *name
);
526 struct bt_ctf_field_type_common
*
527 bt_ctf_field_type_common_variant_borrow_tag_field_type(
528 struct bt_ctf_field_type_common
*ft
);
531 const char *bt_ctf_field_type_common_variant_get_tag_name(
532 struct bt_ctf_field_type_common
*ft
);
535 int bt_ctf_field_type_common_variant_set_tag_name(
536 struct bt_ctf_field_type_common
*ft
, const char *name
);
539 int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common
*ft
,
540 struct bt_ctf_field_type_common
*field_type
,
541 const char *field_name
);
544 int bt_ctf_field_type_common_variant_update_choices(
545 struct bt_ctf_field_type_common
*ft
);
548 struct bt_ctf_field_type_common
*
549 bt_ctf_field_type_common_variant_borrow_field_type_by_name(
550 struct bt_ctf_field_type_common
*ft
,
551 const char *field_name
);
554 int64_t bt_ctf_field_type_common_variant_get_field_count(
555 struct bt_ctf_field_type_common
*ft
);
558 int bt_ctf_field_type_common_variant_borrow_field_by_index(
559 struct bt_ctf_field_type_common
*ft
,
560 const char **field_name
,
561 struct bt_ctf_field_type_common
**field_type
, uint64_t index
);
564 struct bt_ctf_field_type_common
*
565 bt_ctf_field_type_common_array_borrow_element_field_type(
566 struct bt_ctf_field_type_common
*ft
);
569 int bt_ctf_field_type_common_array_set_element_field_type(
570 struct bt_ctf_field_type_common
*ft
,
571 struct bt_ctf_field_type_common
*element_ft
);
574 int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common
*ft
);
577 struct bt_ctf_field_type_common
*
578 bt_ctf_field_type_common_sequence_borrow_element_field_type(
579 struct bt_ctf_field_type_common
*ft
);
582 int bt_ctf_field_type_common_sequence_set_element_field_type(
583 struct bt_ctf_field_type_common
*ft
,
584 struct bt_ctf_field_type_common
*element_ft
);
587 const char *bt_ctf_field_type_common_sequence_get_length_field_name(
588 struct bt_ctf_field_type_common
*ft
);
591 enum bt_ctf_string_encoding
bt_ctf_field_type_common_string_get_encoding(
592 struct bt_ctf_field_type_common
*ft
);
595 int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common
*ft
,
596 enum bt_ctf_string_encoding encoding
);
599 int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common
*type
);
602 int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common
*ft
,
603 unsigned int alignment
);
606 enum bt_ctf_byte_order
bt_ctf_field_type_common_get_byte_order(
607 struct bt_ctf_field_type_common
*ft
);
610 int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common
*ft
,
611 enum bt_ctf_byte_order byte_order
);
614 enum bt_ctf_field_type_id
bt_ctf_field_type_common_get_type_id(
615 struct bt_ctf_field_type_common
*ft
);
618 void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common
*ft
);
621 struct bt_ctf_field_type_common
*
622 bt_ctf_field_type_common_variant_borrow_field_type_signed(
623 struct bt_ctf_field_type_common_variant
*var_ft
,
627 struct bt_ctf_field_type_common
*
628 bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
629 struct bt_ctf_field_type_common_variant
*var_ft
,
633 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_copy(
634 struct bt_ctf_field_type_common
*ft
);
637 int bt_ctf_field_type_common_structure_get_field_name_index(
638 struct bt_ctf_field_type_common
*ft
, const char *name
);
641 int bt_ctf_field_type_common_variant_get_field_name_index(
642 struct bt_ctf_field_type_common
*ft
, const char *name
);
645 int bt_ctf_field_type_common_sequence_set_length_field_path(
646 struct bt_ctf_field_type_common
*ft
, struct bt_ctf_field_path
*path
);
649 int bt_ctf_field_type_common_variant_set_tag_field_path(
650 struct bt_ctf_field_type_common
*ft
,
651 struct bt_ctf_field_path
*path
);
654 int bt_ctf_field_type_common_variant_set_tag_field_type(
655 struct bt_ctf_field_type_common
*ft
,
656 struct bt_ctf_field_type_common
*tag_ft
);
659 void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common
*ft
);
662 void bt_ctf_field_type_common_enumeration_freeze_recursive(
663 struct bt_ctf_field_type_common
*ft
);
666 void bt_ctf_field_type_common_structure_freeze_recursive(
667 struct bt_ctf_field_type_common
*ft
);
670 void bt_ctf_field_type_common_variant_freeze_recursive(
671 struct bt_ctf_field_type_common
*ft
);
674 void bt_ctf_field_type_common_array_freeze_recursive(
675 struct bt_ctf_field_type_common
*ft
);
678 void bt_ctf_field_type_common_sequence_freeze_recursive(
679 struct bt_ctf_field_type_common
*type
);
682 void bt_ctf_field_type_common_integer_set_byte_order(
683 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
686 void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
687 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
690 void bt_ctf_field_type_common_floating_point_set_byte_order(
691 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
694 void bt_ctf_field_type_common_structure_set_byte_order_recursive(
695 struct bt_ctf_field_type_common
*ft
,
696 enum bt_ctf_byte_order byte_order
);
699 void bt_ctf_field_type_common_variant_set_byte_order_recursive(
700 struct bt_ctf_field_type_common
*ft
,
701 enum bt_ctf_byte_order byte_order
);
704 void bt_ctf_field_type_common_array_set_byte_order_recursive(
705 struct bt_ctf_field_type_common
*ft
,
706 enum bt_ctf_byte_order byte_order
);
709 void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
710 struct bt_ctf_field_type_common
*ft
,
711 enum bt_ctf_byte_order byte_order
);
714 int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common
*ft_a
,
715 struct bt_ctf_field_type_common
*ft_b
);
718 int bt_ctf_field_type_common_floating_point_compare(
719 struct bt_ctf_field_type_common
*ft_a
,
720 struct bt_ctf_field_type_common
*ft_b
);
723 int bt_ctf_field_type_common_enumeration_compare_recursive(
724 struct bt_ctf_field_type_common
*ft_a
,
725 struct bt_ctf_field_type_common
*ft_b
);
728 int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common
*ft_a
,
729 struct bt_ctf_field_type_common
*ft_b
);
732 int bt_ctf_field_type_common_structure_compare_recursive(
733 struct bt_ctf_field_type_common
*ft_a
,
734 struct bt_ctf_field_type_common
*ft_b
);
737 int bt_ctf_field_type_common_variant_compare_recursive(
738 struct bt_ctf_field_type_common
*ft_a
,
739 struct bt_ctf_field_type_common
*ft_b
);
742 int bt_ctf_field_type_common_array_compare_recursive(
743 struct bt_ctf_field_type_common
*ft_a
,
744 struct bt_ctf_field_type_common
*ft_b
);
747 int bt_ctf_field_type_common_sequence_compare_recursive(
748 struct bt_ctf_field_type_common
*ft_a
,
749 struct bt_ctf_field_type_common
*ft_b
);
752 int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common
*ft_a
,
753 struct bt_ctf_field_type_common
*ft_b
);
756 int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common
*ft
);
759 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_borrow_field_at_index(
760 struct bt_ctf_field_type_common
*ft
, int index
);
763 int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common
*ft
,
767 struct bt_ctf_field_path
*bt_ctf_field_type_common_variant_borrow_tag_field_path(
768 struct bt_ctf_field_type_common
*ft
);
771 struct bt_ctf_field_path
*bt_ctf_field_type_common_sequence_borrow_length_field_path(
772 struct bt_ctf_field_type_common
*ft
);
775 int bt_ctf_field_type_common_validate_single_clock_class(
776 struct bt_ctf_field_type_common
*ft
,
777 struct bt_ctf_clock_class
**expected_clock_class
);
780 int64_t bt_ctf_field_type_common_variant_find_choice_index(
781 struct bt_ctf_field_type_common
*ft
, uint64_t uval
,
785 int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type
*type
,
786 struct metadata_context
*context
);
789 struct bt_ctf_field_type
*bt_ctf_field_type_copy(struct bt_ctf_field_type
*ft
);
791 #endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */