ir: rename ctf_type_id -> bt_ctf_type_id
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 8 Feb 2016 21:03:22 +0000 (16:03 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 19 Feb 2016 21:28:04 +0000 (16:28 -0500)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
24 files changed:
formats/ctf-text/types/array.c
formats/ctf-text/types/sequence.c
formats/ctf/ctf.c
formats/ctf/ir/event-fields.c
formats/ctf/ir/event-types.c
formats/ctf/ir/event.c
formats/ctf/ir/stream-class.c
formats/ctf/ir/stream.c
formats/ctf/ir/trace.c
formats/ctf/ir/validation.c
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
formats/ctf/types/array.c
formats/ctf/types/sequence.c
include/babeltrace/ctf-ir/event-fields.h
include/babeltrace/ctf-ir/event-types.h
include/babeltrace/ctf/callbacks-internal.h
include/babeltrace/ctf/events-internal.h
include/babeltrace/ctf/events.h
include/babeltrace/types.h
tests/lib/test_ctf_writer.c
tests/lib/test_seek.c
types/array.c
types/sequence.c
types/types.c

index 47eb1287a0f15dbac4604bc5bf5ecf21113839b1..ff2ca5ec3fd24942fe8a6f0369cc596f1129b047 100644 (file)
@@ -52,7 +52,7 @@ int ctf_text_array_write(struct bt_stream_pos *ppos, struct bt_definition *defin
                                rem_(g_quark_to_string(definition->name)));
        }
 
-       if (elem->id == CTF_TYPE_INTEGER) {
+       if (elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(elem, struct declaration_integer, p);
 
index a9499b451ced7b3580d56899fed05a82508dc022..659f87d6beb58ca11f515d10230583f69ac926f5 100644 (file)
@@ -52,7 +52,7 @@ int ctf_text_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *de
                                rem_(g_quark_to_string(definition->name)));
        }
 
-       if (elem->id == CTF_TYPE_INTEGER) {
+       if (elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(elem, struct declaration_integer, p);
 
index fe0c80f2fae22bef20186024e43f21a89577f763..7c4d210670753175836ca5858c97f4b7a9a2d4e5 100644 (file)
@@ -125,26 +125,26 @@ int ctf_convert_index_timestamp(struct bt_trace_descriptor *tdp);
 
 static
 rw_dispatch read_dispatch_table[] = {
-       [ CTF_TYPE_INTEGER ] = ctf_integer_read,
-       [ CTF_TYPE_FLOAT ] = ctf_float_read,
-       [ CTF_TYPE_ENUM ] = ctf_enum_read,
-       [ CTF_TYPE_STRING ] = ctf_string_read,
-       [ CTF_TYPE_STRUCT ] = ctf_struct_rw,
-       [ CTF_TYPE_VARIANT ] = ctf_variant_rw,
-       [ CTF_TYPE_ARRAY ] = ctf_array_read,
-       [ CTF_TYPE_SEQUENCE ] = ctf_sequence_read,
+       [ BT_CTF_TYPE_ID_INTEGER ] = ctf_integer_read,
+       [ BT_CTF_TYPE_ID_FLOAT ] = ctf_float_read,
+       [ BT_CTF_TYPE_ID_ENUM ] = ctf_enum_read,
+       [ BT_CTF_TYPE_ID_STRING ] = ctf_string_read,
+       [ BT_CTF_TYPE_ID_STRUCT ] = ctf_struct_rw,
+       [ BT_CTF_TYPE_ID_VARIANT ] = ctf_variant_rw,
+       [ BT_CTF_TYPE_ID_ARRAY ] = ctf_array_read,
+       [ BT_CTF_TYPE_ID_SEQUENCE ] = ctf_sequence_read,
 };
 
 static
 rw_dispatch write_dispatch_table[] = {
-       [ CTF_TYPE_INTEGER ] = ctf_integer_write,
-       [ CTF_TYPE_FLOAT ] = ctf_float_write,
-       [ CTF_TYPE_ENUM ] = ctf_enum_write,
-       [ CTF_TYPE_STRING ] = ctf_string_write,
-       [ CTF_TYPE_STRUCT ] = ctf_struct_rw,
-       [ CTF_TYPE_VARIANT ] = ctf_variant_rw,
-       [ CTF_TYPE_ARRAY ] = ctf_array_write,
-       [ CTF_TYPE_SEQUENCE ] = ctf_sequence_write,
+       [ BT_CTF_TYPE_ID_INTEGER ] = ctf_integer_write,
+       [ BT_CTF_TYPE_ID_FLOAT ] = ctf_float_write,
+       [ BT_CTF_TYPE_ID_ENUM ] = ctf_enum_write,
+       [ BT_CTF_TYPE_ID_STRING ] = ctf_string_write,
+       [ BT_CTF_TYPE_ID_STRUCT ] = ctf_struct_rw,
+       [ BT_CTF_TYPE_ID_VARIANT ] = ctf_variant_rw,
+       [ BT_CTF_TYPE_ID_ARRAY ] = ctf_array_write,
+       [ BT_CTF_TYPE_ID_SEQUENCE ] = ctf_sequence_write,
 };
 
 static
@@ -1128,7 +1128,7 @@ int check_version(unsigned int major, unsigned int minor)
                }
        default:
                goto warning;
-               
+
        }
 
        /* eventually return an error instead of warning */
@@ -1649,7 +1649,7 @@ begin:
                        uint8_t uuidval[BABELTRACE_UUID_LEN];
 
                        field = bt_struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index);
-                       assert(field->declaration->id == CTF_TYPE_ARRAY);
+                       assert(field->declaration->id == BT_CTF_TYPE_ID_ARRAY);
                        defarray = container_of(field, struct definition_array, p);
                        assert(bt_array_len(defarray) == BABELTRACE_UUID_LEN);
 
@@ -1892,7 +1892,7 @@ int create_trace_definitions(struct ctf_trace *td, struct ctf_stream_definition
                        ret = -EINVAL;
                        goto error;
                }
-               stream->trace_packet_header = 
+               stream->trace_packet_header =
                        container_of(definition, struct definition_struct, p);
                stream->parent_def_scope = stream->trace_packet_header->p.scope;
        }
index 4383e2a33783ee221af1115a493bf1845ff46c6a..91e7e9c4a7cc7ded48e031243b0a8ab1d5bc4b39 100644 (file)
@@ -155,85 +155,85 @@ int increase_packet_size(struct ctf_stream_pos *pos);
 static
 struct bt_ctf_field *(* const field_create_funcs[])(
                struct bt_ctf_field_type *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_integer_create,
-       [CTF_TYPE_ENUM] = bt_ctf_field_enumeration_create,
-       [CTF_TYPE_FLOAT] =
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_integer_create,
+       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_create,
+       [BT_CTF_TYPE_ID_FLOAT] =
                bt_ctf_field_floating_point_create,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_structure_create,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_variant_create,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_array_create,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_sequence_create,
-       [CTF_TYPE_STRING] = bt_ctf_field_string_create,
+       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_create,
+       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_create,
+       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_create,
+       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_create,
+       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_create,
 };
 
 static
 void (* const field_destroy_funcs[])(struct bt_ctf_field *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_integer_destroy,
-       [CTF_TYPE_ENUM] = bt_ctf_field_enumeration_destroy,
-       [CTF_TYPE_FLOAT] =
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_integer_destroy,
+       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_destroy,
+       [BT_CTF_TYPE_ID_FLOAT] =
                bt_ctf_field_floating_point_destroy,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_structure_destroy,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_variant_destroy,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_array_destroy,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_sequence_destroy,
-       [CTF_TYPE_STRING] = bt_ctf_field_string_destroy,
+       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_destroy,
+       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_destroy,
+       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_destroy,
+       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_destroy,
+       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_destroy,
 };
 
 static
 int (* const field_validate_funcs[])(struct bt_ctf_field *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_generic_validate,
-       [CTF_TYPE_ENUM] = bt_ctf_field_enumeration_validate,
-       [CTF_TYPE_FLOAT] = bt_ctf_field_generic_validate,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_structure_validate,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_variant_validate,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_array_validate,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_sequence_validate,
-       [CTF_TYPE_STRING] = bt_ctf_field_generic_validate,
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_generic_validate,
+       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_validate,
+       [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_generic_validate,
+       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_validate,
+       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_validate,
+       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_validate,
+       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_validate,
+       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_generic_validate,
 };
 
 static
 int (* const field_reset_funcs[])(struct bt_ctf_field *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_generic_reset,
-       [CTF_TYPE_ENUM] = bt_ctf_field_enumeration_reset,
-       [CTF_TYPE_FLOAT] = bt_ctf_field_generic_reset,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_structure_reset,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_variant_reset,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_array_reset,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_sequence_reset,
-       [CTF_TYPE_STRING] = bt_ctf_field_string_reset,
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_generic_reset,
+       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_reset,
+       [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_generic_reset,
+       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_reset,
+       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_reset,
+       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_reset,
+       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_reset,
+       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_reset,
 };
 
 static
 int (* const field_serialize_funcs[])(struct bt_ctf_field *,
                struct ctf_stream_pos *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_integer_serialize,
-       [CTF_TYPE_ENUM] = bt_ctf_field_enumeration_serialize,
-       [CTF_TYPE_FLOAT] =
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_integer_serialize,
+       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_serialize,
+       [BT_CTF_TYPE_ID_FLOAT] =
                bt_ctf_field_floating_point_serialize,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_structure_serialize,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_variant_serialize,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_array_serialize,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_sequence_serialize,
-       [CTF_TYPE_STRING] = bt_ctf_field_string_serialize,
+       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_serialize,
+       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_serialize,
+       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_serialize,
+       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_serialize,
+       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_serialize,
 };
 
 static
 int (* const field_copy_funcs[])(struct bt_ctf_field *,
                struct bt_ctf_field *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_integer_copy,
-       [CTF_TYPE_ENUM] = bt_ctf_field_enumeration_copy,
-       [CTF_TYPE_FLOAT] = bt_ctf_field_floating_point_copy,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_structure_copy,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_variant_copy,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_array_copy,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_sequence_copy,
-       [CTF_TYPE_STRING] = bt_ctf_field_string_copy,
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_integer_copy,
+       [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_copy,
+       [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_floating_point_copy,
+       [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_copy,
+       [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_copy,
+       [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_copy,
+       [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_copy,
+       [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_copy,
 };
 
 struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type)
 {
        struct bt_ctf_field *field = NULL;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
        int ret;
 
        if (!type) {
@@ -241,7 +241,8 @@ struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type)
        }
 
        type_id = bt_ctf_field_type_get_type_id(type);
-       if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES) {
+       if (type_id <= BT_CTF_TYPE_ID_UNKNOWN ||
+                       type_id >= BT_CTF_NR_TYPE_IDS) {
                goto error;
        }
 
@@ -291,9 +292,9 @@ end:
        return ret;
 }
 
-enum ctf_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field)
+enum bt_ctf_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field)
 {
-       enum ctf_type_id ret = CTF_TYPE_UNKNOWN;
+       enum bt_ctf_type_id ret = BT_CTF_TYPE_ID_UNKNOWN;
 
        if (!field) {
                goto end;
@@ -306,42 +307,42 @@ end:
 
 int bt_ctf_field_is_integer(struct bt_ctf_field *field)
 {
-       return bt_ctf_field_get_type_id(field) == CTF_TYPE_INTEGER;
+       return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_INTEGER;
 }
 
 int bt_ctf_field_is_floating_point(struct bt_ctf_field *field)
 {
-       return bt_ctf_field_get_type_id(field) == CTF_TYPE_FLOAT;
+       return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_FLOAT;
 }
 
 int bt_ctf_field_is_enumeration(struct bt_ctf_field *field)
 {
-       return bt_ctf_field_get_type_id(field) == CTF_TYPE_ENUM;
+       return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_ENUM;
 }
 
 int bt_ctf_field_is_string(struct bt_ctf_field *field)
 {
-       return bt_ctf_field_get_type_id(field) == CTF_TYPE_STRING;
+       return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_STRING;
 }
 
 int bt_ctf_field_is_structure(struct bt_ctf_field *field)
 {
-       return bt_ctf_field_get_type_id(field) == CTF_TYPE_STRUCT;
+       return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_STRUCT;
 }
 
 int bt_ctf_field_is_array(struct bt_ctf_field *field)
 {
-       return bt_ctf_field_get_type_id(field) == CTF_TYPE_ARRAY;
+       return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_ARRAY;
 }
 
 int bt_ctf_field_is_sequence(struct bt_ctf_field *field)
 {
-       return bt_ctf_field_get_type_id(field) == CTF_TYPE_SEQUENCE;
+       return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_SEQUENCE;
 }
 
 int bt_ctf_field_is_variant(struct bt_ctf_field *field)
 {
-       return bt_ctf_field_get_type_id(field) == CTF_TYPE_VARIANT;
+       return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_VARIANT;
 }
 
 struct bt_ctf_field *bt_ctf_field_sequence_get_length(
@@ -355,7 +356,7 @@ struct bt_ctf_field *bt_ctf_field_sequence_get_length(
        }
 
        if (bt_ctf_field_type_get_type_id(field->type) !=
-               CTF_TYPE_SEQUENCE) {
+               BT_CTF_TYPE_ID_SEQUENCE) {
                goto end;
        }
 
@@ -380,7 +381,7 @@ int bt_ctf_field_sequence_set_length(struct bt_ctf_field *field,
                goto end;
        }
        if (bt_ctf_field_type_get_type_id(length_field->type) !=
-               CTF_TYPE_INTEGER) {
+               BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -428,7 +429,7 @@ struct bt_ctf_field *bt_ctf_field_structure_get_field(
 
        if (!field || !name ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_STRUCT) {
+                       BT_CTF_TYPE_ID_STRUCT) {
                goto error;
        }
 
@@ -473,7 +474,8 @@ struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
        struct bt_ctf_field *ret_field = NULL;
 
        if (!field ||
-               bt_ctf_field_type_get_type_id(field->type) != CTF_TYPE_STRUCT) {
+               bt_ctf_field_type_get_type_id(field->type) !=
+               BT_CTF_TYPE_ID_STRUCT) {
                goto end;
        }
 
@@ -525,7 +527,7 @@ int bt_ctf_field_structure_set_field(struct bt_ctf_field *field,
 
        if (!field || !name || !value ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_STRUCT) {
+                       BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -567,7 +569,7 @@ struct bt_ctf_field *bt_ctf_field_array_get_field(struct bt_ctf_field *field,
        struct bt_ctf_field_array *array;
 
        if (!field || bt_ctf_field_type_get_type_id(field->type) !=
-               CTF_TYPE_ARRAY) {
+               BT_CTF_TYPE_ID_ARRAY) {
                goto end;
        }
 
@@ -602,7 +604,7 @@ struct bt_ctf_field *bt_ctf_field_sequence_get_field(struct bt_ctf_field *field,
        struct bt_ctf_field_sequence *sequence;
 
        if (!field || bt_ctf_field_type_get_type_id(field->type) !=
-               CTF_TYPE_SEQUENCE) {
+               BT_CTF_TYPE_ID_SEQUENCE) {
                goto end;
        }
 
@@ -642,9 +644,9 @@ struct bt_ctf_field *bt_ctf_field_variant_get_field(struct bt_ctf_field *field,
 
        if (!field || !tag_field ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_VARIANT ||
+                       BT_CTF_TYPE_ID_VARIANT ||
                bt_ctf_field_type_get_type_id(tag_field->type) !=
-                       CTF_TYPE_ENUM) {
+                       BT_CTF_TYPE_ID_ENUM) {
                goto end;
        }
 
@@ -720,7 +722,7 @@ struct bt_ctf_field *bt_ctf_field_variant_get_current_field(
 
        if (!variant_field ||
                bt_ctf_field_type_get_type_id(variant_field->type) !=
-                       CTF_TYPE_VARIANT) {
+                       BT_CTF_TYPE_ID_VARIANT) {
                goto end;
        }
 
@@ -744,7 +746,7 @@ struct bt_ctf_field *bt_ctf_field_enumeration_get_container(
        struct bt_ctf_field_enumeration *enumeration;
 
        if (!field || bt_ctf_field_type_get_type_id(field->type) !=
-               CTF_TYPE_ENUM) {
+               BT_CTF_TYPE_ID_ENUM) {
                goto end;
        }
 
@@ -828,7 +830,7 @@ int bt_ctf_field_signed_integer_get_value(struct bt_ctf_field *field,
 
        if (!field || !value || !field->payload_set ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_INTEGER) {
+                       BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -858,7 +860,7 @@ int bt_ctf_field_signed_integer_set_value(struct bt_ctf_field *field,
 
        if (!field ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_INTEGER) {
+                       BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -894,7 +896,7 @@ int bt_ctf_field_unsigned_integer_get_value(struct bt_ctf_field *field,
 
        if (!field || !value || !field->payload_set ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_INTEGER) {
+                       BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -924,7 +926,7 @@ int bt_ctf_field_unsigned_integer_set_value(struct bt_ctf_field *field,
 
        if (!field ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_INTEGER) {
+                       BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -958,7 +960,7 @@ int bt_ctf_field_floating_point_get_value(struct bt_ctf_field *field,
 
        if (!field || !value || !field->payload_set ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_FLOAT) {
+                       BT_CTF_TYPE_ID_FLOAT) {
                ret = -1;
                goto end;
        }
@@ -978,7 +980,7 @@ int bt_ctf_field_floating_point_set_value(struct bt_ctf_field *field,
 
        if (!field ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_FLOAT) {
+                       BT_CTF_TYPE_ID_FLOAT) {
                ret = -1;
                goto end;
        }
@@ -997,7 +999,7 @@ const char *bt_ctf_field_string_get_value(struct bt_ctf_field *field)
 
        if (!field || !field->payload_set ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_STRING) {
+                       BT_CTF_TYPE_ID_STRING) {
                goto end;
        }
 
@@ -1016,7 +1018,7 @@ int bt_ctf_field_string_set_value(struct bt_ctf_field *field,
 
        if (!field || !value ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_STRING) {
+                       BT_CTF_TYPE_ID_STRING) {
                ret = -1;
                goto end;
        }
@@ -1041,7 +1043,7 @@ int bt_ctf_field_string_append(struct bt_ctf_field *field,
 
        if (!field || !value ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_STRING) {
+                       BT_CTF_TYPE_ID_STRING) {
                ret = -1;
                goto end;
        }
@@ -1070,7 +1072,7 @@ int bt_ctf_field_string_append_len(struct bt_ctf_field *field,
 
        if (!field || !value ||
                bt_ctf_field_type_get_type_id(field->type) !=
-                       CTF_TYPE_STRING) {
+                       BT_CTF_TYPE_ID_STRING) {
                ret = -1;
                goto end;
        }
@@ -1103,7 +1105,7 @@ BT_HIDDEN
 int bt_ctf_field_validate(struct bt_ctf_field *field)
 {
        int ret = 0;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        if (!field) {
                ret = -1;
@@ -1111,7 +1113,7 @@ int bt_ctf_field_validate(struct bt_ctf_field *field)
        }
 
        type_id = bt_ctf_field_type_get_type_id(field->type);
-       if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES) {
+       if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
                ret = -1;
                goto end;
        }
@@ -1125,7 +1127,7 @@ BT_HIDDEN
 int bt_ctf_field_reset(struct bt_ctf_field *field)
 {
        int ret = 0;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        if (!field) {
                ret = -1;
@@ -1133,7 +1135,7 @@ int bt_ctf_field_reset(struct bt_ctf_field *field)
        }
 
        type_id = bt_ctf_field_type_get_type_id(field->type);
-       if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES) {
+       if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
                ret = -1;
                goto end;
        }
@@ -1148,7 +1150,7 @@ int bt_ctf_field_serialize(struct bt_ctf_field *field,
                struct ctf_stream_pos *pos)
 {
        int ret = 0;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        if (!field || !pos) {
                ret = -1;
@@ -1156,7 +1158,7 @@ int bt_ctf_field_serialize(struct bt_ctf_field *field,
        }
 
        type_id = bt_ctf_field_type_get_type_id(field->type);
-       if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES) {
+       if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
                ret = -1;
                goto end;
        }
@@ -1170,14 +1172,14 @@ struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field)
 {
        int ret;
        struct bt_ctf_field *copy = NULL;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        if (!field) {
                goto end;
        }
 
        type_id = bt_ctf_field_type_get_type_id(field->type);
-       if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES) {
+       if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
                goto end;
        }
 
@@ -1339,13 +1341,13 @@ void bt_ctf_field_destroy(struct bt_object *obj)
 {
        struct bt_ctf_field *field;
        struct bt_ctf_field_type *type;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        field = container_of(obj, struct bt_ctf_field, base);
        type = field->type;
        type_id = bt_ctf_field_type_get_type_id(type);
-       if (type_id <= CTF_TYPE_UNKNOWN ||
-               type_id >= NR_CTF_TYPES) {
+       if (type_id <= BT_CTF_TYPE_ID_UNKNOWN ||
+               type_id >= BT_CTF_NR_TYPE_IDS) {
                return;
        }
 
index 67200dac0a31b15e1a08c14df64278ca1f70238b..eab0ef4347512143ff79745d027da75b812f0583 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 *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_type_integer_destroy,
-       [CTF_TYPE_ENUM] =
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_destroy,
+       [BT_CTF_TYPE_ID_ENUM] =
                bt_ctf_field_type_enumeration_destroy,
-       [CTF_TYPE_FLOAT] =
+       [BT_CTF_TYPE_ID_FLOAT] =
                bt_ctf_field_type_floating_point_destroy,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_type_structure_destroy,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_type_variant_destroy,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_type_array_destroy,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_type_sequence_destroy,
-       [CTF_TYPE_STRING] = bt_ctf_field_type_string_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,
 };
 
 static
@@ -103,14 +103,14 @@ void bt_ctf_field_type_sequence_freeze(struct bt_ctf_field_type *);
 
 static
 type_freeze_func const type_freeze_funcs[] = {
-       [CTF_TYPE_INTEGER] = generic_field_type_freeze,
-       [CTF_TYPE_ENUM] = bt_ctf_field_type_enumeration_freeze,
-       [CTF_TYPE_FLOAT] = generic_field_type_freeze,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_type_structure_freeze,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_type_variant_freeze,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_type_array_freeze,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_type_sequence_freeze,
-       [CTF_TYPE_STRING] = generic_field_type_freeze,
+       [BT_CTF_TYPE_ID_INTEGER] = generic_field_type_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,
 };
 
 static
@@ -140,17 +140,17 @@ int bt_ctf_field_type_string_serialize(struct bt_ctf_field_type *,
 
 static
 type_serialize_func const type_serialize_funcs[] = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_type_integer_serialize,
-       [CTF_TYPE_ENUM] =
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_serialize,
+       [BT_CTF_TYPE_ID_ENUM] =
                bt_ctf_field_type_enumeration_serialize,
-       [CTF_TYPE_FLOAT] =
+       [BT_CTF_TYPE_ID_FLOAT] =
                bt_ctf_field_type_floating_point_serialize,
-       [CTF_TYPE_STRUCT] =
+       [BT_CTF_TYPE_ID_STRUCT] =
                bt_ctf_field_type_structure_serialize,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_type_variant_serialize,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_type_array_serialize,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_type_sequence_serialize,
-       [CTF_TYPE_STRING] = bt_ctf_field_type_string_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,
 };
 
 static
@@ -179,17 +179,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 *,
                int byte_order, int set_native) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_type_integer_set_byte_order,
-       [CTF_TYPE_ENUM] =
+       [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_set_byte_order,
+       [BT_CTF_TYPE_ID_ENUM] =
                bt_ctf_field_type_enumeration_set_byte_order,
-       [CTF_TYPE_FLOAT] =
+       [BT_CTF_TYPE_ID_FLOAT] =
                bt_ctf_field_type_floating_point_set_byte_order,
-       [CTF_TYPE_STRUCT] =
+       [BT_CTF_TYPE_ID_STRUCT] =
                bt_ctf_field_type_structure_set_byte_order,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_type_variant_set_byte_order,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_type_array_set_byte_order,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_type_sequence_set_byte_order,
-       [CTF_TYPE_STRING] = NULL,
+       [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,
 };
 
 static
@@ -220,14 +220,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 *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_type_integer_copy,
-       [CTF_TYPE_ENUM] = bt_ctf_field_type_enumeration_copy,
-       [CTF_TYPE_FLOAT] = bt_ctf_field_type_floating_point_copy,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_type_structure_copy,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_type_variant_copy,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_type_array_copy,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_type_sequence_copy,
-       [CTF_TYPE_STRING] = bt_ctf_field_type_string_copy,
+       [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,
 };
 
 static
@@ -258,14 +258,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 *) = {
-       [CTF_TYPE_INTEGER] = bt_ctf_field_type_integer_compare,
-       [CTF_TYPE_ENUM] = bt_ctf_field_type_enumeration_compare,
-       [CTF_TYPE_FLOAT] = bt_ctf_field_type_floating_point_compare,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_type_structure_compare,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_type_variant_compare,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_type_array_compare,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_type_sequence_compare,
-       [CTF_TYPE_STRING] = bt_ctf_field_type_string_compare,
+       [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,
 };
 
 static
@@ -281,14 +281,14 @@ int bt_ctf_field_type_sequence_validate(struct bt_ctf_field_type *);
 
 static
 int (* const type_validate_funcs[])(struct bt_ctf_field_type *) = {
-       [CTF_TYPE_INTEGER] = NULL,
-       [CTF_TYPE_FLOAT] = NULL,
-       [CTF_TYPE_STRING] = NULL,
-       [CTF_TYPE_ENUM] = bt_ctf_field_type_enumeration_validate,
-       [CTF_TYPE_STRUCT] = bt_ctf_field_type_structure_validate,
-       [CTF_TYPE_VARIANT] = bt_ctf_field_type_variant_validate,
-       [CTF_TYPE_ARRAY] = bt_ctf_field_type_array_validate,
-       [CTF_TYPE_SEQUENCE] = bt_ctf_field_type_sequence_validate,
+       [BT_CTF_TYPE_ID_INTEGER] = NULL,
+       [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,
 };
 
 static
@@ -355,10 +355,10 @@ gint compare_enumeration_mappings_unsigned(struct enumeration_mapping **a,
 static
 void bt_ctf_field_type_init(struct bt_ctf_field_type *type, int init_bo)
 {
-       enum ctf_type_id type_id = type->declaration->id;
+       enum bt_ctf_type_id type_id = type->declaration->id;
 
-       assert(type && (type_id > CTF_TYPE_UNKNOWN) &&
-               (type_id < NR_CTF_TYPES));
+       assert(type && (type_id > BT_CTF_TYPE_ID_UNKNOWN) &&
+               (type_id < BT_CTF_NR_TYPE_IDS));
 
        bt_object_init(type, bt_ctf_field_type_destroy);
        type->freeze = type_freeze_funcs[type_id];
@@ -411,12 +411,12 @@ static
 void bt_ctf_field_type_destroy(struct bt_object *obj)
 {
        struct bt_ctf_field_type *type;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        type = container_of(obj, struct bt_ctf_field_type, base);
        type_id = type->declaration->id;
-       if (type_id <= CTF_TYPE_UNKNOWN ||
-               type_id >= NR_CTF_TYPES) {
+       if (type_id <= BT_CTF_TYPE_ID_UNKNOWN ||
+               type_id >= BT_CTF_NR_TYPE_IDS) {
                return;
        }
 
@@ -624,7 +624,7 @@ BT_HIDDEN
 int bt_ctf_field_type_validate(struct bt_ctf_field_type *type)
 {
        int ret = 0;
-       enum ctf_type_id id = bt_ctf_field_type_get_type_id(type);
+       enum bt_ctf_type_id id = bt_ctf_field_type_get_type_id(type);
 
        if (!type) {
                ret = -1;
@@ -659,7 +659,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_integer_create(unsigned int size)
        }
 
        integer->parent.declaration = &integer->declaration.p;
-       integer->parent.declaration->id = CTF_TYPE_INTEGER;
+       integer->parent.declaration->id = BT_CTF_TYPE_ID_INTEGER;
        integer->declaration.len = size;
        integer->declaration.base = BT_CTF_INTEGER_BASE_DECIMAL;
        integer->declaration.encoding = BT_CTF_STRING_ENCODING_NONE;
@@ -672,7 +672,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->declaration->id != CTF_TYPE_INTEGER) {
+       if (!type || type->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -688,7 +688,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->declaration->id != CTF_TYPE_INTEGER) {
+       if (!type || type->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -706,7 +706,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->declaration->id != CTF_TYPE_INTEGER) {
+               type->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -723,7 +723,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->declaration->id != CTF_TYPE_INTEGER) {
+       if (!type || type->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
                goto end;
        }
 
@@ -739,7 +739,7 @@ int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *type,
        int ret = 0;
 
        if (!type || type->frozen ||
-               type->declaration->id != CTF_TYPE_INTEGER) {
+               type->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -768,7 +768,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->declaration->id != CTF_TYPE_INTEGER) {
+       if (!type || type->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
                goto end;
        }
 
@@ -785,7 +785,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->declaration->id != CTF_TYPE_INTEGER) ||
+               (type->declaration->id != BT_CTF_TYPE_ID_INTEGER) ||
                (encoding < BT_CTF_STRING_ENCODING_NONE) ||
                (encoding >= BT_CTF_STRING_ENCODING_UNKNOWN)) {
                ret = -1;
@@ -844,7 +844,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
                goto error;
        }
 
-       if (integer_container_type->declaration->id != CTF_TYPE_INTEGER) {
+       if (integer_container_type->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
                goto error;
        }
 
@@ -854,7 +854,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
        }
 
        enumeration->parent.declaration = &enumeration->declaration.p;
-       enumeration->parent.declaration->id = CTF_TYPE_ENUM;
+       enumeration->parent.declaration->id = BT_CTF_TYPE_ID_ENUM;
        bt_get(integer_container_type);
        enumeration->container = integer_container_type;
        enumeration->entries = g_ptr_array_new_with_free_func(
@@ -876,7 +876,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_type(
                goto end;
        }
 
-       if (type->declaration->id != CTF_TYPE_ENUM) {
+       if (type->declaration->id != BT_CTF_TYPE_ID_ENUM) {
                goto end;
        }
 
@@ -899,7 +899,7 @@ int bt_ctf_field_type_enumeration_add_mapping(
        struct range_overlap_query query;
        char *escaped_string;
 
-       if (!type || (type->declaration->id != CTF_TYPE_ENUM) ||
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_ENUM) ||
                type->frozen ||
                (range_end < range_start)) {
                ret = -1;
@@ -962,7 +962,7 @@ int bt_ctf_field_type_enumeration_add_mapping_unsigned(
        struct range_overlap_query query;
        char *escaped_string;
 
-       if (!type || (type->declaration->id != CTF_TYPE_ENUM) ||
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_ENUM) ||
                type->frozen ||
                (range_end < range_start)) {
                ret = -1;
@@ -1066,7 +1066,7 @@ int bt_ctf_field_type_enumeration_get_mapping_count(
        int ret = 0;
        struct bt_ctf_field_type_enumeration *enumeration;
 
-       if (!type || (type->declaration->id != CTF_TYPE_ENUM)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_ENUM)) {
                ret = -1;
                goto end;
        }
@@ -1104,7 +1104,7 @@ int bt_ctf_field_type_enumeration_get_mapping(
        int ret = 0;
 
        if (!type || index < 0 || !string || !range_start || !range_end ||
-               (type->declaration->id != CTF_TYPE_ENUM)) {
+               (type->declaration->id != BT_CTF_TYPE_ID_ENUM)) {
                ret = -1;
                goto end;
        }
@@ -1130,7 +1130,7 @@ int bt_ctf_field_type_enumeration_get_mapping_unsigned(
        int ret = 0;
 
        if (!type || index < 0 || !string || !range_start || !range_end ||
-               (type->declaration->id != CTF_TYPE_ENUM)) {
+               (type->declaration->id != BT_CTF_TYPE_ID_ENUM)) {
                ret = -1;
                goto end;
        }
@@ -1156,7 +1156,7 @@ int bt_ctf_field_type_enumeration_get_mapping_index_by_name(
        int i, ret = 0;
 
        if (!type || !name ||
-               (type->declaration->id != CTF_TYPE_ENUM)) {
+               (type->declaration->id != BT_CTF_TYPE_ID_ENUM)) {
                ret = -1;
                goto end;
        }
@@ -1190,7 +1190,7 @@ int bt_ctf_field_type_enumeration_get_mapping_index_by_value(
        struct bt_ctf_field_type_enumeration *enumeration;
        int i, ret = 0;
 
-       if (!type || (type->declaration->id != CTF_TYPE_ENUM)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_ENUM)) {
                ret = -1;
                goto end;
        }
@@ -1219,7 +1219,7 @@ int bt_ctf_field_type_enumeration_get_mapping_index_by_unsigned_value(
        struct bt_ctf_field_type_enumeration *enumeration;
        int i, ret = 0;
 
-       if (!type || (type->declaration->id != CTF_TYPE_ENUM)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_ENUM)) {
                ret = -1;
                goto end;
        }
@@ -1256,7 +1256,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void)
        floating_point->declaration.exp = &floating_point->exp;
        floating_point->sign.len = 1;
        floating_point->parent.declaration = &floating_point->declaration.p;
-       floating_point->parent.declaration->id = CTF_TYPE_FLOAT;
+       floating_point->parent.declaration->id = BT_CTF_TYPE_ID_FLOAT;
        floating_point->declaration.exp->len =
                sizeof(float) * CHAR_BIT - FLT_MANT_DIG;
        floating_point->declaration.mantissa->len = FLT_MANT_DIG - 1;
@@ -1275,7 +1275,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->declaration->id != CTF_TYPE_FLOAT)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_FLOAT)) {
                ret = -1;
                goto end;
        }
@@ -1295,7 +1295,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->declaration->id != CTF_TYPE_FLOAT)) {
+               (type->declaration->id != BT_CTF_TYPE_ID_FLOAT)) {
                ret = -1;
                goto end;
        }
@@ -1321,7 +1321,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->declaration->id != CTF_TYPE_FLOAT)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_FLOAT)) {
                ret = -1;
                goto end;
        }
@@ -1341,7 +1341,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->declaration->id != CTF_TYPE_FLOAT)) {
+               (type->declaration->id != BT_CTF_TYPE_ID_FLOAT)) {
                ret = -1;
                goto end;
        }
@@ -1371,7 +1371,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void)
        }
 
        structure->parent.declaration = &structure->declaration.p;
-       structure->parent.declaration->id = CTF_TYPE_STRUCT;
+       structure->parent.declaration->id = BT_CTF_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);
@@ -1390,7 +1390,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->declaration->id != CTF_TYPE_STRUCT)) {
+               (type->declaration->id != BT_CTF_TYPE_ID_STRUCT)) {
                ret = -1;
                goto end;
        }
@@ -1412,7 +1412,7 @@ int bt_ctf_field_type_structure_get_field_count(
        int ret = 0;
        struct bt_ctf_field_type_structure *structure;
 
-       if (!type || (type->declaration->id != CTF_TYPE_STRUCT)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_STRUCT)) {
                ret = -1;
                goto end;
        }
@@ -1432,7 +1432,8 @@ int bt_ctf_field_type_structure_get_field(struct bt_ctf_field_type *type,
        struct structure_field *field;
        int ret = 0;
 
-       if (!type || index < 0 || (type->declaration->id != CTF_TYPE_STRUCT)) {
+       if (!type || index < 0 ||
+                       (type->declaration->id != BT_CTF_TYPE_ID_STRUCT)) {
                ret = -1;
                goto end;
        }
@@ -1504,7 +1505,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_create(
        }
 
        variant->parent.declaration = &variant->declaration.p;
-       variant->parent.declaration->id = CTF_TYPE_VARIANT;
+       variant->parent.declaration->id = BT_CTF_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(
@@ -1529,7 +1530,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->declaration->id != CTF_TYPE_VARIANT)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_VARIANT)) {
                goto end;
        }
 
@@ -1550,7 +1551,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->declaration->id != CTF_TYPE_VARIANT)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_VARIANT)) {
                goto end;
        }
 
@@ -1571,7 +1572,7 @@ int bt_ctf_field_type_variant_set_tag_name(
        struct bt_ctf_field_type_variant *variant;
 
        if (!type || type->frozen ||
-               (type->declaration->id != CTF_TYPE_VARIANT) ||
+               (type->declaration->id != BT_CTF_TYPE_ID_VARIANT) ||
                bt_ctf_validate_identifier(name)) {
                ret = -1;
                goto end;
@@ -1594,7 +1595,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->declaration->id != CTF_TYPE_VARIANT)) {
+               (type->declaration->id != BT_CTF_TYPE_ID_VARIANT)) {
                ret = -1;
                goto end;
        }
@@ -1671,7 +1672,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
        const char *enum_value;
        struct bt_ctf_field_type *field_type = NULL;
 
-       if (!type || !tag || type->declaration->id != CTF_TYPE_VARIANT) {
+       if (!type || !tag || type->declaration->id != BT_CTF_TYPE_ID_VARIANT) {
                goto end;
        }
 
@@ -1692,7 +1693,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->declaration->id != CTF_TYPE_VARIANT)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_VARIANT)) {
                ret = -1;
                goto end;
        }
@@ -1713,7 +1714,8 @@ int bt_ctf_field_type_variant_get_field(struct bt_ctf_field_type *type,
        struct structure_field *field;
        int ret = 0;
 
-       if (!type || index < 0 || (type->declaration->id != CTF_TYPE_VARIANT)) {
+       if (!type || index < 0 ||
+                       (type->declaration->id != BT_CTF_TYPE_ID_VARIANT)) {
                ret = -1;
                goto end;
        }
@@ -1753,7 +1755,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_array_create(
        }
 
        array->parent.declaration = &array->declaration.p;
-       array->parent.declaration->id = CTF_TYPE_ARRAY;
+       array->parent.declaration->id = BT_CTF_TYPE_ID_ARRAY;
 
        bt_get(element_type);
        array->element_type = element_type;
@@ -1770,7 +1772,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->declaration->id != CTF_TYPE_ARRAY)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_ARRAY)) {
                goto end;
        }
 
@@ -1789,7 +1791,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->declaration->id != CTF_TYPE_ARRAY)) {
+                       (type->declaration->id != BT_CTF_TYPE_ID_ARRAY)) {
                ret = -1;
                goto end;
        }
@@ -1812,7 +1814,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->declaration->id != CTF_TYPE_ARRAY)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_ARRAY)) {
                ret = -1;
                goto end;
        }
@@ -1839,7 +1841,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_sequence_create(
        }
 
        sequence->parent.declaration = &sequence->declaration.p;
-       sequence->parent.declaration->id = CTF_TYPE_SEQUENCE;
+       sequence->parent.declaration->id = BT_CTF_TYPE_ID_SEQUENCE;
        bt_get(element_type);
        sequence->element_type = element_type;
        sequence->length_field_name = g_string_new(length_field_name);
@@ -1855,7 +1857,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->declaration->id != CTF_TYPE_SEQUENCE)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_SEQUENCE)) {
                goto end;
        }
 
@@ -1875,7 +1877,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->declaration->id != CTF_TYPE_SEQUENCE)) {
+                       (type->declaration->id != BT_CTF_TYPE_ID_SEQUENCE)) {
                ret = -1;
                goto end;
        }
@@ -1899,7 +1901,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->declaration->id != CTF_TYPE_SEQUENCE)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_SEQUENCE)) {
                goto end;
        }
 
@@ -1920,7 +1922,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_string_create(void)
        }
 
        string->parent.declaration = &string->declaration.p;
-       string->parent.declaration->id = CTF_TYPE_STRING;
+       string->parent.declaration->id = BT_CTF_TYPE_ID_STRING;
        bt_ctf_field_type_init(&string->parent, TRUE);
        string->declaration.encoding = BT_CTF_STRING_ENCODING_UTF8;
        string->parent.declaration->alignment = CHAR_BIT;
@@ -1933,7 +1935,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->declaration->id != CTF_TYPE_STRING)) {
+       if (!type || (type->declaration->id != BT_CTF_TYPE_ID_STRING)) {
                goto end;
        }
 
@@ -1950,7 +1952,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->declaration->id != CTF_TYPE_STRING ||
+       if (!type || type->declaration->id != BT_CTF_TYPE_ID_STRING ||
                (encoding != BT_CTF_STRING_ENCODING_UTF8 &&
                encoding != BT_CTF_STRING_ENCODING_ASCII)) {
                ret = -1;
@@ -1966,7 +1968,7 @@ end:
 int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
 {
        int ret;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        if (!type) {
                ret = -1;
@@ -1980,7 +1982,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 CTF_TYPE_SEQUENCE:
+       case BT_CTF_TYPE_ID_SEQUENCE:
        {
                struct bt_ctf_field_type *element =
                        bt_ctf_field_type_sequence_get_element_type(type);
@@ -1994,7 +1996,7 @@ int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
                bt_put(element);
                break;
        }
-       case CTF_TYPE_ARRAY:
+       case BT_CTF_TYPE_ID_ARRAY:
        {
                struct bt_ctf_field_type *element =
                        bt_ctf_field_type_array_get_element_type(type);
@@ -2008,7 +2010,7 @@ int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
                bt_put(element);
                break;
        }
-       case CTF_TYPE_STRUCT:
+       case BT_CTF_TYPE_ID_STRUCT:
        {
                int i, element_count;
 
@@ -2044,7 +2046,7 @@ int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
                ret = (int) type->declaration->alignment;
                break;
        }
-       case CTF_TYPE_UNKNOWN:
+       case BT_CTF_TYPE_ID_UNKNOWN:
                ret = -1;
                break;
        default:
@@ -2065,7 +2067,7 @@ int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *type,
                unsigned int alignment)
 {
        int ret = 0;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        /* Alignment must be a power of two */
        if (!type || type->frozen || !is_power_of_two(alignment)) {
@@ -2074,19 +2076,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 == CTF_TYPE_UNKNOWN) {
+       if (type_id == BT_CTF_TYPE_ID_UNKNOWN) {
                ret = -1;
                goto end;
        }
 
-       if (type->declaration->id == CTF_TYPE_STRING &&
+       if (type->declaration->id == BT_CTF_TYPE_ID_STRING &&
                alignment != CHAR_BIT) {
                ret = -1;
                goto end;
        }
 
-       if (type_id == CTF_TYPE_VARIANT || type_id == CTF_TYPE_SEQUENCE ||
-               type_id == CTF_TYPE_ARRAY) {
+       if (type_id == BT_CTF_TYPE_ID_VARIANT ||
+               type_id == BT_CTF_TYPE_ID_SEQUENCE ||
+               type_id == BT_CTF_TYPE_ID_ARRAY) {
                /* Setting an alignment on these types makes no sense */
                ret = -1;
                goto end;
@@ -2108,14 +2111,14 @@ enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(
        }
 
        switch (type->declaration->id) {
-       case CTF_TYPE_INTEGER:
+       case BT_CTF_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 CTF_TYPE_FLOAT:
+       case BT_CTF_TYPE_ID_FLOAT:
        {
                struct bt_ctf_field_type_floating_point *floating_point =
                        container_of(type,
@@ -2142,7 +2145,7 @@ int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *type,
 {
        int ret = 0;
        int internal_byte_order;
-       enum ctf_type_id type_id;
+       enum bt_ctf_type_id type_id;
 
        if (!type || type->frozen) {
                ret = -1;
@@ -2174,11 +2177,11 @@ end:
        return ret;
 }
 
-enum ctf_type_id bt_ctf_field_type_get_type_id(
+enum bt_ctf_type_id bt_ctf_field_type_get_type_id(
                struct bt_ctf_field_type *type)
 {
        if (!type) {
-               return CTF_TYPE_UNKNOWN;
+               return BT_CTF_TYPE_ID_UNKNOWN;
        }
 
        return type->declaration->id;
@@ -2186,42 +2189,42 @@ enum 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) == CTF_TYPE_INTEGER;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_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) == CTF_TYPE_FLOAT;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_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) == CTF_TYPE_ENUM;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_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) == CTF_TYPE_STRING;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_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) == CTF_TYPE_STRUCT;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_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) == CTF_TYPE_ARRAY;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_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) == CTF_TYPE_SEQUENCE;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_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) == CTF_TYPE_VARIANT;
+       return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_VARIANT;
 }
 
 void bt_ctf_field_type_get(struct bt_ctf_field_type *type)
@@ -2371,7 +2374,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) != CTF_TYPE_STRUCT) {
+               bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -2402,7 +2405,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) != CTF_TYPE_STRUCT) {
+               bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -2433,7 +2436,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) != CTF_TYPE_VARIANT) {
+               bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_VARIANT) {
                ret = -1;
                goto end;
        }
@@ -2464,7 +2467,8 @@ int bt_ctf_field_type_sequence_set_length_field_path(
        int ret = 0;
        struct bt_ctf_field_type_sequence *sequence;
 
-       if (!type || bt_ctf_field_type_get_type_id(type) != CTF_TYPE_SEQUENCE) {
+       if (!type || bt_ctf_field_type_get_type_id(type) !=
+                       BT_CTF_TYPE_ID_SEQUENCE) {
                ret = -1;
                goto end;
        }
@@ -2484,7 +2488,8 @@ int bt_ctf_field_type_variant_set_tag_field_path(struct bt_ctf_field_type *type,
        int ret = 0;
        struct bt_ctf_field_type_variant *variant;
 
-       if (!type || bt_ctf_field_type_get_type_id(type) != CTF_TYPE_VARIANT) {
+       if (!type || bt_ctf_field_type_get_type_id(type) !=
+                       BT_CTF_TYPE_ID_VARIANT) {
                ret = -1;
                goto end;
        }
@@ -2505,7 +2510,8 @@ int bt_ctf_field_type_variant_set_tag_field_type(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_variant *variant;
 
        if (!type || !tag ||
-                       bt_ctf_field_type_get_type_id(tag) != CTF_TYPE_ENUM) {
+                       bt_ctf_field_type_get_type_id(tag) !=
+                       BT_CTF_TYPE_ID_ENUM) {
                ret = -1;
                goto end;
        }
@@ -2530,7 +2536,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) != CTF_TYPE_VARIANT) {
+               bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_VARIANT) {
                ret = -1;
                goto end;
        }
@@ -3968,7 +3974,7 @@ int bt_ctf_field_type_compare(struct bt_ctf_field_type *type_a,
                goto end;
        }
 
-       if (type_a->declaration->id == CTF_TYPE_UNKNOWN) {
+       if (type_a->declaration->id == BT_CTF_TYPE_ID_UNKNOWN) {
                /* Both have unknown type IDs */
                goto end;
        }
index 1e9f2b853bb1478308eca087598f0610d15c7928..f9779e240a080f64572e093c1f1cf645e3d81df0 100644 (file)
@@ -349,7 +349,8 @@ int bt_ctf_event_class_set_payload_type(struct bt_ctf_event_class *event_class,
        int ret = 0;
 
        if (!event_class || !payload ||
-               bt_ctf_field_type_get_type_id(payload) != CTF_TYPE_STRUCT) {
+               bt_ctf_field_type_get_type_id(payload) !=
+               BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -374,7 +375,7 @@ int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
        }
 
        if (bt_ctf_field_type_get_type_id(event_class->fields) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -396,7 +397,7 @@ int bt_ctf_event_class_get_field_count(
        }
 
        if (bt_ctf_field_type_get_type_id(event_class->fields) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -418,7 +419,7 @@ int bt_ctf_event_class_get_field(struct bt_ctf_event_class *event_class,
        }
 
        if (bt_ctf_field_type_get_type_id(event_class->fields) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -440,7 +441,7 @@ struct bt_ctf_field_type *bt_ctf_event_class_get_field_by_name(
        }
 
        if (bt_ctf_field_type_get_type_id(event_class->fields) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                goto end;
        }
 
@@ -485,7 +486,7 @@ int bt_ctf_event_class_set_context_type(
                goto end;
        }
 
-       if (bt_ctf_field_type_get_type_id(context) != CTF_TYPE_STRUCT) {
+       if (bt_ctf_field_type_get_type_id(context) != BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -834,7 +835,8 @@ int bt_ctf_event_set_payload_field(struct bt_ctf_event *event,
                goto end;
        }
 
-       if (bt_ctf_field_type_get_type_id(payload_type) != CTF_TYPE_STRUCT) {
+       if (bt_ctf_field_type_get_type_id(payload_type) !=
+                       BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -1034,7 +1036,8 @@ int set_integer_field_value(struct bt_ctf_field* field, uint64_t value)
        field_type = bt_ctf_field_get_type(field);
        assert(field_type);
 
-       if (bt_ctf_field_type_get_type_id(field_type) != CTF_TYPE_INTEGER) {
+       if (bt_ctf_field_type_get_type_id(field_type) !=
+                       BT_CTF_TYPE_ID_INTEGER) {
                /* Not an integer and the value is unset, error. */
                ret = -1;
                goto end;
index b5e7e79dca12b2f7330a68ee838101a1da6f4b89..ead548a7f4736bcf9d3898a599691b03592e47ce 100644 (file)
@@ -587,7 +587,7 @@ int bt_ctf_stream_class_set_packet_context_type(
                goto end;
        }
        if (bt_ctf_field_type_get_type_id(packet_context_type) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                /* A packet context must be a structure */
                ret = -1;
                goto end;
@@ -632,7 +632,7 @@ int bt_ctf_stream_class_set_event_header_type(
                goto end;
        }
        if (bt_ctf_field_type_get_type_id(event_header_type) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                /* An event header must be a structure */
                ret = -1;
                goto end;
@@ -673,7 +673,7 @@ int bt_ctf_stream_class_set_event_context_type(
        }
 
        if (bt_ctf_field_type_get_type_id(event_context_type) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                /* A packet context must be a structure */
                ret = -1;
                goto end;
index cc5548b548033345239bd1e4c0234e2c116f3460..1ee583f0790da3e8fa0a13a40308cb4af1627bd0 100644 (file)
@@ -68,7 +68,7 @@ int set_packet_header_magic(struct bt_ctf_stream *stream)
        assert(magic_field_type);
 
        if (bt_ctf_field_type_get_type_id(magic_field_type) !=
-               CTF_TYPE_INTEGER) {
+               BT_CTF_TYPE_ID_INTEGER) {
                /* Magic field is not an integer. Not an error, skip. */
                goto end;
        }
@@ -119,7 +119,7 @@ int set_packet_header_uuid(struct bt_ctf_stream *stream)
        uuid_field_type = bt_ctf_field_get_type(uuid_field);
        assert(uuid_field_type);
        if (bt_ctf_field_type_get_type_id(uuid_field_type) !=
-               CTF_TYPE_ARRAY) {
+               BT_CTF_TYPE_ID_ARRAY) {
                /* UUID field is not an array. Not an error, skip. */
                goto end;
        }
@@ -136,7 +136,7 @@ int set_packet_header_uuid(struct bt_ctf_stream *stream)
                uuid_field_type);
        assert(element_field_type);
        if (bt_ctf_field_type_get_type_id(element_field_type) !=
-               CTF_TYPE_INTEGER) {
+               BT_CTF_TYPE_ID_INTEGER) {
                /* UUID array elements are not integers. Not an error, skip */
                goto end;
        }
@@ -192,7 +192,7 @@ int set_packet_header_stream_id(struct bt_ctf_stream *stream)
        stream_id_field_type = bt_ctf_field_get_type(stream_id_field);
        assert(stream_id_field_type);
        if (bt_ctf_field_type_get_type_id(stream_id_field_type) !=
-               CTF_TYPE_INTEGER) {
+               BT_CTF_TYPE_ID_INTEGER) {
                /* stream_id field is not an integer. Not an error, skip. */
                goto end;
        }
@@ -703,7 +703,7 @@ int get_event_header_timestamp(struct bt_ctf_field *event_header, uint64_t *time
        timestamp_field_type = bt_ctf_field_get_type(timestamp_field);
        assert(timestamp_field_type);
        if (bt_ctf_field_type_get_type_id(timestamp_field_type) !=
-               CTF_TYPE_INTEGER) {
+               BT_CTF_TYPE_ID_INTEGER) {
                ret = -1;
                goto end;
        }
@@ -955,7 +955,7 @@ int set_structure_field_integer(struct bt_ctf_field *structure, char *name,
        field_type = bt_ctf_field_get_type(integer);
        /* Something is serioulsly wrong */
        assert(field_type);
-       if (bt_ctf_field_type_get_type_id(field_type) != CTF_TYPE_INTEGER) {
+       if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
                /*
                 * The user most likely meant for us to populate this field
                 * automatically. However, we can only do this if the field
index dce9474baa787f33faea3c797880e7f67ebb4757..75a47952eedd4f68e5c0b44ec1c624ddf8e8c5c8 100644 (file)
@@ -1002,7 +1002,7 @@ int bt_ctf_trace_set_packet_header_type(struct bt_ctf_trace *trace,
 
        /* packet_header_type must be a structure */
        if (bt_ctf_field_type_get_type_id(packet_header_type) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
index aabcd9b9f6c5335d2bb377d180f14de4881e3c43..6deaa7a0fa1346bc9e83c3f2c36fbc63a62a7c56 100644 (file)
@@ -190,15 +190,15 @@ static
 int field_type_contains_sequence_or_variant_ft(struct bt_ctf_field_type *type)
 {
        int ret = 0;
-       enum ctf_type_id type_id = bt_ctf_field_type_get_type_id(type);
+       enum bt_ctf_type_id type_id = bt_ctf_field_type_get_type_id(type);
 
        switch (type_id) {
-       case CTF_TYPE_SEQUENCE:
-       case CTF_TYPE_VARIANT:
+       case BT_CTF_TYPE_ID_SEQUENCE:
+       case BT_CTF_TYPE_ID_VARIANT:
                ret = 1;
                goto end;
-       case CTF_TYPE_ARRAY:
-       case CTF_TYPE_STRUCT:
+       case BT_CTF_TYPE_ID_ARRAY:
+       case BT_CTF_TYPE_ID_STRUCT:
        {
                int i;
                int field_count = bt_ctf_field_type_get_field_count(type);
index 53d67d24c77ede0c217db3f4282b6a75764e4962..40ba4aa03ba6222802d6ae55f5aa39167478a658 100644 (file)
@@ -465,7 +465,7 @@ struct bt_declaration *ctf_type_declarator_visit(FILE *fd, int depth,
                                fprintf(fd, "[error] %s: cannot find typealias \"%s\".\n", __func__, g_quark_to_string(alias_q));
                                return NULL;
                        }
-                       if (nested_declaration->id == CTF_TYPE_INTEGER) {
+                       if (nested_declaration->id == BT_CTF_TYPE_ID_INTEGER) {
                                struct declaration_integer *integer_declaration =
                                        container_of(nested_declaration, struct declaration_integer, p);
                                /* For base to 16 for pointers (expected pretty-print) */
@@ -513,7 +513,7 @@ struct bt_declaration *ctf_type_declarator_visit(FILE *fd, int depth,
                        fprintf(fd, "[error] %s: expecting length field reference or value.\n", __func__);
                        return NULL;
                }
-               first = _bt_list_first_entry(&node_type_declarator->u.type_declarator.u.nested.length, 
+               first = _bt_list_first_entry(&node_type_declarator->u.type_declarator.u.nested.length,
                                struct ctf_node, siblings);
                if (first->type != NODE_UNARY_EXPRESSION) {
                        return NULL;
@@ -669,7 +669,7 @@ int ctf_typedef_visit(FILE *fd, int depth, struct declaration_scope *scope,
                 * Don't allow typedef and typealias of untagged
                 * variants.
                 */
-               if (type_declaration->id == CTF_TYPE_UNTAGGED_VARIANT) {
+               if (type_declaration->id == BT_CTF_TYPE_ID_UNTAGGED_VARIANT) {
                        fprintf(fd, "[error] %s: typedef of untagged variant is not permitted.\n", __func__);
                        bt_declaration_unref(type_declaration);
                        return -EPERM;
@@ -719,7 +719,7 @@ int ctf_typealias_visit(FILE *fd, int depth, struct declaration_scope *scope,
         * Don't allow typedef and typealias of untagged
         * variants.
         */
-       if (type_declaration->id == CTF_TYPE_UNTAGGED_VARIANT) {
+       if (type_declaration->id == BT_CTF_TYPE_ID_UNTAGGED_VARIANT) {
                fprintf(fd, "[error] %s: typedef of untagged variant is not permitted.\n", __func__);
                bt_declaration_unref(type_declaration);
                return -EPERM;
@@ -1131,7 +1131,7 @@ struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
                        fprintf(fd, "[error] %s: unable to create container type for enumeration\n", __func__);
                        return NULL;
                }
-               if (declaration->id != CTF_TYPE_INTEGER) {
+               if (declaration->id != BT_CTF_TYPE_ID_INTEGER) {
                        fprintf(fd, "[error] %s: container type for enumeration is not integer\n", __func__);
                        return NULL;
                }
@@ -1350,7 +1350,7 @@ struct bt_declaration *ctf_declaration_integer_visit(FILE *fd, int depth,
                        switch (right->u.unary_expression.type) {
                        case UNARY_UNSIGNED_CONSTANT:
                                switch (right->u.unary_expression.u.unsigned_constant) {
-                               case 2: 
+                               case 2:
                                case 8:
                                case 10:
                                case 16:
@@ -1769,7 +1769,7 @@ int ctf_event_declaration_visit(FILE *fd, int depth, struct ctf_node *node, stru
                                ret = -EPERM;
                                goto error;
                        }
-                       if (declaration->id != CTF_TYPE_STRUCT) {
+                       if (declaration->id != BT_CTF_TYPE_ID_STRUCT) {
                                ret = -EPERM;
                                goto error;
                        }
@@ -1790,7 +1790,7 @@ int ctf_event_declaration_visit(FILE *fd, int depth, struct ctf_node *node, stru
                                ret = -EPERM;
                                goto error;
                        }
-                       if (declaration->id != CTF_TYPE_STRUCT) {
+                       if (declaration->id != BT_CTF_TYPE_ID_STRUCT) {
                                ret = -EPERM;
                                goto error;
                        }
@@ -1922,7 +1922,7 @@ error:
        return ret;
 }
 
+
 static
 int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_stream_declaration *stream, struct ctf_trace *trace)
 {
@@ -1982,7 +1982,7 @@ int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, str
                                ret = -EPERM;
                                goto error;
                        }
-                       if (declaration->id != CTF_TYPE_STRUCT) {
+                       if (declaration->id != BT_CTF_TYPE_ID_STRUCT) {
                                ret = -EPERM;
                                goto error;
                        }
@@ -2003,7 +2003,7 @@ int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, str
                                ret = -EPERM;
                                goto error;
                        }
-                       if (declaration->id != CTF_TYPE_STRUCT) {
+                       if (declaration->id != BT_CTF_TYPE_ID_STRUCT) {
                                ret = -EPERM;
                                goto error;
                        }
@@ -2024,7 +2024,7 @@ int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, str
                                ret = -EPERM;
                                goto error;
                        }
-                       if (declaration->id != CTF_TYPE_STRUCT) {
+                       if (declaration->id != BT_CTF_TYPE_ID_STRUCT) {
                                ret = -EPERM;
                                goto error;
                        }
@@ -2232,7 +2232,7 @@ int ctf_trace_declaration_visit(FILE *fd, int depth, struct ctf_node *node, stru
                                ret = -EPERM;
                                goto error;
                        }
-                       if (declaration->id != CTF_TYPE_STRUCT) {
+                       if (declaration->id != BT_CTF_TYPE_ID_STRUCT) {
                                ret = -EPERM;
                                goto error;
                        }
index 979f7a3dc313895d29085e6de09e7ad904b675c0..016d527fb1b328cf81ba374521d38e7126a460ef 100644 (file)
@@ -38,7 +38,7 @@ int ctf_array_read(struct bt_stream_pos *ppos, struct bt_definition *definition)
        struct ctf_stream_pos *pos =
                container_of(ppos, struct ctf_stream_pos, parent);
 
-       if (elem->id == CTF_TYPE_INTEGER) {
+       if (elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(elem, struct declaration_integer, p);
 
@@ -78,7 +78,7 @@ int ctf_array_write(struct bt_stream_pos *ppos, struct bt_definition *definition
        struct ctf_stream_pos *pos =
                container_of(ppos, struct ctf_stream_pos, parent);
 
-       if (elem->id == CTF_TYPE_INTEGER) {
+       if (elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(elem, struct declaration_integer, p);
 
index 5dae7d0281d4610c586d00b2ee487e8ddb5a063d..518b13d52fe29d1052b4b4787b6a221573518795 100644 (file)
@@ -37,7 +37,7 @@ int ctf_sequence_read(struct bt_stream_pos *ppos, struct bt_definition *definiti
        struct bt_declaration *elem = sequence_declaration->elem;
        struct ctf_stream_pos *pos = ctf_pos(ppos);
 
-       if (elem->id == CTF_TYPE_INTEGER) {
+       if (elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(elem, struct declaration_integer, p);
 
@@ -74,7 +74,7 @@ int ctf_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *definit
        struct bt_declaration *elem = sequence_declaration->elem;
        struct ctf_stream_pos *pos = ctf_pos(ppos);
 
-       if (elem->id == CTF_TYPE_INTEGER) {
+       if (elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(elem, struct declaration_integer, p);
 
index 898fee981e353c730b8883fa0303552b6ca9288f..28d6fa5aea49a3d3f5de3c37371f9b3530255c7a 100644 (file)
@@ -364,7 +364,7 @@ extern struct bt_ctf_field_type *bt_ctf_field_get_type(
  *
  * Returns the field's ctf_type_id, CTF_TYPE_UNKNOWN on error.
  */
-extern enum ctf_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field);
+extern enum bt_ctf_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field);
 
 /*
  * bt_ctf_field_is_integer: returns whether or not a given field
index 054615f121d4001bc37f281005463365321f7751..be6b7ea20b0df826cf59bf32c1964a7fb87076b1 100644 (file)
@@ -30,7 +30,6 @@
  * http://www.efficios.com/ctf
  */
 
-#include <babeltrace/ctf/events.h>
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -43,6 +42,51 @@ struct bt_ctf_field_type;
 struct bt_ctf_field;
 struct bt_ctf_field_path;
 
+/*
+ * Babeltrace 1.x enumerations that were also used in CTF writer's API.
+ * They are left here for backward compatibility reasons, but
+ * enum bt_ctf_type_id and enum bt_ctf_string_encoding should be used
+ * in new code. Both new enumerations are compatible with their legacy
+ * 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,
+       NR_CTF_TYPES,
+};
+
+/*
+ * Old enum.
+ */
+enum ctf_string_encoding {
+       CTF_STRING_NONE = 0,
+       CTF_STRING_UTF8,
+       CTF_STRING_ASCII,
+       CTF_STRING_UNKNOWN,
+};
+
+enum bt_ctf_type_id {
+       BT_CTF_TYPE_ID_UNKNOWN = CTF_TYPE_UNKNOWN,
+       BT_CTF_TYPE_ID_INTEGER = CTF_TYPE_INTEGER,
+       BT_CTF_TYPE_ID_FLOAT = CTF_TYPE_FLOAT,
+       BT_CTF_TYPE_ID_ENUM = CTF_TYPE_ENUM,
+       BT_CTF_TYPE_ID_STRING = CTF_TYPE_STRING,
+       BT_CTF_TYPE_ID_STRUCT = CTF_TYPE_STRUCT,
+       BT_CTF_TYPE_ID_UNTAGGED_VARIANT = CTF_TYPE_UNTAGGED_VARIANT,
+       BT_CTF_TYPE_ID_VARIANT = CTF_TYPE_VARIANT,
+       BT_CTF_TYPE_ID_ARRAY = CTF_TYPE_ARRAY,
+       BT_CTF_TYPE_ID_SEQUENCE = CTF_TYPE_SEQUENCE,
+       BT_CTF_NR_TYPE_IDS,
+};
+
 enum bt_ctf_integer_base {
        BT_CTF_INTEGER_BASE_UNKNOWN = -1,
        BT_CTF_INTEGER_BASE_BINARY = 2,
@@ -808,13 +852,13 @@ extern int bt_ctf_field_type_compare(struct bt_ctf_field_type *type_a,
                struct bt_ctf_field_type *type_b);
 
 /*
- * bt_ctf_field_type_get_type_id: get a field type's ctf_type_id.
+ * bt_ctf_field_type_get_type_id: get a field type's bt_ctf_type_id.
  *
  * @param type Field type.
  *
- * Returns the field type's ctf_type_id, CTF_TYPE_UNKNOWN on error.
+ * Returns the field type's bt_ctf_type_id, CTF_TYPE_UNKNOWN on error.
  */
-extern enum ctf_type_id bt_ctf_field_type_get_type_id(
+extern enum bt_ctf_type_id bt_ctf_field_type_get_type_id(
                struct bt_ctf_field_type *type);
 
 /*
index 41bc8461ef7bb79aaf4d95dee758d287880802cd..014f4b9841d1ff1000c935fe69965196aacfdff8 100644 (file)
  */
 
 #include <glib.h>
-#include <babeltrace/ctf/events.h>
+#include <babeltrace/babeltrace-internal.h>
+
+struct bt_ctf_iter;
+struct ctf_stream_definition;
 
 struct bt_callback {
        int prio;               /* Callback order priority. Lower first. Dynamically assigned from dependency graph. */
index 48caa54429fd70fe0f9299f82b0e1930f5ee03c5..ba64bc09939de9c2a8283c4a48ad28e1722a2b64 100644 (file)
@@ -35,6 +35,7 @@
 #include <babeltrace/ctf/callbacks.h>
 #include <babeltrace/ctf/callbacks-internal.h>
 #include <babeltrace/ctf-ir/metadata.h>
+#include <babeltrace/ctf-ir/event-types.h>
 #include <glib.h>
 
 struct ctf_stream_definition;
@@ -83,4 +84,236 @@ void ctf_update_current_packet_index(struct ctf_stream_definition *stream,
                struct packet_index *prev_index,
                struct packet_index *cur_index);
 
+struct bt_definition;
+struct bt_declaration;
+struct bt_ctf_event;
+struct bt_ctf_event_decl;
+struct bt_ctf_field_decl;
+
+/*
+ * the top-level scopes in CTF
+ */
+enum ctf_scope {
+       BT_TRACE_PACKET_HEADER          = 0,
+       BT_STREAM_PACKET_CONTEXT        = 1,
+       BT_STREAM_EVENT_HEADER          = 2,
+       BT_STREAM_EVENT_CONTEXT         = 3,
+       BT_EVENT_CONTEXT                = 4,
+       BT_EVENT_FIELDS                 = 5,
+};
+
+/*
+ * bt_ctf_get_top_level_scope: return a definition of the top-level scope
+ *
+ * Top-level scopes are defined in the ctf_scope enum.
+ * In order to get a field or a field list, the user needs to pass a
+ * scope as argument, this scope can be a top-level scope or a scope
+ * relative to an arbitrary field. This function provides the mapping
+ * between the enum and the actual definition of top-level scopes.
+ * On error return NULL.
+ */
+const struct bt_definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *event,
+               enum ctf_scope scope);
+
+/*
+ * bt_ctf_event_get_name: returns the name of the event or NULL on error
+ */
+const char *bt_ctf_event_name(const struct bt_ctf_event *event);
+
+/*
+ * bt_ctf_get_cycles: returns the timestamp of the event as written
+ * in the packet (in cycles) or -1ULL on error.
+ */
+uint64_t bt_ctf_get_cycles(const struct bt_ctf_event *event);
+
+/*
+ * bt_ctf_get_timestamp: get the timestamp of the event offsetted
+ * with the system clock source (in ns) in *timestamp.
+ *
+ * Return 0 on success, or -1ULL on error.
+ */
+int bt_ctf_get_timestamp(const struct bt_ctf_event *event, int64_t *timestamp);
+
+/*
+ * bt_ctf_get_field_list: obtain the list of fields for compound type
+ *
+ * This function can be used to obtain the list of fields contained
+ * within a top-level scope of an event or a compound type: array,
+ * sequence, structure, or variant.
+
+ * This function sets the "list" pointer to an array of definition
+ * pointers and set count to the number of elements in the array.
+ * Return 0 on success and a negative value on error.
+ *
+ * The content pointed to by "list" should *not* be freed. It stays
+ * valid as long as the event is unchanged (as long as the iterator
+ * from which the event is extracted is unchanged).
+ */
+int bt_ctf_get_field_list(const struct bt_ctf_event *event,
+               const struct bt_definition *scope,
+               struct bt_definition const * const **list,
+               unsigned int *count);
+
+/*
+ * bt_ctf_get_field: returns the definition of a specific field
+ */
+const struct bt_definition *bt_ctf_get_field(const struct bt_ctf_event *event,
+               const struct bt_definition *scope,
+               const char *field);
+
+/*
+ * bt_ctf_get_index: if the field is an array or a sequence, return the element
+ * at position index, otherwise return NULL;
+ */
+const struct bt_definition *bt_ctf_get_index(const struct bt_ctf_event *event,
+               const struct bt_definition *field,
+               unsigned int index);
+
+/*
+ * bt_ctf_field_name: returns the name of a field or NULL on error
+ */
+const char *bt_ctf_field_name(const struct bt_definition *def);
+
+/*
+ * bt_ctf_get_decl_from_def: return the declaration of a field from
+ * its definition or NULL on error
+ */
+const struct bt_declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def);
+
+/*
+ * bt_ctf_get_decl_from_field_decl: return the declaration of a field from
+ * a field_decl or NULL on error
+ */
+const struct bt_declaration *bt_ctf_get_decl_from_field_decl(
+               const struct bt_ctf_field_decl *field);
+
+/*
+ * bt_ctf_field_type: returns the type of a field or -1 if unknown
+ */
+enum ctf_type_id bt_ctf_field_type(const struct bt_declaration *decl);
+
+/*
+ * bt_ctf_get_int_signedness: return the signedness of an integer
+ *
+ * return 0 if unsigned
+ * return 1 if signed
+ * return -1 on error
+ */
+int bt_ctf_get_int_signedness(const struct bt_declaration *decl);
+
+/*
+ * bt_ctf_get_int_base: return the base of an int or a negative value on error
+ */
+int bt_ctf_get_int_base(const struct bt_declaration *decl);
+
+/*
+ * bt_ctf_get_int_byte_order: return the byte order of an int or a negative
+ * value on error
+ */
+int bt_ctf_get_int_byte_order(const struct bt_declaration *decl);
+
+/*
+ * bt_ctf_get_int_len: return the size, in bits, of an int or a negative
+ * value on error
+ */
+ssize_t bt_ctf_get_int_len(const struct bt_declaration *decl);
+
+/*
+ * bt_ctf_get_encoding: return the encoding of an int, a string, or of
+ * the integer contained in a char array or a sequence.
+ * return a negative value on error
+ */
+enum ctf_string_encoding bt_ctf_get_encoding(const struct bt_declaration *decl);
+
+/*
+ * bt_ctf_get_array_len: return the len of an array or a negative
+ * value on error
+ */
+int bt_ctf_get_array_len(const struct bt_declaration *decl);
+
+/*
+ * bt_ctf_get_struct_field_count: return the number of fields in a structure.
+ * Returns a negative value on error.
+ */
+uint64_t bt_ctf_get_struct_field_count(const struct bt_definition *field);
+
+/*
+ * Field access functions
+ *
+ * These functions return the value associated with the field passed in
+ * parameter.
+ *
+ * If the field does not exist or is not of the type requested, the value
+ * returned is undefined. To check if an error occured, use the
+ * bt_ctf_field_get_error() function after accessing a field.
+ *
+ * bt_ctf_get_enum_int gets the integer field of an enumeration.
+ * bt_ctf_get_enum_str gets the string matching the current enumeration
+ * value, or NULL if the current value does not match any string.
+ */
+uint64_t bt_ctf_get_uint64(const struct bt_definition *field);
+int64_t bt_ctf_get_int64(const struct bt_definition *field);
+const struct bt_definition *bt_ctf_get_enum_int(const struct bt_definition *field);
+const char *bt_ctf_get_enum_str(const struct bt_definition *field);
+char *bt_ctf_get_char_array(const struct bt_definition *field);
+char *bt_ctf_get_string(const struct bt_definition *field);
+double bt_ctf_get_float(const struct bt_definition *field);
+const struct bt_definition *bt_ctf_get_variant(const struct bt_definition *field);
+const struct bt_definition *bt_ctf_get_struct_field_index(
+               const struct bt_definition *field, uint64_t i);
+
+/*
+ * bt_ctf_field_get_error: returns the last error code encountered while
+ * accessing a field and reset the error flag.
+ * Return 0 if no error, a negative value otherwise.
+ */
+int bt_ctf_field_get_error(void);
+
+/*
+ * bt_ctf_get_event_decl_list: get a list of all the event declarations in
+ * a trace.
+ *
+ * The list array is pointed to the array of event declarations.
+ * The number of events in the array is written in count.
+ *
+ * Return 0 on success and a negative value on error.
+ *
+ * The content pointed to by "list" should *not* be freed. It stays
+ * valid as long as the trace is opened.
+ */
+int bt_ctf_get_event_decl_list(int handle_id, struct bt_context *ctx,
+               struct bt_ctf_event_decl * const **list,
+               unsigned int *count);
+
+/*
+ * bt_ctf_get_decl_event_name: return the name of the event or NULL on error
+ */
+const char *bt_ctf_get_decl_event_name(const struct bt_ctf_event_decl *event);
+
+/*
+ * bt_ctf_get_decl_event_id: return the event-ID of the event or -1ULL on error
+ */
+uint64_t bt_ctf_get_decl_event_id(const struct bt_ctf_event_decl *event);
+
+/*
+ * bt_ctf_get_decl_fields: get all field declarations in a scope of an event
+ *
+ * The list array is pointed to the array of field declaration.
+ * The number of field declaration in the array is written in count.
+ *
+ * Returns 0 on success and a negative value on error
+ *
+ * The content pointed to by "list" should *not* be freed. It stays
+ * valid as long as the trace is opened.
+ */
+int bt_ctf_get_decl_fields(struct bt_ctf_event_decl *event_decl,
+               enum ctf_scope scope,
+               struct bt_ctf_field_decl const * const **list,
+               unsigned int *count);
+
+/*
+ * bt_ctf_get_decl_field_name: return the name of a field decl or NULL on error
+ */
+const char *bt_ctf_get_decl_field_name(const struct bt_ctf_field_decl *field);
+
 #endif /*_BABELTRACE_CTF_EVENTS_INTERNAL_H */
index eb238f40401f7ba9800fe1bdf506656e8e2c793a..15ebe56f1b9aff71fa64e78495e770fd3d1dc890 100644 (file)
 #include <stdint.h>
 #include <babeltrace/context.h>
 #include <babeltrace/clock-types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_definition;
-struct bt_declaration;
-struct bt_ctf_event;
-struct bt_ctf_event_decl;
-struct bt_ctf_field_decl;
-
-/*
- * the top-level scopes in CTF
- */
-enum ctf_scope {
-       BT_TRACE_PACKET_HEADER          = 0,
-       BT_STREAM_PACKET_CONTEXT        = 1,
-       BT_STREAM_EVENT_HEADER          = 2,
-       BT_STREAM_EVENT_CONTEXT         = 3,
-       BT_EVENT_CONTEXT                = 4,
-       BT_EVENT_FIELDS                 = 5,
-};
-
-/*
- * the supported CTF types
- */
-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,
-       NR_CTF_TYPES,
-};
-
-/*
- * the supported CTF string encodings
- */
-enum ctf_string_encoding {
-       CTF_STRING_NONE = 0,
-       CTF_STRING_UTF8,
-       CTF_STRING_ASCII,
-       CTF_STRING_UNKNOWN,
-};
-
-/*
- * bt_ctf_get_top_level_scope: return a definition of the top-level scope
- *
- * Top-level scopes are defined in the ctf_scope enum.
- * In order to get a field or a field list, the user needs to pass a
- * scope as argument, this scope can be a top-level scope or a scope
- * relative to an arbitrary field. This function provides the mapping
- * between the enum and the actual definition of top-level scopes.
- * On error return NULL.
- */
-const struct bt_definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *event,
-               enum ctf_scope scope);
-
-/*
- * bt_ctf_event_get_name: returns the name of the event or NULL on error
- */
-const char *bt_ctf_event_name(const struct bt_ctf_event *event);
-
-/*
- * bt_ctf_get_cycles: returns the timestamp of the event as written
- * in the packet (in cycles) or -1ULL on error.
- */
-uint64_t bt_ctf_get_cycles(const struct bt_ctf_event *event);
-
-/*
- * bt_ctf_get_timestamp: get the timestamp of the event offsetted
- * with the system clock source (in ns) in *timestamp.
- *
- * Return 0 on success, or -1ULL on error.
- */
-int bt_ctf_get_timestamp(const struct bt_ctf_event *event, int64_t *timestamp);
+#include <babeltrace/ctf-ir/event-types.h>
 
 /*
- * bt_ctf_get_field_list: obtain the list of fields for compound type
- *
- * This function can be used to obtain the list of fields contained
- * within a top-level scope of an event or a compound type: array,
- * sequence, structure, or variant.
-
- * This function sets the "list" pointer to an array of definition
- * pointers and set count to the number of elements in the array.
- * Return 0 on success and a negative value on error.
- *
- * The content pointed to by "list" should *not* be freed. It stays
- * valid as long as the event is unchanged (as long as the iterator
- * from which the event is extracted is unchanged).
- */
-int bt_ctf_get_field_list(const struct bt_ctf_event *event,
-               const struct bt_definition *scope,
-               struct bt_definition const * const **list,
-               unsigned int *count);
-
-/*
- * bt_ctf_get_field: returns the definition of a specific field
- */
-const struct bt_definition *bt_ctf_get_field(const struct bt_ctf_event *event,
-               const struct bt_definition *scope,
-               const char *field);
-
-/*
- * bt_ctf_get_index: if the field is an array or a sequence, return the element
- * at position index, otherwise return NULL;
- */
-const struct bt_definition *bt_ctf_get_index(const struct bt_ctf_event *event,
-               const struct bt_definition *field,
-               unsigned int index);
-
-/*
- * bt_ctf_field_name: returns the name of a field or NULL on error
- */
-const char *bt_ctf_field_name(const struct bt_definition *def);
-
-/*
- * bt_ctf_get_decl_from_def: return the declaration of a field from
- * its definition or NULL on error
- */
-const struct bt_declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def);
-
-/*
- * bt_ctf_get_decl_from_field_decl: return the declaration of a field from
- * a field_decl or NULL on error
- */
-const struct bt_declaration *bt_ctf_get_decl_from_field_decl(
-               const struct bt_ctf_field_decl *field);
-
-/*
- * bt_ctf_field_type: returns the type of a field or -1 if unknown
- */
-enum ctf_type_id bt_ctf_field_type(const struct bt_declaration *decl);
-
-/*
- * bt_ctf_get_int_signedness: return the signedness of an integer
- *
- * return 0 if unsigned
- * return 1 if signed
- * return -1 on error
+ * This header must exist in Babeltrace 2 because it contained
+ * enumerations that were used in CTF writer's API. Those enumerations
+ * are now located in ctf-ir/event-types.h.
  */
-int bt_ctf_get_int_signedness(const struct bt_declaration *decl);
-
-/*
- * bt_ctf_get_int_base: return the base of an int or a negative value on error
- */
-int bt_ctf_get_int_base(const struct bt_declaration *decl);
-
-/*
- * bt_ctf_get_int_byte_order: return the byte order of an int or a negative
- * value on error
- */
-int bt_ctf_get_int_byte_order(const struct bt_declaration *decl);
-
-/*
- * bt_ctf_get_int_len: return the size, in bits, of an int or a negative
- * value on error
- */
-ssize_t bt_ctf_get_int_len(const struct bt_declaration *decl);
-
-/*
- * bt_ctf_get_encoding: return the encoding of an int, a string, or of
- * the integer contained in a char array or a sequence.
- * return a negative value on error
- */
-enum ctf_string_encoding bt_ctf_get_encoding(const struct bt_declaration *decl);
-
-/*
- * bt_ctf_get_array_len: return the len of an array or a negative
- * value on error
- */
-int bt_ctf_get_array_len(const struct bt_declaration *decl);
-
-/*
- * bt_ctf_get_struct_field_count: return the number of fields in a structure.
- * Returns a negative value on error.
- */
-uint64_t bt_ctf_get_struct_field_count(const struct bt_definition *field);
-
-/*
- * Field access functions
- *
- * These functions return the value associated with the field passed in
- * parameter.
- *
- * If the field does not exist or is not of the type requested, the value
- * returned is undefined. To check if an error occured, use the
- * bt_ctf_field_get_error() function after accessing a field.
- *
- * bt_ctf_get_enum_int gets the integer field of an enumeration.
- * bt_ctf_get_enum_str gets the string matching the current enumeration
- * value, or NULL if the current value does not match any string.
- */
-uint64_t bt_ctf_get_uint64(const struct bt_definition *field);
-int64_t bt_ctf_get_int64(const struct bt_definition *field);
-const struct bt_definition *bt_ctf_get_enum_int(const struct bt_definition *field);
-const char *bt_ctf_get_enum_str(const struct bt_definition *field);
-char *bt_ctf_get_char_array(const struct bt_definition *field);
-char *bt_ctf_get_string(const struct bt_definition *field);
-double bt_ctf_get_float(const struct bt_definition *field);
-const struct bt_definition *bt_ctf_get_variant(const struct bt_definition *field);
-const struct bt_definition *bt_ctf_get_struct_field_index(
-               const struct bt_definition *field, uint64_t i);
-
-/*
- * bt_ctf_field_get_error: returns the last error code encountered while
- * accessing a field and reset the error flag.
- * Return 0 if no error, a negative value otherwise.
- */
-int bt_ctf_field_get_error(void);
-
-/*
- * bt_ctf_get_event_decl_list: get a list of all the event declarations in
- * a trace.
- *
- * The list array is pointed to the array of event declarations.
- * The number of events in the array is written in count.
- *
- * Return 0 on success and a negative value on error.
- *
- * The content pointed to by "list" should *not* be freed. It stays
- * valid as long as the trace is opened.
- */
-int bt_ctf_get_event_decl_list(int handle_id, struct bt_context *ctx,
-               struct bt_ctf_event_decl * const **list,
-               unsigned int *count);
-
-/*
- * bt_ctf_get_decl_event_name: return the name of the event or NULL on error
- */
-const char *bt_ctf_get_decl_event_name(const struct bt_ctf_event_decl *event);
-
-/*
- * bt_ctf_get_decl_event_id: return the event-ID of the event or -1ULL on error
- */
-uint64_t bt_ctf_get_decl_event_id(const struct bt_ctf_event_decl *event);
-
-/*
- * bt_ctf_get_decl_fields: get all field declarations in a scope of an event
- *
- * The list array is pointed to the array of field declaration.
- * The number of field declaration in the array is written in count.
- *
- * Returns 0 on success and a negative value on error
- *
- * The content pointed to by "list" should *not* be freed. It stays
- * valid as long as the trace is opened.
- */
-int bt_ctf_get_decl_fields(struct bt_ctf_event_decl *event_decl,
-               enum ctf_scope scope,
-               struct bt_ctf_field_decl const * const **list,
-               unsigned int *count);
-
-/*
- * bt_ctf_get_decl_field_name: return the name of a field decl or NULL on error
- */
-const char *bt_ctf_get_decl_field_name(const struct bt_ctf_field_decl *field);
-
-#ifdef __cplusplus
-}
-#endif
 
 #endif /* _BABELTRACE_CTF_EVENTS_H */
index b2bcf0e8b46b1b48f2d867a5d3c90973be207102..ab78fa29dc0dc782775a5ec25db36e66dede911e 100644 (file)
@@ -79,7 +79,7 @@ struct definition_scope {
 };
 
 struct bt_declaration {
-       enum ctf_type_id id;
+       enum bt_ctf_type_id id;
        size_t alignment;       /* type alignment, in bits */
        int ref;                /* number of references to the type */
        /*
@@ -125,7 +125,7 @@ struct bt_stream_pos {
 static inline
 int generic_rw(struct bt_stream_pos *pos, struct bt_definition *definition)
 {
-       enum ctf_type_id dispatch_id = definition->declaration->id;
+       enum bt_ctf_type_id dispatch_id = definition->declaration->id;
        rw_dispatch call;
 
        assert(pos->rw_table[dispatch_id] != NULL);
index 86940d2d849be25a7e31e6bf728b1fb2c8f32231..576c4cf023320dafd08a1fcd383ffad6b3e8dbd3 100644 (file)
@@ -1948,10 +1948,10 @@ void type_field_tests()
                "bt_ctf_field_type_get_byte_order handles NULL correctly");
 
        ok(bt_ctf_field_type_get_type_id(NULL) ==
-               CTF_TYPE_UNKNOWN,
+               BT_CTF_TYPE_ID_UNKNOWN,
                "bt_ctf_field_type_get_type_id handles NULL correctly");
        ok(bt_ctf_field_type_get_type_id(uint_12_type) ==
-               CTF_TYPE_INTEGER,
+               BT_CTF_TYPE_ID_INTEGER,
                "bt_ctf_field_type_get_type_id returns a correct value with an integer type");
 
        ok(bt_ctf_field_type_integer_get_base(NULL) ==
@@ -1986,7 +1986,7 @@ void type_field_tests()
                bt_ctf_field_type_sequence_create(int_16_type, "seq_len");
        ok(sequence_type, "Create a sequence of int16_t type");
        ok(bt_ctf_field_type_get_type_id(sequence_type) ==
-               CTF_TYPE_SEQUENCE,
+               BT_CTF_TYPE_ID_SEQUENCE,
                "bt_ctf_field_type_get_type_id returns a correct value with a sequence type");
 
        ok(bt_ctf_field_type_sequence_get_length_field_name(NULL) == NULL,
@@ -2024,7 +2024,7 @@ void type_field_tests()
 
        structure_seq_type = bt_ctf_field_type_structure_create();
        ok(bt_ctf_field_type_get_type_id(structure_seq_type) ==
-               CTF_TYPE_STRUCT,
+               BT_CTF_TYPE_ID_STRUCT,
                "bt_ctf_field_type_get_type_id returns a correct value with a structure type");
        ok(structure_seq_type, "Create a structure type");
        ok(bt_ctf_field_type_structure_add_field(structure_seq_type,
@@ -3135,7 +3135,7 @@ int main(int argc, char **argv)
                stream_class);
        ok(ret_field_type,
                "bt_ctf_stream_class_get_event_header_type returns an event header type");
-       ok(bt_ctf_field_type_get_type_id(ret_field_type) == CTF_TYPE_STRUCT,
+       ok(bt_ctf_field_type_get_type_id(ret_field_type) == BT_CTF_TYPE_ID_STRUCT,
                "Default event header type is a structure");
        event_header_field_type =
                bt_ctf_field_type_structure_get_field_type_by_name(
@@ -3143,7 +3143,7 @@ int main(int argc, char **argv)
        ok(event_header_field_type,
                "Default event header type contains an \"id\" field");
        ok(bt_ctf_field_type_get_type_id(
-               event_header_field_type) == CTF_TYPE_INTEGER,
+               event_header_field_type) == BT_CTF_TYPE_ID_INTEGER,
                "Default event header \"id\" field is an integer");
        bt_put(event_header_field_type);
        event_header_field_type =
@@ -3152,7 +3152,7 @@ int main(int argc, char **argv)
        ok(event_header_field_type,
                "Default event header type contains a \"timestamp\" field");
        ok(bt_ctf_field_type_get_type_id(
-               event_header_field_type) == CTF_TYPE_INTEGER,
+               event_header_field_type) == BT_CTF_TYPE_ID_INTEGER,
                "Default event header \"timestamp\" field is an integer");
        bt_put(event_header_field_type);
        bt_put(ret_field_type);
@@ -3163,7 +3163,7 @@ int main(int argc, char **argv)
        packet_header_type = bt_ctf_trace_get_packet_header_type(trace);
        ok(packet_header_type,
                "bt_ctf_trace_get_packet_header_type returns a packet header");
-       ok(bt_ctf_field_type_get_type_id(packet_header_type) == CTF_TYPE_STRUCT,
+       ok(bt_ctf_field_type_get_type_id(packet_header_type) == BT_CTF_TYPE_ID_STRUCT,
                "bt_ctf_trace_get_packet_header_type returns a packet header of type struct");
        ret_field_type = bt_ctf_field_type_structure_get_field_type_by_name(
                packet_header_type, "magic");
@@ -3197,7 +3197,7 @@ int main(int argc, char **argv)
        packet_context_type = bt_ctf_stream_class_get_packet_context_type(stream_class);
        ok(packet_context_type,
                "bt_ctf_stream_class_get_packet_context_type returns a packet context type.");
-       ok(bt_ctf_field_type_get_type_id(packet_context_type) == CTF_TYPE_STRUCT,
+       ok(bt_ctf_field_type_get_type_id(packet_context_type) == BT_CTF_TYPE_ID_STRUCT,
                "Packet context is a structure");
 
        ok(bt_ctf_stream_class_set_packet_context_type(NULL, packet_context_type),
index 444f1ab7664420520592a6b6d1c7949e22b3e7fb..7243c7f19344f4fff14ac6408692bc89765cc18b 100644 (file)
@@ -22,7 +22,7 @@
 #include <babeltrace/context.h>
 #include <babeltrace/iterator.h>
 #include <babeltrace/ctf/iterator.h>
-#include <babeltrace/ctf/events.h>
+#include <babeltrace/ctf/events-internal.h>
 #include <babeltrace/babeltrace-internal.h>    /* For symbol side-effects */
 
 #include <stdio.h>
index e4b43d8b5fe692f44eee37b11c7947229ca6356a..d514a60a7fddf844856ea082ec2d0f68a39ceac9 100644 (file)
@@ -83,7 +83,7 @@ struct declaration_array *
        bt_declaration_ref(elem_declaration);
        array_declaration->elem = elem_declaration;
        array_declaration->scope = bt_new_declaration_scope(parent_scope);
-       declaration->id = CTF_TYPE_ARRAY;
+       declaration->id = BT_CTF_TYPE_ID_ARRAY;
        declaration->alignment = elem_declaration->alignment;
        declaration->declaration_free = _array_declaration_free;
        declaration->definition_new = _array_definition_new;
@@ -123,7 +123,7 @@ struct bt_definition *
        array->string = NULL;
        array->elems = NULL;
 
-       if (array_declaration->elem->id == CTF_TYPE_INTEGER) {
+       if (array_declaration->elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(array_declaration->elem, struct declaration_integer, p);
 
@@ -229,7 +229,7 @@ GString *bt_get_char_array(const struct bt_definition *field)
        array_definition = container_of(field, struct definition_array, p);
        array_declaration = array_definition->declaration;
        elem = array_declaration->elem;
-       if (elem->id == CTF_TYPE_INTEGER) {
+       if (elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(elem, struct declaration_integer, p);
 
index 6c61ef7a0c55b70761cbf98f1830eb3553d0ae3a..825e4dc4b9c5e092ae64400302d3cfcd1a0185d2 100644 (file)
@@ -116,7 +116,7 @@ struct declaration_sequence *
        bt_declaration_ref(elem_declaration);
        sequence_declaration->elem = elem_declaration;
        sequence_declaration->scope = bt_new_declaration_scope(parent_scope);
-       declaration->id = CTF_TYPE_SEQUENCE;
+       declaration->id = BT_CTF_TYPE_ID_SEQUENCE;
        declaration->alignment = elem_declaration->alignment;
        declaration->declaration_free = _sequence_declaration_free;
        declaration->definition_new = _sequence_definition_new;
@@ -171,7 +171,7 @@ struct bt_definition *_sequence_definition_new(struct bt_declaration *declaratio
        sequence->string = NULL;
        sequence->elems = NULL;
 
-       if (sequence_declaration->elem->id == CTF_TYPE_INTEGER) {
+       if (sequence_declaration->elem->id == BT_CTF_TYPE_ID_INTEGER) {
                struct declaration_integer *integer_declaration =
                        container_of(sequence_declaration->elem, struct declaration_integer, p);
 
index ade23e5ef0440555703d81ec44e4afee44eb2598..41c6b8ed76258992a22f580acf2c5810d0cad4e6 100644 (file)
@@ -634,7 +634,7 @@ struct definition_integer *bt_lookup_integer(const struct bt_definition *definit
        lookup = bt_lookup_definition(definition, field_name);
        if (!lookup)
                return NULL;
-       if (lookup->declaration->id != CTF_TYPE_INTEGER)
+       if (lookup->declaration->id != BT_CTF_TYPE_ID_INTEGER)
                return NULL;
        lookup_integer = container_of(lookup, struct definition_integer, p);
        if (lookup_integer->declaration->signedness != signedness)
@@ -652,7 +652,7 @@ struct definition_enum *bt_lookup_enum(const struct bt_definition *definition,
        lookup = bt_lookup_definition(definition, field_name);
        if (!lookup)
                return NULL;
-       if (lookup->declaration->id != CTF_TYPE_ENUM)
+       if (lookup->declaration->id != BT_CTF_TYPE_ID_ENUM)
                return NULL;
        lookup_enum = container_of(lookup, struct definition_enum, p);
        if (lookup_enum->integer->declaration->signedness != signedness)
@@ -669,7 +669,7 @@ struct bt_definition *bt_lookup_variant(const struct bt_definition *definition,
        lookup = bt_lookup_definition(definition, field_name);
        if (!lookup)
                return NULL;
-       if (lookup->declaration->id != CTF_TYPE_VARIANT)
+       if (lookup->declaration->id != BT_CTF_TYPE_ID_VARIANT)
                return NULL;
        bt_lookup_variant = container_of(lookup, struct definition_variant, p);
        lookup = bt_variant_get_current_field(bt_lookup_variant);
This page took 0.076677 seconds and 4 git commands to generate.