Commit | Line | Data |
---|---|---|
924dc299 PP |
1 | #ifndef BABELTRACE2_TRACE_IR_FIELD_CLASS_H |
2 | #define BABELTRACE2_TRACE_IR_FIELD_CLASS_H | |
5cd6d0e5 PP |
3 | |
4 | /* | |
e2f7325d | 5 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
5cd6d0e5 PP |
6 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
7 | * | |
5cd6d0e5 PP |
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
9 | * of this software and associated documentation files (the "Software"), to deal | |
10 | * in the Software without restriction, including without limitation the rights | |
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
12 | * copies of the Software, and to permit persons to whom the Software is | |
13 | * furnished to do so, subject to the following conditions: | |
14 | * | |
15 | * The above copyright notice and this permission notice shall be included in | |
16 | * all copies or substantial portions of the Software. | |
17 | * | |
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
24 | * SOFTWARE. | |
25 | * | |
26 | * The Common Trace Format (CTF) Specification is available at | |
27 | * http://www.efficios.com/ctf | |
28 | */ | |
29 | ||
4fa90f32 PP |
30 | #ifndef __BT_IN_BABELTRACE_H |
31 | # error "Please include <babeltrace2/babeltrace.h> instead." | |
32 | #endif | |
33 | ||
d24d5663 PP |
34 | #include <stdint.h> |
35 | #include <stddef.h> | |
36 | ||
3fadfbc0 | 37 | #include <babeltrace2/types.h> |
3fadfbc0 | 38 | #include <babeltrace2/trace-ir/field-class-const.h> |
40f4ba76 | 39 | |
5cd6d0e5 PP |
40 | #ifdef __cplusplus |
41 | extern "C" { | |
42 | #endif | |
43 | ||
1122a43a PP |
44 | extern bt_field_class *bt_field_class_unsigned_integer_create( |
45 | bt_trace_class *trace_class); | |
5cd6d0e5 | 46 | |
1122a43a PP |
47 | extern bt_field_class *bt_field_class_signed_integer_create( |
48 | bt_trace_class *trace_class); | |
40f4ba76 PP |
49 | |
50 | extern void bt_field_class_integer_set_field_value_range( | |
b19ff26f | 51 | bt_field_class *field_class, uint64_t size); |
40f4ba76 PP |
52 | |
53 | extern void bt_field_class_integer_set_preferred_display_base( | |
b19ff26f | 54 | bt_field_class *field_class, |
4cdfc5e8 | 55 | bt_field_class_integer_preferred_display_base base); |
40f4ba76 | 56 | |
1122a43a | 57 | extern bt_field_class *bt_field_class_real_create(bt_trace_class *trace_class); |
40f4ba76 PP |
58 | |
59 | extern void bt_field_class_real_set_is_single_precision( | |
b19ff26f | 60 | bt_field_class *field_class, |
40f4ba76 PP |
61 | bt_bool is_single_precision); |
62 | ||
1122a43a PP |
63 | extern bt_field_class *bt_field_class_unsigned_enumeration_create( |
64 | bt_trace_class *trace_class); | |
40f4ba76 | 65 | |
1122a43a PP |
66 | extern bt_field_class *bt_field_class_signed_enumeration_create( |
67 | bt_trace_class *trace_class); | |
40f4ba76 | 68 | |
d24d5663 PP |
69 | typedef enum bt_field_class_enumeration_map_range_status { |
70 | BT_FIELD_CLASS_ENUMERATION_MAP_RANGE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
71 | BT_FIELD_CLASS_ENUMERATION_MAP_RANGE_STATUS_OK = __BT_FUNC_STATUS_OK, | |
72 | } bt_field_class_enumeration_map_range_status; | |
73 | ||
74 | extern bt_field_class_enumeration_map_range_status | |
75 | bt_field_class_unsigned_enumeration_map_range( | |
b19ff26f | 76 | bt_field_class *field_class, const char *label, |
40f4ba76 PP |
77 | uint64_t range_lower, uint64_t range_upper); |
78 | ||
d24d5663 PP |
79 | extern bt_field_class_enumeration_map_range_status |
80 | bt_field_class_signed_enumeration_map_range( | |
b19ff26f | 81 | bt_field_class *field_class, const char *label, |
40f4ba76 PP |
82 | int64_t range_lower, int64_t range_upper); |
83 | ||
1122a43a PP |
84 | extern bt_field_class *bt_field_class_string_create( |
85 | bt_trace_class *trace_class); | |
40f4ba76 | 86 | |
1122a43a PP |
87 | extern bt_field_class *bt_field_class_structure_create( |
88 | bt_trace_class *trace_class); | |
40f4ba76 | 89 | |
d24d5663 PP |
90 | typedef enum bt_field_class_structure_append_member_status { |
91 | BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
92 | BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK = __BT_FUNC_STATUS_OK, | |
93 | } bt_field_class_structure_append_member_status; | |
94 | ||
95 | extern bt_field_class_structure_append_member_status | |
96 | bt_field_class_structure_append_member( | |
b19ff26f PP |
97 | bt_field_class *struct_field_class, |
98 | const char *name, bt_field_class *field_class); | |
40f4ba76 | 99 | |
1e6fd1d7 PP |
100 | extern bt_field_class_structure_member * |
101 | bt_field_class_structure_borrow_member_by_index( | |
102 | bt_field_class *field_class, uint64_t index); | |
740faaf4 | 103 | |
1e6fd1d7 PP |
104 | extern bt_field_class_structure_member * |
105 | bt_field_class_structure_borrow_member_by_name( | |
740faaf4 PP |
106 | bt_field_class *field_class, const char *name); |
107 | ||
b19ff26f | 108 | extern bt_field_class *bt_field_class_static_array_create( |
1122a43a | 109 | bt_trace_class *trace_class, |
b19ff26f | 110 | bt_field_class *elem_field_class, uint64_t length); |
40f4ba76 | 111 | |
b19ff26f | 112 | extern bt_field_class *bt_field_class_dynamic_array_create( |
1122a43a | 113 | bt_trace_class *trace_class, |
b19ff26f | 114 | bt_field_class *elem_field_class); |
40f4ba76 | 115 | |
740faaf4 PP |
116 | extern bt_field_class *bt_field_class_array_borrow_element_field_class( |
117 | bt_field_class *field_class); | |
118 | ||
d24d5663 PP |
119 | typedef enum bt_field_class_dynamic_array_set_length_field_class_status { |
120 | BT_FIELD_CLASS_DYNAMIC_ARRAY_SET_LENGTH_FIELD_CLASS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
121 | BT_FIELD_CLASS_DYNAMIC_ARRAY_SET_LENGTH_FIELD_CLASS_STATUS_OK = __BT_FUNC_STATUS_OK, | |
122 | } bt_field_class_dynamic_array_set_length_field_class_status; | |
123 | ||
124 | extern bt_field_class_dynamic_array_set_length_field_class_status | |
4295b9e0 | 125 | bt_field_class_dynamic_array_set_length_field_class( |
b19ff26f PP |
126 | bt_field_class *field_class, |
127 | bt_field_class *length_field_class); | |
40f4ba76 | 128 | |
1122a43a PP |
129 | extern bt_field_class *bt_field_class_variant_create( |
130 | bt_trace_class *trace_class); | |
40f4ba76 | 131 | |
d24d5663 PP |
132 | typedef enum bt_field_class_variant_set_selector_field_class_status { |
133 | BT_FIELD_CLASS_VARIANT_SET_SELECTOR_FIELD_CLASS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
134 | BT_FIELD_CLASS_VARIANT_SET_SELECTOR_FIELD_CLASS_STATUS_OK = __BT_FUNC_STATUS_OK, | |
135 | } bt_field_class_variant_set_selector_field_class_status; | |
136 | ||
137 | extern bt_field_class_variant_set_selector_field_class_status | |
4295b9e0 | 138 | bt_field_class_variant_set_selector_field_class(bt_field_class *field_class, |
b19ff26f | 139 | bt_field_class *selector_field_class); |
40f4ba76 | 140 | |
d24d5663 PP |
141 | typedef enum bt_field_class_variant_append_option_status { |
142 | BT_FIELD_CLASS_VARIANT_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
143 | BT_FIELD_CLASS_VARIANT_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK, | |
144 | } bt_field_class_variant_append_option_status; | |
145 | ||
146 | extern bt_field_class_variant_append_option_status | |
147 | bt_field_class_variant_append_option( | |
b19ff26f PP |
148 | bt_field_class *var_field_class, |
149 | const char *name, bt_field_class *field_class); | |
5cd6d0e5 | 150 | |
1e6fd1d7 PP |
151 | extern bt_field_class_variant_option * |
152 | bt_field_class_variant_borrow_option_by_index( | |
153 | bt_field_class *field_class, uint64_t index); | |
740faaf4 | 154 | |
1e6fd1d7 PP |
155 | extern bt_field_class_variant_option * |
156 | bt_field_class_variant_borrow_option_by_name( | |
7c06e353 | 157 | bt_field_class *field_class, const char *name); |
1e6fd1d7 PP |
158 | |
159 | extern bt_field_class *bt_field_class_variant_option_borrow_field_class( | |
160 | bt_field_class_variant_option *option); | |
740faaf4 | 161 | |
5cd6d0e5 PP |
162 | #ifdef __cplusplus |
163 | } | |
164 | #endif | |
165 | ||
924dc299 | 166 | #endif /* BABELTRACE2_TRACE_IR_FIELD_CLASS_H */ |