Commit | Line | Data |
---|---|---|
b011f6b0 PP |
1 | #ifndef BABELTRACE_CTF_IR_FIELD_PATH |
2 | #define BABELTRACE_CTF_IR_FIELD_PATH | |
3 | ||
4 | /* | |
5 | * BabelTrace - CTF IR: Field path | |
6 | * | |
7 | * Copyright 2016 Philippe Proulx <pproulx@efficios.com> | |
8 | * | |
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | * of this software and associated documentation files (the "Software"), to deal | |
11 | * in the Software without restriction, including without limitation the rights | |
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
13 | * copies of the Software, and to permit persons to whom the Software is | |
14 | * furnished to do so, subject to the following conditions: | |
15 | * | |
16 | * The above copyright notice and this permission notice shall be included in | |
17 | * all copies or substantial portions of the Software. | |
18 | * | |
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
25 | * SOFTWARE. | |
26 | * | |
27 | * The Common Trace Format (CTF) Specification is available at | |
28 | * http://www.efficios.com/ctf | |
29 | */ | |
30 | ||
2e33ac5a | 31 | #include <babeltrace/ctf-ir/field-types.h> |
b011f6b0 PP |
32 | |
33 | #ifdef __cplusplus | |
34 | extern "C" { | |
35 | #endif | |
36 | ||
37 | struct bt_ctf_field_path; | |
38 | ||
39 | /* | |
b74f1a20 | 40 | * bt_ctf_field_path_get_root_scope: get the root node of a field path. |
b011f6b0 PP |
41 | * |
42 | * Get the field path's root node. | |
43 | * | |
44 | * @param field_path Field path. | |
45 | * | |
46 | * Returns the root node of a field path, or BT_CTF_SCOPE_UNKNOWN on error. | |
47 | */ | |
b74f1a20 | 48 | extern enum bt_ctf_scope bt_ctf_field_path_get_root_scope( |
b011f6b0 PP |
49 | const struct bt_ctf_field_path *field_path); |
50 | ||
51 | /* | |
52 | * bt_ctf_field_path_get_index_count: get the number of indexes of a field path. | |
53 | * | |
54 | * Get the number of indexes of a field path. | |
55 | * | |
56 | * @param field_path Field path. | |
57 | * | |
58 | * Returns the field path's index count, or a negative value on error. | |
59 | */ | |
60 | extern int bt_ctf_field_path_get_index_count( | |
61 | const struct bt_ctf_field_path *field_path); | |
62 | ||
63 | /* | |
64 | * bt_ctf_field_path_get_index: get the field path's index at a specific index. | |
65 | * | |
66 | * Get the field path's index at a specific index. | |
67 | * | |
68 | * @param field_path Field path. | |
69 | * @param index Index. | |
70 | * | |
71 | * Returns a field path index, or INT_MIN on error. | |
72 | */ | |
73 | extern int bt_ctf_field_path_get_index( | |
74 | const struct bt_ctf_field_path *field_path, | |
75 | int index); | |
76 | ||
77 | #ifdef __cplusplus | |
78 | } | |
79 | #endif | |
80 | ||
81 | #endif /* BABELTRACE_CTF_IR_FIELD_PATH */ |