struct bt_ctf_field_type {
struct bt_object base;
- enum bt_ctf_type_id id;
+ enum bt_ctf_field_type_id id;
unsigned int alignment;
type_freeze_func freeze;
type_serialize_func serialize;
<th>CTF IR field which you can create from this field type
</tr>
<tr>
- <td>#BT_CTF_TYPE_ID_INTEGER
+ <td>#BT_CTF_FIELD_TYPE_ID_INTEGER
<td>\ref ctfirintfieldtype
<td>\ref ctfirintfield
</tr>
<tr>
- <td>#BT_CTF_TYPE_ID_FLOAT
+ <td>#BT_CTF_FIELD_TYPE_ID_FLOAT
<td>\ref ctfirfloatfieldtype
<td>\ref ctfirfloatfield
</tr>
<tr>
- <td>#BT_CTF_TYPE_ID_ENUM
+ <td>#BT_CTF_FIELD_TYPE_ID_ENUM
<td>\ref ctfirenumfieldtype
<td>\ref ctfirenumfield
</tr>
<tr>
- <td>#BT_CTF_TYPE_ID_STRING
+ <td>#BT_CTF_FIELD_TYPE_ID_STRING
<td>\ref ctfirstringfieldtype
<td>\ref ctfirstringfield
</tr>
<tr>
- <td>#BT_CTF_TYPE_ID_STRUCT
+ <td>#BT_CTF_FIELD_TYPE_ID_STRUCT
<td>\ref ctfirstructfieldtype
<td>\ref ctfirstructfield
</tr>
<tr>
- <td>#BT_CTF_TYPE_ID_ARRAY
+ <td>#BT_CTF_FIELD_TYPE_ID_ARRAY
<td>\ref ctfirarrayfieldtype
<td>\ref ctfirarrayfield
</tr>
<tr>
- <td>#BT_CTF_TYPE_ID_SEQUENCE
+ <td>#BT_CTF_FIELD_TYPE_ID_SEQUENCE
<td>\ref ctfirseqfieldtype
<td>\ref ctfirseqfield
</tr>
<tr>
- <td>#BT_CTF_TYPE_ID_VARIANT
+ <td>#BT_CTF_FIELD_TYPE_ID_VARIANT
<td>\ref ctfirvarfieldtype
<td>\ref ctfirvarfield
</tr>
</table>
Each field type has its own <strong>type ID</strong> (see
-#bt_ctf_type_id). You get the type ID of a field type object
+#bt_ctf_field_type_id). You get the type ID of a field type object
with bt_ctf_field_type_get_type_id().
You can get a deep copy of a field type with bt_ctf_field_type_copy().
/*
* Babeltrace 1.x enumerations that were also used in CTF writer's API.
* They are left here for backward compatibility reasons, but
- * enum bt_ctf_type_id and enum bt_ctf_string_encoding should be used
+ * enum bt_ctf_field_type_id and enum bt_ctf_string_encoding should be used
* in new code. Both new enumerations are compatible with their legacy
* counterpart.
*/
/**
@brief Type ID of a @ft.
*/
-enum bt_ctf_type_id {
+enum bt_ctf_field_type_id {
/// Unknown, used for errors.
- BT_CTF_TYPE_ID_UNKNOWN = CTF_TYPE_UNKNOWN,
+ BT_CTF_FIELD_TYPE_ID_UNKNOWN = CTF_TYPE_UNKNOWN,
/// \ref ctfirintfieldtype
- BT_CTF_TYPE_ID_INTEGER = CTF_TYPE_INTEGER,
+ BT_CTF_FIELD_TYPE_ID_INTEGER = CTF_TYPE_INTEGER,
/// \ref ctfirfloatfieldtype
- BT_CTF_TYPE_ID_FLOAT = CTF_TYPE_FLOAT,
+ BT_CTF_FIELD_TYPE_ID_FLOAT = CTF_TYPE_FLOAT,
/// \ref ctfirenumfieldtype
- BT_CTF_TYPE_ID_ENUM = CTF_TYPE_ENUM,
+ BT_CTF_FIELD_TYPE_ID_ENUM = CTF_TYPE_ENUM,
/// \ref ctfirstringfieldtype
- BT_CTF_TYPE_ID_STRING = CTF_TYPE_STRING,
+ BT_CTF_FIELD_TYPE_ID_STRING = CTF_TYPE_STRING,
/// \ref ctfirstructfieldtype
- BT_CTF_TYPE_ID_STRUCT = CTF_TYPE_STRUCT,
+ BT_CTF_FIELD_TYPE_ID_STRUCT = CTF_TYPE_STRUCT,
/// @cond DOCUMENT
BT_CTF_TYPE_ID_UNTAGGED_VARIANT = CTF_TYPE_UNTAGGED_VARIANT,
/// @endcond
/// \ref ctfirarrayfieldtype
- BT_CTF_TYPE_ID_ARRAY = CTF_TYPE_ARRAY,
+ BT_CTF_FIELD_TYPE_ID_ARRAY = CTF_TYPE_ARRAY,
/// \ref ctfirseqfieldtype
- BT_CTF_TYPE_ID_SEQUENCE = CTF_TYPE_SEQUENCE,
+ BT_CTF_FIELD_TYPE_ID_SEQUENCE = CTF_TYPE_SEQUENCE,
/// \ref ctfirvarfieldtype
- BT_CTF_TYPE_ID_VARIANT = CTF_TYPE_VARIANT,
+ BT_CTF_FIELD_TYPE_ID_VARIANT = CTF_TYPE_VARIANT,
/// Number of enumeration entries.
BT_CTF_NR_TYPE_IDS = NR_CTF_TYPES,
@param[in] field_type Field type of which to get the type ID.
@returns Type ID of \p field_type,
- or #BT_CTF_TYPE_ID_UNKNOWN on error.
+ or #BT_CTF_FIELD_TYPE_ID_UNKNOWN on error.
@prenotnull{field_type}
@postrefcountsame{field_type}
-@sa #bt_ctf_type_id: CTF IR field type ID.
+@sa #bt_ctf_field_type_id: CTF IR field type ID.
@sa bt_ctf_field_type_is_integer(): Returns whether or not a given
field type is a @intft.
@sa bt_ctf_field_type_is_floating_point(): Returns whether or not a
@sa bt_ctf_field_type_is_variant(): Returns whether or not a given
field type is a @varft.
*/
-extern enum bt_ctf_type_id bt_ctf_field_type_get_type_id(
+extern enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id(
struct bt_ctf_field_type *field_type);
/**
You can get a reference to the @ft which was used to create a field with
bt_ctf_field_get_type(). You can get the
-\link #bt_ctf_type_id type ID\endlink of this field type directly with
+\link #bt_ctf_field_type_id type ID\endlink of this field type directly with
bt_ctf_field_get_type_id().
You can get a deep copy of a field with bt_ctf_field_copy(). The field
@param[in] field Field of which to get the type ID of its
parent field type..
@returns Type ID of the parent field type of \p field,
- or #BT_CTF_TYPE_ID_UNKNOWN on error.
+ or #BT_CTF_FIELD_TYPE_ID_UNKNOWN on error.
@prenotnull{field}
@postrefcountsame{field}
-@sa #bt_ctf_type_id: CTF IR field type ID.
+@sa #bt_ctf_field_type_id: CTF IR field type ID.
@sa bt_ctf_field_is_integer(): Returns whether or not a given field is a
@intfield.
@sa bt_ctf_field_is_floating_point(): Returns whether or not a given
@sa bt_ctf_field_is_variant(): Returns whether or not a given field is a
@varfield.
*/
-extern enum bt_ctf_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field);
+extern enum bt_ctf_field_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field);
/*
* bt_ctf_field_signed_integer_get_value: get a signed integer field's value
}
if (payload && bt_ctf_field_type_get_type_id(payload) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(event_class->fields) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(event_class->fields) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(event_class->fields) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(event_class->fields) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
goto end;
}
}
if (context && bt_ctf_field_type_get_type_id(context) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(payload_type) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
static
void (* const type_destroy_funcs[])(struct bt_ctf_field_type *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_destroy,
- [BT_CTF_TYPE_ID_ENUM] =
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_destroy,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] =
bt_ctf_field_type_enumeration_destroy,
- [BT_CTF_TYPE_ID_FLOAT] =
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] =
bt_ctf_field_type_floating_point_destroy,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_destroy,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_destroy,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_destroy,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_destroy,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_type_string_destroy,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_destroy,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_destroy,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_destroy,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_destroy,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_type_string_destroy,
};
static
static
type_freeze_func const type_freeze_funcs[] = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_freeze,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_freeze,
- [BT_CTF_TYPE_ID_FLOAT] = generic_field_type_freeze,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_freeze,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_freeze,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_freeze,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_freeze,
- [BT_CTF_TYPE_ID_STRING] = generic_field_type_freeze,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_freeze,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_freeze,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = generic_field_type_freeze,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_freeze,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_freeze,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_freeze,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_freeze,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = generic_field_type_freeze,
};
static
static
type_serialize_func const type_serialize_funcs[] = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_serialize,
- [BT_CTF_TYPE_ID_ENUM] =
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_serialize,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] =
bt_ctf_field_type_enumeration_serialize,
- [BT_CTF_TYPE_ID_FLOAT] =
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] =
bt_ctf_field_type_floating_point_serialize,
- [BT_CTF_TYPE_ID_STRUCT] =
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] =
bt_ctf_field_type_structure_serialize,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_serialize,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_serialize,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_serialize,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_type_string_serialize,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_serialize,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_serialize,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_serialize,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_type_string_serialize,
};
static
static
void (* const set_byte_order_funcs[])(struct bt_ctf_field_type *,
enum bt_ctf_byte_order) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_set_byte_order,
- [BT_CTF_TYPE_ID_ENUM] =
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_set_byte_order,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] =
bt_ctf_field_type_enumeration_set_byte_order,
- [BT_CTF_TYPE_ID_FLOAT] =
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] =
bt_ctf_field_type_floating_point_set_byte_order,
- [BT_CTF_TYPE_ID_STRUCT] =
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] =
bt_ctf_field_type_structure_set_byte_order,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_set_byte_order,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_set_byte_order,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_set_byte_order,
- [BT_CTF_TYPE_ID_STRING] = NULL,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_set_byte_order,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_set_byte_order,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_set_byte_order,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = NULL,
};
static
static
struct bt_ctf_field_type *(* const type_copy_funcs[])(
struct bt_ctf_field_type *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_copy,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_copy,
- [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_type_floating_point_copy,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_copy,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_copy,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_copy,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_copy,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_type_string_copy,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_copy,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_copy,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = bt_ctf_field_type_floating_point_copy,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_copy,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_copy,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_copy,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_copy,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_type_string_copy,
};
static
static
int (* const type_compare_funcs[])(struct bt_ctf_field_type *,
struct bt_ctf_field_type *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_compare,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_compare,
- [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_type_floating_point_compare,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_compare,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_compare,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_compare,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_compare,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_type_string_compare,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_compare,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_compare,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = bt_ctf_field_type_floating_point_compare,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_compare,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_compare,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_compare,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_compare,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_type_string_compare,
};
static
static
int (* const type_validate_funcs[])(struct bt_ctf_field_type *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_validate,
- [BT_CTF_TYPE_ID_FLOAT] = NULL,
- [BT_CTF_TYPE_ID_STRING] = NULL,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_validate,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_validate,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_validate,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_type_array_validate,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_validate,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_validate,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = NULL,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = NULL,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_validate,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_validate,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_type_variant_validate,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_type_array_validate,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_type_sequence_validate,
};
static
static
void bt_ctf_field_type_init(struct bt_ctf_field_type *type, bool init_bo)
{
- assert(type && (type->id > BT_CTF_TYPE_ID_UNKNOWN) &&
+ assert(type && (type->id > BT_CTF_FIELD_TYPE_ID_UNKNOWN) &&
(type->id < BT_CTF_NR_TYPE_IDS));
bt_object_init(type, bt_ctf_field_type_destroy);
void bt_ctf_field_type_destroy(struct bt_object *obj)
{
struct bt_ctf_field_type *type;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
type = container_of(obj, struct bt_ctf_field_type, base);
type_id = type->id;
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN ||
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN ||
type_id >= BT_CTF_NR_TYPE_IDS) {
return;
}
int bt_ctf_field_type_validate(struct bt_ctf_field_type *type)
{
int ret = 0;
- enum bt_ctf_type_id id = bt_ctf_field_type_get_type_id(type);
+ enum bt_ctf_field_type_id id = bt_ctf_field_type_get_type_id(type);
if (!type) {
ret = -1;
return NULL;
}
- integer->parent.id = BT_CTF_TYPE_ID_INTEGER;
+ integer->parent.id = BT_CTF_FIELD_TYPE_ID_INTEGER;
integer->size = size;
integer->base = BT_CTF_INTEGER_BASE_DECIMAL;
integer->encoding = BT_CTF_STRING_ENCODING_NONE;
int ret = 0;
struct bt_ctf_field_type_integer *integer;
- if (!type || type->id != BT_CTF_TYPE_ID_INTEGER) {
+ if (!type || type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
int ret = 0;
struct bt_ctf_field_type_integer *integer;
- if (!type || type->id != BT_CTF_TYPE_ID_INTEGER) {
+ if (!type || type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_integer *integer;
if (!type || type->frozen ||
- type->id != BT_CTF_TYPE_ID_INTEGER) {
+ type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_integer *integer;
if (!type || type->frozen ||
- type->id != BT_CTF_TYPE_ID_INTEGER ||
+ type->id != BT_CTF_FIELD_TYPE_ID_INTEGER ||
!size || size > 64) {
ret = -1;
goto end;
enum bt_ctf_integer_base ret = BT_CTF_INTEGER_BASE_UNKNOWN;
struct bt_ctf_field_type_integer *integer;
- if (!type || type->id != BT_CTF_TYPE_ID_INTEGER) {
+ if (!type || type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
goto end;
}
int ret = 0;
if (!type || type->frozen ||
- type->id != BT_CTF_TYPE_ID_INTEGER) {
+ type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
enum bt_ctf_string_encoding ret = BT_CTF_STRING_ENCODING_UNKNOWN;
struct bt_ctf_field_type_integer *integer;
- if (!type || type->id != BT_CTF_TYPE_ID_INTEGER) {
+ if (!type || type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
goto end;
}
struct bt_ctf_field_type_integer *integer;
if (!type || type->frozen ||
- (type->id != BT_CTF_TYPE_ID_INTEGER) ||
+ (type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) ||
(encoding < BT_CTF_STRING_ENCODING_NONE) ||
(encoding >= BT_CTF_STRING_ENCODING_UNKNOWN)) {
ret = -1;
struct bt_ctf_field_type_enumeration *enumeration_type;
struct bt_ctf_field_type_enumeration_mapping_iterator *iter = NULL;
- if (!type || (type->id != BT_CTF_TYPE_ID_ENUM)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM)) {
goto end;
}
goto error;
}
- if (integer_container_type->id != BT_CTF_TYPE_ID_INTEGER) {
+ if (integer_container_type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) {
goto error;
}
goto error;
}
- enumeration->parent.id = BT_CTF_TYPE_ID_ENUM;
+ enumeration->parent.id = BT_CTF_FIELD_TYPE_ID_ENUM;
bt_get(integer_container_type);
enumeration->container = integer_container_type;
enumeration->entries = g_ptr_array_new_with_free_func(
goto end;
}
- if (type->id != BT_CTF_TYPE_ID_ENUM) {
+ if (type->id != BT_CTF_FIELD_TYPE_ID_ENUM) {
goto end;
}
struct bt_ctf_field_type_enumeration *enumeration;
char *escaped_string;
- if (!type || (type->id != BT_CTF_TYPE_ID_ENUM) ||
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM) ||
type->frozen ||
(range_end < range_start)) {
ret = -1;
struct bt_ctf_field_type_enumeration *enumeration;
char *escaped_string;
- if (!type || (type->id != BT_CTF_TYPE_ID_ENUM) ||
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM) ||
type->frozen ||
(range_end < range_start)) {
ret = -1;
int ret = 0;
struct bt_ctf_field_type_enumeration *enumeration;
- if (!type || (type->id != BT_CTF_TYPE_ID_ENUM)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM)) {
ret = -1;
goto end;
}
goto end;
}
- floating_point->parent.id = BT_CTF_TYPE_ID_FLOAT;
+ floating_point->parent.id = BT_CTF_FIELD_TYPE_ID_FLOAT;
floating_point->exp_dig = sizeof(float) * CHAR_BIT - FLT_MANT_DIG;
floating_point->mant_dig = FLT_MANT_DIG;
bt_ctf_field_type_init(&floating_point->parent, TRUE);
int ret = 0;
struct bt_ctf_field_type_floating_point *floating_point;
- if (!type || (type->id != BT_CTF_TYPE_ID_FLOAT)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_FLOAT)) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_floating_point *floating_point;
if (!type || type->frozen ||
- (type->id != BT_CTF_TYPE_ID_FLOAT)) {
+ (type->id != BT_CTF_FIELD_TYPE_ID_FLOAT)) {
ret = -1;
goto end;
}
int ret = 0;
struct bt_ctf_field_type_floating_point *floating_point;
- if (!type || (type->id != BT_CTF_TYPE_ID_FLOAT)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_FLOAT)) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_floating_point *floating_point;
if (!type || type->frozen ||
- (type->id != BT_CTF_TYPE_ID_FLOAT)) {
+ (type->id != BT_CTF_FIELD_TYPE_ID_FLOAT)) {
ret = -1;
goto end;
}
goto error;
}
- structure->parent.id = BT_CTF_TYPE_ID_STRUCT;
+ structure->parent.id = BT_CTF_FIELD_TYPE_ID_STRUCT;
structure->fields = g_ptr_array_new_with_free_func(
(GDestroyNotify)destroy_structure_field);
structure->field_name_to_index = g_hash_table_new(NULL, NULL);
*/
if (!type || !field_type || type->frozen ||
bt_ctf_validate_identifier(field_name) ||
- (type->id != BT_CTF_TYPE_ID_STRUCT) ||
+ (type->id != BT_CTF_FIELD_TYPE_ID_STRUCT) ||
type == field_type) {
ret = -1;
goto end;
int ret = 0;
struct bt_ctf_field_type_structure *structure;
- if (!type || (type->id != BT_CTF_TYPE_ID_STRUCT)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_STRUCT)) {
ret = -1;
goto end;
}
int ret = 0;
if (!type || index < 0 ||
- (type->id != BT_CTF_TYPE_ID_STRUCT)) {
+ (type->id != BT_CTF_FIELD_TYPE_ID_STRUCT)) {
ret = -1;
goto end;
}
goto error;
}
- variant->parent.id = BT_CTF_TYPE_ID_VARIANT;
+ variant->parent.id = BT_CTF_FIELD_TYPE_ID_VARIANT;
variant->tag_name = g_string_new(tag_name);
variant->field_name_to_index = g_hash_table_new(NULL, NULL);
variant->fields = g_ptr_array_new_with_free_func(
struct bt_ctf_field_type_variant *variant;
struct bt_ctf_field_type *tag_type = NULL;
- if (!type || (type->id != BT_CTF_TYPE_ID_VARIANT)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
goto end;
}
struct bt_ctf_field_type_variant *variant;
const char *tag_name = NULL;
- if (!type || (type->id != BT_CTF_TYPE_ID_VARIANT)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
goto end;
}
struct bt_ctf_field_type_variant *variant;
if (!type || type->frozen ||
- (type->id != BT_CTF_TYPE_ID_VARIANT) ||
+ (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT) ||
bt_ctf_validate_identifier(name)) {
ret = -1;
goto end;
*/
if (!type || !field_type || type->frozen ||
bt_ctf_validate_identifier(field_name) ||
- (type->id != BT_CTF_TYPE_ID_VARIANT) ||
+ (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT) ||
type == field_type) {
ret = -1;
goto end;
struct bt_ctf_field_type *field_type = NULL;
struct bt_ctf_field_type_enumeration_mapping_iterator *iter = NULL;
- if (!type || !tag || type->id != BT_CTF_TYPE_ID_VARIANT) {
+ if (!type || !tag || type->id != BT_CTF_FIELD_TYPE_ID_VARIANT) {
goto end;
}
int ret = 0;
struct bt_ctf_field_type_variant *variant;
- if (!type || (type->id != BT_CTF_TYPE_ID_VARIANT)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
ret = -1;
goto end;
}
int ret = 0;
if (!type || index < 0 ||
- (type->id != BT_CTF_TYPE_ID_VARIANT)) {
+ (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
ret = -1;
goto end;
}
goto error;
}
- array->parent.id = BT_CTF_TYPE_ID_ARRAY;
+ array->parent.id = BT_CTF_FIELD_TYPE_ID_ARRAY;
bt_get(element_type);
array->element_type = element_type;
array->length = length;
struct bt_ctf_field_type *ret = NULL;
struct bt_ctf_field_type_array *array;
- if (!type || (type->id != BT_CTF_TYPE_ID_ARRAY)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ARRAY)) {
goto end;
}
struct bt_ctf_field_type_array *array;
if (!type || !element_type ||
- (type->id != BT_CTF_TYPE_ID_ARRAY)) {
+ (type->id != BT_CTF_FIELD_TYPE_ID_ARRAY)) {
ret = -1;
goto end;
}
int64_t ret;
struct bt_ctf_field_type_array *array;
- if (!type || (type->id != BT_CTF_TYPE_ID_ARRAY)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ARRAY)) {
ret = -1;
goto end;
}
goto error;
}
- sequence->parent.id = BT_CTF_TYPE_ID_SEQUENCE;
+ sequence->parent.id = BT_CTF_FIELD_TYPE_ID_SEQUENCE;
bt_get(element_type);
sequence->element_type = element_type;
sequence->length_field_name = g_string_new(length_field_name);
struct bt_ctf_field_type *ret = NULL;
struct bt_ctf_field_type_sequence *sequence;
- if (!type || (type->id != BT_CTF_TYPE_ID_SEQUENCE)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_SEQUENCE)) {
goto end;
}
struct bt_ctf_field_type_sequence *sequence;
if (!type || !element_type ||
- (type->id != BT_CTF_TYPE_ID_SEQUENCE)) {
+ (type->id != BT_CTF_FIELD_TYPE_ID_SEQUENCE)) {
ret = -1;
goto end;
}
const char *ret = NULL;
struct bt_ctf_field_type_sequence *sequence;
- if (!type || (type->id != BT_CTF_TYPE_ID_SEQUENCE)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_SEQUENCE)) {
goto end;
}
return NULL;
}
- string->parent.id = BT_CTF_TYPE_ID_STRING;
+ string->parent.id = BT_CTF_FIELD_TYPE_ID_STRING;
bt_ctf_field_type_init(&string->parent, TRUE);
string->encoding = BT_CTF_STRING_ENCODING_UTF8;
string->parent.alignment = CHAR_BIT;
struct bt_ctf_field_type_string *string;
enum bt_ctf_string_encoding ret = BT_CTF_STRING_ENCODING_UNKNOWN;
- if (!type || (type->id != BT_CTF_TYPE_ID_STRING)) {
+ if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_STRING)) {
goto end;
}
int ret = 0;
struct bt_ctf_field_type_string *string;
- if (!type || type->id != BT_CTF_TYPE_ID_STRING ||
+ if (!type || type->id != BT_CTF_FIELD_TYPE_ID_STRING ||
(encoding != BT_CTF_STRING_ENCODING_UTF8 &&
encoding != BT_CTF_STRING_ENCODING_ASCII)) {
ret = -1;
int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type)
{
int ret;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
if (!type) {
ret = -1;
type_id = bt_ctf_field_type_get_type_id(type);
switch (type_id) {
- case BT_CTF_TYPE_ID_SEQUENCE:
+ case BT_CTF_FIELD_TYPE_ID_SEQUENCE:
{
struct bt_ctf_field_type *element =
bt_ctf_field_type_sequence_get_element_type(type);
bt_put(element);
break;
}
- case BT_CTF_TYPE_ID_ARRAY:
+ case BT_CTF_FIELD_TYPE_ID_ARRAY:
{
struct bt_ctf_field_type *element =
bt_ctf_field_type_array_get_element_type(type);
bt_put(element);
break;
}
- case BT_CTF_TYPE_ID_STRUCT:
+ case BT_CTF_FIELD_TYPE_ID_STRUCT:
{
int i, element_count;
ret = (int) type->alignment;
break;
}
- case BT_CTF_TYPE_ID_UNKNOWN:
+ case BT_CTF_FIELD_TYPE_ID_UNKNOWN:
ret = -1;
break;
default:
unsigned int alignment)
{
int ret = 0;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
/* Alignment must be a power of two */
if (!type || type->frozen || !is_power_of_two(alignment)) {
}
type_id = bt_ctf_field_type_get_type_id(type);
- if (type_id == BT_CTF_TYPE_ID_UNKNOWN) {
+ if (type_id == BT_CTF_FIELD_TYPE_ID_UNKNOWN) {
ret = -1;
goto end;
}
- if (type->id == BT_CTF_TYPE_ID_STRING &&
+ if (type->id == BT_CTF_FIELD_TYPE_ID_STRING &&
alignment != CHAR_BIT) {
ret = -1;
goto end;
}
- if (type_id == BT_CTF_TYPE_ID_VARIANT ||
- type_id == BT_CTF_TYPE_ID_SEQUENCE ||
- type_id == BT_CTF_TYPE_ID_ARRAY) {
+ if (type_id == BT_CTF_FIELD_TYPE_ID_VARIANT ||
+ type_id == BT_CTF_FIELD_TYPE_ID_SEQUENCE ||
+ type_id == BT_CTF_FIELD_TYPE_ID_ARRAY) {
/* Setting an alignment on these types makes no sense */
ret = -1;
goto end;
}
switch (type->id) {
- case BT_CTF_TYPE_ID_INTEGER:
+ case BT_CTF_FIELD_TYPE_ID_INTEGER:
{
struct bt_ctf_field_type_integer *integer = container_of(
type, struct bt_ctf_field_type_integer, parent);
ret = integer->user_byte_order;
break;
}
- case BT_CTF_TYPE_ID_ENUM:
+ case BT_CTF_FIELD_TYPE_ID_ENUM:
{
struct bt_ctf_field_type_enumeration *enum_ft = container_of(
type, struct bt_ctf_field_type_enumeration, parent);
ret = bt_ctf_field_type_get_byte_order(enum_ft->container);
break;
}
- case BT_CTF_TYPE_ID_FLOAT:
+ case BT_CTF_FIELD_TYPE_ID_FLOAT:
{
struct bt_ctf_field_type_floating_point *floating_point =
container_of(type,
return ret;
}
-enum bt_ctf_type_id bt_ctf_field_type_get_type_id(
+enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id(
struct bt_ctf_field_type *type)
{
if (!type) {
- return BT_CTF_TYPE_ID_UNKNOWN;
+ return BT_CTF_FIELD_TYPE_ID_UNKNOWN;
}
return type->id;
int bt_ctf_field_type_is_integer(struct bt_ctf_field_type *type)
{
- return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_INTEGER;
+ return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_INTEGER;
}
int bt_ctf_field_type_is_floating_point(struct bt_ctf_field_type *type)
{
- return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_FLOAT;
+ return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_FLOAT;
}
int bt_ctf_field_type_is_enumeration(struct bt_ctf_field_type *type)
{
- return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_ENUM;
+ return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_ENUM;
}
int bt_ctf_field_type_is_string(struct bt_ctf_field_type *type)
{
- return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_STRING;
+ return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_STRING;
}
int bt_ctf_field_type_is_structure(struct bt_ctf_field_type *type)
{
- return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_STRUCT;
+ return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_STRUCT;
}
int bt_ctf_field_type_is_array(struct bt_ctf_field_type *type)
{
- return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_ARRAY;
+ return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_ARRAY;
}
int bt_ctf_field_type_is_sequence(struct bt_ctf_field_type *type)
{
- return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_SEQUENCE;
+ return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_SEQUENCE;
}
int bt_ctf_field_type_is_variant(struct bt_ctf_field_type *type)
{
- return bt_ctf_field_type_get_type_id(type) == BT_CTF_TYPE_ID_VARIANT;
+ return bt_ctf_field_type_get_type_id(type) == BT_CTF_FIELD_TYPE_ID_VARIANT;
}
void bt_ctf_field_type_get(struct bt_ctf_field_type *type)
struct bt_ctf_field_type_structure *structure;
if (!type || !name ||
- bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_STRUCT) {
+ bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_structure *structure;
if (!type || !field ||
- bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_STRUCT) {
+ bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_variant *variant;
if (!type || !name ||
- bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_VARIANT) {
+ bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_VARIANT) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_sequence *sequence;
if (!type || bt_ctf_field_type_get_type_id(type) !=
- BT_CTF_TYPE_ID_SEQUENCE) {
+ BT_CTF_FIELD_TYPE_ID_SEQUENCE) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_variant *variant;
if (!type || bt_ctf_field_type_get_type_id(type) !=
- BT_CTF_TYPE_ID_VARIANT) {
+ BT_CTF_FIELD_TYPE_ID_VARIANT) {
ret = -1;
goto end;
}
if (!type || !tag ||
bt_ctf_field_type_get_type_id(tag) !=
- BT_CTF_TYPE_ID_ENUM) {
+ BT_CTF_FIELD_TYPE_ID_ENUM) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_variant *variant;
if (!type || !field ||
- bt_ctf_field_type_get_type_id(type) != BT_CTF_TYPE_ID_VARIANT) {
+ bt_ctf_field_type_get_type_id(type) != BT_CTF_FIELD_TYPE_ID_VARIANT) {
ret = -1;
goto end;
}
goto end;
}
- if (type_a->id == BT_CTF_TYPE_ID_UNKNOWN) {
+ if (type_a->id == BT_CTF_FIELD_TYPE_ID_UNKNOWN) {
/* Both have unknown type IDs */
goto end;
}
int bt_ctf_field_type_get_field_count(struct bt_ctf_field_type *field_type)
{
int field_count = -1;
- enum bt_ctf_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
+ enum bt_ctf_field_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
switch (type_id) {
case CTF_TYPE_STRUCT:
struct bt_ctf_field_type *field_type, int index)
{
struct bt_ctf_field_type *field = NULL;
- enum bt_ctf_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
+ enum bt_ctf_field_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
switch (type_id) {
case CTF_TYPE_STRUCT:
const char *name)
{
int field_index = -1;
- enum bt_ctf_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
+ enum bt_ctf_field_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
switch (type_id) {
case CTF_TYPE_STRUCT:
static
struct bt_ctf_field *(* const field_create_funcs[])(
struct bt_ctf_field_type *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_integer_create,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_create,
- [BT_CTF_TYPE_ID_FLOAT] =
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_integer_create,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_enumeration_create,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] =
bt_ctf_field_floating_point_create,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_create,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_create,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_create,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_create,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_create,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_structure_create,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_variant_create,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_array_create,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_create,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_string_create,
};
static
void (* const field_destroy_funcs[])(struct bt_ctf_field *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_integer_destroy,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_destroy,
- [BT_CTF_TYPE_ID_FLOAT] =
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_integer_destroy,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_enumeration_destroy,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] =
bt_ctf_field_floating_point_destroy,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_destroy,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_destroy,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_destroy,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_destroy,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_destroy,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_structure_destroy,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_variant_destroy,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_array_destroy,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_destroy,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_string_destroy,
};
static
int (* const field_validate_funcs[])(struct bt_ctf_field *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_generic_validate,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_validate,
- [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_generic_validate,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_validate,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_validate,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_validate,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_validate,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_generic_validate,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_generic_validate,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_enumeration_validate,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = bt_ctf_field_generic_validate,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_structure_validate,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_variant_validate,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_array_validate,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_validate,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_generic_validate,
};
static
int (* const field_reset_funcs[])(struct bt_ctf_field *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_generic_reset,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_reset,
- [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_generic_reset,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_reset,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_reset,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_reset,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_reset,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_reset,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_generic_reset,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_enumeration_reset,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = bt_ctf_field_generic_reset,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_structure_reset,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_variant_reset,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_array_reset,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_reset,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_string_reset,
};
static
int (* const field_serialize_funcs[])(struct bt_ctf_field *,
struct bt_ctf_stream_pos *, enum bt_ctf_byte_order) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_integer_serialize,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_serialize,
- [BT_CTF_TYPE_ID_FLOAT] =
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_integer_serialize,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_enumeration_serialize,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] =
bt_ctf_field_floating_point_serialize,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_serialize,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_serialize,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_serialize,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_serialize,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_serialize,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_structure_serialize,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_variant_serialize,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_array_serialize,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_serialize,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_string_serialize,
};
static
int (* const field_copy_funcs[])(struct bt_ctf_field *,
struct bt_ctf_field *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_integer_copy,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_copy,
- [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_floating_point_copy,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_copy,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_copy,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_copy,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_copy,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_string_copy,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_integer_copy,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_enumeration_copy,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = bt_ctf_field_floating_point_copy,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_structure_copy,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_variant_copy,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_array_copy,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_copy,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_string_copy,
};
static
void (* const field_freeze_funcs[])(struct bt_ctf_field *) = {
- [BT_CTF_TYPE_ID_INTEGER] = generic_field_freeze,
- [BT_CTF_TYPE_ID_FLOAT] = generic_field_freeze,
- [BT_CTF_TYPE_ID_STRING] = generic_field_freeze,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_freeze,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_freeze,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_freeze,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_freeze,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_freeze,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = generic_field_freeze,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = generic_field_freeze,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = generic_field_freeze,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_enumeration_freeze,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_structure_freeze,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_variant_freeze,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_array_freeze,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_freeze,
};
static
bool (* const field_is_set_funcs[])(struct bt_ctf_field *) = {
- [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_generic_is_set,
- [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_enumeration_is_set,
- [BT_CTF_TYPE_ID_FLOAT] = bt_ctf_field_generic_is_set,
- [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_structure_is_set,
- [BT_CTF_TYPE_ID_VARIANT] = bt_ctf_field_variant_is_set,
- [BT_CTF_TYPE_ID_ARRAY] = bt_ctf_field_array_is_set,
- [BT_CTF_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_is_set,
- [BT_CTF_TYPE_ID_STRING] = bt_ctf_field_generic_is_set,
+ [BT_CTF_FIELD_TYPE_ID_INTEGER] = bt_ctf_field_generic_is_set,
+ [BT_CTF_FIELD_TYPE_ID_ENUM] = bt_ctf_field_enumeration_is_set,
+ [BT_CTF_FIELD_TYPE_ID_FLOAT] = bt_ctf_field_generic_is_set,
+ [BT_CTF_FIELD_TYPE_ID_STRUCT] = bt_ctf_field_structure_is_set,
+ [BT_CTF_FIELD_TYPE_ID_VARIANT] = bt_ctf_field_variant_is_set,
+ [BT_CTF_FIELD_TYPE_ID_ARRAY] = bt_ctf_field_array_is_set,
+ [BT_CTF_FIELD_TYPE_ID_SEQUENCE] = bt_ctf_field_sequence_is_set,
+ [BT_CTF_FIELD_TYPE_ID_STRING] = bt_ctf_field_generic_is_set,
};
struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type)
{
struct bt_ctf_field *field = NULL;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
int ret;
if (!type) {
}
type_id = bt_ctf_field_type_get_type_id(type);
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN ||
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN ||
type_id >= BT_CTF_NR_TYPE_IDS) {
goto error;
}
return ret;
}
-enum bt_ctf_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field)
+enum bt_ctf_field_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field)
{
- enum bt_ctf_type_id ret = BT_CTF_TYPE_ID_UNKNOWN;
+ enum bt_ctf_field_type_id ret = BT_CTF_FIELD_TYPE_ID_UNKNOWN;
if (!field) {
goto end;
int bt_ctf_field_is_integer(struct bt_ctf_field *field)
{
- return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_INTEGER;
+ return bt_ctf_field_get_type_id(field) == BT_CTF_FIELD_TYPE_ID_INTEGER;
}
int bt_ctf_field_is_floating_point(struct bt_ctf_field *field)
{
- return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_FLOAT;
+ return bt_ctf_field_get_type_id(field) == BT_CTF_FIELD_TYPE_ID_FLOAT;
}
int bt_ctf_field_is_enumeration(struct bt_ctf_field *field)
{
- return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_ENUM;
+ return bt_ctf_field_get_type_id(field) == BT_CTF_FIELD_TYPE_ID_ENUM;
}
int bt_ctf_field_is_string(struct bt_ctf_field *field)
{
- return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_STRING;
+ return bt_ctf_field_get_type_id(field) == BT_CTF_FIELD_TYPE_ID_STRING;
}
int bt_ctf_field_is_structure(struct bt_ctf_field *field)
{
- return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_STRUCT;
+ return bt_ctf_field_get_type_id(field) == BT_CTF_FIELD_TYPE_ID_STRUCT;
}
int bt_ctf_field_is_array(struct bt_ctf_field *field)
{
- return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_ARRAY;
+ return bt_ctf_field_get_type_id(field) == BT_CTF_FIELD_TYPE_ID_ARRAY;
}
int bt_ctf_field_is_sequence(struct bt_ctf_field *field)
{
- return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_SEQUENCE;
+ return bt_ctf_field_get_type_id(field) == BT_CTF_FIELD_TYPE_ID_SEQUENCE;
}
int bt_ctf_field_is_variant(struct bt_ctf_field *field)
{
- return bt_ctf_field_get_type_id(field) == BT_CTF_TYPE_ID_VARIANT;
+ return bt_ctf_field_get_type_id(field) == BT_CTF_FIELD_TYPE_ID_VARIANT;
}
struct bt_ctf_field *bt_ctf_field_sequence_get_length(
}
if (bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_SEQUENCE) {
+ BT_CTF_FIELD_TYPE_ID_SEQUENCE) {
goto end;
}
goto end;
}
if (bt_ctf_field_type_get_type_id(length_field->type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
if (!field || !name ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
goto error;
}
if (!field ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
goto end;
}
if (!field || !name || !value || field->frozen ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
struct bt_ctf_field_array *array;
if (!field || bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_ARRAY) {
+ BT_CTF_FIELD_TYPE_ID_ARRAY) {
goto end;
}
struct bt_ctf_field_sequence *sequence;
if (!field || bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_SEQUENCE) {
+ BT_CTF_FIELD_TYPE_ID_SEQUENCE) {
goto end;
}
if (!field || !tag_field ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_VARIANT ||
+ BT_CTF_FIELD_TYPE_ID_VARIANT ||
bt_ctf_field_type_get_type_id(tag_field->type) !=
- BT_CTF_TYPE_ID_ENUM) {
+ BT_CTF_FIELD_TYPE_ID_ENUM) {
goto end;
}
if (!variant_field ||
bt_ctf_field_type_get_type_id(variant_field->type) !=
- BT_CTF_TYPE_ID_VARIANT) {
+ BT_CTF_FIELD_TYPE_ID_VARIANT) {
goto end;
}
if (!variant_field ||
bt_ctf_field_type_get_type_id(variant_field->type) !=
- BT_CTF_TYPE_ID_VARIANT) {
+ BT_CTF_FIELD_TYPE_ID_VARIANT) {
goto end;
}
struct bt_ctf_field_enumeration *enumeration;
if (!field || bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_ENUM) {
+ BT_CTF_FIELD_TYPE_ID_ENUM) {
goto end;
}
if (!field || !value || !field->payload_set ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
if (!field || field->frozen ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
if (!field || !value || !field->payload_set ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
if (!field || field->frozen ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
if (!field || !value || !field->payload_set ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_FLOAT) {
+ BT_CTF_FIELD_TYPE_ID_FLOAT) {
ret = -1;
goto end;
}
if (!field || field->frozen ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_FLOAT) {
+ BT_CTF_FIELD_TYPE_ID_FLOAT) {
ret = -1;
goto end;
}
if (!field || !field->payload_set ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_STRING) {
+ BT_CTF_FIELD_TYPE_ID_STRING) {
goto end;
}
if (!field || !value || field->frozen ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_STRING) {
+ BT_CTF_FIELD_TYPE_ID_STRING) {
ret = -1;
goto end;
}
if (!field || !value || field->frozen ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_STRING) {
+ BT_CTF_FIELD_TYPE_ID_STRING) {
ret = -1;
goto end;
}
if (!field || !value || field->frozen ||
bt_ctf_field_type_get_type_id(field->type) !=
- BT_CTF_TYPE_ID_STRING) {
+ BT_CTF_FIELD_TYPE_ID_STRING) {
ret = -1;
goto end;
}
int bt_ctf_field_validate(struct bt_ctf_field *field)
{
int ret = 0;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
if (!field) {
ret = -1;
}
type_id = bt_ctf_field_type_get_type_id(field->type);
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
ret = -1;
goto end;
}
int bt_ctf_field_reset(struct bt_ctf_field *field)
{
int ret = 0;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
if (!field) {
ret = -1;
}
type_id = bt_ctf_field_type_get_type_id(field->type);
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
ret = -1;
goto end;
}
enum bt_ctf_byte_order native_byte_order)
{
int ret = 0;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
if (!field || !pos) {
ret = -1;
}
type_id = bt_ctf_field_type_get_type_id(field->type);
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
ret = -1;
goto end;
}
bool bt_ctf_field_is_set(struct bt_ctf_field *field)
{
bool is_set = false;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
if (!field) {
goto end;
}
type_id = bt_ctf_field_type_get_type_id(field->type);
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
goto end;
}
{
int ret;
struct bt_ctf_field *copy = NULL;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
if (!field) {
goto end;
}
type_id = bt_ctf_field_type_get_type_id(field->type);
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN || type_id >= BT_CTF_NR_TYPE_IDS) {
goto end;
}
{
struct bt_ctf_field *field;
struct bt_ctf_field_type *type;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
field = container_of(obj, struct bt_ctf_field, base);
type = field->type;
type_id = bt_ctf_field_type_get_type_id(type);
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN ||
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN ||
type_id >= BT_CTF_NR_TYPE_IDS) {
return;
}
BT_HIDDEN
void bt_ctf_field_freeze(struct bt_ctf_field *field)
{
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
if (!field) {
goto end;
}
type_id = bt_ctf_field_get_type_id(field);
- if (type_id <= BT_CTF_TYPE_ID_UNKNOWN ||
+ if (type_id <= BT_CTF_FIELD_TYPE_ID_UNKNOWN ||
type_id >= BT_CTF_NR_TYPE_IDS) {
goto end;
}
int child_index;
struct bt_ctf_field_type *child_type;
const char *field_name = ptoken_get_string(cur_ptoken);
- enum bt_ctf_type_id type_id =
+ enum bt_ctf_field_type_id type_id =
bt_ctf_field_type_get_type_id(type);
/* Find to which index corresponds the current path token */
if (packet_context_type &&
bt_ctf_field_type_get_type_id(packet_context_type) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
/* A packet context must be a structure. */
ret = -1;
goto end;
if (event_header_type &&
bt_ctf_field_type_get_type_id(event_header_type) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
/* An event header must be a structure. */
ret = -1;
goto end;
if (event_context_type &&
bt_ctf_field_type_get_type_id(event_context_type) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
/* A packet context must be a structure. */
ret = -1;
goto end;
assert(field_type);
if (bt_ctf_field_type_get_type_id(field_type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
/* Not an integer and the value is unset, error. */
ret = -1;
goto end;
assert(magic_field_type);
if (bt_ctf_field_type_get_type_id(magic_field_type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
/* Magic field is not an integer. Not an error, skip. */
goto end;
}
uuid_field_type = bt_ctf_field_get_type(uuid_field);
assert(uuid_field_type);
if (bt_ctf_field_type_get_type_id(uuid_field_type) !=
- BT_CTF_TYPE_ID_ARRAY) {
+ BT_CTF_FIELD_TYPE_ID_ARRAY) {
/* UUID field is not an array. Not an error, skip. */
goto end;
}
uuid_field_type);
assert(element_field_type);
if (bt_ctf_field_type_get_type_id(element_field_type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
/* UUID array elements are not integers. Not an error, skip */
goto end;
}
stream_id_field_type = bt_ctf_field_get_type(stream_id_field);
assert(stream_id_field_type);
if (bt_ctf_field_type_get_type_id(stream_id_field_type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
/* stream_id field is not an integer. Not an error, skip. */
goto end;
}
timestamp_field_type = bt_ctf_field_get_type(timestamp_field);
assert(timestamp_field_type);
if (bt_ctf_field_type_get_type_id(timestamp_field_type) !=
- BT_CTF_TYPE_ID_INTEGER) {
+ BT_CTF_FIELD_TYPE_ID_INTEGER) {
ret = -1;
goto end;
}
field_type = bt_ctf_field_get_type(integer);
assert(field_type);
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
/*
* The user most likely meant for us to populate this field
* automatically. However, we can only do this if the field
/* packet_header_type must be a structure. */
if (packet_header_type &&
bt_ctf_field_type_get_type_id(packet_header_type) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
int field_type_contains_sequence_or_variant_ft(struct bt_ctf_field_type *type)
{
int ret = 0;
- enum bt_ctf_type_id type_id = bt_ctf_field_type_get_type_id(type);
+ enum bt_ctf_field_type_id type_id = bt_ctf_field_type_get_type_id(type);
switch (type_id) {
- case BT_CTF_TYPE_ID_SEQUENCE:
- case BT_CTF_TYPE_ID_VARIANT:
+ case BT_CTF_FIELD_TYPE_ID_SEQUENCE:
+ case BT_CTF_FIELD_TYPE_ID_VARIANT:
ret = 1;
goto end;
- case BT_CTF_TYPE_ID_ARRAY:
- case BT_CTF_TYPE_ID_STRUCT:
+ case BT_CTF_FIELD_TYPE_ID_ARRAY:
+ case BT_CTF_FIELD_TYPE_ID_STRUCT:
{
int i;
int field_count = bt_ctf_field_type_get_field_count(type);
int64_t length;
switch (bt_ctf_field_type_get_type_id(field_type)) {
- case BT_CTF_TYPE_ID_STRUCT:
+ case BT_CTF_FIELD_TYPE_ID_STRUCT:
length = (int64_t) bt_ctf_field_type_structure_get_field_count(
field_type);
break;
- case BT_CTF_TYPE_ID_VARIANT:
+ case BT_CTF_FIELD_TYPE_ID_VARIANT:
/* Variant field types always "contain" a single type */
length = 1;
break;
- case BT_CTF_TYPE_ID_ARRAY:
+ case BT_CTF_FIELD_TYPE_ID_ARRAY:
length = bt_ctf_field_type_array_get_length(field_type);
break;
- case BT_CTF_TYPE_ID_SEQUENCE:
+ case BT_CTF_FIELD_TYPE_ID_SEQUENCE:
length = btr->user.cbs.query.get_sequence_length(field_type,
btr->user.data);
break;
int size;
switch (bt_ctf_field_type_get_type_id(field_type)) {
- case BT_CTF_TYPE_ID_INTEGER:
+ case BT_CTF_FIELD_TYPE_ID_INTEGER:
size = bt_ctf_field_type_integer_get_size(field_type);
break;
- case BT_CTF_TYPE_ID_FLOAT:
+ case BT_CTF_FIELD_TYPE_ID_FLOAT:
{
int exp_dig, mant_dig;
size = exp_dig + mant_dig;
break;
}
- case BT_CTF_TYPE_ID_ENUM:
+ case BT_CTF_FIELD_TYPE_ID_ENUM:
{
struct bt_ctf_field_type *int_type;
assert(btr->cur_basic_field_type);
switch (bt_ctf_field_type_get_type_id(btr->cur_basic_field_type)) {
- case BT_CTF_TYPE_ID_INTEGER:
+ case BT_CTF_FIELD_TYPE_ID_INTEGER:
status = read_basic_int_type_and_call_begin(btr);
break;
- case BT_CTF_TYPE_ID_FLOAT:
+ case BT_CTF_FIELD_TYPE_ID_FLOAT:
status = read_basic_float_type_and_call_begin(btr);
break;
- case BT_CTF_TYPE_ID_ENUM:
+ case BT_CTF_FIELD_TYPE_ID_ENUM:
status = read_basic_enum_type_and_call_begin(btr);
break;
- case BT_CTF_TYPE_ID_STRING:
+ case BT_CTF_FIELD_TYPE_ID_STRING:
status = read_basic_string_type_and_call(btr, true);
break;
default:
assert(btr->cur_basic_field_type);
switch (bt_ctf_field_type_get_type_id(btr->cur_basic_field_type)) {
- case BT_CTF_TYPE_ID_INTEGER:
+ case BT_CTF_FIELD_TYPE_ID_INTEGER:
status = read_basic_int_type_and_call_continue(btr);
break;
- case BT_CTF_TYPE_ID_FLOAT:
+ case BT_CTF_FIELD_TYPE_ID_FLOAT:
status = read_basic_float_type_and_call_continue(btr);
break;
- case BT_CTF_TYPE_ID_ENUM:
+ case BT_CTF_FIELD_TYPE_ID_ENUM:
status = read_basic_enum_type_and_call_continue(btr);
break;
- case BT_CTF_TYPE_ID_STRING:
+ case BT_CTF_FIELD_TYPE_ID_STRING:
status = read_basic_string_type_and_call(btr, false);
break;
default:
static inline
bool is_compound_type(struct bt_ctf_field_type *field_type)
{
- enum bt_ctf_type_id id = bt_ctf_field_type_get_type_id(field_type);
+ enum bt_ctf_field_type_id id = bt_ctf_field_type_get_type_id(field_type);
- return id == BT_CTF_TYPE_ID_STRUCT || id == BT_CTF_TYPE_ID_ARRAY ||
- id == BT_CTF_TYPE_ID_SEQUENCE || id == BT_CTF_TYPE_ID_VARIANT;
+ return id == BT_CTF_FIELD_TYPE_ID_STRUCT || id == BT_CTF_FIELD_TYPE_ID_ARRAY ||
+ id == BT_CTF_FIELD_TYPE_ID_SEQUENCE || id == BT_CTF_FIELD_TYPE_ID_VARIANT;
}
static inline
/* Get next field's type */
switch (bt_ctf_field_type_get_type_id(top->base_type)) {
- case BT_CTF_TYPE_ID_STRUCT:
+ case BT_CTF_FIELD_TYPE_ID_STRUCT:
ret = bt_ctf_field_type_structure_get_field(
top->base_type, NULL, &next_field_type,
top->index);
next_field_type = NULL;
}
break;
- case BT_CTF_TYPE_ID_ARRAY:
+ case BT_CTF_FIELD_TYPE_ID_ARRAY:
next_field_type =
bt_ctf_field_type_array_get_element_type(
top->base_type);
break;
- case BT_CTF_TYPE_ID_SEQUENCE:
+ case BT_CTF_FIELD_TYPE_ID_SEQUENCE:
next_field_type =
bt_ctf_field_type_sequence_get_element_type(
top->base_type);
break;
- case BT_CTF_TYPE_ID_VARIANT:
+ case BT_CTF_FIELD_TYPE_ID_VARIANT:
/* Variant types are dynamic: query the user, he should know! */
next_field_type =
btr->user.cbs.query.get_variant_type(
bool is_struct_type(struct bt_ctf_field_type *field_type)
{
return bt_ctf_field_type_get_type_id(field_type) ==
- BT_CTF_TYPE_ID_STRUCT;
+ BT_CTF_FIELD_TYPE_ID_STRUCT;
}
static inline
bool is_variant_type(struct bt_ctf_field_type *field_type)
{
return bt_ctf_field_type_get_type_id(field_type) ==
- BT_CTF_TYPE_ID_VARIANT;
+ BT_CTF_FIELD_TYPE_ID_VARIANT;
}
static
}
switch (bt_ctf_field_type_get_type_id(base_type)) {
- case BT_CTF_TYPE_ID_STRUCT:
+ case BT_CTF_FIELD_TYPE_ID_STRUCT:
next_field = bt_ctf_field_structure_get_field_by_index(
base_field, index);
break;
- case BT_CTF_TYPE_ID_ARRAY:
+ case BT_CTF_FIELD_TYPE_ID_ARRAY:
next_field = bt_ctf_field_array_get_field(base_field, index);
break;
- case BT_CTF_TYPE_ID_SEQUENCE:
+ case BT_CTF_FIELD_TYPE_ID_SEQUENCE:
next_field = bt_ctf_field_sequence_get_field(base_field, index);
break;
- case BT_CTF_TYPE_ID_VARIANT:
+ case BT_CTF_FIELD_TYPE_ID_VARIANT:
next_field = bt_ctf_field_variant_get_current_field(base_field);
break;
default:
}
switch(bt_ctf_field_type_get_type_id(type)) {
- case BT_CTF_TYPE_ID_INTEGER:
+ case BT_CTF_FIELD_TYPE_ID_INTEGER:
/* Integer field is created field */
BT_MOVE(int_field, field);
bt_get(type);
break;
- case BT_CTF_TYPE_ID_ENUM:
+ case BT_CTF_FIELD_TYPE_ID_ENUM:
int_field = bt_ctf_field_enumeration_get_container(field);
type = bt_ctf_field_get_type(int_field);
break;
}
switch(bt_ctf_field_type_get_type_id(type)) {
- case BT_CTF_TYPE_ID_INTEGER:
+ case BT_CTF_FIELD_TYPE_ID_INTEGER:
/* Integer field is created field */
BT_MOVE(int_field, field);
bt_get(type);
break;
- case BT_CTF_TYPE_ID_ENUM:
+ case BT_CTF_FIELD_TYPE_ID_ENUM:
int_field = bt_ctf_field_enumeration_get_container(field);
type = bt_ctf_field_get_type(int_field);
break;
goto end;
}
- if (bt_ctf_field_type_get_type_id(sec_type) != BT_CTF_TYPE_ID_STRUCT) {
+ if (bt_ctf_field_type_get_type_id(sec_type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
fprintf(err, "[error] %s in %s:%d\n", __func__,
__FILE__, __LINE__);
goto end;
goto end;
}
- if (bt_ctf_field_type_get_type_id(sec_type) != BT_CTF_TYPE_ID_STRUCT) {
+ if (bt_ctf_field_type_get_type_id(sec_type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
fprintf(err, "[error] %s in %s:%d\n", __func__,
__FILE__, __LINE__);
goto end;
goto error;
}
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
fprintf(err, "[error] %s in %s:%d\n", __func__,
__FILE__, __LINE__);
goto error;
goto error;
}
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
fprintf(err, "[error] %s in %s:%d\n", __func__,
__FILE__, __LINE__);
goto error;
goto error;
}
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
fprintf(err, "[error] %s in %s:%d\n", __func__,
__FILE__, __LINE__);
goto error;
goto error;
}
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
fprintf(err, "[error] %s in %s:%d\n", __func__,
__FILE__, __LINE__);
goto error;
goto error;
}
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_STRING) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_STRING) {
fprintf(err, "[error] %s in %s:%d\n", __func__,
__FILE__, __LINE__);
goto error;
goto error;
}
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_SEQUENCE) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_SEQUENCE) {
fprintf(err, "[error] %s in %s:%d\n", __func__,
__FILE__, __LINE__);
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_ctf_field_type_get_type_id(writer_event_context_type) != BT_CTF_TYPE_ID_STRUCT) {
+ if (bt_ctf_field_type_get_type_id(writer_event_context_type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
ret = bt_ctf_event_set_event_context(writer_event, event_context);
goto end;
}
int ret;
switch (bt_ctf_field_type_get_type_id(type)) {
- case BT_CTF_TYPE_ID_INTEGER:
+ case BT_CTF_FIELD_TYPE_ID_INTEGER:
return update_header_clock_int_field_type(err, type,
writer_clock_class);
- case BT_CTF_TYPE_ID_STRUCT:
+ case BT_CTF_FIELD_TYPE_ID_STRUCT:
return find_update_struct_clock_fields(err, type,
writer_clock_class);
- case BT_CTF_TYPE_ID_ARRAY:
+ case BT_CTF_FIELD_TYPE_ID_ARRAY:
return find_update_array_clock_fields(err, type,
writer_clock_class);
- case BT_CTF_TYPE_ID_SEQUENCE:
+ case BT_CTF_FIELD_TYPE_ID_SEQUENCE:
return find_update_sequence_clock_fields(err, type,
writer_clock_class);
case BT_CTF_TYPE_ID_UNTAGGED_VARIANT:
- case BT_CTF_TYPE_ID_VARIANT:
+ case BT_CTF_FIELD_TYPE_ID_VARIANT:
return find_update_variant_clock_fields(err, type,
writer_clock_class);
- case BT_CTF_TYPE_ID_ENUM:
+ case BT_CTF_FIELD_TYPE_ID_ENUM:
return find_update_enum_clock_fields(err, type,
writer_clock_class);
break;
goto error;
}
- if (bt_ctf_field_type_get_type_id(new_type) != BT_CTF_TYPE_ID_STRUCT) {
+ if (bt_ctf_field_type_get_type_id(new_type) != BT_CTF_FIELD_TYPE_ID_STRUCT) {
fprintf(err, "[error] Unexpected header field type\n");
goto error;
}
}
switch (bt_ctf_field_type_get_type_id(type)) {
- case BT_CTF_TYPE_ID_INTEGER:
+ case BT_CTF_FIELD_TYPE_ID_INTEGER:
ret = copy_find_clock_int_field(err, event, writer_event,
field, type, copy_field);
break;
- case BT_CTF_TYPE_ID_STRUCT:
+ case BT_CTF_FIELD_TYPE_ID_STRUCT:
ret = copy_find_clock_struct_field(err, event, writer_event,
field, type, copy_field);
break;
- case BT_CTF_TYPE_ID_FLOAT:
+ case BT_CTF_FIELD_TYPE_ID_FLOAT:
ret = copy_float_field(err, field, type, copy_field);
break;
- case BT_CTF_TYPE_ID_ENUM:
+ case BT_CTF_FIELD_TYPE_ID_ENUM:
ret = copy_find_clock_enum_field(err, event, writer_event,
field, type, copy_field);
break;
- case BT_CTF_TYPE_ID_STRING:
+ case BT_CTF_FIELD_TYPE_ID_STRING:
ret = copy_string_field(err, field, type, copy_field);
break;
- case BT_CTF_TYPE_ID_ARRAY:
+ case BT_CTF_FIELD_TYPE_ID_ARRAY:
ret = copy_find_clock_array_field(err, event, writer_event,
field, type, copy_field);
break;
- case BT_CTF_TYPE_ID_SEQUENCE:
+ case BT_CTF_FIELD_TYPE_ID_SEQUENCE:
ret = copy_find_clock_sequence_field(err, event, writer_event,
field, type, copy_field);
break;
case BT_CTF_TYPE_ID_UNTAGGED_VARIANT:
- case BT_CTF_TYPE_ID_VARIANT:
+ case BT_CTF_FIELD_TYPE_ID_VARIANT:
ret = copy_find_clock_variant_field(err, event, writer_event,
field, type, copy_field);
break;
/* No default, we want to catch missing field types. */
- case BT_CTF_TYPE_ID_UNKNOWN:
+ case BT_CTF_FIELD_TYPE_ID_UNKNOWN:
case BT_CTF_NR_TYPE_IDS:
break;
}
/*
* Only support for integers for now.
*/
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
fprintf(err, "[error] Unsupported packet context field type\n");
ret = BT_COMPONENT_STATUS_ERROR;
goto error;
continue;
}
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
fprintf(err, "[error] Unexpected packet context field type\n");
goto error;
}
{
enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
struct bt_ctf_field_type *array_type = NULL, *field_type = NULL;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
int64_t len;
uint64_t i;
bool is_string = false;
goto end;
}
type_id = bt_ctf_field_type_get_type_id(field_type);
- if (type_id == BT_CTF_TYPE_ID_INTEGER) {
+ if (type_id == BT_CTF_FIELD_TYPE_ID_INTEGER) {
enum bt_ctf_string_encoding encoding;
encoding = bt_ctf_field_type_integer_get_encoding(field_type);
enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
struct bt_ctf_field_type *seq_type = NULL, *field_type = NULL;
struct bt_ctf_field *length_field = NULL;
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
uint64_t len;
uint64_t i;
bool is_string = false;
goto end;
}
type_id = bt_ctf_field_type_get_type_id(field_type);
- if (type_id == BT_CTF_TYPE_ID_INTEGER) {
+ if (type_id == BT_CTF_FIELD_TYPE_ID_INTEGER) {
enum bt_ctf_string_encoding encoding;
encoding = bt_ctf_field_type_integer_get_encoding(field_type);
struct bt_ctf_field *field, bool print_names,
GQuark *filter_fields, int filter_array_len)
{
- enum bt_ctf_type_id type_id;
+ enum bt_ctf_field_type_id type_id;
type_id = bt_ctf_field_get_type_id(field);
switch (type_id) {
BT_PUT(field);
continue;
}
- if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_TYPE_ID_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
fprintf(err, "[error] Unexpected packet context field type\n");
goto error;
}
"bt_ctf_field_type_get_byte_order handles NULL correctly");
ok(bt_ctf_field_type_get_type_id(NULL) ==
- BT_CTF_TYPE_ID_UNKNOWN,
+ BT_CTF_FIELD_TYPE_ID_UNKNOWN,
"bt_ctf_field_type_get_type_id handles NULL correctly");
ok(bt_ctf_field_type_get_type_id(uint_12_type) ==
- BT_CTF_TYPE_ID_INTEGER,
+ BT_CTF_FIELD_TYPE_ID_INTEGER,
"bt_ctf_field_type_get_type_id returns a correct value with an integer type");
ok(bt_ctf_field_type_integer_get_base(NULL) ==
bt_ctf_field_type_sequence_create(int_16_type, "seq_len");
ok(sequence_type, "Create a sequence of int16_t type");
ok(bt_ctf_field_type_get_type_id(sequence_type) ==
- BT_CTF_TYPE_ID_SEQUENCE,
+ BT_CTF_FIELD_TYPE_ID_SEQUENCE,
"bt_ctf_field_type_get_type_id returns a correct value with a sequence type");
ok(bt_ctf_field_type_sequence_get_length_field_name(NULL) == NULL,
structure_seq_type = bt_ctf_field_type_structure_create();
ok(bt_ctf_field_type_get_type_id(structure_seq_type) ==
- BT_CTF_TYPE_ID_STRUCT,
+ BT_CTF_FIELD_TYPE_ID_STRUCT,
"bt_ctf_field_type_get_type_id returns a correct value with a structure type");
ok(structure_seq_type, "Create a structure type");
ok(bt_ctf_field_type_structure_add_field(structure_seq_type,
stream_class);
ok(ret_field_type,
"bt_ctf_stream_class_get_event_header_type returns an event header type");
- ok(bt_ctf_field_type_get_type_id(ret_field_type) == BT_CTF_TYPE_ID_STRUCT,
+ ok(bt_ctf_field_type_get_type_id(ret_field_type) == BT_CTF_FIELD_TYPE_ID_STRUCT,
"Default event header type is a structure");
event_header_field_type =
bt_ctf_field_type_structure_get_field_type_by_name(
ok(event_header_field_type,
"Default event header type contains an \"id\" field");
ok(bt_ctf_field_type_get_type_id(
- event_header_field_type) == BT_CTF_TYPE_ID_INTEGER,
+ event_header_field_type) == BT_CTF_FIELD_TYPE_ID_INTEGER,
"Default event header \"id\" field is an integer");
bt_put(event_header_field_type);
event_header_field_type =
ok(event_header_field_type,
"Default event header type contains a \"timestamp\" field");
ok(bt_ctf_field_type_get_type_id(
- event_header_field_type) == BT_CTF_TYPE_ID_INTEGER,
+ event_header_field_type) == BT_CTF_FIELD_TYPE_ID_INTEGER,
"Default event header \"timestamp\" field is an integer");
bt_put(event_header_field_type);
bt_put(ret_field_type);
packet_header_type = bt_ctf_trace_get_packet_header_type(trace);
ok(packet_header_type,
"bt_ctf_trace_get_packet_header_type returns a packet header");
- ok(bt_ctf_field_type_get_type_id(packet_header_type) == BT_CTF_TYPE_ID_STRUCT,
+ ok(bt_ctf_field_type_get_type_id(packet_header_type) == BT_CTF_FIELD_TYPE_ID_STRUCT,
"bt_ctf_trace_get_packet_header_type returns a packet header of type struct");
ret_field_type = bt_ctf_field_type_structure_get_field_type_by_name(
packet_header_type, "magic");
packet_context_type = bt_ctf_stream_class_get_packet_context_type(stream_class);
ok(packet_context_type,
"bt_ctf_stream_class_get_packet_context_type returns a packet context type.");
- ok(bt_ctf_field_type_get_type_id(packet_context_type) == BT_CTF_TYPE_ID_STRUCT,
+ ok(bt_ctf_field_type_get_type_id(packet_context_type) == BT_CTF_FIELD_TYPE_ID_STRUCT,
"Packet context is a structure");
ok(bt_ctf_stream_class_set_packet_context_type(NULL, packet_context_type),