Python plugin provider: only finalize interpreter if we initialized it
[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
PP
25/* Type */
26struct bt_ctf_field_type;
27
28/* Common enumerations */
29enum bt_ctf_scope {
30 BT_CTF_SCOPE_UNKNOWN = -1,
31 BT_CTF_SCOPE_TRACE_PACKET_HEADER = 1,
32 BT_CTF_SCOPE_STREAM_PACKET_CONTEXT = 2,
33 BT_CTF_SCOPE_STREAM_EVENT_HEADER = 3,
34 BT_CTF_SCOPE_STREAM_EVENT_CONTEXT = 4,
35 BT_CTF_SCOPE_EVENT_CONTEXT = 5,
36 BT_CTF_SCOPE_EVENT_PAYLOAD = 6,
37 BT_CTF_SCOPE_ENV = 0,
38 BT_CTF_SCOPE_EVENT_FIELDS = 6,
39};
40
811644b8
PP
41enum bt_ctf_field_type_id {
42 BT_CTF_FIELD_TYPE_ID_UNKNOWN = CTF_TYPE_UNKNOWN,
43 BT_CTF_FIELD_TYPE_ID_INTEGER = CTF_TYPE_INTEGER,
44 BT_CTF_FIELD_TYPE_ID_FLOAT = CTF_TYPE_FLOAT,
45 BT_CTF_FIELD_TYPE_ID_ENUM = CTF_TYPE_ENUM,
46 BT_CTF_FIELD_TYPE_ID_STRING = CTF_TYPE_STRING,
47 BT_CTF_FIELD_TYPE_ID_STRUCT = CTF_TYPE_STRUCT,
48 BT_CTF_FIELD_TYPE_ID_ARRAY = CTF_TYPE_ARRAY,
49 BT_CTF_FIELD_TYPE_ID_SEQUENCE = CTF_TYPE_SEQUENCE,
50 BT_CTF_FIELD_TYPE_ID_VARIANT = CTF_TYPE_VARIANT,
81447b5b
PP
51 BT_CTF_NR_TYPE_IDS = NR_CTF_TYPES,
52};
53
54enum bt_ctf_byte_order {
55 BT_CTF_BYTE_ORDER_UNKNOWN = -1,
56 BT_CTF_BYTE_ORDER_NATIVE = 0,
811644b8 57 BT_CTF_BYTE_ORDER_UNSPECIFIED,
81447b5b
PP
58 BT_CTF_BYTE_ORDER_LITTLE_ENDIAN,
59 BT_CTF_BYTE_ORDER_BIG_ENDIAN,
60 BT_CTF_BYTE_ORDER_NETWORK,
61};
62
63enum bt_ctf_string_encoding {
64 BT_CTF_STRING_ENCODING_UNKNOWN = CTF_STRING_UNKNOWN,
65 BT_CTF_STRING_ENCODING_NONE = CTF_STRING_NONE,
66 BT_CTF_STRING_ENCODING_UTF8 = CTF_STRING_UTF8,
67 BT_CTF_STRING_ENCODING_ASCII = CTF_STRING_ASCII,
68};
69
70/* Common functions */
811644b8 71enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id(
81447b5b
PP
72 struct bt_ctf_field_type *field_type);
73int bt_ctf_field_type_get_alignment(
74 struct bt_ctf_field_type *field_type);
75int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *field_type,
76 unsigned int alignment);
77enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(
78 struct bt_ctf_field_type *field_type);
79int bt_ctf_field_type_set_byte_order(
80 struct bt_ctf_field_type *field_type,
81 enum bt_ctf_byte_order byte_order);
82int bt_ctf_field_type_compare(struct bt_ctf_field_type *field_type_a,
83 struct bt_ctf_field_type *field_type_b);
84struct bt_ctf_field_type *bt_ctf_field_type_copy(
85 struct bt_ctf_field_type *field_type);
86
87/* Integer field type base enumeration */
88enum bt_ctf_integer_base {
89 BT_CTF_INTEGER_BASE_UNKNOWN = -1,
90 BT_CTF_INTEGER_BASE_BINARY = 2,
91 BT_CTF_INTEGER_BASE_OCTAL = 8,
92 BT_CTF_INTEGER_BASE_DECIMAL = 10,
93 BT_CTF_INTEGER_BASE_HEXADECIMAL = 16,
94};
95
96/* Integer field type functions */
97struct bt_ctf_field_type *bt_ctf_field_type_integer_create(
98 unsigned int size);
99int bt_ctf_field_type_integer_get_size(
100 struct bt_ctf_field_type *int_field_type);
811644b8
PP
101int bt_ctf_field_type_integer_set_size(
102 struct bt_ctf_field_type *int_field_type, unsigned int size);
103int bt_ctf_field_type_integer_is_signed(
81447b5b 104 struct bt_ctf_field_type *int_field_type);
811644b8 105int bt_ctf_field_type_integer_set_is_signed(
81447b5b
PP
106 struct bt_ctf_field_type *int_field_type, int is_signed);
107enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base(
108 struct bt_ctf_field_type *int_field_type);
109int bt_ctf_field_type_integer_set_base(
110 struct bt_ctf_field_type *int_field_type,
111 enum bt_ctf_integer_base base);
112enum bt_ctf_string_encoding bt_ctf_field_type_integer_get_encoding(
113 struct bt_ctf_field_type *int_field_type);
114int bt_ctf_field_type_integer_set_encoding(
115 struct bt_ctf_field_type *int_field_type,
116 enum bt_ctf_string_encoding encoding);
117struct bt_ctf_clock_class *bt_ctf_field_type_integer_get_mapped_clock_class(
118 struct bt_ctf_field_type *int_field_type);
119int bt_ctf_field_type_integer_set_mapped_clock_class(
120 struct bt_ctf_field_type *int_field_type,
121 struct bt_ctf_clock_class *clock_class);
122
123/* Floating point number field type functions */
124struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void);
125int bt_ctf_field_type_floating_point_get_exponent_digits(
126 struct bt_ctf_field_type *float_field_type);
127int bt_ctf_field_type_floating_point_set_exponent_digits(
128 struct bt_ctf_field_type *float_field_type,
129 unsigned int exponent_size);
130int bt_ctf_field_type_floating_point_get_mantissa_digits(
131 struct bt_ctf_field_type *float_field_type);
132int bt_ctf_field_type_floating_point_set_mantissa_digits(
133 struct bt_ctf_field_type *float_field_type,
134 unsigned int mantissa_sign_size);
135
136/* Enumeration field type functions */
137struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
138 struct bt_ctf_field_type *int_field_type);
139struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_type(
140 struct bt_ctf_field_type *enum_field_type);
811644b8 141int64_t bt_ctf_field_type_enumeration_get_mapping_count(
81447b5b
PP
142 struct bt_ctf_field_type *enum_field_type);
143int bt_ctf_field_type_enumeration_get_mapping_signed(
144 struct bt_ctf_field_type *enum_field_type, int index,
145 const char **BTOUTSTR, int64_t *OUTPUT, int64_t *OUTPUT);
146int bt_ctf_field_type_enumeration_get_mapping_unsigned(
147 struct bt_ctf_field_type *enum_field_type, int index,
148 const char **BTOUTSTR, uint64_t *OUTPUT,
149 uint64_t *OUTPUT);
811644b8 150int bt_ctf_field_type_enumeration_add_mapping_signed(
81447b5b
PP
151 struct bt_ctf_field_type *enum_field_type, const char *name,
152 int64_t range_begin, int64_t range_end);
153int bt_ctf_field_type_enumeration_add_mapping_unsigned(
154 struct bt_ctf_field_type *enum_field_type, const char *name,
155 uint64_t range_begin, uint64_t range_end);
156struct bt_ctf_field_type_enumeration_mapping_iterator *
157bt_ctf_field_type_enumeration_find_mappings_by_name(
158 struct bt_ctf_field_type *enum_field_type,
159 const char *name);
160struct bt_ctf_field_type_enumeration_mapping_iterator *
161bt_ctf_field_type_enumeration_find_mappings_by_signed_value(
162 struct bt_ctf_field_type *enum_field_type,
163 int64_t value);
164struct bt_ctf_field_type_enumeration_mapping_iterator *
165bt_ctf_field_type_enumeration_find_mappings_by_unsigned_value(
166 struct bt_ctf_field_type *enum_field_type,
167 uint64_t value);
168
169/* Enumeration field type mapping iterator functions */
170int bt_ctf_field_type_enumeration_mapping_iterator_get_signed(
171 struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
172 const char **BTOUTSTR, int64_t *OUTPUT, int64_t *OUTPUT);
173int bt_ctf_field_type_enumeration_mapping_iterator_get_unsigned(
174 struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
811644b8 175 const char **BTOUTSTR, uint64_t *OUTPUT, uint64_t *OUTPUT);
81447b5b
PP
176int bt_ctf_field_type_enumeration_mapping_iterator_next(
177 struct bt_ctf_field_type_enumeration_mapping_iterator *iter);
178
179/* String field type functions */
180struct bt_ctf_field_type *bt_ctf_field_type_string_create(void);
181enum bt_ctf_string_encoding bt_ctf_field_type_string_get_encoding(
182 struct bt_ctf_field_type *string_field_type);
183int bt_ctf_field_type_string_set_encoding(
184 struct bt_ctf_field_type *string_field_type,
185 enum bt_ctf_string_encoding encoding);
186
187/* Structure field type functions */
188struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void);
811644b8 189int64_t bt_ctf_field_type_structure_get_field_count(
81447b5b 190 struct bt_ctf_field_type *struct_field_type);
811644b8 191int bt_ctf_field_type_structure_get_field_by_index(
81447b5b
PP
192 struct bt_ctf_field_type *struct_field_type,
193 const char **BTOUTSTR, struct bt_ctf_field_type **BTOUTFT,
811644b8 194 uint64_t index);
81447b5b
PP
195struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name(
196 struct bt_ctf_field_type *struct_field_type,
197 const char *field_name);
198int bt_ctf_field_type_structure_add_field(
199 struct bt_ctf_field_type *struct_field_type,
200 struct bt_ctf_field_type *field_type,
201 const char *field_name);
202
203/* Array field type functions */
204struct bt_ctf_field_type *bt_ctf_field_type_array_create(
205 struct bt_ctf_field_type *element_field_type,
206 unsigned int length);
207struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_type(
208 struct bt_ctf_field_type *array_field_type);
209int64_t bt_ctf_field_type_array_get_length(
210 struct bt_ctf_field_type *array_field_type);
211
212/* Sequence field type functions */
811644b8 213struct bt_ctf_field_type *bt_ctf_field_type_sequence_create(
81447b5b
PP
214 struct bt_ctf_field_type *element_field_type,
215 const char *length_name);
811644b8 216struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_type(
81447b5b 217 struct bt_ctf_field_type *sequence_field_type);
811644b8 218const char *bt_ctf_field_type_sequence_get_length_field_name(
81447b5b 219 struct bt_ctf_field_type *sequence_field_type);
811644b8 220struct bt_ctf_field_path *bt_ctf_field_type_sequence_get_length_field_path(
81447b5b
PP
221 struct bt_ctf_field_type *sequence_field_type);
222
223/* Variant field type functions */
224struct bt_ctf_field_type *bt_ctf_field_type_variant_create(
225 struct bt_ctf_field_type *tag_field_type,
226 const char *tag_name);
227struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_type(
228 struct bt_ctf_field_type *variant_field_type);
229const char *bt_ctf_field_type_variant_get_tag_name(
230 struct bt_ctf_field_type *variant_field_type);
231int bt_ctf_field_type_variant_set_tag_name(
232 struct bt_ctf_field_type *variant_field_type,
233 const char *tag_name);
234struct bt_ctf_field_path *bt_ctf_field_type_variant_get_tag_field_path(
235 struct bt_ctf_field_type *variant_field_type);
811644b8 236int64_t bt_ctf_field_type_variant_get_field_count(
81447b5b 237 struct bt_ctf_field_type *variant_field_type);
811644b8 238int bt_ctf_field_type_variant_get_field_by_index(
81447b5b
PP
239 struct bt_ctf_field_type *variant_field_type,
240 const char **BTOUTSTR,
811644b8 241 struct bt_ctf_field_type **BTOUTFT, uint64_t index);
81447b5b
PP
242struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name(
243 struct bt_ctf_field_type *variant_field_type,
244 const char *field_name);
245int bt_ctf_field_type_variant_add_field(
246 struct bt_ctf_field_type *variant_field_type,
247 struct bt_ctf_field_type *field_type,
248 const char *field_name);
This page took 0.039638 seconds and 4 git commands to generate.