-BT_HIDDEN
-struct bt_ctf_field_path *bt_ctf_field_path_create(void)
-{
- struct bt_ctf_field_path *field_path = NULL;
-
- field_path = g_new0(struct bt_ctf_field_path, 1);
- if (!field_path) {
- goto end;
- }
-
- field_path->root = CTF_NODE_UNKNOWN;
- field_path->path_indexes = g_array_new(TRUE, FALSE, sizeof(int));
- if (!field_path->path_indexes) {
- bt_ctf_field_path_destroy(field_path);
- field_path = NULL;
- }
-end:
- return field_path;
-}
-
-BT_HIDDEN
-void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path)
-{
- if (field_path->path_indexes->len > 0) {
- g_array_remove_range(field_path->path_indexes, 0,
- field_path->path_indexes->len);
- }
-}
-
-BT_HIDDEN
-struct bt_ctf_field_path *bt_ctf_field_path_copy(
- struct bt_ctf_field_path *path)
-{
- struct bt_ctf_field_path *new_path = bt_ctf_field_path_create();
-
- if (!new_path) {
- goto end;
- }
-
- new_path->root = path->root;
- g_array_insert_vals(new_path->path_indexes, 0,
- path->path_indexes->data, path->path_indexes->len);
-end:
- return new_path;
-}
-
-BT_HIDDEN
-void bt_ctf_field_path_destroy(struct bt_ctf_field_path *path)
-{
- if (!path) {
- return;
- }
-
- if (path->path_indexes) {
- g_array_free(path->path_indexes, TRUE);
- }
- g_free(path);
-}
-