Commit | Line | Data |
---|---|---|
6fa6bfa1 SM |
1 | /* |
2 | * The MIT License (MIT) | |
3 | * | |
4 | * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com> | |
5 | * | |
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 | * of this software and associated documentation files (the "Software"), to deal | |
8 | * in the Software without restriction, including without limitation the rights | |
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
10 | * copies of the Software, and to permit persons to whom the Software is | |
11 | * furnished to do so, subject to the following conditions: | |
12 | * | |
13 | * The above copyright notice and this permission notice shall be included in | |
14 | * all copies or substantial portions of the Software. | |
15 | * | |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
22 | * THE SOFTWARE. | |
23 | */ | |
24 | ||
0010c8b0 SM |
25 | |
26 | /* Output argument typemap for clock value output (always appends) */ | |
27 | %typemap(in, numinputs=0) | |
28 | (const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT) | |
29 | (bt_clock_snapshot *temp_clock_snapshot = NULL) { | |
30 | $1 = &temp_clock_snapshot; | |
31 | } | |
32 | ||
33 | %typemap(argout) | |
34 | (const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT) { | |
35 | if (*$1) { | |
36 | /* SWIG_Python_AppendOutput() steals the created object */ | |
37 | $result = SWIG_Python_AppendOutput($result, | |
38 | SWIG_NewPointerObj(SWIG_as_voidptr(*$1), | |
39 | SWIGTYPE_p_bt_clock_snapshot, 0)); | |
40 | } else { | |
41 | /* SWIG_Python_AppendOutput() steals Py_None */ | |
42 | Py_INCREF(Py_None); | |
43 | $result = SWIG_Python_AppendOutput($result, Py_None); | |
44 | } | |
45 | } | |
46 | ||
6fa6bfa1 SM |
47 | /* From message-const.h */ |
48 | ||
49 | typedef enum bt_message_type { | |
50 | BT_MESSAGE_TYPE_EVENT = 0, | |
51 | BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY = 1, | |
52 | BT_MESSAGE_TYPE_STREAM_BEGINNING = 2, | |
53 | BT_MESSAGE_TYPE_STREAM_END = 3, | |
54 | BT_MESSAGE_TYPE_PACKET_BEGINNING = 4, | |
55 | BT_MESSAGE_TYPE_PACKET_END = 5, | |
56 | BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING = 6, | |
57 | BT_MESSAGE_TYPE_STREAM_ACTIVITY_END = 7, | |
58 | BT_MESSAGE_TYPE_DISCARDED_EVENTS = 8, | |
59 | BT_MESSAGE_TYPE_DISCARDED_PACKETS = 9, | |
60 | } bt_message_type; | |
61 | ||
62 | extern bt_message_type bt_message_get_type(const bt_message *message); | |
63 | ||
64 | extern void bt_message_get_ref(const bt_message *message); | |
65 | ||
66 | extern void bt_message_put_ref(const bt_message *message); | |
67 | ||
68 | /* From message-event-const.h */ | |
69 | ||
70 | extern const bt_event *bt_message_event_borrow_event_const( | |
71 | const bt_message *message); | |
72 | ||
11ddb3ef | 73 | extern const bt_clock_snapshot * |
6fa6bfa1 | 74 | bt_message_event_borrow_default_clock_snapshot_const( |
11ddb3ef | 75 | const bt_message *msg); |
6fa6bfa1 SM |
76 | |
77 | extern const bt_clock_class * | |
78 | bt_message_event_borrow_stream_class_default_clock_class_const( | |
79 | const bt_message *msg); | |
80 | ||
81 | /* From message-event.h */ | |
82 | ||
83 | extern | |
84 | bt_message *bt_message_event_create( | |
85 | bt_self_message_iterator *message_iterator, | |
86 | const bt_event_class *event_class, | |
87 | const bt_packet *packet); | |
88 | ||
89 | extern | |
90 | bt_message *bt_message_event_create_with_default_clock_snapshot( | |
91 | bt_self_message_iterator *message_iterator, | |
92 | const bt_event_class *event_class, | |
93 | const bt_packet *packet, uint64_t raw_clock_value); | |
94 | ||
95 | extern bt_event *bt_message_event_borrow_event( | |
96 | bt_message *message); | |
97 | ||
98 | /* From message-message-iterator-inactivity-const.h */ | |
99 | ||
11ddb3ef | 100 | extern const bt_clock_snapshot * |
6fa6bfa1 | 101 | bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const( |
11ddb3ef | 102 | const bt_message *msg); |
6fa6bfa1 SM |
103 | |
104 | /* From message-message-iterator-inactivity.h */ | |
105 | ||
106 | extern | |
107 | bt_message *bt_message_message_iterator_inactivity_create( | |
108 | bt_self_message_iterator *message_iterator, | |
109 | const bt_clock_class *default_clock_class, uint64_t raw_value); | |
110 | ||
111 | /* From message-stream-beginning-const.h */ | |
112 | ||
113 | extern const bt_stream *bt_message_stream_beginning_borrow_stream_const( | |
114 | const bt_message *message); | |
115 | ||
116 | /* From message-stream-beginning.h */ | |
117 | ||
118 | extern | |
119 | bt_message *bt_message_stream_beginning_create( | |
120 | bt_self_message_iterator *message_iterator, | |
121 | const bt_stream *stream); | |
122 | ||
123 | extern bt_stream *bt_message_stream_beginning_borrow_stream( | |
124 | bt_message *message); | |
125 | ||
126 | /* From message-stream-end-const.h */ | |
127 | ||
128 | extern const bt_stream *bt_message_stream_end_borrow_stream_const( | |
129 | const bt_message *message); | |
130 | ||
131 | /* From message-stream-end.h */ | |
132 | ||
133 | extern | |
134 | bt_message *bt_message_stream_end_create( | |
135 | bt_self_message_iterator *message_iterator, | |
136 | const bt_stream *stream); | |
137 | ||
138 | extern bt_stream *bt_message_stream_end_borrow_stream( | |
139 | bt_message *message); | |
140 | ||
141 | /* From message-packet-beginning-const.h */ | |
142 | ||
143 | extern const bt_packet *bt_message_packet_beginning_borrow_packet_const( | |
144 | const bt_message *message); | |
145 | ||
11ddb3ef | 146 | extern const bt_clock_snapshot * |
6fa6bfa1 | 147 | bt_message_packet_beginning_borrow_default_clock_snapshot_const( |
11ddb3ef | 148 | const bt_message *msg); |
6fa6bfa1 SM |
149 | |
150 | extern const bt_clock_class * | |
151 | bt_message_packet_beginning_borrow_stream_class_default_clock_class_const( | |
152 | const bt_message *msg); | |
153 | ||
154 | /* From message-packet-beginning.h */ | |
155 | ||
156 | extern | |
157 | bt_message *bt_message_packet_beginning_create( | |
158 | bt_self_message_iterator *message_iterator, | |
159 | const bt_packet *packet); | |
160 | ||
161 | extern | |
162 | bt_message *bt_message_packet_beginning_create_with_default_clock_snapshot( | |
163 | bt_self_message_iterator *message_iterator, | |
164 | const bt_packet *packet, uint64_t raw_value); | |
165 | ||
166 | extern bt_packet *bt_message_packet_beginning_borrow_packet( | |
167 | bt_message *message); | |
168 | ||
169 | /* From message-packet-end-const.h */ | |
170 | ||
171 | extern const bt_packet *bt_message_packet_end_borrow_packet_const( | |
172 | const bt_message *message); | |
173 | ||
11ddb3ef | 174 | extern const bt_clock_snapshot * |
6fa6bfa1 | 175 | bt_message_packet_end_borrow_default_clock_snapshot_const( |
11ddb3ef | 176 | const bt_message *msg); |
6fa6bfa1 SM |
177 | |
178 | extern const bt_clock_class * | |
179 | bt_message_packet_end_borrow_stream_class_default_clock_class_const( | |
180 | const bt_message *msg); | |
181 | ||
182 | /* From message-packet-end.h */ | |
183 | ||
184 | extern | |
185 | bt_message *bt_message_packet_end_create( | |
186 | bt_self_message_iterator *message_iterator, | |
187 | const bt_packet *packet); | |
188 | ||
189 | extern | |
190 | bt_message *bt_message_packet_end_create_with_default_clock_snapshot( | |
191 | bt_self_message_iterator *message_iterator, | |
192 | const bt_packet *packet, uint64_t raw_value); | |
193 | ||
194 | extern bt_packet *bt_message_packet_end_borrow_packet( | |
195 | bt_message *message); | |
196 | ||
197 | /* From message-stream-activity-const.h */ | |
198 | ||
199 | typedef enum bt_message_stream_activity_clock_snapshot_state { | |
200 | BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_KNOWN, | |
201 | BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_UNKNOWN, | |
202 | BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_INFINITE, | |
203 | } bt_message_stream_activity_clock_snapshot_state; | |
204 | ||
205 | /* From message-stream-activity-beginning-const.h */ | |
206 | ||
207 | extern bt_message_stream_activity_clock_snapshot_state | |
208 | bt_message_stream_activity_beginning_borrow_default_clock_snapshot_const( | |
209 | const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT); | |
210 | ||
211 | extern const bt_clock_class * | |
212 | bt_message_stream_activity_beginning_borrow_stream_class_default_clock_class_const( | |
213 | const bt_message *msg); | |
214 | ||
215 | extern const bt_stream * | |
216 | bt_message_stream_activity_beginning_borrow_stream_const( | |
217 | const bt_message *message); | |
218 | ||
219 | /* From message-stream-activity-beginning.h */ | |
220 | ||
221 | extern bt_message *bt_message_stream_activity_beginning_create( | |
222 | bt_self_message_iterator *message_iterator, | |
223 | const bt_stream *stream); | |
224 | ||
225 | extern bt_stream *bt_message_stream_activity_beginning_borrow_stream( | |
226 | bt_message *message); | |
227 | ||
228 | extern void bt_message_stream_activity_beginning_set_default_clock_snapshot_state( | |
229 | bt_message *msg, | |
230 | bt_message_stream_activity_clock_snapshot_state state); | |
231 | ||
232 | extern void bt_message_stream_activity_beginning_set_default_clock_snapshot( | |
233 | bt_message *msg, uint64_t raw_value); | |
234 | ||
235 | /* From message-stream-activity-end-const.h */ | |
236 | ||
237 | extern bt_message_stream_activity_clock_snapshot_state | |
238 | bt_message_stream_activity_end_borrow_default_clock_snapshot_const( | |
239 | const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT); | |
240 | ||
241 | extern const bt_clock_class * | |
242 | bt_message_stream_activity_end_borrow_stream_class_default_clock_class_const( | |
243 | const bt_message *msg); | |
244 | ||
245 | extern const bt_stream * | |
246 | bt_message_stream_activity_end_borrow_stream_const( | |
247 | const bt_message *message); | |
248 | ||
249 | /* From message-stream-activity-end.h */ | |
250 | ||
251 | extern bt_message *bt_message_stream_activity_end_create( | |
252 | bt_self_message_iterator *message_iterator, | |
253 | const bt_stream *stream); | |
254 | ||
255 | extern void bt_message_stream_activity_end_set_default_clock_snapshot_state( | |
256 | bt_message *msg, | |
257 | bt_message_stream_activity_clock_snapshot_state state); | |
258 | ||
259 | extern void bt_message_stream_activity_end_set_default_clock_snapshot( | |
260 | bt_message *msg, uint64_t raw_value); | |
261 | ||
262 | extern bt_stream *bt_message_stream_activity_end_borrow_stream( | |
263 | bt_message *message); | |
264 | ||
265 | /* From message-discarded-events-const.h */ | |
266 | ||
11ddb3ef | 267 | extern const bt_clock_snapshot * |
5ef34326 | 268 | bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const( |
11ddb3ef | 269 | const bt_message *msg); |
6fa6bfa1 | 270 | |
11ddb3ef | 271 | extern const bt_clock_snapshot * |
5ef34326 | 272 | bt_message_discarded_events_borrow_end_default_clock_snapshot_const( |
11ddb3ef | 273 | const bt_message *msg); |
6fa6bfa1 SM |
274 | |
275 | extern const bt_clock_class * | |
276 | bt_message_discarded_events_borrow_stream_class_default_clock_class_const( | |
277 | const bt_message *msg); | |
278 | ||
279 | extern const bt_stream * | |
280 | bt_message_discarded_events_borrow_stream_const(const bt_message *message); | |
281 | ||
282 | extern bt_property_availability bt_message_discarded_events_get_count( | |
283 | const bt_message *message, uint64_t *OUT); | |
284 | ||
285 | /* From message-discarded-events.h */ | |
286 | ||
287 | extern bt_message *bt_message_discarded_events_create( | |
288 | bt_self_message_iterator *message_iterator, | |
289 | const bt_stream *stream); | |
290 | ||
291 | extern bt_message *bt_message_discarded_events_create_with_default_clock_snapshots( | |
292 | bt_self_message_iterator *message_iterator, | |
293 | const bt_stream *stream, uint64_t beginning_raw_value, | |
294 | uint64_t end_raw_value); | |
295 | ||
296 | extern bt_stream *bt_message_discarded_events_borrow_stream( | |
297 | bt_message *message); | |
298 | ||
299 | extern void bt_message_discarded_events_set_count(bt_message *message, | |
300 | uint64_t count); | |
301 | ||
302 | /* From message-discarded-packets-const.h */ | |
303 | ||
11ddb3ef | 304 | extern const bt_clock_snapshot * |
5ef34326 | 305 | bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const( |
11ddb3ef | 306 | const bt_message *msg); |
6fa6bfa1 | 307 | |
11ddb3ef | 308 | extern const bt_clock_snapshot * |
5ef34326 | 309 | bt_message_discarded_packets_borrow_end_default_clock_snapshot_const( |
11ddb3ef | 310 | const bt_message *msg); |
6fa6bfa1 SM |
311 | |
312 | extern const bt_clock_class * | |
313 | bt_message_discarded_packets_borrow_stream_class_default_clock_class_const( | |
314 | const bt_message *msg); | |
315 | ||
316 | extern const bt_stream * | |
317 | bt_message_discarded_packets_borrow_stream_const(const bt_message *message); | |
318 | ||
319 | extern bt_property_availability bt_message_discarded_packets_get_count( | |
320 | const bt_message *message, uint64_t *OUT); | |
321 | ||
322 | /* From message-discarded-packets.h */ | |
323 | ||
324 | extern bt_message *bt_message_discarded_packets_create( | |
325 | bt_self_message_iterator *message_iterator, | |
326 | const bt_stream *stream); | |
327 | ||
328 | extern bt_message *bt_message_discarded_packets_create_with_default_clock_snapshots( | |
329 | bt_self_message_iterator *message_iterator, | |
330 | const bt_stream *stream, uint64_t beginning_raw_value, | |
331 | uint64_t end_raw_value); | |
332 | ||
333 | extern bt_stream *bt_message_discarded_packets_borrow_stream( | |
334 | bt_message *message); | |
335 | ||
336 | extern void bt_message_discarded_packets_set_count(bt_message *message, | |
337 | uint64_t count); |