Do not use `bool` type; use new `bt_bool` instead
[babeltrace.git] / include / babeltrace / ctf-ir / field-types.h
index 74908cf1283d1eff2ef9606de56f7183ff9abd49..6609018416efa7915b050a5b75e58a0ecf1746cd 100644 (file)
@@ -211,16 +211,16 @@ struct bt_ctf_field_type_enumeration_mapping_iterator;
  * counterpart.
  */
 enum ctf_type_id {
-       CTF_TYPE_UNKNOWN = 0,
-       CTF_TYPE_INTEGER,
-       CTF_TYPE_FLOAT,
-       CTF_TYPE_ENUM,
-       CTF_TYPE_STRING,
-       CTF_TYPE_STRUCT,
-       CTF_TYPE_UNTAGGED_VARIANT,
-       CTF_TYPE_VARIANT,
-       CTF_TYPE_ARRAY,
-       CTF_TYPE_SEQUENCE,
+       CTF_TYPE_UNKNOWN = -1,
+       CTF_TYPE_INTEGER = 0,
+       CTF_TYPE_FLOAT = 1,
+       CTF_TYPE_ENUM = 2,
+       CTF_TYPE_STRING = 3,
+       CTF_TYPE_STRUCT = 4,
+       CTF_TYPE_UNTAGGED_VARIANT = 5,
+       CTF_TYPE_VARIANT = 5,
+       CTF_TYPE_ARRAY = 6,
+       CTF_TYPE_SEQUENCE = 7,
        NR_CTF_TYPES,
 };
 
@@ -294,10 +294,6 @@ enum bt_ctf_field_type_id {
        /// \ref ctfirstructfieldtype
        BT_CTF_FIELD_TYPE_ID_STRUCT = CTF_TYPE_STRUCT,
 
-       /// @cond DOCUMENT
-       BT_CTF_TYPE_ID_UNTAGGED_VARIANT = CTF_TYPE_UNTAGGED_VARIANT,
-       /// @endcond
-
        /// \ref ctfirarrayfieldtype
        BT_CTF_FIELD_TYPE_ID_ARRAY = CTF_TYPE_ARRAY,
 
@@ -708,8 +704,8 @@ An integer field type has the following properties:
   <tr>
     <td><strong>Signedness</strong> of the described integer fields
     <td>Unsigned
-    <td>bt_ctf_field_type_integer_get_signed()
-    <td>bt_ctf_field_type_integer_set_signed()
+    <td>bt_ctf_field_type_integer_is_signed()
+    <td>bt_ctf_field_type_integer_set_is_signed()
   </tr>
   <tr>
     <td><strong>Preferred display base</strong> of the described
@@ -838,12 +834,15 @@ extern int bt_ctf_field_type_integer_set_size(
 @preisintft{int_field_type}
 @postrefcountsame{int_field_type}
 
-@sa bt_ctf_field_type_integer_set_signed(): Sets the signedness of the
+@sa bt_ctf_field_type_integer_set_is_signed(): Sets the signedness of the
        integer fields described by a given integer field type.
 */
-extern int bt_ctf_field_type_integer_get_signed(
+extern int bt_ctf_field_type_integer_is_signed(
                struct bt_ctf_field_type *int_field_type);
 
+/* Pre-2.0 CTF writer compatibility */
+#define bt_ctf_field_type_integer_get_signed bt_ctf_field_type_integer_is_signed
+
 /**
 @brief Sets whether or not the @intfields described by
        the @intft \p int_field_type are signed.
@@ -862,12 +861,15 @@ extern int bt_ctf_field_type_integer_get_signed(
 @pre \p is_signed is 0 or 1.
 @postrefcountsame{int_field_type}
 
-@sa bt_ctf_field_type_integer_get_signed(): Returns the signedness of
+@sa bt_ctf_field_type_integer_is_signed(): Returns the signedness of
        the integer fields described by a given integer field type.
 */
-extern int bt_ctf_field_type_integer_set_signed(
+extern int bt_ctf_field_type_integer_set_is_signed(
                struct bt_ctf_field_type *int_field_type, int is_signed);
 
+/* Pre-2.0 CTF writer compatibility */
+#define bt_ctf_field_type_integer_set_signed bt_ctf_field_type_integer_set_is_signed
+
 /**
 @brief  Returns the preferred display base (radix) of the @intfields
        described by the @intft \p int_field_type.
@@ -1330,7 +1332,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_type(
 @preisenumft{enum_field_type}
 @postrefcountsame{enum_field_type}
 */
-extern int bt_ctf_field_type_enumeration_get_mapping_count(
+extern int64_t bt_ctf_field_type_enumeration_get_mapping_count(
                struct bt_ctf_field_type *enum_field_type);
 
 /**
@@ -1372,7 +1374,7 @@ On success, \p enum_field_type remains the sole owner of \p *name.
        at a given index.
 */
 extern int bt_ctf_field_type_enumeration_get_mapping_signed(
-               struct bt_ctf_field_type *enum_field_type, int index,
+               struct bt_ctf_field_type *enum_field_type, uint64_t index,
                const char **name, int64_t *range_begin, int64_t *range_end);
 
 /**
@@ -1414,7 +1416,7 @@ On success, \p enum_field_type remains the sole owner of \p *name.
        at a given index.
 */
 extern int bt_ctf_field_type_enumeration_get_mapping_unsigned(
-               struct bt_ctf_field_type *enum_field_type, int index,
+               struct bt_ctf_field_type *enum_field_type, uint64_t index,
                const char **name, uint64_t *range_begin,
                uint64_t *range_end);
 
@@ -1551,6 +1553,7 @@ A mapping in \p enum_field_type can exist with the name \p name.
 
 @prenotnull{enum_field_type}
 @prenotnull{name}
+@prehot{enum_field_type}
 @preisenumft{enum_field_type}
 @pre The wrapped @intft of \p enum_field_type is signed.
 @pre \p range_end is greater than or equal to \p range_begin.
@@ -1589,6 +1592,7 @@ A mapping in \p enum_field_type can exist with the name \p name.
 
 @prenotnull{enum_field_type}
 @prenotnull{name}
+@prehot{enum_field_type}
 @preisenumft{enum_field_type}
 @pre The wrapped @intft of \p enum_field_type is unsigned.
 @pre \p range_end is greater than or equal to \p range_begin.
@@ -1913,7 +1917,7 @@ extern struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void);
 @preisstructft{struct_field_type}
 @postrefcountsame{struct_field_type}
 */
-extern int bt_ctf_field_type_structure_get_field_count(
+extern int64_t bt_ctf_field_type_structure_get_field_count(
                struct bt_ctf_field_type *struct_field_type);
 
 /**
@@ -1947,10 +1951,13 @@ On success, the field's type is placed in \p *field_type if
 @sa bt_ctf_field_type_structure_get_field_type_by_name(): Finds a
        structure field type's field by name.
 */
-extern int bt_ctf_field_type_structure_get_field(
+extern int bt_ctf_field_type_structure_get_field_by_index(
                struct bt_ctf_field_type *struct_field_type,
                const char **field_name, struct bt_ctf_field_type **field_type,
-               int index);
+               uint64_t index);
+
+/* Pre-2.0 CTF writer compatibility */
+#define bt_ctf_field_type_structure_get_field bt_ctf_field_type_structure_get_field_by_index
 
 /**
 @brief  Returns the type of the field named \p field_name found in
@@ -1969,7 +1976,7 @@ extern int bt_ctf_field_type_structure_get_field(
 @postrefcountsame{struct_field_type}
 @postsuccessrefcountretinc
 
-@sa bt_ctf_field_type_structure_get_field(): Finds a
+@sa bt_ctf_field_type_structure_get_field_by_index(): Finds a
        structure field type's field by index.
 */
 extern
@@ -2392,7 +2399,7 @@ extern struct bt_ctf_field_path *bt_ctf_field_type_variant_get_tag_field_path(
 @preisvarft{variant_field_type}
 @postrefcountsame{variant_field_type}
 */
-extern int bt_ctf_field_type_variant_get_field_count(
+extern int64_t bt_ctf_field_type_variant_get_field_count(
                struct bt_ctf_field_type *variant_field_type);
 
 /**
@@ -2428,10 +2435,13 @@ On success, the field's type is placed in \p *field_type if
 @sa bt_ctf_field_type_variant_get_field_type_from_tag(): Finds a variant
        field type's field by current tag value.
 */
-extern int bt_ctf_field_type_variant_get_field(
+extern int bt_ctf_field_type_variant_get_field_by_index(
                struct bt_ctf_field_type *variant_field_type,
                const char **field_name,
-               struct bt_ctf_field_type **field_type, int index);
+               struct bt_ctf_field_type **field_type, uint64_t index);
+
+/* Pre-2.0 CTF writer compatibility */
+#define bt_ctf_field_type_variant_get_field bt_ctf_field_type_variant_get_field_by_index
 
 /**
 @brief  Returns the type of the field (choice) named \p field_name
@@ -2450,7 +2460,7 @@ extern int bt_ctf_field_type_variant_get_field(
 @postrefcountsame{variant_field_type}
 @postsuccessrefcountretinc
 
-@sa bt_ctf_field_type_variant_get_field(): Finds a variant field type's
+@sa bt_ctf_field_type_variant_get_field_by_index(): Finds a variant field type's
        field by index.
 @sa bt_ctf_field_type_variant_get_field_type_from_tag(): Finds a variant
        field type's field by current tag value.
@@ -2486,7 +2496,7 @@ bt_ctf_field_type_variant_get_tag_type() for \p variant_field_type.
 @postrefcountsame{tag_field}
 @postsuccessrefcountretinc
 
-@sa bt_ctf_field_type_variant_get_field(): Finds a variant field type's
+@sa bt_ctf_field_type_variant_get_field_by_index(): Finds a variant field type's
        field by index.
 @sa bt_ctf_field_type_variant_get_field_type_by_name(): Finds a variant
        field type's field by name.
This page took 0.028547 seconds and 4 git commands to generate.