Fix: headers: add missing end of `extern "C"` curly brackets (for C++)
[babeltrace.git] / include / babeltrace / common-internal.h
index 306fd9bdb520fe66f9d1c827209b3e50d9f5d2af..0e84e8fa49007b706e1214195cb1507e14a34eb1 100644 (file)
@@ -432,7 +432,7 @@ const char *bt_common_value_type_string(enum bt_value_type type)
 };
 
 static inline
-GString *bt_field_path_string(struct bt_field_path *path)
+GString *bt_common_field_path_string(struct bt_field_path *path)
 {
        GString *str = g_string_new(NULL);
        uint64_t i;
@@ -446,9 +446,21 @@ GString *bt_field_path_string(struct bt_field_path *path)
        g_string_append_printf(str, "[%s", bt_common_scope_string(
                bt_field_path_get_root_scope(path)));
 
-       for (i = 0; i < bt_field_path_get_index_count(path); i++) {
-               g_string_append_printf(str, ", %" PRIu64,
-                       bt_field_path_get_index_by_index(path, i));
+       for (i = 0; i < bt_field_path_get_item_count(path); i++) {
+               const struct bt_field_path_item *fp_item =
+                       bt_field_path_borrow_item_by_index_const(path, i);
+
+               switch (bt_field_path_item_get_type(fp_item)) {
+               case BT_FIELD_PATH_ITEM_TYPE_INDEX:
+                       g_string_append_printf(str, ", %" PRIu64,
+                               bt_field_path_item_index_get_index(fp_item));
+                       break;
+               case BT_FIELD_PATH_ITEM_TYPE_CURRENT_ARRAY_ELEMENT:
+                       g_string_append(str, ", <CUR>");
+                       break;
+               default:
+                       abort();
+               }
        }
 
        g_string_append(str, "]");
@@ -458,7 +470,7 @@ end:
 }
 
 static inline
-const char *bt_self_message_iterator_status_string(
+const char *bt_common_self_message_iterator_status_string(
                enum bt_self_message_iterator_status status)
 {
        switch (status) {
@@ -568,4 +580,10 @@ end:
        return ret;
 }
 
+static inline
+enum bt_self_message_iterator_status bt_common_message_iterator_status_to_self(
+               enum bt_message_iterator_status status)
+{
+       return (int) status;
+}
 #endif /* BABELTRACE_COMMON_INTERNAL_H */
This page took 0.033767 seconds and 4 git commands to generate.