#include "lib/assert-pre.h"
#include <babeltrace2/trace-ir/field.h>
-#include <babeltrace2/trace-ir/field-const.h>
#include "lib/object.h"
#include "compat/compiler.h"
#include "compat/fcntl.h"
{
const struct bt_field_integer *int_field = (const void *) field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
{
const struct bt_field_integer *int_field = (const void *) field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
BT_ASSERT_DBG(field);
string_field->length = 0;
+ g_array_index(string_field->buf, char, 0) = '\0';
bt_field_set_single(field, true);
}
enum bt_field_string_set_value_status bt_field_string_set_value(
struct bt_field *field, const char *value)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
enum bt_field_string_append_status bt_field_string_append(
struct bt_field *field, const char *value)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
+
return bt_field_string_append_with_length(field,
value, (uint64_t) strlen(value));
}
char *data;
uint64_t new_length;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
int ret = BT_FUNC_STATUS_OK;
struct bt_field_array *array_field = (void *) field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_DYNAMIC_ARRAY(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
}
const struct bt_field_class_variant_option *
-bt_field_variant_borrow_selected_class_option_const(
+bt_field_variant_borrow_selected_option_class_const(
const struct bt_field *field)
{
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
}
const struct bt_field_class_variant_with_selector_field_integer_unsigned_option *
-bt_field_variant_with_unsigned_integer_selector_borrow_selected_class_option_const(
+bt_field_variant_with_selector_field_integer_unsigned_borrow_selected_option_class_const(
const struct bt_field *field)
{
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
}
const struct bt_field_class_variant_with_selector_field_integer_signed_option *
-bt_field_variant_with_signed_integer_selector_borrow_selected_class_option_const(
+bt_field_variant_with_selector_field_integer_signed_borrow_selected_option_class_const(
const struct bt_field *field)
{
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
return (const void *) borrow_variant_field_selected_class_option(field);
}
-enum bt_field_variant_select_option_field_by_index_status
-bt_field_variant_select_option_field_by_index(
+enum bt_field_variant_select_option_by_index_status
+bt_field_variant_select_option_by_index(
struct bt_field *field, uint64_t index)
{
struct bt_field_variant *var_field = (void *) field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
return BT_FUNC_STATUS_OK;
}
-uint64_t bt_field_variant_get_selected_option_field_index(
+uint64_t bt_field_variant_get_selected_option_index(
const struct bt_field *field)
{
const struct bt_field_variant *var_field = (const void *) field;