Avoid unnecessary inclusions in public headers
[babeltrace.git] / include / babeltrace / ctf-ir / fields.h
index 5a030b356e7d4454b32c7c0d892291c3016b3dc5..f881e24a59341f1ef0fef13d0ee3233abb6fad6b 100644 (file)
 
 #include <stdint.h>
 #include <stddef.h>
-#include <babeltrace/ctf-ir/field-types.h>
+
+/* For bt_bool */
+#include <babeltrace/types.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct bt_ctf_field_type;
+
 /**
 @defgroup ctfirfields CTF IR fields
 @ingroup ctfir
@@ -84,13 +88,14 @@ contained fields with the following getters if such fields do not exist
 yet:
 
 - bt_ctf_field_enumeration_get_container()
-- bt_ctf_field_structure_get_field()
+- bt_ctf_field_structure_get_field_by_name()
 - bt_ctf_field_array_get_field()
 - bt_ctf_field_sequence_get_field()
 - bt_ctf_field_variant_get_field()
 
 If you already have a field object, you can also assign it to a specific
-name within a @structfield with bt_ctf_field_structure_set_field().
+name within a @structfield with
+bt_ctf_field_structure_set_field_by_name().
 
 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
@@ -230,8 +235,8 @@ extern int bt_ctf_field_signed_integer_get_value(struct bt_ctf_field *integer,
 @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}
@@ -240,14 +245,14 @@ extern int bt_ctf_field_signed_integer_get_value(struct bt_ctf_field *integer,
 @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}
@@ -256,14 +261,14 @@ extern int bt_ctf_field_is_integer(struct bt_ctf_field *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}
@@ -272,14 +277,14 @@ extern int bt_ctf_field_is_floating_point(struct bt_ctf_field *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}
@@ -288,14 +293,14 @@ extern int bt_ctf_field_is_enumeration(struct bt_ctf_field *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}
@@ -304,14 +309,14 @@ extern int bt_ctf_field_is_string(struct bt_ctf_field *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}
@@ -320,14 +325,14 @@ extern int bt_ctf_field_is_structure(struct bt_ctf_field *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}
@@ -336,14 +341,14 @@ extern int bt_ctf_field_is_array(struct bt_ctf_field *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}
@@ -352,7 +357,7 @@ extern int bt_ctf_field_is_sequence(struct bt_ctf_field *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);
 
 /** @} */
 
@@ -827,10 +832,10 @@ contains an ordered list of zero or more named @fields which can be
 different @fts, and which is described by a @structft.
 
 To set the value of a specific field of a structure field, you need to
-first get the field with bt_ctf_field_structure_get_field() or
+first get the field with bt_ctf_field_structure_get_field_by_name() or
 bt_ctf_field_structure_get_field_by_index(). If you already have a
 field object, you can assign it to a specific name within a structure
-field with bt_ctf_field_structure_set_field().
+field with bt_ctf_field_structure_set_field_by_name().
 
 @sa ctfirstructfieldtype
 @sa ctfirfields
@@ -860,8 +865,8 @@ exist.
 
 @sa bt_ctf_field_structure_get_field_by_index(): Returns the field of a
        given structure field by index.
-@sa bt_ctf_field_structure_set_field(): Sets the field of a given
-       structure field.
+@sa bt_ctf_field_structure_set_field_by_name(): Sets the field of a
+       given structure field by name.
 */
 extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
                struct bt_ctf_field *struct_field, const char *name);
@@ -887,10 +892,10 @@ extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
 @postrefcountsame{struct_field}
 @postsuccessrefcountretinc
 
-@sa bt_ctf_field_structure_get_field(): Returns the field of a
+@sa bt_ctf_field_structure_get_field_by_name(): Returns the field of a
+       given structure field by name.
+@sa bt_ctf_field_structure_set_field_by_name(): Sets the field of a
        given structure field by name.
-@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_by_index(
                struct bt_ctf_field *struct_field, uint64_t index);
@@ -932,10 +937,11 @@ bt_ctf_trace_get_packet_header_type() for the parent trace class of
 
 @sa bt_ctf_field_structure_get_field_by_index(): Returns the field of a
        given structure field by index.
-@sa bt_ctf_field_structure_get_field(): Returns the field of a
+@sa bt_ctf_field_structure_get_field_by_name(): Returns the field of a
        given structure field by name.
 */
-extern int bt_ctf_field_structure_set_field(struct bt_ctf_field *struct_field,
+extern int bt_ctf_field_structure_set_field_by_name(
+               struct bt_ctf_field *struct_field,
                const char *name, struct bt_ctf_field *field);
 
 /** @} */
This page took 0.030739 seconds and 4 git commands to generate.