Document libbabeltrace2's C API
[babeltrace.git] / include / babeltrace2 / types.h
CommitLineData
924dc299
PP
1#ifndef BABELTRACE2_TYPES_H
2#define BABELTRACE2_TYPES_H
c55a9f58
PP
3
4/*
bbb7b5f0 5 * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
c55a9f58
PP
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25
4fa90f32
PP
26#ifndef __BT_IN_BABELTRACE_H
27# error "Please include <babeltrace2/babeltrace.h> instead."
28#endif
29
44c440bc
PP
30#include <stdint.h>
31
c55a9f58
PP
32#ifdef __cplusplus
33extern "C" {
34#endif
35
b19ff26f 36typedef struct bt_clock_class bt_clock_class;
605e1019 37typedef struct bt_clock_snapshot bt_clock_snapshot;
b19ff26f
PP
38typedef struct bt_component bt_component;
39typedef struct bt_component_class bt_component_class;
40typedef struct bt_component_class_filter bt_component_class_filter;
41typedef struct bt_component_class_sink bt_component_class_sink;
42typedef struct bt_component_class_source bt_component_class_source;
55f09f52 43typedef struct bt_component_descriptor_set bt_component_descriptor_set;
b19ff26f 44typedef struct bt_component_filter bt_component_filter;
b19ff26f
PP
45typedef struct bt_component_sink bt_component_sink;
46typedef struct bt_component_source bt_component_source;
47typedef struct bt_connection bt_connection;
45c51519
PP
48typedef struct bt_error bt_error;
49typedef struct bt_error_cause bt_error_cause;
b19ff26f
PP
50typedef struct bt_event bt_event;
51typedef struct bt_event_class bt_event_class;
52typedef struct bt_event_header_field bt_event_header_field;
53typedef struct bt_field bt_field;
54typedef struct bt_field_class bt_field_class;
8f3ccfbc 55typedef struct bt_field_class_enumeration_mapping bt_field_class_enumeration_mapping;
9c08c816 56typedef struct bt_field_class_enumeration_signed_mapping bt_field_class_enumeration_signed_mapping;
9c08c816 57typedef struct bt_field_class_enumeration_unsigned_mapping bt_field_class_enumeration_unsigned_mapping;
b70d57a1 58typedef struct bt_field_class_structure_member bt_field_class_structure_member;
1e6fd1d7 59typedef struct bt_field_class_variant_option bt_field_class_variant_option;
de821fe5
PP
60typedef struct bt_field_class_variant_with_selector_field_integer_signed_option bt_field_class_variant_with_selector_field_integer_signed_option;
61typedef struct bt_field_class_variant_with_selector_field_integer_unsigned_option bt_field_class_variant_with_selector_field_integer_unsigned_option;
b19ff26f 62typedef struct bt_field_path bt_field_path;
66ddcddf 63typedef struct bt_field_path_item bt_field_path_item;
b19ff26f 64typedef struct bt_graph bt_graph;
fb91c0ef
PP
65typedef struct bt_integer_range_set bt_integer_range_set;
66typedef struct bt_integer_range_set_signed bt_integer_range_set_signed;
67typedef struct bt_integer_range_set_unsigned bt_integer_range_set_unsigned;
68typedef struct bt_integer_range_signed bt_integer_range_signed;
69typedef struct bt_integer_range_unsigned bt_integer_range_unsigned;
b70d57a1 70typedef struct bt_interrupter bt_interrupter;
d6e69534
PP
71typedef struct bt_message bt_message;
72typedef struct bt_message_iterator bt_message_iterator;
a3f0c7db 73typedef struct bt_message_iterator_class bt_message_iterator_class;
b19ff26f
PP
74typedef struct bt_object bt_object;
75typedef struct bt_packet bt_packet;
b19ff26f
PP
76typedef struct bt_plugin bt_plugin;
77typedef struct bt_plugin_set bt_plugin_set;
78typedef struct bt_plugin_so_shared_lib_handle bt_plugin_so_shared_lib_handle;
79typedef struct bt_port bt_port;
80typedef struct bt_port_input bt_port_input;
81typedef struct bt_port_output bt_port_output;
d6e69534 82typedef struct bt_port_output_message_iterator bt_port_output_message_iterator;
3c729b9a 83typedef struct bt_private_query_executor bt_private_query_executor;
b19ff26f
PP
84typedef struct bt_query_executor bt_query_executor;
85typedef struct bt_self_component bt_self_component;
553c4bab 86typedef struct bt_self_component_class bt_self_component_class;
b19ff26f
PP
87typedef struct bt_self_component_class_filter bt_self_component_class_filter;
88typedef struct bt_self_component_class_sink bt_self_component_class_sink;
89typedef struct bt_self_component_class_source bt_self_component_class_source;
90typedef struct bt_self_component_filter bt_self_component_filter;
59225a3e 91typedef struct bt_self_component_filter_configuration bt_self_component_filter_configuration;
b19ff26f
PP
92typedef struct bt_self_component_port bt_self_component_port;
93typedef struct bt_self_component_port_input bt_self_component_port_input;
9a2c8b8e 94typedef struct bt_message_iterator bt_message_iterator;
b19ff26f
PP
95typedef struct bt_self_component_port_output bt_self_component_port_output;
96typedef struct bt_self_component_sink bt_self_component_sink;
59225a3e 97typedef struct bt_self_component_sink_configuration bt_self_component_sink_configuration;
b19ff26f 98typedef struct bt_self_component_source bt_self_component_source;
59225a3e 99typedef struct bt_self_component_source_configuration bt_self_component_source_configuration;
d6e69534 100typedef struct bt_self_message_iterator bt_self_message_iterator;
8d8b141d 101typedef struct bt_self_message_iterator_configuration bt_self_message_iterator_configuration;
d24d5663 102typedef struct bt_self_plugin bt_self_plugin;
b19ff26f
PP
103typedef struct bt_stream bt_stream;
104typedef struct bt_stream_class bt_stream_class;
105typedef struct bt_trace bt_trace;
106typedef struct bt_trace_class bt_trace_class;
107typedef struct bt_value bt_value;
108
43c59509
PP
109/*!
110@defgroup api-common-types Common C types
111
112@brief
113 C types common to many parts of the API.
114*/
115
116/*! @{ */
117
118/*!
119@brief
120 \em True value for #bt_bool.
121*/
122#define BT_TRUE 1
123
124/*!
125@brief
126 \em False value for #bt_bool.
127*/
128#define BT_FALSE 0
129
130/*!
131@brief
132 \bt_name boolean type.
133
134The API uses #bt_bool instead of the C99 \c bool type for
135<a href="https://en.wikipedia.org/wiki/Application_binary_interface">application binary interface</a>
136reasons.
137
138Use #BT_TRUE and #BT_FALSE to set and compare #bt_bool variables.
139*/
140typedef int bt_bool;
141
142/*!
143@brief
144 Numeric ID which identifies a user listener function.
145
146Some functions, such as bt_trace_add_destruction_listener(), return a
147listener ID when you add a user listener function to some object. You
148can then use this listener ID to remove the listener from the object.
149*/
150typedef uint64_t bt_listener_id;
151
152/*!
153@brief
154 A
155 <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier">UUID</a>,
156 that is, an array of 16&nbsp;constant bytes.
157*/
158typedef uint8_t const *bt_uuid;
159
160/*!
161@brief
162 Availability of an object's property.
163
164Some getter functions of the API, such as
165bt_event_class_get_log_level(), return, by output parameter, an optional
166object property which is not a pointer. In that case, the function
167either:
168
169- Returns #BT_PROPERTY_AVAILABILITY_AVAILABLE and sets an output
170 parameter to the property's value.
171- Returns #BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE.
172*/
173typedef enum bt_property_availability {
174 /*!
175 @brief
176 Property is available.
177 */
178 BT_PROPERTY_AVAILABILITY_AVAILABLE = 1,
179
180 /*!
181 @brief
182 Property is not available.
183 */
184 BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE = 0,
185} bt_property_availability;
186
187/*!
188@brief
189 Array of constant \bt_p_msg.
190
191Such an array is filled by the
192\link api-msg-iter-cls-meth-next "next" method\endlink of a
193\bt_msg_iter and consumed with bt_message_iterator_next() by another
194message iterator or by a \bt_sink_comp.
195*/
196typedef bt_message const **bt_message_array_const;
b19ff26f 197
43c59509 198/*! @} */
c55a9f58
PP
199
200#ifdef __cplusplus
201}
202#endif
203
924dc299 204#endif /* BABELTRACE2_TYPES_H */
This page took 0.061951 seconds and 4 git commands to generate.