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 <babeltrace2/ctf-writer/field-types.h>
35 #include <babeltrace2/ctf-writer/types.h>
37 #include "common/macros.h"
39 #include "assert-pre.h"
40 #include "clock-class.h"
44 #define BT_CTF_ASSERT_PRE_CTF_FT_COMMON_HAS_ID(_ft, _type_id, _name) \
45 BT_CTF_ASSERT_PRE(((struct bt_ctf_field_type_common *) (_ft))->id == (_type_id), \
46 _name " has the wrong type ID: expected-type-id=%s, " \
47 "ft-addr=%p", bt_ctf_field_type_id_string(_type_id), (_ft))
49 #define BT_CTF_ASSERT_PRE_CTF_FT_HOT(_ft, _name) \
50 BT_CTF_ASSERT_PRE_HOT((_ft), (_name), ": ft-addr=%p", (_ft))
52 #define BT_CTF_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(_ft, _index) \
53 (&g_array_index(((struct bt_ctf_field_type_common_structure *) (_ft))->fields, \
54 struct bt_ctf_field_type_common_structure_field, (_index)))
56 #define BT_CTF_FIELD_TYPE_COMMON_VARIANT_CHOICE_AT_INDEX(_ft, _index) \
57 (&g_array_index(((struct bt_ctf_field_type_common_variant *) (_ft))->choices, \
58 struct bt_ctf_field_type_common_variant_choice, (_index)))
60 struct bt_ctf_field_common
;
61 struct bt_ctf_field_type_common
;
63 typedef void (*bt_ctf_field_type_common_method_freeze
)(
64 struct bt_ctf_field_type_common
*);
65 typedef int (*bt_ctf_field_type_common_method_validate
)(
66 struct bt_ctf_field_type_common
*);
67 typedef void (*bt_ctf_field_type_common_method_set_byte_order
)(
68 struct bt_ctf_field_type_common
*, enum bt_ctf_byte_order
);
69 typedef struct bt_ctf_field_type_common
*(*bt_ctf_field_type_common_method_copy
)(
70 struct bt_ctf_field_type_common
*);
71 typedef int (*bt_ctf_field_type_common_method_compare
)(
72 struct bt_ctf_field_type_common
*,
73 struct bt_ctf_field_type_common
*);
75 struct bt_ctf_field_type_common_methods
{
76 bt_ctf_field_type_common_method_freeze freeze
;
77 bt_ctf_field_type_common_method_validate validate
;
78 bt_ctf_field_type_common_method_set_byte_order set_byte_order
;
79 bt_ctf_field_type_common_method_copy copy
;
80 bt_ctf_field_type_common_method_compare compare
;
83 struct bt_ctf_field_type_common
{
84 struct bt_ctf_object base
;
85 enum bt_ctf_field_type_id id
;
86 unsigned int alignment
;
89 struct bt_ctf_field_type_common_methods
*methods
;
92 * A type can't be modified once it is added to an event or after a
93 * a field has been instanciated from it.
98 * This flag indicates if the field type is valid. A valid
99 * field type is _always_ frozen. All the nested field types of
100 * a valid field type are also valid (and thus frozen).
105 * Specialized data for either CTF IR or CTF writer APIs.
106 * Having this here ensures that:
108 * * The type-specific common data is always found at the same
109 * offset when the common API has a `struct
110 * bt_ctf_field_type_common *` so that you can cast it to `struct
111 * bt_ctf_field_type_common_integer *` for example and access the
112 * common integer field type fields.
114 * * The specific CTF IR and CTF writer APIs can access their
115 * specific field type fields in this union at an offset known
116 * at build time. This avoids a pointer to specific data so
117 * that all the fields, common or specific, of a CTF IR
118 * integer field type or of a CTF writer integer field type,
119 * for example, are contained within the same contiguous block
126 void *serialize_func
;
131 struct bt_ctf_field_type_common_integer
{
132 struct bt_ctf_field_type_common common
;
135 struct bt_ctf_clock_class
*mapped_clock_class
;
137 enum bt_ctf_byte_order user_byte_order
;
138 bt_ctf_bool is_signed
;
140 enum bt_ctf_integer_base base
;
141 enum bt_ctf_string_encoding encoding
;
144 struct bt_ctf_enumeration_mapping
{
156 struct bt_ctf_field_type_common_enumeration
{
157 struct bt_ctf_field_type_common common
;
160 struct bt_ctf_field_type_common_integer
*container_ft
;
162 /* Array of `struct bt_ctf_enumeration_mapping *`, owned by this */
165 /* Only set during validation */
166 bt_ctf_bool has_overlapping_ranges
;
169 enum bt_ctf_field_type_enumeration_mapping_iterator_type
{
170 CTF_ITERATOR_BY_NAME
,
171 CTF_ITERATOR_BY_SIGNED_VALUE
,
172 CTF_ITERATOR_BY_UNSIGNED_VALUE
,
175 struct bt_ctf_field_type_enumeration_mapping_iterator
{
176 struct bt_ctf_object base
;
179 struct bt_ctf_field_type_common_enumeration
*enumeration_ft
;
181 enum bt_ctf_field_type_enumeration_mapping_iterator_type type
;
185 int64_t signed_value
;
186 uint64_t unsigned_value
;
190 struct bt_ctf_field_type_common_floating_point
{
191 struct bt_ctf_field_type_common common
;
192 enum bt_ctf_byte_order user_byte_order
;
193 unsigned int exp_dig
;
194 unsigned int mant_dig
;
197 struct bt_ctf_field_type_common_structure_field
{
201 struct bt_ctf_field_type_common
*type
;
204 struct bt_ctf_field_type_common_structure
{
205 struct bt_ctf_field_type_common common
;
206 GHashTable
*field_name_to_index
;
209 * Array of `struct bt_ctf_field_type_common_structure_field`,
215 struct bt_ctf_field_type_common_variant_choice_range
{
226 struct bt_ctf_field_type_common_variant_choice
{
230 struct bt_ctf_field_type_common
*type
;
232 /* Array of `struct bt_ctf_field_type_common_variant_choice_range` */
236 struct bt_ctf_field_type_common_variant
{
237 struct bt_ctf_field_type_common common
;
239 bool choices_up_to_date
;
242 struct bt_ctf_field_type_common_enumeration
*tag_ft
;
245 struct bt_ctf_field_path
*tag_field_path
;
247 GHashTable
*choice_name_to_index
;
250 * Array of `struct bt_ctf_field_type_common_variant_choice`,
255 struct bt_ctf_field_type_common_array
{
256 struct bt_ctf_field_type_common common
;
259 struct bt_ctf_field_type_common
*element_ft
;
264 struct bt_ctf_field_type_common_sequence
{
265 struct bt_ctf_field_type_common common
;
268 struct bt_ctf_field_type_common
*element_ft
;
270 GString
*length_field_name
;
273 struct bt_ctf_field_path
*length_field_path
;
276 struct bt_ctf_field_type_common_string
{
277 struct bt_ctf_field_type_common common
;
278 enum bt_ctf_string_encoding encoding
;
281 typedef struct bt_ctf_field_common
*(* bt_ctf_field_common_create_func
)(
282 struct bt_ctf_field_type_common
*);
285 void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common
*ft
,
286 bool init_bo
, bt_ctf_object_release_func release_func
,
287 struct bt_ctf_field_type_common_methods
*methods
);
290 void bt_ctf_field_type_common_integer_initialize(
291 struct bt_ctf_field_type_common
*ft
,
292 unsigned int size
, bt_ctf_object_release_func release_func
,
293 struct bt_ctf_field_type_common_methods
*methods
);
296 void bt_ctf_field_type_common_floating_point_initialize(
297 struct bt_ctf_field_type_common
*ft
,
298 bt_ctf_object_release_func release_func
,
299 struct bt_ctf_field_type_common_methods
*methods
);
302 void bt_ctf_field_type_common_enumeration_initialize(
303 struct bt_ctf_field_type_common
*ft
,
304 struct bt_ctf_field_type_common
*container_ft
,
305 bt_ctf_object_release_func release_func
,
306 struct bt_ctf_field_type_common_methods
*methods
);
309 void bt_ctf_field_type_common_string_initialize(
310 struct bt_ctf_field_type_common
*ft
,
311 bt_ctf_object_release_func release_func
,
312 struct bt_ctf_field_type_common_methods
*methods
);
315 void bt_ctf_field_type_common_structure_initialize(
316 struct bt_ctf_field_type_common
*ft
,
317 bt_ctf_object_release_func release_func
,
318 struct bt_ctf_field_type_common_methods
*methods
);
321 void bt_ctf_field_type_common_array_initialize(
322 struct bt_ctf_field_type_common
*ft
,
323 struct bt_ctf_field_type_common
*element_ft
,
324 unsigned int length
, bt_ctf_object_release_func release_func
,
325 struct bt_ctf_field_type_common_methods
*methods
);
328 void bt_ctf_field_type_common_sequence_initialize(
329 struct bt_ctf_field_type_common
*ft
,
330 struct bt_ctf_field_type_common
*element_ft
,
331 const char *length_field_name
,
332 bt_ctf_object_release_func release_func
,
333 struct bt_ctf_field_type_common_methods
*methods
);
336 void bt_ctf_field_type_common_variant_initialize(
337 struct bt_ctf_field_type_common
*ft
,
338 struct bt_ctf_field_type_common
*tag_ft
,
339 const char *tag_name
,
340 bt_ctf_object_release_func release_func
,
341 struct bt_ctf_field_type_common_methods
*methods
);
344 void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object
*obj
);
347 void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object
*obj
);
350 void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object
*obj
);
353 void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object
*obj
);
356 void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object
*obj
);
359 void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object
*obj
);
362 void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object
*obj
);
365 void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object
*obj
);
368 int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common
*ft
);
371 int bt_ctf_field_type_common_enumeration_validate_recursive(
372 struct bt_ctf_field_type_common
*ft
);
375 int bt_ctf_field_type_common_sequence_validate_recursive(
376 struct bt_ctf_field_type_common
*ft
);
379 int bt_ctf_field_type_common_array_validate_recursive(
380 struct bt_ctf_field_type_common
*ft
);
383 int bt_ctf_field_type_common_structure_validate_recursive(
384 struct bt_ctf_field_type_common
*ft
);
387 int bt_ctf_field_type_common_variant_validate_recursive(
388 struct bt_ctf_field_type_common
*type
);
391 int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common
*ft
);
394 int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common
*ft
);
397 bt_ctf_bool
bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common
*ft
);
400 int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common
*ft
,
401 bt_ctf_bool is_signed
);
404 int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common
*ft
,
408 enum bt_ctf_integer_base
bt_ctf_field_type_common_integer_get_base(
409 struct bt_ctf_field_type_common
*ft
);
412 int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common
*ft
,
413 enum bt_ctf_integer_base base
);
416 enum bt_ctf_string_encoding
bt_ctf_field_type_common_integer_get_encoding(
417 struct bt_ctf_field_type_common
*ft
);
420 int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common
*ft
,
421 enum bt_ctf_string_encoding encoding
);
424 struct bt_ctf_clock_class
*bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
425 struct bt_ctf_field_type_common
*ft
);
428 int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
429 struct bt_ctf_field_type_common
*ft
,
430 struct bt_ctf_clock_class
*clock_class
);
433 int bt_ctf_field_type_common_integer_set_mapped_clock_class(
434 struct bt_ctf_field_type_common
*ft
,
435 struct bt_ctf_clock_class
*clock_class
);
438 struct bt_ctf_field_type_enumeration_mapping_iterator
*
439 bt_ctf_field_type_common_enumeration_find_mappings_by_name(
440 struct bt_ctf_field_type_common
*ft
, const char *name
);
443 struct bt_ctf_field_type_enumeration_mapping_iterator
*
444 bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
445 struct bt_ctf_field_type_common
*ft
, int64_t value
);
448 struct bt_ctf_field_type_enumeration_mapping_iterator
*
449 bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
450 struct bt_ctf_field_type_common
*ft
, uint64_t value
);
453 int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
454 struct bt_ctf_field_type_common
*ft
, uint64_t index
,
455 const char **mapping_name
, int64_t *range_begin
,
459 int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
460 struct bt_ctf_field_type_common
*ft
, uint64_t index
,
461 const char **mapping_name
, uint64_t *range_begin
,
462 uint64_t *range_end
);
465 struct bt_ctf_field_type_common
*
466 bt_ctf_field_type_common_enumeration_borrow_container_field_type(
467 struct bt_ctf_field_type_common
*ft
);
470 int bt_ctf_field_type_common_enumeration_signed_add_mapping(
471 struct bt_ctf_field_type_common
*ft
, const char *string
,
472 int64_t range_start
, int64_t range_end
);
475 int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
476 struct bt_ctf_field_type_common
*ft
, const char *string
,
477 uint64_t range_start
, uint64_t range_end
);
480 int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
481 struct bt_ctf_field_type_common
*ft
);
484 int bt_ctf_field_type_common_floating_point_get_exponent_digits(
485 struct bt_ctf_field_type_common
*ft
);
488 int bt_ctf_field_type_common_floating_point_set_exponent_digits(
489 struct bt_ctf_field_type_common
*ft
,
490 unsigned int exponent_digits
);
493 int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
494 struct bt_ctf_field_type_common
*type
);
497 int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
498 struct bt_ctf_field_type_common
*ft
, unsigned int mantissa_digits
);
501 int bt_ctf_field_type_common_structure_replace_field(
502 struct bt_ctf_field_type_common
*ft
,
503 const char *field_name
,
504 struct bt_ctf_field_type_common
*field_type
);
507 int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common
*ft
,
508 struct bt_ctf_field_type_common
*field_type
,
509 const char *field_name
);
512 int64_t bt_ctf_field_type_common_structure_get_field_count(
513 struct bt_ctf_field_type_common
*ft
);
516 int bt_ctf_field_type_common_structure_borrow_field_by_index(
517 struct bt_ctf_field_type_common
*ft
,
518 const char **field_name
,
519 struct bt_ctf_field_type_common
**field_type
, uint64_t index
);
522 struct bt_ctf_field_type_common
*
523 bt_ctf_field_type_common_structure_borrow_field_type_by_name(
524 struct bt_ctf_field_type_common
*ft
, const char *name
);
527 struct bt_ctf_field_type_common
*
528 bt_ctf_field_type_common_variant_borrow_tag_field_type(
529 struct bt_ctf_field_type_common
*ft
);
532 const char *bt_ctf_field_type_common_variant_get_tag_name(
533 struct bt_ctf_field_type_common
*ft
);
536 int bt_ctf_field_type_common_variant_set_tag_name(
537 struct bt_ctf_field_type_common
*ft
, const char *name
);
540 int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common
*ft
,
541 struct bt_ctf_field_type_common
*field_type
,
542 const char *field_name
);
545 int bt_ctf_field_type_common_variant_update_choices(
546 struct bt_ctf_field_type_common
*ft
);
549 struct bt_ctf_field_type_common
*
550 bt_ctf_field_type_common_variant_borrow_field_type_by_name(
551 struct bt_ctf_field_type_common
*ft
,
552 const char *field_name
);
555 int64_t bt_ctf_field_type_common_variant_get_field_count(
556 struct bt_ctf_field_type_common
*ft
);
559 int bt_ctf_field_type_common_variant_borrow_field_by_index(
560 struct bt_ctf_field_type_common
*ft
,
561 const char **field_name
,
562 struct bt_ctf_field_type_common
**field_type
, uint64_t index
);
565 struct bt_ctf_field_type_common
*
566 bt_ctf_field_type_common_array_borrow_element_field_type(
567 struct bt_ctf_field_type_common
*ft
);
570 int bt_ctf_field_type_common_array_set_element_field_type(
571 struct bt_ctf_field_type_common
*ft
,
572 struct bt_ctf_field_type_common
*element_ft
);
575 int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common
*ft
);
578 struct bt_ctf_field_type_common
*
579 bt_ctf_field_type_common_sequence_borrow_element_field_type(
580 struct bt_ctf_field_type_common
*ft
);
583 int bt_ctf_field_type_common_sequence_set_element_field_type(
584 struct bt_ctf_field_type_common
*ft
,
585 struct bt_ctf_field_type_common
*element_ft
);
588 const char *bt_ctf_field_type_common_sequence_get_length_field_name(
589 struct bt_ctf_field_type_common
*ft
);
592 enum bt_ctf_string_encoding
bt_ctf_field_type_common_string_get_encoding(
593 struct bt_ctf_field_type_common
*ft
);
596 int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common
*ft
,
597 enum bt_ctf_string_encoding encoding
);
600 int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common
*type
);
603 int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common
*ft
,
604 unsigned int alignment
);
607 enum bt_ctf_byte_order
bt_ctf_field_type_common_get_byte_order(
608 struct bt_ctf_field_type_common
*ft
);
611 int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common
*ft
,
612 enum bt_ctf_byte_order byte_order
);
615 enum bt_ctf_field_type_id
bt_ctf_field_type_common_get_type_id(
616 struct bt_ctf_field_type_common
*ft
);
619 void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common
*ft
);
622 struct bt_ctf_field_type_common
*
623 bt_ctf_field_type_common_variant_borrow_field_type_signed(
624 struct bt_ctf_field_type_common_variant
*var_ft
,
628 struct bt_ctf_field_type_common
*
629 bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
630 struct bt_ctf_field_type_common_variant
*var_ft
,
634 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_copy(
635 struct bt_ctf_field_type_common
*ft
);
638 int bt_ctf_field_type_common_structure_get_field_name_index(
639 struct bt_ctf_field_type_common
*ft
, const char *name
);
642 int bt_ctf_field_type_common_variant_get_field_name_index(
643 struct bt_ctf_field_type_common
*ft
, const char *name
);
646 int bt_ctf_field_type_common_sequence_set_length_field_path(
647 struct bt_ctf_field_type_common
*ft
, struct bt_ctf_field_path
*path
);
650 int bt_ctf_field_type_common_variant_set_tag_field_path(
651 struct bt_ctf_field_type_common
*ft
,
652 struct bt_ctf_field_path
*path
);
655 int bt_ctf_field_type_common_variant_set_tag_field_type(
656 struct bt_ctf_field_type_common
*ft
,
657 struct bt_ctf_field_type_common
*tag_ft
);
660 void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common
*ft
);
663 void bt_ctf_field_type_common_enumeration_freeze_recursive(
664 struct bt_ctf_field_type_common
*ft
);
667 void bt_ctf_field_type_common_structure_freeze_recursive(
668 struct bt_ctf_field_type_common
*ft
);
671 void bt_ctf_field_type_common_variant_freeze_recursive(
672 struct bt_ctf_field_type_common
*ft
);
675 void bt_ctf_field_type_common_array_freeze_recursive(
676 struct bt_ctf_field_type_common
*ft
);
679 void bt_ctf_field_type_common_sequence_freeze_recursive(
680 struct bt_ctf_field_type_common
*type
);
683 void bt_ctf_field_type_common_integer_set_byte_order(
684 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
687 void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
688 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
691 void bt_ctf_field_type_common_floating_point_set_byte_order(
692 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
695 void bt_ctf_field_type_common_structure_set_byte_order_recursive(
696 struct bt_ctf_field_type_common
*ft
,
697 enum bt_ctf_byte_order byte_order
);
700 void bt_ctf_field_type_common_variant_set_byte_order_recursive(
701 struct bt_ctf_field_type_common
*ft
,
702 enum bt_ctf_byte_order byte_order
);
705 void bt_ctf_field_type_common_array_set_byte_order_recursive(
706 struct bt_ctf_field_type_common
*ft
,
707 enum bt_ctf_byte_order byte_order
);
710 void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
711 struct bt_ctf_field_type_common
*ft
,
712 enum bt_ctf_byte_order byte_order
);
715 int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common
*ft_a
,
716 struct bt_ctf_field_type_common
*ft_b
);
719 int bt_ctf_field_type_common_floating_point_compare(
720 struct bt_ctf_field_type_common
*ft_a
,
721 struct bt_ctf_field_type_common
*ft_b
);
724 int bt_ctf_field_type_common_enumeration_compare_recursive(
725 struct bt_ctf_field_type_common
*ft_a
,
726 struct bt_ctf_field_type_common
*ft_b
);
729 int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common
*ft_a
,
730 struct bt_ctf_field_type_common
*ft_b
);
733 int bt_ctf_field_type_common_structure_compare_recursive(
734 struct bt_ctf_field_type_common
*ft_a
,
735 struct bt_ctf_field_type_common
*ft_b
);
738 int bt_ctf_field_type_common_variant_compare_recursive(
739 struct bt_ctf_field_type_common
*ft_a
,
740 struct bt_ctf_field_type_common
*ft_b
);
743 int bt_ctf_field_type_common_array_compare_recursive(
744 struct bt_ctf_field_type_common
*ft_a
,
745 struct bt_ctf_field_type_common
*ft_b
);
748 int bt_ctf_field_type_common_sequence_compare_recursive(
749 struct bt_ctf_field_type_common
*ft_a
,
750 struct bt_ctf_field_type_common
*ft_b
);
753 int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common
*ft_a
,
754 struct bt_ctf_field_type_common
*ft_b
);
757 int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common
*ft
);
760 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_borrow_field_at_index(
761 struct bt_ctf_field_type_common
*ft
, int index
);
764 int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common
*ft
,
768 struct bt_ctf_field_path
*bt_ctf_field_type_common_variant_borrow_tag_field_path(
769 struct bt_ctf_field_type_common
*ft
);
772 struct bt_ctf_field_path
*bt_ctf_field_type_common_sequence_borrow_length_field_path(
773 struct bt_ctf_field_type_common
*ft
);
776 int bt_ctf_field_type_common_validate_single_clock_class(
777 struct bt_ctf_field_type_common
*ft
,
778 struct bt_ctf_clock_class
**expected_clock_class
);
781 int64_t bt_ctf_field_type_common_variant_find_choice_index(
782 struct bt_ctf_field_type_common
*ft
, uint64_t uval
,
786 int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type
*type
,
787 struct metadata_context
*context
);
790 struct bt_ctf_field_type
*bt_ctf_field_type_copy(struct bt_ctf_field_type
*ft
);
792 #endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */