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 (&bt_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 (&bt_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
*);
267 void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common
*ft
,
268 bool init_bo
, bt_ctf_object_release_func release_func
,
269 struct bt_ctf_field_type_common_methods
*methods
);
271 void bt_ctf_field_type_common_integer_initialize(
272 struct bt_ctf_field_type_common
*ft
,
273 unsigned int size
, bt_ctf_object_release_func release_func
,
274 struct bt_ctf_field_type_common_methods
*methods
);
276 void bt_ctf_field_type_common_floating_point_initialize(
277 struct bt_ctf_field_type_common
*ft
,
278 bt_ctf_object_release_func release_func
,
279 struct bt_ctf_field_type_common_methods
*methods
);
281 void bt_ctf_field_type_common_enumeration_initialize(
282 struct bt_ctf_field_type_common
*ft
,
283 struct bt_ctf_field_type_common
*container_ft
,
284 bt_ctf_object_release_func release_func
,
285 struct bt_ctf_field_type_common_methods
*methods
);
287 void bt_ctf_field_type_common_string_initialize(
288 struct bt_ctf_field_type_common
*ft
,
289 bt_ctf_object_release_func release_func
,
290 struct bt_ctf_field_type_common_methods
*methods
);
292 void bt_ctf_field_type_common_structure_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
);
297 void bt_ctf_field_type_common_array_initialize(
298 struct bt_ctf_field_type_common
*ft
,
299 struct bt_ctf_field_type_common
*element_ft
,
300 unsigned int length
, bt_ctf_object_release_func release_func
,
301 struct bt_ctf_field_type_common_methods
*methods
);
303 void bt_ctf_field_type_common_sequence_initialize(
304 struct bt_ctf_field_type_common
*ft
,
305 struct bt_ctf_field_type_common
*element_ft
,
306 const char *length_field_name
,
307 bt_ctf_object_release_func release_func
,
308 struct bt_ctf_field_type_common_methods
*methods
);
310 void bt_ctf_field_type_common_variant_initialize(
311 struct bt_ctf_field_type_common
*ft
,
312 struct bt_ctf_field_type_common
*tag_ft
,
313 const char *tag_name
,
314 bt_ctf_object_release_func release_func
,
315 struct bt_ctf_field_type_common_methods
*methods
);
317 void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object
*obj
);
319 void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object
*obj
);
321 void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object
*obj
);
323 void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object
*obj
);
325 void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object
*obj
);
327 void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object
*obj
);
329 void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object
*obj
);
331 void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object
*obj
);
333 int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common
*ft
);
335 int bt_ctf_field_type_common_enumeration_validate_recursive(
336 struct bt_ctf_field_type_common
*ft
);
338 int bt_ctf_field_type_common_sequence_validate_recursive(
339 struct bt_ctf_field_type_common
*ft
);
341 int bt_ctf_field_type_common_array_validate_recursive(
342 struct bt_ctf_field_type_common
*ft
);
344 int bt_ctf_field_type_common_structure_validate_recursive(
345 struct bt_ctf_field_type_common
*ft
);
347 int bt_ctf_field_type_common_variant_validate_recursive(
348 struct bt_ctf_field_type_common
*type
);
350 int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common
*ft
);
352 int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common
*ft
);
354 bt_ctf_bool
bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common
*ft
);
356 int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common
*ft
,
357 bt_ctf_bool is_signed
);
359 int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common
*ft
,
362 enum bt_ctf_integer_base
bt_ctf_field_type_common_integer_get_base(
363 struct bt_ctf_field_type_common
*ft
);
365 int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common
*ft
,
366 enum bt_ctf_integer_base base
);
368 enum bt_ctf_string_encoding
bt_ctf_field_type_common_integer_get_encoding(
369 struct bt_ctf_field_type_common
*ft
);
371 int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common
*ft
,
372 enum bt_ctf_string_encoding encoding
);
374 struct bt_ctf_clock_class
*bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
375 struct bt_ctf_field_type_common
*ft
);
377 int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
378 struct bt_ctf_field_type_common
*ft
,
379 struct bt_ctf_clock_class
*clock_class
);
381 int bt_ctf_field_type_common_integer_set_mapped_clock_class(
382 struct bt_ctf_field_type_common
*ft
,
383 struct bt_ctf_clock_class
*clock_class
);
385 struct bt_ctf_field_type_enumeration_mapping_iterator
*
386 bt_ctf_field_type_common_enumeration_find_mappings_by_name(
387 struct bt_ctf_field_type_common
*ft
, const char *name
);
389 struct bt_ctf_field_type_enumeration_mapping_iterator
*
390 bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
391 struct bt_ctf_field_type_common
*ft
, int64_t value
);
393 struct bt_ctf_field_type_enumeration_mapping_iterator
*
394 bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
395 struct bt_ctf_field_type_common
*ft
, uint64_t value
);
397 int bt_ctf_field_type_enumeration_mapping_iterator_next(
398 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
);
400 int bt_ctf_field_type_enumeration_mapping_iterator_signed_get(
401 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
,
402 const char **mapping_name
, int64_t *range_begin
,
405 int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get(
406 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
,
407 const char **mapping_name
, uint64_t *range_begin
,
408 uint64_t *range_end
);
410 int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
411 struct bt_ctf_field_type_common
*ft
, uint64_t index
,
412 const char **mapping_name
, int64_t *range_begin
,
415 int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
416 struct bt_ctf_field_type_common
*ft
, uint64_t index
,
417 const char **mapping_name
, uint64_t *range_begin
,
418 uint64_t *range_end
);
420 struct bt_ctf_field_type_common
*
421 bt_ctf_field_type_common_enumeration_borrow_container_field_type(
422 struct bt_ctf_field_type_common
*ft
);
424 int bt_ctf_field_type_common_enumeration_signed_add_mapping(
425 struct bt_ctf_field_type_common
*ft
, const char *string
,
426 int64_t range_start
, int64_t range_end
);
428 int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
429 struct bt_ctf_field_type_common
*ft
, const char *string
,
430 uint64_t range_start
, uint64_t range_end
);
432 int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
433 struct bt_ctf_field_type_common
*ft
);
435 int bt_ctf_field_type_common_floating_point_get_exponent_digits(
436 struct bt_ctf_field_type_common
*ft
);
438 int bt_ctf_field_type_common_floating_point_set_exponent_digits(
439 struct bt_ctf_field_type_common
*ft
,
440 unsigned int exponent_digits
);
442 int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
443 struct bt_ctf_field_type_common
*type
);
445 int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
446 struct bt_ctf_field_type_common
*ft
, unsigned int mantissa_digits
);
448 int bt_ctf_field_type_common_structure_replace_field(
449 struct bt_ctf_field_type_common
*ft
,
450 const char *field_name
,
451 struct bt_ctf_field_type_common
*field_type
);
453 int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common
*ft
,
454 struct bt_ctf_field_type_common
*field_type
,
455 const char *field_name
);
457 int64_t bt_ctf_field_type_common_structure_get_field_count(
458 struct bt_ctf_field_type_common
*ft
);
460 int bt_ctf_field_type_common_structure_borrow_field_by_index(
461 struct bt_ctf_field_type_common
*ft
,
462 const char **field_name
,
463 struct bt_ctf_field_type_common
**field_type
, uint64_t index
);
465 struct bt_ctf_field_type_common
*
466 bt_ctf_field_type_common_structure_borrow_field_type_by_name(
467 struct bt_ctf_field_type_common
*ft
, const char *name
);
469 struct bt_ctf_field_type_common
*
470 bt_ctf_field_type_common_variant_borrow_tag_field_type(
471 struct bt_ctf_field_type_common
*ft
);
473 const char *bt_ctf_field_type_common_variant_get_tag_name(
474 struct bt_ctf_field_type_common
*ft
);
476 int bt_ctf_field_type_common_variant_set_tag_name(
477 struct bt_ctf_field_type_common
*ft
, const char *name
);
479 int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common
*ft
,
480 struct bt_ctf_field_type_common
*field_type
,
481 const char *field_name
);
483 int bt_ctf_field_type_common_variant_update_choices(
484 struct bt_ctf_field_type_common
*ft
);
486 struct bt_ctf_field_type_common
*
487 bt_ctf_field_type_common_variant_borrow_field_type_by_name(
488 struct bt_ctf_field_type_common
*ft
,
489 const char *field_name
);
491 int64_t bt_ctf_field_type_common_variant_get_field_count(
492 struct bt_ctf_field_type_common
*ft
);
494 int bt_ctf_field_type_common_variant_borrow_field_by_index(
495 struct bt_ctf_field_type_common
*ft
,
496 const char **field_name
,
497 struct bt_ctf_field_type_common
**field_type
, uint64_t index
);
499 struct bt_ctf_field_type_common
*
500 bt_ctf_field_type_common_array_borrow_element_field_type(
501 struct bt_ctf_field_type_common
*ft
);
503 int bt_ctf_field_type_common_array_set_element_field_type(
504 struct bt_ctf_field_type_common
*ft
,
505 struct bt_ctf_field_type_common
*element_ft
);
507 int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common
*ft
);
509 struct bt_ctf_field_type_common
*
510 bt_ctf_field_type_common_sequence_borrow_element_field_type(
511 struct bt_ctf_field_type_common
*ft
);
513 int bt_ctf_field_type_common_sequence_set_element_field_type(
514 struct bt_ctf_field_type_common
*ft
,
515 struct bt_ctf_field_type_common
*element_ft
);
517 const char *bt_ctf_field_type_common_sequence_get_length_field_name(
518 struct bt_ctf_field_type_common
*ft
);
520 enum bt_ctf_string_encoding
bt_ctf_field_type_common_string_get_encoding(
521 struct bt_ctf_field_type_common
*ft
);
523 int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common
*ft
,
524 enum bt_ctf_string_encoding encoding
);
526 int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common
*type
);
528 int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common
*ft
,
529 unsigned int alignment
);
531 enum bt_ctf_byte_order
bt_ctf_field_type_common_get_byte_order(
532 struct bt_ctf_field_type_common
*ft
);
534 int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common
*ft
,
535 enum bt_ctf_byte_order byte_order
);
537 enum bt_ctf_field_type_id
bt_ctf_field_type_common_get_type_id(
538 struct bt_ctf_field_type_common
*ft
);
540 void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common
*ft
);
542 struct bt_ctf_field_type_common
*
543 bt_ctf_field_type_common_variant_borrow_field_type_signed(
544 struct bt_ctf_field_type_common_variant
*var_ft
,
547 struct bt_ctf_field_type_common
*
548 bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
549 struct bt_ctf_field_type_common_variant
*var_ft
,
552 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_copy(
553 struct bt_ctf_field_type_common
*ft
);
555 int bt_ctf_field_type_common_structure_get_field_name_index(
556 struct bt_ctf_field_type_common
*ft
, const char *name
);
558 int bt_ctf_field_type_common_variant_get_field_name_index(
559 struct bt_ctf_field_type_common
*ft
, const char *name
);
561 int bt_ctf_field_type_common_sequence_set_length_field_path(
562 struct bt_ctf_field_type_common
*ft
, struct bt_ctf_field_path
*path
);
564 int bt_ctf_field_type_common_variant_set_tag_field_path(
565 struct bt_ctf_field_type_common
*ft
,
566 struct bt_ctf_field_path
*path
);
568 int bt_ctf_field_type_common_variant_set_tag_field_type(
569 struct bt_ctf_field_type_common
*ft
,
570 struct bt_ctf_field_type_common
*tag_ft
);
572 void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common
*ft
);
574 void bt_ctf_field_type_common_enumeration_freeze_recursive(
575 struct bt_ctf_field_type_common
*ft
);
577 void bt_ctf_field_type_common_structure_freeze_recursive(
578 struct bt_ctf_field_type_common
*ft
);
580 void bt_ctf_field_type_common_variant_freeze_recursive(
581 struct bt_ctf_field_type_common
*ft
);
583 void bt_ctf_field_type_common_array_freeze_recursive(
584 struct bt_ctf_field_type_common
*ft
);
586 void bt_ctf_field_type_common_sequence_freeze_recursive(
587 struct bt_ctf_field_type_common
*type
);
589 void bt_ctf_field_type_common_integer_set_byte_order(
590 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
592 void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
593 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
595 void bt_ctf_field_type_common_floating_point_set_byte_order(
596 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
598 void bt_ctf_field_type_common_structure_set_byte_order_recursive(
599 struct bt_ctf_field_type_common
*ft
,
600 enum bt_ctf_byte_order byte_order
);
602 void bt_ctf_field_type_common_variant_set_byte_order_recursive(
603 struct bt_ctf_field_type_common
*ft
,
604 enum bt_ctf_byte_order byte_order
);
606 void bt_ctf_field_type_common_array_set_byte_order_recursive(
607 struct bt_ctf_field_type_common
*ft
,
608 enum bt_ctf_byte_order byte_order
);
610 void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
611 struct bt_ctf_field_type_common
*ft
,
612 enum bt_ctf_byte_order byte_order
);
614 int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common
*ft_a
,
615 struct bt_ctf_field_type_common
*ft_b
);
617 int bt_ctf_field_type_common_floating_point_compare(
618 struct bt_ctf_field_type_common
*ft_a
,
619 struct bt_ctf_field_type_common
*ft_b
);
621 int bt_ctf_field_type_common_enumeration_compare_recursive(
622 struct bt_ctf_field_type_common
*ft_a
,
623 struct bt_ctf_field_type_common
*ft_b
);
625 int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common
*ft_a
,
626 struct bt_ctf_field_type_common
*ft_b
);
628 int bt_ctf_field_type_common_structure_compare_recursive(
629 struct bt_ctf_field_type_common
*ft_a
,
630 struct bt_ctf_field_type_common
*ft_b
);
632 int bt_ctf_field_type_common_variant_compare_recursive(
633 struct bt_ctf_field_type_common
*ft_a
,
634 struct bt_ctf_field_type_common
*ft_b
);
636 int bt_ctf_field_type_common_array_compare_recursive(
637 struct bt_ctf_field_type_common
*ft_a
,
638 struct bt_ctf_field_type_common
*ft_b
);
640 int bt_ctf_field_type_common_sequence_compare_recursive(
641 struct bt_ctf_field_type_common
*ft_a
,
642 struct bt_ctf_field_type_common
*ft_b
);
644 int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common
*ft_a
,
645 struct bt_ctf_field_type_common
*ft_b
);
647 int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common
*ft
);
649 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_borrow_field_at_index(
650 struct bt_ctf_field_type_common
*ft
, int index
);
652 int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common
*ft
,
655 struct bt_ctf_field_path
*bt_ctf_field_type_common_variant_borrow_tag_field_path(
656 struct bt_ctf_field_type_common
*ft
);
658 struct bt_ctf_field_path
*bt_ctf_field_type_common_sequence_borrow_length_field_path(
659 struct bt_ctf_field_type_common
*ft
);
661 int bt_ctf_field_type_common_validate_single_clock_class(
662 struct bt_ctf_field_type_common
*ft
,
663 struct bt_ctf_clock_class
**expected_clock_class
);
665 int64_t bt_ctf_field_type_common_variant_find_choice_index(
666 struct bt_ctf_field_type_common
*ft
, uint64_t uval
,
669 int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type
*type
,
670 struct metadata_context
*context
);
672 struct bt_ctf_field_type
*bt_ctf_field_type_copy(struct bt_ctf_field_type
*ft
);
674 #endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */