lib: standardize public header copyright notice
[babeltrace.git] / include / babeltrace2 / types.h
1 #ifndef BABELTRACE2_TYPES_H
2 #define BABELTRACE2_TYPES_H
3
4 /*
5 * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
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
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
28 #endif
29
30 #include <stdint.h>
31
32 /* Internal use */
33 #ifdef __cplusplus
34 # define __BT_UPCAST(_type, _p) static_cast<_type *>(static_cast<void *>(_p))
35 # define __BT_UPCAST_CONST(_type, _p) static_cast<const _type *>(static_cast<const void *>(_p))
36 #else
37 # define __BT_UPCAST(_type, _p) ((_type *) (_p))
38 # define __BT_UPCAST_CONST(_type, _p) ((const _type *) (_p))
39 #endif
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 /**
46 @defgroup ctypes Babeltrace C types
47 @ingroup apiref
48 @brief Babeltrace C types.
49
50 @code
51 #include <babeltrace2/types.h>
52 @endcode
53
54 This header contains custom type definitions used across the library.
55
56 @file
57 @brief Babeltrace C types.
58 @sa ctypes
59
60 @addtogroup ctypes
61 @{
62 */
63
64 /// False boolean value for the #bt_bool type.
65 #define BT_FALSE 0
66
67 /// True boolean value for the #bt_bool type.
68 #define BT_TRUE 1
69
70 /**
71 @brief Babeltrace's boolean type.
72
73 Use only the #BT_FALSE and #BT_TRUE definitions for #bt_bool parameters.
74 It is guaranteed that the library functions which return a #bt_bool
75 value return either #BT_FALSE or #BT_TRUE.
76
77 You can always test the truthness of a #bt_bool value directly, without
78 comparing it to #BT_TRUE directly:
79
80 @code
81 bt_bool ret = bt_some_function(...);
82
83 if (ret) {
84 // ret is true
85 }
86 @endcode
87 */
88 typedef int bt_bool;
89
90 typedef const uint8_t *bt_uuid;
91
92 typedef struct bt_clock_class bt_clock_class;
93 typedef struct bt_clock_snapshot bt_clock_snapshot;
94 typedef struct bt_component bt_component;
95 typedef struct bt_component_class bt_component_class;
96 typedef struct bt_component_class_filter bt_component_class_filter;
97 typedef struct bt_component_class_sink bt_component_class_sink;
98 typedef struct bt_component_class_source bt_component_class_source;
99 typedef struct bt_component_filter bt_component_filter;
100 typedef struct bt_component_sink bt_component_sink;
101 typedef struct bt_component_source bt_component_source;
102 typedef struct bt_connection bt_connection;
103 typedef struct bt_event bt_event;
104 typedef struct bt_event_class bt_event_class;
105 typedef struct bt_event_header_field bt_event_header_field;
106 typedef struct bt_error bt_error;
107 typedef struct bt_error_cause bt_error_cause;
108 typedef struct bt_field bt_field;
109 typedef struct bt_field_class bt_field_class;
110 typedef struct bt_field_class_enumeration_mapping bt_field_class_enumeration_mapping;
111 typedef struct bt_field_class_signed_enumeration_mapping bt_field_class_signed_enumeration_mapping;
112 typedef struct bt_field_class_unsigned_enumeration_mapping bt_field_class_unsigned_enumeration_mapping;
113 typedef struct bt_field_class_structure_member bt_field_class_structure_member;
114 typedef struct bt_field_class_variant_option bt_field_class_variant_option;
115 typedef struct bt_field_path bt_field_path;
116 typedef struct bt_field_path_item bt_field_path_item;
117 typedef struct bt_graph bt_graph;
118 typedef struct bt_message bt_message;
119 typedef struct bt_message_iterator bt_message_iterator;
120 typedef struct bt_object bt_object;
121 typedef struct bt_packet bt_packet;
122 typedef struct bt_packet_context_field bt_packet_context_field;
123 typedef struct bt_packet_header_field bt_packet_header_field;
124 typedef struct bt_plugin bt_plugin;
125 typedef struct bt_plugin_set bt_plugin_set;
126 typedef struct bt_plugin_so_shared_lib_handle bt_plugin_so_shared_lib_handle;
127 typedef struct bt_port bt_port;
128 typedef struct bt_port_input bt_port_input;
129 typedef struct bt_port_output bt_port_output;
130 typedef struct bt_port_output_message_iterator bt_port_output_message_iterator;
131 typedef struct bt_query_executor bt_query_executor;
132 typedef struct bt_self_component bt_self_component;
133 typedef struct bt_self_component_class bt_self_component_class;
134 typedef struct bt_self_component_class_filter bt_self_component_class_filter;
135 typedef struct bt_self_component_class_sink bt_self_component_class_sink;
136 typedef struct bt_self_component_class_source bt_self_component_class_source;
137 typedef struct bt_self_component_filter bt_self_component_filter;
138 typedef struct bt_self_component_port bt_self_component_port;
139 typedef struct bt_self_component_port_input bt_self_component_port_input;
140 typedef struct bt_self_component_port_input_message_iterator bt_self_component_port_input_message_iterator;
141 typedef struct bt_self_component_port_output bt_self_component_port_output;
142 typedef struct bt_self_component_sink bt_self_component_sink;
143 typedef struct bt_self_component_source bt_self_component_source;
144 typedef struct bt_self_message_iterator bt_self_message_iterator;
145 typedef struct bt_self_plugin bt_self_plugin;
146 typedef struct bt_self_port bt_self_port;
147 typedef struct bt_self_port_input bt_self_port_input;
148 typedef struct bt_self_port_output bt_self_port_output;
149 typedef struct bt_stream bt_stream;
150 typedef struct bt_stream_class bt_stream_class;
151 typedef struct bt_trace bt_trace;
152 typedef struct bt_trace_class bt_trace_class;
153 typedef struct bt_value bt_value;
154
155 typedef const char * const *bt_field_class_enumeration_mapping_label_array;
156 typedef const struct bt_message **bt_message_array_const;
157
158 /** @} */
159
160 #ifdef __cplusplus
161 }
162 #endif
163
164 #endif /* BABELTRACE2_TYPES_H */
This page took 0.033462 seconds and 5 git commands to generate.