babeltrace2/ctf-writer/stream-class.h \
babeltrace2/ctf-writer/stream.h \
babeltrace2/ctf-writer/trace.h \
+ babeltrace2/ctf-writer/types.h \
babeltrace2/ctf-writer/utils.h \
babeltrace2/ctf-writer/visitor.h \
babeltrace2/ctf-writer/writer.h
extern int bt_ctf_clock_class_set_offset_cycles(
struct bt_ctf_clock_class *clock_class, int64_t cycles);
-extern bt_bool bt_ctf_clock_class_is_absolute(
+extern bt_ctf_bool bt_ctf_clock_class_is_absolute(
struct bt_ctf_clock_class *clock_class);
extern int bt_ctf_clock_class_set_is_absolute(
- struct bt_ctf_clock_class *clock_class, bt_bool is_absolute);
+ struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute);
extern const uint8_t *bt_ctf_clock_class_get_uuid(
struct bt_ctf_clock_class *clock_class);
#include <stdint.h>
#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/types.h>
+#include <babeltrace2/ctf-writer/types.h>
#ifdef __cplusplus
extern "C" {
#include <stdint.h>
#include <stddef.h>
-
-#include <babeltrace2/types.h>
+#include <babeltrace2/ctf-writer/types.h>
#ifdef __cplusplus
extern "C" {
extern int bt_ctf_field_type_integer_set_size(
struct bt_ctf_field_type *int_field_type, unsigned int size);
-extern bt_bool bt_ctf_field_type_integer_is_signed(
+extern bt_ctf_bool bt_ctf_field_type_integer_is_signed(
struct bt_ctf_field_type *int_field_type);
/* Pre-2.0 CTF writer compatibility */
}
extern int bt_ctf_field_type_integer_set_is_signed(
- struct bt_ctf_field_type *int_field_type, bt_bool is_signed);
+ struct bt_ctf_field_type *int_field_type, bt_ctf_bool is_signed);
/* Pre-2.0 CTF writer compatibility */
static inline
struct bt_ctf_field_type *int_field_type, int is_signed)
{
return bt_ctf_field_type_integer_set_is_signed(int_field_type,
- is_signed ? BT_TRUE : BT_FALSE);
+ is_signed ? BT_CTF_TRUE : BT_CTF_FALSE);
}
extern enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base(
--- /dev/null
+#ifndef BABELTRACE2_CTF_WRITER_TYPES_H
+#define BABELTRACE2_CTF_WRITER_TYPES_H
+
+/*
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/// False boolean value for the #bt_ctf_bool type.
+#define BT_CTF_FALSE 0
+
+/// True boolean value for the #bt_ctf_bool type.
+#define BT_CTF_TRUE 1
+
+typedef int bt_ctf_bool;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_TYPES_H */
* http://www.efficios.com/ctf
*/
-/* For bt_bool */
-#include <babeltrace2/types.h>
+/* For bt_ctf_bool */
+#include <babeltrace2/ctf-writer/types.h>
#ifdef __cplusplus
extern "C" {
#endif
-extern bt_bool bt_ctf_identifier_is_valid(const char *identifier);
+extern bt_ctf_bool bt_ctf_identifier_is_valid(const char *identifier);
static inline
int bt_ctf_validate_identifier(const char *identifier)
void bt_ctf_clock_class_destroy(struct bt_ctf_object *obj);
BT_HIDDEN
-bt_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class)
+bt_ctf_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class)
{
return clock_class && clock_class->name;
}
}
BT_HIDDEN
-bt_bool bt_ctf_clock_class_is_absolute(struct bt_ctf_clock_class *clock_class)
+bt_ctf_bool bt_ctf_clock_class_is_absolute(struct bt_ctf_clock_class *clock_class)
{
int ret = -1;
BT_HIDDEN
int bt_ctf_clock_class_set_is_absolute(struct bt_ctf_clock_class *clock_class,
- bt_bool is_absolute)
+ bt_ctf_bool is_absolute)
{
int ret = 0;
#include "common/macros.h"
#include "object-pool.h"
#include "common/uuid.h"
-#include <babeltrace2/types.h>
+#include <babeltrace2/ctf-writer/types.h>
#include <stdbool.h>
#include <stdint.h>
#include <glib.h>
void bt_ctf_clock_class_freeze(struct bt_ctf_clock_class *clock_class);
BT_HIDDEN
-bt_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class);
+bt_ctf_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class);
BT_HIDDEN
int bt_ctf_clock_class_compare(struct bt_ctf_clock_class *clock_class_a,
int bt_ctf_clock_class_set_offset_cycles(
struct bt_ctf_clock_class *clock_class, int64_t cycles);
BT_HIDDEN
-bt_bool bt_ctf_clock_class_is_absolute(
+bt_ctf_bool bt_ctf_clock_class_is_absolute(
struct bt_ctf_clock_class *clock_class);
BT_HIDDEN
int bt_ctf_clock_class_set_is_absolute(
- struct bt_ctf_clock_class *clock_class, bt_bool is_absolute);
+ struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute);
BT_HIDDEN
const uint8_t *bt_ctf_clock_class_get_uuid(
struct bt_ctf_clock_class *clock_class);
<= mapping[1]->range_end._signed
&& mapping[0]->range_end._signed
>= mapping[1]->range_start._signed) {
- ft->has_overlapping_ranges = BT_TRUE;
+ ft->has_overlapping_ranges = BT_CTF_TRUE;
goto end;
}
} else {
<= mapping[1]->range_end._unsigned
&& mapping[0]->range_end._unsigned
>= mapping[1]->range_start._unsigned) {
- ft->has_overlapping_ranges = BT_TRUE;
+ ft->has_overlapping_ranges = BT_CTF_TRUE;
goto end;
}
}
}
static
-bt_bool bt_ctf_field_type_common_enumeration_has_overlapping_ranges(
+bt_ctf_bool bt_ctf_field_type_common_enumeration_has_overlapping_ranges(
struct bt_ctf_field_type_common_enumeration *enum_ft)
{
if (!enum_ft->common.frozen) {
}
BT_HIDDEN
-bt_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft)
+bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft)
{
struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft);
BT_HIDDEN
int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft,
- bt_bool is_signed)
+ bt_ctf_bool is_signed)
{
int ret = 0;
struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft);
return bt_ctf_field_type_common_integer_get_size((void *) ft);
}
-bt_bool bt_ctf_field_type_integer_is_signed(struct bt_ctf_field_type *ft)
+bt_ctf_bool bt_ctf_field_type_integer_is_signed(struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_integer_is_signed((void *) ft);
}
int bt_ctf_field_type_integer_set_is_signed(struct bt_ctf_field_type *ft,
- bt_bool is_signed)
+ bt_ctf_bool is_signed)
{
return bt_ctf_field_type_common_integer_set_is_signed((void *) ft,
is_signed);
#include <stddef.h>
#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/types.h>
+#include <babeltrace2/ctf-writer/types.h>
#include "common/macros.h"
struct bt_ctf_clock_class *mapped_clock_class;
enum bt_ctf_byte_order user_byte_order;
- bt_bool is_signed;
+ bt_ctf_bool is_signed;
unsigned int size;
enum bt_ctf_integer_base base;
enum bt_ctf_string_encoding encoding;
GPtrArray *entries;
/* Only set during validation */
- bt_bool has_overlapping_ranges;
+ bt_ctf_bool has_overlapping_ranges;
};
enum bt_ctf_field_type_enumeration_mapping_iterator_type {
int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft);
BT_HIDDEN
-bt_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft);
+bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft);
BT_HIDDEN
int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft,
- bt_bool is_signed);
+ bt_ctf_bool is_signed);
BT_HIDDEN
int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft,
}
BT_HIDDEN
-bt_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field)
{
return field && field->payload_set;
}
BT_HIDDEN
-bt_bool bt_ctf_field_common_structure_is_set_recursive(
+bt_ctf_bool bt_ctf_field_common_structure_is_set_recursive(
struct bt_ctf_field_common *field)
{
- bt_bool is_set = BT_FALSE;
+ bt_ctf_bool is_set = BT_CTF_FALSE;
size_t i;
struct bt_ctf_field_common_structure *structure = BT_CTF_FROM_COMMON(field);
}
BT_HIDDEN
-bt_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field)
{
struct bt_ctf_field_common_variant *variant = BT_CTF_FROM_COMMON(field);
- bt_bool is_set = BT_FALSE;
+ bt_ctf_bool is_set = BT_CTF_FALSE;
BT_ASSERT(field);
}
BT_HIDDEN
-bt_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field)
{
size_t i;
- bt_bool is_set = BT_FALSE;
+ bt_ctf_bool is_set = BT_CTF_FALSE;
struct bt_ctf_field_common_array *array = BT_CTF_FROM_COMMON(field);
BT_ASSERT(field);
}
BT_HIDDEN
-bt_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field)
{
size_t i;
- bt_bool is_set = BT_FALSE;
+ bt_ctf_bool is_set = BT_CTF_FALSE;
struct bt_ctf_field_common_sequence *sequence = BT_CTF_FROM_COMMON(field);
BT_ASSERT(field);
int bt_ctf_field_enumeration_validate_recursive(struct bt_ctf_field_common *field);
static
-bt_bool bt_ctf_field_enumeration_is_set_recursive(
+bt_ctf_bool bt_ctf_field_enumeration_is_set_recursive(
struct bt_ctf_field_common *field);
static
int bt_ctf_field_variant_validate_recursive(struct bt_ctf_field_common *field);
static
-bt_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field);
+bt_ctf_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field);
static
void bt_ctf_field_variant_reset_recursive(struct bt_ctf_field_common *field);
struct bt_ctf_field_type_common_variant *variant_ft;
struct bt_ctf_field_type_common_enumeration *tag_ft;
struct bt_ctf_field *current_field = NULL;
- bt_bool is_signed;
+ bt_ctf_bool is_signed;
uint64_t tag_uval;
int ret;
}
static
-bt_bool bt_ctf_field_enumeration_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_enumeration_is_set_recursive(struct bt_ctf_field_common *field)
{
- bt_bool is_set = BT_FALSE;
+ bt_ctf_bool is_set = BT_CTF_FALSE;
struct bt_ctf_field_enumeration *enumeration = (void *) field;
if (enumeration->container) {
}
static
-bt_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field)
{
- bt_bool is_set;
+ bt_ctf_bool is_set;
struct bt_ctf_field_variant *variant = (void *) field;
if (variant->tag) {
typedef int (*bt_ctf_field_common_method_validate)(struct bt_ctf_field_common *);
typedef struct bt_ctf_field_common *(*bt_ctf_field_common_method_copy)(
struct bt_ctf_field_common *);
-typedef bt_bool (*bt_ctf_field_common_method_is_set)(struct bt_ctf_field_common *);
+typedef bt_ctf_bool (*bt_ctf_field_common_method_is_set)(struct bt_ctf_field_common *);
typedef void (*bt_ctf_field_common_method_reset)(struct bt_ctf_field_common *);
struct bt_ctf_field_common_methods {
bool is_frozen);
BT_HIDDEN
-bt_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field);
+bt_ctf_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field);
BT_HIDDEN
-bt_bool bt_ctf_field_common_structure_is_set_recursive(
+bt_ctf_bool bt_ctf_field_common_structure_is_set_recursive(
struct bt_ctf_field_common *field);
BT_HIDDEN
-bt_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field);
+bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field);
BT_HIDDEN
-bt_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field);
+bt_ctf_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field);
BT_HIDDEN
-bt_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field);
+bt_ctf_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field);
#ifdef BT_DEV_MODE
# define bt_ctf_field_common_validate_recursive _bt_ctf_field_common_validate_recursive
#else
# define bt_ctf_field_common_validate_recursive(_field) (-1)
# define bt_ctf_field_common_set_is_frozen_recursive(_field, _is_frozen)
-# define bt_ctf_field_common_is_set_recursive(_field) (BT_FALSE)
+# define bt_ctf_field_common_is_set_recursive(_field) (BT_CTF_FALSE)
# define bt_ctf_field_common_reset_recursive(_field)
# define bt_ctf_field_common_set(_field, _val)
#endif
}
static inline
-bt_bool _bt_ctf_field_common_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool _bt_ctf_field_common_is_set_recursive(struct bt_ctf_field_common *field)
{
- bt_bool is_set = BT_FALSE;
+ bt_ctf_bool is_set = BT_CTF_FALSE;
if (!field) {
goto end;
struct bt_ctf_field *field);
static inline
-bt_bool bt_ctf_field_is_set_recursive(struct bt_ctf_field *field)
+bt_ctf_bool bt_ctf_field_is_set_recursive(struct bt_ctf_field *field)
{
return bt_ctf_field_common_is_set_recursive((void *) field);
}
* Checks whether or not `stack` is empty.
*/
static
-bt_bool type_stack_empty(type_stack *stack)
+bt_ctf_bool type_stack_empty(type_stack *stack)
{
return stack->len == 0;
}
{
int ret = 0;
GList *cur_ptoken = ptokens;
- bt_bool first_level_done = BT_FALSE;
+ bt_ctf_bool first_level_done = BT_CTF_FALSE;
/* Get our own reference */
bt_ctf_object_get_ref(type);
/* Next path token */
cur_ptoken = g_list_next(cur_ptoken);
- first_level_done = BT_TRUE;
+ first_level_done = BT_CTF_TRUE;
}
/* Create new field path entry */
int tail_field_path_len =
tail_field_path->indexes->len;
- while (BT_TRUE) {
+ while (BT_CTF_TRUE) {
struct bt_ctf_field_type_common *cur_type =
type_stack_at(ctx->type_stack, i)->type;
int index = type_stack_at(
field_path1_len = field_path1->indexes->len;
field_path2_len = field_path2->indexes->len;
- while (BT_TRUE) {
+ while (BT_CTF_TRUE) {
int target_index, ctx_index;
if (lca_index == field_path2_len ||
static
int _set_structure_field_integer(struct bt_ctf_field *structure, char *name,
- uint64_t value, bt_bool force)
+ uint64_t value, bt_ctf_bool force)
{
int ret = 0;
struct bt_ctf_field_type *field_type = NULL;
int try_set_structure_field_integer(struct bt_ctf_field *structure, char *name,
uint64_t value)
{
- return _set_structure_field_integer(structure, name, value, BT_FALSE);
+ return _set_structure_field_integer(structure, name, value, BT_CTF_FALSE);
}
struct bt_ctf_stream_class *bt_ctf_stream_get_class(
}
bt_uuid_copy(trace->uuid, uuid);
- trace->uuid_set = BT_TRUE;
+ trace->uuid_set = BT_CTF_TRUE;
BT_LOGT("Set trace's UUID: addr=%p, name=\"%s\", "
"uuid=\"" BT_UUID_FMT "\"",
trace, bt_ctf_trace_common_get_name(trace),
}
BT_HIDDEN
-bt_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace,
+bt_ctf_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace,
struct bt_ctf_clock_class *clock_class)
{
struct bt_ctf_search_query query = { .value = clock_class, .found = 0 };
GString *name;
int frozen;
bt_uuid_t uuid;
- bt_bool uuid_set;
+ bt_ctf_bool uuid_set;
enum bt_ctf_byte_order native_byte_order;
struct bt_ctf_private_value *environment;
GPtrArray *clock_classes; /* Array of pointers to bt_ctf_clock_class */
};
BT_HIDDEN
-bt_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace,
+bt_ctf_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace,
struct bt_ctf_clock_class *clock_class);
BT_HIDDEN
}
}
-bt_bool bt_ctf_identifier_is_valid(const char *identifier)
+bt_ctf_bool bt_ctf_identifier_is_valid(const char *identifier)
{
- bt_bool is_valid = BT_TRUE;
+ bt_ctf_bool is_valid = BT_CTF_TRUE;
char *string = NULL;
char *save_ptr, *token;
if (!identifier) {
BT_LOGT_STR("Invalid parameter: input string is NULL.");
- is_valid = BT_FALSE;
+ is_valid = BT_CTF_FALSE;
goto end;
}
try_init_reserved_keywords();
if (identifier[0] == '\0') {
- is_valid = BT_FALSE;
+ is_valid = BT_CTF_FALSE;
goto end;
}
string = strdup(identifier);
if (!string) {
BT_LOGE("strdup() failed.");
- is_valid = BT_FALSE;
+ is_valid = BT_CTF_FALSE;
goto end;
}
if (g_hash_table_lookup_extended(reserved_keywords_set,
GINT_TO_POINTER(g_quark_from_string(token)),
NULL, NULL)) {
- is_valid = BT_FALSE;
+ is_valid = BT_CTF_FALSE;
goto end;
}
struct bt_ctf_value {
struct bt_ctf_object base;
enum bt_ctf_value_type type;
- bt_bool frozen;
+ bt_ctf_bool frozen;
};
static
.parent = NULL,
},
.type = BT_CTF_VALUE_TYPE_NULL,
- .frozen = BT_TRUE,
+ .frozen = BT_CTF_TRUE,
};
struct bt_ctf_value *const bt_ctf_value_null = &bt_ctf_value_null_instance;
struct bt_ctf_value_bool {
struct bt_ctf_value base;
- bt_bool value;
+ bt_ctf_bool value;
};
struct bt_ctf_value_integer {
};
static
-bt_bool bt_ctf_value_null_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_null_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b)
{
/*
- * Always BT_TRUE since bt_ctf_value_compare() already checks if both
+ * Always BT_CTF_TRUE since bt_ctf_value_compare() already checks if both
* object_a and object_b have the same type, and in the case of
* null value objects, they're always the same if it is so.
*/
- return BT_TRUE;
+ return BT_CTF_TRUE;
}
static
-bt_bool bt_ctf_value_bool_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_bool_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b)
{
if (BT_CTF_VALUE_TO_BOOL(object_a)->value !=
"bool-a-val=%d, bool-b-val=%d",
BT_CTF_VALUE_TO_BOOL(object_a)->value,
BT_CTF_VALUE_TO_BOOL(object_b)->value);
- return BT_FALSE;
+ return BT_CTF_FALSE;
}
- return BT_TRUE;
+ return BT_CTF_TRUE;
}
static
-bt_bool bt_ctf_value_integer_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_integer_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b)
{
if (BT_CTF_VALUE_TO_INTEGER(object_a)->value !=
"int-a-val=%" PRId64 ", int-b-val=%" PRId64,
BT_CTF_VALUE_TO_INTEGER(object_a)->value,
BT_CTF_VALUE_TO_INTEGER(object_b)->value);
- return BT_FALSE;
+ return BT_CTF_FALSE;
}
- return BT_TRUE;
+ return BT_CTF_TRUE;
}
static
-bt_bool bt_ctf_value_real_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_real_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b)
{
if (BT_CTF_VALUE_TO_REAL(object_a)->value !=
"real-a-val=%f, real-b-val=%f",
BT_CTF_VALUE_TO_REAL(object_a)->value,
BT_CTF_VALUE_TO_REAL(object_b)->value);
- return BT_FALSE;
+ return BT_CTF_FALSE;
}
- return BT_TRUE;
+ return BT_CTF_TRUE;
}
static
-bt_bool bt_ctf_value_string_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_string_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b)
{
if (strcmp(BT_CTF_VALUE_TO_STRING(object_a)->gstr->str,
"string-a-val=\"%s\", string-b-val=\"%s\"",
BT_CTF_VALUE_TO_STRING(object_a)->gstr->str,
BT_CTF_VALUE_TO_STRING(object_b)->gstr->str);
- return BT_FALSE;
+ return BT_CTF_FALSE;
}
- return BT_TRUE;
+ return BT_CTF_TRUE;
}
static
-bt_bool bt_ctf_value_array_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_array_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b)
{
int i;
- bt_bool ret = BT_TRUE;
+ bt_ctf_bool ret = BT_CTF_TRUE;
const struct bt_ctf_value_array *array_obj_a =
BT_CTF_VALUE_TO_ARRAY(object_a);
object_a, object_b,
bt_ctf_value_array_get_size(object_a),
bt_ctf_value_array_get_size(object_b));
- ret = BT_FALSE;
+ ret = BT_CTF_FALSE;
goto end;
}
BT_LOGT("Array values's elements are different: "
"value-a-addr=%p, value-b-addr=%p, index=%d",
element_obj_a, element_obj_b, i);
- ret = BT_FALSE;
+ ret = BT_CTF_FALSE;
goto end;
}
}
}
static
-bt_bool bt_ctf_value_map_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_map_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b)
{
- bt_bool ret = BT_TRUE;
+ bt_ctf_bool ret = BT_CTF_TRUE;
GHashTableIter iter;
gpointer key, element_obj_a;
const struct bt_ctf_value_map *map_obj_a = BT_CTF_VALUE_TO_MAP(object_a);
object_a, object_b,
bt_ctf_value_map_get_size(object_a),
bt_ctf_value_map_get_size(object_b));
- ret = BT_FALSE;
+ ret = BT_CTF_FALSE;
goto end;
}
BT_LOGT("Map values's elements are different: "
"value-a-addr=%p, value-b-addr=%p, key=\"%s\"",
element_obj_a, element_obj_b, key_str);
- ret = BT_FALSE;
+ ret = BT_CTF_FALSE;
goto end;
}
}
}
static
-bt_bool (* const compare_funcs[])(const struct bt_ctf_value *,
+bt_ctf_bool (* const compare_funcs[])(const struct bt_ctf_value *,
const struct bt_ctf_value *) = {
[BT_CTF_VALUE_TYPE_NULL] = bt_ctf_value_null_compare,
[BT_CTF_VALUE_TYPE_BOOL] = bt_ctf_value_bool_compare,
static
void bt_ctf_value_generic_freeze(struct bt_ctf_value *object)
{
- object->frozen = BT_TRUE;
+ object->frozen = BT_CTF_TRUE;
}
static
struct bt_ctf_value value;
value.type = type;
- value.frozen = BT_FALSE;
+ value.frozen = BT_CTF_FALSE;
bt_ctf_object_init_shared(&value.base, bt_ctf_value_destroy);
return value;
}
BT_HIDDEN
-struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_bool val)
+struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_ctf_bool val)
{
struct bt_ctf_value_bool *bool_obj;
BT_HIDDEN
struct bt_ctf_private_value *bt_ctf_private_value_bool_create(void)
{
- return bt_ctf_private_value_bool_create_init(BT_FALSE);
+ return bt_ctf_private_value_bool_create_init(BT_CTF_FALSE);
}
BT_HIDDEN
}
BT_HIDDEN
-bt_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj)
+bt_ctf_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj)
{
BT_CTF_ASSERT_PRE_NON_NULL(bool_obj, "Value object");
BT_CTF_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_CTF_VALUE_TYPE_BOOL);
}
BT_HIDDEN
-void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj, bt_bool val)
+void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj, bt_ctf_bool val)
{
BT_CTF_ASSERT_PRE_NON_NULL(bool_obj, "Value object");
BT_CTF_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_CTF_VALUE_TYPE_BOOL);
BT_HIDDEN
enum bt_ctf_value_status bt_ctf_private_value_array_append_bool_element(
- struct bt_ctf_private_value *array_obj, bt_bool val)
+ struct bt_ctf_private_value *array_obj, bt_ctf_bool val)
{
enum bt_ctf_value_status ret;
struct bt_ctf_private_value *bool_obj = NULL;
}
BT_HIDDEN
-bt_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, const char *key)
+bt_ctf_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, const char *key)
{
BT_CTF_ASSERT_PRE_NON_NULL(map_obj, "Value object");
BT_CTF_ASSERT_PRE_NON_NULL(key, "Key");
BT_HIDDEN
enum bt_ctf_value_status bt_ctf_private_value_map_insert_bool_entry(
- struct bt_ctf_private_value *map_obj, const char *key, bt_bool val)
+ struct bt_ctf_private_value *map_obj, const char *key, bt_ctf_bool val)
{
enum bt_ctf_value_status ret;
struct bt_ctf_private_value *bool_obj = NULL;
};
static
-bt_bool extend_map_element(const char *key,
+bt_ctf_bool extend_map_element(const char *key,
struct bt_ctf_value *extension_obj_elem, void *data)
{
- bt_bool ret = BT_TRUE;
+ bt_ctf_bool ret = BT_CTF_TRUE;
struct extend_map_element_data *extend_data = data;
struct bt_ctf_private_value *extension_obj_elem_copy = NULL;
error:
BT_ASSERT(extend_data->status != BT_CTF_VALUE_STATUS_OK);
- ret = BT_FALSE;
+ ret = BT_CTF_FALSE;
end:
BT_CTF_OBJECT_PUT_REF_AND_RESET(extension_obj_elem_copy);
}
BT_HIDDEN
-bt_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b)
{
- bt_bool ret = BT_FALSE;
+ bt_ctf_bool ret = BT_CTF_FALSE;
BT_CTF_ASSERT_PRE_NON_NULL(object_a, "Value object A");
BT_CTF_ASSERT_PRE_NON_NULL(object_b, "Value object B");
* SOFTWARE.
*/
-#include <babeltrace2/types.h>
+#include <babeltrace2/ctf-writer/types.h>
#include "common/macros.h"
/// Null value object.
BT_CTF_VALUE_TYPE_NULL = 0,
- /// Boolean value object (holds #BT_TRUE or #BT_FALSE).
+ /// Boolean value object (holds #BT_CTF_TRUE or #BT_CTF_FALSE).
BT_CTF_VALUE_TYPE_BOOL = 1,
/// Integer value object (holds a signed 64-bit integer raw value).
enum bt_ctf_value_type bt_ctf_value_get_type(const struct bt_ctf_value *object);
static inline
-bt_bool bt_ctf_value_is_null(const struct bt_ctf_value *object)
+bt_ctf_bool bt_ctf_value_is_null(const struct bt_ctf_value *object)
{
return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_NULL;
}
static inline
-bt_bool bt_ctf_value_is_bool(const struct bt_ctf_value *object)
+bt_ctf_bool bt_ctf_value_is_bool(const struct bt_ctf_value *object)
{
return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_BOOL;
}
static inline
-bt_bool bt_ctf_value_is_integer(const struct bt_ctf_value *object)
+bt_ctf_bool bt_ctf_value_is_integer(const struct bt_ctf_value *object)
{
return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_INTEGER;
}
static inline
-bt_bool bt_ctf_value_is_real(const struct bt_ctf_value *object)
+bt_ctf_bool bt_ctf_value_is_real(const struct bt_ctf_value *object)
{
return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_REAL;
}
static inline
-bt_bool bt_ctf_value_is_string(const struct bt_ctf_value *object)
+bt_ctf_bool bt_ctf_value_is_string(const struct bt_ctf_value *object)
{
return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_STRING;
}
static inline
-bt_bool bt_ctf_value_is_array(const struct bt_ctf_value *object)
+bt_ctf_bool bt_ctf_value_is_array(const struct bt_ctf_value *object)
{
return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_ARRAY;
}
static inline
-bt_bool bt_ctf_value_is_map(const struct bt_ctf_value *object)
+bt_ctf_bool bt_ctf_value_is_map(const struct bt_ctf_value *object)
{
return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_MAP;
}
const struct bt_ctf_value *object);
BT_HIDDEN
-bt_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a,
+bt_ctf_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a,
const struct bt_ctf_value *object_b);
BT_HIDDEN
-bt_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj);
+bt_ctf_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj);
BT_HIDDEN
int64_t bt_ctf_value_integer_get(const struct bt_ctf_value *integer_obj);
uint64_t bt_ctf_value_array_get_size(const struct bt_ctf_value *array_obj);
static inline
-bt_bool bt_ctf_value_array_is_empty(const struct bt_ctf_value *array_obj)
+bt_ctf_bool bt_ctf_value_array_is_empty(const struct bt_ctf_value *array_obj)
{
return bt_ctf_value_array_get_size(array_obj) == 0;
}
uint64_t bt_ctf_value_map_get_size(const struct bt_ctf_value *map_obj);
static inline
-bt_bool bt_ctf_value_map_is_empty(const struct bt_ctf_value *map_obj)
+bt_ctf_bool bt_ctf_value_map_is_empty(const struct bt_ctf_value *map_obj)
{
return bt_ctf_value_map_get_size(map_obj) == 0;
}
struct bt_ctf_value *bt_ctf_value_map_borrow_entry_value(
const struct bt_ctf_value *map_obj, const char *key);
-typedef bt_bool (* bt_ctf_value_map_foreach_entry_cb)(const char *key,
+typedef bt_ctf_bool (* bt_ctf_value_map_foreach_entry_cb)(const char *key,
struct bt_ctf_value *object, void *data);
BT_HIDDEN
bt_ctf_value_map_foreach_entry_cb cb, void *data);
BT_HIDDEN
-bt_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj,
+bt_ctf_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj,
const char *key);
BT_HIDDEN
struct bt_ctf_private_value *bt_ctf_private_value_bool_create(void);
BT_HIDDEN
-struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_bool val);
+struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_ctf_bool val);
BT_HIDDEN
void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj,
- bt_bool val);
+ bt_ctf_bool val);
BT_HIDDEN
struct bt_ctf_private_value *bt_ctf_private_value_integer_create(void);
BT_HIDDEN
enum bt_ctf_value_status bt_ctf_private_value_array_append_bool_element(
struct bt_ctf_private_value *array_obj,
- bt_bool val);
+ bt_ctf_bool val);
BT_HIDDEN
enum bt_ctf_value_status bt_ctf_private_value_array_append_integer_element(
struct bt_ctf_private_value *bt_ctf_private_value_map_borrow_entry_value(
const struct bt_ctf_private_value *map_obj, const char *key);
-typedef bt_bool (* bt_ctf_private_value_map_foreach_entry_cb)(const char *key,
+typedef bt_ctf_bool (* bt_ctf_private_value_map_foreach_entry_cb)(const char *key,
struct bt_ctf_private_value *object, void *data);
BT_HIDDEN
BT_HIDDEN
enum bt_ctf_value_status bt_ctf_private_value_map_insert_bool_entry(
- struct bt_ctf_private_value *map_obj, const char *key, bt_bool val);
+ struct bt_ctf_private_value *map_obj, const char *key, bt_ctf_bool val);
BT_HIDDEN
enum bt_ctf_value_status bt_ctf_private_value_map_insert_integer_entry(
{
struct bt_ctf_stream *stream = NULL;
int stream_class_count;
- bt_bool stream_class_found = BT_FALSE;
+ bt_ctf_bool stream_class_found = BT_CTF_FALSE;
int i;
if (!writer || !stream_class) {
writer->trace, i);
if (existing_stream_class == stream_class) {
- stream_class_found = BT_TRUE;
+ stream_class_found = BT_CTF_TRUE;
}
BT_CTF_OBJECT_PUT_REF_AND_RESET(existing_stream_class);
BT_ASSERT(cfg->ec);
ft = bt_ctf_field_type_integer_create(8);
BT_ASSERT(ft);
- ret = bt_ctf_field_type_integer_set_is_signed(ft, BT_TRUE);
+ ret = bt_ctf_field_type_integer_set_is_signed(ft, BT_CTF_TRUE);
BT_ASSERT(ret == 0);
ret = bt_ctf_event_class_add_field(cfg->ec, ft, "first");
BT_ASSERT(ret == 0);