Handle negative time and offset from Epoch
[babeltrace.git] / bindings / python / nativebt.i
1 /*
2 * nativebt.i.in
3 *
4 * Babeltrace native interface Python module
5 *
6 * Copyright 2012 EfficiOS Inc.
7 *
8 * Author: Danny Serres <danny.serres@efficios.com>
9 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * SOFTWARE.
28 */
29 %module nativebt
30
31
32 %include "stdint.i"
33 %include "typemaps.i"
34 %{
35 #define SWIG_FILE_WITH_INIT
36 #include <babeltrace/babeltrace.h>
37 #include <babeltrace/babeltrace-internal.h>
38 #include <babeltrace/trace-handle.h>
39 #include <babeltrace/trace-handle-internal.h>
40 #include <babeltrace/context.h>
41 #include <babeltrace/context-internal.h>
42 #include <babeltrace/iterator.h>
43 #include <babeltrace/iterator-internal.h>
44 #include <babeltrace/format.h>
45 #include <babeltrace/list.h>
46 #include <babeltrace/types.h>
47 #include <babeltrace/ctf/iterator.h>
48 #include "python-complements.h"
49 #include <babeltrace/ctf-writer/clock.h>
50 #include <babeltrace/ctf-writer/event-fields.h>
51 #include <babeltrace/ctf-writer/event-types.h>
52 #include <babeltrace/ctf-writer/event.h>
53 #include <babeltrace/ctf-writer/stream.h>
54 #include <babeltrace/ctf-writer/writer.h>
55 %}
56
57
58 typedef int bt_intern_str;
59 typedef int64_t ssize_t;
60
61
62 /* python-complements.h */
63 struct bt_definition **_bt_python_field_listcaller(
64 const struct bt_ctf_event *ctf_event,
65 const struct bt_definition *scope,
66 unsigned int *OUTPUT);
67 struct bt_definition *_bt_python_field_one_from_list(
68 struct bt_definition **list, int index);
69 struct bt_ctf_event_decl **_bt_python_event_decl_listcaller(
70 int handle_id,
71 struct bt_context *ctx,
72 unsigned int *OUTPUT);
73 struct bt_ctf_event_decl *_bt_python_decl_one_from_list(
74 struct bt_ctf_event_decl **list, int index);
75 struct bt_ctf_field_decl **_by_python_field_decl_listcaller(
76 struct bt_ctf_event_decl *event_decl,
77 enum bt_ctf_scope scope,
78 unsigned int *OUTPUT);
79 struct bt_ctf_field_decl *_bt_python_field_decl_one_from_list(
80 struct bt_ctf_field_decl **list, int index);
81 struct definition_array *_bt_python_get_array_from_def(
82 struct bt_definition *field);
83 struct definition_sequence *_bt_python_get_sequence_from_def(
84 struct bt_definition *field);
85 struct bt_declaration *_bt_python_get_array_element_declaration(
86 struct bt_declaration *field);
87 struct bt_declaration *_bt_python_get_sequence_element_declaration(
88 struct bt_declaration *field);
89 const char *_bt_python_get_array_string(struct bt_definition *field);
90 const char *_bt_python_get_sequence_string(struct bt_definition *field);
91 int _bt_python_field_integer_get_signedness(const struct bt_ctf_field *field);
92 enum ctf_type_id _bt_python_get_field_type(const struct bt_ctf_field *field);
93 const char *_bt_python_ctf_field_type_enumeration_get_mapping(
94 struct bt_ctf_field_type *enumeration, size_t index,
95 int64_t *OUTPUT, int64_t *OUTPUT);
96 const char *_bt_python_ctf_field_type_enumeration_get_mapping_unsigned(
97 struct bt_ctf_field_type *enumeration, size_t index,
98 uint64_t *OUTPUT, uint64_t *OUTPUT);
99 const char *_bt_python_ctf_field_type_structure_get_field_name(
100 struct bt_ctf_field_type *structure, size_t index);
101 struct bt_ctf_field_type *_bt_python_ctf_field_type_structure_get_field_type(
102 struct bt_ctf_field_type *structure, size_t index);
103 const char *_bt_python_ctf_field_type_variant_get_field_name(
104 struct bt_ctf_field_type *variant, size_t index);
105 struct bt_ctf_field_type *_bt_python_ctf_field_type_variant_get_field_type(
106 struct bt_ctf_field_type *variant, size_t index);
107 const char *_bt_python_ctf_event_class_get_field_name(
108 struct bt_ctf_event_class *event_class, size_t index);
109 struct bt_ctf_field_type *_bt_python_ctf_event_class_get_field_type(
110 struct bt_ctf_event_class *event_class, size_t index);
111 int _bt_python_ctf_clock_get_uuid_index(struct bt_ctf_clock *clock,
112 size_t index, unsigned char *OUTPUT);
113 int _bt_python_ctf_clock_set_uuid_index(struct bt_ctf_clock *clock,
114 size_t index, unsigned char value);
115 struct bt_iter_pos *_bt_python_create_iter_pos(void);
116
117 /* context.h, context-internal.h */
118 %rename("_bt_context_create") bt_context_create(void);
119 %rename("_bt_context_add_trace") bt_context_add_trace(
120 struct bt_context *ctx, const char *path, const char *format,
121 void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence),
122 struct bt_mmap_stream_list *stream_list, FILE *metadata);
123 %rename("_bt_context_remove_trace") bt_context_remove_trace(
124 struct bt_context *ctx, int trace_id);
125 %rename("_bt_context_get") bt_context_get(struct bt_context *ctx);
126 %rename("_bt_context_put") bt_context_put(struct bt_context *ctx);
127 %rename("_bt_ctf_event_get_context") bt_ctf_event_get_context(
128 const struct bt_ctf_event *event);
129
130 struct bt_context *bt_context_create(void);
131 int bt_context_add_trace(struct bt_context *ctx, const char *path, const char *format,
132 void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence),
133 struct bt_mmap_stream_list *stream_list, FILE *metadata);
134 void bt_context_remove_trace(struct bt_context *ctx, int trace_id);
135 void bt_context_get(struct bt_context *ctx);
136 void bt_context_put(struct bt_context *ctx);
137 struct bt_context *bt_ctf_event_get_context(const struct bt_ctf_event *event);
138
139
140 /* format.h */
141 %rename("lookup_format") bt_lookup_format(bt_intern_str qname);
142 %rename("_bt_print_format_list") bt_fprintf_format_list(FILE *fp);
143 %rename("register_format") bt_register_format(struct format *format);
144 %rename("unregister_format") bt_unregister_format(struct bt_format *format);
145
146 extern struct format *bt_lookup_format(bt_intern_str qname);
147 extern void bt_fprintf_format_list(FILE *fp);
148 extern int bt_register_format(struct bt_format *format);
149 extern void bt_unregister_format(struct bt_format *format);
150
151
152 /* iterator.h, iterator-internal.h */
153 %rename("_bt_iter_create") bt_iter_create(struct bt_context *ctx,
154 const struct bt_iter_pos *begin_pos, const struct bt_iter_pos *end_pos);
155 %rename("_bt_iter_destroy") bt_iter_destroy(struct bt_iter *iter);
156 %rename("_bt_iter_next") bt_iter_next(struct bt_iter *iter);
157 %rename("_bt_iter_get_pos") bt_iter_get_pos(struct bt_iter *iter);
158 %rename("_bt_iter_free_pos") bt_iter_free_pos(struct bt_iter_pos *pos);
159 %rename("_bt_iter_set_pos") bt_iter_set_pos(struct bt_iter *iter,
160 const struct bt_iter_pos *pos);
161 %rename("_bt_iter_create_time_pos") bt_iter_create_time_pos(struct bt_iter *iter,
162 uint64_t timestamp);
163
164 struct bt_iter *bt_iter_create(struct bt_context *ctx,
165 const struct bt_iter_pos *begin_pos, const struct bt_iter_pos *end_pos);
166 void bt_iter_destroy(struct bt_iter *iter);
167 int bt_iter_next(struct bt_iter *iter);
168 struct bt_iter_pos *bt_iter_get_pos(struct bt_iter *iter);
169 void bt_iter_free_pos(struct bt_iter_pos *pos);
170 int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *pos);
171 struct bt_iter_pos *bt_iter_create_time_pos(struct bt_iter *iter, uint64_t timestamp);
172
173 %rename("_bt_iter_pos") bt_iter_pos;
174 %rename("SEEK_TIME") BT_SEEK_TIME;
175 %rename("SEEK_RESTORE") BT_SEEK_RESTORE;
176 %rename("SEEK_CUR") BT_SEEK_CUR;
177 %rename("SEEK_BEGIN") BT_SEEK_BEGIN;
178 %rename("SEEK_LAST") BT_SEEK_LAST;
179
180
181 /*
182 * This struct is taken from iterator.h
183 * All changes to the struct must also be made here.
184 */
185 struct bt_iter_pos {
186 enum {
187 BT_SEEK_TIME, /* uses u.seek_time */
188 BT_SEEK_RESTORE, /* uses u.restore */
189 BT_SEEK_CUR,
190 BT_SEEK_BEGIN,
191 BT_SEEK_LAST
192 } type;
193 union {
194 uint64_t seek_time;
195 struct bt_saved_pos *restore;
196 } u;
197 };
198
199
200 /* trace-handle.h, trace-handle-internal.h */
201 %rename("_bt_trace_handle_create") bt_trace_handle_create(struct bt_context *ctx);
202 %rename("_bt_trace_handle_destroy") bt_trace_handle_destroy(struct bt_trace_handle *bt);
203 struct bt_trace_handle *bt_trace_handle_create(struct bt_context *ctx);
204 void bt_trace_handle_destroy(struct bt_trace_handle *bt);
205
206 %rename("_bt_trace_handle_get_path") bt_trace_handle_get_path(struct bt_context *ctx,
207 int handle_id);
208 %rename("_bt_trace_handle_get_timestamp_begin") bt_trace_handle_get_timestamp_begin(
209 struct bt_context *ctx, int handle_id, enum bt_clock_type type,
210 int64_t *timestamp);
211 %rename("_bt_trace_handle_get_timestamp_end") bt_trace_handle_get_timestamp_end(
212 struct bt_context *ctx, int handle_id, enum bt_clock_type type,
213 int64_t *timestamp);
214 const char *bt_trace_handle_get_path(struct bt_context *ctx, int handle_id);
215 int bt_trace_handle_get_timestamp_begin(struct bt_context *ctx, int handle_id,
216 enum bt_clock_type type, int64_t *timestamp);
217 int bt_trace_handle_get_timestamp_end(struct bt_context *ctx, int handle_id,
218 enum bt_clock_type type, int64_t *timestamp);
219
220 %rename("_bt_ctf_event_get_handle_id") bt_ctf_event_get_handle_id(
221 const struct bt_ctf_event *event);
222 int bt_ctf_event_get_handle_id(const struct bt_ctf_event *event);
223
224
225 /* iterator.h, events.h */
226 %rename("_bt_ctf_iter_create") bt_ctf_iter_create(struct bt_context *ctx,
227 const struct bt_iter_pos *begin_pos,
228 const struct bt_iter_pos *end_pos);
229 %rename("_bt_ctf_get_iter") bt_ctf_get_iter(struct bt_ctf_iter *iter);
230 %rename("_bt_ctf_iter_destroy") bt_ctf_iter_destroy(struct bt_ctf_iter *iter);
231 %rename("_bt_ctf_iter_read_event") bt_ctf_iter_read_event(struct bt_ctf_iter *iter);
232
233 struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx,
234 const struct bt_iter_pos *begin_pos,
235 const struct bt_iter_pos *end_pos);
236 struct bt_iter *bt_ctf_get_iter(struct bt_ctf_iter *iter);
237 void bt_ctf_iter_destroy(struct bt_ctf_iter *iter);
238 struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_ctf_iter *iter);
239
240
241 /* events.h */
242 %rename("_bt_ctf_get_top_level_scope") bt_ctf_get_top_level_scope(const struct
243 bt_ctf_event *event, enum bt_ctf_scope scope);
244 %rename("_bt_ctf_event_name") bt_ctf_event_name(const struct bt_ctf_event *ctf_event);
245 %rename("_bt_ctf_get_timestamp") bt_ctf_get_timestamp(
246 const struct bt_ctf_event *ctf_event, int64_t *timestamp);
247 %rename("_bt_ctf_get_cycles") bt_ctf_get_cycles(
248 const struct bt_ctf_event *ctf_event);
249
250 %rename("_bt_ctf_get_field") bt_ctf_get_field(const struct bt_ctf_event *ctf_event,
251 const struct bt_definition *scope, const char *field);
252 %rename("_bt_ctf_get_index") bt_ctf_get_index(const struct bt_ctf_event *ctf_event,
253 const struct bt_definition *field, unsigned int index);
254 %rename("_bt_ctf_field_name") bt_ctf_field_name(const struct bt_definition *field);
255 %rename("_bt_ctf_field_type") bt_ctf_field_type(const struct bt_declaration *field);
256 %rename("_bt_ctf_get_int_signedness") bt_ctf_get_int_signedness(
257 const struct bt_declaration *field);
258 %rename("_bt_ctf_get_int_base") bt_ctf_get_int_base(const struct bt_declaration *field);
259 %rename("_bt_ctf_get_int_byte_order") bt_ctf_get_int_byte_order(
260 const struct bt_declaration *field);
261 %rename("_bt_ctf_get_int_len") bt_ctf_get_int_len(const struct bt_declaration *field);
262 %rename("_bt_ctf_get_enum_int") bt_ctf_get_enum_int(const struct bt_definition *field);
263 %rename("_bt_ctf_get_enum_str") bt_ctf_get_enum_str(const struct bt_definition *field);
264 %rename("_bt_ctf_get_encoding") bt_ctf_get_encoding(const struct bt_declaration *field);
265 %rename("_bt_ctf_get_array_len") bt_ctf_get_array_len(const struct bt_declaration *field);
266 %rename("_bt_ctf_get_uint64") bt_ctf_get_uint64(const struct bt_definition *field);
267 %rename("_bt_ctf_get_int64") bt_ctf_get_int64(const struct bt_definition *field);
268 %rename("_bt_ctf_get_char_array") bt_ctf_get_char_array(const struct bt_definition *field);
269 %rename("_bt_ctf_get_string") bt_ctf_get_string(const struct bt_definition *field);
270 %rename("_bt_ctf_get_float") bt_ctf_get_float(const struct bt_definition *field);
271 %rename("_bt_ctf_get_variant") bt_ctf_get_variant(const struct bt_definition *field);
272 %rename("_bt_ctf_field_get_error") bt_ctf_field_get_error(void);
273 %rename("_bt_ctf_get_decl_event_name") bt_ctf_get_decl_event_name(const struct
274 bt_ctf_event_decl *event);
275 %rename("_bt_ctf_get_decl_event_id") bt_ctf_get_decl_event_id(const struct
276 bt_ctf_event_decl *event);
277 %rename("_bt_ctf_get_decl_field_name") bt_ctf_get_decl_field_name(
278 const struct bt_ctf_field_decl *field);
279 %rename("_bt_ctf_get_decl_from_def") bt_ctf_get_decl_from_def(
280 const struct bt_definition *field);
281 %rename("_bt_ctf_get_decl_from_field_decl") bt_ctf_get_decl_from_field_decl(
282 const struct bt_ctf_field_decl *field);
283 %rename("_bt_array_index") bt_array_index(struct definition_array *array, uint64_t i);
284 %rename("_bt_sequence_len") bt_sequence_len(struct definition_sequence *sequence);
285 %rename("_bt_sequence_index") bt_sequence_index(struct definition_sequence *sequence, uint64_t i);
286 %rename("_bt_ctf_get_struct_field_count") bt_ctf_get_struct_field_count(const struct bt_definition *structure);
287 %rename("_bt_ctf_get_struct_field_index") bt_ctf_get_struct_field_index(const struct bt_definition *structure, uint64_t i);
288
289 const struct bt_definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *ctf_event,
290 enum bt_ctf_scope scope);
291 const char *bt_ctf_event_name(const struct bt_ctf_event *ctf_event);
292 int bt_ctf_get_timestamp(const struct bt_ctf_event *ctf_event, int64_t *timestamp);
293 uint64_t bt_ctf_get_cycles(const struct bt_ctf_event *ctf_event);
294 const struct bt_definition *bt_ctf_get_field(const struct bt_ctf_event *ctf_event,
295 const struct bt_definition *scope,
296 const char *field);
297 const struct bt_definition *bt_ctf_get_index(const struct bt_ctf_event *ctf_event,
298 const struct bt_definition *field,
299 unsigned int index);
300 const char *bt_ctf_field_name(const struct bt_definition *field);
301 enum ctf_type_id bt_ctf_field_type(const struct bt_declaration *field);
302 int bt_ctf_get_int_signedness(const struct bt_declaration *field);
303 int bt_ctf_get_int_base(const struct bt_declaration *field);
304 int bt_ctf_get_int_byte_order(const struct bt_declaration *field);
305 ssize_t bt_ctf_get_int_len(const struct bt_declaration *field);
306 const struct bt_definition *bt_ctf_get_enum_int(const struct bt_definition *field);
307 const char *bt_ctf_get_enum_str(const struct bt_definition *field);
308 enum ctf_string_encoding bt_ctf_get_encoding(const struct bt_declaration *field);
309 int bt_ctf_get_array_len(const struct bt_declaration *field);
310 struct bt_definition *bt_array_index(struct definition_array *array, uint64_t i);
311 uint64_t bt_ctf_get_uint64(const struct bt_definition *field);
312 int64_t bt_ctf_get_int64(const struct bt_definition *field);
313 char *bt_ctf_get_char_array(const struct bt_definition *field);
314 char *bt_ctf_get_string(const struct bt_definition *field);
315 double bt_ctf_get_float(const struct bt_definition *field);
316 const struct bt_definition *bt_ctf_get_variant(const struct bt_definition *field);
317 int bt_ctf_field_get_error(void);
318 const char *bt_ctf_get_decl_event_name(const struct bt_ctf_event_decl *event);
319 uint64_t bt_ctf_get_decl_event_id(const struct bt_ctf_event_decl *event);
320 const char *bt_ctf_get_decl_field_name(const struct bt_ctf_field_decl *field);
321 const struct bt_declaration *bt_ctf_get_decl_from_def(const struct bt_definition *field);
322 const struct bt_declaration *bt_ctf_get_decl_from_field_decl(const struct bt_ctf_field_decl *field);
323 uint64_t bt_sequence_len(struct definition_sequence *sequence);
324 struct bt_definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i);
325 uint64_t bt_ctf_get_struct_field_count(const struct bt_definition *structure);
326 const struct bt_definition *bt_ctf_get_struct_field_index(const struct bt_definition *structure, uint64_t i);
327
328
329 /* CTF Writer */
330
331 /* clock.h */
332 %rename("_bt_ctf_clock_create") bt_ctf_clock_create(const char *name);
333 %rename("_bt_ctf_clock_get_name") bt_ctf_clock_get_name(struct bt_ctf_clock *clock);
334 %rename("_bt_ctf_clock_get_description") bt_ctf_clock_get_description(struct bt_ctf_clock *clock);
335 %rename("_bt_ctf_clock_set_description") bt_ctf_clock_set_description(struct bt_ctf_clock *clock, const char *desc);
336 %rename("_bt_ctf_clock_get_frequency") bt_ctf_clock_get_frequency(struct bt_ctf_clock *clock);
337 %rename("_bt_ctf_clock_set_frequency") bt_ctf_clock_set_frequency(struct bt_ctf_clock *clock, uint64_t freq);
338 %rename("_bt_ctf_clock_get_precision") bt_ctf_clock_get_precision(struct bt_ctf_clock *clock);
339 %rename("_bt_ctf_clock_set_precision") bt_ctf_clock_set_precision(struct bt_ctf_clock *clock, uint64_t precision);
340 %rename("_bt_ctf_clock_get_offset_s") bt_ctf_clock_get_offset_s(struct bt_ctf_clock *clock, int64_t *offset_s);
341 %rename("_bt_ctf_clock_set_offset_s") bt_ctf_clock_set_offset_s(struct bt_ctf_clock *clock, int64_t offset_s);
342 %rename("_bt_ctf_clock_get_offset") bt_ctf_clock_get_offset(struct bt_ctf_clock *clock, int64_t *offset);
343 %rename("_bt_ctf_clock_set_offset") bt_ctf_clock_set_offset(struct bt_ctf_clock *clock, int64_t offset);
344 %rename("_bt_ctf_clock_get_is_absolute") bt_ctf_clock_get_is_absolute(struct bt_ctf_clock *clock);
345 %rename("_bt_ctf_clock_set_is_absolute") bt_ctf_clock_set_is_absolute(struct bt_ctf_clock *clock, int is_absolute);
346 %rename("_bt_ctf_clock_get_time") bt_ctf_clock_get_time(struct bt_ctf_clock *clock, int64_t *time);
347 %rename("_bt_ctf_clock_set_time") bt_ctf_clock_set_time(struct bt_ctf_clock *clock, int64_t time);
348 %rename("_bt_ctf_clock_get") bt_ctf_clock_get(struct bt_ctf_clock *clock);
349 %rename("_bt_ctf_clock_put") bt_ctf_clock_put(struct bt_ctf_clock *clock);
350
351 struct bt_ctf_clock *bt_ctf_clock_create(const char *name);
352 const char *bt_ctf_clock_get_name(struct bt_ctf_clock *clock);
353 const char *bt_ctf_clock_get_description(struct bt_ctf_clock *clock);
354 int bt_ctf_clock_set_description(struct bt_ctf_clock *clock, const char *desc);
355 uint64_t bt_ctf_clock_get_frequency(struct bt_ctf_clock *clock);
356 int bt_ctf_clock_set_frequency(struct bt_ctf_clock *clock, uint64_t freq);
357 uint64_t bt_ctf_clock_get_precision(struct bt_ctf_clock *clock);
358 int bt_ctf_clock_set_precision(struct bt_ctf_clock *clock, uint64_t precision);
359 int bt_ctf_clock_get_offset_s(struct bt_ctf_clock *clock, int64_t *offset_s);
360 int bt_ctf_clock_set_offset_s(struct bt_ctf_clock *clock, int64_t offset_s);
361 int bt_ctf_clock_get_offset(struct bt_ctf_clock *clock, int64_t *offset);
362 int bt_ctf_clock_set_offset(struct bt_ctf_clock *clock, int64_t offset);
363 int bt_ctf_clock_get_is_absolute(struct bt_ctf_clock *clock);
364 int bt_ctf_clock_set_is_absolute(struct bt_ctf_clock *clock, int is_absolute);
365 int bt_ctf_clock_get_time(struct bt_ctf_clock *clock, int64_t *time);
366 int bt_ctf_clock_set_time(struct bt_ctf_clock *clock, int64_t time);
367 void bt_ctf_clock_get(struct bt_ctf_clock *clock);
368 void bt_ctf_clock_put(struct bt_ctf_clock *clock);
369
370
371 /* event-types.h */
372 %rename("_bt_ctf_field_type_integer_create") bt_ctf_field_type_integer_create(unsigned int size);
373 %rename("_bt_ctf_field_type_integer_get_size") bt_ctf_field_type_integer_get_size(struct bt_ctf_field_type *integer);
374 %rename("_bt_ctf_field_type_integer_get_signed") bt_ctf_field_type_integer_get_signed(struct bt_ctf_field_type *integer);
375 %rename("_bt_ctf_field_type_integer_set_signed") bt_ctf_field_type_integer_set_signed(struct bt_ctf_field_type *integer, int is_signed);
376 %rename("_bt_ctf_field_type_integer_get_base") bt_ctf_field_type_integer_get_base(struct bt_ctf_field_type *integer);
377 %rename("_bt_ctf_field_type_integer_set_base") bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *integer, enum bt_ctf_integer_base base);
378 %rename("_bt_ctf_field_type_integer_get_encoding") bt_ctf_field_type_integer_get_encoding(struct bt_ctf_field_type *integer);
379 %rename("_bt_ctf_field_type_integer_set_encoding") bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *integer, enum ctf_string_encoding encoding);
380 %rename("_bt_ctf_field_type_enumeration_create") bt_ctf_field_type_enumeration_create(struct bt_ctf_field_type *integer_container_type);
381 %rename("_bt_ctf_field_type_enumeration_get_container_type") bt_ctf_field_type_enumeration_get_container_type(struct bt_ctf_field_type *enumeration);
382 %rename("_bt_ctf_field_type_enumeration_add_mapping") bt_ctf_field_type_enumeration_add_mapping(struct bt_ctf_field_type *enumeration, const char *name, int64_t range_start, int64_t range_end);
383 %rename("_bt_ctf_field_type_enumeration_add_mapping_unsigned") bt_ctf_field_type_enumeration_add_mapping_unsigned(struct bt_ctf_field_type *enumeration, const char *name, uint64_t range_start, uint64_t range_end);
384 %rename("_bt_ctf_field_type_enumeration_get_mapping_count") bt_ctf_field_type_enumeration_get_mapping_count(struct bt_ctf_field_type *enumeration);
385 %rename("_bt_ctf_field_type_enumeration_get_mapping") bt_ctf_field_type_enumeration_get_mapping(struct bt_ctf_field_type *enumeration, int index, const char **name, int64_t *range_start, int64_t *range_end);
386 %rename("_bt_ctf_field_type_enumeration_get_mapping_unsigned") bt_ctf_field_type_enumeration_get_mapping_unsigned(struct bt_ctf_field_type *enumeration, int index, const char **name, uint64_t *range_start, uint64_t *range_end);
387 %rename("_bt_ctf_field_type_enumeration_get_mapping_index_by_name") bt_ctf_field_type_enumeration_get_mapping_index_by_name(struct bt_ctf_field_type *enumeration, const char *name);
388 %rename("_bt_ctf_field_type_enumeration_get_mapping_index_by_value") bt_ctf_field_type_enumeration_get_mapping_index_by_value(struct bt_ctf_field_type *enumeration, int64_t value);
389 %rename("_bt_ctf_field_type_enumeration_get_mapping_index_by_unsigned_value") bt_ctf_field_type_enumeration_get_mapping_index_by_unsigned_value(struct bt_ctf_field_type *enumeration, uint64_t value);
390 %rename("_bt_ctf_field_type_floating_point_create") bt_ctf_field_type_floating_point_create(void);
391 %rename("_bt_ctf_field_type_floating_point_get_exponent_digits") bt_ctf_field_type_floating_point_get_exponent_digits(struct bt_ctf_field_type *floating_point);
392 %rename("_bt_ctf_field_type_floating_point_set_exponent_digits") bt_ctf_field_type_floating_point_set_exponent_digits(struct bt_ctf_field_type *floating_point, unsigned int exponent_digits);
393 %rename("_bt_ctf_field_type_floating_point_get_mantissa_digits") bt_ctf_field_type_floating_point_get_mantissa_digits(struct bt_ctf_field_type *floating_point);
394 %rename("_bt_ctf_field_type_floating_point_set_mantissa_digits") bt_ctf_field_type_floating_point_set_mantissa_digits(struct bt_ctf_field_type *floating_point, unsigned int mantissa_digits);
395 %rename("_bt_ctf_field_type_structure_create") bt_ctf_field_type_structure_create(void);
396 %rename("_bt_ctf_field_type_structure_add_field") bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *structure, struct bt_ctf_field_type *field_type, const char *field_name);
397 %rename("_bt_ctf_field_type_structure_get_field_count") bt_ctf_field_type_structure_get_field_count(struct bt_ctf_field_type *structure);
398 %rename("_bt_ctf_field_type_structure_get_field") bt_ctf_field_type_structure_get_field(struct bt_ctf_field_type *structure, const char **field_name, struct bt_ctf_field_type **field_type, int index);
399 %rename("_bt_ctf_field_type_structure_get_field_type_by_name") bt_ctf_field_type_structure_get_field_type_by_name(struct bt_ctf_field_type *structure, const char *field_name);
400 %rename("_bt_ctf_field_type_variant_create") bt_ctf_field_type_variant_create(struct bt_ctf_field_type *enum_tag, const char *tag_name);
401 %rename("_bt_ctf_field_type_variant_get_tag_type") bt_ctf_field_type_variant_get_tag_type(struct bt_ctf_field_type *variant);
402 %rename("_bt_ctf_field_type_variant_get_tag_name") bt_ctf_field_type_variant_get_tag_name(struct bt_ctf_field_type *variant);
403 %rename("_bt_ctf_field_type_variant_add_field") bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *variant, struct bt_ctf_field_type *field_type, const char *field_name);
404 %rename("_bt_ctf_field_type_variant_get_field_type_by_name") bt_ctf_field_type_variant_get_field_type_by_name(struct bt_ctf_field_type *variant, const char *field_name);
405 %rename("_bt_ctf_field_type_variant_get_field_type_from_tag") bt_ctf_field_type_variant_get_field_type_from_tag(struct bt_ctf_field_type *variant, struct bt_ctf_field *tag);
406 %rename("_bt_ctf_field_type_variant_get_field_count") bt_ctf_field_type_variant_get_field_count(struct bt_ctf_field_type *variant);
407 %rename("_bt_ctf_field_type_variant_get_field") bt_ctf_field_type_variant_get_field(struct bt_ctf_field_type *variant, const char **field_name, struct bt_ctf_field_type **field_type, int index);
408 %rename("_bt_ctf_field_type_array_create") bt_ctf_field_type_array_create(struct bt_ctf_field_type *element_type, unsigned int length);
409 %rename("_bt_ctf_field_type_array_get_element_type") bt_ctf_field_type_array_get_element_type(struct bt_ctf_field_type *array);
410 %rename("_bt_ctf_field_type_array_get_length") bt_ctf_field_type_array_get_length(struct bt_ctf_field_type *array);
411 %rename("_bt_ctf_field_type_sequence_create") bt_ctf_field_type_sequence_create(struct bt_ctf_field_type *element_type, const char *length_field_name);
412 %rename("_bt_ctf_field_type_sequence_get_element_type") bt_ctf_field_type_sequence_get_element_type(struct bt_ctf_field_type *sequence);
413 %rename("_bt_ctf_field_type_sequence_get_length_field_name") bt_ctf_field_type_sequence_get_length_field_name(struct bt_ctf_field_type *sequence);
414 %rename("_bt_ctf_field_type_string_create") bt_ctf_field_type_string_create(void);
415 %rename("_bt_ctf_field_type_string_get_encoding") bt_ctf_field_type_string_get_encoding(struct bt_ctf_field_type *string_type);
416 %rename("_bt_ctf_field_type_string_set_encoding") bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *string_type, enum ctf_string_encoding encoding);
417 %rename("_bt_ctf_field_type_get_alignment") bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type);
418 %rename("_bt_ctf_field_type_set_alignment") bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *type, unsigned int alignment);
419 %rename("_bt_ctf_field_type_get_byte_order") bt_ctf_field_type_get_byte_order(struct bt_ctf_field_type *type);
420 %rename("_bt_ctf_field_type_set_byte_order") bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *type, enum bt_ctf_byte_order byte_order);
421 %rename("_bt_ctf_field_type_get_type_id") bt_ctf_field_type_get_type_id(struct bt_ctf_field_type *type);
422 %rename("_bt_ctf_field_type_get") bt_ctf_field_type_get(struct bt_ctf_field_type *type);
423 %rename("_bt_ctf_field_type_put") bt_ctf_field_type_put(struct bt_ctf_field_type *type);
424
425 struct bt_ctf_field_type *bt_ctf_field_type_integer_create(unsigned int size);
426 int bt_ctf_field_type_integer_get_size(struct bt_ctf_field_type *integer);
427 int bt_ctf_field_type_integer_get_signed(struct bt_ctf_field_type *integer);
428 int bt_ctf_field_type_integer_set_signed(struct bt_ctf_field_type *integer, int is_signed);
429 enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base(struct bt_ctf_field_type *integer);
430 int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *integer, enum bt_ctf_integer_base base);
431 enum ctf_string_encoding bt_ctf_field_type_integer_get_encoding(struct bt_ctf_field_type *integer);
432 int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *integer, enum ctf_string_encoding encoding);
433 struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(struct bt_ctf_field_type *integer_container_type);
434 struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_type(struct bt_ctf_field_type *enumeration);
435 int bt_ctf_field_type_enumeration_add_mapping(struct bt_ctf_field_type *enumeration, const char *name, int64_t range_start, int64_t range_end);
436 int bt_ctf_field_type_enumeration_add_mapping_unsigned(struct bt_ctf_field_type *enumeration, const char *name, uint64_t range_start, uint64_t range_end);
437 int bt_ctf_field_type_enumeration_get_mapping_count(struct bt_ctf_field_type *enumeration);
438 int bt_ctf_field_type_enumeration_get_mapping(struct bt_ctf_field_type *enumeration, int index, const char **OUTPUT, int64_t *OUTPUT, int64_t *OUTPUT);
439 int bt_ctf_field_type_enumeration_get_mapping_unsigned(struct bt_ctf_field_type *enumeration, int index, const char **OUTPUT, uint64_t *OUTPUT, uint64_t *OUTPUT);
440 int bt_ctf_field_type_enumeration_get_mapping_index_by_name(struct bt_ctf_field_type *enumeration, const char *name);
441 int bt_ctf_field_type_enumeration_get_mapping_index_by_value(struct bt_ctf_field_type *enumeration, int64_t value);
442 int bt_ctf_field_type_enumeration_get_mapping_index_by_unsigned_value(struct bt_ctf_field_type *enumeration, uint64_t value);
443 struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void);
444 int bt_ctf_field_type_floating_point_get_exponent_digits(struct bt_ctf_field_type *floating_point);
445 int bt_ctf_field_type_floating_point_set_exponent_digits(struct bt_ctf_field_type *floating_point, unsigned int exponent_digits);
446 int bt_ctf_field_type_floating_point_get_mantissa_digits(struct bt_ctf_field_type *floating_point);
447 int bt_ctf_field_type_floating_point_set_mantissa_digits(struct bt_ctf_field_type *floating_point, unsigned int mantissa_digits);
448 struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void);
449 int bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *structure, struct bt_ctf_field_type *field_type, const char *field_name);
450 int bt_ctf_field_type_structure_get_field_count(struct bt_ctf_field_type *structure);
451 int bt_ctf_field_type_structure_get_field(struct bt_ctf_field_type *structure, const char **OUTPUT, struct bt_ctf_field_type **OUTPUT, int index);
452 struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name(struct bt_ctf_field_type *structure, const char *field_name);
453 struct bt_ctf_field_type *bt_ctf_field_type_variant_create(struct bt_ctf_field_type *enum_tag, const char *tag_name);
454 struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_type(struct bt_ctf_field_type *variant);
455 const char *bt_ctf_field_type_variant_get_tag_name(struct bt_ctf_field_type *variant);
456 int bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *variant, struct bt_ctf_field_type *field_type, const char *field_name);
457 struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name(struct bt_ctf_field_type *variant, const char *field_name);
458 struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(struct bt_ctf_field_type *variant, struct bt_ctf_field *tag);
459 int bt_ctf_field_type_variant_get_field_count(struct bt_ctf_field_type *variant);
460 int bt_ctf_field_type_variant_get_field(struct bt_ctf_field_type *variant, const char **OUTPUT, struct bt_ctf_field_type **OUTPUT, int index);
461 struct bt_ctf_field_type *bt_ctf_field_type_array_create(struct bt_ctf_field_type *element_type, unsigned int length);
462 struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_type(struct bt_ctf_field_type *array);
463 int64_t bt_ctf_field_type_array_get_length(struct bt_ctf_field_type *array);
464 struct bt_ctf_field_type *bt_ctf_field_type_sequence_create(struct bt_ctf_field_type *element_type, const char *length_field_name);
465 struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_type(struct bt_ctf_field_type *sequence);
466 const char *bt_ctf_field_type_sequence_get_length_field_name(struct bt_ctf_field_type *sequence);
467 struct bt_ctf_field_type *bt_ctf_field_type_string_create(void);
468 enum ctf_string_encoding bt_ctf_field_type_string_get_encoding(struct bt_ctf_field_type *string_type);
469 int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *string_type, enum ctf_string_encoding encoding);
470 int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type);
471 int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *type, unsigned int alignment);
472 enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(struct bt_ctf_field_type *type);
473 int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *type, enum bt_ctf_byte_order byte_order);
474 enum ctf_type_id bt_ctf_field_type_get_type_id(struct bt_ctf_field_type *type);
475 void bt_ctf_field_type_get(struct bt_ctf_field_type *type);
476 void bt_ctf_field_type_put(struct bt_ctf_field_type *type);
477
478
479 /* event-fields.h */
480 %rename("_bt_ctf_field_create") bt_ctf_field_create(struct bt_ctf_field_type *type);
481 %rename("_bt_ctf_field_structure_get_field") bt_ctf_field_structure_get_field(struct bt_ctf_field *structure, const char *name);
482 %rename("_bt_ctf_field_array_get_field") bt_ctf_field_array_get_field(struct bt_ctf_field *array, uint64_t index);
483 %rename("_bt_ctf_field_sequence_get_length") bt_ctf_field_sequence_get_length(struct bt_ctf_field *sequence);
484 %rename("_bt_ctf_field_sequence_set_length") bt_ctf_field_sequence_set_length(struct bt_ctf_field *sequence, struct bt_ctf_field *length_field);
485 %rename("_bt_ctf_field_sequence_get_field") bt_ctf_field_sequence_get_field(struct bt_ctf_field *sequence, uint64_t index);
486 %rename("_bt_ctf_field_variant_get_field") bt_ctf_field_variant_get_field(struct bt_ctf_field *variant, struct bt_ctf_field *tag);
487 %rename("_bt_ctf_field_enumeration_get_container") bt_ctf_field_enumeration_get_container(struct bt_ctf_field *enumeration);
488 %rename("_bt_ctf_field_enumeration_get_mapping_name") bt_ctf_field_enumeration_get_mapping_name(struct bt_ctf_field *enumeration);
489 %rename("_bt_ctf_field_signed_integer_get_value") bt_ctf_field_signed_integer_get_value(struct bt_ctf_field *integer, int64_t *value);
490 %rename("_bt_ctf_field_signed_integer_set_value") bt_ctf_field_signed_integer_set_value(struct bt_ctf_field *integer, int64_t value);
491 %rename("_bt_ctf_field_unsigned_integer_get_value") bt_ctf_field_unsigned_integer_get_value(struct bt_ctf_field *integer, uint64_t *value);
492 %rename("_bt_ctf_field_unsigned_integer_set_value") bt_ctf_field_unsigned_integer_set_value(struct bt_ctf_field *integer, uint64_t value);
493 %rename("_bt_ctf_field_floating_point_get_value") bt_ctf_field_floating_point_get_value(struct bt_ctf_field *floating_point, double *value);
494 %rename("_bt_ctf_field_floating_point_set_value") bt_ctf_field_floating_point_set_value(struct bt_ctf_field *floating_point, double value);
495 %rename("_bt_ctf_field_string_get_value") bt_ctf_field_string_get_value(struct bt_ctf_field *string_field);
496 %rename("_bt_ctf_field_string_set_value") bt_ctf_field_string_set_value(struct bt_ctf_field *string_field, const char *value);
497 %rename("_bt_ctf_field_get_type") bt_ctf_field_get_type(struct bt_ctf_field *field);
498 %rename("_bt_ctf_field_get") bt_ctf_field_get(struct bt_ctf_field *field);
499 %rename("_bt_ctf_field_put") bt_ctf_field_put(struct bt_ctf_field *field);
500
501 struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type);
502 struct bt_ctf_field *bt_ctf_field_structure_get_field(struct bt_ctf_field *structure, const char *name);
503 struct bt_ctf_field *bt_ctf_field_array_get_field(struct bt_ctf_field *array, uint64_t index);
504 struct bt_ctf_field * bt_ctf_field_sequence_get_length(struct bt_ctf_field *sequence);
505 int bt_ctf_field_sequence_set_length(struct bt_ctf_field *sequence, struct bt_ctf_field *length_field);
506 struct bt_ctf_field *bt_ctf_field_sequence_get_field(struct bt_ctf_field *sequence, uint64_t index);
507 struct bt_ctf_field *bt_ctf_field_variant_get_field(struct bt_ctf_field *variant, struct bt_ctf_field *tag);
508 struct bt_ctf_field *bt_ctf_field_enumeration_get_container(struct bt_ctf_field *enumeration);
509 const char *bt_ctf_field_enumeration_get_mapping_name(struct bt_ctf_field *enumeration);
510 int bt_ctf_field_signed_integer_get_value(struct bt_ctf_field *integer, int64_t *OUTPUT);
511 int bt_ctf_field_signed_integer_set_value(struct bt_ctf_field *integer, int64_t value);
512 int bt_ctf_field_unsigned_integer_get_value(struct bt_ctf_field *integer, uint64_t *OUTPUT);
513 int bt_ctf_field_unsigned_integer_set_value(struct bt_ctf_field *integer, uint64_t value);
514 int bt_ctf_field_floating_point_get_value(struct bt_ctf_field *floating_point, double *OUTPUT);
515 int bt_ctf_field_floating_point_set_value(struct bt_ctf_field *floating_point, double value);
516 const char *bt_ctf_field_string_get_value(struct bt_ctf_field *string_field);
517 int bt_ctf_field_string_set_value(struct bt_ctf_field *string_field, const char *value);
518 struct bt_ctf_field_type *bt_ctf_field_get_type(struct bt_ctf_field *field);
519 void bt_ctf_field_get(struct bt_ctf_field *field);
520 void bt_ctf_field_put(struct bt_ctf_field *field);
521
522
523 /* event-class.h */
524 %rename("_bt_ctf_event_class_create") bt_ctf_event_class_create(const char *name);
525 %rename("_bt_ctf_event_class_get_name") bt_ctf_event_class_get_name(struct bt_ctf_event_class *event_class);
526 %rename("_bt_ctf_event_class_get_id") bt_ctf_event_class_get_id(struct bt_ctf_event_class *event_class);
527 %rename("_bt_ctf_event_class_set_id") bt_ctf_event_class_set_id(struct bt_ctf_event_class *event_class, uint32_t id);
528 %rename("_bt_ctf_event_class_get_stream_class") bt_ctf_event_class_get_stream_class(struct bt_ctf_event_class *event_class);
529 %rename("_bt_ctf_event_class_add_field") bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class, struct bt_ctf_field_type *type, const char *name);
530 %rename("_bt_ctf_event_class_get_field_count") bt_ctf_event_class_get_field_count(struct bt_ctf_event_class *event_class);
531 %rename("_bt_ctf_event_class_get_field") bt_ctf_event_class_get_field(struct bt_ctf_event_class *event_class, const char **field_name, struct bt_ctf_field_type **field_type, int index);
532 %rename("_bt_ctf_event_class_get_field_by_name") bt_ctf_event_class_get_field_by_name(struct bt_ctf_event_class *event_class, const char *name);
533 %rename("_bt_ctf_event_class_get") bt_ctf_event_class_get(struct bt_ctf_event_class *event_class);
534 %rename("_bt_ctf_event_class_put") bt_ctf_event_class_put(struct bt_ctf_event_class *event_class);
535
536 struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name);
537 const char *bt_ctf_event_class_get_name(struct bt_ctf_event_class *event_class);
538 int64_t bt_ctf_event_class_get_id(struct bt_ctf_event_class *event_class);
539 int bt_ctf_event_class_set_id(struct bt_ctf_event_class *event_class, uint32_t id);
540 struct bt_ctf_stream_class *bt_ctf_event_class_get_stream_class(struct bt_ctf_event_class *event_class);
541 int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class, struct bt_ctf_field_type *type, const char *name);
542 int bt_ctf_event_class_get_field_count(struct bt_ctf_event_class *event_class);
543 int bt_ctf_event_class_get_field(struct bt_ctf_event_class *event_class, const char **field_name, struct bt_ctf_field_type **field_type, int index);
544 struct bt_ctf_field_type *bt_ctf_event_class_get_field_by_name(struct bt_ctf_event_class *event_class, const char *name);
545 void bt_ctf_event_class_get(struct bt_ctf_event_class *event_class);
546 void bt_ctf_event_class_put(struct bt_ctf_event_class *event_class);
547
548
549 /* event.h */
550 %rename("_bt_ctf_event_create") bt_ctf_event_create(struct bt_ctf_event_class *event_class);
551 %rename("_bt_ctf_event_get_class") bt_ctf_event_get_class(struct bt_ctf_event *event);
552 %rename("_bt_ctf_event_get_clock") bt_ctf_event_get_clock(struct bt_ctf_event *event);
553 %rename("_bt_ctf_event_get_payload") bt_ctf_event_get_payload(struct bt_ctf_event *event, const char *name);
554 %rename("_bt_ctf_event_set_payload") bt_ctf_event_set_payload(struct bt_ctf_event *event, const char *name, struct bt_ctf_field *value);
555 %rename("_bt_ctf_event_get_payload_by_index") bt_ctf_event_get_payload_by_index(struct bt_ctf_event *event, int index);
556 %rename("_bt_ctf_event_get") bt_ctf_event_get(struct bt_ctf_event *event);
557 %rename("_bt_ctf_event_put") bt_ctf_event_put(struct bt_ctf_event *event);
558
559 struct bt_ctf_event *bt_ctf_event_create(struct bt_ctf_event_class *event_class);
560 struct bt_ctf_event_class *bt_ctf_event_get_class(struct bt_ctf_event *event);
561 struct bt_ctf_clock *bt_ctf_event_get_clock(struct bt_ctf_event *event);
562 struct bt_ctf_field *bt_ctf_event_get_payload(struct bt_ctf_event *event, const char *name);
563 int bt_ctf_event_set_payload(struct bt_ctf_event *event, const char *name, struct bt_ctf_field *value);
564 struct bt_ctf_field *bt_ctf_event_get_payload_by_index(struct bt_ctf_event *event, int index);
565 void bt_ctf_event_get(struct bt_ctf_event *event);
566 void bt_ctf_event_put(struct bt_ctf_event *event);
567
568
569 /* stream-class.h */
570 %rename("_bt_ctf_stream_class_create") bt_ctf_stream_class_create(const char *name);
571 %rename("_bt_ctf_stream_class_get_name") bt_ctf_stream_class_get_name(struct bt_ctf_stream_class *stream_class);
572 %rename("_bt_ctf_stream_class_get_clock") bt_ctf_stream_class_get_clock(struct bt_ctf_stream_class *stream_class);
573 %rename("_bt_ctf_stream_class_set_clock") bt_ctf_stream_class_set_clock(struct bt_ctf_stream_class *stream_class, struct bt_ctf_clock *clock);
574 %rename("_bt_ctf_stream_class_get_id") bt_ctf_stream_class_get_id(struct bt_ctf_stream_class *stream_class);
575 %rename("_bt_ctf_stream_class_set_id") bt_ctf_stream_class_set_id(struct bt_ctf_stream_class *stream_class, uint32_t id);
576 %rename("_bt_ctf_stream_class_add_event_class") bt_ctf_stream_class_add_event_class(struct bt_ctf_stream_class *stream_class, struct bt_ctf_event_class *event_class);
577 %rename("_bt_ctf_stream_class_get_event_class_count") bt_ctf_stream_class_get_event_class_count(struct bt_ctf_stream_class *stream_class);
578 %rename("_bt_ctf_stream_class_get_event_class") bt_ctf_stream_class_get_event_class(struct bt_ctf_stream_class *stream_class, int index);
579 %rename("_bt_ctf_stream_class_get_event_class_by_name") bt_ctf_stream_class_get_event_class_by_name(struct bt_ctf_stream_class *stream_class, const char *name);
580 %rename("_bt_ctf_stream_class_get_packet_context_type") bt_ctf_stream_class_get_packet_context_type(struct bt_ctf_stream_class *stream_class);
581 %rename("_bt_ctf_stream_class_set_packet_context_type") bt_ctf_stream_class_set_packet_context_type(struct bt_ctf_stream_class *stream_class, struct bt_ctf_field_type *packet_context_type);
582 %rename("_bt_ctf_stream_class_get") bt_ctf_stream_class_get(struct bt_ctf_stream_class *stream_class);
583 %rename("_bt_ctf_stream_class_put") bt_ctf_stream_class_put(struct bt_ctf_stream_class *stream_class);
584
585 struct bt_ctf_stream_class *bt_ctf_stream_class_create(const char *name);
586 const char *bt_ctf_stream_class_get_name(struct bt_ctf_stream_class *stream_class);
587 struct bt_ctf_clock *bt_ctf_stream_class_get_clock(struct bt_ctf_stream_class *stream_class);
588 int bt_ctf_stream_class_set_clock(struct bt_ctf_stream_class *stream_class, struct bt_ctf_clock *clock);
589 int64_t bt_ctf_stream_class_get_id(struct bt_ctf_stream_class *stream_class);
590 int bt_ctf_stream_class_set_id(struct bt_ctf_stream_class *stream_class, uint32_t id);
591 int bt_ctf_stream_class_add_event_class(struct bt_ctf_stream_class *stream_class, struct bt_ctf_event_class *event_class);
592 int bt_ctf_stream_class_get_event_class_count(struct bt_ctf_stream_class *stream_class);
593 struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class(struct bt_ctf_stream_class *stream_class, int index);
594 struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_name(struct bt_ctf_stream_class *stream_class, const char *name);
595 struct bt_ctf_field_type *bt_ctf_stream_class_get_packet_context_type(struct bt_ctf_stream_class *stream_class);
596 int bt_ctf_stream_class_set_packet_context_type(struct bt_ctf_stream_class *stream_class, struct bt_ctf_field_type *packet_context_type);
597 void bt_ctf_stream_class_get(struct bt_ctf_stream_class *stream_class);
598 void bt_ctf_stream_class_put(struct bt_ctf_stream_class *stream_class);
599
600
601 /* stream.h */
602 %rename("_bt_ctf_stream_get_discarded_events_count") bt_ctf_stream_get_discarded_events_count(struct bt_ctf_stream *stream, uint64_t *count);
603 %rename("_bt_ctf_stream_append_discarded_events") bt_ctf_stream_append_discarded_events(struct bt_ctf_stream *stream, uint64_t event_count);
604 %rename("_bt_ctf_stream_append_event") bt_ctf_stream_append_event(struct bt_ctf_stream *stream, struct bt_ctf_event *event);
605 %rename("_bt_ctf_stream_get_packet_context") bt_ctf_stream_get_packet_context(struct bt_ctf_stream *stream);
606 %rename("_bt_ctf_stream_set_packet_context") bt_ctf_stream_set_packet_context(struct bt_ctf_stream *stream, struct bt_ctf_field *packet_context);
607 %rename("_bt_ctf_stream_flush") bt_ctf_stream_flush(struct bt_ctf_stream *stream);
608 %rename("_bt_ctf_stream_get") bt_ctf_stream_get(struct bt_ctf_stream *stream);
609 %rename("_bt_ctf_stream_put") bt_ctf_stream_put(struct bt_ctf_stream *stream);
610
611 int bt_ctf_stream_get_discarded_events_count(struct bt_ctf_stream *stream, uint64_t *OUTPUT);
612 void bt_ctf_stream_append_discarded_events(struct bt_ctf_stream *stream, uint64_t event_count);
613 int bt_ctf_stream_append_event(struct bt_ctf_stream *stream, struct bt_ctf_event *event);
614 struct bt_ctf_field *bt_ctf_stream_get_packet_context(struct bt_ctf_stream *stream);
615 int bt_ctf_stream_set_packet_context(struct bt_ctf_stream *stream, struct bt_ctf_field *packet_context);
616 int bt_ctf_stream_flush(struct bt_ctf_stream *stream);
617 void bt_ctf_stream_get(struct bt_ctf_stream *stream);
618 void bt_ctf_stream_put(struct bt_ctf_stream *stream);
619
620
621 /* writer.h */
622 %rename("_bt_ctf_writer_create") bt_ctf_writer_create(const char *path);
623 %rename("_bt_ctf_writer_create_stream") bt_ctf_writer_create_stream(struct bt_ctf_writer *writer, struct bt_ctf_stream_class *stream_class);
624 %rename("_bt_ctf_writer_add_environment_field") bt_ctf_writer_add_environment_field(struct bt_ctf_writer *writer, const char *name, const char *value);
625 %rename("_bt_ctf_writer_add_clock") bt_ctf_writer_add_clock(struct bt_ctf_writer *writer, struct bt_ctf_clock *clock);
626 %newobject bt_ctf_writer_get_metadata_string;
627 %rename("_bt_ctf_writer_get_metadata_string") bt_ctf_writer_get_metadata_string(struct bt_ctf_writer *writer);
628 %rename("_bt_ctf_writer_flush_metadata") bt_ctf_writer_flush_metadata(struct bt_ctf_writer *writer);
629 %rename("_bt_ctf_writer_set_byte_order") bt_ctf_writer_set_byte_order(struct bt_ctf_writer *writer, enum bt_ctf_byte_order byte_order);
630 %rename("_bt_ctf_writer_get") bt_ctf_writer_get(struct bt_ctf_writer *writer);
631 %rename("_bt_ctf_writer_put") bt_ctf_writer_put(struct bt_ctf_writer *writer);
632
633 struct bt_ctf_writer *bt_ctf_writer_create(const char *path);
634 struct bt_ctf_stream *bt_ctf_writer_create_stream(struct bt_ctf_writer *writer, struct bt_ctf_stream_class *stream_class);
635 int bt_ctf_writer_add_environment_field(struct bt_ctf_writer *writer, const char *name, const char *value);
636 int bt_ctf_writer_add_clock(struct bt_ctf_writer *writer, struct bt_ctf_clock *clock);
637 char *bt_ctf_writer_get_metadata_string(struct bt_ctf_writer *writer);
638 void bt_ctf_writer_flush_metadata(struct bt_ctf_writer *writer);
639 int bt_ctf_writer_set_byte_order(struct bt_ctf_writer *writer, enum bt_ctf_byte_order byte_order);
640 void bt_ctf_writer_get(struct bt_ctf_writer *writer);
641 void bt_ctf_writer_put(struct bt_ctf_writer *writer);
This page took 0.042855 seconds and 4 git commands to generate.