| 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 | |
| 25 | /* From message-const.h */ |
| 26 | |
| 27 | typedef enum bt_message_type { |
| 28 | BT_MESSAGE_TYPE_EVENT = 0, |
| 29 | BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY = 1, |
| 30 | BT_MESSAGE_TYPE_STREAM_BEGINNING = 2, |
| 31 | BT_MESSAGE_TYPE_STREAM_END = 3, |
| 32 | BT_MESSAGE_TYPE_PACKET_BEGINNING = 4, |
| 33 | BT_MESSAGE_TYPE_PACKET_END = 5, |
| 34 | BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING = 6, |
| 35 | BT_MESSAGE_TYPE_STREAM_ACTIVITY_END = 7, |
| 36 | BT_MESSAGE_TYPE_DISCARDED_EVENTS = 8, |
| 37 | BT_MESSAGE_TYPE_DISCARDED_PACKETS = 9, |
| 38 | } bt_message_type; |
| 39 | |
| 40 | extern bt_message_type bt_message_get_type(const bt_message *message); |
| 41 | |
| 42 | extern void bt_message_get_ref(const bt_message *message); |
| 43 | |
| 44 | extern void bt_message_put_ref(const bt_message *message); |
| 45 | |
| 46 | /* From message-event-const.h */ |
| 47 | |
| 48 | extern const bt_event *bt_message_event_borrow_event_const( |
| 49 | const bt_message *message); |
| 50 | |
| 51 | extern const bt_clock_snapshot * |
| 52 | bt_message_event_borrow_default_clock_snapshot_const( |
| 53 | const bt_message *msg); |
| 54 | |
| 55 | extern const bt_clock_class * |
| 56 | bt_message_event_borrow_stream_class_default_clock_class_const( |
| 57 | const bt_message *msg); |
| 58 | |
| 59 | /* From message-event.h */ |
| 60 | |
| 61 | extern |
| 62 | bt_message *bt_message_event_create( |
| 63 | bt_self_message_iterator *message_iterator, |
| 64 | const bt_event_class *event_class, |
| 65 | const bt_packet *packet); |
| 66 | |
| 67 | extern |
| 68 | bt_message *bt_message_event_create_with_default_clock_snapshot( |
| 69 | bt_self_message_iterator *message_iterator, |
| 70 | const bt_event_class *event_class, |
| 71 | const bt_packet *packet, uint64_t raw_clock_value); |
| 72 | |
| 73 | extern bt_event *bt_message_event_borrow_event( |
| 74 | bt_message *message); |
| 75 | |
| 76 | /* From message-message-iterator-inactivity-const.h */ |
| 77 | |
| 78 | extern const bt_clock_snapshot * |
| 79 | bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const( |
| 80 | const bt_message *msg); |
| 81 | |
| 82 | /* From message-message-iterator-inactivity.h */ |
| 83 | |
| 84 | extern |
| 85 | bt_message *bt_message_message_iterator_inactivity_create( |
| 86 | bt_self_message_iterator *message_iterator, |
| 87 | const bt_clock_class *default_clock_class, uint64_t raw_value); |
| 88 | |
| 89 | /* From message-stream-beginning-const.h */ |
| 90 | |
| 91 | extern const bt_stream *bt_message_stream_beginning_borrow_stream_const( |
| 92 | const bt_message *message); |
| 93 | |
| 94 | /* From message-stream-beginning.h */ |
| 95 | |
| 96 | extern |
| 97 | bt_message *bt_message_stream_beginning_create( |
| 98 | bt_self_message_iterator *message_iterator, |
| 99 | const bt_stream *stream); |
| 100 | |
| 101 | extern bt_stream *bt_message_stream_beginning_borrow_stream( |
| 102 | bt_message *message); |
| 103 | |
| 104 | /* From message-stream-end-const.h */ |
| 105 | |
| 106 | extern const bt_stream *bt_message_stream_end_borrow_stream_const( |
| 107 | const bt_message *message); |
| 108 | |
| 109 | /* From message-stream-end.h */ |
| 110 | |
| 111 | extern |
| 112 | bt_message *bt_message_stream_end_create( |
| 113 | bt_self_message_iterator *message_iterator, |
| 114 | const bt_stream *stream); |
| 115 | |
| 116 | extern bt_stream *bt_message_stream_end_borrow_stream( |
| 117 | bt_message *message); |
| 118 | |
| 119 | /* From message-packet-beginning-const.h */ |
| 120 | |
| 121 | extern const bt_packet *bt_message_packet_beginning_borrow_packet_const( |
| 122 | const bt_message *message); |
| 123 | |
| 124 | extern const bt_clock_snapshot * |
| 125 | bt_message_packet_beginning_borrow_default_clock_snapshot_const( |
| 126 | const bt_message *msg); |
| 127 | |
| 128 | extern const bt_clock_class * |
| 129 | bt_message_packet_beginning_borrow_stream_class_default_clock_class_const( |
| 130 | const bt_message *msg); |
| 131 | |
| 132 | /* From message-packet-beginning.h */ |
| 133 | |
| 134 | extern |
| 135 | bt_message *bt_message_packet_beginning_create( |
| 136 | bt_self_message_iterator *message_iterator, |
| 137 | const bt_packet *packet); |
| 138 | |
| 139 | extern |
| 140 | bt_message *bt_message_packet_beginning_create_with_default_clock_snapshot( |
| 141 | bt_self_message_iterator *message_iterator, |
| 142 | const bt_packet *packet, uint64_t raw_value); |
| 143 | |
| 144 | extern bt_packet *bt_message_packet_beginning_borrow_packet( |
| 145 | bt_message *message); |
| 146 | |
| 147 | /* From message-packet-end-const.h */ |
| 148 | |
| 149 | extern const bt_packet *bt_message_packet_end_borrow_packet_const( |
| 150 | const bt_message *message); |
| 151 | |
| 152 | extern const bt_clock_snapshot * |
| 153 | bt_message_packet_end_borrow_default_clock_snapshot_const( |
| 154 | const bt_message *msg); |
| 155 | |
| 156 | extern const bt_clock_class * |
| 157 | bt_message_packet_end_borrow_stream_class_default_clock_class_const( |
| 158 | const bt_message *msg); |
| 159 | |
| 160 | /* From message-packet-end.h */ |
| 161 | |
| 162 | extern |
| 163 | bt_message *bt_message_packet_end_create( |
| 164 | bt_self_message_iterator *message_iterator, |
| 165 | const bt_packet *packet); |
| 166 | |
| 167 | extern |
| 168 | bt_message *bt_message_packet_end_create_with_default_clock_snapshot( |
| 169 | bt_self_message_iterator *message_iterator, |
| 170 | const bt_packet *packet, uint64_t raw_value); |
| 171 | |
| 172 | extern bt_packet *bt_message_packet_end_borrow_packet( |
| 173 | bt_message *message); |
| 174 | |
| 175 | /* From message-stream-activity-const.h */ |
| 176 | |
| 177 | typedef enum bt_message_stream_activity_clock_snapshot_state { |
| 178 | BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_KNOWN, |
| 179 | BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_UNKNOWN, |
| 180 | BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_INFINITE, |
| 181 | } bt_message_stream_activity_clock_snapshot_state; |
| 182 | |
| 183 | /* From message-stream-activity-beginning-const.h */ |
| 184 | |
| 185 | extern bt_message_stream_activity_clock_snapshot_state |
| 186 | bt_message_stream_activity_beginning_borrow_default_clock_snapshot_const( |
| 187 | const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT); |
| 188 | |
| 189 | extern const bt_clock_class * |
| 190 | bt_message_stream_activity_beginning_borrow_stream_class_default_clock_class_const( |
| 191 | const bt_message *msg); |
| 192 | |
| 193 | extern const bt_stream * |
| 194 | bt_message_stream_activity_beginning_borrow_stream_const( |
| 195 | const bt_message *message); |
| 196 | |
| 197 | /* From message-stream-activity-beginning.h */ |
| 198 | |
| 199 | extern bt_message *bt_message_stream_activity_beginning_create( |
| 200 | bt_self_message_iterator *message_iterator, |
| 201 | const bt_stream *stream); |
| 202 | |
| 203 | extern bt_stream *bt_message_stream_activity_beginning_borrow_stream( |
| 204 | bt_message *message); |
| 205 | |
| 206 | extern void bt_message_stream_activity_beginning_set_default_clock_snapshot_state( |
| 207 | bt_message *msg, |
| 208 | bt_message_stream_activity_clock_snapshot_state state); |
| 209 | |
| 210 | extern void bt_message_stream_activity_beginning_set_default_clock_snapshot( |
| 211 | bt_message *msg, uint64_t raw_value); |
| 212 | |
| 213 | /* From message-stream-activity-end-const.h */ |
| 214 | |
| 215 | extern bt_message_stream_activity_clock_snapshot_state |
| 216 | bt_message_stream_activity_end_borrow_default_clock_snapshot_const( |
| 217 | const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT); |
| 218 | |
| 219 | extern const bt_clock_class * |
| 220 | bt_message_stream_activity_end_borrow_stream_class_default_clock_class_const( |
| 221 | const bt_message *msg); |
| 222 | |
| 223 | extern const bt_stream * |
| 224 | bt_message_stream_activity_end_borrow_stream_const( |
| 225 | const bt_message *message); |
| 226 | |
| 227 | /* From message-stream-activity-end.h */ |
| 228 | |
| 229 | extern bt_message *bt_message_stream_activity_end_create( |
| 230 | bt_self_message_iterator *message_iterator, |
| 231 | const bt_stream *stream); |
| 232 | |
| 233 | extern void bt_message_stream_activity_end_set_default_clock_snapshot_state( |
| 234 | bt_message *msg, |
| 235 | bt_message_stream_activity_clock_snapshot_state state); |
| 236 | |
| 237 | extern void bt_message_stream_activity_end_set_default_clock_snapshot( |
| 238 | bt_message *msg, uint64_t raw_value); |
| 239 | |
| 240 | extern bt_stream *bt_message_stream_activity_end_borrow_stream( |
| 241 | bt_message *message); |
| 242 | |
| 243 | /* From message-discarded-events-const.h */ |
| 244 | |
| 245 | extern const bt_clock_snapshot * |
| 246 | bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const( |
| 247 | const bt_message *msg); |
| 248 | |
| 249 | extern const bt_clock_snapshot * |
| 250 | bt_message_discarded_events_borrow_default_end_clock_snapshot_const( |
| 251 | const bt_message *msg); |
| 252 | |
| 253 | extern const bt_clock_class * |
| 254 | bt_message_discarded_events_borrow_stream_class_default_clock_class_const( |
| 255 | const bt_message *msg); |
| 256 | |
| 257 | extern const bt_stream * |
| 258 | bt_message_discarded_events_borrow_stream_const(const bt_message *message); |
| 259 | |
| 260 | extern bt_property_availability bt_message_discarded_events_get_count( |
| 261 | const bt_message *message, uint64_t *OUT); |
| 262 | |
| 263 | /* From message-discarded-events.h */ |
| 264 | |
| 265 | extern bt_message *bt_message_discarded_events_create( |
| 266 | bt_self_message_iterator *message_iterator, |
| 267 | const bt_stream *stream); |
| 268 | |
| 269 | extern bt_message *bt_message_discarded_events_create_with_default_clock_snapshots( |
| 270 | bt_self_message_iterator *message_iterator, |
| 271 | const bt_stream *stream, uint64_t beginning_raw_value, |
| 272 | uint64_t end_raw_value); |
| 273 | |
| 274 | extern bt_stream *bt_message_discarded_events_borrow_stream( |
| 275 | bt_message *message); |
| 276 | |
| 277 | extern void bt_message_discarded_events_set_count(bt_message *message, |
| 278 | uint64_t count); |
| 279 | |
| 280 | /* From message-discarded-packets-const.h */ |
| 281 | |
| 282 | extern const bt_clock_snapshot * |
| 283 | bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const( |
| 284 | const bt_message *msg); |
| 285 | |
| 286 | extern const bt_clock_snapshot * |
| 287 | bt_message_discarded_packets_borrow_default_end_clock_snapshot_const( |
| 288 | const bt_message *msg); |
| 289 | |
| 290 | extern const bt_clock_class * |
| 291 | bt_message_discarded_packets_borrow_stream_class_default_clock_class_const( |
| 292 | const bt_message *msg); |
| 293 | |
| 294 | extern const bt_stream * |
| 295 | bt_message_discarded_packets_borrow_stream_const(const bt_message *message); |
| 296 | |
| 297 | extern bt_property_availability bt_message_discarded_packets_get_count( |
| 298 | const bt_message *message, uint64_t *OUT); |
| 299 | |
| 300 | /* From message-discarded-packets.h */ |
| 301 | |
| 302 | extern bt_message *bt_message_discarded_packets_create( |
| 303 | bt_self_message_iterator *message_iterator, |
| 304 | const bt_stream *stream); |
| 305 | |
| 306 | extern bt_message *bt_message_discarded_packets_create_with_default_clock_snapshots( |
| 307 | bt_self_message_iterator *message_iterator, |
| 308 | const bt_stream *stream, uint64_t beginning_raw_value, |
| 309 | uint64_t end_raw_value); |
| 310 | |
| 311 | extern bt_stream *bt_message_discarded_packets_borrow_stream( |
| 312 | bt_message *message); |
| 313 | |
| 314 | extern void bt_message_discarded_packets_set_count(bt_message *message, |
| 315 | uint64_t count); |