lib: make BT_ASSERT_{PRE,POST}() always on; add BT_ASSERT_{PRE,POST}_DEV()
[babeltrace.git] / src / lib / trace-ir / field-class.c
index 40fe2159e5de1a6565a354ab33f541649225482a..30f85dbf4ed8adf8c80e8eef12a1895c6d20ae56 100644 (file)
@@ -21,8 +21,8 @@
  * SOFTWARE.
  */
 
-#define BT_LOG_TAG "FIELD-CLASSES"
-#include "lib/lib-logging.h"
+#define BT_LOG_TAG "LIB/FIELD-CLASS"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/field-class.h>
 #include "field.h"
 #include "field-path.h"
 #include "utils.h"
+#include "lib/func-status.h"
 
 enum bt_field_class_type bt_field_class_get_type(
                const struct bt_field_class *fc)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
        return fc->type;
 }
 
@@ -92,7 +93,8 @@ struct bt_field_class *create_integer_field_class(bt_trace_class *trace_class,
                bt_common_field_class_type_string(type));
        int_fc = g_new0(struct bt_field_class_integer, 1);
        if (!int_fc) {
-               BT_LOGE_STR("Failed to allocate one integer field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one integer field class.");
                goto error;
        }
 
@@ -126,8 +128,8 @@ uint64_t bt_field_class_integer_get_field_value_range(
 {
        const struct bt_field_class_integer *int_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
        return int_fc->range;
 }
 
@@ -147,7 +149,7 @@ void bt_field_class_integer_set_field_value_range(
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        BT_ASSERT_PRE(size <= 64,
                "Unsupported size for integer field class's field value range "
                "(maximum is 64): size=%" PRIu64, size);
@@ -159,7 +161,7 @@ void bt_field_class_integer_set_field_value_range(
                "at least one of the current mapping ranges contains values "
                "which are outside this range: %!+F, size=%" PRIu64, fc, size);
        int_fc->range = size;
-       BT_LIB_LOGV("Set integer field class's field value range: %!+F", fc);
+       BT_LIB_LOGD("Set integer field class's field value range: %!+F", fc);
 }
 
 enum bt_field_class_integer_preferred_display_base
@@ -167,8 +169,8 @@ bt_field_class_integer_get_preferred_display_base(const struct bt_field_class *f
 {
        const struct bt_field_class_integer *int_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
        return int_fc->base;
 }
 
@@ -180,9 +182,9 @@ void bt_field_class_integer_set_preferred_display_base(
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        int_fc->base = base;
-       BT_LIB_LOGV("Set integer field class's preferred display base: %!+F", fc);
+       BT_LIB_LOGD("Set integer field class's preferred display base: %!+F", fc);
 }
 
 static
@@ -239,7 +241,8 @@ struct bt_field_class *create_enumeration_field_class(
                bt_common_field_class_type_string(type));
        enum_fc = g_new0(struct bt_field_class_enumeration, 1);
        if (!enum_fc) {
-               BT_LOGE_STR("Failed to allocate one enumeration field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one enumeration field class.");
                goto error;
        }
 
@@ -248,13 +251,13 @@ struct bt_field_class *create_enumeration_field_class(
        enum_fc->mappings = g_array_new(FALSE, TRUE,
                sizeof(struct bt_field_class_enumeration_mapping));
        if (!enum_fc->mappings) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                goto error;
        }
 
        enum_fc->label_buf = g_ptr_array_new();
        if (!enum_fc->label_buf) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                goto error;
        }
 
@@ -287,8 +290,8 @@ uint64_t bt_field_class_enumeration_get_mapping_count(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ENUM(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ENUM(fc, "Field class");
        return (uint64_t) enum_fc->mappings->len;
 }
 
@@ -298,9 +301,9 @@ bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_VALID_INDEX(index, enum_fc->mappings->len);
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
 }
@@ -311,9 +314,9 @@ bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_VALID_INDEX(index, enum_fc->mappings->len);
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
 }
@@ -321,14 +324,14 @@ bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
 const char *bt_field_class_enumeration_mapping_get_label(
                const struct bt_field_class_enumeration_mapping *mapping)
 {
-       BT_ASSERT_PRE_NON_NULL(mapping, "Enumeration field class mapping");
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Enumeration field class mapping");
        return mapping->label->str;
 }
 
 uint64_t bt_field_class_enumeration_mapping_get_range_count(
                const struct bt_field_class_enumeration_mapping *mapping)
 {
-       BT_ASSERT_PRE_NON_NULL(mapping, "Enumeration field class mapping");
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Enumeration field class mapping");
        return (uint64_t) mapping->ranges->len;
 }
 
@@ -339,10 +342,10 @@ void get_enumeration_field_class_mapping_range_at_index(
 {
        const struct bt_field_class_enumeration_mapping_range *range;
 
-       BT_ASSERT_PRE_NON_NULL(mapping, "Ranges");
-       BT_ASSERT_PRE_NON_NULL(lower, "Range's lower (output)");
-       BT_ASSERT_PRE_NON_NULL(upper, "Range's upper (output)");
-       BT_ASSERT_PRE_VALID_INDEX(index, mapping->ranges->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Ranges");
+       BT_ASSERT_PRE_DEV_NON_NULL(lower, "Range's lower (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(upper, "Range's upper (output)");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, mapping->ranges->len);
        range = BT_FIELD_CLASS_ENUM_MAPPING_RANGE_AT_INDEX(mapping, index);
        *lower = range->lower.u;
        *upper = range->upper.u;
@@ -365,8 +368,8 @@ void bt_field_class_signed_enumeration_mapping_get_range_by_index(
                (uint64_t *) lower, (uint64_t *) upper);
 }
 
-enum bt_field_class_status
-bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
+enum bt_field_class_enumeration_get_mapping_labels_for_value_status
+bt_field_class_unsigned_enumeration_get_mapping_labels_for_value(
                const struct bt_field_class *fc, uint64_t value,
                bt_field_class_enumeration_mapping_label_array *label_array,
                uint64_t *count)
@@ -374,10 +377,10 @@ bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        g_ptr_array_set_size(enum_fc->label_buf, 0);
 
@@ -402,11 +405,11 @@ bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
 
        *label_array = (void *) enum_fc->label_buf->pdata;
        *count = (uint64_t) enum_fc->label_buf->len;
-       return BT_FIELD_CLASS_STATUS_OK;
+       return BT_FUNC_STATUS_OK;
 }
 
-enum bt_field_class_status
-bt_field_class_signed_enumeration_get_mapping_labels_by_value(
+enum bt_field_class_enumeration_get_mapping_labels_for_value_status
+bt_field_class_signed_enumeration_get_mapping_labels_for_value(
                const struct bt_field_class *fc, int64_t value,
                bt_field_class_enumeration_mapping_label_array *label_array,
                uint64_t *count)
@@ -414,10 +417,10 @@ bt_field_class_signed_enumeration_get_mapping_labels_by_value(
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        g_ptr_array_set_size(enum_fc->label_buf, 0);
 
@@ -442,15 +445,16 @@ bt_field_class_signed_enumeration_get_mapping_labels_by_value(
 
        *label_array = (void *) enum_fc->label_buf->pdata;
        *count = (uint64_t) enum_fc->label_buf->len;
-       return BT_FIELD_CLASS_STATUS_OK;
+       return BT_FUNC_STATUS_OK;
 }
 
 static inline
-enum bt_field_class_status add_mapping_to_enumeration_field_class(
+enum bt_field_class_enumeration_map_range_status
+add_mapping_to_enumeration_field_class(
                struct bt_field_class *fc,
                const char *label, uint64_t lower, uint64_t upper)
 {
-       int ret = BT_FIELD_CLASS_STATUS_OK;
+       int ret = BT_FUNC_STATUS_OK;
        uint64_t i;
        struct bt_field_class_enumeration *enum_fc = (void *) fc;
        struct bt_field_class_enumeration_mapping *mapping = NULL;
@@ -481,7 +485,7 @@ enum bt_field_class_status add_mapping_to_enumeration_field_class(
                        finalize_enumeration_field_class_mapping(mapping);
                        g_array_set_size(enum_fc->mappings,
                                enum_fc->mappings->len - 1);
-                       ret = BT_FIELD_CLASS_STATUS_NOMEM;
+                       ret = BT_FUNC_STATUS_MEMORY_ERROR;
                        goto end;
                }
 
@@ -490,7 +494,7 @@ enum bt_field_class_status add_mapping_to_enumeration_field_class(
                        finalize_enumeration_field_class_mapping(mapping);
                        g_array_set_size(enum_fc->mappings,
                                enum_fc->mappings->len - 1);
-                       ret = BT_FIELD_CLASS_STATUS_NOMEM;
+                       ret = BT_FUNC_STATUS_MEMORY_ERROR;
                        goto end;
                }
        }
@@ -502,7 +506,7 @@ enum bt_field_class_status add_mapping_to_enumeration_field_class(
                mapping->ranges->len - 1);
        range->lower.u = lower;
        range->upper.u = upper;
-       BT_LIB_LOGV("Added mapping to enumeration field class: "
+       BT_LIB_LOGD("Added mapping to enumeration field class: "
                "%![fc-]+F, label=\"%s\", lower-unsigned=%" PRIu64 ", "
                "upper-unsigned=%" PRIu64, fc, label, lower, upper);
 
@@ -510,7 +514,8 @@ end:
        return ret;
 }
 
-enum bt_field_class_status bt_field_class_unsigned_enumeration_map_range(
+enum bt_field_class_enumeration_map_range_status
+bt_field_class_unsigned_enumeration_map_range(
                struct bt_field_class *fc, const char *label,
                uint64_t range_lower, uint64_t range_upper)
 {
@@ -535,7 +540,8 @@ enum bt_field_class_status bt_field_class_unsigned_enumeration_map_range(
                range_upper);
 }
 
-enum bt_field_class_status bt_field_class_signed_enumeration_map_range(
+enum bt_field_class_enumeration_map_range_status
+bt_field_class_signed_enumeration_map_range(
                struct bt_field_class *fc, const char *label,
                int64_t range_lower, int64_t range_upper)
 {
@@ -576,7 +582,7 @@ struct bt_field_class *bt_field_class_real_create(bt_trace_class *trace_class)
        BT_LOGD_STR("Creating default real field class object.");
        real_fc = g_new0(struct bt_field_class_real, 1);
        if (!real_fc) {
-               BT_LOGE_STR("Failed to allocate one real field class.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one real field class.");
                goto error;
        }
 
@@ -596,8 +602,8 @@ bt_bool bt_field_class_real_is_single_precision(const struct bt_field_class *fc)
 {
        const struct bt_field_class_real *real_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
        return real_fc->is_single_precision;
 }
 
@@ -608,9 +614,9 @@ void bt_field_class_real_set_is_single_precision(struct bt_field_class *fc,
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        real_fc->is_single_precision = (bool) is_single_precision;
-       BT_LIB_LOGV("Set real field class's \"is single precision\" property: "
+       BT_LIB_LOGD("Set real field class's \"is single precision\" property: "
                "%!+F", fc);
 }
 
@@ -626,14 +632,14 @@ int init_named_field_classes_container(
        fc->named_fcs = g_array_new(FALSE, TRUE,
                sizeof(struct bt_named_field_class));
        if (!fc->named_fcs) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                ret = -1;
                goto end;
        }
 
        fc->name_to_index = g_hash_table_new(g_str_hash, g_str_equal);
        if (!fc->name_to_index) {
-               BT_LOGE_STR("Failed to allocate a GHashTable.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GHashTable.");
                ret = -1;
                goto end;
        }
@@ -701,7 +707,8 @@ struct bt_field_class *bt_field_class_structure_create(
        BT_LOGD_STR("Creating default structure field class object.");
        struct_fc = g_new0(struct bt_field_class_structure, 1);
        if (!struct_fc) {
-               BT_LOGE_STR("Failed to allocate one structure field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one structure field class.");
                goto error;
        }
 
@@ -722,16 +729,16 @@ end:
 }
 
 static
-enum bt_field_class_status append_named_field_class_to_container_field_class(
+int append_named_field_class_to_container_field_class(
                struct bt_field_class_named_field_class_container *container_fc,
                const char *name, struct bt_field_class *fc)
 {
-       int ret = BT_FIELD_CLASS_STATUS_OK;
+       int ret = BT_FUNC_STATUS_OK;
        struct bt_named_field_class *named_fc;
        GString *name_str;
 
        BT_ASSERT(container_fc);
-       BT_ASSERT_PRE_FC_HOT(container_fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(container_fc, "Field class");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE(!bt_g_hash_table_contains(container_fc->name_to_index,
@@ -740,8 +747,8 @@ enum bt_field_class_status append_named_field_class_to_container_field_class(
                "%![container-fc-]+F, name=\"%s\"", container_fc, name);
        name_str = g_string_new(name);
        if (!name_str) {
-               BT_LOGE_STR("Failed to allocate a GString.");
-               ret = BT_FIELD_CLASS_STATUS_NOMEM;
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
+               ret = BT_FUNC_STATUS_MEMORY_ERROR;
                goto end;
        }
 
@@ -766,7 +773,8 @@ end:
        return ret;
 }
 
-enum bt_field_class_status bt_field_class_structure_append_member(
+enum bt_field_class_structure_append_member_status
+bt_field_class_structure_append_member(
                struct bt_field_class *fc, const char *name,
                struct bt_field_class *member_fc)
 {
@@ -783,8 +791,8 @@ uint64_t bt_field_class_structure_get_member_count(
 {
        struct bt_field_class_structure *struct_fc = (void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (uint64_t) struct_fc->common.named_fcs->len;
 }
@@ -796,7 +804,7 @@ borrow_named_field_class_from_container_field_class_at_index(
                uint64_t index)
 {
        BT_ASSERT(fc);
-       BT_ASSERT_PRE_VALID_INDEX(index, fc->named_fcs->len);
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, fc->named_fcs->len);
        return BT_FIELD_CLASS_NAMED_FC_AT_INDEX(fc, index);
 }
 
@@ -804,8 +812,8 @@ const struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_index_const(
                const struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_at_index(
@@ -816,8 +824,8 @@ struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_index(
                struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_at_index(
@@ -835,7 +843,7 @@ borrow_named_field_class_from_container_field_class_by_name(
        gpointer value;
 
        BT_ASSERT(fc);
-       BT_ASSERT_PRE_NON_NULL(name, "Name");
+       BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
        if (!g_hash_table_lookup_extended(fc->name_to_index, name, &orig_key,
                        &value)) {
                goto end;
@@ -852,8 +860,8 @@ const struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_name_const(
                const struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_by_name(
@@ -864,8 +872,8 @@ struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_name(
                struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_by_name(
@@ -877,7 +885,7 @@ const char *bt_field_class_structure_member_get_name(
 {
        const struct bt_named_field_class *named_fc = (const void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->name->str;
 }
 
@@ -887,7 +895,7 @@ bt_field_class_structure_member_borrow_field_class_const(
 {
        const struct bt_named_field_class *named_fc = (const void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->fc;
 }
 
@@ -897,7 +905,7 @@ bt_field_class_structure_member_borrow_field_class(
 {
        struct bt_named_field_class *named_fc = (void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->fc;
 }
 
@@ -926,7 +934,8 @@ struct bt_field_class *bt_field_class_variant_create(
        BT_LOGD_STR("Creating default variant field class object.");
        var_fc = g_new0(struct bt_field_class_variant, 1);
        if (!var_fc) {
-               BT_LOGE_STR("Failed to allocate one variant field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one variant field class.");
                goto error;
        }
 
@@ -946,7 +955,8 @@ end:
        return (void *) var_fc;
 }
 
-enum bt_field_class_status bt_field_class_variant_set_selector_field_class(
+enum bt_field_class_variant_set_selector_field_class_status
+bt_field_class_variant_set_selector_field_class(
                struct bt_field_class *fc,
                struct bt_field_class *selector_fc)
 {
@@ -956,14 +966,15 @@ enum bt_field_class_status bt_field_class_variant_set_selector_field_class(
        BT_ASSERT_PRE_NON_NULL(selector_fc, "Selector field class");
        BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        BT_ASSERT_PRE_FC_IS_ENUM(selector_fc, "Selector field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Variant field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Variant field class");
        var_fc->selector_fc = selector_fc;
        bt_object_get_no_null_check(selector_fc);
        bt_field_class_freeze(selector_fc);
-       return BT_FIELD_CLASS_STATUS_OK;
+       return BT_FUNC_STATUS_OK;
 }
 
-enum bt_field_class_status bt_field_class_variant_append_option(
+enum bt_field_class_variant_append_option_status
+bt_field_class_variant_append_option(
                struct bt_field_class *fc,
                const char *name, struct bt_field_class *option_fc)
 {
@@ -978,8 +989,9 @@ const struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_name_const(
                const struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
+               "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_by_name(
                        (void *) fc, name);
@@ -989,8 +1001,8 @@ struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_name(
                struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_by_name(
                        (void *) fc, name);
@@ -1000,8 +1012,8 @@ uint64_t bt_field_class_variant_get_option_count(const struct bt_field_class *fc
 {
        const struct bt_field_class_variant *var_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (uint64_t) var_fc->common.named_fcs->len;
 }
 
@@ -1009,8 +1021,8 @@ const struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_index_const(
                const struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_at_index(
                        (void *) fc, index);
@@ -1020,8 +1032,8 @@ struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_index(
                struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_at_index(
                        (void *) fc, index);
@@ -1032,7 +1044,7 @@ const char *bt_field_class_variant_option_get_name(
 {
        const struct bt_named_field_class *named_fc = (const void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->name->str;
 }
 
@@ -1042,7 +1054,7 @@ bt_field_class_variant_option_borrow_field_class_const(
 {
        const struct bt_named_field_class *named_fc = (const void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->fc;
 }
 
@@ -1052,7 +1064,7 @@ bt_field_class_variant_option_borrow_field_class(
 {
        struct bt_named_field_class *named_fc = (void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->fc;
 }
 
@@ -1062,8 +1074,8 @@ bt_field_class_variant_borrow_selector_field_path_const(
 {
        const struct bt_field_class_variant *var_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
                "Field class");
        return var_fc->selector_field_path;
 }
@@ -1108,7 +1120,8 @@ bt_field_class_static_array_create(bt_trace_class *trace_class,
        BT_LOGD_STR("Creating default static array field class object.");
        array_fc = g_new0(struct bt_field_class_static_array, 1);
        if (!array_fc) {
-               BT_LOGE_STR("Failed to allocate one static array field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one static array field class.");
                goto error;
        }
 
@@ -1131,8 +1144,8 @@ bt_field_class_array_borrow_element_field_class_const(
 {
        const struct bt_field_class_array *array_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ARRAY(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
        return array_fc->element_fc;
 }
 
@@ -1141,8 +1154,8 @@ bt_field_class_array_borrow_element_field_class(struct bt_field_class *fc)
 {
        struct bt_field_class_array *array_fc = (void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ARRAY(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
        return array_fc->element_fc;
 }
 
@@ -1150,8 +1163,8 @@ uint64_t bt_field_class_static_array_get_length(const struct bt_field_class *fc)
 {
        const struct bt_field_class_static_array *array_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
                "Field class");
        return (uint64_t) array_fc->length;
 }
@@ -1182,7 +1195,8 @@ struct bt_field_class *bt_field_class_dynamic_array_create(
        BT_LOGD_STR("Creating default dynamic array field class object.");
        array_fc = g_new0(struct bt_field_class_dynamic_array, 1);
        if (!array_fc) {
-               BT_LOGE_STR("Failed to allocate one dynamic array field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one dynamic array field class.");
                goto error;
        }
 
@@ -1199,7 +1213,8 @@ end:
        return (void *) array_fc;
 }
 
-enum bt_field_class_status bt_field_class_dynamic_array_set_length_field_class(
+enum bt_field_class_dynamic_array_set_length_field_class_status
+bt_field_class_dynamic_array_set_length_field_class(
                struct bt_field_class *fc,
                struct bt_field_class *length_fc)
 {
@@ -1210,11 +1225,11 @@ enum bt_field_class_status bt_field_class_dynamic_array_set_length_field_class(
        BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
                "Field class");
        BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(length_fc, "Length field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Dynamic array field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Dynamic array field class");
        array_fc->length_fc = length_fc;
        bt_object_get_no_null_check(length_fc);
        bt_field_class_freeze(length_fc);
-       return BT_FIELD_CLASS_STATUS_OK;
+       return BT_FUNC_STATUS_OK;
 }
 
 const struct bt_field_path *
@@ -1223,8 +1238,8 @@ bt_field_class_dynamic_array_borrow_length_field_path_const(
 {
        const struct bt_field_class_dynamic_array *seq_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
                "Field class");
        return seq_fc->length_field_path;
 }
@@ -1245,7 +1260,8 @@ struct bt_field_class *bt_field_class_string_create(bt_trace_class *trace_class)
        BT_LOGD_STR("Creating default string field class object.");
        string_fc = g_new0(struct bt_field_class_string, 1);
        if (!string_fc) {
-               BT_LOGE_STR("Failed to allocate one string field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one string field class.");
                goto error;
        }
 
@@ -1305,7 +1321,7 @@ void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc)
 }
 
 BT_HIDDEN
-void _bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc)
+void bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc)
 {
        struct bt_field_class *fc = (void *) c_fc;
 
This page took 0.035884 seconds and 4 git commands to generate.