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