| 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 | #ifdef __cplusplus |
| 33 | extern "C" { |
| 34 | #endif |
| 35 | |
| 36 | typedef struct bt_clock_class bt_clock_class; |
| 37 | typedef struct bt_clock_snapshot bt_clock_snapshot; |
| 38 | typedef struct bt_component bt_component; |
| 39 | typedef struct bt_component_class bt_component_class; |
| 40 | typedef struct bt_component_class_filter bt_component_class_filter; |
| 41 | typedef struct bt_component_class_sink bt_component_class_sink; |
| 42 | typedef struct bt_component_class_source bt_component_class_source; |
| 43 | typedef struct bt_component_descriptor_set bt_component_descriptor_set; |
| 44 | typedef struct bt_component_filter bt_component_filter; |
| 45 | typedef struct bt_component_sink bt_component_sink; |
| 46 | typedef struct bt_component_source bt_component_source; |
| 47 | typedef struct bt_connection bt_connection; |
| 48 | typedef struct bt_error bt_error; |
| 49 | typedef struct bt_error_cause bt_error_cause; |
| 50 | typedef struct bt_event bt_event; |
| 51 | typedef struct bt_event_class bt_event_class; |
| 52 | typedef struct bt_event_header_field bt_event_header_field; |
| 53 | typedef struct bt_field bt_field; |
| 54 | typedef struct bt_field_class bt_field_class; |
| 55 | typedef struct bt_field_class_enumeration_mapping bt_field_class_enumeration_mapping; |
| 56 | typedef struct bt_field_class_enumeration_signed_mapping bt_field_class_enumeration_signed_mapping; |
| 57 | typedef struct bt_field_class_enumeration_unsigned_mapping bt_field_class_enumeration_unsigned_mapping; |
| 58 | typedef struct bt_field_class_structure_member bt_field_class_structure_member; |
| 59 | typedef struct bt_field_class_variant_option bt_field_class_variant_option; |
| 60 | typedef struct bt_field_class_variant_with_selector_field_integer_signed_option bt_field_class_variant_with_selector_field_integer_signed_option; |
| 61 | typedef struct bt_field_class_variant_with_selector_field_integer_unsigned_option bt_field_class_variant_with_selector_field_integer_unsigned_option; |
| 62 | typedef struct bt_field_path bt_field_path; |
| 63 | typedef struct bt_field_path_item bt_field_path_item; |
| 64 | typedef struct bt_graph bt_graph; |
| 65 | typedef struct bt_integer_range_set bt_integer_range_set; |
| 66 | typedef struct bt_integer_range_set_signed bt_integer_range_set_signed; |
| 67 | typedef struct bt_integer_range_set_unsigned bt_integer_range_set_unsigned; |
| 68 | typedef struct bt_integer_range_signed bt_integer_range_signed; |
| 69 | typedef struct bt_integer_range_unsigned bt_integer_range_unsigned; |
| 70 | typedef struct bt_interrupter bt_interrupter; |
| 71 | typedef struct bt_message bt_message; |
| 72 | typedef struct bt_message_iterator bt_message_iterator; |
| 73 | typedef struct bt_message_iterator_class bt_message_iterator_class; |
| 74 | typedef struct bt_object bt_object; |
| 75 | typedef struct bt_packet bt_packet; |
| 76 | typedef struct bt_plugin bt_plugin; |
| 77 | typedef struct bt_plugin_set bt_plugin_set; |
| 78 | typedef struct bt_plugin_so_shared_lib_handle bt_plugin_so_shared_lib_handle; |
| 79 | typedef struct bt_port bt_port; |
| 80 | typedef struct bt_port_input bt_port_input; |
| 81 | typedef struct bt_port_output bt_port_output; |
| 82 | typedef struct bt_port_output_message_iterator bt_port_output_message_iterator; |
| 83 | typedef struct bt_private_query_executor bt_private_query_executor; |
| 84 | typedef struct bt_query_executor bt_query_executor; |
| 85 | typedef struct bt_self_component bt_self_component; |
| 86 | typedef struct bt_self_component_class bt_self_component_class; |
| 87 | typedef struct bt_self_component_class_filter bt_self_component_class_filter; |
| 88 | typedef struct bt_self_component_class_sink bt_self_component_class_sink; |
| 89 | typedef struct bt_self_component_class_source bt_self_component_class_source; |
| 90 | typedef struct bt_self_component_filter bt_self_component_filter; |
| 91 | typedef struct bt_self_component_filter_configuration bt_self_component_filter_configuration; |
| 92 | typedef struct bt_self_component_port bt_self_component_port; |
| 93 | typedef struct bt_self_component_port_input bt_self_component_port_input; |
| 94 | typedef struct bt_message_iterator bt_message_iterator; |
| 95 | typedef struct bt_self_component_port_output bt_self_component_port_output; |
| 96 | typedef struct bt_self_component_sink bt_self_component_sink; |
| 97 | typedef struct bt_self_component_sink_configuration bt_self_component_sink_configuration; |
| 98 | typedef struct bt_self_component_source bt_self_component_source; |
| 99 | typedef struct bt_self_component_source_configuration bt_self_component_source_configuration; |
| 100 | typedef struct bt_self_message_iterator bt_self_message_iterator; |
| 101 | typedef struct bt_self_message_iterator_configuration bt_self_message_iterator_configuration; |
| 102 | typedef struct bt_self_plugin bt_self_plugin; |
| 103 | typedef struct bt_stream bt_stream; |
| 104 | typedef struct bt_stream_class bt_stream_class; |
| 105 | typedef struct bt_trace bt_trace; |
| 106 | typedef struct bt_trace_class bt_trace_class; |
| 107 | typedef struct bt_value bt_value; |
| 108 | |
| 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 | |
| 134 | The 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> |
| 136 | reasons. |
| 137 | |
| 138 | Use #BT_TRUE and #BT_FALSE to set and compare #bt_bool variables. |
| 139 | */ |
| 140 | typedef int bt_bool; |
| 141 | |
| 142 | /*! |
| 143 | @brief |
| 144 | Numeric ID which identifies a user listener function. |
| 145 | |
| 146 | Some functions, such as bt_trace_add_destruction_listener(), return a |
| 147 | listener ID when you add a user listener function to some object. You |
| 148 | can then use this listener ID to remove the listener from the object. |
| 149 | */ |
| 150 | typedef 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 constant bytes. |
| 157 | */ |
| 158 | typedef uint8_t const *bt_uuid; |
| 159 | |
| 160 | /*! |
| 161 | @brief |
| 162 | Availability of an object's property. |
| 163 | |
| 164 | Some getter functions of the API, such as |
| 165 | bt_event_class_get_log_level(), return, by output parameter, an optional |
| 166 | object property which is not a pointer. In that case, the function |
| 167 | either: |
| 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 | */ |
| 173 | typedef 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 | |
| 191 | Such 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 |
| 194 | message iterator or by a \bt_sink_comp. |
| 195 | */ |
| 196 | typedef bt_message const **bt_message_array_const; |
| 197 | |
| 198 | /*! @} */ |
| 199 | |
| 200 | #ifdef __cplusplus |
| 201 | } |
| 202 | #endif |
| 203 | |
| 204 | #endif /* BABELTRACE2_TYPES_H */ |