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
35 #include <babeltrace2-ctf-writer/field-types.h>
36 #include <babeltrace2-ctf-writer/types.h>
38 #include "common/macros.h"
40 #include "assert-pre.h"
41 #include "clock-class.h"
45 #define BT_CTF_ASSERT_PRE_CTF_FT_COMMON_HAS_ID(_ft, _type_id, _name) \
46 BT_CTF_ASSERT_PRE(((struct bt_ctf_field_type_common *) (_ft))->id == (_type_id), \
47 _name " has the wrong type ID: expected-type-id=%s, " \
48 "ft-addr=%p", bt_ctf_field_type_id_string(_type_id), (_ft))
50 #define BT_CTF_ASSERT_PRE_CTF_FT_HOT(_ft, _name) \
51 BT_CTF_ASSERT_PRE_HOT((_ft), (_name), ": ft-addr=%p", (_ft))
53 #define BT_CTF_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(_ft, _index) \
54 (&g_array_index(((struct bt_ctf_field_type_common_structure *) (_ft))->fields, \
55 struct bt_ctf_field_type_common_structure_field, (_index)))
57 #define BT_CTF_FIELD_TYPE_COMMON_VARIANT_CHOICE_AT_INDEX(_ft, _index) \
58 (&g_array_index(((struct bt_ctf_field_type_common_variant *) (_ft))->choices, \
59 struct bt_ctf_field_type_common_variant_choice, (_index)))
61 struct bt_ctf_field_common
;
62 struct bt_ctf_field_type_common
;
64 typedef void (*bt_ctf_field_type_common_method_freeze
)(
65 struct bt_ctf_field_type_common
*);
66 typedef int (*bt_ctf_field_type_common_method_validate
)(
67 struct bt_ctf_field_type_common
*);
68 typedef void (*bt_ctf_field_type_common_method_set_byte_order
)(
69 struct bt_ctf_field_type_common
*, enum bt_ctf_byte_order
);
70 typedef struct bt_ctf_field_type_common
*(*bt_ctf_field_type_common_method_copy
)(
71 struct bt_ctf_field_type_common
*);
72 typedef int (*bt_ctf_field_type_common_method_compare
)(
73 struct bt_ctf_field_type_common
*,
74 struct bt_ctf_field_type_common
*);
76 struct bt_ctf_field_type_common_methods
{
77 bt_ctf_field_type_common_method_freeze freeze
;
78 bt_ctf_field_type_common_method_validate validate
;
79 bt_ctf_field_type_common_method_set_byte_order set_byte_order
;
80 bt_ctf_field_type_common_method_copy copy
;
81 bt_ctf_field_type_common_method_compare compare
;
84 struct bt_ctf_field_type_common
{
85 struct bt_ctf_object base
;
86 enum bt_ctf_field_type_id id
;
87 unsigned int alignment
;
90 struct bt_ctf_field_type_common_methods
*methods
;
93 * A type can't be modified once it is added to an event or after a
94 * a field has been instanciated from it.
99 * This flag indicates if the field type is valid. A valid
100 * field type is _always_ frozen. All the nested field types of
101 * a valid field type are also valid (and thus frozen).
106 * Specialized data for either CTF IR or CTF writer APIs.
107 * Having this here ensures that:
109 * * The type-specific common data is always found at the same
110 * offset when the common API has a `struct
111 * bt_ctf_field_type_common *` so that you can cast it to `struct
112 * bt_ctf_field_type_common_integer *` for example and access the
113 * common integer field type fields.
115 * * The specific CTF IR and CTF writer APIs can access their
116 * specific field type fields in this union at an offset known
117 * at build time. This avoids a pointer to specific data so
118 * that all the fields, common or specific, of a CTF IR
119 * integer field type or of a CTF writer integer field type,
120 * for example, are contained within the same contiguous block
127 void *serialize_func
;
132 struct bt_ctf_field_type_common_integer
{
133 struct bt_ctf_field_type_common common
;
136 struct bt_ctf_clock_class
*mapped_clock_class
;
138 enum bt_ctf_byte_order user_byte_order
;
139 bt_ctf_bool is_signed
;
141 enum bt_ctf_integer_base base
;
142 enum bt_ctf_string_encoding encoding
;
145 struct bt_ctf_enumeration_mapping
{
157 struct bt_ctf_field_type_common_enumeration
{
158 struct bt_ctf_field_type_common common
;
161 struct bt_ctf_field_type_common_integer
*container_ft
;
163 /* Array of `struct bt_ctf_enumeration_mapping *`, owned by this */
166 /* Only set during validation */
167 bt_ctf_bool has_overlapping_ranges
;
170 enum bt_ctf_field_type_enumeration_mapping_iterator_type
{
171 CTF_ITERATOR_BY_NAME
,
172 CTF_ITERATOR_BY_SIGNED_VALUE
,
173 CTF_ITERATOR_BY_UNSIGNED_VALUE
,
176 struct bt_ctf_field_type_enumeration_mapping_iterator
{
177 struct bt_ctf_object base
;
180 struct bt_ctf_field_type_common_enumeration
*enumeration_ft
;
182 enum bt_ctf_field_type_enumeration_mapping_iterator_type type
;
186 int64_t signed_value
;
187 uint64_t unsigned_value
;
191 struct bt_ctf_field_type_common_floating_point
{
192 struct bt_ctf_field_type_common common
;
193 enum bt_ctf_byte_order user_byte_order
;
194 unsigned int exp_dig
;
195 unsigned int mant_dig
;
198 struct bt_ctf_field_type_common_structure_field
{
202 struct bt_ctf_field_type_common
*type
;
205 struct bt_ctf_field_type_common_structure
{
206 struct bt_ctf_field_type_common common
;
207 GHashTable
*field_name_to_index
;
210 * Array of `struct bt_ctf_field_type_common_structure_field`,
216 struct bt_ctf_field_type_common_variant_choice_range
{
227 struct bt_ctf_field_type_common_variant_choice
{
231 struct bt_ctf_field_type_common
*type
;
233 /* Array of `struct bt_ctf_field_type_common_variant_choice_range` */
237 struct bt_ctf_field_type_common_variant
{
238 struct bt_ctf_field_type_common common
;
240 bool choices_up_to_date
;
243 struct bt_ctf_field_type_common_enumeration
*tag_ft
;
246 struct bt_ctf_field_path
*tag_field_path
;
248 GHashTable
*choice_name_to_index
;
251 * Array of `struct bt_ctf_field_type_common_variant_choice`,
256 struct bt_ctf_field_type_common_array
{
257 struct bt_ctf_field_type_common common
;
260 struct bt_ctf_field_type_common
*element_ft
;
265 struct bt_ctf_field_type_common_sequence
{
266 struct bt_ctf_field_type_common common
;
269 struct bt_ctf_field_type_common
*element_ft
;
271 GString
*length_field_name
;
274 struct bt_ctf_field_path
*length_field_path
;
277 struct bt_ctf_field_type_common_string
{
278 struct bt_ctf_field_type_common common
;
279 enum bt_ctf_string_encoding encoding
;
282 typedef struct bt_ctf_field_common
*(* bt_ctf_field_common_create_func
)(
283 struct bt_ctf_field_type_common
*);
286 void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common
*ft
,
287 bool init_bo
, bt_ctf_object_release_func release_func
,
288 struct bt_ctf_field_type_common_methods
*methods
);
291 void bt_ctf_field_type_common_integer_initialize(
292 struct bt_ctf_field_type_common
*ft
,
293 unsigned int size
, bt_ctf_object_release_func release_func
,
294 struct bt_ctf_field_type_common_methods
*methods
);
297 void bt_ctf_field_type_common_floating_point_initialize(
298 struct bt_ctf_field_type_common
*ft
,
299 bt_ctf_object_release_func release_func
,
300 struct bt_ctf_field_type_common_methods
*methods
);
303 void bt_ctf_field_type_common_enumeration_initialize(
304 struct bt_ctf_field_type_common
*ft
,
305 struct bt_ctf_field_type_common
*container_ft
,
306 bt_ctf_object_release_func release_func
,
307 struct bt_ctf_field_type_common_methods
*methods
);
310 void bt_ctf_field_type_common_string_initialize(
311 struct bt_ctf_field_type_common
*ft
,
312 bt_ctf_object_release_func release_func
,
313 struct bt_ctf_field_type_common_methods
*methods
);
316 void bt_ctf_field_type_common_structure_initialize(
317 struct bt_ctf_field_type_common
*ft
,
318 bt_ctf_object_release_func release_func
,
319 struct bt_ctf_field_type_common_methods
*methods
);
322 void bt_ctf_field_type_common_array_initialize(
323 struct bt_ctf_field_type_common
*ft
,
324 struct bt_ctf_field_type_common
*element_ft
,
325 unsigned int length
, bt_ctf_object_release_func release_func
,
326 struct bt_ctf_field_type_common_methods
*methods
);
329 void bt_ctf_field_type_common_sequence_initialize(
330 struct bt_ctf_field_type_common
*ft
,
331 struct bt_ctf_field_type_common
*element_ft
,
332 const char *length_field_name
,
333 bt_ctf_object_release_func release_func
,
334 struct bt_ctf_field_type_common_methods
*methods
);
337 void bt_ctf_field_type_common_variant_initialize(
338 struct bt_ctf_field_type_common
*ft
,
339 struct bt_ctf_field_type_common
*tag_ft
,
340 const char *tag_name
,
341 bt_ctf_object_release_func release_func
,
342 struct bt_ctf_field_type_common_methods
*methods
);
345 void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object
*obj
);
348 void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object
*obj
);
351 void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object
*obj
);
354 void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object
*obj
);
357 void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object
*obj
);
360 void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object
*obj
);
363 void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object
*obj
);
366 void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object
*obj
);
369 int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common
*ft
);
372 int bt_ctf_field_type_common_enumeration_validate_recursive(
373 struct bt_ctf_field_type_common
*ft
);
376 int bt_ctf_field_type_common_sequence_validate_recursive(
377 struct bt_ctf_field_type_common
*ft
);
380 int bt_ctf_field_type_common_array_validate_recursive(
381 struct bt_ctf_field_type_common
*ft
);
384 int bt_ctf_field_type_common_structure_validate_recursive(
385 struct bt_ctf_field_type_common
*ft
);
388 int bt_ctf_field_type_common_variant_validate_recursive(
389 struct bt_ctf_field_type_common
*type
);
392 int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common
*ft
);
395 int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common
*ft
);
398 bt_ctf_bool
bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common
*ft
);
401 int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common
*ft
,
402 bt_ctf_bool is_signed
);
405 int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common
*ft
,
409 enum bt_ctf_integer_base
bt_ctf_field_type_common_integer_get_base(
410 struct bt_ctf_field_type_common
*ft
);
413 int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common
*ft
,
414 enum bt_ctf_integer_base base
);
417 enum bt_ctf_string_encoding
bt_ctf_field_type_common_integer_get_encoding(
418 struct bt_ctf_field_type_common
*ft
);
421 int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common
*ft
,
422 enum bt_ctf_string_encoding encoding
);
425 struct bt_ctf_clock_class
*bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
426 struct bt_ctf_field_type_common
*ft
);
429 int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
430 struct bt_ctf_field_type_common
*ft
,
431 struct bt_ctf_clock_class
*clock_class
);
434 int bt_ctf_field_type_common_integer_set_mapped_clock_class(
435 struct bt_ctf_field_type_common
*ft
,
436 struct bt_ctf_clock_class
*clock_class
);
439 struct bt_ctf_field_type_enumeration_mapping_iterator
*
440 bt_ctf_field_type_common_enumeration_find_mappings_by_name(
441 struct bt_ctf_field_type_common
*ft
, const char *name
);
444 struct bt_ctf_field_type_enumeration_mapping_iterator
*
445 bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
446 struct bt_ctf_field_type_common
*ft
, int64_t value
);
449 struct bt_ctf_field_type_enumeration_mapping_iterator
*
450 bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
451 struct bt_ctf_field_type_common
*ft
, uint64_t value
);
454 int bt_ctf_field_type_enumeration_mapping_iterator_next(
455 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
);
458 int bt_ctf_field_type_enumeration_mapping_iterator_signed_get(
459 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
,
460 const char **mapping_name
, int64_t *range_begin
,
464 int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get(
465 struct bt_ctf_field_type_enumeration_mapping_iterator
*iter
,
466 const char **mapping_name
, uint64_t *range_begin
,
467 uint64_t *range_end
);
470 int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
471 struct bt_ctf_field_type_common
*ft
, uint64_t index
,
472 const char **mapping_name
, int64_t *range_begin
,
476 int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
477 struct bt_ctf_field_type_common
*ft
, uint64_t index
,
478 const char **mapping_name
, uint64_t *range_begin
,
479 uint64_t *range_end
);
482 struct bt_ctf_field_type_common
*
483 bt_ctf_field_type_common_enumeration_borrow_container_field_type(
484 struct bt_ctf_field_type_common
*ft
);
487 int bt_ctf_field_type_common_enumeration_signed_add_mapping(
488 struct bt_ctf_field_type_common
*ft
, const char *string
,
489 int64_t range_start
, int64_t range_end
);
492 int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
493 struct bt_ctf_field_type_common
*ft
, const char *string
,
494 uint64_t range_start
, uint64_t range_end
);
497 int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
498 struct bt_ctf_field_type_common
*ft
);
501 int bt_ctf_field_type_common_floating_point_get_exponent_digits(
502 struct bt_ctf_field_type_common
*ft
);
505 int bt_ctf_field_type_common_floating_point_set_exponent_digits(
506 struct bt_ctf_field_type_common
*ft
,
507 unsigned int exponent_digits
);
510 int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
511 struct bt_ctf_field_type_common
*type
);
514 int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
515 struct bt_ctf_field_type_common
*ft
, unsigned int mantissa_digits
);
518 int bt_ctf_field_type_common_structure_replace_field(
519 struct bt_ctf_field_type_common
*ft
,
520 const char *field_name
,
521 struct bt_ctf_field_type_common
*field_type
);
524 int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common
*ft
,
525 struct bt_ctf_field_type_common
*field_type
,
526 const char *field_name
);
529 int64_t bt_ctf_field_type_common_structure_get_field_count(
530 struct bt_ctf_field_type_common
*ft
);
533 int bt_ctf_field_type_common_structure_borrow_field_by_index(
534 struct bt_ctf_field_type_common
*ft
,
535 const char **field_name
,
536 struct bt_ctf_field_type_common
**field_type
, uint64_t index
);
539 struct bt_ctf_field_type_common
*
540 bt_ctf_field_type_common_structure_borrow_field_type_by_name(
541 struct bt_ctf_field_type_common
*ft
, const char *name
);
544 struct bt_ctf_field_type_common
*
545 bt_ctf_field_type_common_variant_borrow_tag_field_type(
546 struct bt_ctf_field_type_common
*ft
);
549 const char *bt_ctf_field_type_common_variant_get_tag_name(
550 struct bt_ctf_field_type_common
*ft
);
553 int bt_ctf_field_type_common_variant_set_tag_name(
554 struct bt_ctf_field_type_common
*ft
, const char *name
);
557 int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common
*ft
,
558 struct bt_ctf_field_type_common
*field_type
,
559 const char *field_name
);
562 int bt_ctf_field_type_common_variant_update_choices(
563 struct bt_ctf_field_type_common
*ft
);
566 struct bt_ctf_field_type_common
*
567 bt_ctf_field_type_common_variant_borrow_field_type_by_name(
568 struct bt_ctf_field_type_common
*ft
,
569 const char *field_name
);
572 int64_t bt_ctf_field_type_common_variant_get_field_count(
573 struct bt_ctf_field_type_common
*ft
);
576 int bt_ctf_field_type_common_variant_borrow_field_by_index(
577 struct bt_ctf_field_type_common
*ft
,
578 const char **field_name
,
579 struct bt_ctf_field_type_common
**field_type
, uint64_t index
);
582 struct bt_ctf_field_type_common
*
583 bt_ctf_field_type_common_array_borrow_element_field_type(
584 struct bt_ctf_field_type_common
*ft
);
587 int bt_ctf_field_type_common_array_set_element_field_type(
588 struct bt_ctf_field_type_common
*ft
,
589 struct bt_ctf_field_type_common
*element_ft
);
592 int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common
*ft
);
595 struct bt_ctf_field_type_common
*
596 bt_ctf_field_type_common_sequence_borrow_element_field_type(
597 struct bt_ctf_field_type_common
*ft
);
600 int bt_ctf_field_type_common_sequence_set_element_field_type(
601 struct bt_ctf_field_type_common
*ft
,
602 struct bt_ctf_field_type_common
*element_ft
);
605 const char *bt_ctf_field_type_common_sequence_get_length_field_name(
606 struct bt_ctf_field_type_common
*ft
);
609 enum bt_ctf_string_encoding
bt_ctf_field_type_common_string_get_encoding(
610 struct bt_ctf_field_type_common
*ft
);
613 int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common
*ft
,
614 enum bt_ctf_string_encoding encoding
);
617 int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common
*type
);
620 int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common
*ft
,
621 unsigned int alignment
);
624 enum bt_ctf_byte_order
bt_ctf_field_type_common_get_byte_order(
625 struct bt_ctf_field_type_common
*ft
);
628 int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common
*ft
,
629 enum bt_ctf_byte_order byte_order
);
632 enum bt_ctf_field_type_id
bt_ctf_field_type_common_get_type_id(
633 struct bt_ctf_field_type_common
*ft
);
636 void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common
*ft
);
639 struct bt_ctf_field_type_common
*
640 bt_ctf_field_type_common_variant_borrow_field_type_signed(
641 struct bt_ctf_field_type_common_variant
*var_ft
,
645 struct bt_ctf_field_type_common
*
646 bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
647 struct bt_ctf_field_type_common_variant
*var_ft
,
651 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_copy(
652 struct bt_ctf_field_type_common
*ft
);
655 int bt_ctf_field_type_common_structure_get_field_name_index(
656 struct bt_ctf_field_type_common
*ft
, const char *name
);
659 int bt_ctf_field_type_common_variant_get_field_name_index(
660 struct bt_ctf_field_type_common
*ft
, const char *name
);
663 int bt_ctf_field_type_common_sequence_set_length_field_path(
664 struct bt_ctf_field_type_common
*ft
, struct bt_ctf_field_path
*path
);
667 int bt_ctf_field_type_common_variant_set_tag_field_path(
668 struct bt_ctf_field_type_common
*ft
,
669 struct bt_ctf_field_path
*path
);
672 int bt_ctf_field_type_common_variant_set_tag_field_type(
673 struct bt_ctf_field_type_common
*ft
,
674 struct bt_ctf_field_type_common
*tag_ft
);
677 void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common
*ft
);
680 void bt_ctf_field_type_common_enumeration_freeze_recursive(
681 struct bt_ctf_field_type_common
*ft
);
684 void bt_ctf_field_type_common_structure_freeze_recursive(
685 struct bt_ctf_field_type_common
*ft
);
688 void bt_ctf_field_type_common_variant_freeze_recursive(
689 struct bt_ctf_field_type_common
*ft
);
692 void bt_ctf_field_type_common_array_freeze_recursive(
693 struct bt_ctf_field_type_common
*ft
);
696 void bt_ctf_field_type_common_sequence_freeze_recursive(
697 struct bt_ctf_field_type_common
*type
);
700 void bt_ctf_field_type_common_integer_set_byte_order(
701 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
704 void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
705 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
708 void bt_ctf_field_type_common_floating_point_set_byte_order(
709 struct bt_ctf_field_type_common
*ft
, enum bt_ctf_byte_order byte_order
);
712 void bt_ctf_field_type_common_structure_set_byte_order_recursive(
713 struct bt_ctf_field_type_common
*ft
,
714 enum bt_ctf_byte_order byte_order
);
717 void bt_ctf_field_type_common_variant_set_byte_order_recursive(
718 struct bt_ctf_field_type_common
*ft
,
719 enum bt_ctf_byte_order byte_order
);
722 void bt_ctf_field_type_common_array_set_byte_order_recursive(
723 struct bt_ctf_field_type_common
*ft
,
724 enum bt_ctf_byte_order byte_order
);
727 void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
728 struct bt_ctf_field_type_common
*ft
,
729 enum bt_ctf_byte_order byte_order
);
732 int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common
*ft_a
,
733 struct bt_ctf_field_type_common
*ft_b
);
736 int bt_ctf_field_type_common_floating_point_compare(
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_enumeration_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_string_compare(struct bt_ctf_field_type_common
*ft_a
,
747 struct bt_ctf_field_type_common
*ft_b
);
750 int bt_ctf_field_type_common_structure_compare_recursive(
751 struct bt_ctf_field_type_common
*ft_a
,
752 struct bt_ctf_field_type_common
*ft_b
);
755 int bt_ctf_field_type_common_variant_compare_recursive(
756 struct bt_ctf_field_type_common
*ft_a
,
757 struct bt_ctf_field_type_common
*ft_b
);
760 int bt_ctf_field_type_common_array_compare_recursive(
761 struct bt_ctf_field_type_common
*ft_a
,
762 struct bt_ctf_field_type_common
*ft_b
);
765 int bt_ctf_field_type_common_sequence_compare_recursive(
766 struct bt_ctf_field_type_common
*ft_a
,
767 struct bt_ctf_field_type_common
*ft_b
);
770 int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common
*ft_a
,
771 struct bt_ctf_field_type_common
*ft_b
);
774 int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common
*ft
);
777 struct bt_ctf_field_type_common
*bt_ctf_field_type_common_borrow_field_at_index(
778 struct bt_ctf_field_type_common
*ft
, int index
);
781 int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common
*ft
,
785 struct bt_ctf_field_path
*bt_ctf_field_type_common_variant_borrow_tag_field_path(
786 struct bt_ctf_field_type_common
*ft
);
789 struct bt_ctf_field_path
*bt_ctf_field_type_common_sequence_borrow_length_field_path(
790 struct bt_ctf_field_type_common
*ft
);
793 int bt_ctf_field_type_common_validate_single_clock_class(
794 struct bt_ctf_field_type_common
*ft
,
795 struct bt_ctf_clock_class
**expected_clock_class
);
798 int64_t bt_ctf_field_type_common_variant_find_choice_index(
799 struct bt_ctf_field_type_common
*ft
, uint64_t uval
,
803 int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type
*type
,
804 struct metadata_context
*context
);
807 struct bt_ctf_field_type
*bt_ctf_field_type_copy(struct bt_ctf_field_type
*ft
);
809 #endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */