Visibility hidden by default
[babeltrace.git] / src / ctf-writer / field-types.c
index 535267d4b6b9aa44ad42024287e8715746ac58cb..50f943c351bba2b9cda84072e81a12ac5646ff07 100644 (file)
@@ -1,25 +1,7 @@
 /*
- * 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:
+ * SPDX-License-Identifier: MIT
  *
- * 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.
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  */
 
 #define BT_LOG_TAG "CTF-WRITER/FIELD-TYPES"
 
 #include <float.h>
 #include <inttypes.h>
+#include <stdbool.h>
 #include <stdlib.h>
 
-#include <babeltrace2/ctf-writer/fields.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/fields.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/utils.h>
 
 #include "common/assert.h"
 #include "compat/compiler.h"
@@ -53,12 +36,11 @@ void destroy_enumeration_mapping(struct bt_ctf_enumeration_mapping *mapping)
        g_free(mapping);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft,
                bool init_bo, bt_ctf_object_release_func release_func,
                struct bt_ctf_field_type_common_methods *methods)
 {
-       BT_ASSERT(ft && (ft->id > BT_CTF_FIELD_TYPE_ID_UNKNOWN) &&
+       BT_ASSERT_DBG(ft && (ft->id > BT_CTF_FIELD_TYPE_ID_UNKNOWN) &&
                (ft->id < BT_CTF_FIELD_TYPE_ID_NR));
 
        bt_ctf_object_init_shared(&ft->base, release_func);
@@ -71,13 +53,12 @@ void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft,
                BT_LOGD("Setting initial field type's byte order: bo=%s",
                        bt_ctf_byte_order_string(bo));
                ret = bt_ctf_field_type_common_set_byte_order(ft, bo);
-               BT_ASSERT(ret == 0);
+               BT_ASSERT_DBG(ret == 0);
        }
 
        ft->alignment = 1;
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_integer_initialize(
                struct bt_ctf_field_type_common *ft,
                unsigned int size, bt_ctf_object_release_func release_func,
@@ -85,7 +66,7 @@ void bt_ctf_field_type_common_integer_initialize(
 {
        struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft);
 
-       BT_ASSERT(size > 0);
+       BT_ASSERT_DBG(size > 0);
        BT_LOGD("Initializing common integer field type object: size=%u",
                size);
        ft->id = BT_CTF_FIELD_TYPE_ID_INTEGER;
@@ -97,7 +78,6 @@ void bt_ctf_field_type_common_integer_initialize(
                ft, size);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_floating_point_initialize(
                struct bt_ctf_field_type_common *ft,
                bt_ctf_object_release_func release_func,
@@ -115,7 +95,6 @@ void bt_ctf_field_type_common_floating_point_initialize(
                flt_ft->mant_dig);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_enumeration_initialize(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *container_ft,
@@ -124,7 +103,7 @@ void bt_ctf_field_type_common_enumeration_initialize(
 {
        struct bt_ctf_field_type_common_enumeration *enum_ft = BT_CTF_FROM_COMMON(ft);
 
-       BT_ASSERT(container_ft);
+       BT_ASSERT_DBG(container_ft);
        BT_LOGD("Initializing common enumeration field type object: int-ft-addr=%p",
                container_ft);
        ft->id = BT_CTF_FIELD_TYPE_ID_ENUM;
@@ -137,7 +116,6 @@ void bt_ctf_field_type_common_enumeration_initialize(
                bt_ctf_field_type_common_integer_get_size(container_ft));
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_string_initialize(
                struct bt_ctf_field_type_common *ft,
                bt_ctf_object_release_func release_func,
@@ -153,7 +131,6 @@ void bt_ctf_field_type_common_string_initialize(
        BT_LOGD("Initialized common string field type object: addr=%p", ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_structure_initialize(
                struct bt_ctf_field_type_common *ft,
                bt_ctf_object_release_func release_func,
@@ -170,7 +147,6 @@ void bt_ctf_field_type_common_structure_initialize(
        BT_LOGD("Initialized common structure field type object: addr=%p", ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_array_initialize(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *element_ft,
@@ -179,7 +155,7 @@ void bt_ctf_field_type_common_array_initialize(
 {
        struct bt_ctf_field_type_common_array *array_ft = BT_CTF_FROM_COMMON(ft);
 
-       BT_ASSERT(element_ft);
+       BT_ASSERT_DBG(element_ft);
        BT_LOGD("Initializing common array field type object: element-ft-addr=%p, "
                "length=%u", element_ft, length);
        ft->id = BT_CTF_FIELD_TYPE_ID_ARRAY;
@@ -190,7 +166,6 @@ void bt_ctf_field_type_common_array_initialize(
                "element-ft-addr=%p, length=%u", ft, element_ft, length);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_sequence_initialize(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *element_ft,
@@ -200,9 +175,9 @@ void bt_ctf_field_type_common_sequence_initialize(
 {
        struct bt_ctf_field_type_common_sequence *seq_ft = BT_CTF_FROM_COMMON(ft);
 
-       BT_ASSERT(element_ft);
-       BT_ASSERT(length_field_name);
-       BT_ASSERT(bt_ctf_identifier_is_valid(length_field_name));
+       BT_ASSERT_DBG(element_ft);
+       BT_ASSERT_DBG(length_field_name);
+       BT_ASSERT_DBG(bt_ctf_identifier_is_valid(length_field_name));
        BT_LOGD("Initializing common sequence field type object: element-ft-addr=%p, "
                "length-field-name=\"%s\"", element_ft, length_field_name);
        ft->id = BT_CTF_FIELD_TYPE_ID_SEQUENCE;
@@ -214,7 +189,6 @@ void bt_ctf_field_type_common_sequence_initialize(
                ft, element_ft, length_field_name);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_variant_initialize(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *tag_ft,
@@ -224,7 +198,7 @@ void bt_ctf_field_type_common_variant_initialize(
 {
        struct bt_ctf_field_type_common_variant *var_ft = BT_CTF_FROM_COMMON(ft);
 
-       BT_ASSERT(!tag_name || bt_ctf_identifier_is_valid(tag_name));
+       BT_ASSERT_DBG(!tag_name || bt_ctf_identifier_is_valid(tag_name));
        BT_LOGD("Initializing common variant field type object: "
                "tag-ft-addr=%p, tag-field-name=\"%s\"",
                tag_ft, tag_name);
@@ -246,7 +220,6 @@ void bt_ctf_field_type_common_variant_initialize(
                ft, tag_ft, tag_name);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj)
 {
        struct bt_ctf_field_type_common_integer *ft = (void *) obj;
@@ -261,7 +234,6 @@ void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj)
        g_free(ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj)
 {
        struct bt_ctf_field_type_common_floating_point *ft = (void *) obj;
@@ -274,7 +246,6 @@ void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj)
        g_free(ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object *obj)
 {
        struct bt_ctf_field_type_common_enumeration *ft = (void *) obj;
@@ -290,7 +261,6 @@ void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object
        g_free(ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object *obj)
 {
        struct bt_ctf_field_type_common_string *ft = (void *) obj;
@@ -318,7 +288,6 @@ void bt_ctf_field_type_common_structure_field_finalize(
        bt_ctf_object_put_ref(field->type);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object *obj)
 {
        struct bt_ctf_field_type_common_structure *ft = (void *) obj;
@@ -347,7 +316,6 @@ void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object *
        g_free(ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj)
 {
        struct bt_ctf_field_type_common_array *ft = (void *) obj;
@@ -362,7 +330,6 @@ void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj)
        g_free(ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object *obj)
 {
        struct bt_ctf_field_type_common_sequence *ft = (void *) obj;
@@ -399,7 +366,6 @@ void bt_ctf_field_type_common_variant_choice_finalize(
        }
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object *obj)
 {
        struct bt_ctf_field_type_common_variant *ft = (void *) obj;
@@ -556,10 +522,10 @@ int add_structure_variant_member(GArray *members,
 
                member_ft = &choice->type;
                member_name = &choice->name;
-               BT_ASSERT(!choice->ranges);
+               BT_ASSERT_DBG(!choice->ranges);
                choice->ranges = g_array_new(FALSE, TRUE,
                        sizeof(struct bt_ctf_field_type_common_variant_choice_range));
-               BT_ASSERT(choice->ranges);
+               BT_ASSERT_DBG(choice->ranges);
        } else {
                struct bt_ctf_field_type_common_structure_field *field =
                        &g_array_index(members,
@@ -582,7 +548,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common *ft)
 {
        int ret = 0;
@@ -642,7 +607,6 @@ end:
        return iter;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_enumeration_mapping_iterator *
 bt_ctf_field_type_common_enumeration_find_mappings_by_name(
                struct bt_ctf_field_type_common *ft, const char *name)
@@ -693,7 +657,6 @@ end:
        return mapping;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_enumeration_mapping_iterator_next(
                struct bt_ctf_field_type_enumeration_mapping_iterator *iter)
 {
@@ -739,7 +702,7 @@ int bt_ctf_field_type_enumeration_mapping_iterator_next(
                default:
                        BT_LOGF("Invalid enumeration field type mapping iterator type: "
                                "type=%d", iter->type);
-                       abort();
+                       bt_common_abort();
                }
        }
 
@@ -749,7 +712,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_enumeration_mapping_iterator *
 bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
                struct bt_ctf_field_type_common *ft, int64_t value)
@@ -780,7 +742,6 @@ error:
        return NULL;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_enumeration_mapping_iterator *
 bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
                struct bt_ctf_field_type_common *ft, uint64_t value)
@@ -811,7 +772,6 @@ error:
        return NULL;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_enumeration_mapping_iterator_signed_get(
                struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
                const char **mapping_name, int64_t *range_begin,
@@ -826,7 +786,6 @@ int bt_ctf_field_type_enumeration_mapping_iterator_signed_get(
                        mapping_name, range_begin, range_end);
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get(
                struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
                const char **mapping_name, uint64_t *range_begin,
@@ -871,7 +830,7 @@ void bt_ctf_field_type_common_enumeration_set_range_overlap(
                                                        <= 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 {
@@ -879,7 +838,7 @@ void bt_ctf_field_type_common_enumeration_set_range_overlap(
                                                        <= 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;
                                }
                        }
@@ -894,7 +853,6 @@ end:
        }
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_enumeration_validate_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -922,7 +880,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_sequence_validate_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -948,7 +905,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_array_validate_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -965,7 +921,6 @@ int bt_ctf_field_type_common_array_validate_recursive(
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_structure_validate_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -975,14 +930,14 @@ int bt_ctf_field_type_common_structure_validate_recursive(
                bt_ctf_field_type_common_structure_get_field_count(ft);
        int64_t i;
 
-       BT_ASSERT(field_count >= 0);
+       BT_ASSERT_DBG(field_count >= 0);
 
        for (i = 0; i < field_count; ++i) {
                const char *field_name;
 
                ret = bt_ctf_field_type_common_structure_borrow_field_by_index(ft,
                        &field_name, &child_ft, i);
-               BT_ASSERT(ret == 0);
+               BT_ASSERT_DBG(ret == 0);
                ret = bt_ctf_field_type_common_validate(child_ft);
                if (ret) {
                        BT_LOGW("Invalid structure field type: "
@@ -999,7 +954,7 @@ 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) {
@@ -1009,7 +964,6 @@ bt_bool bt_ctf_field_type_common_enumeration_has_overlapping_ranges(
        return enum_ft->has_overlapping_ranges;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_validate_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -1071,7 +1025,7 @@ int bt_ctf_field_type_common_variant_validate_recursive(
 
                ret = bt_ctf_field_type_common_variant_borrow_field_by_index(ft,
                        &field_name, &child_ft, i);
-               BT_ASSERT(ret == 0);
+               BT_ASSERT_DBG(ret == 0);
                ret = bt_ctf_field_type_common_validate(child_ft);
                if (ret) {
                        BT_LOGW("Invalid variant field type: "
@@ -1095,12 +1049,11 @@ end:
  * of the given field type and the properties of its children if
  * applicable.
  */
-BT_HIDDEN
 int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common *ft)
 {
        int ret = 0;
 
-       BT_ASSERT(ft);
+       BT_ASSERT_DBG(ft);
 
        if (ft->valid) {
                /* Already marked as valid */
@@ -1121,7 +1074,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft)
 {
        struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft);
@@ -1132,8 +1084,7 @@ int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *f
        return (int) int_ft->size;
 }
 
-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);
 
@@ -1143,9 +1094,8 @@ bt_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_comm
        return int_ft->is_signed;
 }
 
-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);
@@ -1179,7 +1129,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft,
                unsigned int size)
 {
@@ -1222,7 +1171,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base(
                struct bt_ctf_field_type_common *ft)
 {
@@ -1234,7 +1182,6 @@ enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base(
        return int_ft->base;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common *ft,
                enum bt_ctf_integer_base base)
 {
@@ -1285,7 +1232,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding(
                struct bt_ctf_field_type_common *ft)
 {
@@ -1297,7 +1243,6 @@ enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding(
        return int_ft->encoding;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common *ft,
                enum bt_ctf_string_encoding encoding)
 {
@@ -1342,7 +1287,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
                struct bt_ctf_field_type_common *ft)
 {
@@ -1354,7 +1298,6 @@ struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_
        return int_ft->mapped_clock_class;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_clock_class *clock_class)
@@ -1394,7 +1337,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_integer_set_mapped_clock_class(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_clock_class *clock_class)
@@ -1421,7 +1363,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
                struct bt_ctf_field_type_common *ft, uint64_t index,
                const char **mapping_name, int64_t *range_begin,
@@ -1443,7 +1384,7 @@ int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
 
        if (mapping_name) {
                *mapping_name = g_quark_to_string(mapping->string);
-               BT_ASSERT(*mapping_name);
+               BT_ASSERT_DBG(*mapping_name);
        }
 
        if (range_begin) {
@@ -1458,7 +1399,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
                struct bt_ctf_field_type_common *ft, uint64_t index,
                const char **mapping_name, uint64_t *range_begin,
@@ -1479,7 +1419,7 @@ int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
 
        if (mapping_name) {
                *mapping_name = g_quark_to_string(mapping->string);
-               BT_ASSERT(*mapping_name);
+               BT_ASSERT_DBG(*mapping_name);
        }
 
        if (range_begin) {
@@ -1494,7 +1434,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *
 bt_ctf_field_type_common_enumeration_borrow_container_field_type(
                struct bt_ctf_field_type_common *ft)
@@ -1506,7 +1445,6 @@ bt_ctf_field_type_common_enumeration_borrow_container_field_type(
        return BT_CTF_TO_COMMON(enum_ft->container_ft);
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_enumeration_signed_add_mapping(
                struct bt_ctf_field_type_common *ft, const char *string,
                int64_t range_start, int64_t range_end)
@@ -1596,7 +1534,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
                struct bt_ctf_field_type_common *ft, const char *string,
                uint64_t range_start, uint64_t range_end)
@@ -1686,7 +1623,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
                struct bt_ctf_field_type_common *ft)
 {
@@ -1697,7 +1633,6 @@ int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
        return (int64_t) enum_ft->entries->len;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_floating_point_get_exponent_digits(
                struct bt_ctf_field_type_common *ft)
 {
@@ -1709,7 +1644,6 @@ int bt_ctf_field_type_common_floating_point_get_exponent_digits(
        return (int) flt_ft->exp_dig;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_floating_point_set_exponent_digits(
                struct bt_ctf_field_type_common *ft,
                unsigned int exponent_digits)
@@ -1756,7 +1690,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
                struct bt_ctf_field_type_common *ft)
 {
@@ -1768,7 +1701,6 @@ int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
        return (int) flt_ft->mant_dig;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
                struct bt_ctf_field_type_common *ft, unsigned int mantissa_digits)
 {
@@ -1813,7 +1745,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_structure_replace_field(
                struct bt_ctf_field_type_common *ft,
                const char *field_name,
@@ -1824,10 +1755,10 @@ int bt_ctf_field_type_common_structure_replace_field(
        GQuark name_quark;
        uint64_t i;
 
-       BT_ASSERT(ft);
-       BT_ASSERT(field_name);
-       BT_ASSERT(field_type);
-       BT_ASSERT(ft->id == BT_CTF_FIELD_TYPE_ID_STRUCT);
+       BT_ASSERT_DBG(ft);
+       BT_ASSERT_DBG(field_name);
+       BT_ASSERT_DBG(field_type);
+       BT_ASSERT_DBG(ft->id == BT_CTF_FIELD_TYPE_ID_STRUCT);
        name_quark = g_quark_from_string(field_name);
 
        for (i = 0; i < struct_ft->fields->len; i++) {
@@ -1843,7 +1774,6 @@ int bt_ctf_field_type_common_structure_replace_field(
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *field_type,
                const char *field_name)
@@ -1907,7 +1837,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int64_t bt_ctf_field_type_common_structure_get_field_count(
                struct bt_ctf_field_type_common *ft)
 {
@@ -1919,7 +1848,6 @@ int64_t bt_ctf_field_type_common_structure_get_field_count(
        return (int64_t) struct_ft->fields->len;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_structure_borrow_field_by_index(
                struct bt_ctf_field_type_common *ft,
                const char **field_name,
@@ -1943,13 +1871,12 @@ int bt_ctf_field_type_common_structure_borrow_field_by_index(
 
        if (field_name) {
                *field_name = g_quark_to_string(field->name);
-               BT_ASSERT(*field_name);
+               BT_ASSERT_DBG(*field_name);
        }
 
        return 0;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *
 bt_ctf_field_type_common_structure_borrow_field_type_by_name(
                struct bt_ctf_field_type_common *ft, const char *name)
@@ -1987,7 +1914,6 @@ end:
        return field_type;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *
 bt_ctf_field_type_common_variant_borrow_tag_field_type(
                struct bt_ctf_field_type_common *ft)
@@ -2011,7 +1937,6 @@ end:
        return tag_ft;
 }
 
-BT_HIDDEN
 const char *bt_ctf_field_type_common_variant_get_tag_name(
                struct bt_ctf_field_type_common *ft)
 {
@@ -2034,7 +1959,6 @@ end:
        return tag_name;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_set_tag_name(
                struct bt_ctf_field_type_common *ft, const char *name)
 {
@@ -2077,7 +2001,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *field_type,
                const char *field_name)
@@ -2165,7 +2088,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *
 bt_ctf_field_type_common_variant_borrow_field_type_by_name(
                struct bt_ctf_field_type_common *ft,
@@ -2204,7 +2126,6 @@ end:
        return field_type;
 }
 
-BT_HIDDEN
 int64_t bt_ctf_field_type_common_variant_get_field_count(
                struct bt_ctf_field_type_common *ft)
 {
@@ -2216,7 +2137,6 @@ int64_t bt_ctf_field_type_common_variant_get_field_count(
        return (int64_t) var_ft->choices->len;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_borrow_field_by_index(
                struct bt_ctf_field_type_common *ft,
                const char **field_name,
@@ -2240,13 +2160,12 @@ int bt_ctf_field_type_common_variant_borrow_field_by_index(
 
        if (field_name) {
                *field_name = g_quark_to_string(choice->name);
-               BT_ASSERT(*field_name);
+               BT_ASSERT_DBG(*field_name);
        }
 
        return 0;
 }
 
-BT_HIDDEN
 int64_t bt_ctf_field_type_common_variant_find_choice_index(
                struct bt_ctf_field_type_common *ft, uint64_t uval,
                bool is_signed)
@@ -2255,8 +2174,8 @@ int64_t bt_ctf_field_type_common_variant_find_choice_index(
        uint64_t i;
        struct bt_ctf_field_type_common_variant *var_ft = BT_CTF_FROM_COMMON(ft);
 
-       BT_ASSERT(ft);
-       BT_ASSERT(ft->id == BT_CTF_FIELD_TYPE_ID_VARIANT);
+       BT_ASSERT_DBG(ft);
+       BT_ASSERT_DBG(ft->id == BT_CTF_FIELD_TYPE_ID_VARIANT);
 
        if (bt_ctf_field_type_common_variant_update_choices(ft)) {
                ret = INT64_C(-1);
@@ -2303,7 +2222,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *
 bt_ctf_field_type_common_array_borrow_element_field_type(
                struct bt_ctf_field_type_common *ft)
@@ -2313,11 +2231,10 @@ bt_ctf_field_type_common_array_borrow_element_field_type(
        BT_CTF_ASSERT_PRE_NON_NULL(ft, "Field type");
        BT_CTF_ASSERT_PRE_CTF_FT_COMMON_HAS_ID(ft, BT_CTF_FIELD_TYPE_ID_ARRAY,
                "Field type");
-       BT_ASSERT(array_ft && array_ft->element_ft);
+       BT_ASSERT_DBG(array_ft && array_ft->element_ft);
        return array_ft->element_ft;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_array_set_element_field_type(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *element_ft)
@@ -2357,7 +2274,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common *ft)
 {
        struct bt_ctf_field_type_common_array *array_ft = BT_CTF_FROM_COMMON(ft);
@@ -2368,7 +2284,6 @@ int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_commo
        return (int64_t) array_ft->length;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *bt_ctf_field_type_common_sequence_borrow_element_field_type(
                struct bt_ctf_field_type_common *ft)
 {
@@ -2380,7 +2295,6 @@ struct bt_ctf_field_type_common *bt_ctf_field_type_common_sequence_borrow_elemen
        return seq_ft->element_ft;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_sequence_set_element_field_type(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *element_ft)
@@ -2421,7 +2335,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 const char *bt_ctf_field_type_common_sequence_get_length_field_name(
                struct bt_ctf_field_type_common *ft)
 {
@@ -2434,7 +2347,6 @@ const char *bt_ctf_field_type_common_sequence_get_length_field_name(
                seq_ft->length_field_name->str : NULL;
 }
 
-BT_HIDDEN
 enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding(
                struct bt_ctf_field_type_common *ft)
 {
@@ -2446,7 +2358,6 @@ enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding(
        return string_ft->encoding;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common *ft,
                enum bt_ctf_string_encoding encoding)
 {
@@ -2483,7 +2394,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *ft)
 {
        int ret;
@@ -2503,7 +2413,7 @@ int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *ft)
                struct bt_ctf_field_type_common *element_ft =
                        bt_ctf_field_type_common_sequence_borrow_element_field_type(ft);
 
-               BT_ASSERT(element_ft);
+               BT_ASSERT_DBG(element_ft);
                ret = bt_ctf_field_type_common_get_alignment(element_ft);
                break;
        }
@@ -2512,7 +2422,7 @@ int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *ft)
                struct bt_ctf_field_type_common *element_ft =
                        bt_ctf_field_type_common_array_borrow_element_field_type(ft);
 
-               BT_ASSERT(element_ft);
+               BT_ASSERT_DBG(element_ft);
                ret = bt_ctf_field_type_common_get_alignment(element_ft);
                break;
        }
@@ -2522,7 +2432,7 @@ int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *ft)
 
                element_count = bt_ctf_field_type_common_structure_get_field_count(
                        ft);
-               BT_ASSERT(element_count >= 0);
+               BT_ASSERT_DBG(element_count >= 0);
 
                for (i = 0; i < element_count; i++) {
                        struct bt_ctf_field_type_common *field = NULL;
@@ -2530,8 +2440,8 @@ int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *ft)
 
                        ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
                                ft, NULL, &field, i);
-                       BT_ASSERT(ret == 0);
-                       BT_ASSERT(field);
+                       BT_ASSERT_DBG(ret == 0);
+                       BT_ASSERT_DBG(field);
                        field_alignment = bt_ctf_field_type_common_get_alignment(
                                field);
                        if (field_alignment < 0) {
@@ -2564,7 +2474,6 @@ int is_power_of_two(unsigned int value)
        return ((value & (value - 1)) == 0) && value > 0;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common *ft,
                unsigned int alignment)
 {
@@ -2627,7 +2536,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 enum bt_ctf_byte_order bt_ctf_field_type_common_get_byte_order(
                struct bt_ctf_field_type_common *ft)
 {
@@ -2667,7 +2575,7 @@ enum bt_ctf_byte_order bt_ctf_field_type_common_get_byte_order(
                goto end;
        }
 
-       BT_ASSERT(ret == BT_CTF_BYTE_ORDER_NATIVE ||
+       BT_ASSERT_DBG(ret == BT_CTF_BYTE_ORDER_NATIVE ||
                ret == BT_CTF_BYTE_ORDER_LITTLE_ENDIAN ||
                ret == BT_CTF_BYTE_ORDER_BIG_ENDIAN ||
                ret == BT_CTF_BYTE_ORDER_NETWORK);
@@ -2676,7 +2584,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common *ft,
                enum bt_ctf_byte_order byte_order)
 {
@@ -2717,7 +2624,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id(
                struct bt_ctf_field_type_common *ft)
 {
@@ -2725,18 +2631,16 @@ enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id(
        return ft->id;
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common *ft)
 {
        if (!ft || ft->frozen) {
                return;
        }
 
-       BT_ASSERT(ft->methods->freeze);
+       BT_ASSERT_DBG(ft->methods->freeze);
        ft->methods->freeze(ft);
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *
 bt_ctf_field_type_common_variant_borrow_field_type_signed(
                struct bt_ctf_field_type_common_variant *var_ft,
@@ -2773,7 +2677,6 @@ end:
        return field_type;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *
 bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
                struct bt_ctf_field_type_common_variant *var_ft,
@@ -2810,14 +2713,13 @@ end:
        return field_type;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *bt_ctf_field_type_common_copy(
                struct bt_ctf_field_type_common *ft)
 {
        struct bt_ctf_field_type_common *ft_copy = NULL;
 
        BT_CTF_ASSERT_PRE_NON_NULL(ft, "Field type");
-       BT_ASSERT(ft->methods->copy);
+       BT_ASSERT_DBG(ft->methods->copy);
        ft_copy = ft->methods->copy(ft);
        if (!ft_copy) {
                BT_LOGE_STR("Cannot copy field type.");
@@ -2830,7 +2732,6 @@ end:
        return ft_copy;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_structure_get_field_name_index(
                struct bt_ctf_field_type_common *ft, const char *name)
 {
@@ -2869,7 +2770,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_get_field_name_index(
                struct bt_ctf_field_type_common *ft, const char *name)
 {
@@ -2907,7 +2807,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_sequence_set_length_field_path(
                struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path)
 {
@@ -2937,7 +2836,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_set_tag_field_path(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_path *path)
@@ -2968,7 +2866,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_set_tag_field_type(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_field_type_common *tag_ft)
@@ -3005,13 +2902,11 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common *ft)
 {
        ft->frozen = 1;
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_enumeration_freeze_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -3025,7 +2920,6 @@ void bt_ctf_field_type_common_enumeration_freeze_recursive(
        bt_ctf_field_type_common_freeze(BT_CTF_TO_COMMON(enum_ft->container_ft));
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_structure_freeze_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -3048,7 +2942,6 @@ void bt_ctf_field_type_common_structure_freeze_recursive(
        }
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_update_choices(struct bt_ctf_field_type_common *ft)
 {
        struct bt_ctf_field_type_common_variant *var_ft = BT_CTF_FROM_COMMON(ft);
@@ -3060,7 +2953,7 @@ int bt_ctf_field_type_common_variant_update_choices(struct bt_ctf_field_type_com
                goto end;
        }
 
-       BT_ASSERT(var_ft->tag_ft);
+       BT_ASSERT_DBG(var_ft->tag_ft);
        is_signed = !!var_ft->tag_ft->container_ft->is_signed;
 
        for (i = 0; i < var_ft->choices->len; i++) {
@@ -3076,7 +2969,7 @@ int bt_ctf_field_type_common_variant_update_choices(struct bt_ctf_field_type_com
                        goto end;
                }
 
-               BT_ASSERT(choice->ranges);
+               BT_ASSERT_DBG(choice->ranges);
                g_array_set_size(choice->ranges, 0);
 
                while (bt_ctf_field_type_enumeration_mapping_iterator_next(iter) == 0) {
@@ -3092,7 +2985,7 @@ int bt_ctf_field_type_common_variant_update_choices(struct bt_ctf_field_type_com
                                        &range.lower.u, &range.upper.u);
                        }
 
-                       BT_ASSERT(ret == 0);
+                       BT_ASSERT_DBG(ret == 0);
                        g_array_append_val(choice->ranges, range);
                }
 
@@ -3105,7 +2998,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_variant_freeze_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -3126,7 +3018,6 @@ void bt_ctf_field_type_common_variant_freeze_recursive(
        }
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_array_freeze_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -3141,7 +3032,6 @@ void bt_ctf_field_type_common_array_freeze_recursive(
        bt_ctf_field_type_common_freeze(array_ft->element_ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_sequence_freeze_recursive(
                struct bt_ctf_field_type_common *ft)
 {
@@ -3156,7 +3046,6 @@ void bt_ctf_field_type_common_sequence_freeze_recursive(
        bt_ctf_field_type_common_freeze(seq_ft->element_ft);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_integer_set_byte_order(
                struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order)
 {
@@ -3165,7 +3054,6 @@ void bt_ctf_field_type_common_integer_set_byte_order(
        int_ft->user_byte_order = byte_order;
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
                struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order)
 {
@@ -3175,7 +3063,6 @@ void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
                byte_order);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_floating_point_set_byte_order(
                struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order)
 {
@@ -3184,7 +3071,6 @@ void bt_ctf_field_type_common_floating_point_set_byte_order(
        flt_ft->user_byte_order = byte_order;
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_structure_set_byte_order_recursive(
                struct bt_ctf_field_type_common *ft,
                enum bt_ctf_byte_order byte_order)
@@ -3202,7 +3088,6 @@ void bt_ctf_field_type_common_structure_set_byte_order_recursive(
        }
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_variant_set_byte_order_recursive(
                struct bt_ctf_field_type_common *ft,
                enum bt_ctf_byte_order byte_order)
@@ -3220,7 +3105,6 @@ void bt_ctf_field_type_common_variant_set_byte_order_recursive(
        }
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_array_set_byte_order_recursive(
                struct bt_ctf_field_type_common *ft,
                enum bt_ctf_byte_order byte_order)
@@ -3230,7 +3114,6 @@ void bt_ctf_field_type_common_array_set_byte_order_recursive(
        bt_ctf_field_type_common_set_byte_order(array_ft->element_ft, byte_order);
 }
 
-BT_HIDDEN
 void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
                struct bt_ctf_field_type_common *ft,
                enum bt_ctf_byte_order byte_order)
@@ -3241,7 +3124,6 @@ void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
 }
 
 
-BT_HIDDEN
 int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
 {
@@ -3322,7 +3204,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_floating_point_compare(
                struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
@@ -3409,7 +3290,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_enumeration_compare_recursive(
                struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
@@ -3463,7 +3343,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
 {
@@ -3517,7 +3396,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_structure_compare_recursive(
                struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
@@ -3571,7 +3449,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_variant_compare_recursive(
                struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
@@ -3633,7 +3510,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_array_compare_recursive(
                struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
@@ -3663,7 +3539,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_sequence_compare_recursive(
                struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
@@ -3696,7 +3571,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common *ft_a,
                struct bt_ctf_field_type_common *ft_b)
 {
@@ -3740,7 +3614,7 @@ int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common *ft_a,
                goto end;
        }
 
-       BT_ASSERT(ft_a->methods->compare);
+       BT_ASSERT_DBG(ft_a->methods->compare);
        ret = ft_a->methods->compare(ft_a, ft_b);
        if (ret == 1) {
                BT_LOGT("Field types differ: ft-a-addr=%p, ft-b-addr=%p",
@@ -3751,7 +3625,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common *ft)
 {
        int64_t field_count = -1;
@@ -3780,7 +3653,6 @@ int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common
        return field_count;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type_common *bt_ctf_field_type_common_borrow_field_at_index(
                struct bt_ctf_field_type_common *ft, int index)
 {
@@ -3823,7 +3695,6 @@ end:
        return field_type;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft,
                const char *name)
 {
@@ -3845,7 +3716,6 @@ int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft
        return field_index;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path(
                struct bt_ctf_field_type_common *ft)
 {
@@ -3857,7 +3727,6 @@ struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path
        return var_ft->tag_field_path;
 }
 
-BT_HIDDEN
 struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_path(
                struct bt_ctf_field_type_common *ft)
 {
@@ -3869,7 +3738,6 @@ struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_
        return seq_ft->length_field_path;
 }
 
-BT_HIDDEN
 int bt_ctf_field_type_common_validate_single_clock_class(
                struct bt_ctf_field_type_common *ft,
                struct bt_ctf_clock_class **expected_clock_class)
@@ -3880,7 +3748,7 @@ int bt_ctf_field_type_common_validate_single_clock_class(
                goto end;
        }
 
-       BT_ASSERT(expected_clock_class);
+       BT_ASSERT_DBG(expected_clock_class);
 
        switch (ft->id) {
        case BT_CTF_FIELD_TYPE_ID_INTEGER:
@@ -3940,10 +3808,10 @@ int bt_ctf_field_type_common_validate_single_clock_class(
                        break;
                default:
                        BT_LOGF("Unexpected field type ID: id=%d", ft->id);
-                       abort();
+                       bt_common_abort();
                }
 
-               BT_ASSERT(sub_ft);
+               BT_ASSERT_DBG(sub_ft);
                ret = bt_ctf_field_type_common_validate_single_clock_class(sub_ft,
                        expected_clock_class);
                break;
@@ -3960,7 +3828,7 @@ int bt_ctf_field_type_common_validate_single_clock_class(
 
                        ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
                                ft, &name, &member_type, i);
-                       BT_ASSERT(ret == 0);
+                       BT_ASSERT_DBG(ret == 0);
                        ret = bt_ctf_field_type_common_validate_single_clock_class(
                                member_type, expected_clock_class);
                        if (ret) {
@@ -3986,7 +3854,7 @@ int bt_ctf_field_type_common_validate_single_clock_class(
 
                        ret = bt_ctf_field_type_common_variant_borrow_field_by_index(
                                ft, &name, &member_type, i);
-                       BT_ASSERT(ret == 0);
+                       BT_ASSERT_DBG(ret == 0);
                        ret = bt_ctf_field_type_common_validate_single_clock_class(
                                member_type, expected_clock_class);
                        if (ret) {
@@ -4115,7 +3983,6 @@ static struct bt_ctf_field_type_common_methods bt_ctf_field_type_variant_methods
 typedef int (*bt_ctf_field_type_serialize_func)(struct bt_ctf_field_type_common *,
                struct metadata_context *);
 
-BT_HIDDEN
 int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type,
                struct metadata_context *context)
 {
@@ -4123,8 +3990,8 @@ int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type,
        struct bt_ctf_field_type_common *type_common = (void *) type;
        bt_ctf_field_type_serialize_func serialize_func;
 
-       BT_ASSERT(type);
-       BT_ASSERT(context);
+       BT_ASSERT_DBG(type);
+       BT_ASSERT_DBG(context);
 
        /* Make sure field type is valid before serializing it */
        ret = bt_ctf_field_type_common_validate((void *) type);
@@ -4224,7 +4091,7 @@ int bt_ctf_field_type_integer_serialize(struct bt_ctf_field_type_common *type,
                const char *clock_name = bt_ctf_clock_class_get_name(
                        integer->mapped_clock_class);
 
-               BT_ASSERT(clock_name);
+               BT_ASSERT_DBG(clock_name);
                g_string_append_printf(context->string,
                        "; map = clock.%s.value", clock_name);
        }
@@ -4249,10 +4116,10 @@ int bt_ctf_field_type_enumeration_serialize_recursive(
                "ft-addr=%p, metadata-context-addr=%p", type, context);
        container_type =
                bt_ctf_field_type_common_enumeration_borrow_container_field_type(type);
-       BT_ASSERT(container_type);
+       BT_ASSERT_DBG(container_type);
        container_signed = bt_ctf_field_type_common_integer_is_signed(
                container_type);
-       BT_ASSERT(container_signed >= 0);
+       BT_ASSERT_DBG(container_signed >= 0);
        g_string_append(context->string, "enum : ");
        BT_LOGD_STR("Serializing CTF writer enumeration field type's container field type's metadata.");
        ret = bt_ctf_field_type_serialize_recursive(
@@ -4558,6 +4425,7 @@ int bt_ctf_field_type_string_serialize(struct bt_ctf_field_type_common *type,
        return 0;
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_integer_create(unsigned int size)
 {
        struct bt_ctf_field_type_common_integer *integer = NULL;
@@ -4592,35 +4460,41 @@ end:
        return (void *) integer;
 }
 
+BT_EXPORT
 int bt_ctf_field_type_integer_get_size(struct bt_ctf_field_type *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_EXPORT
+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);
 }
 
+BT_EXPORT
 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);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_integer_set_size(struct bt_ctf_field_type *ft,
                unsigned int size)
 {
        return bt_ctf_field_type_common_integer_set_size((void *) ft, size);
 }
 
+BT_EXPORT
 enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base(
                struct bt_ctf_field_type *ft)
 {
        return (int) bt_ctf_field_type_common_integer_get_base((void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *ft,
                enum bt_ctf_integer_base base)
 {
@@ -4628,12 +4502,14 @@ int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *ft,
                (int) base);
 }
 
+BT_EXPORT
 enum bt_ctf_string_encoding bt_ctf_field_type_integer_get_encoding(
                struct bt_ctf_field_type *ft)
 {
        return (int) bt_ctf_field_type_common_integer_get_encoding((void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *ft,
                enum bt_ctf_string_encoding encoding)
 {
@@ -4641,6 +4517,7 @@ int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *ft,
                (int) encoding);
 }
 
+BT_EXPORT
 struct bt_ctf_clock_class *bt_ctf_field_type_integer_get_mapped_clock_class(
                struct bt_ctf_field_type *ft)
 {
@@ -4648,6 +4525,7 @@ struct bt_ctf_clock_class *bt_ctf_field_type_integer_get_mapped_clock_class(
                (void *) ft));
 }
 
+BT_EXPORT
 int bt_ctf_field_type_integer_set_mapped_clock_class(
                struct bt_ctf_field_type *ft,
                struct bt_ctf_clock_class *clock_class)
@@ -4656,6 +4534,7 @@ int bt_ctf_field_type_integer_set_mapped_clock_class(
                clock_class);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_enumeration_signed_get_mapping_by_index(
                struct bt_ctf_field_type *ft, uint64_t index,
                const char **mapping_name, int64_t *range_begin,
@@ -4665,6 +4544,7 @@ int bt_ctf_field_type_enumeration_signed_get_mapping_by_index(
                (void *) ft, index, mapping_name, range_begin, range_end);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_enumeration_unsigned_get_mapping_by_index(
                struct bt_ctf_field_type *ft, uint64_t index,
                const char **mapping_name, uint64_t *range_begin,
@@ -4674,6 +4554,7 @@ int bt_ctf_field_type_enumeration_unsigned_get_mapping_by_index(
                (void *) ft, index, mapping_name, range_begin, range_end);
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
                struct bt_ctf_field_type *container_ft)
 {
@@ -4719,6 +4600,7 @@ end:
        return (void *) enumeration;
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_field_type(
                struct bt_ctf_field_type *ft)
 {
@@ -4727,6 +4609,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_field_type
                        (void *) ft));
 }
 
+BT_EXPORT
 int bt_ctf_field_type_enumeration_signed_add_mapping(
                struct bt_ctf_field_type *ft, const char *string,
                int64_t range_start, int64_t range_end)
@@ -4735,6 +4618,7 @@ int bt_ctf_field_type_enumeration_signed_add_mapping(
                (void *) ft, string, range_start, range_end);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_enumeration_unsigned_add_mapping(
                struct bt_ctf_field_type *ft, const char *string,
                uint64_t range_start, uint64_t range_end)
@@ -4743,12 +4627,14 @@ int bt_ctf_field_type_enumeration_unsigned_add_mapping(
                (void *) ft, string, range_start, range_end);
 }
 
+BT_EXPORT
 int64_t bt_ctf_field_type_enumeration_get_mapping_count(
                struct bt_ctf_field_type *ft)
 {
        return bt_ctf_field_type_common_enumeration_get_mapping_count((void *) ft);
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void)
 {
        struct bt_ctf_field_type_common_floating_point *floating_point =
@@ -4775,6 +4661,7 @@ end:
        return (void *) floating_point;
 }
 
+BT_EXPORT
 int bt_ctf_field_type_floating_point_get_exponent_digits(
                struct bt_ctf_field_type *ft)
 {
@@ -4782,6 +4669,7 @@ int bt_ctf_field_type_floating_point_get_exponent_digits(
                (void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_floating_point_set_exponent_digits(
                struct bt_ctf_field_type *ft, unsigned int exponent_digits)
 {
@@ -4789,6 +4677,7 @@ int bt_ctf_field_type_floating_point_set_exponent_digits(
                (void *) ft, exponent_digits);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_floating_point_get_mantissa_digits(
                struct bt_ctf_field_type *ft)
 {
@@ -4796,6 +4685,7 @@ int bt_ctf_field_type_floating_point_get_mantissa_digits(
                (void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_floating_point_set_mantissa_digits(
                struct bt_ctf_field_type *ft, unsigned int mantissa_digits)
 {
@@ -4803,6 +4693,7 @@ int bt_ctf_field_type_floating_point_set_mantissa_digits(
                (void *) ft, mantissa_digits);
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void)
 {
        struct bt_ctf_field_type_common_structure *structure =
@@ -4831,6 +4722,7 @@ end:
        return (void *) structure;
 }
 
+BT_EXPORT
 int bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *ft,
                struct bt_ctf_field_type *field_type,
                const char *field_name)
@@ -4839,11 +4731,13 @@ int bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *ft,
                (void *) field_type, field_name);
 }
 
+BT_EXPORT
 int64_t bt_ctf_field_type_structure_get_field_count(struct bt_ctf_field_type *ft)
 {
        return bt_ctf_field_type_common_structure_get_field_count((void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_structure_get_field_by_index(
                struct bt_ctf_field_type *ft,
                const char **field_name,
@@ -4859,6 +4753,7 @@ int bt_ctf_field_type_structure_get_field_by_index(
        return ret;
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name(
                struct bt_ctf_field_type *ft, const char *name)
 {
@@ -4866,6 +4761,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name(
                (void *) ft, name));
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_variant_create(
        struct bt_ctf_field_type *tag_ft, const char *tag_name)
 {
@@ -4906,6 +4802,7 @@ end:
        return (void *) var_ft;
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_field_type(
                struct bt_ctf_field_type *ft)
 {
@@ -4913,17 +4810,20 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_field_type(
                (void *) ft));
 }
 
+BT_EXPORT
 const char *bt_ctf_field_type_variant_get_tag_name(struct bt_ctf_field_type *ft)
 {
        return bt_ctf_field_type_common_variant_get_tag_name((void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_variant_set_tag_name(
                struct bt_ctf_field_type *ft, const char *name)
 {
        return bt_ctf_field_type_common_variant_set_tag_name((void *) ft, name);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *ft,
                struct bt_ctf_field_type *field_type,
                const char *field_name)
@@ -4932,6 +4832,7 @@ int bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *ft,
                (void *) field_type, field_name);
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name(
                struct bt_ctf_field_type *ft,
                const char *field_name)
@@ -4940,6 +4841,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name(
                (void *) ft, field_name));
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
                struct bt_ctf_field_type *ft,
                struct bt_ctf_field *tag_field)
@@ -4961,14 +4863,14 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
                "Tag field");
 
        container = bt_ctf_field_enumeration_borrow_container(tag_field);
-       BT_ASSERT(container);
+       BT_ASSERT_DBG(container);
 
        if (var_ft->tag_ft->container_ft->is_signed) {
                int64_t val;
 
                ret = bt_ctf_field_integer_signed_get_value(container,
                        &val);
-               BT_ASSERT(ret == 0);
+               BT_ASSERT_DBG(ret == 0);
                choice_index = bt_ctf_field_type_common_variant_find_choice_index(
                        (void *) ft, (uint64_t) val, true);
        } else {
@@ -4976,7 +4878,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
 
                ret = bt_ctf_field_integer_unsigned_get_value(container,
                        &val);
-               BT_ASSERT(ret == 0);
+               BT_ASSERT_DBG(ret == 0);
                choice_index = bt_ctf_field_type_common_variant_find_choice_index(
                        (void *) ft, val, false);
        }
@@ -4989,17 +4891,19 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
 
        ret = bt_ctf_field_type_variant_get_field_by_index(ft, NULL,
                &ret_ft, choice_index);
-       BT_ASSERT(ret == 0);
+       BT_ASSERT_DBG(ret == 0);
 
 end:
        return ret_ft;
 }
 
+BT_EXPORT
 int64_t bt_ctf_field_type_variant_get_field_count(struct bt_ctf_field_type *ft)
 {
        return bt_ctf_field_type_common_variant_get_field_count((void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_variant_get_field_by_index(struct bt_ctf_field_type *ft,
                const char **field_name, struct bt_ctf_field_type **field_type,
                uint64_t index)
@@ -5014,6 +4918,7 @@ int bt_ctf_field_type_variant_get_field_by_index(struct bt_ctf_field_type *ft,
        return ret;
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_array_create(
                struct bt_ctf_field_type *element_ft, unsigned int length)
 {
@@ -5056,6 +4961,7 @@ end:
        return (void *) array;
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_field_type(
                struct bt_ctf_field_type *ft)
 {
@@ -5063,11 +4969,13 @@ struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_field_type(
                (void *) ft));
 }
 
+BT_EXPORT
 int64_t bt_ctf_field_type_array_get_length(struct bt_ctf_field_type *ft)
 {
        return bt_ctf_field_type_common_array_get_length((void *) ft);
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_sequence_create(
                struct bt_ctf_field_type *element_ft,
                const char *length_field_name)
@@ -5112,6 +5020,7 @@ end:
        return (void *) sequence;
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_field_type(
                struct bt_ctf_field_type *ft)
 {
@@ -5119,12 +5028,14 @@ struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_field_type(
                (void *) ft));
 }
 
+BT_EXPORT
 const char *bt_ctf_field_type_sequence_get_length_field_name(
                struct bt_ctf_field_type *ft)
 {
        return bt_ctf_field_type_common_sequence_get_length_field_name((void *) ft);
 }
 
+BT_EXPORT
 struct bt_ctf_field_type *bt_ctf_field_type_string_create(void)
 {
        struct bt_ctf_field_type_common_string *string =
@@ -5146,12 +5057,14 @@ struct bt_ctf_field_type *bt_ctf_field_type_string_create(void)
        return (void *) string;
 }
 
+BT_EXPORT
 enum bt_ctf_string_encoding bt_ctf_field_type_string_get_encoding(
                struct bt_ctf_field_type *ft)
 {
        return (int) bt_ctf_field_type_common_string_get_encoding((void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *ft,
                enum bt_ctf_string_encoding encoding)
 {
@@ -5159,23 +5072,27 @@ int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *ft,
                (int) encoding);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *ft)
 {
        return bt_ctf_field_type_common_get_alignment((void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *ft,
                unsigned int alignment)
 {
        return bt_ctf_field_type_common_set_alignment((void *) ft, alignment);
 }
 
+BT_EXPORT
 enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(
                struct bt_ctf_field_type *ft)
 {
        return (int) bt_ctf_field_type_common_get_byte_order((void *) ft);
 }
 
+BT_EXPORT
 int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *ft,
                enum bt_ctf_byte_order byte_order)
 {
@@ -5183,13 +5100,13 @@ int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *ft,
                (int) byte_order);
 }
 
+BT_EXPORT
 enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id(
                struct bt_ctf_field_type *ft)
 {
        return (int) bt_ctf_field_type_common_get_type_id((void *) ft);
 }
 
-BT_HIDDEN
 struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *ft)
 {
        return (void *) bt_ctf_field_type_common_copy((void *) ft);
@@ -5435,7 +5352,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_copy_recursive(
                /* Copy ranges */
                copy_entry->ranges = g_array_new(FALSE, TRUE,
                        sizeof(struct bt_ctf_field_type_common_variant_choice_range));
-               BT_ASSERT(copy_entry->ranges);
+               BT_ASSERT_DBG(copy_entry->ranges);
                g_array_set_size(copy_entry->ranges, entry->ranges->len);
 
                for (range_i = 0; range_i < entry->ranges->len; range_i++) {
This page took 0.045466 seconds and 4 git commands to generate.