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)";
}
#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), \
struct bt_field_class {
struct bt_object base;
- enum bt_field_class_id id;
+ enum bt_field_class_type type;
bool frozen;
/*
};
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
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 {
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);
#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) \
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);
/* 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
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);
{
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,
{
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));
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;
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;
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;
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;
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;
break;
}
- case BT_FIELD_CLASS_ID_VARIANT:
+ case BT_FIELD_CLASS_TYPE_VARIANT:
{
struct bt_field_class_variant *var_fc = (void *) field_class;
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;
}
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;
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;
break;
}
- case BT_FIELD_CLASS_ID_VARIANT:
+ case BT_FIELD_CLASS_TYPE_VARIANT:
{
struct bt_field_variant *var_field = (void *) field;
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(
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(
#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;
}
}
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;
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(
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 "
}
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));
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)
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;
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;
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);
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);
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: "
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: "
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;
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;
}
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: "
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) {
}
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;
}
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);
}
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;
}
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);
}
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);
}
}
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;
}
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;
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);
}
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);
}
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;
}
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);
}
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);
}
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);
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;
}
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;
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");
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;
}
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;
"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;
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;
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
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)
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
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);
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;
}
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 ||
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);
}
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);
}
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;
}
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;
}
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,
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,
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;
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)) {
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];
}
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,
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;
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];
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;
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
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;
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;
{
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);
*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;
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;
}
break;
}
- if (prev_fc->id != BT_FIELD_CLASS_ID_STRUCTURE) {
+ if (prev_fc->type != BT_FIELD_CLASS_TYPE_STRUCTURE) {
is_valid = false;
}
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;
}
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;
break;
}
- case BT_FIELD_CLASS_ID_VARIANT:
+ case BT_FIELD_CLASS_TYPE_VARIANT:
{
struct bt_field_class_variant *var_fc = (void *) 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;
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;
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 =
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 =
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 =
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);
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) {
{
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;
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;
}
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:
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:
}
/* 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;
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(
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;
}
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 =
/*
* 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;
}
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;
}
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;
}
/* 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;
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;
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: "
}
/* 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 =
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 {
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:
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)) {
/*
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;
}
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;
break;
}
- case CTF_FIELD_CLASS_ID_STRUCT:
+ case CTF_FIELD_CLASS_TYPE_STRUCT:
{
struct ctf_field_class_struct *struct_fc = (void *) fc;
break;
}
- case CTF_FIELD_CLASS_ID_VARIANT:
+ case CTF_FIELD_CLASS_TYPE_VARIANT:
{
struct ctf_field_class_variant *var_fc = (void *) 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;
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;
break;
}
- case CTF_FIELD_CLASS_ID_STRUCT:
+ case CTF_FIELD_CLASS_TYPE_STRUCT:
{
struct ctf_field_class_struct *struct_fc = (void *) 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;
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 ||
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;
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;
break;
}
- case CTF_FIELD_CLASS_ID_STRUCT:
+ case CTF_FIELD_CLASS_TYPE_STRUCT:
{
struct ctf_field_class_struct *struct_fc = (void *) fc;
break;
}
- case CTF_FIELD_CLASS_ID_VARIANT:
+ case CTF_FIELD_CLASS_TYPE_VARIANT:
{
struct ctf_field_class_variant *var_fc = (void *) 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;
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;
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;
break;
}
- case CTF_FIELD_CLASS_ID_VARIANT:
+ case CTF_FIELD_CLASS_TYPE_VARIANT:
{
struct ctf_field_class_variant *var_fc = (void *) 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;
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;
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;
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;
}
}
- 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;
break;
}
- case CTF_FIELD_CLASS_ID_VARIANT:
+ case CTF_FIELD_CLASS_TYPE_VARIANT:
{
struct ctf_field_class_variant *var_fc = (void *) 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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
(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;
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;
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.");
#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 {
};
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;
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;
}
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;
}
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;
}
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;
}
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);
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);
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);
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;
}
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);
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:
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;
}
{
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(
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(
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;
{
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).
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;
break;
}
- case CTF_FIELD_CLASS_ID_VARIANT:
+ case CTF_FIELD_CLASS_TYPE_VARIANT:
{
struct ctf_field_class_variant *var_fc = (void *) 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;
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
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;
}
/* 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;
}
/* 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) {
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;
}
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;
}
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;
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);
}
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.");
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(
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);
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;
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++;
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);
}
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;
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)) {
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++;
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;
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);
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;
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 */
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;
* 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);
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;
* 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);
}
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;
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;
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;
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;
}
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;
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;
}
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;
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;
}
* 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;
}
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);
}
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(
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);
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;
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;
}
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;
}
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
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;