Rename: "field class ID" -> "field class type"
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 15 Nov 2018 19:28:32 +0000 (14:28 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
We use "type" everywhere else to hold a numeric type identifier. The
only reason we used "ID" for field classes was because they were named
"field types" before.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
27 files changed:
include/babeltrace/common-internal.h
include/babeltrace/trace-ir/field-classes-internal.h
include/babeltrace/trace-ir/field-classes.h
include/babeltrace/trace-ir/fields-internal.h
include/babeltrace/trace-ir/fields.h
lib/lib-logging.c
lib/trace-ir/event-class.c
lib/trace-ir/field-classes.c
lib/trace-ir/fields.c
lib/trace-ir/resolve-field-path.c
lib/trace-ir/stream-class.c
lib/trace-ir/trace.c
plugins/ctf/common/bfcr/bfcr.c
plugins/ctf/common/metadata/ctf-meta-resolve.c
plugins/ctf/common/metadata/ctf-meta-translate.c
plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.c
plugins/ctf/common/metadata/ctf-meta-update-in-ir.c
plugins/ctf/common/metadata/ctf-meta-update-meanings.c
plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.c
plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.c
plugins/ctf/common/metadata/ctf-meta-validate.c
plugins/ctf/common/metadata/ctf-meta.h
plugins/ctf/common/metadata/visitor-generate-ir.c
plugins/ctf/common/notif-iter/notif-iter.c
plugins/lttng-utils/copy.c
plugins/text/pretty/print.c
plugins/utils/trimmer/copy.c

index da688fc89458b0e86b9857b6bae699dc5bf9688b..4e4baef1b2e435bc6ceb61c1d90adbe8c338b523 100644 (file)
@@ -281,29 +281,29 @@ BT_HIDDEN
 size_t bt_common_get_page_size(void);
 
 static inline
-const char *bt_common_field_class_id_string(enum bt_field_class_id class_id)
+const char *bt_common_field_class_type_string(enum bt_field_class_type class_type)
 {
-       switch (class_id) {
-       case BT_FIELD_CLASS_ID_UNSIGNED_INTEGER:
-               return "BT_FIELD_CLASS_ID_UNSIGNED_INTEGER";
-       case BT_FIELD_CLASS_ID_SIGNED_INTEGER:
-               return "BT_FIELD_CLASS_ID_SIGNED_INTEGER";
-       case BT_FIELD_CLASS_ID_REAL:
-               return "BT_FIELD_CLASS_ID_REAL";
-       case BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION:
-               return "BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION";
-       case BT_FIELD_CLASS_ID_SIGNED_ENUMERATION:
-               return "BT_FIELD_CLASS_ID_SIGNED_ENUMERATION";
-       case BT_FIELD_CLASS_ID_STRING:
-               return "BT_FIELD_CLASS_ID_STRING";
-       case BT_FIELD_CLASS_ID_STRUCTURE:
-               return "BT_FIELD_CLASS_ID_STRUCTURE";
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
-               return "BT_FIELD_CLASS_ID_STATIC_ARRAY";
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
-               return "BT_FIELD_CLASS_ID_DYNAMIC_ARRAY";
-       case BT_FIELD_CLASS_ID_VARIANT:
-               return "BT_FIELD_CLASS_ID_VARIANT";
+       switch (class_type) {
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
+               return "BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER";
+       case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
+               return "BT_FIELD_CLASS_TYPE_SIGNED_INTEGER";
+       case BT_FIELD_CLASS_TYPE_REAL:
+               return "BT_FIELD_CLASS_TYPE_REAL";
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
+               return "BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION";
+       case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION:
+               return "BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION";
+       case BT_FIELD_CLASS_TYPE_STRING:
+               return "BT_FIELD_CLASS_TYPE_STRING";
+       case BT_FIELD_CLASS_TYPE_STRUCTURE:
+               return "BT_FIELD_CLASS_TYPE_STRUCTURE";
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
+               return "BT_FIELD_CLASS_TYPE_STATIC_ARRAY";
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
+               return "BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY";
+       case BT_FIELD_CLASS_TYPE_VARIANT:
+               return "BT_FIELD_CLASS_TYPE_VARIANT";
        default:
                return "(unknown)";
        }
index bdc146c799831a10f503599c280ba99253c9b40a..20bf544ef9347cce6da790d646b5786a8115d8bc 100644 (file)
 
 #define BT_ASSERT_PRE_FC_IS_INT(_fc, _name)                            \
        BT_ASSERT_PRE(                                                  \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_UNSIGNED_INTEGER || \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_SIGNED_INTEGER || \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION || \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_SIGNED_ENUMERATION, \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION || \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, \
                _name " is not an integer field class: %![fc-]+F", (_fc))
 
 #define BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(_fc, _name)                   \
        BT_ASSERT_PRE(                                                  \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_UNSIGNED_INTEGER || \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION, \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, \
                _name " is not an unsigned integer field class: %![fc-]+F", (_fc))
 
 #define BT_ASSERT_PRE_FC_IS_ENUM(_fc, _name)                           \
        BT_ASSERT_PRE(                                                  \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION || \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_SIGNED_ENUMERATION, \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION || \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, \
                _name " is not an enumeration field class: %![fc-]+F", (_fc))
 
 #define BT_ASSERT_PRE_FC_IS_ARRAY(_fc, _name)                          \
        BT_ASSERT_PRE(                                                  \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_STATIC_ARRAY || \
-               ((struct bt_field_class *) (_fc))->id == BT_FIELD_CLASS_ID_DYNAMIC_ARRAY, \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
+               ((struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, \
                _name " is not an array field class: %![fc-]+F", (_fc))
 
-#define BT_ASSERT_PRE_FC_HAS_ID(_fc, _id, _name)                       \
-       BT_ASSERT_PRE(((struct bt_field_class *) (_fc))->id == (_id),   \
-               _name " has the wrong ID: expected-id=%s, "             \
-               "%![fc-]+F", bt_common_field_class_id_string(_id), (_fc))
+#define BT_ASSERT_PRE_FC_HAS_ID(_fc, _type, _name)                     \
+       BT_ASSERT_PRE(((struct bt_field_class *) (_fc))->type == (_type),       \
+               _name " has the wrong type: expected-type=%s, "         \
+               "%![fc-]+F", bt_common_field_class_type_string(_type), (_fc))
 
 #define BT_ASSERT_PRE_FC_HOT(_fc, _name)                               \
        BT_ASSERT_PRE_HOT((struct bt_field_class *) (_fc),              \
@@ -88,7 +88,7 @@ struct bt_field_class;
 
 struct bt_field_class {
        struct bt_object base;
-       enum bt_field_class_id id;
+       enum bt_field_class_type type;
        bool frozen;
 
        /*
@@ -222,10 +222,10 @@ struct bt_field_class_variant {
 };
 
 static inline
-bool bt_field_class_has_known_id(struct bt_field_class *fc)
+bool bt_field_class_has_known_type(struct bt_field_class *fc)
 {
-       return fc->id >= BT_FIELD_CLASS_ID_UNSIGNED_INTEGER &&
-               fc->id <= BT_FIELD_CLASS_ID_VARIANT;
+       return fc->type >= BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER &&
+               fc->type <= BT_FIELD_CLASS_TYPE_VARIANT;
 }
 
 BT_HIDDEN
index 004efbfcd92ce657367e34e501e799cbf8745fcc..0c93847aacbdb9358e63c82373ae3b8cc9163334 100644 (file)
@@ -50,17 +50,17 @@ struct bt_field_class_unsigned_enumeration_mapping_ranges;
 
 typedef const char * const *bt_field_class_enumeration_mapping_label_array;
 
-enum bt_field_class_id {
-       BT_FIELD_CLASS_ID_UNSIGNED_INTEGER,
-       BT_FIELD_CLASS_ID_SIGNED_INTEGER,
-       BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION,
-       BT_FIELD_CLASS_ID_SIGNED_ENUMERATION,
-       BT_FIELD_CLASS_ID_REAL,
-       BT_FIELD_CLASS_ID_STRING,
-       BT_FIELD_CLASS_ID_STRUCTURE,
-       BT_FIELD_CLASS_ID_STATIC_ARRAY,
-       BT_FIELD_CLASS_ID_DYNAMIC_ARRAY,
-       BT_FIELD_CLASS_ID_VARIANT,
+enum bt_field_class_type {
+       BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER,
+       BT_FIELD_CLASS_TYPE_SIGNED_INTEGER,
+       BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
+       BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
+       BT_FIELD_CLASS_TYPE_REAL,
+       BT_FIELD_CLASS_TYPE_STRING,
+       BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
+       BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
+       BT_FIELD_CLASS_TYPE_VARIANT,
 };
 
 enum bt_field_class_integer_preferred_display_base {
@@ -70,7 +70,7 @@ enum bt_field_class_integer_preferred_display_base {
        BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL,
 };
 
-extern enum bt_field_class_id bt_field_class_get_id(
+extern enum bt_field_class_type bt_field_class_get_type(
                struct bt_field_class *field_class);
 
 extern struct bt_field_class *bt_field_class_unsigned_integer_create(void);
index 816d56dc32ca0cadbd565cf624d52b304e590e54..c3ee0ad893fe1d8da3e47535112aa3343c14dbc2 100644 (file)
 #include <stdbool.h>
 #include <glib.h>
 
-#define BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(_field, _cls_id, _name)       \
-       BT_ASSERT_PRE(((struct bt_field *) (_field))->class->id == (_cls_id), \
-               _name " has the wrong class ID: expected-class-id=%s, " \
+#define BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(_field, _cls_type, _name)   \
+       BT_ASSERT_PRE(((struct bt_field *) (_field))->class->type == (_cls_type), \
+               _name " has the wrong class type: expected-class-type=%s, " \
                "%![field-]+f",                                         \
-               bt_common_field_class_id_string(_cls_id), (_field))
+               bt_common_field_class_type_string(_cls_type), (_field))
 
 #define BT_ASSERT_PRE_FIELD_IS_UNSIGNED_INT(_field, _name)             \
        BT_ASSERT_PRE(                                                  \
-               ((struct bt_field *) (_field))->class->id == BT_FIELD_CLASS_ID_UNSIGNED_INTEGER || \
-               ((struct bt_field *) (_field))->class->id == BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION, \
+               ((struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
+               ((struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, \
                _name " is not an unsigned integer field: %![field-]+f", \
                (_field))
 
 #define BT_ASSERT_PRE_FIELD_IS_SIGNED_INT(_field, _name)               \
        BT_ASSERT_PRE(                                                  \
-               ((struct bt_field *) (_field))->class->id == BT_FIELD_CLASS_ID_SIGNED_INTEGER || \
-               ((struct bt_field *) (_field))->class->id == BT_FIELD_CLASS_ID_SIGNED_ENUMERATION, \
+               ((struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || \
+               ((struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, \
                _name " is not a signed integer field: %![field-]+f", \
                (_field))
 
 #define BT_ASSERT_PRE_FIELD_IS_ARRAY(_field, _name)                    \
        BT_ASSERT_PRE(                                                  \
-               ((struct bt_field *) (_field))->class->id == BT_FIELD_CLASS_ID_STATIC_ARRAY || \
-               ((struct bt_field *) (_field))->class->id == BT_FIELD_CLASS_ID_DYNAMIC_ARRAY, \
+               ((struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
+               ((struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, \
                _name " is not an array field: %![field-]+f", (_field))
 
 #define BT_ASSERT_PRE_FIELD_IS_SET(_field, _name)                      \
@@ -189,7 +189,7 @@ bt_bool _bt_field_is_set(struct bt_field *field)
                goto end;
        }
 
-       BT_ASSERT(bt_field_class_has_known_id(field->class));
+       BT_ASSERT(bt_field_class_has_known_type(field->class));
        BT_ASSERT(field->methods->is_set);
        is_set = field->methods->is_set(field);
 
index 4b29d01789b4b0fb979408b078ee1f943bb57cbb..754d95d26af5257a4f3b07de2f902bce4bff4cb7 100644 (file)
@@ -35,7 +35,7 @@
 /* For bt_bool */
 #include <babeltrace/types.h>
 
-/* For enum bt_field_class_id */
+/* For enum bt_field_class_type */
 #include <babeltrace/trace-ir/field-classes.h>
 
 #ifdef __cplusplus
@@ -48,7 +48,7 @@ struct bt_field_class_enumeration_mapping_iterator;
 
 extern struct bt_field_class *bt_field_borrow_class(struct bt_field *field);
 
-extern enum bt_field_class_id bt_field_get_class_id(struct bt_field *field);
+extern enum bt_field_class_type bt_field_get_class_type(struct bt_field *field);
 
 extern int64_t bt_field_signed_integer_get_value(struct bt_field *field);
 
index 9629dd3b229e9ea27b7a04789e04a13b86f792f9..f8ec223208aca2927ba4e79f81cbf4cc16bcd0db 100644 (file)
@@ -164,9 +164,9 @@ static inline void format_array_field_class(char **buf_ch,
 {
        struct bt_field_class_array *array_fc = (void *) field_class;
 
-       BUF_APPEND(", %selement-fc-addr=%p, %selement-fc-id=%s",
+       BUF_APPEND(", %selement-fc-addr=%p, %selement-fc-type=%s",
                PRFIELD(array_fc->element_fc),
-               PRFIELD(bt_common_field_class_id_string(array_fc->element_fc->id)));
+               PRFIELD(bt_common_field_class_type_string(array_fc->element_fc->type)));
 }
 
 static inline void format_field_class(char **buf_ch, bool extended,
@@ -174,8 +174,8 @@ static inline void format_field_class(char **buf_ch, bool extended,
 {
        char tmp_prefix[64];
 
-       BUF_APPEND(", %sid=%s",
-               PRFIELD(bt_common_field_class_id_string(field_class->id)));
+       BUF_APPEND(", %stype=%s",
+               PRFIELD(bt_common_field_class_type_string(field_class->type)));
 
        if (extended) {
                BUF_APPEND(", %sis-frozen=%d", PRFIELD(field_class->frozen));
@@ -185,14 +185,14 @@ static inline void format_field_class(char **buf_ch, bool extended,
                return;
        }
 
-       switch (field_class->id) {
-       case BT_FIELD_CLASS_ID_UNSIGNED_INTEGER:
-       case BT_FIELD_CLASS_ID_SIGNED_INTEGER:
+       switch (field_class->type) {
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
+       case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
        {
                format_integer_field_class(buf_ch, extended, prefix, field_class);
                break;
        }
-       case BT_FIELD_CLASS_ID_REAL:
+       case BT_FIELD_CLASS_TYPE_REAL:
        {
                struct bt_field_class_real *real_fc = (void *) field_class;
 
@@ -200,8 +200,8 @@ static inline void format_field_class(char **buf_ch, bool extended,
                        PRFIELD(real_fc->is_single_precision));
                break;
        }
-       case BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION:
-       case BT_FIELD_CLASS_ID_SIGNED_ENUMERATION:
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
+       case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION:
        {
                struct bt_field_class_enumeration *enum_fc =
                        (void *) field_class;
@@ -211,7 +211,7 @@ static inline void format_field_class(char **buf_ch, bool extended,
                        PRFIELD(enum_fc->mappings->len));
                break;
        }
-       case BT_FIELD_CLASS_ID_STRUCTURE:
+       case BT_FIELD_CLASS_TYPE_STRUCTURE:
        {
                struct bt_field_class_structure *struct_fc =
                        (void *) field_class;
@@ -223,7 +223,7 @@ static inline void format_field_class(char **buf_ch, bool extended,
 
                break;
        }
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
        {
                struct bt_field_class_static_array *array_fc =
                        (void *) field_class;
@@ -232,7 +232,7 @@ static inline void format_field_class(char **buf_ch, bool extended,
                BUF_APPEND(", %slength=%" PRIu64, PRFIELD(array_fc->length));
                break;
        }
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
        {
                struct bt_field_class_dynamic_array *array_fc =
                        (void *) field_class;
@@ -253,7 +253,7 @@ static inline void format_field_class(char **buf_ch, bool extended,
 
                break;
        }
-       case BT_FIELD_CLASS_ID_VARIANT:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
        {
                struct bt_field_class_variant *var_fc = (void *) field_class;
 
@@ -296,8 +296,8 @@ static inline void format_field_integer_extended(char **buf_ch,
                fmt = ", %svalue=%" PRIx64;
        }
 
-       if (field_class->common.id == BT_FIELD_CLASS_ID_SIGNED_INTEGER ||
-                       field_class->common.id == BT_FIELD_CLASS_ID_SIGNED_ENUMERATION) {
+       if (field_class->common.type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
+                       field_class->common.type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION) {
                if (!fmt) {
                        fmt = ", %svalue=%" PRId64;
                }
@@ -321,36 +321,36 @@ static inline void format_field(char **buf_ch, bool extended,
                BUF_APPEND(", %sis-frozen=%d", PRFIELD(field->frozen));
        }
 
-       BUF_APPEND(", %stype-addr=%p", PRFIELD(field->class));
+       BUF_APPEND(", %sclass-addr=%p", PRFIELD(field->class));
 
        if (!field->class) {
                return;
        }
 
-       BUF_APPEND(", %stype-id=%s",
-               PRFIELD(bt_common_field_class_id_string(field->class->id)));
+       BUF_APPEND(", %sclass-type=%s",
+               PRFIELD(bt_common_field_class_type_string(field->class->type)));
 
        if (!extended || !field->is_set) {
                return;
        }
 
-       switch (field->class->id) {
-       case BT_FIELD_CLASS_ID_UNSIGNED_INTEGER:
-       case BT_FIELD_CLASS_ID_SIGNED_INTEGER:
-       case BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION:
-       case BT_FIELD_CLASS_ID_SIGNED_ENUMERATION:
+       switch (field->class->type) {
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
+       case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
+       case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION:
        {
                format_field_integer_extended(buf_ch, prefix, field);
                break;
        }
-       case BT_FIELD_CLASS_ID_REAL:
+       case BT_FIELD_CLASS_TYPE_REAL:
        {
                struct bt_field_real *real_field = (void *) field;
 
                BUF_APPEND(", %svalue=%f", PRFIELD(real_field->value));
                break;
        }
-       case BT_FIELD_CLASS_ID_STRING:
+       case BT_FIELD_CLASS_TYPE_STRING:
        {
                struct bt_field_string *str = (void *) field;
 
@@ -362,8 +362,8 @@ static inline void format_field(char **buf_ch, bool extended,
 
                break;
        }
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
        {
                struct bt_field_array *array_field = (void *) field;
 
@@ -376,7 +376,7 @@ static inline void format_field(char **buf_ch, bool extended,
 
                break;
        }
-       case BT_FIELD_CLASS_ID_VARIANT:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
        {
                struct bt_field_variant *var_field = (void *) field;
 
index e47c77f8548a485d60c3629b868d96ed5f6851e1..3df6320bf23746105f9719de4c82fc73aa8f1182 100644 (file)
@@ -284,8 +284,8 @@ int bt_event_class_set_specific_context_field_class(
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
        BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
-       BT_ASSERT_PRE(bt_field_class_get_id(field_class) ==
-               BT_FIELD_CLASS_ID_STRUCTURE,
+       BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
+               BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Specific context field classe is not a structure field classe: "
                "%!+F", field_class);
        stream_class = bt_event_class_borrow_stream_class_inline(
@@ -338,8 +338,8 @@ int bt_event_class_set_payload_field_class(struct bt_event_class *event_class,
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
        BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
-       BT_ASSERT_PRE(bt_field_class_get_id(field_class) ==
-               BT_FIELD_CLASS_ID_STRUCTURE,
+       BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
+               BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Payload field classe is not a structure field classe: %!+F",
                field_class);
        stream_class = bt_event_class_borrow_stream_class_inline(
index 72b7f457a547e2dcf7cb5b9aa4fee61c6d63bb96..bd43b6f2bc9be80703d07f2abfc2e17c30a36ce6 100644 (file)
 #include <inttypes.h>
 #include <stdlib.h>
 
-enum bt_field_class_id bt_field_class_get_id(struct bt_field_class *fc)
+enum bt_field_class_type bt_field_class_get_type(struct bt_field_class *fc)
 {
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       return fc->id;
+       return fc->type;
 }
 
 static
-void init_field_class(struct bt_field_class *fc, enum bt_field_class_id id,
+void init_field_class(struct bt_field_class *fc, enum bt_field_class_type type,
                bt_object_release_func release_func)
 {
        BT_ASSERT(fc);
-       BT_ASSERT(bt_field_class_has_known_id(fc));
+       BT_ASSERT(bt_field_class_has_known_type(fc));
        BT_ASSERT(release_func);
        bt_object_init_shared(&fc->base, release_func);
-       fc->id = id;
+       fc->type = type;
 }
 
 static
-void init_integer_field_class(struct bt_field_class_integer *fc, enum bt_field_class_id id,
+void init_integer_field_class(struct bt_field_class_integer *fc,
+               enum bt_field_class_type type,
                bt_object_release_func release_func)
 {
-       init_field_class((void *) fc, id, release_func);
+       init_field_class((void *) fc, type, release_func);
        fc->range = 64;
        fc->base = BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL;
 }
@@ -83,19 +84,19 @@ void destroy_integer_field_class(struct bt_object *obj)
 }
 
 static inline
-struct bt_field_class *create_integer_field_class(enum bt_field_class_id id)
+struct bt_field_class *create_integer_field_class(enum bt_field_class_type type)
 {
        struct bt_field_class_integer *int_fc = NULL;
 
-       BT_LOGD("Creating default integer field classe object: id=%s",
-               bt_common_field_class_id_string(id));
+       BT_LOGD("Creating default integer field classe object: type=%s",
+               bt_common_field_class_type_string(type));
        int_fc = g_new0(struct bt_field_class_integer, 1);
        if (!int_fc) {
                BT_LOGE_STR("Failed to allocate one integer field classe.");
                goto error;
        }
 
-       init_integer_field_class(int_fc, id, destroy_integer_field_class);
+       init_integer_field_class(int_fc, type, destroy_integer_field_class);
        BT_LIB_LOGD("Created integer field classe object: %!+F", int_fc);
        goto end;
 
@@ -108,12 +109,12 @@ end:
 
 struct bt_field_class *bt_field_class_unsigned_integer_create(void)
 {
-       return create_integer_field_class(BT_FIELD_CLASS_ID_UNSIGNED_INTEGER);
+       return create_integer_field_class(BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
 }
 
 struct bt_field_class *bt_field_class_signed_integer_create(void)
 {
-       return create_integer_field_class(BT_FIELD_CLASS_ID_SIGNED_INTEGER);
+       return create_integer_field_class(BT_FIELD_CLASS_TYPE_SIGNED_INTEGER);
 }
 
 uint64_t bt_field_class_integer_get_field_value_range(
@@ -146,8 +147,9 @@ int bt_field_class_integer_set_field_value_range(
        BT_ASSERT_PRE(size <= 64,
                "Unsupported size for integer field classe's field value range "
                "(maximum is 64): size=%" PRIu64, size);
-       BT_ASSERT_PRE(int_fc->common.id == BT_FIELD_CLASS_ID_UNSIGNED_INTEGER ||
-               int_fc->common.id == BT_FIELD_CLASS_ID_SIGNED_INTEGER ||
+       BT_ASSERT_PRE(
+               int_fc->common.type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
+               int_fc->common.type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
                size_is_valid_for_enumeration_field_class(fc, size),
                "Invalid field value range for enumeration field classe: "
                "at least one of the current mapping ranges contains values "
@@ -222,19 +224,19 @@ void destroy_enumeration_field_class(struct bt_object *obj)
 }
 
 static
-struct bt_field_class *create_enumeration_field_class(enum bt_field_class_id id)
+struct bt_field_class *create_enumeration_field_class(enum bt_field_class_type type)
 {
        struct bt_field_class_enumeration *enum_fc = NULL;
 
-       BT_LOGD("Creating default enumeration field classe object: id=%s",
-               bt_common_field_class_id_string(id));
+       BT_LOGD("Creating default enumeration field classe object: type=%s",
+               bt_common_field_class_type_string(type));
        enum_fc = g_new0(struct bt_field_class_enumeration, 1);
        if (!enum_fc) {
                BT_LOGE_STR("Failed to allocate one enumeration field classe.");
                goto error;
        }
 
-       init_integer_field_class((void *) enum_fc, id,
+       init_integer_field_class((void *) enum_fc, type,
                destroy_enumeration_field_class);
        enum_fc->mappings = g_array_new(FALSE, TRUE,
                sizeof(struct bt_field_class_enumeration_mapping));
@@ -262,13 +264,13 @@ end:
 struct bt_field_class *bt_field_class_unsigned_enumeration_create(void)
 {
        return create_enumeration_field_class(
-               BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION);
+               BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
 }
 
 struct bt_field_class *bt_field_class_signed_enumeration_create(void)
 {
        return create_enumeration_field_class(
-               BT_FIELD_CLASS_ID_SIGNED_ENUMERATION);
+               BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
 }
 
 uint64_t bt_field_class_enumeration_get_mapping_count(struct bt_field_class *fc)
@@ -292,7 +294,7 @@ void bt_field_class_unsigned_enumeration_borrow_mapping_by_index(
        BT_ASSERT_PRE_NON_NULL(name, "Name (output)");
        BT_ASSERT_PRE_NON_NULL(ranges, "Ranges (output)");
        BT_ASSERT_PRE_VALID_INDEX(index, enum_fc->mappings->len);
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        mapping = BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
        *name = mapping->label->str;
@@ -311,7 +313,7 @@ void bt_field_class_signed_enumeration_borrow_mapping_by_index(
        BT_ASSERT_PRE_NON_NULL(name, "Name (output)");
        BT_ASSERT_PRE_NON_NULL(ranges, "Ranges (output)");
        BT_ASSERT_PRE_VALID_INDEX(index, enum_fc->mappings->len);
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        mapping = BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
        *name = mapping->label->str;
@@ -383,7 +385,7 @@ int bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
        BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        g_ptr_array_set_size(enum_fc->label_buf, 0);
 
@@ -422,7 +424,7 @@ int bt_field_class_signed_enumeration_get_mapping_labels_by_value(
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
        BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        g_ptr_array_set_size(enum_fc->label_buf, 0);
 
@@ -521,7 +523,7 @@ int bt_field_class_unsigned_enumeration_map_range(
        struct bt_field_class_enumeration *enum_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        BT_ASSERT_PRE(range_lower <= range_upper,
                "Range's upper bound is less than lower bound: "
@@ -546,7 +548,7 @@ int bt_field_class_signed_enumeration_map_range(
        struct bt_field_class_enumeration *enum_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        BT_ASSERT_PRE(range_lower <= range_upper,
                "Range's upper bound is less than lower bound: "
@@ -583,7 +585,7 @@ struct bt_field_class *bt_field_class_real_create(void)
                goto error;
        }
 
-       init_field_class((void *) real_fc, BT_FIELD_CLASS_ID_REAL,
+       init_field_class((void *) real_fc, BT_FIELD_CLASS_TYPE_REAL,
                destroy_real_field_class);
        BT_LIB_LOGD("Created real field classe object: %!+F", real_fc);
        goto end;
@@ -600,7 +602,7 @@ bt_bool bt_field_class_real_is_single_precision(struct bt_field_class *fc)
        struct bt_field_class_real *real_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_REAL, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
        return real_fc->is_single_precision;
 }
 
@@ -610,7 +612,7 @@ int bt_field_class_real_set_is_single_precision(struct bt_field_class *fc,
        struct bt_field_class_real *real_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_REAL, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
        BT_ASSERT_PRE_FC_HOT(fc, "Field class");
        real_fc->is_single_precision = (bool) is_single_precision;
        BT_LIB_LOGV("Set real field classe's \"is single precision\" property: "
@@ -621,11 +623,11 @@ int bt_field_class_real_set_is_single_precision(struct bt_field_class *fc,
 static
 int init_named_field_classes_container(
                struct bt_field_class_named_field_class_container *fc,
-               enum bt_field_class_id id, bt_object_release_func release_func)
+               enum bt_field_class_type type, bt_object_release_func release_func)
 {
        int ret = 0;
 
-       init_field_class((void *) fc, id, release_func);
+       init_field_class((void *) fc, type, release_func);
        fc->named_fcs = g_array_new(FALSE, TRUE,
                sizeof(struct bt_named_field_class));
        if (!fc->named_fcs) {
@@ -707,7 +709,7 @@ struct bt_field_class *bt_field_class_structure_create(void)
        }
 
        ret = init_named_field_classes_container((void *) struct_fc,
-               BT_FIELD_CLASS_ID_STRUCTURE, destroy_structure_field_class);
+               BT_FIELD_CLASS_TYPE_STRUCTURE, destroy_structure_field_class);
        if (ret) {
                goto error;
        }
@@ -764,7 +766,7 @@ int bt_field_class_structure_append_member(struct bt_field_class *fc,
                const char *name, struct bt_field_class *member_fc)
 {
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_STRUCTURE, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class");
        return append_named_field_class_to_container_field_class((void *) fc,
                name, member_fc);
 }
@@ -774,7 +776,7 @@ uint64_t bt_field_class_structure_get_member_count(struct bt_field_class *fc)
        struct bt_field_class_structure *struct_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_STRUCTURE, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class");
        return (uint64_t) struct_fc->common.named_fcs->len;
 }
 
@@ -800,7 +802,7 @@ void bt_field_class_structure_borrow_member_by_index(
                const char **name, struct bt_field_class **out_fc)
 {
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_STRUCTURE, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class");
        borrow_named_field_class_from_container_field_class_at_index((void *) fc,
                index, name, out_fc);
 }
@@ -834,7 +836,7 @@ struct bt_field_class *bt_field_class_structure_borrow_member_field_class_by_nam
                struct bt_field_class *fc, const char *name)
 {
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_STRUCTURE, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class");
        return borrow_field_class_from_container_field_class_by_name((void *) fc,
                name);
 }
@@ -865,7 +867,7 @@ struct bt_field_class *bt_field_class_variant_create(void)
        }
 
        ret = init_named_field_classes_container((void *) var_fc,
-               BT_FIELD_CLASS_ID_VARIANT, destroy_variant_field_class);
+               BT_FIELD_CLASS_TYPE_VARIANT, destroy_variant_field_class);
        if (ret) {
                goto error;
        }
@@ -887,7 +889,7 @@ int bt_field_class_variant_set_selector_field_class(
 
        BT_ASSERT_PRE_NON_NULL(fc, "Variant field classe");
        BT_ASSERT_PRE_NON_NULL(selector_fc, "Selector field classe");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_VARIANT, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        BT_ASSERT_PRE_FC_IS_ENUM(selector_fc, "Selector field classe");
        BT_ASSERT_PRE_FC_HOT(fc, "Variant field classe");
        var_fc->selector_fc = selector_fc;
@@ -899,7 +901,7 @@ int bt_field_class_variant_append_option(struct bt_field_class *fc,
                const char *name, struct bt_field_class *option_fc)
 {
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_VARIANT, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return append_named_field_class_to_container_field_class((void *) fc,
                name, option_fc);
 }
@@ -908,7 +910,7 @@ struct bt_field_class *bt_field_class_variant_borrow_option_field_class_by_name(
                struct bt_field_class *fc, const char *name)
 {
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_VARIANT, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return borrow_field_class_from_container_field_class_by_name((void *) fc,
                name);
 }
@@ -918,7 +920,7 @@ uint64_t bt_field_class_variant_get_option_count(struct bt_field_class *fc)
        struct bt_field_class_variant *var_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_VARIANT, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (uint64_t) var_fc->common.named_fcs->len;
 }
 
@@ -927,7 +929,7 @@ void bt_field_class_variant_borrow_option_by_index(
                const char **name, struct bt_field_class **out_fc)
 {
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_VARIANT, "Field class");
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        borrow_named_field_class_from_container_field_class_at_index((void *) fc,
                index, name, out_fc);
 }
@@ -938,18 +940,18 @@ struct bt_field_path *bt_field_class_variant_borrow_selector_field_path(
        struct bt_field_class_variant *var_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_VARIANT,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
                "Field class");
        return var_fc->selector_field_path;
 }
 
 static
 void init_array_field_class(struct bt_field_class_array *fc,
-               enum bt_field_class_id id, bt_object_release_func release_func,
+               enum bt_field_class_type type, bt_object_release_func release_func,
                struct bt_field_class *element_fc)
 {
        BT_ASSERT(element_fc);
-       init_field_class((void *) fc, id, release_func);
+       init_field_class((void *) fc, type, release_func);
        fc->element_fc = bt_get(element_fc);
        bt_field_class_freeze(element_fc);
 }
@@ -984,7 +986,7 @@ struct bt_field_class *bt_field_class_static_array_create(
                goto error;
        }
 
-       init_array_field_class((void *) array_fc, BT_FIELD_CLASS_ID_STATIC_ARRAY,
+       init_array_field_class((void *) array_fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
                destroy_static_array_field_class, element_fc);
        array_fc->length = length;
        BT_LIB_LOGD("Created static array field classe object: %!+F", array_fc);
@@ -1012,7 +1014,7 @@ uint64_t bt_field_class_static_array_get_length(struct bt_field_class *fc)
        struct bt_field_class_static_array *array_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_STATIC_ARRAY,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
                "Field class");
        return (uint64_t) array_fc->length;
 }
@@ -1043,7 +1045,7 @@ struct bt_field_class *bt_field_class_dynamic_array_create(
                goto error;
        }
 
-       init_array_field_class((void *) array_fc, BT_FIELD_CLASS_ID_DYNAMIC_ARRAY,
+       init_array_field_class((void *) array_fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
                destroy_dynamic_array_field_class, element_fc);
        BT_LIB_LOGD("Created dynamic array field classe object: %!+F", array_fc);
        goto end;
@@ -1062,7 +1064,7 @@ int bt_field_class_dynamic_array_set_length_field_class(struct bt_field_class *f
 
        BT_ASSERT_PRE_NON_NULL(fc, "Dynamic array field classe");
        BT_ASSERT_PRE_NON_NULL(length_fc, "Length field classe");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_DYNAMIC_ARRAY,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
                "Field class");
        BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(length_fc, "Length field classe");
        BT_ASSERT_PRE_FC_HOT(fc, "Dynamic array field classe");
@@ -1077,7 +1079,7 @@ struct bt_field_path *bt_field_class_dynamic_array_borrow_length_field_path(
        struct bt_field_class_dynamic_array *seq_fc = (void *) fc;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_ID_DYNAMIC_ARRAY,
+       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
                "Field class");
        return seq_fc->length_field_path;
 }
@@ -1101,7 +1103,7 @@ struct bt_field_class *bt_field_class_string_create(void)
                goto error;
        }
 
-       init_field_class((void *) string_fc, BT_FIELD_CLASS_ID_STRING,
+       init_field_class((void *) string_fc, BT_FIELD_CLASS_TYPE_STRING,
                destroy_string_field_class);
        BT_LIB_LOGD("Created string field classe object: %!+F", string_fc);
        goto end;
@@ -1132,9 +1134,9 @@ void _bt_field_class_make_part_of_trace(struct bt_field_class *fc)
                "Field class is already part of a trace: %!+F", fc);
        fc->part_of_trace = true;
 
-       switch (fc->id) {
-       case BT_FIELD_CLASS_ID_STRUCTURE:
-       case BT_FIELD_CLASS_ID_VARIANT:
+       switch (fc->type) {
+       case BT_FIELD_CLASS_TYPE_STRUCTURE:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
        {
                struct bt_field_class_named_field_class_container *container_fc =
                        (void *) fc;
@@ -1150,8 +1152,8 @@ void _bt_field_class_make_part_of_trace(struct bt_field_class *fc)
 
                break;
        }
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
        {
                struct bt_field_class_array *array_fc = (void *) fc;
 
index 376bc5d66c60d80ecbaa17738cd1122aa92a9121..9872dd77603da350d8a42b23c89e05ed32949761 100644 (file)
@@ -142,16 +142,16 @@ struct bt_field *create_variant_field(struct bt_field_class *);
 
 static
 struct bt_field *(* const field_create_funcs[])(struct bt_field_class *) = {
-       [BT_FIELD_CLASS_ID_UNSIGNED_INTEGER]    = create_integer_field,
-       [BT_FIELD_CLASS_ID_SIGNED_INTEGER]      = create_integer_field,
-       [BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION] = create_integer_field,
-       [BT_FIELD_CLASS_ID_SIGNED_ENUMERATION]  = create_integer_field,
-       [BT_FIELD_CLASS_ID_REAL]                        = create_real_field,
-       [BT_FIELD_CLASS_ID_STRING]              = create_string_field,
-       [BT_FIELD_CLASS_ID_STRUCTURE]           = create_structure_field,
-       [BT_FIELD_CLASS_ID_STATIC_ARRAY]                = create_static_array_field,
-       [BT_FIELD_CLASS_ID_DYNAMIC_ARRAY]       = create_dynamic_array_field,
-       [BT_FIELD_CLASS_ID_VARIANT]             = create_variant_field,
+       [BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER]  = create_integer_field,
+       [BT_FIELD_CLASS_TYPE_SIGNED_INTEGER]    = create_integer_field,
+       [BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION] = create_integer_field,
+       [BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION]        = create_integer_field,
+       [BT_FIELD_CLASS_TYPE_REAL]                      = create_real_field,
+       [BT_FIELD_CLASS_TYPE_STRING]            = create_string_field,
+       [BT_FIELD_CLASS_TYPE_STRUCTURE]         = create_structure_field,
+       [BT_FIELD_CLASS_TYPE_STATIC_ARRAY]              = create_static_array_field,
+       [BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY]     = create_dynamic_array_field,
+       [BT_FIELD_CLASS_TYPE_VARIANT]           = create_variant_field,
 };
 
 static
@@ -174,16 +174,16 @@ void destroy_variant_field(struct bt_field *field);
 
 static
 void (* const field_destroy_funcs[])(struct bt_field *) = {
-       [BT_FIELD_CLASS_ID_UNSIGNED_INTEGER]    = destroy_integer_field,
-       [BT_FIELD_CLASS_ID_SIGNED_INTEGER]      = destroy_integer_field,
-       [BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION] = destroy_integer_field,
-       [BT_FIELD_CLASS_ID_SIGNED_ENUMERATION]  = destroy_integer_field,
-       [BT_FIELD_CLASS_ID_REAL]                        = destroy_real_field,
-       [BT_FIELD_CLASS_ID_STRING]              = destroy_string_field,
-       [BT_FIELD_CLASS_ID_STRUCTURE]           = destroy_structure_field,
-       [BT_FIELD_CLASS_ID_STATIC_ARRAY]                = destroy_array_field,
-       [BT_FIELD_CLASS_ID_DYNAMIC_ARRAY]       = destroy_array_field,
-       [BT_FIELD_CLASS_ID_VARIANT]             = destroy_variant_field,
+       [BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER]  = destroy_integer_field,
+       [BT_FIELD_CLASS_TYPE_SIGNED_INTEGER]    = destroy_integer_field,
+       [BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION] = destroy_integer_field,
+       [BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION]        = destroy_integer_field,
+       [BT_FIELD_CLASS_TYPE_REAL]                      = destroy_real_field,
+       [BT_FIELD_CLASS_TYPE_STRING]            = destroy_string_field,
+       [BT_FIELD_CLASS_TYPE_STRUCTURE]         = destroy_structure_field,
+       [BT_FIELD_CLASS_TYPE_STATIC_ARRAY]              = destroy_array_field,
+       [BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY]     = destroy_array_field,
+       [BT_FIELD_CLASS_TYPE_VARIANT]           = destroy_variant_field,
 };
 
 struct bt_field_class *bt_field_borrow_class(struct bt_field *field)
@@ -192,10 +192,10 @@ struct bt_field_class *bt_field_borrow_class(struct bt_field *field)
        return field->class;
 }
 
-enum bt_field_class_id bt_field_get_class_id(struct bt_field *field)
+enum bt_field_class_type bt_field_get_class_type(struct bt_field *field)
 {
        BT_ASSERT_PRE_NON_NULL(field, "Field");
-       return field->class->id;
+       return field->class->type;
 }
 
 BT_HIDDEN
@@ -204,8 +204,8 @@ struct bt_field *bt_field_create(struct bt_field_class *fc)
        struct bt_field *field = NULL;
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT(bt_field_class_has_known_id(fc));
-       field = field_create_funcs[fc->id](fc);
+       BT_ASSERT(bt_field_class_has_known_type(fc));
+       field = field_create_funcs[fc->type](fc);
        if (!field) {
                BT_LIB_LOGE("Cannot create field object from field classe: "
                        "%![fc-]+F", fc);
@@ -536,7 +536,7 @@ double bt_field_real_get_value(struct bt_field *field)
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
        BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field, BT_FIELD_CLASS_ID_REAL, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
        return real_field->value;
 }
 
@@ -545,7 +545,7 @@ void bt_field_real_set_value(struct bt_field *field, double value)
        struct bt_field_real *real_field = (void *) field;
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field, BT_FIELD_CLASS_ID_REAL, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
        BT_ASSERT_PRE_FIELD_HOT(field, "Field");
        BT_ASSERT_PRE(
                !((struct bt_field_class_real *) field->class)->is_single_precision ||
@@ -566,8 +566,8 @@ int bt_field_unsigned_enumeration_get_mapping_labels(struct bt_field *field,
        BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
        BT_ASSERT_PRE_NON_NULL(label_array, "Count (output)");
        BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field");
        return bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
                field->class, int_field->value.u, label_array, count);
 }
@@ -582,8 +582,8 @@ int bt_field_signed_enumeration_get_mapping_labels(struct bt_field *field,
        BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
        BT_ASSERT_PRE_NON_NULL(label_array, "Count (output)");
        BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_SIGNED_ENUMERATION, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field");
        return bt_field_class_signed_enumeration_get_mapping_labels_by_value(
                field->class, int_field->value.i, label_array, count);
 }
@@ -594,7 +594,7 @@ const char *bt_field_string_get_value(struct bt_field *field)
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
        BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field, BT_FIELD_CLASS_ID_STRING,
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        return (const char *) string_field->buf->data;
 }
@@ -605,7 +605,7 @@ uint64_t bt_field_string_get_length(struct bt_field *field)
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
        BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field, BT_FIELD_CLASS_ID_STRING,
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        return string_field->length;
 }
@@ -615,7 +615,7 @@ int bt_field_string_set_value(struct bt_field *field, const char *value)
        BT_ASSERT_PRE_NON_NULL(field, "Field");
        BT_ASSERT_PRE_NON_NULL(value, "Value");
        BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field, BT_FIELD_CLASS_ID_STRING,
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        bt_field_string_clear(field);
        return bt_field_string_append_with_length(field, value,
@@ -638,8 +638,8 @@ int bt_field_string_append_with_length(struct bt_field *field,
        BT_ASSERT_PRE_NON_NULL(field, "Field");
        BT_ASSERT_PRE_NON_NULL(value, "Value");
        BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_STRING, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_STRING, "Field");
 
        /* Make sure no null bytes are appended */
        BT_ASSERT_PRE(memchr(value, '\0', length) == NULL,
@@ -666,8 +666,8 @@ int bt_field_string_clear(struct bt_field *field)
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
        BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_STRING, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_STRING, "Field");
        string_field->length = 0;
        bt_field_set_single(field, true);
        return 0;
@@ -689,8 +689,8 @@ int bt_field_dynamic_array_set_length(struct bt_field *field,
        struct bt_field_array *array_field = (void *) field;
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_DYNAMIC_ARRAY, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, "Field");
        BT_ASSERT_PRE_FIELD_HOT(field, "Field");
 
        if (unlikely(length > array_field->fields->len)) {
@@ -743,8 +743,8 @@ struct bt_field *bt_field_structure_borrow_member_field_by_index(
        struct bt_field_structure *struct_field = (void *) field;
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_STRUCTURE, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
        BT_ASSERT_PRE_VALID_INDEX(index, struct_field->fields->len);
        return struct_field->fields->pdata[index];
 }
@@ -760,8 +760,8 @@ struct bt_field *bt_field_structure_borrow_member_field_by_name(
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
        BT_ASSERT_PRE_NON_NULL(name, "Field name");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_STRUCTURE, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
        struct_fc = (void *) field->class;
 
        if (!g_hash_table_lookup_extended(struct_fc->common.name_to_index, name,
@@ -782,8 +782,8 @@ struct bt_field *bt_field_variant_borrow_selected_option_field(
        struct bt_field_variant *var_field = (void *) field;
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_VARIANT, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_VARIANT, "Field");
        BT_ASSERT_PRE(var_field->selected_field,
                "Variant field has no selected field: %!+f", field);
        return var_field->selected_field;
@@ -795,8 +795,8 @@ int bt_field_variant_select_option_field(struct bt_field *field,
        struct bt_field_variant *var_field = (void *) field;
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_VARIANT, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_VARIANT, "Field");
        BT_ASSERT_PRE_FIELD_HOT(field, "Field");
        BT_ASSERT_PRE_VALID_INDEX(index, var_field->fields->len);
        var_field->selected_field = var_field->fields->pdata[index];
@@ -810,8 +810,8 @@ uint64_t bt_field_variant_get_selected_option_field_index(
        struct bt_field_variant *var_field = (void *) field;
 
        BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_ID(field,
-               BT_FIELD_CLASS_ID_VARIANT, "Field");
+       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+               BT_FIELD_CLASS_TYPE_VARIANT, "Field");
        BT_ASSERT_PRE(var_field->selected_field,
                "Variant field has no selected field: %!+f", field);
        return var_field->selected_index;
@@ -911,8 +911,8 @@ BT_HIDDEN
 void bt_field_destroy(struct bt_field *field)
 {
        BT_ASSERT(field);
-       BT_ASSERT(bt_field_class_has_known_id(field->class));
-       field_destroy_funcs[field->class->id](field);
+       BT_ASSERT(bt_field_class_has_known_type(field->class));
+       field_destroy_funcs[field->class->type](field);
 }
 
 static
index b86109952d06bac3494f07b381d5cf0f94909d36..8334d18bbd80c27c62aae216f7a2f655e868d8a0 100644 (file)
@@ -45,9 +45,9 @@ bool find_field_class_recursive(struct bt_field_class *fc,
                goto end;
        }
 
-       switch (fc->id) {
-       case BT_FIELD_CLASS_ID_STRUCTURE:
-       case BT_FIELD_CLASS_ID_VARIANT:
+       switch (fc->type) {
+       case BT_FIELD_CLASS_TYPE_STRUCTURE:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
        {
                struct bt_field_class_named_field_class_container *container_fc =
                        (void *) fc;
@@ -71,8 +71,8 @@ bool find_field_class_recursive(struct bt_field_class *fc,
 
                break;
        }
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
        {
                struct bt_field_class_array *array_fc = (void *) fc;
 
@@ -235,9 +235,9 @@ struct bt_field_class *borrow_child_field_class(struct bt_field_class *parent_fc
 {
        struct bt_field_class *child_fc = NULL;
 
-       switch (parent_fc->id) {
-       case BT_FIELD_CLASS_ID_STRUCTURE:
-       case BT_FIELD_CLASS_ID_VARIANT:
+       switch (parent_fc->type) {
+       case BT_FIELD_CLASS_TYPE_STRUCTURE:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
        {
                struct bt_named_field_class *named_fc =
                        BT_FIELD_CLASS_NAMED_FC_AT_INDEX(parent_fc, index);
@@ -246,8 +246,8 @@ struct bt_field_class *borrow_child_field_class(struct bt_field_class *parent_fc
                *advance = true;
                break;
        }
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
        {
                struct bt_field_class_array *array_fc = (void *) parent_fc;
 
@@ -284,9 +284,9 @@ bool target_field_path_in_different_scope_has_struct_fc_only(
                        tgt_field_path, i);
                bool advance;
 
-               if (fc->id == BT_FIELD_CLASS_ID_STATIC_ARRAY ||
-                               fc->id == BT_FIELD_CLASS_ID_DYNAMIC_ARRAY ||
-                               fc->id == BT_FIELD_CLASS_ID_VARIANT) {
+               if (fc->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY ||
+                               fc->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY ||
+                               fc->type == BT_FIELD_CLASS_TYPE_VARIANT) {
                        is_valid = false;
                        goto end;
                }
@@ -341,7 +341,7 @@ bool lca_is_structure_field_class(struct bt_field_path *src_field_path,
                                break;
                        }
 
-                       if (prev_fc->id != BT_FIELD_CLASS_ID_STRUCTURE) {
+                       if (prev_fc->type != BT_FIELD_CLASS_TYPE_STRUCTURE) {
                                is_valid = false;
                        }
 
@@ -420,9 +420,9 @@ bool lca_to_target_has_struct_fc_only(struct bt_field_path *src_field_path,
                uint64_t tgt_index = bt_field_path_get_index_by_index_inline(
                        tgt_field_path, tgt_i);
 
-               if (tgt_fc->id == BT_FIELD_CLASS_ID_STATIC_ARRAY ||
-                               tgt_fc->id == BT_FIELD_CLASS_ID_DYNAMIC_ARRAY ||
-                               tgt_fc->id == BT_FIELD_CLASS_ID_VARIANT) {
+               if (tgt_fc->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY ||
+                               tgt_fc->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY ||
+                               tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT) {
                        is_valid = false;
                        goto end;
                }
@@ -535,8 +535,8 @@ int bt_resolve_field_paths(struct bt_field_class *fc,
        BT_ASSERT(fc);
 
        /* Resolving part for dynamic array and variant field classes */
-       switch (fc->id) {
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       switch (fc->type) {
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
        {
                struct bt_field_class_dynamic_array *dyn_array_fc = (void *) fc;
 
@@ -552,7 +552,7 @@ int bt_resolve_field_paths(struct bt_field_class *fc,
 
                break;
        }
-       case BT_FIELD_CLASS_ID_VARIANT:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
        {
                struct bt_field_class_variant *var_fc = (void *) fc;
 
@@ -572,9 +572,9 @@ int bt_resolve_field_paths(struct bt_field_class *fc,
        }
 
        /* Recursive part */
-       switch (fc->id) {
-       case BT_FIELD_CLASS_ID_STRUCTURE:
-       case BT_FIELD_CLASS_ID_VARIANT:
+       switch (fc->type) {
+       case BT_FIELD_CLASS_TYPE_STRUCTURE:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
        {
                struct bt_field_class_named_field_class_container *container_fc =
                        (void *) fc;
@@ -593,8 +593,8 @@ int bt_resolve_field_paths(struct bt_field_class *fc,
 
                break;
        }
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
        {
                struct bt_field_class_array *array_fc = (void *) fc;
 
index 7a0963755357fdb0dddb91f5f721285c0eb35fea..91255fc6a4efce93d928b2bdd8eaee505760254e 100644 (file)
@@ -291,8 +291,8 @@ int bt_stream_class_set_packet_context_field_class(
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
        BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
-       BT_ASSERT_PRE(bt_field_class_get_id(field_class) ==
-               BT_FIELD_CLASS_ID_STRUCTURE,
+       BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
+               BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Packet context field classe is not a structure field classe: %!+F",
                field_class);
        resolve_ctx.packet_header =
@@ -337,8 +337,8 @@ int bt_stream_class_set_event_header_field_class(
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
        BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
-       BT_ASSERT_PRE(bt_field_class_get_id(field_class) ==
-               BT_FIELD_CLASS_ID_STRUCTURE,
+       BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
+               BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Event header field classe is not a structure field classe: %!+F",
                field_class);
        resolve_ctx.packet_header =
@@ -384,8 +384,8 @@ int bt_stream_class_set_event_common_context_field_class(
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
        BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
-       BT_ASSERT_PRE(bt_field_class_get_id(field_class) ==
-               BT_FIELD_CLASS_ID_STRUCTURE,
+       BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
+               BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Event common context field classe is not a structure field classe: %!+F",
                field_class);
        resolve_ctx.packet_header =
index 9b338667a3629707b5b4d3d96246c677a6ad3434..9d70548265403fdf2559fa314577ccda8c9f2731 100644 (file)
@@ -454,8 +454,8 @@ int bt_trace_set_packet_header_field_class(struct bt_trace *trace,
        BT_ASSERT_PRE_NON_NULL(trace, "Trace");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
        BT_ASSERT_PRE_TRACE_HOT(trace);
-       BT_ASSERT_PRE(bt_field_class_get_id(field_class) ==
-               BT_FIELD_CLASS_ID_STRUCTURE,
+       BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
+               BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Packet header field classe is not a structure field classe: %!+F",
                field_class);
        ret = bt_resolve_field_paths(field_class, &resolve_ctx);
index 5d093c6df1db2f06bfbfdc74011b14aa1d932cbf..1a800bbda414302205d4a98f5cdf96de273369f3 100644 (file)
@@ -228,9 +228,9 @@ int stack_push(struct stack *stack, struct ctf_field_class *base_class,
        BT_ASSERT(stack);
        BT_ASSERT(base_class);
        BT_LOGV("Pushing field class on stack: stack-addr=%p, "
-               "fc-addr=%p, fc-id=%d, base-length=%zu, "
+               "fc-addr=%p, fc-type=%d, base-length=%zu, "
                "stack-size-before=%zu, stack-size-after=%zu",
-               stack, base_class, base_class->id,
+               stack, base_class, base_class->type,
                base_len, stack->size, stack->size + 1);
 
        if (stack->entries->len == stack->size) {
@@ -251,28 +251,28 @@ int64_t get_compound_field_class_length(struct bt_bfcr *bfcr,
 {
        int64_t length;
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_field_class_struct *struct_fc = (void *) fc;
 
                length = (int64_t) struct_fc->members->len;
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                /* Variant field classes always "contain" a single class */
                length = 1;
                break;
        }
-       case CTF_FIELD_CLASS_ID_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
        {
                struct ctf_field_class_array *array_fc = (void *) fc;
 
                length = (int64_t) array_fc->length;
                break;
        }
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
                length = bfcr->user.cbs.query.get_sequence_length(fc,
                        bfcr->user.data);
                break;
@@ -291,8 +291,8 @@ int stack_push_with_len(struct bt_bfcr *bfcr, struct ctf_field_class *base_class
 
        if (length < 0) {
                BT_LOGW("Cannot get compound field class's field count: "
-                       "bfcr-addr=%p, fc-addr=%p, fc-id=%d",
-                       bfcr, base_class, base_class->id);
+                       "bfcr-addr=%p, fc-addr=%p, fc-type=%d",
+                       bfcr, base_class, base_class->type);
                ret = BT_BFCR_STATUS_ERROR;
                goto end;
        }
@@ -917,15 +917,15 @@ enum bt_bfcr_status read_basic_begin_state(struct bt_bfcr *bfcr)
 
        BT_ASSERT(bfcr->cur_basic_field_class);
 
-       switch (bfcr->cur_basic_field_class->id) {
-       case CTF_FIELD_CLASS_ID_INT:
-       case CTF_FIELD_CLASS_ID_ENUM:
+       switch (bfcr->cur_basic_field_class->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
                status = read_basic_int_class_and_call_begin(bfcr);
                break;
-       case CTF_FIELD_CLASS_ID_FLOAT:
+       case CTF_FIELD_CLASS_TYPE_FLOAT:
                status = read_basic_float_class_and_call_begin(bfcr);
                break;
-       case CTF_FIELD_CLASS_ID_STRING:
+       case CTF_FIELD_CLASS_TYPE_STRING:
                status = read_basic_string_class_and_call(bfcr, true);
                break;
        default:
@@ -942,15 +942,15 @@ enum bt_bfcr_status read_basic_continue_state(struct bt_bfcr *bfcr)
 
        BT_ASSERT(bfcr->cur_basic_field_class);
 
-       switch (bfcr->cur_basic_field_class->id) {
-       case CTF_FIELD_CLASS_ID_INT:
-       case CTF_FIELD_CLASS_ID_ENUM:
+       switch (bfcr->cur_basic_field_class->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
                status = read_basic_int_class_and_call_continue(bfcr);
                break;
-       case CTF_FIELD_CLASS_ID_FLOAT:
+       case CTF_FIELD_CLASS_TYPE_FLOAT:
                status = read_basic_float_class_and_call_continue(bfcr);
                break;
-       case CTF_FIELD_CLASS_ID_STRING:
+       case CTF_FIELD_CLASS_TYPE_STRING:
                status = read_basic_string_class_and_call(bfcr, false);
                break;
        default:
@@ -1062,13 +1062,13 @@ enum bt_bfcr_status next_field_state(struct bt_bfcr *bfcr)
        }
 
        /* Get next field's class */
-       switch (top->base_class->id) {
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       switch (top->base_class->type) {
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
                next_field_class = ctf_field_class_struct_borrow_member_by_index(
                        (void *) top->base_class, (uint64_t) top->index)->fc;
                break;
-       case CTF_FIELD_CLASS_ID_ARRAY:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_array_base *array_fc =
                        (void *) top->base_class;
@@ -1076,7 +1076,7 @@ enum bt_bfcr_status next_field_state(struct bt_bfcr *bfcr)
                next_field_class = array_fc->elem_fc;
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
                /* Variant classes are dynamic: the user should know! */
                next_field_class =
                        bfcr->user.cbs.query.borrow_variant_selected_field_class(
@@ -1088,9 +1088,10 @@ enum bt_bfcr_status next_field_state(struct bt_bfcr *bfcr)
 
        if (!next_field_class) {
                BT_LOGW("Cannot get the field class of the next field: "
-                       "bfcr-addr=%p, base-fc-addr=%p, base-fc-id=%d, "
+                       "bfcr-addr=%p, base-fc-addr=%p, base-fc-type=%d, "
                        "index=%" PRId64,
-                       bfcr, top->base_class, top->base_class->id, top->index);
+                       bfcr, top->base_class, top->base_class->type,
+                       top->index);
                status = BT_BFCR_STATUS_ERROR;
                goto end;
        }
index e02392c14390e9e743232e33f667b00b3905226a..0292a7dfe479857feb7870ef9794ddfdc13122e4 100644 (file)
@@ -394,8 +394,8 @@ int ptokens_to_field_path(GList *ptokens, struct ctf_field_path *field_path,
                BT_LOGV("Current path token: token=\"%s\"", ft_name);
 
                /* Find to which index corresponds the current path token */
-               if (fc->id == CTF_FIELD_CLASS_ID_ARRAY ||
-                               fc->id == CTF_FIELD_CLASS_ID_SEQUENCE) {
+               if (fc->type == CTF_FIELD_CLASS_TYPE_ARRAY ||
+                               fc->type == CTF_FIELD_CLASS_TYPE_SEQUENCE) {
                        child_index = -1;
                } else {
                        child_index =
@@ -910,25 +910,25 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
        /*
         * Make sure the target class has the right class and properties.
         */
-       switch (ctx->cur_fc->id) {
-       case CTF_FIELD_CLASS_ID_VARIANT:
-               if (target_fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+       switch (ctx->cur_fc->type) {
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
+               if (target_fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE("Variant field class's tag field class is not an enumeration field class: "
                                "tag-fc-addr=%p, tag-fc-id=%d",
-                               target_fc, target_fc->id);
+                               target_fc, target_fc->type);
                        ret = -1;
                        goto end;
                }
                break;
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_int *int_fc = (void *) target_fc;
 
-               if (target_fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               target_fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (target_fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               target_fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE("Sequence field class's length field class is not an unsigned integer field class: "
                                "length-fc-addr=%p, length-fc-id=%d",
-                               target_fc, target_fc->id);
+                               target_fc, target_fc->type);
                        ret = -1;
                        goto end;
                }
@@ -936,7 +936,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
                if (int_fc->is_signed) {
                        BT_LOGE("Sequence field class's length field class is not an unsigned integer field class: "
                                "length-fc-addr=%p, length-fc-id=%d",
-                               target_fc, target_fc->id);
+                               target_fc, target_fc->type);
                        ret = -1;
                        goto end;
                }
@@ -968,14 +968,14 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
        ctf_field_path_init(&target_field_path);
 
        /* Get path string */
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_sequence *seq_fc = (void *) fc;
                pathstr = seq_fc->length_ref->str;
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
                pathstr = var_fc->tag_ref->str;
@@ -1024,8 +1024,8 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
        }
 
        /* Set target field path and target field class */
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_sequence *seq_fc = (void *) fc;
 
@@ -1034,7 +1034,7 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
                seq_fc->length_fc = (void *) target_fc;
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
 
@@ -1073,9 +1073,9 @@ int resolve_field_class(struct ctf_field_class *fc, struct resolve_context *ctx)
        ctx->cur_fc = fc;
 
        /* Resolve sequence/variant field class */
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
                ret = resolve_sequence_or_variant_field_class(fc, ctx);
                if (ret) {
                        BT_LOGE("Cannot resolve sequence field class's length or variant field class's tag: "
@@ -1089,11 +1089,11 @@ int resolve_field_class(struct ctf_field_class *fc, struct resolve_context *ctx)
        }
 
        /* Recurse into compound classes */
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_STRUCT:
-       case CTF_FIELD_CLASS_ID_VARIANT:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
-       case CTF_FIELD_CLASS_ID_ARRAY:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
        {
                uint64_t i;
                uint64_t field_count =
@@ -1113,8 +1113,8 @@ int resolve_field_class(struct ctf_field_class *fc, struct resolve_context *ctx)
 
                        BT_ASSERT(child_fc);
 
-                       if (fc->id == CTF_FIELD_CLASS_ID_ARRAY||
-                                       fc->id == CTF_FIELD_CLASS_ID_SEQUENCE) {
+                       if (fc->type == CTF_FIELD_CLASS_TYPE_ARRAY||
+                                       fc->type == CTF_FIELD_CLASS_TYPE_SEQUENCE) {
                                field_class_stack_peek(
                                        ctx->field_class_stack)->index = -1;
                        } else {
index 2829a0578cd65fcef4c7d0fd574a4289656b6aaf..1b6627716d480bb1c6e48760c1f7cd068128503f 100644 (file)
@@ -279,29 +279,29 @@ struct bt_field_class *ctf_field_class_to_ir(struct ctf_field_class *fc,
        BT_ASSERT(fc);
        BT_ASSERT(fc->in_ir);
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_INT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
                ir_fc = ctf_field_class_int_to_ir((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_ENUM:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
                ir_fc = ctf_field_class_enum_to_ir((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_FLOAT:
+       case CTF_FIELD_CLASS_TYPE_FLOAT:
                ir_fc = ctf_field_class_float_to_ir((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_STRING:
+       case CTF_FIELD_CLASS_TYPE_STRING:
                ir_fc = ctf_field_class_string_to_ir((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
                ir_fc = ctf_field_class_struct_to_ir((void *) fc, tc, sc, ec);
                break;
-       case CTF_FIELD_CLASS_ID_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
                ir_fc = ctf_field_class_array_to_ir((void *) fc, tc, sc, ec);
                break;
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
                ir_fc = ctf_field_class_sequence_to_ir((void *) fc, tc, sc, ec);
                break;
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
                ir_fc = ctf_field_class_variant_to_ir((void *) fc, tc, sc, ec);
                break;
        default:
@@ -345,7 +345,7 @@ struct bt_field_class *scope_ctf_field_class_to_ir(struct ctf_field_class *fc,
                goto end;
        }
 
-       BT_ASSERT(fc->id == CTF_FIELD_CLASS_ID_STRUCT);
+       BT_ASSERT(fc->type == CTF_FIELD_CLASS_TYPE_STRUCT);
 
        if (!ctf_field_class_struct_has_immediate_member_in_ir((void *) fc)) {
                /*
@@ -377,8 +377,8 @@ struct ctf_field_class_int *borrow_named_int_field_class(
                goto end;
        }
 
-       if (named_fc->fc->id != CTF_FIELD_CLASS_ID_INT &&
-                       named_fc->fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+       if (named_fc->fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                       named_fc->fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                goto end;
        }
 
index a7c9f2d6db44d96c2aac34108c092ec1057e6c26..d5039f7933bffac910244474dbf14bcbccf86c9c 100644 (file)
@@ -36,9 +36,9 @@ int find_mapped_clock_class(struct ctf_field_class *fc,
                goto end;
        }
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_INT:
-       case CTF_FIELD_CLASS_ID_ENUM:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
        {
                struct ctf_field_class_int *int_fc = (void *) fc;
 
@@ -59,7 +59,7 @@ int find_mapped_clock_class(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_field_class_struct *struct_fc = (void *) fc;
 
@@ -77,7 +77,7 @@ int find_mapped_clock_class(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
 
@@ -95,8 +95,8 @@ int find_mapped_clock_class(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_ARRAY:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_array_base *array_fc = (void *) fc;
 
index ca93a8d9a0ed78798d75cfd6a37dc0082ac56618..a765b7c1b0b09244918d1b90827ec39bc2576edc 100644 (file)
@@ -36,9 +36,9 @@ void update_field_class_in_ir(struct ctf_field_class *fc,
                goto end;
        }
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_INT:
-       case CTF_FIELD_CLASS_ID_ENUM:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
        {
                struct ctf_field_class_int *int_fc = (void *) fc;
 
@@ -55,7 +55,7 @@ void update_field_class_in_ir(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_field_class_struct *struct_fc = (void *) fc;
 
@@ -75,7 +75,7 @@ void update_field_class_in_ir(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_named_field_class *named_fc;
                struct ctf_field_class_variant *var_fc = (void *) fc;
@@ -125,15 +125,15 @@ void update_field_class_in_ir(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_ARRAY:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_array_base *array_fc = (void *) fc;
 
                update_field_class_in_ir(array_fc->elem_fc, ft_dependents);
                fc->in_ir = array_fc->elem_fc->in_ir;
 
-               if (fc->id == CTF_FIELD_CLASS_ID_ARRAY) {
+               if (fc->type == CTF_FIELD_CLASS_TYPE_ARRAY) {
                        struct ctf_field_class_array *arr_fc = (void *) fc;
 
                        assert(arr_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE ||
@@ -147,7 +147,7 @@ void update_field_class_in_ir(struct ctf_field_class *fc,
                                fc->in_ir = false;
                                array_fc->elem_fc->in_ir = false;
                        }
-               } else if (fc->id == CTF_FIELD_CLASS_ID_SEQUENCE) {
+               } else if (fc->type == CTF_FIELD_CLASS_TYPE_SEQUENCE) {
                        if (fc->in_ir) {
                                struct ctf_field_class_sequence *seq_fc = (void *) fc;
 
index 1e2bb1ae9ae8fddc2cbd4cbd4aba599fcfb67a54..cadbdeae3f459964e5daa6e5d5d5e4caee76c333 100644 (file)
@@ -37,9 +37,9 @@ int set_int_field_class_meaning_by_name(struct ctf_field_class *fc,
                goto end;
        }
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_INT:
-       case CTF_FIELD_CLASS_ID_ENUM:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
        {
                struct ctf_field_class_int *int_fc = (void *) fc;
 
@@ -49,7 +49,7 @@ int set_int_field_class_meaning_by_name(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_field_class_struct *struct_fc = (void *) fc;
 
@@ -67,7 +67,7 @@ int set_int_field_class_meaning_by_name(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
 
@@ -85,8 +85,8 @@ int set_int_field_class_meaning_by_name(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_ARRAY:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_array_base *array_fc = (void *) fc;
 
@@ -207,7 +207,7 @@ int ctf_trace_class_update_meanings(struct ctf_trace_class *ctf_tc)
 
                named_fc = ctf_field_class_struct_borrow_member_by_name(
                        (void *) ctf_tc->packet_header_fc, "uuid");
-               if (named_fc && named_fc->fc->id == CTF_FIELD_CLASS_ID_ARRAY) {
+               if (named_fc && named_fc->fc->type == CTF_FIELD_CLASS_TYPE_ARRAY) {
                        struct ctf_field_class_array *array_fc =
                                (void *) named_fc->fc;
 
index 1253f4a55ded2d4e0b5a3d042d95d933174a11b3..9bc7569d3983498918f274de372d864adaf23815 100644 (file)
@@ -35,8 +35,8 @@ int set_text_array_sequence_field_class(struct ctf_field_class *fc)
                goto end;
        }
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_field_class_struct *struct_fc = (void *) fc;
 
@@ -53,7 +53,7 @@ int set_text_array_sequence_field_class(struct ctf_field_class *fc)
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
 
@@ -70,13 +70,13 @@ int set_text_array_sequence_field_class(struct ctf_field_class *fc)
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_ARRAY:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_array_base *array_fc = (void *) fc;
 
-               if (array_fc->elem_fc->id == CTF_FIELD_CLASS_ID_INT ||
-                               array_fc->elem_fc->id == CTF_FIELD_CLASS_ID_ENUM) {
+               if (array_fc->elem_fc->type == CTF_FIELD_CLASS_TYPE_INT ||
+                               array_fc->elem_fc->type == CTF_FIELD_CLASS_TYPE_ENUM) {
                        struct ctf_field_class_int *int_fc =
                                (void *) array_fc->elem_fc;
 
index 3e01537ac6a34ce0c04637cba5c751782c9b72f6..e75bc8ec5131bafc331894957dee0384c60268af 100644 (file)
@@ -41,8 +41,8 @@ int update_field_class_stored_value_index(struct ctf_field_class *fc,
                goto end;
        }
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
 
@@ -51,7 +51,7 @@ int update_field_class_stored_value_index(struct ctf_field_class *fc,
                tgt_fc = (void *) var_fc->tag_fc;
                break;
        }
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_sequence *seq_fc = (void *) fc;
 
@@ -66,8 +66,8 @@ int update_field_class_stored_value_index(struct ctf_field_class *fc,
 
        if (field_path) {
                BT_ASSERT(tgt_fc);
-               BT_ASSERT(tgt_fc->base.base.id == CTF_FIELD_CLASS_ID_INT ||
-                       tgt_fc->base.base.id == CTF_FIELD_CLASS_ID_ENUM);
+               BT_ASSERT(tgt_fc->base.base.type == CTF_FIELD_CLASS_TYPE_INT ||
+                       tgt_fc->base.base.type == CTF_FIELD_CLASS_TYPE_ENUM);
                if (tgt_fc->storing_index >= 0) {
                        /* Already storing its value */
                        *stored_value_index = (uint64_t) tgt_fc->storing_index;
@@ -79,8 +79,8 @@ int update_field_class_stored_value_index(struct ctf_field_class *fc,
                }
        }
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_field_class_struct *struct_fc = (void *) fc;
 
@@ -98,7 +98,7 @@ int update_field_class_stored_value_index(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
 
@@ -116,8 +116,8 @@ int update_field_class_stored_value_index(struct ctf_field_class *fc,
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_ARRAY:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_array_base *array_fc = (void *) fc;
 
index 16c6532e40d984cffba7fbc0c875bbade50c8edb..322718e08a442feaa58ed6e37fb5a364ace72e27 100644 (file)
@@ -41,8 +41,8 @@ int validate_stream_class(struct ctf_stream_class *sc)
        fc = ctf_field_class_struct_borrow_member_field_class_by_name(
                (void *) sc->packet_context_fc, "timestamp_begin");
        if (fc) {
-               if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE_STR("Invalid packet context field class: "
                                "`timestamp_begin` member is not an integer field class.");
                        goto invalid;
@@ -60,8 +60,8 @@ int validate_stream_class(struct ctf_stream_class *sc)
        fc = ctf_field_class_struct_borrow_member_field_class_by_name(
                (void *) sc->packet_context_fc, "timestamp_end");
        if (fc) {
-               if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE_STR("Invalid packet context field class: "
                                "`timestamp_end` member is not an integer field class.");
                        goto invalid;
@@ -79,8 +79,8 @@ int validate_stream_class(struct ctf_stream_class *sc)
        fc = ctf_field_class_struct_borrow_member_field_class_by_name(
                (void *) sc->packet_context_fc, "events_discarded");
        if (fc) {
-               if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE_STR("Invalid packet context field class: "
                                "`events_discarded` member is not an integer field class.");
                        goto invalid;
@@ -98,8 +98,8 @@ int validate_stream_class(struct ctf_stream_class *sc)
        fc = ctf_field_class_struct_borrow_member_field_class_by_name(
                (void *) sc->packet_context_fc, "packet_seq_num");
        if (fc) {
-               if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE_STR("Invalid packet context field class: "
                                "`packet_seq_num` member is not an integer field class.");
                        goto invalid;
@@ -117,8 +117,8 @@ int validate_stream_class(struct ctf_stream_class *sc)
        fc = ctf_field_class_struct_borrow_member_field_class_by_name(
                (void *) sc->packet_context_fc, "packet_size");
        if (fc) {
-               if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE_STR("Invalid packet context field class: "
                                "`packet_size` member is not an integer field class.");
                        goto invalid;
@@ -138,8 +138,8 @@ int validate_stream_class(struct ctf_stream_class *sc)
        fc = ctf_field_class_struct_borrow_member_field_class_by_name(
                (void *) sc->packet_context_fc, "content_size");
        if (fc) {
-               if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE_STR("Invalid packet context field class: "
                                "`content_size` member is not an integer field class.");
                        goto invalid;
@@ -166,8 +166,8 @@ int validate_stream_class(struct ctf_stream_class *sc)
        fc = ctf_field_class_struct_borrow_member_field_class_by_name(
                (void *) sc->event_header_fc, "id");
        if (fc) {
-               if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        BT_LOGE_STR("Invalid event header field class: "
                                "`id` member is not an integer field class.");
                        goto invalid;
@@ -222,8 +222,8 @@ int ctf_trace_class_validate(struct ctf_trace_class *ctf_tc)
                                goto invalid;
                        }
 
-                       if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                                       fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+                       if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                                       fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                                BT_LOGE_STR("Invalid packet header field class: "
                                        "`magic` member is not an integer field class.");
                                goto invalid;
@@ -247,8 +247,8 @@ int ctf_trace_class_validate(struct ctf_trace_class *ctf_tc)
                fc = ctf_field_class_struct_borrow_member_field_class_by_name(
                        (void *) ctf_tc->packet_header_fc, "stream_id");
                if (fc) {
-                       if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                                       fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+                       if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                                       fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                                BT_LOGE_STR("Invalid packet header field class: "
                                        "`stream_id` member is not an integer field class.");
                                goto invalid;
@@ -274,8 +274,8 @@ int ctf_trace_class_validate(struct ctf_trace_class *ctf_tc)
                        (void *) ctf_tc->packet_header_fc,
                        "stream_instance_id");
                if (fc) {
-                       if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                                       fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+                       if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                                       fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                                BT_LOGE_STR("Invalid packet header field class: "
                                        "`stream_instance_id` member is not an integer field class.");
                                goto invalid;
@@ -295,7 +295,7 @@ int ctf_trace_class_validate(struct ctf_trace_class *ctf_tc)
                if (fc) {
                        struct ctf_field_class_array *array_fc = (void *) fc;
 
-                       if (fc->id != CTF_FIELD_CLASS_ID_ARRAY) {
+                       if (fc->type != CTF_FIELD_CLASS_TYPE_ARRAY) {
                                BT_LOGE_STR("Invalid packet header field class: "
                                        "`uuid` member is not an array field class.");
                                goto invalid;
@@ -309,7 +309,7 @@ int ctf_trace_class_validate(struct ctf_trace_class *ctf_tc)
                                goto invalid;
                        }
 
-                       if (array_fc->base.elem_fc->id != CTF_FIELD_CLASS_ID_INT) {
+                       if (array_fc->base.elem_fc->type != CTF_FIELD_CLASS_TYPE_INT) {
                                BT_LOGE_STR("Invalid packet header field class: "
                                        "`uuid` member's element field class is not "
                                        "an integer field class.");
index 4957a94b11aa45bd3dc7ffd68c64aac3dc366757..60b9e0c62f40181968861b425a1950db6f53a8e2 100644 (file)
 #include <stdint.h>
 #include <string.h>
 
-enum ctf_field_class_id {
-       CTF_FIELD_CLASS_ID_INT,
-       CTF_FIELD_CLASS_ID_ENUM,
-       CTF_FIELD_CLASS_ID_FLOAT,
-       CTF_FIELD_CLASS_ID_STRING,
-       CTF_FIELD_CLASS_ID_STRUCT,
-       CTF_FIELD_CLASS_ID_ARRAY,
-       CTF_FIELD_CLASS_ID_SEQUENCE,
-       CTF_FIELD_CLASS_ID_VARIANT,
+enum ctf_field_class_type {
+       CTF_FIELD_CLASS_TYPE_INT,
+       CTF_FIELD_CLASS_TYPE_ENUM,
+       CTF_FIELD_CLASS_TYPE_FLOAT,
+       CTF_FIELD_CLASS_TYPE_STRING,
+       CTF_FIELD_CLASS_TYPE_STRUCT,
+       CTF_FIELD_CLASS_TYPE_ARRAY,
+       CTF_FIELD_CLASS_TYPE_SEQUENCE,
+       CTF_FIELD_CLASS_TYPE_VARIANT,
 };
 
 enum ctf_field_class_meaning {
@@ -60,7 +60,7 @@ enum ctf_encoding {
 };
 
 struct ctf_field_class {
-       enum ctf_field_class_id id;
+       enum ctf_field_class_type type;
        unsigned int alignment;
        bool is_compound;
        bool in_ir;
@@ -277,27 +277,27 @@ static inline
 void ctf_field_class_destroy(struct ctf_field_class *fc);
 
 static inline
-void _ctf_field_class_init(struct ctf_field_class *fc, enum ctf_field_class_id id,
-               unsigned int alignment)
+void _ctf_field_class_init(struct ctf_field_class *fc,
+               enum ctf_field_class_type type, unsigned int alignment)
 {
        BT_ASSERT(fc);
-       fc->id = id;
+       fc->type = type;
        fc->alignment = alignment;
        fc->in_ir = false;
 }
 
 static inline
 void _ctf_field_class_bit_array_init(struct ctf_field_class_bit_array *fc,
-               enum ctf_field_class_id id)
+               enum ctf_field_class_type type)
 {
-       _ctf_field_class_init((void *) fc, id, 1);
+       _ctf_field_class_init((void *) fc, type, 1);
 }
 
 static inline
 void _ctf_field_class_int_init(struct ctf_field_class_int *fc,
-               enum ctf_field_class_id id)
+               enum ctf_field_class_type type)
 {
-       _ctf_field_class_bit_array_init((void *) fc, id);
+       _ctf_field_class_bit_array_init((void *) fc, type);
        fc->meaning = CTF_FIELD_CLASS_MEANING_NONE;
        fc->storing_index = -1;
 }
@@ -366,7 +366,7 @@ struct ctf_field_class_int *ctf_field_class_int_create(void)
        struct ctf_field_class_int *fc = g_new0(struct ctf_field_class_int, 1);
 
        BT_ASSERT(fc);
-       _ctf_field_class_int_init(fc, CTF_FIELD_CLASS_ID_INT);
+       _ctf_field_class_int_init(fc, CTF_FIELD_CLASS_TYPE_INT);
        return fc;
 }
 
@@ -377,7 +377,7 @@ struct ctf_field_class_float *ctf_field_class_float_create(void)
                g_new0(struct ctf_field_class_float, 1);
 
        BT_ASSERT(fc);
-       _ctf_field_class_bit_array_init((void *) fc, CTF_FIELD_CLASS_ID_FLOAT);
+       _ctf_field_class_bit_array_init((void *) fc, CTF_FIELD_CLASS_TYPE_FLOAT);
        return fc;
 }
 
@@ -388,7 +388,7 @@ struct ctf_field_class_string *ctf_field_class_string_create(void)
                g_new0(struct ctf_field_class_string, 1);
 
        BT_ASSERT(fc);
-       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_ID_STRING, 8);
+       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_TYPE_STRING, 8);
        return fc;
 }
 
@@ -398,7 +398,7 @@ struct ctf_field_class_enum *ctf_field_class_enum_create(void)
        struct ctf_field_class_enum *fc = g_new0(struct ctf_field_class_enum, 1);
 
        BT_ASSERT(fc);
-       _ctf_field_class_int_init((void *) fc, CTF_FIELD_CLASS_ID_ENUM);
+       _ctf_field_class_int_init((void *) fc, CTF_FIELD_CLASS_TYPE_ENUM);
        fc->mappings = g_array_new(FALSE, TRUE,
                sizeof(struct ctf_field_class_enum_mapping));
        BT_ASSERT(fc->mappings);
@@ -412,7 +412,7 @@ struct ctf_field_class_struct *ctf_field_class_struct_create(void)
                g_new0(struct ctf_field_class_struct, 1);
 
        BT_ASSERT(fc);
-       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_ID_STRUCT, 1);
+       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_TYPE_STRUCT, 1);
        fc->members = g_array_new(FALSE, TRUE,
                sizeof(struct ctf_named_field_class));
        BT_ASSERT(fc->members);
@@ -427,7 +427,7 @@ struct ctf_field_class_variant *ctf_field_class_variant_create(void)
                g_new0(struct ctf_field_class_variant, 1);
 
        BT_ASSERT(fc);
-       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_ID_VARIANT, 1);
+       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_TYPE_VARIANT, 1);
        fc->options = g_array_new(FALSE, TRUE,
                sizeof(struct ctf_named_field_class));
        BT_ASSERT(fc->options);
@@ -448,7 +448,7 @@ struct ctf_field_class_array *ctf_field_class_array_create(void)
                g_new0(struct ctf_field_class_array, 1);
 
        BT_ASSERT(fc);
-       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_ID_ARRAY, 1);
+       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_TYPE_ARRAY, 1);
        fc->base.base.is_compound = true;
        return fc;
 }
@@ -460,7 +460,7 @@ struct ctf_field_class_sequence *ctf_field_class_sequence_create(void)
                g_new0(struct ctf_field_class_sequence, 1);
 
        BT_ASSERT(fc);
-       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_ID_SEQUENCE, 1);
+       _ctf_field_class_init((void *) fc, CTF_FIELD_CLASS_TYPE_SEQUENCE, 1);
        fc->length_ref = g_string_new(NULL);
        BT_ASSERT(fc->length_ref);
        ctf_field_path_init(&fc->length_path);
@@ -602,29 +602,29 @@ void ctf_field_class_destroy(struct ctf_field_class *fc)
                return;
        }
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_INT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
                _ctf_field_class_int_destroy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_ENUM:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
                _ctf_field_class_enum_destroy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_FLOAT:
+       case CTF_FIELD_CLASS_TYPE_FLOAT:
                _ctf_field_class_float_destroy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_STRING:
+       case CTF_FIELD_CLASS_TYPE_STRING:
                _ctf_field_class_string_destroy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
                _ctf_field_class_struct_destroy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
                _ctf_field_class_array_destroy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
                _ctf_field_class_sequence_destroy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
                _ctf_field_class_variant_destroy((void *) fc);
                break;
        default:
@@ -730,8 +730,8 @@ ctf_field_class_struct_borrow_member_int_field_class_by_name(
                goto end;
        }
 
-       if (int_fc->base.base.id != CTF_FIELD_CLASS_ID_INT &&
-                       int_fc->base.base.id != CTF_FIELD_CLASS_ID_ENUM) {
+       if (int_fc->base.base.type != CTF_FIELD_CLASS_TYPE_INT &&
+                       int_fc->base.base.type != CTF_FIELD_CLASS_TYPE_ENUM) {
                int_fc = NULL;
                goto end;
        }
@@ -865,8 +865,8 @@ struct ctf_field_class *ctf_field_class_compound_borrow_field_class_by_index(
 {
        struct ctf_field_class *fc = NULL;
 
-       switch (comp_fc->id) {
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       switch (comp_fc->type) {
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_named_field_class *named_fc =
                        ctf_field_class_struct_borrow_member_by_index(
@@ -876,7 +876,7 @@ struct ctf_field_class *ctf_field_class_compound_borrow_field_class_by_index(
                fc = named_fc->fc;
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_named_field_class *named_fc =
                        ctf_field_class_variant_borrow_option_by_index(
@@ -886,8 +886,8 @@ struct ctf_field_class *ctf_field_class_compound_borrow_field_class_by_index(
                fc = named_fc->fc;
                break;
        }
-       case CTF_FIELD_CLASS_ID_ARRAY:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
        {
                struct ctf_field_class_array_base *array_fc = (void *) comp_fc;
 
@@ -906,23 +906,23 @@ uint64_t ctf_field_class_compound_get_field_class_count(struct ctf_field_class *
 {
        uint64_t field_count;
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_field_class_struct *struct_fc = (void *) fc;
 
                field_count = struct_fc->members->len;
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
 
                field_count = var_fc->options->len;
                break;
        }
-       case CTF_FIELD_CLASS_ID_ARRAY:
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
                /*
                 * Array and sequence types always contain a single
                 * member (the element type).
@@ -943,8 +943,8 @@ int64_t ctf_field_class_compound_get_field_class_index_from_name(
        int64_t ret_index = -1;
        uint64_t i;
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
        {
                struct ctf_field_class_struct *struct_fc = (void *) fc;
 
@@ -961,7 +961,7 @@ int64_t ctf_field_class_compound_get_field_class_index_from_name(
 
                break;
        }
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
        {
                struct ctf_field_class_variant *var_fc = (void *) fc;
 
@@ -1293,36 +1293,36 @@ struct ctf_field_class *ctf_field_class_copy(struct ctf_field_class *fc)
         */
        BT_ASSERT(!fc->ir_fc);
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_INT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
                copy_fc = (void *) _ctf_field_class_int_copy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_ENUM:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
                copy_fc = (void *) _ctf_field_class_enum_copy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_FLOAT:
+       case CTF_FIELD_CLASS_TYPE_FLOAT:
                copy_fc = (void *) _ctf_field_class_float_copy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_STRING:
+       case CTF_FIELD_CLASS_TYPE_STRING:
                copy_fc = (void *) _ctf_field_class_string_copy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
                copy_fc = (void *) _ctf_field_class_struct_copy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
                copy_fc = (void *) _ctf_field_class_array_copy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
                copy_fc = (void *) _ctf_field_class_sequence_copy((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
                copy_fc = (void *) _ctf_field_class_variant_copy((void *) fc);
                break;
        default:
                abort();
        }
 
-       copy_fc->id = fc->id;
+       copy_fc->type = fc->type;
        copy_fc->alignment = fc->alignment;
        copy_fc->in_ir = fc->in_ir;
 
@@ -1412,11 +1412,11 @@ void ctf_stream_class_append_event_class(struct ctf_stream_class *sc,
 
 static inline
 struct ctf_event_class *ctf_stream_class_borrow_event_class_by_id(
-               struct ctf_stream_class *sc, uint64_t id)
+               struct ctf_stream_class *sc, uint64_t type)
 {
        BT_ASSERT(sc);
        return g_hash_table_lookup(sc->event_classes_by_id,
-               GUINT_TO_POINTER((guint) id));
+               GUINT_TO_POINTER((guint) type));
 }
 
 static inline
index 4258781f52d12e7f6677437675f8b2628e2af226..b1519ff5cab233400515447c5e0902521d0828d9 100644 (file)
@@ -1349,7 +1349,7 @@ int visit_field_class_declarator(struct ctx *ctx,
                                goto error;
                        }
 
-                       if (nested_decl->id == CTF_FIELD_CLASS_ID_INT) {
+                       if (nested_decl->type == CTF_FIELD_CLASS_TYPE_INT) {
                                /* Pointer: force integer's base to 16 */
                                struct ctf_field_class_int *int_fc =
                                        (void *) nested_decl;
@@ -1684,7 +1684,7 @@ int visit_field_class_def(struct ctx *ctx, struct ctf_node *cls_specifier_list,
                }
 
                /* Do not allow field class def and alias of untagged variants */
-               if (class_decl->id == CTF_FIELD_CLASS_ID_VARIANT) {
+               if (class_decl->type == CTF_FIELD_CLASS_TYPE_VARIANT) {
                        struct ctf_field_class_variant *var_fc =
                                (void *) class_decl;
 
@@ -1742,7 +1742,7 @@ int visit_field_class_alias(struct ctx *ctx, struct ctf_node *target,
        }
 
        /* Do not allow field class def and alias of untagged variants */
-       if (class_decl->id == CTF_FIELD_CLASS_ID_VARIANT) {
+       if (class_decl->type == CTF_FIELD_CLASS_TYPE_VARIANT) {
                struct ctf_field_class_variant *var_fc = (void *) class_decl;
 
                if (var_fc->tag_path.path->len == 0) {
@@ -2266,9 +2266,9 @@ int visit_enum_decl(struct ctx *ctx, const char *name,
 
                BT_ASSERT(integer_decl);
 
-               if (integer_decl->base.base.id != CTF_FIELD_CLASS_ID_INT) {
+               if (integer_decl->base.base.type != CTF_FIELD_CLASS_TYPE_INT) {
                        BT_LOGE("Container field class for enumeration field class is not an integer field class: "
-                               "fc-id=%d", integer_decl->base.base.id);
+                               "fc-type=%d", integer_decl->base.base.type);
                        ret = -EINVAL;
                        goto error;
                }
@@ -3585,8 +3585,8 @@ int auto_map_field_to_trace_clock_class(struct ctx *ctx,
                goto end;
        }
 
-       if (fc->id != CTF_FIELD_CLASS_ID_INT &&
-                       fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+       if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                       fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                goto end;
        }
 
@@ -3655,12 +3655,12 @@ int auto_map_fields_to_trace_clock_class(struct ctx *ctx,
                goto end;
        }
 
-       if (root_fc->id != CTF_FIELD_CLASS_ID_STRUCT &&
-                       root_fc->id != CTF_FIELD_CLASS_ID_VARIANT) {
+       if (root_fc->type != CTF_FIELD_CLASS_TYPE_STRUCT &&
+                       root_fc->type != CTF_FIELD_CLASS_TYPE_VARIANT) {
                goto end;
        }
 
-       if (root_fc->id == CTF_FIELD_CLASS_ID_STRUCT) {
+       if (root_fc->type == CTF_FIELD_CLASS_TYPE_STRUCT) {
                count = struct_fc->members->len;
        } else {
                count = var_fc->options->len;
@@ -3669,10 +3669,10 @@ int auto_map_fields_to_trace_clock_class(struct ctx *ctx,
        for (i = 0; i < count; i++) {
                struct ctf_named_field_class *named_fc = NULL;
 
-               if (root_fc->id == CTF_FIELD_CLASS_ID_STRUCT) {
+               if (root_fc->type == CTF_FIELD_CLASS_TYPE_STRUCT) {
                        named_fc = ctf_field_class_struct_borrow_member_by_index(
                                struct_fc, i);
-               } else if (root_fc->id == CTF_FIELD_CLASS_ID_VARIANT) {
+               } else if (root_fc->type == CTF_FIELD_CLASS_TYPE_VARIANT) {
                        named_fc = ctf_field_class_variant_borrow_option_by_index(
                                var_fc, i);
                }
@@ -3931,8 +3931,8 @@ int visit_stream_decl(struct ctx *ctx, struct ctf_node *node)
                        goto error;
                }
 
-               if (named_fc->fc->id != CTF_FIELD_CLASS_ID_INT &&
-                               named_fc->fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+               if (named_fc->fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                               named_fc->fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                        _BT_LOGE_NODE(node,
                                "Stream class has a `id` attribute, "
                                "but trace's packet header field class's `stream_id` field is not an integer field class.");
index 26e86406bec3dc802cfd2d692307161b6bbeb33b..e7f2e079e1c4435b7d35b0dd9644033ceae65615 100644 (file)
@@ -1683,8 +1683,8 @@ struct bt_field *borrow_next_field(struct bt_notif_iter *notit)
        base_fc = bt_field_borrow_class(base_field);
        BT_ASSERT(base_fc);
 
-       switch (bt_field_class_get_id(base_fc)) {
-       case BT_FIELD_CLASS_ID_STRUCTURE:
+       switch (bt_field_class_get_type(base_fc)) {
+       case BT_FIELD_CLASS_TYPE_STRUCTURE:
        {
                BT_ASSERT(index <
                        bt_field_class_structure_get_member_count(
@@ -1693,13 +1693,13 @@ struct bt_field *borrow_next_field(struct bt_notif_iter *notit)
                        base_field, index);
                break;
        }
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
                BT_ASSERT(index < bt_field_array_get_length(base_field));
                next_field = bt_field_array_borrow_element_field_by_index(
                        base_field, index);
                break;
-       case BT_FIELD_CLASS_ID_VARIANT:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
                BT_ASSERT(index == 0);
                next_field = bt_field_variant_borrow_selected_option_field(
                        base_field);
@@ -1765,8 +1765,8 @@ enum bt_bfcr_status bfcr_unsigned_int_cb(uint64_t value,
 
        BT_LOGV("Unsigned integer function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d, value=%" PRIu64,
-               notit, notit->bfcr, fc, fc->id, fc->in_ir, value);
+               "fc-type=%d, fc-in-ir=%d, value=%" PRIu64,
+               notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
 
        if (likely(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE)) {
                goto update_def_clock;
@@ -1830,8 +1830,8 @@ update_def_clock:
        field = borrow_next_field(notit);
        BT_ASSERT(field);
        BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
-       BT_ASSERT(bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_UNSIGNED_INTEGER ||
-               bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION);
+       BT_ASSERT(bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
+               bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
        bt_field_unsigned_integer_set_value(field, value);
        stack_top(notit->stack)->index++;
 
@@ -1852,8 +1852,8 @@ enum bt_bfcr_status bfcr_unsigned_int_char_cb(uint64_t value,
 
        BT_LOGV("Unsigned integer character function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d, value=%" PRIu64,
-               notit, notit->bfcr, fc, fc->id, fc->in_ir, value);
+               "fc-type=%d, fc-in-ir=%d, value=%" PRIu64,
+               notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
        BT_ASSERT(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
        BT_ASSERT(!int_fc->mapped_clock_class);
        BT_ASSERT(int_fc->storing_index < 0);
@@ -1872,7 +1872,7 @@ enum bt_bfcr_status bfcr_unsigned_int_char_cb(uint64_t value,
        }
 
        string_field = stack_top(notit->stack)->base;
-       BT_ASSERT(bt_field_get_class_id(string_field) == BT_FIELD_CLASS_ID_STRING);
+       BT_ASSERT(bt_field_get_class_type(string_field) == BT_FIELD_CLASS_TYPE_STRING);
 
        /* Append character */
        str[0] = (char) value;
@@ -1900,8 +1900,8 @@ enum bt_bfcr_status bfcr_signed_int_cb(int64_t value,
 
        BT_LOGV("Signed integer function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d, value=%" PRId64,
-               notit, notit->bfcr, fc, fc->id, fc->in_ir, value);
+               "fc-type=%d, fc-in-ir=%d, value=%" PRId64,
+               notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
        BT_ASSERT(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
 
        if (unlikely(int_fc->storing_index >= 0)) {
@@ -1916,8 +1916,8 @@ enum bt_bfcr_status bfcr_signed_int_cb(int64_t value,
        field = borrow_next_field(notit);
        BT_ASSERT(field);
        BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
-       BT_ASSERT(bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_SIGNED_INTEGER ||
-               bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_SIGNED_ENUMERATION);
+       BT_ASSERT(bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
+               bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
        bt_field_signed_integer_set_value(field, value);
        stack_top(notit->stack)->index++;
 
@@ -1935,13 +1935,13 @@ enum bt_bfcr_status bfcr_floating_point_cb(double value,
 
        BT_LOGV("Floating point number function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d, value=%f",
-               notit, notit->bfcr, fc, fc->id, fc->in_ir, value);
+               "fc-type=%d, fc-in-ir=%d, value=%f",
+               notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
        BT_ASSERT(fc->in_ir);
        field = borrow_next_field(notit);
        BT_ASSERT(field);
        BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
-       BT_ASSERT(bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_REAL);
+       BT_ASSERT(bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_REAL);
        bt_field_real_set_value(field, value);
        stack_top(notit->stack)->index++;
        return status;
@@ -1957,14 +1957,14 @@ enum bt_bfcr_status bfcr_string_begin_cb(
 
        BT_LOGV("String (beginning) function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d",
-               notit, notit->bfcr, fc, fc->id, fc->in_ir);
+               "fc-type=%d, fc-in-ir=%d",
+               notit, notit->bfcr, fc, fc->type, fc->in_ir);
 
        BT_ASSERT(fc->in_ir);
        field = borrow_next_field(notit);
        BT_ASSERT(field);
        BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
-       BT_ASSERT(bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_STRING);
+       BT_ASSERT(bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_STRING);
        ret = bt_field_string_clear(field);
        BT_ASSERT(ret == 0);
 
@@ -1988,8 +1988,8 @@ enum bt_bfcr_status bfcr_string_cb(const char *value,
 
        BT_LOGV("String (substring) function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d, string-length=%zu",
-               notit, notit->bfcr, fc, fc->id, fc->in_ir,
+               "fc-type=%d, fc-in-ir=%d, string-length=%zu",
+               notit, notit->bfcr, fc, fc->type, fc->in_ir,
                len);
        BT_ASSERT(fc->in_ir);
        field = stack_top(notit->stack)->base;
@@ -2017,8 +2017,8 @@ enum bt_bfcr_status bfcr_string_end_cb(
 
        BT_LOGV("String (end) function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d",
-               notit, notit->bfcr, fc, fc->id, fc->in_ir);
+               "fc-type=%d, fc-in-ir=%d",
+               notit, notit->bfcr, fc, fc->type, fc->in_ir);
        BT_ASSERT(fc->in_ir);
 
        /* Pop string field */
@@ -2037,8 +2037,8 @@ enum bt_bfcr_status bfcr_compound_begin_cb(
 
        BT_LOGV("Compound (beginning) function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d",
-               notit, notit->bfcr, fc, fc->id, fc->in_ir);
+               "fc-type=%d, fc-in-ir=%d",
+               notit, notit->bfcr, fc, fc->type, fc->in_ir);
 
        if (!fc->in_ir) {
                goto end;
@@ -2062,15 +2062,15 @@ enum bt_bfcr_status bfcr_compound_begin_cb(
         * Change BFCR "unsigned int" callback if it's a text
         * array/sequence.
         */
-       if (fc->id == CTF_FIELD_CLASS_ID_ARRAY ||
-                       fc->id == CTF_FIELD_CLASS_ID_SEQUENCE) {
+       if (fc->type == CTF_FIELD_CLASS_TYPE_ARRAY ||
+                       fc->type == CTF_FIELD_CLASS_TYPE_SEQUENCE) {
                struct ctf_field_class_array_base *array_fc = (void *) fc;
 
                if (array_fc->is_text) {
                        int ret;
 
-                       BT_ASSERT(bt_field_get_class_id(field) ==
-                               BT_FIELD_CLASS_ID_STRING);
+                       BT_ASSERT(bt_field_get_class_type(field) ==
+                               BT_FIELD_CLASS_TYPE_STRING);
                        notit->done_filling_string = false;
                        ret = bt_field_string_clear(field);
                        BT_ASSERT(ret == 0);
@@ -2090,8 +2090,8 @@ enum bt_bfcr_status bfcr_compound_end_cb(
 
        BT_LOGV("Compound (end) function called from BFCR: "
                "notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
-               "fc-id=%d, fc-in-ir=%d",
-               notit, notit->bfcr, fc, fc->id, fc->in_ir);
+               "fc-type=%d, fc-in-ir=%d",
+               notit, notit->bfcr, fc, fc->type, fc->in_ir);
 
        if (!fc->in_ir) {
                goto end;
@@ -2105,14 +2105,14 @@ enum bt_bfcr_status bfcr_compound_end_cb(
         * Reset BFCR "unsigned int" callback if it's a text
         * array/sequence.
         */
-       if (fc->id == CTF_FIELD_CLASS_ID_ARRAY ||
-                       fc->id == CTF_FIELD_CLASS_ID_SEQUENCE) {
+       if (fc->type == CTF_FIELD_CLASS_TYPE_ARRAY ||
+                       fc->type == CTF_FIELD_CLASS_TYPE_SEQUENCE) {
                struct ctf_field_class_array_base *array_fc = (void *) fc;
 
                if (array_fc->is_text) {
-                       BT_ASSERT(bt_field_get_class_id(
+                       BT_ASSERT(bt_field_get_class_type(
                                stack_top(notit->stack)->base) ==
-                                       BT_FIELD_CLASS_ID_STRING);
+                                       BT_FIELD_CLASS_TYPE_STRING);
                        bt_bfcr_set_unsigned_int_cb(notit->bfcr,
                                bfcr_unsigned_int_cb);
                }
index 310550b89a5b4d7b1d22f37d635629df1af74765..0d85507535e1c2c57d38805bdc81f8f3fc005664 100644 (file)
@@ -85,7 +85,7 @@ struct bt_field *get_payload_field(FILE *err,
        payload_class = bt_field_get_class(payload);
        BT_ASSERT(payload_class);
 
-       if (bt_field_class_id(payload_class) != BT_FIELD_CLASS_ID_STRUCT) {
+       if (bt_field_class_id(payload_class) != BT_FIELD_CLASS_TYPE_STRUCT) {
                BT_LOGE("Wrong type, expected struct: field-name=\"%s\"",
                                field_name);
                goto end;
@@ -114,7 +114,7 @@ struct bt_field *get_stream_event_context_field(FILE *err,
        sec_class = bt_field_get_class(sec);
        BT_ASSERT(sec_class);
 
-       if (bt_field_class_id(sec_class) != BT_FIELD_CLASS_ID_STRUCT) {
+       if (bt_field_class_id(sec_class) != BT_FIELD_CLASS_TYPE_STRUCT) {
                BT_LOGE("Wrong type, expected struct, field-name=\"%s\"",
                                field_name);
                goto end;
@@ -145,7 +145,7 @@ int get_stream_event_context_unsigned_int_field_value(FILE *err,
        field_class = bt_field_get_class(field);
        BT_ASSERT(field_class);
 
-       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_ID_INTEGER) {
+       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_TYPE_INTEGER) {
                BT_LOGE("Wrong type, expected integer: field-name=\"%s\"",
                                field_name);
                goto error;
@@ -189,7 +189,7 @@ int get_stream_event_context_int_field_value(FILE *err, struct bt_event *event,
        field_class = bt_field_get_class(field);
        BT_ASSERT(field_class);
 
-       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_ID_INTEGER) {
+       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_TYPE_INTEGER) {
                BT_LOGE("Wrong type, expected integer: field-name=\"%s\"", field_name);
                goto error;
        }
@@ -229,7 +229,7 @@ int get_payload_unsigned_int_field_value(FILE *err,
        field_class = bt_field_get_class(field);
        BT_ASSERT(field_class);
 
-       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_ID_INTEGER) {
+       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_TYPE_INTEGER) {
                BT_LOGE("Wrong type, expected integer: field-name=\"%s\"",
                                field_name);
                goto error;
@@ -274,7 +274,7 @@ int get_payload_int_field_value(FILE *err, struct bt_event *event,
        field_class = bt_field_get_class(field);
        BT_ASSERT(field_class);
 
-       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_ID_INTEGER) {
+       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_TYPE_INTEGER) {
                BT_LOGE("Wrong type, expected integer: field-name=\"%s\"", field_name);
                goto error;
        }
@@ -321,7 +321,7 @@ int get_payload_string_field_value(FILE *err,
        field_class = bt_field_get_class(field);
        BT_ASSERT(field_class);
 
-       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_ID_STRING) {
+       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_TYPE_STRING) {
                BT_LOGE("Wrong type, expected string: field-name=\"%s\"",
                                field_name);
                goto error;
@@ -367,7 +367,7 @@ int get_payload_build_id_field_value(FILE *err,
        field_class = bt_field_get_class(field);
        BT_ASSERT(field_class);
 
-       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_ID_SEQUENCE) {
+       if (bt_field_class_id(field_class) != BT_FIELD_CLASS_TYPE_SEQUENCE) {
                BT_LOGE("Wrong type, expected sequence: field-name=\"%s\"", field_name);
                goto error;
        }
@@ -1597,7 +1597,7 @@ int copy_set_debug_info_stream_event_context(FILE *err,
         * If it is not a structure, we did not modify it to add the debug info
         * fields, so just assign it as is.
         */
-       if (bt_field_class_id(writer_event_context_class) != BT_FIELD_CLASS_ID_STRUCT) {
+       if (bt_field_class_id(writer_event_context_class) != BT_FIELD_CLASS_TYPE_STRUCT) {
                ret = bt_event_set_event_context(writer_event, event_context);
                goto end;
        }
index 921c28d8c6ec778968df53a201a06aea42a58708..f4f7a5868c08eb970deba6dd699370ec3c989b08 100644 (file)
@@ -556,13 +556,13 @@ enum bt_component_status print_integer(struct pretty_component *pretty,
                int64_t s;
        } v;
        bool rst_color = false;
-       enum bt_field_class_id ft_id;
+       enum bt_field_class_type ft_type;
 
        int_fc = bt_field_borrow_class(field);
        BT_ASSERT(int_fc);
-       ft_id = bt_field_get_class_id(field);
-       if (ft_id == BT_FIELD_CLASS_ID_UNSIGNED_INTEGER ||
-                       ft_id == BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION) {
+       ft_type = bt_field_get_class_type(field);
+       if (ft_type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
+                       ft_type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION) {
                v.u = bt_field_unsigned_integer_get_value(field);
        } else {
                v.s = bt_field_signed_integer_get_value(field);
@@ -590,8 +590,8 @@ enum bt_component_status print_integer(struct pretty_component *pretty,
        }
        case BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL:
        {
-               if (ft_id == BT_FIELD_CLASS_ID_SIGNED_INTEGER ||
-                               ft_id == BT_FIELD_CLASS_ID_SIGNED_ENUMERATION) {
+               if (ft_type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
+                               ft_type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION) {
                        int len;
 
                        len = bt_field_class_integer_get_field_value_range(
@@ -610,8 +610,8 @@ enum bt_component_status print_integer(struct pretty_component *pretty,
                break;
        }
        case BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL:
-               if (ft_id == BT_FIELD_CLASS_ID_UNSIGNED_INTEGER ||
-                               ft_id == BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION) {
+               if (ft_type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
+                               ft_type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION) {
                        g_string_append_printf(pretty->string, "%" PRIu64, v.u);
                } else {
                        g_string_append_printf(pretty->string, "%" PRId64, v.s);
@@ -727,12 +727,12 @@ enum bt_component_status print_enum(struct pretty_component *pretty,
                goto end;
        }
 
-       switch (bt_field_get_class_id(field)) {
-       case BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION:
+       switch (bt_field_get_class_type(field)) {
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
                ret = bt_field_unsigned_enumeration_get_mapping_labels(field,
                        &label_array, &label_count);
                break;
-       case BT_FIELD_CLASS_ID_SIGNED_ENUMERATION:
+       case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION:
                ret = bt_field_signed_enumeration_get_mapping_labels(field,
                        &label_array, &label_count);
                break;
@@ -1010,14 +1010,14 @@ enum bt_component_status print_field(struct pretty_component *pretty,
                struct bt_field *field, bool print_names,
                GQuark *filter_fields, int filter_array_len)
 {
-       enum bt_field_class_id class_id;
+       enum bt_field_class_type class_id;
 
-       class_id = bt_field_get_class_id(field);
+       class_id = bt_field_get_class_type(field);
        switch (class_id) {
-       case BT_FIELD_CLASS_ID_UNSIGNED_INTEGER:
-       case BT_FIELD_CLASS_ID_SIGNED_INTEGER:
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
+       case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
                return print_integer(pretty, field);
-       case BT_FIELD_CLASS_ID_REAL:
+       case BT_FIELD_CLASS_TYPE_REAL:
        {
                double v;
 
@@ -1031,10 +1031,10 @@ enum bt_component_status print_field(struct pretty_component *pretty,
                }
                return BT_COMPONENT_STATUS_OK;
        }
-       case BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION:
-       case BT_FIELD_CLASS_ID_SIGNED_ENUMERATION:
+       case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
+       case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION:
                return print_enum(pretty, field);
-       case BT_FIELD_CLASS_ID_STRING:
+       case BT_FIELD_CLASS_TYPE_STRING:
        {
                const char *str;
 
@@ -1052,14 +1052,14 @@ enum bt_component_status print_field(struct pretty_component *pretty,
                }
                return BT_COMPONENT_STATUS_OK;
        }
-       case BT_FIELD_CLASS_ID_STRUCTURE:
+       case BT_FIELD_CLASS_TYPE_STRUCTURE:
                return print_struct(pretty, field, print_names, filter_fields,
                                filter_array_len);
-       case BT_FIELD_CLASS_ID_VARIANT:
+       case BT_FIELD_CLASS_TYPE_VARIANT:
                return print_variant(pretty, field, print_names);
-       case BT_FIELD_CLASS_ID_STATIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
                return print_array(pretty, field, print_names);
-       case BT_FIELD_CLASS_ID_DYNAMIC_ARRAY:
+       case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
                return print_sequence(pretty, field, print_names);
        default:
                // TODO: log instead
index 0b666b35e568303cd748e62afc891f06d48cd148..061e9a84d3f069baeac9b29e640b9addde36b395 100644 (file)
@@ -119,7 +119,7 @@ enum bt_component_status update_packet_context_field(FILE *err,
                        continue;
                }
                if (bt_field_class_id(field_class) !=
-                               BT_FIELD_CLASS_ID_INTEGER) {
+                               BT_FIELD_CLASS_TYPE_INTEGER) {
                        BT_LOGE("Expecting an integer for this field: field-name=\"%s\"",
                                        name);
                        goto error;
This page took 0.121617 seconds and 4 git commands to generate.