lib: Make bt_value_null a const pointer
[babeltrace.git] / bindings / python / bt2 / bt2 / native_btft.i
CommitLineData
81447b5b
PP
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
81447b5b 25/* Type */
839d52a5 26struct bt_field_type;
81447b5b
PP
27
28/* Common enumerations */
839d52a5
PP
29enum 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,
81447b5b
PP
39};
40
839d52a5
PP
41enum 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,
81447b5b
PP
52};
53
839d52a5
PP
54enum 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,
81447b5b
PP
61};
62
839d52a5
PP
63/**
64@brief String encoding of a @ft.
65*/
66enum bt_string_encoding {
67 BT_STRING_ENCODING_UNKNOWN = -1,
68 BT_STRING_ENCODING_NONE,
69 BT_STRING_ENCODING_UTF8,
70 BT_STRING_ENCODING_ASCII,
81447b5b
PP
71};
72
73/* Common functions */
839d52a5
PP
74enum bt_field_type_id bt_field_type_get_type_id(
75 struct bt_field_type *field_type);
76int bt_field_type_get_alignment(
77 struct bt_field_type *field_type);
78int bt_field_type_set_alignment(struct bt_field_type *field_type,
81447b5b 79 unsigned int alignment);
839d52a5
PP
80enum bt_byte_order bt_field_type_get_byte_order(
81 struct bt_field_type *field_type);
82int bt_field_type_set_byte_order(
83 struct bt_field_type *field_type,
84 enum bt_byte_order byte_order);
85int bt_field_type_compare(struct bt_field_type *field_type_a,
86 struct bt_field_type *field_type_b);
87struct bt_field_type *bt_field_type_copy(
88 struct bt_field_type *field_type);
81447b5b
PP
89
90/* Integer field type base enumeration */
839d52a5
PP
91enum 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,
81447b5b
PP
98};
99
100/* Integer field type functions */
839d52a5 101struct bt_field_type *bt_field_type_integer_create(
81447b5b 102 unsigned int size);
839d52a5
PP
103int bt_field_type_integer_get_size(
104 struct bt_field_type *int_field_type);
105int bt_field_type_integer_set_size(
106 struct bt_field_type *int_field_type, unsigned int size);
107int bt_field_type_integer_is_signed(
108 struct bt_field_type *int_field_type);
109int bt_field_type_integer_set_is_signed(
110 struct bt_field_type *int_field_type, int is_signed);
111enum bt_integer_base bt_field_type_integer_get_base(
112 struct bt_field_type *int_field_type);
113int bt_field_type_integer_set_base(
114 struct bt_field_type *int_field_type,
115 enum bt_integer_base base);
116enum bt_string_encoding bt_field_type_integer_get_encoding(
117 struct bt_field_type *int_field_type);
118int bt_field_type_integer_set_encoding(
119 struct bt_field_type *int_field_type,
120 enum bt_string_encoding encoding);
121struct bt_clock_class *bt_field_type_integer_get_mapped_clock_class(
122 struct bt_field_type *int_field_type);
123int bt_field_type_integer_set_mapped_clock_class(
124 struct bt_field_type *int_field_type,
125 struct bt_clock_class *clock_class);
81447b5b
PP
126
127/* Floating point number field type functions */
839d52a5
PP
128struct bt_field_type *bt_field_type_floating_point_create(void);
129int bt_field_type_floating_point_get_exponent_digits(
130 struct bt_field_type *float_field_type);
131int bt_field_type_floating_point_set_exponent_digits(
132 struct bt_field_type *float_field_type,
81447b5b 133 unsigned int exponent_size);
839d52a5
PP
134int bt_field_type_floating_point_get_mantissa_digits(
135 struct bt_field_type *float_field_type);
136int bt_field_type_floating_point_set_mantissa_digits(
137 struct bt_field_type *float_field_type,
81447b5b
PP
138 unsigned int mantissa_sign_size);
139
140/* Enumeration field type functions */
839d52a5
PP
141struct bt_field_type *bt_field_type_enumeration_create(
142 struct bt_field_type *int_field_type);
143struct bt_field_type *bt_field_type_enumeration_get_container_type(
144 struct bt_field_type *enum_field_type);
145int64_t bt_field_type_enumeration_get_mapping_count(
146 struct bt_field_type *enum_field_type);
147int bt_field_type_enumeration_get_mapping_signed(
148 struct bt_field_type *enum_field_type, int index,
81447b5b 149 const char **BTOUTSTR, int64_t *OUTPUT, int64_t *OUTPUT);
839d52a5
PP
150int bt_field_type_enumeration_get_mapping_unsigned(
151 struct bt_field_type *enum_field_type, int index,
81447b5b
PP
152 const char **BTOUTSTR, uint64_t *OUTPUT,
153 uint64_t *OUTPUT);
839d52a5
PP
154int bt_field_type_enumeration_add_mapping_signed(
155 struct bt_field_type *enum_field_type, const char *name,
81447b5b 156 int64_t range_begin, int64_t range_end);
839d52a5
PP
157int bt_field_type_enumeration_add_mapping_unsigned(
158 struct bt_field_type *enum_field_type, const char *name,
81447b5b 159 uint64_t range_begin, uint64_t range_end);
839d52a5
PP
160struct bt_field_type_enumeration_mapping_iterator *
161bt_field_type_enumeration_find_mappings_by_name(
162 struct bt_field_type *enum_field_type,
81447b5b 163 const char *name);
839d52a5
PP
164struct bt_field_type_enumeration_mapping_iterator *
165bt_field_type_enumeration_find_mappings_by_signed_value(
166 struct bt_field_type *enum_field_type,
81447b5b 167 int64_t value);
839d52a5
PP
168struct bt_field_type_enumeration_mapping_iterator *
169bt_field_type_enumeration_find_mappings_by_unsigned_value(
170 struct bt_field_type *enum_field_type,
81447b5b
PP
171 uint64_t value);
172
173/* Enumeration field type mapping iterator functions */
839d52a5
PP
174int bt_field_type_enumeration_mapping_iterator_get_signed(
175 struct bt_field_type_enumeration_mapping_iterator *iter,
81447b5b 176 const char **BTOUTSTR, int64_t *OUTPUT, int64_t *OUTPUT);
839d52a5
PP
177int bt_field_type_enumeration_mapping_iterator_get_unsigned(
178 struct bt_field_type_enumeration_mapping_iterator *iter,
f6a5e476 179 const char **BTOUTSTR, uint64_t *OUTPUT, uint64_t *OUTPUT);
839d52a5
PP
180int bt_field_type_enumeration_mapping_iterator_next(
181 struct bt_field_type_enumeration_mapping_iterator *iter);
81447b5b
PP
182
183/* String field type functions */
839d52a5
PP
184struct bt_field_type *bt_field_type_string_create(void);
185enum bt_string_encoding bt_field_type_string_get_encoding(
186 struct bt_field_type *string_field_type);
187int bt_field_type_string_set_encoding(
188 struct bt_field_type *string_field_type,
189 enum bt_string_encoding encoding);
81447b5b
PP
190
191/* Structure field type functions */
839d52a5
PP
192struct bt_field_type *bt_field_type_structure_create(void);
193int64_t bt_field_type_structure_get_field_count(
194 struct bt_field_type *struct_field_type);
195int 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,
f6a5e476 198 uint64_t index);
839d52a5
PP
199struct bt_field_type *bt_field_type_structure_get_field_type_by_name(
200 struct bt_field_type *struct_field_type,
81447b5b 201 const char *field_name);
839d52a5
PP
202int bt_field_type_structure_add_field(
203 struct bt_field_type *struct_field_type,
204 struct bt_field_type *field_type,
81447b5b
PP
205 const char *field_name);
206
207/* Array field type functions */
839d52a5
PP
208struct bt_field_type *bt_field_type_array_create(
209 struct bt_field_type *element_field_type,
81447b5b 210 unsigned int length);
839d52a5
PP
211struct bt_field_type *bt_field_type_array_get_element_type(
212 struct bt_field_type *array_field_type);
213int64_t bt_field_type_array_get_length(
214 struct bt_field_type *array_field_type);
81447b5b
PP
215
216/* Sequence field type functions */
839d52a5
PP
217struct bt_field_type *bt_field_type_sequence_create(
218 struct bt_field_type *element_field_type,
81447b5b 219 const char *length_name);
839d52a5
PP
220struct bt_field_type *bt_field_type_sequence_get_element_type(
221 struct bt_field_type *sequence_field_type);
222const char *bt_field_type_sequence_get_length_field_name(
223 struct bt_field_type *sequence_field_type);
224struct bt_field_path *bt_field_type_sequence_get_length_field_path(
225 struct bt_field_type *sequence_field_type);
81447b5b
PP
226
227/* Variant field type functions */
839d52a5
PP
228struct bt_field_type *bt_field_type_variant_create(
229 struct bt_field_type *tag_field_type,
81447b5b 230 const char *tag_name);
839d52a5
PP
231struct bt_field_type *bt_field_type_variant_get_tag_type(
232 struct bt_field_type *variant_field_type);
233const char *bt_field_type_variant_get_tag_name(
234 struct bt_field_type *variant_field_type);
235int bt_field_type_variant_set_tag_name(
236 struct bt_field_type *variant_field_type,
81447b5b 237 const char *tag_name);
839d52a5
PP
238struct bt_field_path *bt_field_type_variant_get_tag_field_path(
239 struct bt_field_type *variant_field_type);
240int64_t bt_field_type_variant_get_field_count(
241 struct bt_field_type *variant_field_type);
242int bt_field_type_variant_get_field_by_index(
243 struct bt_field_type *variant_field_type,
81447b5b 244 const char **BTOUTSTR,
839d52a5
PP
245 struct bt_field_type **BTOUTFT, uint64_t index);
246struct bt_field_type *bt_field_type_variant_get_field_type_by_name(
247 struct bt_field_type *variant_field_type,
81447b5b 248 const char *field_name);
839d52a5
PP
249int bt_field_type_variant_add_field(
250 struct bt_field_type *variant_field_type,
251 struct bt_field_type *field_type,
81447b5b 252 const char *field_name);
This page took 0.045024 seconds and 4 git commands to generate.