Document libbabeltrace2's C API
[babeltrace.git] / src / lib / trace-ir / field-path.c
index 32d805524fa3ee46e73a62a64890e9fe6eea4b7a..d91db38bfbbee257fbf4981c4d136aca5450bb85 100644 (file)
  */
 
 #define BT_LOG_TAG "LIB/FIELD-PATH"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/field-class.h>
-#include <babeltrace2/trace-ir/field-path-const.h>
+#include <babeltrace2/trace-ir/field-path.h>
 #include <limits.h>
 #include <stdint.h>
 #include <inttypes.h>
@@ -57,7 +57,7 @@ struct bt_field_path *bt_field_path_create(void)
 
        field_path = g_new0(struct bt_field_path, 1);
        if (!field_path) {
-               BT_LOGE_STR("Failed to allocate one field path.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one field path.");
                goto error;
        }
 
@@ -65,7 +65,7 @@ struct bt_field_path *bt_field_path_create(void)
        field_path->items = g_array_new(FALSE, FALSE,
                sizeof(struct bt_field_path_item));
        if (!field_path->items) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                goto error;
        }
 
@@ -79,39 +79,39 @@ end:
        return field_path;
 }
 
-enum bt_scope bt_field_path_get_root_scope(
+enum bt_field_path_scope bt_field_path_get_root_scope(
                const struct bt_field_path *field_path)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path, "Field path");
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
        return field_path->root;
 }
 
 uint64_t bt_field_path_get_item_count(const struct bt_field_path *field_path)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path, "Field path");
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
        return (uint64_t) field_path->items->len;
 }
 
 const struct bt_field_path_item *bt_field_path_borrow_item_by_index_const(
                const struct bt_field_path *field_path, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path, "Field path");
-       BT_ASSERT_PRE_VALID_INDEX(index, field_path->items->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, field_path->items->len);
        return bt_field_path_borrow_item_by_index_inline(field_path, index);
 }
 
 enum bt_field_path_item_type bt_field_path_item_get_type(
                const struct bt_field_path_item *field_path_item)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path_item, "Field path item");
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path_item, "Field path item");
        return field_path_item->type;
 }
 
 uint64_t bt_field_path_item_index_get_index(
                const struct bt_field_path_item *field_path_item)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path_item, "Field path item");
-       BT_ASSERT_PRE(field_path_item->type == BT_FIELD_PATH_ITEM_TYPE_INDEX,
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path_item, "Field path item");
+       BT_ASSERT_PRE_DEV(field_path_item->type == BT_FIELD_PATH_ITEM_TYPE_INDEX,
                "Field path item is not an index field path item: "
                "addr=%p, type=%s", field_path_item,
                bt_field_path_item_type_string(field_path_item->type));
This page took 0.027238 seconds and 4 git commands to generate.