#include <stdint.h>
#include <stddef.h>
+#include <babeltrace/ctf-ir/field-types.h>
+#include <babeltrace/types.h>
#ifdef __cplusplus
extern "C" {
You can get a reference to the @ft which was used to create a field with
bt_ctf_field_get_type(). You can get the
-\link #bt_ctf_type_id type ID\endlink of this field type directly with
+\link #bt_ctf_field_type_id type ID\endlink of this field type directly with
bt_ctf_field_get_type_id().
You can get a deep copy of a field with bt_ctf_field_copy(). The field
@param[in] field Field of which to get the type ID of its
parent field type..
@returns Type ID of the parent field type of \p field,
- or #BT_CTF_TYPE_ID_UNKNOWN on error.
+ or #BT_CTF_FIELD_TYPE_ID_UNKNOWN on error.
@prenotnull{field}
@postrefcountsame{field}
-@sa #bt_ctf_type_id: CTF IR field type ID.
+@sa #bt_ctf_field_type_id: CTF IR field type ID.
@sa bt_ctf_field_is_integer(): Returns whether or not a given field is a
@intfield.
@sa bt_ctf_field_is_floating_point(): Returns whether or not a given
@sa bt_ctf_field_is_variant(): Returns whether or not a given field is a
@varfield.
*/
-extern enum bt_ctf_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field);
+extern enum bt_ctf_field_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field);
/*
* bt_ctf_field_signed_integer_get_value: get a signed integer field's value
@brief Returns whether or not the @field \p field is a @intfield.
@param[in] field Field to check (can be \c NULL).
-@returns 1 if \p field is an integer field, or 0
- otherwise (including if \p field is
+@returns #BT_TRUE if \p field is an integer field, or
+ #BT_FALSE otherwise (including if \p field is
\c NULL).
@prenotnull{field}
@sa bt_ctf_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern int bt_ctf_field_is_integer(struct bt_ctf_field *field);
+extern bt_bool bt_ctf_field_is_integer(struct bt_ctf_field *field);
/**
@brief Returns whether or not the @field \p field is a @floatfield.
@param[in] field Field to check (can be \c NULL).
-@returns 1 if \p field is a floating point number field,
- or 0 otherwise (including if \p field is
+@returns #BT_TRUE if \p field is a floating point number fiel
+ #BT_FALSE or 0 otherwise (including if \p field is
\c NULL).
@prenotnull{field}
@sa bt_ctf_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern int bt_ctf_field_is_floating_point(struct bt_ctf_field *field);
+extern bt_bool bt_ctf_field_is_floating_point(struct bt_ctf_field *field);
/**
@brief Returns whether or not the @field \p field is a @enumfield.
@param[in] field Field to check (can be \c NULL).
-@returns 1 if \p field is an enumeration field, or 0
- otherwise (including if \p field is
+@returns #BT_TRUE if \p field is an enumeration field, or
+ #BT_FALSE otherwise (including if \p field is
\c NULL).
@prenotnull{field}
@sa bt_ctf_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern int bt_ctf_field_is_enumeration(struct bt_ctf_field *field);
+extern bt_bool bt_ctf_field_is_enumeration(struct bt_ctf_field *field);
/**
@brief Returns whether or not the @field \p field is a @stringfield.
@param[in] field Field to check (can be \c NULL).
-@returns 1 if \p field is a string field, or 0
- otherwise (including if \p field is
+@returns #BT_TRUE if \p field is a string field, or
+ #BT_FALSE otherwise (including if \p field is
\c NULL).
@prenotnull{field}
@sa bt_ctf_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern int bt_ctf_field_is_string(struct bt_ctf_field *field);
+extern bt_bool bt_ctf_field_is_string(struct bt_ctf_field *field);
/**
@brief Returns whether or not the @field \p field is a @structfield.
@param[in] field Field to check (can be \c NULL).
-@returns 1 if \p field is a structure field, or 0
- otherwise (including if \p field is
+@returns #BT_TRUE if \p field is a structure field, or
+ #BT_FALSE otherwise (including if \p field is
\c NULL).
@prenotnull{field}
@sa bt_ctf_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern int bt_ctf_field_is_structure(struct bt_ctf_field *field);
+extern bt_bool bt_ctf_field_is_structure(struct bt_ctf_field *field);
/**
@brief Returns whether or not the @field \p field is a @arrayfield.
@param[in] field Field to check (can be \c NULL).
-@returns 1 if \p field is an array field, or 0
- otherwise (including if \p field is
+@returns #BT_TRUE if \p field is an array field, or
+ #BT_FALSE otherwise (including if \p field is
\c NULL).
@prenotnull{field}
@sa bt_ctf_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern int bt_ctf_field_is_array(struct bt_ctf_field *field);
+extern bt_bool bt_ctf_field_is_array(struct bt_ctf_field *field);
/**
@brief Returns whether or not the @field \p field is a @seqfield.
@param[in] field Field to check (can be \c NULL).
-@returns 1 if \p field is a sequence field, or 0
- otherwise (including if \p field is
+@returns #BT_TRUE if \p field is a sequence field, or
+ #BT_FALSE otherwise (including if \p field is
\c NULL).
@prenotnull{field}
@sa bt_ctf_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern int bt_ctf_field_is_sequence(struct bt_ctf_field *field);
+extern bt_bool bt_ctf_field_is_sequence(struct bt_ctf_field *field);
/**
@brief Returns whether or not the @field \p field is a @varfield.
@param[in] field Field to check (can be \c NULL).
-@returns 1 if \p field is a variant field, or 0
- otherwise (including if \p field is
+@returns #BT_TRUE if \p field is a variant field, or
+ #BT_FALSE otherwise (including if \p field is
\c NULL).
@prenotnull{field}
@sa bt_ctf_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern int bt_ctf_field_is_variant(struct bt_ctf_field *field);
+extern bt_bool bt_ctf_field_is_variant(struct bt_ctf_field *field);
/** @} */
@sa bt_ctf_field_structure_set_field(): Sets the field of a given
structure field.
*/
-extern struct bt_ctf_field *bt_ctf_field_structure_get_field(
+extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
struct bt_ctf_field *struct_field, const char *name);
+/* Pre-2.0 CTF writer compatibility */
+#define bt_ctf_field_structure_get_field bt_ctf_field_structure_get_field_by_name
+
/**
@brief Returns the @field at index \p index in the @structfield
\p struct_field.
structure field.
*/
extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
- struct bt_ctf_field *struct_field, int index);
+ struct bt_ctf_field *struct_field, uint64_t index);
/**
@brief Sets the field of the @structfield \p struct_field named \p name