Commit | Line | Data |
---|---|---|
16ca5ff0 | 1 | /* |
0235b0db | 2 | * SPDX-License-Identifier: MIT |
16ca5ff0 | 3 | * |
0235b0db | 4 | * Copyright 2016 Philippe Proulx <pproulx@efficios.com> |
16ca5ff0 PP |
5 | * |
6 | * The Common Trace Format (CTF) Specification is available at | |
7 | * http://www.efficios.com/ctf | |
8 | */ | |
9 | ||
0235b0db MJ |
10 | #ifndef BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL |
11 | #define BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL | |
12 | ||
578e048b MJ |
13 | #include "common/common.h" |
14 | #include "common/assert.h" | |
91d81473 | 15 | #include "common/macros.h" |
217cf9d3 | 16 | #include <babeltrace2-ctf-writer/field-types.h> |
16ca5ff0 PP |
17 | #include <glib.h> |
18 | ||
578e048b MJ |
19 | #include "object.h" |
20 | ||
16ca5ff0 | 21 | struct bt_ctf_field_path { |
e1e02a22 | 22 | struct bt_ctf_object base; |
16ca5ff0 PP |
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 | ||
16ca5ff0 PP |
34 | struct bt_ctf_field_path *bt_ctf_field_path_create(void); |
35 | ||
16ca5ff0 PP |
36 | void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path); |
37 | ||
16ca5ff0 PP |
38 | struct bt_ctf_field_path *bt_ctf_field_path_copy( |
39 | struct bt_ctf_field_path *path); | |
40 | ||
1353b066 | 41 | enum bt_ctf_scope bt_ctf_field_path_get_root_scope( |
16ca5ff0 PP |
42 | const struct bt_ctf_field_path *field_path); |
43 | ||
1353b066 | 44 | int64_t bt_ctf_field_path_get_index_count( |
16ca5ff0 PP |
45 | const struct bt_ctf_field_path *field_path); |
46 | ||
1353b066 | 47 | int bt_ctf_field_path_get_index( |
16ca5ff0 PP |
48 | const struct bt_ctf_field_path *field_path, uint64_t index); |
49 | ||
50 | #endif /* BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL */ |