| 1 | /* |
| 2 | * SPDX-License-Identifier: MIT |
| 3 | * |
| 4 | * Copyright 2016 Philippe Proulx <pproulx@efficios.com> |
| 5 | * |
| 6 | * The Common Trace Format (CTF) Specification is available at |
| 7 | * http://www.efficios.com/ctf |
| 8 | */ |
| 9 | |
| 10 | #ifndef BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL |
| 11 | #define BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL |
| 12 | |
| 13 | #include "common/common.h" |
| 14 | #include "common/assert.h" |
| 15 | #include "common/macros.h" |
| 16 | #include <babeltrace2-ctf-writer/field-types.h> |
| 17 | #include <glib.h> |
| 18 | |
| 19 | #include "object.h" |
| 20 | |
| 21 | struct bt_ctf_field_path { |
| 22 | struct bt_ctf_object base; |
| 23 | enum bt_ctf_scope root; |
| 24 | |
| 25 | /* |
| 26 | * Array of integers (int) indicating the index in either |
| 27 | * structures, variants, arrays, or sequences that make up |
| 28 | * the path to a field type. -1 means the "current element |
| 29 | * of an array or sequence type". |
| 30 | */ |
| 31 | GArray *indexes; |
| 32 | }; |
| 33 | |
| 34 | BT_HIDDEN |
| 35 | struct bt_ctf_field_path *bt_ctf_field_path_create(void); |
| 36 | |
| 37 | BT_HIDDEN |
| 38 | void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path); |
| 39 | |
| 40 | BT_HIDDEN |
| 41 | struct bt_ctf_field_path *bt_ctf_field_path_copy( |
| 42 | struct bt_ctf_field_path *path); |
| 43 | |
| 44 | BT_HIDDEN enum bt_ctf_scope bt_ctf_field_path_get_root_scope( |
| 45 | const struct bt_ctf_field_path *field_path); |
| 46 | |
| 47 | BT_HIDDEN int64_t bt_ctf_field_path_get_index_count( |
| 48 | const struct bt_ctf_field_path *field_path); |
| 49 | |
| 50 | BT_HIDDEN int bt_ctf_field_path_get_index( |
| 51 | const struct bt_ctf_field_path *field_path, uint64_t index); |
| 52 | |
| 53 | #endif /* BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL */ |