Make API CTF-agnostic
[babeltrace.git] / include / babeltrace / ctf-ir / field-path-internal.h
index b270094baaffd20691f3a7be7903d6dd7e70fa00..f8cb13674a70faea105ce198df4521a338617c1f 100644 (file)
  */
 
 #include <babeltrace/object-internal.h>
+#include <babeltrace/ctf-ir/field-path.h>
+#include <babeltrace/assert-internal.h>
 #include <glib.h>
 
-struct bt_ctf_field_path {
+struct bt_field_path {
        struct bt_object base;
-       enum bt_ctf_scope root;
+       enum bt_scope root;
 
-       /*
-        * Array of integers (int) indicating the index in either
-        * structures, variants, arrays, or sequences that make up
-        * the path to a field type. -1 means the "current element
-        * of an array or sequence type".
-        */
+       /* Array of `uint64_t` (indexes) */
        GArray *indexes;
 };
 
 BT_HIDDEN
-struct bt_ctf_field_path *bt_ctf_field_path_create(void);
-
-BT_HIDDEN
-void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path);
-
-BT_HIDDEN
-struct bt_ctf_field_path *bt_ctf_field_path_copy(
-               struct bt_ctf_field_path *path);
-
-BT_HIDDEN
-GString *bt_ctf_field_path_string(struct bt_ctf_field_path *path);
+struct bt_field_path *bt_field_path_create(void);
+
+static inline
+uint64_t bt_field_path_get_index_by_index_inline(
+               struct bt_field_path *field_path, uint64_t index)
+{
+       BT_ASSERT(field_path);
+       BT_ASSERT(index < field_path->indexes->len);
+       return g_array_index(field_path->indexes, uint64_t, index);
+}
 
 #endif /* BABELTRACE_CTF_IR_FIELD_PATH_INTERNAL */
This page took 0.025826 seconds and 4 git commands to generate.