lib: Make bt_value_null a const pointer
[babeltrace.git] / bindings / python / bt2 / bt2 / native_btft.i
1 /*
2 * The MIT License (MIT)
3 *
4 * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24
25 /* Type */
26 struct bt_field_type;
27
28 /* Common enumerations */
29 enum bt_scope {
30 BT_SCOPE_UNKNOWN = -1,
31 BT_SCOPE_TRACE_PACKET_HEADER = 1,
32 BT_SCOPE_STREAM_PACKET_CONTEXT = 2,
33 BT_SCOPE_STREAM_EVENT_HEADER = 3,
34 BT_SCOPE_STREAM_EVENT_CONTEXT = 4,
35 BT_SCOPE_EVENT_CONTEXT = 5,
36 BT_SCOPE_EVENT_PAYLOAD = 6,
37 BT_SCOPE_ENV = 0,
38 BT_SCOPE_EVENT_FIELDS = 6,
39 };
40
41 enum bt_field_type_id {
42 BT_FIELD_TYPE_ID_UNKNOWN = -1,
43 BT_FIELD_TYPE_ID_INTEGER = 0,
44 BT_FIELD_TYPE_ID_FLOAT = 1,
45 BT_FIELD_TYPE_ID_ENUM = 2,
46 BT_FIELD_TYPE_ID_STRING = 3,
47 BT_FIELD_TYPE_ID_STRUCT = 4,
48 BT_FIELD_TYPE_ID_ARRAY = 6,
49 BT_FIELD_TYPE_ID_SEQUENCE = 7,
50 BT_FIELD_TYPE_ID_VARIANT = 5,
51 BT_FIELD_TYPE_ID_NR = 8,
52 };
53
54 enum bt_byte_order {
55 BT_BYTE_ORDER_UNKNOWN = -1,
56 BT_BYTE_ORDER_NATIVE = 0,
57 BT_BYTE_ORDER_UNSPECIFIED,
58 BT_BYTE_ORDER_LITTLE_ENDIAN,
59 BT_BYTE_ORDER_BIG_ENDIAN,
60 BT_BYTE_ORDER_NETWORK,
61 };
62
63 /**
64 @brief String encoding of a @ft.
65 */
66 enum bt_string_encoding {
67 BT_STRING_ENCODING_UNKNOWN = -1,
68 BT_STRING_ENCODING_NONE,
69 BT_STRING_ENCODING_UTF8,
70 BT_STRING_ENCODING_ASCII,
71 };
72
73 /* Common functions */
74 enum bt_field_type_id bt_field_type_get_type_id(
75 struct bt_field_type *field_type);
76 int bt_field_type_get_alignment(
77 struct bt_field_type *field_type);
78 int bt_field_type_set_alignment(struct bt_field_type *field_type,
79 unsigned int alignment);
80 enum bt_byte_order bt_field_type_get_byte_order(
81 struct bt_field_type *field_type);
82 int bt_field_type_set_byte_order(
83 struct bt_field_type *field_type,
84 enum bt_byte_order byte_order);
85 int bt_field_type_compare(struct bt_field_type *field_type_a,
86 struct bt_field_type *field_type_b);
87 struct bt_field_type *bt_field_type_copy(
88 struct bt_field_type *field_type);
89
90 /* Integer field type base enumeration */
91 enum bt_integer_base {
92 BT_INTEGER_BASE_UNKNOWN = -1,
93 BT_INTEGER_BASE_UNSPECIFIED = 0,
94 BT_INTEGER_BASE_BINARY = 2,
95 BT_INTEGER_BASE_OCTAL = 8,
96 BT_INTEGER_BASE_DECIMAL = 10,
97 BT_INTEGER_BASE_HEXADECIMAL = 16,
98 };
99
100 /* Integer field type functions */
101 struct bt_field_type *bt_field_type_integer_create(
102 unsigned int size);
103 int bt_field_type_integer_get_size(
104 struct bt_field_type *int_field_type);
105 int bt_field_type_integer_set_size(
106 struct bt_field_type *int_field_type, unsigned int size);
107 int bt_field_type_integer_is_signed(
108 struct bt_field_type *int_field_type);
109 int bt_field_type_integer_set_is_signed(
110 struct bt_field_type *int_field_type, int is_signed);
111 enum bt_integer_base bt_field_type_integer_get_base(
112 struct bt_field_type *int_field_type);
113 int bt_field_type_integer_set_base(
114 struct bt_field_type *int_field_type,
115 enum bt_integer_base base);
116 enum bt_string_encoding bt_field_type_integer_get_encoding(
117 struct bt_field_type *int_field_type);
118 int bt_field_type_integer_set_encoding(
119 struct bt_field_type *int_field_type,
120 enum bt_string_encoding encoding);
121 struct bt_clock_class *bt_field_type_integer_get_mapped_clock_class(
122 struct bt_field_type *int_field_type);
123 int bt_field_type_integer_set_mapped_clock_class(
124 struct bt_field_type *int_field_type,
125 struct bt_clock_class *clock_class);
126
127 /* Floating point number field type functions */
128 struct bt_field_type *bt_field_type_floating_point_create(void);
129 int bt_field_type_floating_point_get_exponent_digits(
130 struct bt_field_type *float_field_type);
131 int bt_field_type_floating_point_set_exponent_digits(
132 struct bt_field_type *float_field_type,
133 unsigned int exponent_size);
134 int bt_field_type_floating_point_get_mantissa_digits(
135 struct bt_field_type *float_field_type);
136 int bt_field_type_floating_point_set_mantissa_digits(
137 struct bt_field_type *float_field_type,
138 unsigned int mantissa_sign_size);
139
140 /* Enumeration field type functions */
141 struct bt_field_type *bt_field_type_enumeration_create(
142 struct bt_field_type *int_field_type);
143 struct bt_field_type *bt_field_type_enumeration_get_container_type(
144 struct bt_field_type *enum_field_type);
145 int64_t bt_field_type_enumeration_get_mapping_count(
146 struct bt_field_type *enum_field_type);
147 int bt_field_type_enumeration_get_mapping_signed(
148 struct bt_field_type *enum_field_type, int index,
149 const char **BTOUTSTR, int64_t *OUTPUT, int64_t *OUTPUT);
150 int bt_field_type_enumeration_get_mapping_unsigned(
151 struct bt_field_type *enum_field_type, int index,
152 const char **BTOUTSTR, uint64_t *OUTPUT,
153 uint64_t *OUTPUT);
154 int bt_field_type_enumeration_add_mapping_signed(
155 struct bt_field_type *enum_field_type, const char *name,
156 int64_t range_begin, int64_t range_end);
157 int bt_field_type_enumeration_add_mapping_unsigned(
158 struct bt_field_type *enum_field_type, const char *name,
159 uint64_t range_begin, uint64_t range_end);
160 struct bt_field_type_enumeration_mapping_iterator *
161 bt_field_type_enumeration_find_mappings_by_name(
162 struct bt_field_type *enum_field_type,
163 const char *name);
164 struct bt_field_type_enumeration_mapping_iterator *
165 bt_field_type_enumeration_find_mappings_by_signed_value(
166 struct bt_field_type *enum_field_type,
167 int64_t value);
168 struct bt_field_type_enumeration_mapping_iterator *
169 bt_field_type_enumeration_find_mappings_by_unsigned_value(
170 struct bt_field_type *enum_field_type,
171 uint64_t value);
172
173 /* Enumeration field type mapping iterator functions */
174 int bt_field_type_enumeration_mapping_iterator_get_signed(
175 struct bt_field_type_enumeration_mapping_iterator *iter,
176 const char **BTOUTSTR, int64_t *OUTPUT, int64_t *OUTPUT);
177 int bt_field_type_enumeration_mapping_iterator_get_unsigned(
178 struct bt_field_type_enumeration_mapping_iterator *iter,
179 const char **BTOUTSTR, uint64_t *OUTPUT, uint64_t *OUTPUT);
180 int bt_field_type_enumeration_mapping_iterator_next(
181 struct bt_field_type_enumeration_mapping_iterator *iter);
182
183 /* String field type functions */
184 struct bt_field_type *bt_field_type_string_create(void);
185 enum bt_string_encoding bt_field_type_string_get_encoding(
186 struct bt_field_type *string_field_type);
187 int bt_field_type_string_set_encoding(
188 struct bt_field_type *string_field_type,
189 enum bt_string_encoding encoding);
190
191 /* Structure field type functions */
192 struct bt_field_type *bt_field_type_structure_create(void);
193 int64_t bt_field_type_structure_get_field_count(
194 struct bt_field_type *struct_field_type);
195 int bt_field_type_structure_get_field_by_index(
196 struct bt_field_type *struct_field_type,
197 const char **BTOUTSTR, struct bt_field_type **BTOUTFT,
198 uint64_t index);
199 struct bt_field_type *bt_field_type_structure_get_field_type_by_name(
200 struct bt_field_type *struct_field_type,
201 const char *field_name);
202 int bt_field_type_structure_add_field(
203 struct bt_field_type *struct_field_type,
204 struct bt_field_type *field_type,
205 const char *field_name);
206
207 /* Array field type functions */
208 struct bt_field_type *bt_field_type_array_create(
209 struct bt_field_type *element_field_type,
210 unsigned int length);
211 struct bt_field_type *bt_field_type_array_get_element_type(
212 struct bt_field_type *array_field_type);
213 int64_t bt_field_type_array_get_length(
214 struct bt_field_type *array_field_type);
215
216 /* Sequence field type functions */
217 struct bt_field_type *bt_field_type_sequence_create(
218 struct bt_field_type *element_field_type,
219 const char *length_name);
220 struct bt_field_type *bt_field_type_sequence_get_element_type(
221 struct bt_field_type *sequence_field_type);
222 const char *bt_field_type_sequence_get_length_field_name(
223 struct bt_field_type *sequence_field_type);
224 struct bt_field_path *bt_field_type_sequence_get_length_field_path(
225 struct bt_field_type *sequence_field_type);
226
227 /* Variant field type functions */
228 struct bt_field_type *bt_field_type_variant_create(
229 struct bt_field_type *tag_field_type,
230 const char *tag_name);
231 struct bt_field_type *bt_field_type_variant_get_tag_type(
232 struct bt_field_type *variant_field_type);
233 const char *bt_field_type_variant_get_tag_name(
234 struct bt_field_type *variant_field_type);
235 int bt_field_type_variant_set_tag_name(
236 struct bt_field_type *variant_field_type,
237 const char *tag_name);
238 struct bt_field_path *bt_field_type_variant_get_tag_field_path(
239 struct bt_field_type *variant_field_type);
240 int64_t bt_field_type_variant_get_field_count(
241 struct bt_field_type *variant_field_type);
242 int bt_field_type_variant_get_field_by_index(
243 struct bt_field_type *variant_field_type,
244 const char **BTOUTSTR,
245 struct bt_field_type **BTOUTFT, uint64_t index);
246 struct bt_field_type *bt_field_type_variant_get_field_type_by_name(
247 struct bt_field_type *variant_field_type,
248 const char *field_name);
249 int bt_field_type_variant_add_field(
250 struct bt_field_type *variant_field_type,
251 struct bt_field_type *field_type,
252 const char *field_name);
This page took 0.034925 seconds and 4 git commands to generate.