@sa bt_field_type_get_type_id(): Returns the type ID of a given
field type.
*/
-extern bt_bool bt_field_type_is_integer(
- struct bt_field_type *field_type);
+static inline
+bt_bool bt_field_type_is_integer(struct bt_field_type *field_type)
+{
+ return bt_field_type_get_type_id(field_type) ==
+ BT_FIELD_TYPE_ID_INTEGER;
+}
/**
@brief Returns whether or not the @ft \p field_type is a @floatft.
@sa bt_field_type_get_type_id(): Returns the type ID of a given
field type.
*/
-extern bt_bool bt_field_type_is_floating_point(
- struct bt_field_type *field_type);
+static inline
+bt_bool bt_field_type_is_floating_point(struct bt_field_type *field_type)
+{
+ return bt_field_type_get_type_id(field_type) == BT_FIELD_TYPE_ID_FLOAT;
+}
/**
@brief Returns whether or not the @ft \p field_type is a @enumft.
@sa bt_field_type_get_type_id(): Returns the type ID of a given
field type.
*/
-extern bt_bool bt_field_type_is_enumeration(
- struct bt_field_type *field_type);
+static inline
+bt_bool bt_field_type_is_enumeration(struct bt_field_type *field_type)
+{
+ return bt_field_type_get_type_id(field_type) == BT_FIELD_TYPE_ID_ENUM;
+}
/**
@brief Returns whether or not the @ft \p field_type is a @stringft.
@sa bt_field_type_get_type_id(): Returns the type ID of a given
field type.
*/
-extern bt_bool bt_field_type_is_string(
- struct bt_field_type *field_type);
+static inline
+bt_bool bt_field_type_is_string(struct bt_field_type *field_type)
+{
+ return bt_field_type_get_type_id(field_type) == BT_FIELD_TYPE_ID_STRING;
+}
/**
@brief Returns whether or not the @ft \p field_type is a @structft.
@sa bt_field_type_get_type_id(): Returns the type ID of a given
field type.
*/
-extern bt_bool bt_field_type_is_structure(
- struct bt_field_type *field_type);
+static inline
+bt_bool bt_field_type_is_structure(struct bt_field_type *field_type)
+{
+ return bt_field_type_get_type_id(field_type) == BT_FIELD_TYPE_ID_STRUCT;
+}
/**
@brief Returns whether or not the @ft \p field_type is a @arrayft.
@sa bt_field_type_get_type_id(): Returns the type ID of a given
field type.
*/
-extern bt_bool bt_field_type_is_array(
- struct bt_field_type *field_type);
+static inline
+bt_bool bt_field_type_is_array(struct bt_field_type *field_type)
+{
+ return bt_field_type_get_type_id(field_type) == BT_FIELD_TYPE_ID_ARRAY;
+}
/**
@brief Returns whether or not the @ft \p field_type is a @seqft.
@sa bt_field_type_get_type_id(): Returns the type ID of a given
field type.
*/
-extern bt_bool bt_field_type_is_sequence(
- struct bt_field_type *field_type);
+static inline
+bt_bool bt_field_type_is_sequence(struct bt_field_type *field_type)
+{
+ return bt_field_type_get_type_id(field_type) ==
+ BT_FIELD_TYPE_ID_SEQUENCE;
+}
/**
@brief Returns whether or not the @ft \p field_type is a @varft.
@sa bt_field_type_get_type_id(): Returns the type ID of a given
field type.
*/
-extern bt_bool bt_field_type_is_variant(
- struct bt_field_type *field_type);
+static inline
+bt_bool bt_field_type_is_variant(struct bt_field_type *field_type)
+{
+ return bt_field_type_get_type_id(field_type) ==
+ BT_FIELD_TYPE_ID_VARIANT;
+}
/** @} */
/* For bt_bool */
#include <babeltrace/types.h>
+/* For BT_FIELD_TYPE_ID_* */
+#include <babeltrace/ctf-ir/field-types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@sa bt_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern bt_bool bt_field_is_integer(struct bt_field *field);
+static inline
+bt_bool bt_field_is_integer(struct bt_field *field)
+{
+ return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_INTEGER;
+}
/**
@brief Returns whether or not the @field \p field is a @floatfield.
@sa bt_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern bt_bool bt_field_is_floating_point(struct bt_field *field);
+static inline
+bt_bool bt_field_is_floating_point(struct bt_field *field)
+{
+ return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_FLOAT;
+}
/**
@brief Returns whether or not the @field \p field is a @enumfield.
@sa bt_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern bt_bool bt_field_is_enumeration(struct bt_field *field);
+static inline
+bt_bool bt_field_is_enumeration(struct bt_field *field)
+{
+ return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_ENUM;
+}
/**
@brief Returns whether or not the @field \p field is a @stringfield.
@sa bt_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern bt_bool bt_field_is_string(struct bt_field *field);
+static inline
+bt_bool bt_field_is_string(struct bt_field *field)
+{
+ return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_STRING;
+}
/**
@brief Returns whether or not the @field \p field is a @structfield.
@sa bt_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern bt_bool bt_field_is_structure(struct bt_field *field);
+static inline
+bt_bool bt_field_is_structure(struct bt_field *field)
+{
+ return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_STRUCT;
+}
/**
@brief Returns whether or not the @field \p field is a @arrayfield.
@sa bt_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern bt_bool bt_field_is_array(struct bt_field *field);
+static inline
+bt_bool bt_field_is_array(struct bt_field *field)
+{
+ return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_ARRAY;
+}
/**
@brief Returns whether or not the @field \p field is a @seqfield.
@sa bt_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern bt_bool bt_field_is_sequence(struct bt_field *field);
+static inline
+bt_bool bt_field_is_sequence(struct bt_field *field)
+{
+ return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_SEQUENCE;
+}
/**
@brief Returns whether or not the @field \p field is a @varfield.
@sa bt_field_get_type_id(): Returns the type ID of a given
field's type.
*/
-extern bt_bool bt_field_is_variant(struct bt_field *field);
+static inline
+bt_bool bt_field_is_variant(struct bt_field *field)
+{
+ return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_VARIANT;
+}
/** @} */
return bt_field_type_common_get_type_id((void *) ft);
}
-int bt_field_type_is_integer(struct bt_field_type *type)
-{
- return bt_field_type_get_type_id(type) == BT_FIELD_TYPE_ID_INTEGER;
-}
-
-int bt_field_type_is_floating_point(struct bt_field_type *type)
-{
- return bt_field_type_get_type_id(type) == BT_FIELD_TYPE_ID_FLOAT;
-}
-
-int bt_field_type_is_enumeration(struct bt_field_type *type)
-{
- return bt_field_type_get_type_id(type) == BT_FIELD_TYPE_ID_ENUM;
-}
-
-int bt_field_type_is_string(struct bt_field_type *type)
-{
- return bt_field_type_get_type_id(type) == BT_FIELD_TYPE_ID_STRING;
-}
-
-int bt_field_type_is_structure(struct bt_field_type *type)
-{
- return bt_field_type_get_type_id(type) == BT_FIELD_TYPE_ID_STRUCT;
-}
-
-int bt_field_type_is_array(struct bt_field_type *type)
-{
- return bt_field_type_get_type_id(type) == BT_FIELD_TYPE_ID_ARRAY;
-}
-
-int bt_field_type_is_sequence(struct bt_field_type *type)
-{
- return bt_field_type_get_type_id(type) == BT_FIELD_TYPE_ID_SEQUENCE;
-}
-
-int bt_field_type_is_variant(struct bt_field_type *type)
-{
- return bt_field_type_get_type_id(type) == BT_FIELD_TYPE_ID_VARIANT;
-}
-
BT_HIDDEN
void bt_field_type_common_freeze(struct bt_field_type_common *ft)
{
return field_common->type->id;
}
-bt_bool bt_field_is_integer(struct bt_field *field)
-{
- return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_INTEGER;
-}
-
-bt_bool bt_field_is_floating_point(struct bt_field *field)
-{
- return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_FLOAT;
-}
-
-bt_bool bt_field_is_enumeration(struct bt_field *field)
-{
- return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_ENUM;
-}
-
-bt_bool bt_field_is_string(struct bt_field *field)
-{
- return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_STRING;
-}
-
-bt_bool bt_field_is_structure(struct bt_field *field)
-{
- return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_STRUCT;
-}
-
-bt_bool bt_field_is_array(struct bt_field *field)
-{
- return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_ARRAY;
-}
-
-bt_bool bt_field_is_sequence(struct bt_field *field)
-{
- return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_SEQUENCE;
-}
-
-bt_bool bt_field_is_variant(struct bt_field *field)
-{
- return bt_field_get_type_id(field) == BT_FIELD_TYPE_ID_VARIANT;
-}
-
int64_t bt_field_sequence_get_length(struct bt_field *field)
{
return bt_field_common_sequence_get_length((void *) field);