Make API CTF-agnostic
[babeltrace.git] / include / babeltrace / ctf-ir / packet.h
1 #ifndef BABELTRACE_CTF_IR_PACKET_H
2 #define BABELTRACE_CTF_IR_PACKET_H
3
4 /*
5 * BabelTrace - CTF IR: Stream packet
6 *
7 * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * The Common Trace Format (CTF) Specification is available at
28 * http://www.efficios.com/ctf
29 */
30
31 #include <stdint.h>
32
33 /* For enum bt_property_availability */
34 #include <babeltrace/property.h>
35
36 /* For enum bt_clock_value_status */
37 #include <babeltrace/ctf-ir/clock-value.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 struct bt_packet;
44 struct bt_packet_header_field;
45 struct bt_packet_context_field;
46 struct bt_stream;
47 struct bt_clock_value;
48
49 extern struct bt_packet *bt_packet_create(struct bt_stream *stream);
50
51 extern struct bt_stream *bt_packet_borrow_stream(struct bt_packet *packet);
52
53 extern
54 struct bt_field *bt_packet_borrow_header_field(struct bt_packet *packet);
55
56 extern
57 int bt_packet_move_header_field(struct bt_packet *packet,
58 struct bt_packet_header_field *header);
59
60 extern
61 struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet);
62
63 extern
64 int bt_packet_move_context_field(struct bt_packet *packet,
65 struct bt_packet_context_field *context);
66
67 extern
68 enum bt_clock_value_status bt_packet_borrow_default_beginning_clock_value(
69 struct bt_packet *packet, struct bt_clock_value **clock_value);
70
71 extern
72 int bt_packet_set_default_beginning_clock_value(struct bt_packet *packet,
73 uint64_t value_cycles);
74
75 extern
76 enum bt_clock_value_status bt_packet_borrow_default_end_clock_valeu(
77 struct bt_packet *packet, struct bt_clock_value **clock_value);
78
79 extern
80 int bt_packet_set_default_end_clock_value(struct bt_packet *packet,
81 uint64_t value_cycles);
82
83 extern
84 enum bt_property_availability bt_packet_get_discarded_event_counter_snapshot(
85 struct bt_packet *packet, uint64_t *value);
86
87 extern
88 int bt_packet_set_discarded_event_counter_snapshot(struct bt_packet *packet,
89 uint64_t value);
90
91 extern
92 enum bt_property_availability bt_packet_get_packet_counter_snapshot(
93 struct bt_packet *packet, uint64_t *value);
94
95 extern
96 int bt_packet_set_packet_counter_snapshot(struct bt_packet *packet,
97 uint64_t value);
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif /* BABELTRACE_CTF_IR_PACKET_H */
This page took 0.0303 seconds and 4 git commands to generate.