#include <babeltrace/ctf-writer/serialize-internal.h>
#include <babeltrace/object-internal.h>
#include <babeltrace/ref.h>
-#include <babeltrace/compiler.h>
-#include <babeltrace/compat/fcntl.h>
-#include <babeltrace/align.h>
+#include <babeltrace/compiler-internal.h>
+#include <babeltrace/compat/fcntl-internal.h>
+#include <babeltrace/align-internal.h>
#define PACKET_LEN_INCREMENT (getpagesize() * 8 * CHAR_BIT)
void bt_ctf_field_sequence_freeze(struct bt_ctf_field *);
static
-bool bt_ctf_field_generic_is_set(struct bt_ctf_field *);
+bt_bool bt_ctf_field_generic_is_set(struct bt_ctf_field *);
static
-bool bt_ctf_field_structure_is_set(struct bt_ctf_field *);
+bt_bool bt_ctf_field_structure_is_set(struct bt_ctf_field *);
static
-bool bt_ctf_field_variant_is_set(struct bt_ctf_field *);
+bt_bool bt_ctf_field_variant_is_set(struct bt_ctf_field *);
static
-bool bt_ctf_field_enumeration_is_set(struct bt_ctf_field *);
+bt_bool bt_ctf_field_enumeration_is_set(struct bt_ctf_field *);
static
-bool bt_ctf_field_array_is_set(struct bt_ctf_field *);
+bt_bool bt_ctf_field_array_is_set(struct bt_ctf_field *);
static
-bool bt_ctf_field_sequence_is_set(struct bt_ctf_field *);
+bt_bool bt_ctf_field_sequence_is_set(struct bt_ctf_field *);
static
int increase_packet_size(struct bt_ctf_stream_pos *pos);
};
static
-bool (* const field_is_set_funcs[])(struct bt_ctf_field *) = {
+bt_bool (* const field_is_set_funcs[])(struct bt_ctf_field *) = {
[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,
return ret;
}
-struct bt_ctf_field *bt_ctf_field_structure_get_field(
+struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
struct bt_ctf_field *field, const char *name)
{
struct bt_ctf_field *new_field = NULL;
}
struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
- struct bt_ctf_field *field, int index)
+ struct bt_ctf_field *field, uint64_t index)
{
int ret;
const char *field_name;
}
sequence = container_of(field, struct bt_ctf_field_sequence, parent);
- if (!sequence->elements || sequence->elements->len <= index) {
+ if (!sequence->elements || index >= sequence->elements->len) {
goto end;
}
BT_HIDDEN
-bool bt_ctf_field_is_set(struct bt_ctf_field *field)
+bt_bool bt_ctf_field_is_set(struct bt_ctf_field *field)
{
- bool is_set = false;
+ bt_bool is_set = BT_FALSE;
enum bt_ctf_field_type_id type_id;
if (!field) {
}
static
-bool bt_ctf_field_generic_is_set(struct bt_ctf_field *field)
+bt_bool bt_ctf_field_generic_is_set(struct bt_ctf_field *field)
{
return field && field->payload_set;
}
static
-bool bt_ctf_field_enumeration_is_set(struct bt_ctf_field *field)
+bt_bool bt_ctf_field_enumeration_is_set(struct bt_ctf_field *field)
{
- bool is_set = false;
+ bt_bool is_set = BT_FALSE;
struct bt_ctf_field_enumeration *enumeration;
if (!field) {
}
static
-bool bt_ctf_field_structure_is_set(struct bt_ctf_field *field)
+bt_bool bt_ctf_field_structure_is_set(struct bt_ctf_field *field)
{
- bool is_set = false;
+ bt_bool is_set = BT_FALSE;
size_t i;
struct bt_ctf_field_structure *structure;
}
static
-bool bt_ctf_field_variant_is_set(struct bt_ctf_field *field)
+bt_bool bt_ctf_field_variant_is_set(struct bt_ctf_field *field)
{
- bool is_set = false;
+ bt_bool is_set = BT_FALSE;
struct bt_ctf_field_variant *variant;
if (!field) {
}
static
-bool bt_ctf_field_array_is_set(struct bt_ctf_field *field)
+bt_bool bt_ctf_field_array_is_set(struct bt_ctf_field *field)
{
size_t i;
- bool is_set = false;
+ bt_bool is_set = BT_FALSE;
struct bt_ctf_field_array *array;
if (!field) {
}
static
-bool bt_ctf_field_sequence_is_set(struct bt_ctf_field *field)
+bt_bool bt_ctf_field_sequence_is_set(struct bt_ctf_field *field)
{
size_t i;
- bool is_set = false;
+ bt_bool is_set = BT_FALSE;
struct bt_ctf_field_sequence *sequence;
if (!field) {