1 #ifndef BABELTRACE_CTF_IR_FIELD_TYPES_H
2 #define BABELTRACE_CTF_IR_FIELD_TYPES_H
5 * BabelTrace - CTF IR: Event field types
7 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 * The Common Trace Format (CTF) Specification is available at
30 * http://www.efficios.com/ctf
40 @defgroup ctfirfieldtypes CTF IR field types
42 @brief CTF IR field types.
45 #include <babeltrace/ctf-ir/field-types.h>
48 A CTF IR <strong><em>field type</em></strong> is a field type that you
49 can use to create concrete @fields.
51 You can create a @field object from a CTF IR field type object
52 with bt_ctf_field_create().
54 In the CTF IR hierarchy, you can set the root field types of three
57 - \ref ctfirtraceclass
58 - Trace packet header field type: bt_ctf_trace_set_packet_header_type().
59 - \ref ctfirstreamclass
60 - Stream packet context field type:
61 bt_ctf_stream_class_set_packet_context_type().
62 - Stream event header field type:
63 bt_ctf_stream_class_set_event_header_type().
64 - Stream event context field type:
65 bt_ctf_stream_class_set_event_context_type().
66 - \ref ctfireventclass
67 - Event context field type: bt_ctf_event_class_set_context_type().
68 - Event payload field type: bt_ctf_event_class_set_payload_type().
70 As of Babeltrace \btversion, those six previous "root" field types
71 \em must be @structft objects.
73 If, at any level within a given root field type, you add a @seqft or a
74 @varft, you do not need to specify its associated length
75 or tag field type: the length or tag string is enough for the Babeltrace
76 system to resolve the needed field type depending on where this
77 dynamic field type is located within the whole hierarchy. It is
78 guaranteed that this automatic resolving is performed for all the field
79 types contained in a given
80 \link ctfirstreamclass CTF IR stream class\endlink (and in its
81 children \link ctfireventclass CTF IR event classes\endlink) once you
82 add it to a \link ctfirtraceclass CTF IR trace class\endlink with
83 bt_ctf_trace_add_stream_class(). Once a stream class is the child of
84 a trace class, this automatic resolving is performed for the field
85 types of an event class when you add it with
86 bt_ctf_stream_class_add_event_class(). If the system cannot find a path
87 to a field in the hierarchy for a dynamic field type, the adding
90 The standard CTF field types are:
96 <th>CTF IR field which you can create from this field type
99 <td>#BT_CTF_TYPE_ID_INTEGER
100 <td>\ref ctfirintfieldtype
101 <td>\ref ctfirintfield
104 <td>#BT_CTF_TYPE_ID_FLOAT
105 <td>\ref ctfirfloatfieldtype
106 <td>\ref ctfirfloatfield
109 <td>#BT_CTF_TYPE_ID_ENUM
110 <td>\ref ctfirenumfieldtype
111 <td>\ref ctfirenumfield
114 <td>#BT_CTF_TYPE_ID_STRING
115 <td>\ref ctfirstringfieldtype
116 <td>\ref ctfirstringfield
119 <td>#BT_CTF_TYPE_ID_STRUCT
120 <td>\ref ctfirstructfieldtype
121 <td>\ref ctfirstructfield
124 <td>#BT_CTF_TYPE_ID_ARRAY
125 <td>\ref ctfirarrayfieldtype
126 <td>\ref ctfirarrayfield
129 <td>#BT_CTF_TYPE_ID_SEQUENCE
130 <td>\ref ctfirseqfieldtype
131 <td>\ref ctfirseqfield
134 <td>#BT_CTF_TYPE_ID_VARIANT
135 <td>\ref ctfirvarfieldtype
136 <td>\ref ctfirvarfield
140 Each field type has its own <strong>type ID</strong> (see
141 #bt_ctf_type_id). You get the type ID of a field type object
142 with bt_ctf_field_type_get_type_id().
144 You can get a deep copy of a field type with bt_ctf_field_type_copy().
145 This function resets, in the field type copy, the resolved field type
146 of the dynamic field types. The automatic resolving can be done again
147 when you eventually call bt_ctf_event_create(),
148 bt_ctf_stream_class_add_event_class(), or
149 bt_ctf_trace_add_stream_class().
151 You \em must always use bt_ctf_field_type_compare() to compare two
152 field types. Since some parts of the Babeltrace system can copy field
153 types behind the scenes, you \em cannot rely on a simple field type
156 As with any Babeltrace object, CTF IR field type objects have
157 <a href="https://en.wikipedia.org/wiki/Reference_counting">reference
158 counts</a>. See \ref refs to learn more about the reference counting
159 management of Babeltrace objects.
161 The following functions can \em freeze field type objects:
163 - bt_ctf_field_create() freezes its field type parameter.
164 - bt_ctf_stream_class_add_event_class(), if its
165 \link ctfirstreamclass CTF IR stream class\endlink parameter has a
166 \link ctfirtraceclass CTF IR trace class\endlink parent, freezes
167 the root field types of its
168 \link ctfireventclass CTF IR event class\endlink parameter.
169 - bt_ctf_trace_add_stream_class() freezes the root field types of the
170 whole trace class hierarchy (trace class, children stream classes,
171 and their children event classes).
172 - bt_ctf_writer_create_stream() freezes the root field types of the
173 whole CTF writer's trace class hierarchy.
174 - bt_ctf_event_create() freezes the root field types of its event class
175 parameter and of ther parent stream class of this event class.
177 You cannot modify a frozen field type object: it is considered
178 immutable, except for \link refs reference counting\endlink.
183 @brief CTF IR field types type and functions.
186 @addtogroup ctfirfieldtypes
191 @struct bt_ctf_field_type
192 @brief A CTF IR field type.
195 struct bt_ctf_field_type
;
196 struct bt_ctf_event_class
;
199 struct bt_ctf_field_path
;
201 /** @cond DOCUMENT */
204 * Babeltrace 1.x enumerations that were also used in CTF writer's API.
205 * They are left here for backward compatibility reasons, but
206 * enum bt_ctf_type_id and enum bt_ctf_string_encoding should be used
207 * in new code. Both new enumerations are compatible with their legacy
211 CTF_TYPE_UNKNOWN
= 0,
217 CTF_TYPE_UNTAGGED_VARIANT
,
227 enum ctf_string_encoding
{
240 /// Unknown, used for errors.
241 BT_CTF_SCOPE_UNKNOWN
= -1,
243 /// Trace packet header.
244 BT_CTF_SCOPE_TRACE_PACKET_HEADER
= 1,
246 /// Stream packet context.
247 BT_CTF_SCOPE_STREAM_PACKET_CONTEXT
= 2,
249 /// Stream event header.
250 BT_CTF_SCOPE_STREAM_EVENT_HEADER
= 3,
252 /// Stream event context.
253 BT_CTF_SCOPE_STREAM_EVENT_CONTEXT
= 4,
256 BT_CTF_SCOPE_EVENT_CONTEXT
= 5,
259 BT_CTF_SCOPE_EVENT_PAYLOAD
= 6,
262 BT_CTF_SCOPE_ENV
= 0,
263 BT_CTF_SCOPE_EVENT_FIELDS
= 6,
268 @name Type information
273 @brief Type ID of a @ft.
275 enum bt_ctf_type_id
{
276 /// Unknown, used for errors.
277 BT_CTF_TYPE_ID_UNKNOWN
= CTF_TYPE_UNKNOWN
,
279 /// \ref ctfirintfieldtype
280 BT_CTF_TYPE_ID_INTEGER
= CTF_TYPE_INTEGER
,
282 /// \ref ctfirfloatfieldtype
283 BT_CTF_TYPE_ID_FLOAT
= CTF_TYPE_FLOAT
,
285 /// \ref ctfirenumfieldtype
286 BT_CTF_TYPE_ID_ENUM
= CTF_TYPE_ENUM
,
288 /// \ref ctfirstringfieldtype
289 BT_CTF_TYPE_ID_STRING
= CTF_TYPE_STRING
,
291 /// \ref ctfirstructfieldtype
292 BT_CTF_TYPE_ID_STRUCT
= CTF_TYPE_STRUCT
,
295 BT_CTF_TYPE_ID_UNTAGGED_VARIANT
= CTF_TYPE_UNTAGGED_VARIANT
,
298 /// \ref ctfirarrayfieldtype
299 BT_CTF_TYPE_ID_ARRAY
= CTF_TYPE_ARRAY
,
301 /// \ref ctfirseqfieldtype
302 BT_CTF_TYPE_ID_SEQUENCE
= CTF_TYPE_SEQUENCE
,
304 /// \ref ctfirvarfieldtype
305 BT_CTF_TYPE_ID_VARIANT
= CTF_TYPE_VARIANT
,
307 /// Number of enumeration entries.
308 BT_CTF_NR_TYPE_IDS
= NR_CTF_TYPES
,
312 @brief Returns the type ID of the @ft \p field_type.
314 @param[in] field_type Field type of which to get the type ID.
315 @returns Type ID of \p field_type,
316 or #BT_CTF_TYPE_ID_UNKNOWN on error.
318 @prenotnull{field_type}
319 @postrefcountsame{field_type}
321 @sa #bt_ctf_type_id: CTF IR field type ID.
322 @sa bt_ctf_field_type_is_integer(): Returns whether or not a given
323 field type is a @intft.
324 @sa bt_ctf_field_type_is_floating_point(): Returns whether or not a
325 given field type is a @floatft.
326 @sa bt_ctf_field_type_is_enumeration(): Returns whether or not a given
327 field type is a @enumft.
328 @sa bt_ctf_field_type_is_string(): Returns whether or not a given
329 field type is a @stringft.
330 @sa bt_ctf_field_type_is_structure(): Returns whether or not a given
331 field type is a @structft.
332 @sa bt_ctf_field_type_is_array(): Returns whether or not a given
333 field type is a @arrayft.
334 @sa bt_ctf_field_type_is_sequence(): Returns whether or not a given
335 field type is a @seqft.
336 @sa bt_ctf_field_type_is_variant(): Returns whether or not a given
337 field type is a @varft.
339 extern enum bt_ctf_type_id
bt_ctf_field_type_get_type_id(
340 struct bt_ctf_field_type
*field_type
);
343 @brief Returns whether or not the @ft \p field_type is a @intft.
345 @param[in] field_type Field type to check (can be \c NULL).
346 @returns 1 if \p field_type is an integer field type,
347 or 0 otherwise (including if \p field_type is
350 @prenotnull{field_type}
351 @postrefcountsame{field_type}
353 @sa bt_ctf_field_type_get_type_id(): Returns the type ID of a given
356 extern int bt_ctf_field_type_is_integer(struct bt_ctf_field_type
*field_type
);
359 @brief Returns whether or not the @ft \p field_type is a @floatft.
361 @param[in] field_type Field type to check (can be \c NULL).
362 @returns 1 if \p field_type is a floating point
364 or 0 otherwise (including if \p field_type is
367 @postrefcountsame{field_type}
369 @sa bt_ctf_field_type_get_type_id(): Returns the type ID of a given
372 extern int bt_ctf_field_type_is_floating_point(struct bt_ctf_field_type
*field_type
);
375 @brief Returns whether or not the @ft \p field_type is a @enumft.
377 @param[in] field_type Field type to check (can be \c NULL).
378 @returns 1 if \p field_type is an enumeration field type,
379 or 0 otherwise (including if \p field_type is
382 @postrefcountsame{field_type}
384 @sa bt_ctf_field_type_get_type_id(): Returns the type ID of a given
387 extern int bt_ctf_field_type_is_enumeration(struct bt_ctf_field_type
*field_type
);
390 @brief Returns whether or not the @ft \p field_type is a @stringft.
392 @param[in] field_type Field type to check (can be \c NULL).
393 @returns 1 if \p field_type is a string field type,
394 or 0 otherwise (including if \p field_type is
397 @postrefcountsame{field_type}
399 @sa bt_ctf_field_type_get_type_id(): Returns the type ID of a given
402 extern int bt_ctf_field_type_is_string(struct bt_ctf_field_type
*field_type
);
405 @brief Returns whether or not the @ft \p field_type is a @structft.
407 @param[in] field_type Field type to check (can be \c NULL).
408 @returns 1 if \p field_type is a structure field type,
409 or 0 otherwise (including if \p field_type is
412 @postrefcountsame{field_type}
414 @sa bt_ctf_field_type_get_type_id(): Returns the type ID of a given
417 extern int bt_ctf_field_type_is_structure(struct bt_ctf_field_type
*field_type
);
420 @brief Returns whether or not the @ft \p field_type is a @arrayft.
422 @param[in] field_type Field type to check (can be \c NULL).
423 @returns 1 if \p field_type is an array field type,
424 or 0 otherwise (including if \p field_type is
427 @postrefcountsame{field_type}
429 @sa bt_ctf_field_type_get_type_id(): Returns the type ID of a given
432 extern int bt_ctf_field_type_is_array(struct bt_ctf_field_type
*field_type
);
435 @brief Returns whether or not the @ft \p field_type is a @seqft.
437 @param[in] field_type Field type to check (can be \c NULL).
438 @returns 1 if \p field_type is a sequence field type,
439 or 0 otherwise (including if \p field_type is
442 @postrefcountsame{field_type}
444 @sa bt_ctf_field_type_get_type_id(): Returns the type ID of a given
447 extern int bt_ctf_field_type_is_sequence(struct bt_ctf_field_type
*field_type
);
450 @brief Returns whether or not the @ft \p field_type is a @varft.
452 @param[in] field_type Field type to check (can be \c NULL).
453 @returns 1 if \p field_type is a variant field type,
454 or 0 otherwise (including if \p field_type is
457 @postrefcountsame{field_type}
459 @sa bt_ctf_field_type_get_type_id(): Returns the type ID of a given
462 extern int bt_ctf_field_type_is_variant(struct bt_ctf_field_type
*field_type
);
467 @name Common properties types and functions
472 @brief <a href="https://en.wikipedia.org/wiki/Endianness">Byte order</a>
475 enum bt_ctf_byte_order
{
476 /// Unknown, used for errors.
477 BT_CTF_BYTE_ORDER_UNKNOWN
= -1,
480 * Note that native, in the context of the CTF specification, is defined
481 * as "the byte order described in the trace" and does not mean that the
482 * host's endianness will be used.
484 /// Native (default) byte order.
485 BT_CTF_BYTE_ORDER_NATIVE
= 0,
488 BT_CTF_BYTE_ORDER_LITTLE_ENDIAN
,
491 BT_CTF_BYTE_ORDER_BIG_ENDIAN
,
493 /// Network byte order (big-endian).
494 BT_CTF_BYTE_ORDER_NETWORK
,
498 @brief String encoding of a @ft.
500 enum bt_ctf_string_encoding
{
501 /// Unknown, used for errors.
502 BT_CTF_STRING_ENCODING_UNKNOWN
= CTF_STRING_UNKNOWN
,
505 BT_CTF_STRING_ENCODING_NONE
= CTF_STRING_NONE
,
507 /// <a href="https://en.wikipedia.org/wiki/UTF-8">UTF-8</a>.
508 BT_CTF_STRING_ENCODING_UTF8
= CTF_STRING_UTF8
,
510 /// <a href="https://en.wikipedia.org/wiki/ASCII">ASCII</a>.
511 BT_CTF_STRING_ENCODING_ASCII
= CTF_STRING_ASCII
,
515 @brief Returns the alignment of the @fields described by
516 the @ft \p field_type.
518 @param[in] field_type Field type which describes the
519 fields of which to get the alignment.
520 @returns Alignment of the fields described by
521 \p field_type, or a negative value on error.
523 @prenotnull{field_type}
524 @postrefcountsame{field_type}
526 @sa bt_ctf_field_type_set_alignment(): Sets the alignment
527 of the fields described by a given field type.
529 extern int bt_ctf_field_type_get_alignment(
530 struct bt_ctf_field_type
*field_type
);
533 @brief Sets the alignment of the @fields described by the
534 @ft \p field_type to \p alignment.
536 \p alignment \em must be greater than 0 and a power of two.
538 @param[in] field_type Field type which describes the fields of
539 which to set the alignment.
540 @param[in] alignment Alignment of the fields described by
542 @returns 0 on success, or a negative value on error.
544 @prenotnull{field_type}
546 @pre \p alignment is greater than 0 and a power of two.
547 @postrefcountsame{field_type}
549 @sa bt_ctf_field_type_get_alignment(): Returns the alignment of the
550 fields described by a given field type.
552 extern int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type
*field_type
,
553 unsigned int alignment
);
556 @brief Returns the byte order of the @fields described by
557 the @ft \p field_type.
559 You can only call this function if \p field_type is a @intft, a
560 @floatft, or a @enumft.
562 @param[in] field_type Field type which describes the
563 fields of which to get the byte order.
564 @returns Byte order of the fields described by
565 \p field_type, or #BT_CTF_BYTE_ORDER_UNKNOWN on
568 @prenotnull{field_type}
569 @pre \p field_type is a @intft, a @floatft, or a @enumft.
570 @postrefcountsame{field_type}
572 @sa bt_ctf_field_type_set_byte_order(): Sets the byte order
573 of the fields described by a given field type.
575 extern enum bt_ctf_byte_order
bt_ctf_field_type_get_byte_order(
576 struct bt_ctf_field_type
*field_type
);
579 @brief Sets the byte order of the @fields described by the
580 @ft \p field_type to \p byte_order.
582 If \p field_type is a compound field type, this function also
583 recursively sets the byte order of its children to \p byte_order.
585 @param[in] field_type Field type which describes the fields of
586 which to set the byte order.
587 @param[in] byte_order Alignment of the fields described by
589 @returns 0 on success, or a negative value on error.
591 @prenotnull{field_type}
593 @pre \p byte_order is #BT_CTF_BYTE_ORDER_NATIVE,
594 #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN, #BT_CTF_BYTE_ORDER_BIG_ENDIAN,
595 or #BT_CTF_BYTE_ORDER_NETWORK.
596 @postrefcountsame{field_type}
598 @sa bt_ctf_field_type_get_byte_order(): Returns the byte order of the
599 fields described by a given field type.
601 extern int bt_ctf_field_type_set_byte_order(
602 struct bt_ctf_field_type
*field_type
,
603 enum bt_ctf_byte_order byte_order
);
608 @name Utility functions
613 @brief Returns whether or not the @ft \p field_type_a
614 is equivalent to the field type \p field_type_b.
616 You \em must use this function to compare two field types: it is not
617 safe to compare two pointer values directly, because, for internal
618 reasons, some parts of the Babeltrace system can copy user field types
619 and discard the original ones.
621 @param[in] field_type_a Field type to compare to \p field_type_b.
622 @param[in] field_type_b Field type to compare to \p field_type_a.
623 @returns 0 if \p field_type_a is equivalent to
624 \p field_type_b, 1 if they are not equivalent,
625 or a negative value on error.
627 @prenotnull{field_type_a}
628 @prenotnull{field_type_b}
629 @postrefcountsame{field_type_a}
630 @postrefcountsame{field_type_b}
632 extern int bt_ctf_field_type_compare(struct bt_ctf_field_type
*field_type_a
,
633 struct bt_ctf_field_type
*field_type_b
);
636 @brief Creates a \em deep copy of the @ft \p field_type.
638 You can copy a frozen field type: the resulting copy is
641 This function resets the tag field type of a copied @varft. The
642 automatic field resolving which some functions of the API perform
643 can set it again when the returned field type is used (learn more
644 in the detailed description of this module).
646 @param[in] field_type Field type to copy.
647 @returns Deep copy of \p field_type on success,
650 @prenotnull{field_type}
651 @postrefcountsame{field_type}
652 @postsuccessrefcountret1
653 @post <strong>On success</strong>, the returned field type is not frozen.
655 extern struct bt_ctf_field_type
*bt_ctf_field_type_copy(
656 struct bt_ctf_field_type
*field_type
);
663 @defgroup ctfirintfieldtype CTF IR integer field type
664 @ingroup ctfirfieldtypes
665 @brief CTF IR integer field type.
668 #include <babeltrace/ctf-ir/field-types.h>
671 A CTF IR <strong><em>integer field type</em></strong> is a field type that
672 you can use to create concrete @intfield objects.
674 You can create an integer field type
675 with bt_ctf_field_type_integer_create().
677 An integer field type has the following properties:
682 <th>Value at creation
687 <td>\b Alignment (bits) of the described integer fields
689 <td>bt_ctf_field_type_get_alignment()
690 <td>bt_ctf_field_type_set_alignment()
693 <td><strong>Byte order</strong> of the described integer fields
694 <td>#BT_CTF_BYTE_ORDER_NATIVE
695 <td>bt_ctf_field_type_get_byte_order()
696 <td>bt_ctf_field_type_set_byte_order()
699 <td><strong>Storage size</strong> (bits) of the described
701 <td>Specified at creation
702 <td>bt_ctf_field_type_integer_get_size()
703 <td>None: specified at creation (bt_ctf_field_type_integer_create())
706 <td><strong>Signedness</strong> of the described integer fields
708 <td>bt_ctf_field_type_integer_get_signed()
709 <td>bt_ctf_field_type_integer_set_signed()
712 <td><strong>Preferred display base</strong> of the described
714 <td>#BT_CTF_INTEGER_BASE_DECIMAL
715 <td>bt_ctf_field_type_integer_get_base()
716 <td>bt_ctf_field_type_integer_set_base()
719 <td>\b Encoding of the described integer fields
720 <td>#BT_CTF_STRING_ENCODING_NONE
721 <td>bt_ctf_field_type_integer_get_encoding()
722 <td>bt_ctf_field_type_integer_set_encoding()
726 \link ctfirclockclass CTF IR clock class\endlink</strong>
728 <td>bt_ctf_field_type_integer_get_mapped_clock_class()
729 <td>bt_ctf_field_type_integer_set_mapped_clock_class()
736 @addtogroup ctfirintfieldtype
741 @brief Preferred display base (radix) of a @intft.
743 enum bt_ctf_integer_base
{
744 /// Unknown, used for errors.
745 BT_CTF_INTEGER_BASE_UNKNOWN
= -1,
748 BT_CTF_INTEGER_BASE_BINARY
= 2,
751 BT_CTF_INTEGER_BASE_OCTAL
= 8,
754 BT_CTF_INTEGER_BASE_DECIMAL
= 10,
757 BT_CTF_INTEGER_BASE_HEXADECIMAL
= 16,
761 @brief Creates a default @intft with \p size bits as the storage size
762 of the @intfields it describes.
764 @param[in] size Storage size (bits) of the described integer fields.
765 @returns Created integer field type, or \c NULL on error.
767 @pre \p size is greater than 0 and lesser than or equal to 64.
768 @postsuccessrefcountret1
770 extern struct bt_ctf_field_type
*bt_ctf_field_type_integer_create(
774 @brief Returns the storage size, in bits, of the @intfields
775 described by the @intft \p int_field_type.
777 @param[in] int_field_type Integer field type which describes the
778 integer fields of which to get the
780 @returns Storage size (bits) of the integer
781 fields described by \p int_field_type,
782 or a negative value on error.
784 @prenotnull{int_field_type}
785 @preisintft{int_field_type}
786 @postrefcountsame{int_field_type}
788 extern int bt_ctf_field_type_integer_get_size(
789 struct bt_ctf_field_type
*int_field_type
);
792 @brief Returns whether or not the @intfields described by the @intft
793 \p int_field_type are signed.
795 @param[in] int_field_type Integer field type which describes the
796 integer fields of which to get the
798 @returns 1 if the integer fields described by
799 \p int_field_type are signed, 0 if they
800 are unsigned, or a negative value on
803 @prenotnull{int_field_type}
804 @preisintft{int_field_type}
805 @postrefcountsame{int_field_type}
807 @sa bt_ctf_field_type_integer_set_signed(): Sets the signedness of the
808 integer fields described by a given integer field type.
810 extern int bt_ctf_field_type_integer_get_signed(
811 struct bt_ctf_field_type
*int_field_type
);
814 @brief Sets whether or not the @intfields described by
815 the @intft \p int_field_type are signed.
817 @param[in] int_field_type Integer field type which describes the
818 integer fields of which to set the
820 @param[in] is_signed Signedness of the integer fields
821 described by \p int_field_type; 0 means
822 \em unsigned, 1 means \em signed.
823 @returns 0 on success, or a negative value on error.
825 @prenotnull{int_field_type}
826 @preisintft{int_field_type}
827 @prehot{int_field_type}
828 @pre \p is_signed is 0 or 1.
829 @postrefcountsame{event_class}
831 @sa bt_ctf_field_type_integer_get_signed(): Returns the signedness of
832 the integer fields described by a given integer field type.
834 extern int bt_ctf_field_type_integer_set_signed(
835 struct bt_ctf_field_type
*int_field_type
, int is_signed
);
838 @brief Returns the preferred display base (radix) of the @intfields
839 described by the @intft \p int_field_type.
841 @param[in] int_field_type Integer field type which describes the
842 integer fields of which to get the
843 preferred display base.
844 @returns Preferred display base of the integer
845 fields described by \p int_field_type,
846 or #BT_CTF_INTEGER_BASE_UNKNOWN on
849 @prenotnull{int_field_type}
850 @preisintft{int_field_type}
851 @postrefcountsame{int_field_type}
853 @sa bt_ctf_field_type_integer_set_base(): Sets the preferred display
854 base of the integer fields described by a given integer field
857 extern enum bt_ctf_integer_base
bt_ctf_field_type_integer_get_base(
858 struct bt_ctf_field_type
*int_field_type
);
861 @brief Sets the preferred display base (radix) of the @intfields
862 described by the @intft \p int_field_type to \p base.
864 @param[in] int_field_type Integer field type which describes the
865 integer fields of which to set the
866 preferred display base.
867 @param[in] base Preferred display base of the integer
868 fields described by \p int_field_type.
869 @returns 0 on success, or a negative value on error.
871 @prenotnull{int_field_type}
872 @preisintft{int_field_type}
873 @prehot{int_field_type}
874 @pre \p base is #BT_CTF_INTEGER_BASE_BINARY, #BT_CTF_INTEGER_BASE_OCTAL,
875 #BT_CTF_INTEGER_BASE_DECIMAL, or
876 #BT_CTF_INTEGER_BASE_HEXADECIMAL.
877 @postrefcountsame{int_field_type}
879 @sa bt_ctf_field_type_integer_get_base(): Returns the preferred display
880 base of the integer fields described by a given
883 extern int bt_ctf_field_type_integer_set_base(
884 struct bt_ctf_field_type
*int_field_type
,
885 enum bt_ctf_integer_base base
);
888 @brief Returns the encoding of the @intfields described by
889 the @intft \p int_field_type.
891 @param[in] int_field_type Integer field type which describes the
892 integer fields of which to get the
894 @returns Encoding of the integer
895 fields described by \p int_field_type,
896 or #BT_CTF_STRING_ENCODING_UNKNOWN on
899 @prenotnull{int_field_type}
900 @preisintft{int_field_type}
901 @postrefcountsame{int_field_type}
903 @sa bt_ctf_field_type_integer_set_encoding(): Sets the encoding
904 of the integer fields described by a given integer field type.
906 extern enum bt_ctf_string_encoding
bt_ctf_field_type_integer_get_encoding(
907 struct bt_ctf_field_type
*int_field_type
);
910 @brief Sets the encoding of the @intfields described by the @intft
911 \p int_field_type to \p encoding.
913 You can use this property, in CTF IR, to create "text" @arrayfts or
914 @seqfts. A text array field type is array field type with an unsigned,
915 8-bit integer field type having an encoding as its element field type.
917 @param[in] int_field_type Integer field type which describes the
918 integer fields of which to set the
920 @param[in] encoding Encoding of the integer
921 fields described by \p int_field_type.
922 @returns 0 on success, or a negative value on error.
924 @prenotnull{int_field_type}
925 @preisintft{int_field_type}
926 @prehot{int_field_type}
927 @pre \p encoding is #BT_CTF_STRING_ENCODING_NONE,
928 #BT_CTF_STRING_ENCODING_ASCII, or
929 #BT_CTF_STRING_ENCODING_UTF8.
930 @postrefcountsame{int_field_type}
932 @sa bt_ctf_field_type_integer_get_encoding(): Returns the encoding of
933 the integer fields described by a given integer field type.
935 extern int bt_ctf_field_type_integer_set_encoding(
936 struct bt_ctf_field_type
*int_field_type
,
937 enum bt_ctf_string_encoding encoding
);
940 @brief Returns the \link ctfirclockclass CTF IR clock class\endlink
941 mapped to the @intft \p int_field_type.
943 The mapped clock class, if any, indicates the class of the clock which
944 an @intfield described by \p int_field_type should sample or update.
945 This mapped clock class is only indicative.
947 @param[in] int_field_type Integer field type of which to get the
949 @returns Mapped clock class of \p int_field_type,
950 or \c NULL if there's no mapped clock
953 @prenotnull{int_field_type}
954 @preisintft{int_field_type}
955 @postrefcountsame{int_field_type}
956 @postsuccessrefcountretinc
958 @sa bt_ctf_field_type_integer_set_mapped_clock_class(): Sets the mapped
959 clock class of a given integer field type.
961 extern struct bt_ctf_clock_class
*bt_ctf_field_type_integer_get_mapped_clock_class(
962 struct bt_ctf_field_type
*int_field_type
);
965 @brief Sets the \link ctfirclockclass CTF IR clock class\endlink mapped
966 to the @intft \p int_field_type to \p clock_class.
968 The mapped clock class, if any, indicates the class of the clock which
969 an integer field described by \p int_field_type should sample or update.
970 This mapped clock class is only indicative.
972 @param[in] int_field_type Integer field type of which to set the
974 @param[in] clock_class Mapped clock class of \p int_field_type.
975 @returns 0 on success, or a negative value on error.
977 @prenotnull{int_field_type}
978 @prenotnull{clock_class}
979 @preisintft{int_field_type}
980 @prehot{int_field_type}
981 @postrefcountsame{int_field_type}
982 @postsuccessrefcountinc{clock_class}
984 @sa bt_ctf_field_type_integer_get_mapped_clock_class(): Returns the mapped
985 clock class of a given integer field type.
987 extern int bt_ctf_field_type_integer_set_mapped_clock_class(
988 struct bt_ctf_field_type
*int_field_type
,
989 struct bt_ctf_clock_class
*clock_class
);
994 @defgroup ctfirfloatfieldtype CTF IR floating point number field type
995 @ingroup ctfirfieldtypes
996 @brief CTF IR floating point number field type.
999 #include <babeltrace/ctf-ir/field-types.h>
1002 A CTF IR <strong><em>floating point number field type</em></strong> is
1003 a field type that you can use to create concrete @floatfields.
1005 You can create a floating point number field type
1006 with bt_ctf_field_type_floating_point_create().
1008 A floating point number field type has the following properties:
1013 <th>Value at creation
1018 <td>\b Alignment (bits) of the described floating point
1021 <td>bt_ctf_field_type_get_alignment()
1022 <td>bt_ctf_field_type_set_alignment()
1025 <td><strong>Byte order</strong> of the described floating point
1027 <td>#BT_CTF_BYTE_ORDER_NATIVE
1028 <td>bt_ctf_field_type_get_byte_order()
1029 <td>bt_ctf_field_type_set_byte_order()
1032 <td><strong>Exponent storage size</strong> (bits) of the described
1033 floating point number fields
1035 <td>bt_ctf_field_type_floating_point_get_exponent_digits()
1036 <td>bt_ctf_field_type_floating_point_set_exponent_digits()
1039 <td><strong>Mantissa and sign storage size</strong> (bits) of the
1040 described floating point number fields
1041 <td>24 (23-bit mantissa, 1-bit sign)
1042 <td>bt_ctf_field_type_floating_point_get_mantissa_digits()
1043 <td>bt_ctf_field_type_floating_point_set_mantissa_digits()
1050 @addtogroup ctfirfloatfieldtype
1055 @brief Creates a default @floatft.
1057 @returns Created floating point number field type,
1058 or \c NULL on error.
1060 @postsuccessrefcountret1
1062 extern struct bt_ctf_field_type
*bt_ctf_field_type_floating_point_create(void);
1065 @brief Returns the exponent storage size of the @floatfields
1066 described by the @floatft \p float_field_type.
1068 @param[in] float_field_type Floating point number field type which
1069 describes the floating point number
1070 fields of which to get the exponent
1072 @returns Exponent storage size of the
1073 floating point number fields
1074 described by \p float_field_type,
1075 or a negative value on error.
1077 @prenotnull{float_field_type}
1078 @preisfloatft{float_field_type}
1079 @postrefcountsame{float_field_type}
1081 @sa bt_ctf_field_type_floating_point_set_exponent_digits(): Sets the
1082 exponent storage size of the floating point number fields
1083 described by a given floating point number field type.
1085 extern int bt_ctf_field_type_floating_point_get_exponent_digits(
1086 struct bt_ctf_field_type
*float_field_type
);
1089 @brief Sets the exponent storage size of the @floatfields described by
1090 the @floatft \p float_field_type to \p exponent_size.
1092 As of Babeltrace \btversion, \p exponent_size can only be 8 or 11.
1094 @param[in] float_field_type Floating point number field type which
1095 describes the floating point number
1096 fields of which to set the exponent
1098 @param[in] exponent_size Exponent storage size of the floating
1099 point number fields described by \p
1101 @returns 0 on success, or a negative value on error.
1103 @prenotnull{float_field_type}
1104 @preisfloatft{float_field_type}
1105 @prehot{float_field_type}
1106 @pre \p exponent_size is 8 or 11.
1107 @postrefcountsame{float_field_type}
1109 @sa bt_ctf_field_type_floating_point_get_exponent_digits(): Returns the
1110 exponent storage size of the floating point number fields
1111 described by a given floating point number field type.
1113 extern int bt_ctf_field_type_floating_point_set_exponent_digits(
1114 struct bt_ctf_field_type
*float_field_type
,
1115 unsigned int exponent_size
);
1118 @brief Returns the mantissa and sign storage size of the @floatfields
1119 described by the @floatft \p float_field_type.
1121 On success, the returned value is the sum of the mantissa \em and
1124 @param[in] float_field_type Floating point number field type which
1125 describes the floating point number
1126 fields of which to get the mantissa and
1128 @returns Mantissa and sign storage size of the
1129 floating point number fields
1130 described by \p float_field_type,
1131 or a negative value on error.
1133 @prenotnull{float_field_type}
1134 @preisfloatft{float_field_type}
1135 @postrefcountsame{float_field_type}
1137 @sa bt_ctf_field_type_floating_point_set_mantissa_digits(): Sets the
1138 mantissa and size storage size of the floating point number
1139 fields described by a given floating point number field type.
1141 extern int bt_ctf_field_type_floating_point_get_mantissa_digits(
1142 struct bt_ctf_field_type
*float_field_type
);
1145 @brief Sets the mantissa and sign storage size of the @floatfields
1146 described by the @floatft \p float_field_type to \p
1149 As of Babeltrace \btversion, \p mantissa_sign_size can only be 24 or 53.
1151 @param[in] float_field_type Floating point number field type which
1152 describes the floating point number
1153 fields of which to set the mantissa and
1155 @param[in] mantissa_sign_size Mantissa and sign storage size of the
1156 floating point number fields described
1157 by \p float_field_type.
1158 @returns 0 on success, or a negative value on error.
1160 @prenotnull{float_field_type}
1161 @preisfloatft{float_field_type}
1162 @prehot{float_field_type}
1163 @pre \p mantissa_sign_size is 24 or 53.
1164 @postrefcountsame{float_field_type}
1166 @sa bt_ctf_field_type_floating_point_get_mantissa_digits(): Returns the
1167 mantissa and sign storage size of the floating point number
1168 fields described by a given floating point number field type.
1170 extern int bt_ctf_field_type_floating_point_set_mantissa_digits(
1171 struct bt_ctf_field_type
*float_field_type
,
1172 unsigned int mantissa_sign_size
);
1177 @defgroup ctfirenumfieldtype CTF IR enumeration field type
1178 @ingroup ctfirfieldtypes
1179 @brief CTF IR enumeration field type.
1182 #include <babeltrace/ctf-ir/field-types.h>
1185 A CTF IR <strong><em>enumeration field type</em></strong> is
1186 a field type that you can use to create concrete @enumfields.
1188 You can create an enumeration field type with
1189 bt_ctf_field_type_enumeration_create(). This function needs a @intft
1190 which represents the storage field type of the created enumeration field
1191 type. In other words, an enumeration field type wraps an integer field
1192 type and adds label-value mappings to it.
1194 An enumeration mapping has:
1196 - A <strong>name</strong>.
1197 - A <strong>range of values</strong> given by a beginning and an ending
1198 value, both included in the range.
1200 You can add a mapping to an enumeration field type with
1201 bt_ctf_field_type_enumeration_add_mapping() or
1202 bt_ctf_field_type_enumeration_add_mapping_unsigned(), depending on the
1203 signedness of the wrapped @intft.
1205 Many mappings can share the same name, but the ranges of a given
1206 enumeration field type <strong>must not overlap</strong>. For example,
1207 this is a valid set of mappings:
1216 The following set of mappings is \em not valid, however:
1225 Here, the range of the second \c APPLE mapping overlaps the range of
1226 the \c CHERRY mapping.
1231 @addtogroup ctfirenumfieldtype
1236 @brief Creates a default @enumft wrapping the @intft \p int_field_type.
1238 @param[in] int_field_type Integer field type wrapped by the
1239 created enumeration field type.
1240 @returns Created enumeration field type,
1241 or \c NULL on error.
1243 @prenotnull{int_field_type}
1244 @preisintft{int_field_type}
1245 @postsuccessrefcountinc{int_field_type}
1246 @postsuccessrefcountret1
1248 extern struct bt_ctf_field_type
*bt_ctf_field_type_enumeration_create(
1249 struct bt_ctf_field_type
*int_field_type
);
1252 @brief Returns the @intft wrapped by the @enumft \p enum_field_type.
1254 @param[in] enum_field_type Enumeration field type of which to get
1255 the wrapped integer field type.
1256 @returns Integer field type wrapped by
1257 \p enum_field_type, or \c NULL on
1260 @prenotnull{enum_field_type}
1261 @preisenumft{enum_field_type}
1262 @postrefcountsame{enum_field_type}
1263 @postsuccessrefcountretinc
1266 struct bt_ctf_field_type
*bt_ctf_field_type_enumeration_get_container_type(
1267 struct bt_ctf_field_type
*enum_field_type
);
1270 @brief Returns the number of mappings contained in the
1271 @enumft \p enum_field_type.
1273 @param[in] enum_field_type Enumeration field type of which to get
1274 the number of contained mappings.
1275 @returns Number of mappings contained in
1276 \p enum_field_type, or a negative
1279 @prenotnull{enum_field_type}
1280 @preisenumft{enum_field_type}
1281 @postrefcountsame{enum_field_type}
1283 extern int bt_ctf_field_type_enumeration_get_mapping_count(
1284 struct bt_ctf_field_type
*enum_field_type
);
1287 @brief Returns the signed mapping of the @enumft
1288 \p enum_field_type at index \p index.
1290 The @intft wrapped by \p enum_field_type, as returned by
1291 bt_ctf_field_type_enumeration_get_container_type(), must be \b signed
1292 to use this function.
1294 On success, \p enum_field_type remains the sole owner of \p *name.
1296 @param[in] enum_field_type Enumeration field type of which to get
1297 the mapping at index \p index.
1298 @param[in] index Index of the mapping to get from
1300 @param[out] name Returned name of the mapping at index
1302 @param[out] range_begin Returned beginning of the range
1303 (included) of the mapping at index \p
1305 @param[out] range_end Returned end of the range (included) of
1306 the mapping at index \p index.
1307 @returns 0 on success, or a negative value on error.
1309 @prenotnull{enum_field_type}
1311 @prenotnull{range_begin}
1312 @prenotnull{range_end}
1313 @preisenumft{enum_field_type}
1314 @pre The wrapped @intft of \p enum_field_type is signed.
1315 @pre \p index is lesser than the number of mappings contained in the
1316 enumeration field type \p enum_field_type (see
1317 bt_ctf_field_type_enumeration_get_mapping_count()).
1318 @postrefcountsame{enum_field_type}
1320 @sa bt_ctf_field_type_enumeration_get_mapping_unsigned(): Returns the
1321 unsigned mapping contained by a given enumeration field type
1324 extern int bt_ctf_field_type_enumeration_get_mapping(
1325 struct bt_ctf_field_type
*enum_field_type
, int index
,
1326 const char **name
, int64_t *range_begin
, int64_t *range_end
);
1329 @brief Returns the unsigned mapping of the @enumft
1330 \p enum_field_type at index \p index.
1332 The @intft wrapped by \p enum_field_type, as returned by
1333 bt_ctf_field_type_enumeration_get_container_type(), must be
1334 \b unsigned to use this function.
1336 On success, \p enum_field_type remains the sole owner of \p *name.
1338 @param[in] enum_field_type Enumeration field type of which to get
1339 the mapping at index \p index.
1340 @param[in] index Index of the mapping to get from
1342 @param[out] name Returned name of the mapping at index
1344 @param[out] range_begin Returned beginning of the range
1345 (included) of the mapping at index \p
1347 @param[out] range_end Returned end of the range (included) of
1348 the mapping at index \p index.
1349 @returns 0 on success, or a negative value on error.
1351 @prenotnull{enum_field_type}
1353 @prenotnull{range_begin}
1354 @prenotnull{range_end}
1355 @preisenumft{enum_field_type}
1356 @pre The wrapped @intft of \p enum_field_type is unsigned.
1357 @pre \p index is lesser than the number of mappings contained in the
1358 enumeration field type \p enum_field_type (see
1359 bt_ctf_field_type_enumeration_get_mapping_count()).
1360 @postrefcountsame{enum_field_type}
1362 @sa bt_ctf_field_type_enumeration_get_mapping(): Returns the
1363 signed mapping contained by a given enumeration field type
1366 extern int bt_ctf_field_type_enumeration_get_mapping_unsigned(
1367 struct bt_ctf_field_type
*enum_field_type
, int index
,
1368 const char **name
, uint64_t *range_begin
,
1369 uint64_t *range_end
);
1371 /** @cond DOCUMENT */
1373 * TODO: Document once we know what to do with this function (return
1374 * the first match?).
1376 extern int bt_ctf_field_type_enumeration_get_mapping_index_by_name(
1377 struct bt_ctf_field_type
*enum_field_type
, const char *name
);
1381 @brief Returns the index of the signed mapping of the @enumft
1382 \p field_type which contains the value \p value.
1384 The @intft wrapped by \p enum_field_type, as returned by
1385 bt_ctf_field_type_enumeration_get_container_type(), must be
1386 \b signed to use this function.
1388 @param[in] enum_field_type Enumeration field type of which to get
1389 the index of the mapping which contains
1391 @param[in] value Value of the mapping to find.
1392 @returns Index of the mapping of
1393 \p enum_field_type which contains
1394 \p value, or a negative value if the
1395 function cannot find such a mapping or
1398 @prenotnull{enum_field_type}
1399 @preisenumft{enum_field_type}
1400 @pre The wrapped @intft of \p enum_field_type is signed.
1401 @postrefcountsame{enum_field_type}
1403 @sa bt_ctf_field_type_enumeration_get_mapping_index_by_unsigned_value():
1404 Finds the index of an unsigned mapping of a given enumeration
1405 field type by value.
1407 extern int bt_ctf_field_type_enumeration_get_mapping_index_by_value(
1408 struct bt_ctf_field_type
*enum_field_type
, int64_t value
);
1411 @brief Returns the index of the unsigned mapping of the @enumft
1412 \p field_type which contains the value \p value.
1414 The @intft wrapped by \p enum_field_type, as returned by
1415 bt_ctf_field_type_enumeration_get_container_type(), must be
1416 \b unsigned to use this function.
1418 @param[in] enum_field_type Enumeration field type of which to get
1419 the index of the mapping which contains
1421 @param[in] value Value of the mapping to find.
1422 @returns Index of the mapping of
1423 \p enum_field_type which contains
1424 \p value, or a negative value if the
1425 function cannot find such a mapping or
1428 @prenotnull{enum_field_type}
1429 @preisenumft{enum_field_type}
1430 @pre The wrapped @intft of \p enum_field_type is unsigned.
1431 @postrefcountsame{enum_field_type}
1433 @sa bt_ctf_field_type_enumeration_get_mapping_index_by_unsigned_value():
1434 Finds the index of a signed mapping of a given enumeration
1435 field type by value.
1437 extern int bt_ctf_field_type_enumeration_get_mapping_index_by_unsigned_value(
1438 struct bt_ctf_field_type
*enum_field_type
, uint64_t value
);
1441 @brief Adds a mapping to the @enumft \p enum_field_type which maps the
1442 name \p name to the signed range \p range_begin (included) to
1443 \p range_end (included).
1445 Make \p range_begin and \p range_end the same value to add a mapping
1448 The @intft wrapped by \p enum_field_type, as returned by
1449 bt_ctf_field_type_enumeration_get_container_type(), must be
1450 \b signed to use this function.
1452 A mapping in \p enum_field_type can exist with the name \p name, but
1453 there must be no overlap amongst all the ranges of
1456 @param[in] enum_field_type Enumeration field type to which to add
1458 @param[in] name Name of the mapping to add (copied
1460 @param[in] range_begin Beginning of the range of the mapping
1462 @param[in] range_end End of the range of the mapping
1464 @returns 0 on success, or a negative value on error.
1466 @prenotnull{enum_field_type}
1468 @preisenumft{enum_field_type}
1469 @pre The wrapped @intft of \p enum_field_type is signed.
1470 @pre \p range_end is greater than or equal to \p range_begin.
1471 @postrefcountsame{enum_field_type}
1473 @sa bt_ctf_field_type_enumeration_add_mapping_unsigned(): Adds an
1474 unsigned mapping to a given enumeration field type.
1476 extern int bt_ctf_field_type_enumeration_add_mapping(
1477 struct bt_ctf_field_type
*enum_field_type
, const char *name
,
1478 int64_t range_begin
, int64_t range_end
);
1481 @brief Adds a mapping to the @enumft \p enum_field_type which maps
1482 the name \p name to the unsigned
1483 range \p range_begin (included) to \p range_end (included).
1485 Make \p range_begin and \p range_end the same value to add a mapping
1488 The @intft wrapped by \p enum_field_type, as returned by
1489 bt_ctf_field_type_enumeration_get_container_type(), must be
1490 \b unsigned to use this function.
1492 A mapping in \p enum_field_type can exist with the name \p name, but
1493 there must be no overlap amongst all the ranges of
1496 @param[in] enum_field_type Enumeration field type to which to add
1498 @param[in] name Name of the mapping to add (copied
1500 @param[in] range_begin Beginning of the range of the mapping
1502 @param[in] range_end End of the range of the mapping
1504 @returns 0 on success, or a negative value on error.
1506 @prenotnull{enum_field_type}
1508 @preisenumft{enum_field_type}
1509 @pre The wrapped @intft of \p enum_field_type is unsigned.
1510 @pre \p range_end is greater than or equal to \p range_begin.
1511 @postrefcountsame{enum_field_type}
1513 @sa bt_ctf_field_type_enumeration_add_mapping(): Adds a signed
1514 mapping to a given enumeration field type.
1516 extern int bt_ctf_field_type_enumeration_add_mapping_unsigned(
1517 struct bt_ctf_field_type
*enum_field_type
, const char *name
,
1518 uint64_t range_begin
, uint64_t range_end
);
1523 @defgroup ctfirstringfieldtype CTF IR string field type
1524 @ingroup ctfirfieldtypes
1525 @brief CTF IR string field type.
1528 #include <babeltrace/ctf-ir/field-types.h>
1531 A CTF IR <strong><em>string field type</em></strong> is a field type that
1532 you can use to create concrete @stringfields.
1534 You can create a string field type
1535 with bt_ctf_field_type_string_create().
1537 A string field type has only one property: the \b encoding of its
1538 described @stringfields. By default, the encoding of the string fields
1539 described by a string field type is #BT_CTF_STRING_ENCODING_UTF8. You
1540 can set the encoding of the string fields described by a string field
1541 type with bt_ctf_field_type_string_set_encoding().
1543 @sa ctfirstringfield
1546 @addtogroup ctfirstringfieldtype
1551 @brief Creates a default @stringft.
1553 @returns Created string field type, or \c NULL on error.
1555 @postsuccessrefcountret1
1557 extern struct bt_ctf_field_type
*bt_ctf_field_type_string_create(void);
1560 @brief Returns the encoding of the @stringfields described by
1561 the @stringft \p string_field_type.
1563 @param[in] string_field_type String field type which describes the
1564 string fields of which to get the
1566 @returns Encoding of the string
1567 fields described by \p string_field_type,
1568 or #BT_CTF_STRING_ENCODING_UNKNOWN on
1571 @prenotnull{string_field_type}
1572 @preisstringft{string_field_type}
1573 @postrefcountsame{string_field_type}
1575 @sa bt_ctf_field_type_string_set_encoding(): Sets the encoding
1576 of the string fields described by a given string field type.
1578 extern enum bt_ctf_string_encoding
bt_ctf_field_type_string_get_encoding(
1579 struct bt_ctf_field_type
*string_field_type
);
1582 @brief Sets the encoding of the @stringfields described by the
1583 @stringft \p string_field_type to \p encoding.
1585 @param[in] string_field_type String field type which describes the
1586 string fields of which to set the
1588 @param[in] encoding Encoding of the string fields described
1589 by \p string_field_type.
1590 @returns 0 on success, or a negative value on error.
1592 @prenotnull{string_field_type}
1593 @preisstringft{string_field_type}
1594 @prehot{string_field_type}
1595 @pre \p encoding is #BT_CTF_STRING_ENCODING_ASCII or
1596 #BT_CTF_STRING_ENCODING_UTF8.
1597 @postrefcountsame{string_field_type}
1599 @sa bt_ctf_field_type_string_get_encoding(): Returns the encoding of
1600 the string fields described by a given string field type.
1602 extern int bt_ctf_field_type_string_set_encoding(
1603 struct bt_ctf_field_type
*string_field_type
,
1604 enum bt_ctf_string_encoding encoding
);
1609 @defgroup ctfirstructfieldtype CTF IR structure field type
1610 @ingroup ctfirfieldtypes
1611 @brief CTF IR structure field type.
1614 #include <babeltrace/ctf-ir/field-types.h>
1617 A CTF IR <strong><em>structure field type</em></strong> is
1618 a field type that you can use to create concrete @structfields.
1620 You can create a structure field type
1621 with bt_ctf_field_type_structure_create(). This function creates
1622 an empty structure field type, with no fields.
1624 You can add a field to a structure field type with
1625 bt_ctf_field_type_structure_add_field(). Two fields in a structure
1626 field type cannot have the same name.
1628 You can set the \em minimum alignment of the structure fields described
1629 by a structure field type with the common
1630 bt_ctf_field_type_set_alignment() function. The \em effective alignment
1631 of the structure fields described by a structure field type, as per
1632 <a href="http://diamon.org/ctf/">CTF</a>, is the \em maximum value amongst
1633 the effective alignments of all its fields. Note that the effective
1634 alignment of @varfields is always 1.
1636 You can set the byte order of <em>all the contained fields</em>,
1637 recursively, of a structure field type with the common
1638 bt_ctf_field_type_set_byte_order() function.
1640 @sa ctfirstructfield
1643 @addtogroup ctfirstructfieldtype
1648 @brief Creates a default, empty @structft.
1650 @returns Created structure field type,
1651 or \c NULL on error.
1653 @postsuccessrefcountret1
1655 extern struct bt_ctf_field_type
*bt_ctf_field_type_structure_create(void);
1658 @brief Returns the number of fields contained in the
1659 @structft \p struct_field_type.
1661 @param[in] struct_field_type Structure field type of which to get
1662 the number of contained fields.
1663 @returns Number of fields contained in
1664 \p struct_field_type, or a negative
1667 @prenotnull{struct_field_type}
1668 @preisstructft{struct_field_type}
1669 @postrefcountsame{struct_field_type}
1671 extern int bt_ctf_field_type_structure_get_field_count(
1672 struct bt_ctf_field_type
*struct_field_type
);
1675 @brief Returns the field of the @structft \p struct_field_type
1678 On success, the field's type is placed in \p *field_type if
1679 \p field_type is not \c NULL. The field's name is placed in
1680 \p *field_name if \p field_name is not \c NULL.
1681 \p struct_field_type remains the sole owner of \p *field_name.
1683 @param[in] struct_field_type Structure field type of which to get
1684 the field at index \p index.
1685 @param[out] field_name Returned name of the field at index
1686 \p index (can be \c NULL).
1687 @param[out] field_type Returned field type of the field
1688 at index \p index (can be \c NULL).
1689 @param[in] index Index of the field to get from
1690 \p struct_field_type.
1691 @returns 0 on success, or a negative value on error.
1693 @prenotnull{struct_field_type}
1694 @preisstructft{struct_field_type}
1695 @pre \p index is lesser than the number of fields contained in the
1696 structure field type \p struct_field_type (see
1697 bt_ctf_field_type_structure_get_field_count()).
1698 @postrefcountsame{struct_field_type}
1699 @post <strong>On success</strong>, the returned field's type is placed
1700 in \p *field_type and its reference count is incremented.
1702 @sa bt_ctf_field_type_structure_get_field_type_by_name(): Finds a
1703 structure field type's field by name.
1705 extern int bt_ctf_field_type_structure_get_field(
1706 struct bt_ctf_field_type
*struct_field_type
,
1707 const char **field_name
, struct bt_ctf_field_type
**field_type
,
1711 @brief Returns the type of the field named \p field_name found in
1712 the @structft \p struct_field_type.
1714 @param[in] struct_field_type Structure field type of which to get
1716 @param[in] field_name Name of the field to find.
1717 @returns Type of the field named \p field_name in
1718 \p struct_field_type, or
1721 @prenotnull{struct_field_type}
1722 @prenotnull{field_name}
1723 @preisstructft{struct_field_type}
1724 @postrefcountsame{struct_field_type}
1725 @postsuccessrefcountretinc
1727 @sa bt_ctf_field_type_structure_get_field(): Finds a
1728 structure field type's field by index.
1731 struct bt_ctf_field_type
*bt_ctf_field_type_structure_get_field_type_by_name(
1732 struct bt_ctf_field_type
*struct_field_type
,
1733 const char *field_name
);
1736 @brief Adds a field named \p field_name with the @ft
1737 \p field_type to the @structft \p struct_field_type.
1739 On success, \p field_type becomes the child of \p struct_field_type.
1741 This function adds the new field after the current last field of
1742 \p struct_field_type (append mode).
1744 You \em cannot add a field named \p field_name if there's already a
1745 field named \p field_name in \p struct_field_type.
1747 @param[in] struct_field_type Structure field type to which to add
1749 @param[in] field_type Field type of the field to add to
1750 \p struct_field_type.
1751 @param[in] field_name Name of the field to add to
1752 \p struct_field_type
1753 (copied on success).
1754 @returns 0 on success, or a negative value on error.
1756 @prenotnull{struct_field_type}
1757 @prenotnull{field_type}
1758 @prenotnull{field_name}
1759 @preisstructft{struct_field_type}
1760 @pre \p field_type is not and does not contain \p struct_field_type,
1761 recursively, as a field's type.
1762 @prehot{struct_field_type}
1763 @postrefcountsame{struct_field_type}
1764 @postsuccessrefcountinc{field_type}
1766 extern int bt_ctf_field_type_structure_add_field(
1767 struct bt_ctf_field_type
*struct_field_type
,
1768 struct bt_ctf_field_type
*field_type
,
1769 const char *field_name
);
1774 @defgroup ctfirarrayfieldtype CTF IR array field type
1775 @ingroup ctfirfieldtypes
1776 @brief CTF IR array field type.
1779 #include <babeltrace/ctf-ir/field-types.h>
1782 A CTF IR <strong><em>array field type</em></strong> is a field type that
1783 you can use to create concrete @arrayfields.
1785 You can create an array field type
1786 with bt_ctf_field_type_array_create(). This function needs
1787 the @ft of the fields contained by the array fields described by the
1788 array field type to create.
1793 @addtogroup ctfirarrayfieldtype
1798 @brief Creates a default @arrayft with
1799 \p element_field_type as the field type of the fields contained
1800 in its described @arrayfields of length \p length.
1802 @param[in] element_field_type Field type of the fields contained in
1803 the array fields described by the
1804 created array field type.
1805 @param[in] length Length of the array fields described by
1806 the created array field type.
1807 @returns Created array field type, or
1810 @prenotnull{element_field_type}
1811 @postsuccessrefcountinc{element_field_type}
1812 @postsuccessrefcountret1
1814 extern struct bt_ctf_field_type
*bt_ctf_field_type_array_create(
1815 struct bt_ctf_field_type
*element_field_type
,
1816 unsigned int length
);
1819 @brief Returns the @ft of the @fields contained in
1820 the @arrayfields described by the @arrayft \p array_field_type.
1822 @param[in] array_field_type Array field type of which to get
1823 the type of the fields contained in its
1824 described array fields.
1825 @returns Type of the fields contained in the
1826 array fields described by
1827 \p array_field_type, or \c NULL
1830 @prenotnull{array_field_type}
1831 @preisarrayft{array_field_type}
1832 @postrefcountsame{array_field_type}
1833 @postsuccessrefcountretinc
1835 extern struct bt_ctf_field_type
*bt_ctf_field_type_array_get_element_type(
1836 struct bt_ctf_field_type
*array_field_type
);
1839 @brief Returns the number of @fields contained in the
1840 @arrayfields described by the @arrayft \p array_field_type.
1842 @param[in] array_field_type Array field type of which to get
1843 the number of fields contained in its
1844 described array fields.
1845 @returns Number of fields contained in the
1846 array fields described by
1847 \p array_field_type, or a negative value
1850 @prenotnull{array_field_type}
1851 @preisarrayft{array_field_type}
1852 @postrefcountsame{array_field_type}
1854 extern int64_t bt_ctf_field_type_array_get_length(
1855 struct bt_ctf_field_type
*array_field_type
);
1860 @defgroup ctfirseqfieldtype CTF IR sequence field type
1861 @ingroup ctfirfieldtypes
1862 @brief CTF IR sequence field type.
1865 #include <babeltrace/ctf-ir/field-types.h>
1868 A CTF IR <strong><em>sequence field type</em></strong> is
1869 a field type that you can use to create concrete @seqfields.
1871 You can create a sequence field type with
1872 bt_ctf_field_type_sequence_create(). This function needs the @ft
1873 of the fields contained by the sequence fields described by the created
1874 sequence field type. This function also needs the length name of the
1875 sequence field type to create. The length name is used to automatically
1876 resolve the length's field type. See \ref ctfirfieldtypes to learn more
1877 about the automatic resolving.
1882 @addtogroup ctfirseqfieldtype
1887 @brief Creates a default @seqft with \p element_field_type as the
1888 @ft of the @fields contained in its described @seqfields
1889 with the length name \p length_name.
1891 \p length_name can be an absolute or relative reference. See
1892 <a href="http://diamon.org/ctf/">CTF</a> for more details.
1894 @param[in] element_field_type Field type of the fields contained in
1895 the sequence fields described by the
1896 created sequence field type.
1897 @param[in] length_name Length name (copied on success).
1898 @returns Created array field type, or
1901 @prenotnull{element_field_type}
1902 @prenotnull{length_name}
1903 @postsuccessrefcountinc{element_field_type}
1904 @postsuccessrefcountret1
1906 extern struct bt_ctf_field_type
*bt_ctf_field_type_sequence_create(
1907 struct bt_ctf_field_type
*element_field_type
,
1908 const char *length_name
);
1911 @brief Returns the @ft of the @fields contained in the @seqft
1912 described by the @seqft \p sequence_field_type.
1914 @param[in] sequence_field_type Sequence field type of which to get
1915 the type of the fields contained in its
1916 described sequence fields.
1917 @returns Type of the fields contained in the
1918 sequence fields described by
1919 \p sequence_field_type, or \c NULL
1922 @prenotnull{sequence_field_type}
1923 @preisseqft{sequence_field_type}
1924 @postrefcountsame{sequence_field_type}
1925 @postsuccessrefcountretinc
1927 extern struct bt_ctf_field_type
*bt_ctf_field_type_sequence_get_element_type(
1928 struct bt_ctf_field_type
*sequence_field_type
);
1931 @brief Returns the length name of the @seqft \p sequence_field_type.
1933 On success, \p sequence_field_type remains the sole owner of
1934 the returned string.
1936 @param[in] sequence_field_type Sequence field type of which to get the
1938 @returns Length name of \p sequence_field_type,
1939 or \c NULL on error.
1941 @prenotnull{sequence_field_type}
1942 @preisseqft{sequence_field_type}
1944 @sa bt_ctf_field_type_sequence_get_length_field_path(): Returns the
1945 length's CTF IR field path of a given sequence field type.
1947 extern const char *bt_ctf_field_type_sequence_get_length_field_name(
1948 struct bt_ctf_field_type
*sequence_field_type
);
1951 @brief Returns the length's CTF IR field path of the @seqft
1952 \p sequence_field_type.
1954 The length's field path of a sequence field type is set when automatic
1955 resolving is performed (see \ref ctfirfieldtypes).
1957 @param[in] sequence_field_type Sequence field type of which to get the
1958 length's field path.
1959 @returns Length's field path of
1960 \p sequence_field_type, or
1961 \c NULL if the length's field path is
1962 not set yet is not set or on error.
1964 @prenotnull{sequence_field_type}
1965 @preisseqft{sequence_field_type}
1966 @postsuccessrefcountretinc
1968 @sa bt_ctf_field_type_sequence_get_length_field_name(): Returns the
1969 length's name of a given sequence field type.
1971 extern struct bt_ctf_field_path
*bt_ctf_field_type_sequence_get_length_field_path(
1972 struct bt_ctf_field_type
*sequence_field_type
);
1977 @defgroup ctfirvarfieldtype CTF IR variant field type
1978 @ingroup ctfirfieldtypes
1979 @brief CTF IR variant field type.
1982 #include <babeltrace/ctf-ir/field-types.h>
1985 A CTF IR <strong><em>variant field type</em></strong> is
1986 a field type that you can use to create concrete @varfields.
1988 You can create a variant field type with
1989 bt_ctf_field_type_variant_create(). This function expects you to pass
1990 both the tag's @enumft and the tag name of the variant field type to
1991 create. The tag's field type is optional, as the Babeltrace system can
1992 automatically resolve it using the tag name. You can leave the tag name
1993 to \c NULL initially, and set it later with
1994 bt_ctf_field_type_variant_set_tag_name(). The tag name must be set when
1995 the variant field type is frozen. See \ref ctfirfieldtypes to learn more
1996 about the automatic resolving and the conditions under which a field
1999 You can add a field to a variant field type with
2000 bt_ctf_field_type_variant_add_field(). All the field names of a
2001 variant field type \em must exist as mapping names in its tag's @enumft.
2003 The effective alignment of the @varfields described by a
2004 variant field type is always 1, but the individual fields of a
2005 @varfield can have custom alignments.
2007 You can set the byte order of <em>all the contained fields</em>,
2008 recursively, of a variant field type with the common
2009 bt_ctf_field_type_set_byte_order() function.
2014 @addtogroup ctfirvarfieldtype
2019 @brief Creates a default, empty @varft with the tag's @enumft
2020 \p tag_field_type and the tag name \p tag_name.
2022 \p tag_field_type can be \c NULL; the tag's field type can be
2023 automatically resolved from the variant field type's tag name (see
2024 \ref ctfirfieldtypes). If \p tag_name is \c NULL, it \em must be set
2025 with bt_ctf_field_type_variant_set_tag_name() \em before the variant
2026 field type is frozen.
2028 \p tag_name can be an absolute or relative reference. See
2029 <a href="http://diamon.org/ctf/">CTF</a> for more details.
2031 @param[in] tag_field_type Tag's enumeration field type
2033 @param[in] tag_name Tag name (copied on success,
2035 @returns Created variant field type, or
2038 @pre \p tag_field_type is an enumeration field type or \c NULL.
2039 @post <strong>On success, if \p tag_field_type is not \c NULL</strong>,
2040 its reference count is incremented.
2041 @postsuccessrefcountret1
2043 extern struct bt_ctf_field_type
*bt_ctf_field_type_variant_create(
2044 struct bt_ctf_field_type
*tag_field_type
,
2045 const char *tag_name
);
2048 @brief Returns the tag's @enumft of the @varft \p variant_field_type.
2050 @param[in] variant_field_type Variant field type of which to get
2051 the tag's enumeration field type.
2052 @returns Tag's enumeration field type of
2053 \p variant_field_type, or \c NULL if the
2054 tag's field type is not set or on
2057 @prenotnull{variant_field_type}
2058 @preisvarft{variant_field_type}
2059 @postrefcountsame{variant_field_type}
2060 @postsuccessrefcountretinc
2062 extern struct bt_ctf_field_type
*bt_ctf_field_type_variant_get_tag_type(
2063 struct bt_ctf_field_type
*variant_field_type
);
2066 @brief Returns the tag name of the @varft \p variant_field_type.
2068 On success, \p variant_field_type remains the sole owner of
2069 the returned string.
2071 @param[in] variant_field_type Variant field type of which to get the
2073 @returns Tag name of \p variant_field_type, or
2074 \c NULL if the tag name is not set or
2077 @prenotnull{variant_field_type}
2078 @preisvarft{variant_field_type}
2080 @sa bt_ctf_field_type_variant_set_tag_name(): Sets the tag name of
2081 a given variant field type.
2082 @sa bt_ctf_field_type_variant_get_tag_field_path(): Returns the tag's
2083 CTF IR field path of a given variant field type.
2085 extern const char *bt_ctf_field_type_variant_get_tag_name(
2086 struct bt_ctf_field_type
*variant_field_type
);
2089 @brief Sets the tag name of the @varft \p variant_field_type.
2091 \p tag_name can be an absolute or relative reference. See
2092 <a href="http://diamon.org/ctf/">CTF</a> for more details.
2094 @param[in] variant_field_type Variant field type of which to set
2096 @param[in] tag_name Tag name of \p variant_field_type
2097 (copied on success).
2098 @returns 0 on success, or a negative value on error.
2100 @prenotnull{variant_field_type}
2102 @prehot{variant_field_type}
2103 @postrefcountsame{variant_field_type}
2105 @sa bt_ctf_field_type_variant_get_tag_name(): Returns the tag name of
2106 a given variant field type.
2108 extern int bt_ctf_field_type_variant_set_tag_name(
2109 struct bt_ctf_field_type
*variant_field_type
,
2110 const char *tag_name
);
2113 @brief Returns the tag's CTF IR field path of the @varft
2114 \p variant_field_type.
2116 The tag's field path of a variant field type is set when automatic
2117 resolving is performed (see \ref ctfirfieldtypes).
2119 @param[in] variant_field_type Variant field type of which to get the
2121 @returns Tag's field path of
2122 \p variant_field_type, or
2123 \c NULL if the tag's field path is not
2124 set yet is not set or on error.
2126 @prenotnull{variant_field_type}
2127 @preisvarft{variant_field_type}
2128 @postsuccessrefcountretinc
2130 @sa bt_ctf_field_type_variant_get_tag_name(): Returns the tag's
2131 name of a given variant field type.
2133 extern struct bt_ctf_field_path
*bt_ctf_field_type_variant_get_tag_field_path(
2134 struct bt_ctf_field_type
*variant_field_type
);
2137 @brief Returns the number of fields (choices) contained in the @varft
2138 \p variant_field_type.
2140 @param[in] variant_field_type Variant field type of which to get
2141 the number of contained fields.
2142 @returns Number of fields contained in
2143 \p variant_field_type, or a negative
2146 @prenotnull{variant_field_type}
2147 @preisvarft{variant_field_type}
2148 @postrefcountsame{variant_field_type}
2150 extern int bt_ctf_field_type_variant_get_field_count(
2151 struct bt_ctf_field_type
*variant_field_type
);
2154 @brief Returns the field (choice) of the @varft \p variant_field_type
2157 On success, the field's type is placed in \p *field_type if
2158 \p field_type is not \c NULL. The field's name is placed in
2159 \p *field_name if \p field_name is not \c NULL.
2160 \p variant_field_type remains the sole owner of \p *field_name.
2162 @param[in] variant_field_type Variant field type of which to get
2163 the field at index \p index.
2164 @param[out] field_name Returned name of the field at index
2165 \p index (can be \c NULL).
2166 @param[out] field_type Returned field type of the field
2167 at index \p index (can be \c NULL).
2168 @param[in] index Index of the field to get from
2169 \p variant_field_type.
2170 @returns 0 on success, or a negative value on error.
2172 @prenotnull{variant_field_type}
2173 @preisvarft{variant_field_type}
2174 @pre \p index is lesser than the number of fields contained in the
2175 variant field type \p variant_field_type (see
2176 bt_ctf_field_type_variant_get_field_count()).
2177 @postrefcountsame{variant_field_type}
2178 @post <strong>On success</strong>, the returned field's type is placed
2179 in \p *field_type and its reference count is incremented.
2181 @sa bt_ctf_field_type_variant_get_field_type_by_name(): Finds a variant
2182 field type's field by name.
2183 @sa bt_ctf_field_type_variant_get_field_type_from_tag(): Finds a variant
2184 field type's field by current tag value.
2186 extern int bt_ctf_field_type_variant_get_field(
2187 struct bt_ctf_field_type
*variant_field_type
,
2188 const char **field_name
,
2189 struct bt_ctf_field_type
**field_type
, int index
);
2192 @brief Returns the type of the field (choice) named \p field_name
2193 found in the @varft \p variant_field_type.
2195 @param[in] variant_field_type Variant field type of which to get
2197 @param[in] field_name Name of the field to find.
2198 @returns Type of the field named \p field_name in
2199 \p variant_field_type, or
2202 @prenotnull{variant_field_type}
2203 @prenotnull{field_name}
2204 @preisvarft{variant_field_type}
2205 @postrefcountsame{variant_field_type}
2206 @postsuccessrefcountretinc
2208 @sa bt_ctf_field_type_variant_get_field(): Finds a variant field type's
2210 @sa bt_ctf_field_type_variant_get_field_type_from_tag(): Finds a variant
2211 field type's field by current tag value.
2214 struct bt_ctf_field_type
*bt_ctf_field_type_variant_get_field_type_by_name(
2215 struct bt_ctf_field_type
*variant_field_type
,
2216 const char *field_name
);
2219 @brief Returns the type of the field (choice) selected by the value of
2220 the @enumfield \p tag_field in the @varft \p variant_field_type.
2222 \p tag_field is the current tag value.
2224 The field type of \p tag_field, as returned by bt_ctf_field_get_type(),
2225 \em must be equivalent to the field type returned by
2226 bt_ctf_field_type_variant_get_tag_type() for \p variant_field_type.
2228 @param[in] variant_field_type Variant field type of which to get
2230 @param[in] tag_field Current tag value (variant field type's
2232 @returns Type of the field selected by
2233 \p tag_field in \p variant_field_type,
2234 or \c NULL on error.
2236 @prenotnull{variant_field_type}
2237 @prenotnull{tag_field}
2238 @preisvarft{variant_field_type}
2239 @preisenumfield{tag_field}
2240 @postrefcountsame{variant_field_type}
2241 @postrefcountsame{tag_field}
2242 @postsuccessrefcountretinc
2244 @sa bt_ctf_field_type_variant_get_field(): Finds a variant field type's
2246 @sa bt_ctf_field_type_variant_get_field_type_by_name(): Finds a variant
2247 field type's field by name.
2250 struct bt_ctf_field_type
*bt_ctf_field_type_variant_get_field_type_from_tag(
2251 struct bt_ctf_field_type
*variant_field_type
,
2252 struct bt_ctf_field
*tag_field
);
2255 @brief Adds a field (a choice) named \p field_name with the @ft
2256 \p field_type to the @varft \p variant_field_type.
2258 On success, \p field_type becomes the child of \p variant_field_type.
2260 You \em cannot add a field named \p field_name if there's already a
2261 field named \p field_name in \p variant_field_type.
2263 \p field_name \em must name an existing mapping in the tag's
2264 enumeration field type of \p variant_field_type.
2266 @param[in] variant_field_type Variant field type to which to add
2268 @param[in] field_type Field type of the field to add to
2269 \p variant_field_type.
2270 @param[in] field_name Name of the field to add to
2271 \p variant_field_type
2272 (copied on success).
2273 @returns 0 on success, or a negative value on error.
2275 @prenotnull{variant_field_type}
2276 @prenotnull{field_type}
2277 @prenotnull{field_name}
2278 @preisvarft{variant_field_type}
2279 @pre \p field_type is not and does not contain \p variant_field_type,
2280 recursively, as a field's type.
2281 @prehot{variant_field_type}
2282 @postrefcountsame{variant_field_type}
2283 @postsuccessrefcountinc{field_type}
2285 extern int bt_ctf_field_type_variant_add_field(
2286 struct bt_ctf_field_type
*variant_field_type
,
2287 struct bt_ctf_field_type
*field_type
,
2288 const char *field_name
);
2296 #endif /* BABELTRACE_CTF_IR_FIELD_TYPES_H */