Rename bt_ctf_type_id -> bt_ctf_field_type_id (and the enumerators)
[babeltrace.git] / lib / ctf-ir / field-types.c
index aac430024a7c9f19951cd537ddf76fc11f49a9d5..6b02d4e33df02ab7ca0fa5dd17f3f115eacdddbb 100644 (file)
@@ -76,16 +76,16 @@ void bt_ctf_field_type_string_destroy(struct bt_ctf_field_type *);
 
 static
 void (* const type_destroy_funcs[])(struct bt_ctf_field_type *) = {
-       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_destroy,
-       [BT_CTF_TYPE_ID_ENUM] =
+       [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_destroy,
+       [BT_CTF_FIELD_TYPE_ID_ENUM] =
                bt_ctf_field_type_enumeration_destroy,
-       [BT_CTF_TYPE_ID_FLOAT] =
+       [BT_CTF_FIELD_TYPE_ID_FLOAT] =
                bt_ctf_field_type_floating_point_destroy,
-       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_destroy,
-       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_destroy,
-       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_destroy,
-       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_destroy,
-       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_type_string_destroy,
+       [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_destroy,
+       [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_destroy,
+       [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_destroy,
+       [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_destroy,
+       [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_type_string_destroy,
 };
 
 static
@@ -105,14 +105,14 @@ void bt_ctf_field_type_sequence_freeze(struct bt_ctf_field_type *);
 
 static
 type_freeze_func const type_freeze_funcs[] = {
-       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_freeze,
-       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_freeze,
-       [BT_CTF_TYPE_ID_FLOAT] = generic_field_type_freeze,
-       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_freeze,
-       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_freeze,
-       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_freeze,
-       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_freeze,
-       [BT_CTF_TYPE_ID_STRING] = generic_field_type_freeze,
+       [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_freeze,
+       [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_freeze,
+       [BT_CTF_FIELD_TYPE_ID_FLOAT] = generic_field_type_freeze,
+       [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_freeze,
+       [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_freeze,
+       [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_freeze,
+       [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_freeze,
+       [BT_CTF_FIELD_TYPE_ID_STRING] = generic_field_type_freeze,
 };
 
 static
@@ -142,17 +142,17 @@ int bt_ctf_field_type_string_serialize(struct bt_ctf_field_type *,
 
 static
 type_serialize_func const type_serialize_funcs[] = {
-       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_serialize,
-       [BT_CTF_TYPE_ID_ENUM] =
+       [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_serialize,
+       [BT_CTF_FIELD_TYPE_ID_ENUM] =
                bt_ctf_field_type_enumeration_serialize,
-       [BT_CTF_TYPE_ID_FLOAT] =
+       [BT_CTF_FIELD_TYPE_ID_FLOAT] =
                bt_ctf_field_type_floating_point_serialize,
-       [BT_CTF_TYPE_ID_STRUCT] =
+       [BT_CTF_FIELD_TYPE_ID_STRUCT] =
                bt_ctf_field_type_structure_serialize,
-       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_serialize,
-       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_serialize,
-       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_serialize,
-       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_type_string_serialize,
+       [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_serialize,
+       [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_serialize,
+       [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_serialize,
+       [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_type_string_serialize,
 };
 
 static
@@ -180,17 +180,17 @@ void bt_ctf_field_type_sequence_set_byte_order(struct bt_ctf_field_type *,
 static
 void (* const set_byte_order_funcs[])(struct bt_ctf_field_type *,
                enum bt_ctf_byte_order) = {
-       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_set_byte_order,
-       [BT_CTF_TYPE_ID_ENUM] =
+       [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_set_byte_order,
+       [BT_CTF_FIELD_TYPE_ID_ENUM] =
                bt_ctf_field_type_enumeration_set_byte_order,
-       [BT_CTF_TYPE_ID_FLOAT] =
+       [BT_CTF_FIELD_TYPE_ID_FLOAT] =
                bt_ctf_field_type_floating_point_set_byte_order,
-       [BT_CTF_TYPE_ID_STRUCT] =
+       [BT_CTF_FIELD_TYPE_ID_STRUCT] =
                bt_ctf_field_type_structure_set_byte_order,
-       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_set_byte_order,
-       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_set_byte_order,
-       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_set_byte_order,
-       [BT_CTF_TYPE_ID_STRING] = NULL,
+       [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_set_byte_order,
+       [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_set_byte_order,
+       [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_set_byte_order,
+       [BT_CTF_FIELD_TYPE_ID_STRING] = NULL,
 };
 
 static
@@ -221,14 +221,14 @@ struct bt_ctf_field_type *bt_ctf_field_type_string_copy(
 static
 struct bt_ctf_field_type *(* const type_copy_funcs[])(
                struct bt_ctf_field_type *) = {
-       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_copy,
-       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_copy,
-       [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_type_floating_point_copy,
-       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_copy,
-       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_copy,
-       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_copy,
-       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_copy,
-       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_type_string_copy,
+       [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_copy,
+       [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_copy,
+       [BT_CTF_FIELD_TYPE_ID_FLOAT] = bt_ctf_field_type_floating_point_copy,
+       [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_copy,
+       [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_copy,
+       [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_copy,
+       [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_copy,
+       [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_type_string_copy,
 };
 
 static
@@ -259,14 +259,14 @@ int bt_ctf_field_type_sequence_compare(struct bt_ctf_field_type *,
 static
 int (* const type_compare_funcs[])(struct bt_ctf_field_type *,
                struct bt_ctf_field_type *) = {
-       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_compare,
-       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_compare,
-       [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_type_floating_point_compare,
-       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_compare,
-       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_compare,
-       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_compare,
-       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_compare,
-       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_type_string_compare,
+       [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_compare,
+       [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_compare,
+       [BT_CTF_FIELD_TYPE_ID_FLOAT] = bt_ctf_field_type_floating_point_compare,
+       [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_compare,
+       [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_compare,
+       [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_compare,
+       [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_compare,
+       [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_type_string_compare,
 };
 
 static
@@ -284,14 +284,14 @@ int bt_ctf_field_type_sequence_validate(struct bt_ctf_field_type *);
 
 static
 int (* const type_validate_funcs[])(struct bt_ctf_field_type *) = {
-       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_validate,
-       [BT_CTF_TYPE_ID_FLOAT] = NULL,
-       [BT_CTF_TYPE_ID_STRING] = NULL,
-       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_validate,
-       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_validate,
-       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_validate,
-       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_validate,
-       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_validate,
+       [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_validate,
+       [BT_CTF_FIELD_TYPE_ID_FLOAT] = NULL,
+       [BT_CTF_FIELD_TYPE_ID_STRING] = NULL,
+       [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_validate,
+       [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_validate,
+       [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_validate,
+       [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_validate,
+       [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_validate,
 };
 
 static
@@ -358,7 +358,7 @@ gint compare_enumeration_mappings_unsigned(struct enumeration_mapping **a,
 static
 void bt_ctf_field_type_init(struct bt_ctf_field_type *type, bool init_bo)
 {
-       assert(type && (type->id > BT_CTF_TYPE_ID_UNKNOWN) &&
+       assert(type && (type->id > BT_CTF_FIELD_TYPE_ID_UNKNOWN) &&
                (type->id < BT_CTF_NR_TYPE_IDS));
 
        bt_object_init(type, bt_ctf_field_type_destroy);
@@ -412,11 +412,11 @@ static
 void bt_ctf_field_type_destroy(struct bt_object *obj)
 {
        struct bt_ctf_field_type *type;
-       enum bt_ctf_type_id type_id;
+       enum bt_ctf_field_type_id type_id;
 
        type = container_of(obj, struct bt_ctf_field_type, base);
        type_id = type->id;
-       if (type_id <= BT_CTF_TYPE_ID_UNKNOWN ||
+       if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN ||
                type_id >= BT_CTF_NR_TYPE_IDS) {
                return;
        }
@@ -750,7 +750,7 @@ BT_HIDDEN
 int bt_ctf_field_type_validate(struct bt_ctf_field_type *type)
 {
        int ret = 0;
-       enum bt_ctf_type_id id = bt_ctf_field_type_get_type_id(type);
+       enum bt_ctf_field_type_id id = bt_ctf_field_type_get_type_id(type);
 
        if (!type) {
                ret = -1;
@@ -784,7 +784,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_integer_create(unsigned int size)
                return NULL;
        }
 
-       integer->parent.id = BT_CTF_TYPE_ID_INTEGER;
+       integer->parent.id = BT_CTF_FIELD_TYPE_ID_INTEGER;
        integer->size = size;
        integer->base = BT_CTF_INTEGER_BASE_DECIMAL;
        integer->encoding = BT_CTF_STRING_ENCODING_NONE;
@@ -797,7 +797,7 @@ int bt_ctf_field_type_integer_get_size(struct bt_ctf_field_type *type)
        int ret = 0;
        struct bt_ctf_field_type_integer *integer;
 
-       if (!type || type->id != BT_CTF_TYPE_ID_INTEGER) {
+       if (!type || type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -813,7 +813,7 @@ int bt_ctf_field_type_integer_get_signed(struct bt_ctf_field_type *type)
        int ret = 0;
        struct bt_ctf_field_type_integer *integer;
 
-       if (!type || type->id != BT_CTF_TYPE_ID_INTEGER) {
+       if (!type || type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -831,7 +831,7 @@ int bt_ctf_field_type_integer_set_signed(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_integer *integer;
 
        if (!type || type->frozen ||
-               type->id != BT_CTF_TYPE_ID_INTEGER) {
+               type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -849,7 +849,7 @@ int bt_ctf_field_type_integer_set_size(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_integer *integer;
 
        if (!type || type->frozen ||
-               type->id != BT_CTF_TYPE_ID_INTEGER ||
+               type->id != BT_CTF_FIELD_TYPE_ID_INTEGER ||
                !size || size > 64) {
                ret = -1;
                goto end;
@@ -867,7 +867,7 @@ enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base(
        enum bt_ctf_integer_base ret = BT_CTF_INTEGER_BASE_UNKNOWN;
        struct bt_ctf_field_type_integer *integer;
 
-       if (!type || type->id != BT_CTF_TYPE_ID_INTEGER) {
+       if (!type || type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
                goto end;
        }
 
@@ -883,7 +883,7 @@ int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *type,
        int ret = 0;
 
        if (!type || type->frozen ||
-               type->id != BT_CTF_TYPE_ID_INTEGER) {
+               type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -912,7 +912,7 @@ enum bt_ctf_string_encoding bt_ctf_field_type_integer_get_encoding(
        enum bt_ctf_string_encoding ret = BT_CTF_STRING_ENCODING_UNKNOWN;
        struct bt_ctf_field_type_integer *integer;
 
-       if (!type || type->id != BT_CTF_TYPE_ID_INTEGER) {
+       if (!type || type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
                goto end;
        }
 
@@ -929,7 +929,7 @@ int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_integer *integer;
 
        if (!type || type->frozen ||
-               (type->id != BT_CTF_TYPE_ID_INTEGER) ||
+               (type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) ||
                (encoding < BT_CTF_STRING_ENCODING_NONE) ||
                (encoding >= BT_CTF_STRING_ENCODING_UNKNOWN)) {
                ret = -1;
@@ -999,7 +999,7 @@ bt_ctf_field_type_enumeration_find_mappings_type(
        struct bt_ctf_field_type_enumeration *enumeration_type;
        struct bt_ctf_field_type_enumeration_mapping_iterator *iter = NULL;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_ENUM)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM)) {
                goto end;
        }
 
@@ -1278,7 +1278,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
                goto error;
        }
 
-       if (integer_container_type->id != BT_CTF_TYPE_ID_INTEGER) {
+       if (integer_container_type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
                goto error;
        }
 
@@ -1287,7 +1287,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
                goto error;
        }
 
-       enumeration->parent.id = BT_CTF_TYPE_ID_ENUM;
+       enumeration->parent.id = BT_CTF_FIELD_TYPE_ID_ENUM;
        bt_get(integer_container_type);
        enumeration->container = integer_container_type;
        enumeration->entries = g_ptr_array_new_with_free_func(
@@ -1309,7 +1309,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_type(
                goto end;
        }
 
-       if (type->id != BT_CTF_TYPE_ID_ENUM) {
+       if (type->id != BT_CTF_FIELD_TYPE_ID_ENUM) {
                goto end;
        }
 
@@ -1331,7 +1331,7 @@ int bt_ctf_field_type_enumeration_add_mapping(
        struct bt_ctf_field_type_enumeration *enumeration;
        char *escaped_string;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_ENUM) ||
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM) ||
                type->frozen ||
                (range_end < range_start)) {
                ret = -1;
@@ -1381,7 +1381,7 @@ int bt_ctf_field_type_enumeration_add_mapping_unsigned(
        struct bt_ctf_field_type_enumeration *enumeration;
        char *escaped_string;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_ENUM) ||
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM) ||
                type->frozen ||
                (range_end < range_start)) {
                ret = -1;
@@ -1427,7 +1427,7 @@ int bt_ctf_field_type_enumeration_get_mapping_count(
        int ret = 0;
        struct bt_ctf_field_type_enumeration *enumeration;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_ENUM)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM)) {
                ret = -1;
                goto end;
        }
@@ -1448,7 +1448,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void)
                goto end;
        }
 
-       floating_point->parent.id = BT_CTF_TYPE_ID_FLOAT;
+       floating_point->parent.id = BT_CTF_FIELD_TYPE_ID_FLOAT;
        floating_point->exp_dig = sizeof(float) * CHAR_BIT - FLT_MANT_DIG;
        floating_point->mant_dig = FLT_MANT_DIG;
        bt_ctf_field_type_init(&floating_point->parent, TRUE);
@@ -1462,7 +1462,7 @@ int bt_ctf_field_type_floating_point_get_exponent_digits(
        int ret = 0;
        struct bt_ctf_field_type_floating_point *floating_point;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_FLOAT)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_FLOAT)) {
                ret = -1;
                goto end;
        }
@@ -1482,7 +1482,7 @@ int bt_ctf_field_type_floating_point_set_exponent_digits(
        struct bt_ctf_field_type_floating_point *floating_point;
 
        if (!type || type->frozen ||
-               (type->id != BT_CTF_TYPE_ID_FLOAT)) {
+               (type->id != BT_CTF_FIELD_TYPE_ID_FLOAT)) {
                ret = -1;
                goto end;
        }
@@ -1508,7 +1508,7 @@ int bt_ctf_field_type_floating_point_get_mantissa_digits(
        int ret = 0;
        struct bt_ctf_field_type_floating_point *floating_point;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_FLOAT)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_FLOAT)) {
                ret = -1;
                goto end;
        }
@@ -1528,7 +1528,7 @@ int bt_ctf_field_type_floating_point_set_mantissa_digits(
        struct bt_ctf_field_type_floating_point *floating_point;
 
        if (!type || type->frozen ||
-               (type->id != BT_CTF_TYPE_ID_FLOAT)) {
+               (type->id != BT_CTF_FIELD_TYPE_ID_FLOAT)) {
                ret = -1;
                goto end;
        }
@@ -1557,7 +1557,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void)
                goto error;
        }
 
-       structure->parent.id = BT_CTF_TYPE_ID_STRUCT;
+       structure->parent.id = BT_CTF_FIELD_TYPE_ID_STRUCT;
        structure->fields = g_ptr_array_new_with_free_func(
                (GDestroyNotify)destroy_structure_field);
        structure->field_name_to_index = g_hash_table_new(NULL, NULL);
@@ -1580,7 +1580,7 @@ int bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *type,
         */
        if (!type || !field_type || type->frozen ||
                bt_ctf_validate_identifier(field_name) ||
-               (type->id != BT_CTF_TYPE_ID_STRUCT) ||
+               (type->id != BT_CTF_FIELD_TYPE_ID_STRUCT) ||
                type == field_type) {
                ret = -1;
                goto end;
@@ -1603,7 +1603,7 @@ int bt_ctf_field_type_structure_get_field_count(
        int ret = 0;
        struct bt_ctf_field_type_structure *structure;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_STRUCT)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_STRUCT)) {
                ret = -1;
                goto end;
        }
@@ -1624,7 +1624,7 @@ int bt_ctf_field_type_structure_get_field(struct bt_ctf_field_type *type,
        int ret = 0;
 
        if (!type || index < 0 ||
-                       (type->id != BT_CTF_TYPE_ID_STRUCT)) {
+                       (type->id != BT_CTF_FIELD_TYPE_ID_STRUCT)) {
                ret = -1;
                goto end;
        }
@@ -1695,7 +1695,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_create(
                goto error;
        }
 
-       variant->parent.id = BT_CTF_TYPE_ID_VARIANT;
+       variant->parent.id = BT_CTF_FIELD_TYPE_ID_VARIANT;
        variant->tag_name = g_string_new(tag_name);
        variant->field_name_to_index = g_hash_table_new(NULL, NULL);
        variant->fields = g_ptr_array_new_with_free_func(
@@ -1720,7 +1720,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_type(
        struct bt_ctf_field_type_variant *variant;
        struct bt_ctf_field_type *tag_type = NULL;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_VARIANT)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
                goto end;
        }
 
@@ -1741,7 +1741,7 @@ const char *bt_ctf_field_type_variant_get_tag_name(
        struct bt_ctf_field_type_variant *variant;
        const char *tag_name = NULL;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_VARIANT)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
                goto end;
        }
 
@@ -1762,7 +1762,7 @@ int bt_ctf_field_type_variant_set_tag_name(
        struct bt_ctf_field_type_variant *variant;
 
        if (!type || type->frozen ||
-               (type->id != BT_CTF_TYPE_ID_VARIANT) ||
+               (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT) ||
                bt_ctf_validate_identifier(name)) {
                ret = -1;
                goto end;
@@ -1789,7 +1789,7 @@ int bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *type,
         */
        if (!type || !field_type || type->frozen ||
                bt_ctf_validate_identifier(field_name) ||
-               (type->id != BT_CTF_TYPE_ID_VARIANT) ||
+               (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT) ||
                type == field_type) {
                ret = -1;
                goto end;
@@ -1869,7 +1869,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
        struct bt_ctf_field_type *field_type = NULL;
        struct bt_ctf_field_type_enumeration_mapping_iterator *iter = NULL;
 
-       if (!type || !tag || type->id != BT_CTF_TYPE_ID_VARIANT) {
+       if (!type || !tag || type->id != BT_CTF_FIELD_TYPE_ID_VARIANT) {
                goto end;
        }
 
@@ -1896,7 +1896,7 @@ int bt_ctf_field_type_variant_get_field_count(struct bt_ctf_field_type *type)
        int ret = 0;
        struct bt_ctf_field_type_variant *variant;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_VARIANT)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
                ret = -1;
                goto end;
        }
@@ -1918,7 +1918,7 @@ int bt_ctf_field_type_variant_get_field(struct bt_ctf_field_type *type,
        int ret = 0;
 
        if (!type || index < 0 ||
-                       (type->id != BT_CTF_TYPE_ID_VARIANT)) {
+                       (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
                ret = -1;
                goto end;
        }
@@ -1957,7 +1957,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_array_create(
                goto error;
        }
 
-       array->parent.id = BT_CTF_TYPE_ID_ARRAY;
+       array->parent.id = BT_CTF_FIELD_TYPE_ID_ARRAY;
        bt_get(element_type);
        array->element_type = element_type;
        array->length = length;
@@ -1973,7 +1973,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_type(
        struct bt_ctf_field_type *ret = NULL;
        struct bt_ctf_field_type_array *array;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_ARRAY)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ARRAY)) {
                goto end;
        }
 
@@ -1992,7 +1992,7 @@ int bt_ctf_field_type_array_set_element_type(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_array *array;
 
        if (!type || !element_type ||
-                       (type->id != BT_CTF_TYPE_ID_ARRAY)) {
+                       (type->id != BT_CTF_FIELD_TYPE_ID_ARRAY)) {
                ret = -1;
                goto end;
        }
@@ -2015,7 +2015,7 @@ int64_t bt_ctf_field_type_array_get_length(struct bt_ctf_field_type *type)
        int64_t ret;
        struct bt_ctf_field_type_array *array;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_ARRAY)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ARRAY)) {
                ret = -1;
                goto end;
        }
@@ -2041,7 +2041,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_sequence_create(
                goto error;
        }
 
-       sequence->parent.id = BT_CTF_TYPE_ID_SEQUENCE;
+       sequence->parent.id = BT_CTF_FIELD_TYPE_ID_SEQUENCE;
        bt_get(element_type);
        sequence->element_type = element_type;
        sequence->length_field_name = g_string_new(length_field_name);
@@ -2057,7 +2057,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_type(
        struct bt_ctf_field_type *ret = NULL;
        struct bt_ctf_field_type_sequence *sequence;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_SEQUENCE)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_SEQUENCE)) {
                goto end;
        }
 
@@ -2077,7 +2077,7 @@ int bt_ctf_field_type_sequence_set_element_type(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_sequence *sequence;
 
        if (!type || !element_type ||
-                       (type->id != BT_CTF_TYPE_ID_SEQUENCE)) {
+                       (type->id != BT_CTF_FIELD_TYPE_ID_SEQUENCE)) {
                ret = -1;
                goto end;
        }
@@ -2101,7 +2101,7 @@ const char *bt_ctf_field_type_sequence_get_length_field_name(
        const char *ret = NULL;
        struct bt_ctf_field_type_sequence *sequence;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_SEQUENCE)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_SEQUENCE)) {
                goto end;
        }
 
@@ -2121,7 +2121,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_string_create(void)
                return NULL;
        }
 
-       string->parent.id = BT_CTF_TYPE_ID_STRING;
+       string->parent.id = BT_CTF_FIELD_TYPE_ID_STRING;
        bt_ctf_field_type_init(&string->parent, TRUE);
        string->encoding = BT_CTF_STRING_ENCODING_UTF8;
        string->parent.alignment = CHAR_BIT;
@@ -2134,7 +2134,7 @@ enum bt_ctf_string_encoding bt_ctf_field_type_string_get_encoding(
        struct bt_ctf_field_type_string *string;
        enum bt_ctf_string_encoding ret = BT_CTF_STRING_ENCODING_UNKNOWN;
 
-       if (!type || (type->id != BT_CTF_TYPE_ID_STRING)) {
+       if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_STRING)) {
                goto end;
        }
 
@@ -2151,7 +2151,7 @@ int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *type,
        int ret = 0;
        struct bt_ctf_field_type_string *string;
 
-       if (!type || type->id != BT_CTF_TYPE_ID_STRING ||
+       if (!type || type->id != BT_CTF_FIELD_TYPE_ID_STRING ||
                (encoding != BT_CTF_STRING_ENCODING_UTF8 &&
                encoding != BT_CTF_STRING_ENCODING_ASCII)) {
                ret = -1;
@@ -2167,7 +2167,7 @@ end:
 int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
 {
        int ret;
-       enum bt_ctf_type_id type_id;
+       enum bt_ctf_field_type_id type_id;
 
        if (!type) {
                ret = -1;
@@ -2181,7 +2181,7 @@ int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
 
        type_id = bt_ctf_field_type_get_type_id(type);
        switch (type_id) {
-       case BT_CTF_TYPE_ID_SEQUENCE:
+       case BT_CTF_FIELD_TYPE_ID_SEQUENCE:
        {
                struct bt_ctf_field_type *element =
                        bt_ctf_field_type_sequence_get_element_type(type);
@@ -2195,7 +2195,7 @@ int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
                bt_put(element);
                break;
        }
-       case BT_CTF_TYPE_ID_ARRAY:
+       case BT_CTF_FIELD_TYPE_ID_ARRAY:
        {
                struct bt_ctf_field_type *element =
                        bt_ctf_field_type_array_get_element_type(type);
@@ -2209,7 +2209,7 @@ int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
                bt_put(element);
                break;
        }
-       case BT_CTF_TYPE_ID_STRUCT:
+       case BT_CTF_FIELD_TYPE_ID_STRUCT:
        {
                int i, element_count;
 
@@ -2244,7 +2244,7 @@ int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
                ret = (int) type->alignment;
                break;
        }
-       case BT_CTF_TYPE_ID_UNKNOWN:
+       case BT_CTF_FIELD_TYPE_ID_UNKNOWN:
                ret = -1;
                break;
        default:
@@ -2265,7 +2265,7 @@ int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *type,
                unsigned int alignment)
 {
        int ret = 0;
-       enum bt_ctf_type_id type_id;
+       enum bt_ctf_field_type_id type_id;
 
        /* Alignment must be a power of two */
        if (!type || type->frozen || !is_power_of_two(alignment)) {
@@ -2274,20 +2274,20 @@ int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *type,
        }
 
        type_id = bt_ctf_field_type_get_type_id(type);
-       if (type_id == BT_CTF_TYPE_ID_UNKNOWN) {
+       if (type_id == BT_CTF_FIELD_TYPE_ID_UNKNOWN) {
                ret = -1;
                goto end;
        }
 
-       if (type->id == BT_CTF_TYPE_ID_STRING &&
+       if (type->id == BT_CTF_FIELD_TYPE_ID_STRING &&
                alignment != CHAR_BIT) {
                ret = -1;
                goto end;
        }
 
-       if (type_id == BT_CTF_TYPE_ID_VARIANT ||
-               type_id == BT_CTF_TYPE_ID_SEQUENCE ||
-               type_id == BT_CTF_TYPE_ID_ARRAY) {
+       if (type_id == BT_CTF_FIELD_TYPE_ID_VARIANT ||
+               type_id == BT_CTF_FIELD_TYPE_ID_SEQUENCE ||
+               type_id == BT_CTF_FIELD_TYPE_ID_ARRAY) {
                /* Setting an alignment on these types makes no sense */
                ret = -1;
                goto end;
@@ -2309,21 +2309,21 @@ enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(
        }
 
        switch (type->id) {
-       case BT_CTF_TYPE_ID_INTEGER:
+       case BT_CTF_FIELD_TYPE_ID_INTEGER:
        {
                struct bt_ctf_field_type_integer *integer = container_of(
                        type, struct bt_ctf_field_type_integer, parent);
                ret = integer->user_byte_order;
                break;
        }
-       case BT_CTF_TYPE_ID_ENUM:
+       case BT_CTF_FIELD_TYPE_ID_ENUM:
        {
                struct bt_ctf_field_type_enumeration *enum_ft = container_of(
                        type, struct bt_ctf_field_type_enumeration, parent);
                ret = bt_ctf_field_type_get_byte_order(enum_ft->container);
                break;
        }
-       case BT_CTF_TYPE_ID_FLOAT:
+       case BT_CTF_FIELD_TYPE_ID_FLOAT:
        {
                struct bt_ctf_field_type_floating_point *floating_point =
                        container_of(type,
@@ -2370,11 +2370,11 @@ end:
        return ret;
 }
 
-enum bt_ctf_type_id bt_ctf_field_type_get_type_id(
+enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id(
                struct bt_ctf_field_type *type)
 {
        if (!type) {
-               return BT_CTF_TYPE_ID_UNKNOWN;
+               return BT_CTF_FIELD_TYPE_ID_UNKNOWN;
        }
 
        return type->id;
@@ -2382,42 +2382,42 @@ enum bt_ctf_type_id bt_ctf_field_type_get_type_id(
 
 int bt_ctf_field_type_is_integer(struct bt_ctf_field_type *type)
 {
-       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_INTEGER;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_INTEGER;
 }
 
 int bt_ctf_field_type_is_floating_point(struct bt_ctf_field_type *type)
 {
-       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_FLOAT;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_FLOAT;
 }
 
 int bt_ctf_field_type_is_enumeration(struct bt_ctf_field_type *type)
 {
-       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_ENUM;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_ENUM;
 }
 
 int bt_ctf_field_type_is_string(struct bt_ctf_field_type *type)
 {
-       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_STRING;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_STRING;
 }
 
 int bt_ctf_field_type_is_structure(struct bt_ctf_field_type *type)
 {
-       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_STRUCT;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_STRUCT;
 }
 
 int bt_ctf_field_type_is_array(struct bt_ctf_field_type *type)
 {
-       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_ARRAY;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_ARRAY;
 }
 
 int bt_ctf_field_type_is_sequence(struct bt_ctf_field_type *type)
 {
-       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_SEQUENCE;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_SEQUENCE;
 }
 
 int bt_ctf_field_type_is_variant(struct bt_ctf_field_type *type)
 {
-       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_VARIANT;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_VARIANT;
 }
 
 void bt_ctf_field_type_get(struct bt_ctf_field_type *type)
@@ -2556,7 +2556,7 @@ int bt_ctf_field_type_structure_get_field_name_index(
        struct bt_ctf_field_type_structure *structure;
 
        if (!type || !name ||
-               bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_STRUCT) {
+               bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -2587,7 +2587,7 @@ int bt_ctf_field_type_structure_set_field_index(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_structure *structure;
 
        if (!type || !field ||
-               bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_STRUCT) {
+               bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -2618,7 +2618,7 @@ int bt_ctf_field_type_variant_get_field_name_index(
        struct bt_ctf_field_type_variant *variant;
 
        if (!type || !name ||
-               bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_VARIANT) {
+               bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_VARIANT) {
                ret = -1;
                goto end;
        }
@@ -2650,7 +2650,7 @@ int bt_ctf_field_type_sequence_set_length_field_path(
        struct bt_ctf_field_type_sequence *sequence;
 
        if (!type || bt_ctf_field_type_get_type_id(type) !=
-                       BT_CTF_TYPE_ID_SEQUENCE) {
+                       BT_CTF_FIELD_TYPE_ID_SEQUENCE) {
                ret = -1;
                goto end;
        }
@@ -2671,7 +2671,7 @@ int bt_ctf_field_type_variant_set_tag_field_path(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_variant *variant;
 
        if (!type || bt_ctf_field_type_get_type_id(type) !=
-                       BT_CTF_TYPE_ID_VARIANT) {
+                       BT_CTF_FIELD_TYPE_ID_VARIANT) {
                ret = -1;
                goto end;
        }
@@ -2693,7 +2693,7 @@ int bt_ctf_field_type_variant_set_tag_field_type(struct bt_ctf_field_type *type,
 
        if (!type || !tag ||
                        bt_ctf_field_type_get_type_id(tag) !=
-                       BT_CTF_TYPE_ID_ENUM) {
+                       BT_CTF_FIELD_TYPE_ID_ENUM) {
                ret = -1;
                goto end;
        }
@@ -2718,7 +2718,7 @@ int bt_ctf_field_type_variant_set_field_index(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_variant *variant;
 
        if (!type || !field ||
-               bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_VARIANT) {
+               bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_VARIANT) {
                ret = -1;
                goto end;
        }
@@ -4076,7 +4076,7 @@ int bt_ctf_field_type_compare(struct bt_ctf_field_type *type_a,
                goto end;
        }
 
-       if (type_a->id == BT_CTF_TYPE_ID_UNKNOWN) {
+       if (type_a->id == BT_CTF_FIELD_TYPE_ID_UNKNOWN) {
                /* Both have unknown type IDs */
                goto end;
        }
@@ -4091,7 +4091,7 @@ BT_HIDDEN
 int bt_ctf_field_type_get_field_count(struct bt_ctf_field_type *field_type)
 {
        int field_count = -1;
-       enum bt_ctf_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
+       enum bt_ctf_field_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
 
        switch (type_id) {
        case CTF_TYPE_STRUCT:
@@ -4122,7 +4122,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_get_field_at_index(
                struct bt_ctf_field_type *field_type, int index)
 {
        struct bt_ctf_field_type *field = NULL;
-       enum bt_ctf_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
+       enum bt_ctf_field_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
 
        switch (type_id) {
        case CTF_TYPE_STRUCT:
@@ -4157,7 +4157,7 @@ int bt_ctf_field_type_get_field_index(struct bt_ctf_field_type *field_type,
                const char *name)
 {
        int field_index = -1;
-       enum bt_ctf_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
+       enum bt_ctf_field_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
 
        switch (type_id) {
        case CTF_TYPE_STRUCT:
This page took 0.048329 seconds and 4 git commands to generate.