| 1 | /* |
| 2 | * SPDX-License-Identifier: MIT |
| 3 | * |
| 4 | * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation |
| 5 | */ |
| 6 | |
| 7 | #ifndef BABELTRACE2_TYPES_H |
| 8 | #define BABELTRACE2_TYPES_H |
| 9 | |
| 10 | /* IWYU pragma: private, include <babeltrace2/babeltrace.h> */ |
| 11 | |
| 12 | #ifndef __BT_IN_BABELTRACE_H |
| 13 | # error "Please include <babeltrace2/babeltrace.h> instead." |
| 14 | #endif |
| 15 | |
| 16 | #include <stdint.h> |
| 17 | |
| 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
| 22 | typedef struct bt_clock_class bt_clock_class; |
| 23 | typedef struct bt_clock_snapshot bt_clock_snapshot; |
| 24 | typedef struct bt_component bt_component; |
| 25 | typedef struct bt_component_class bt_component_class; |
| 26 | typedef struct bt_component_class_filter bt_component_class_filter; |
| 27 | typedef struct bt_component_class_sink bt_component_class_sink; |
| 28 | typedef struct bt_component_class_source bt_component_class_source; |
| 29 | typedef struct bt_component_descriptor_set bt_component_descriptor_set; |
| 30 | typedef struct bt_component_filter bt_component_filter; |
| 31 | typedef struct bt_component_sink bt_component_sink; |
| 32 | typedef struct bt_component_source bt_component_source; |
| 33 | typedef struct bt_connection bt_connection; |
| 34 | typedef struct bt_error bt_error; |
| 35 | typedef struct bt_error_cause bt_error_cause; |
| 36 | typedef struct bt_event bt_event; |
| 37 | typedef struct bt_event_class bt_event_class; |
| 38 | typedef struct bt_event_header_field bt_event_header_field; |
| 39 | typedef struct bt_field bt_field; |
| 40 | typedef struct bt_field_class bt_field_class; |
| 41 | typedef struct bt_field_class_enumeration_mapping bt_field_class_enumeration_mapping; |
| 42 | typedef struct bt_field_class_enumeration_signed_mapping bt_field_class_enumeration_signed_mapping; |
| 43 | typedef struct bt_field_class_enumeration_unsigned_mapping bt_field_class_enumeration_unsigned_mapping; |
| 44 | typedef struct bt_field_class_structure_member bt_field_class_structure_member; |
| 45 | typedef struct bt_field_class_variant_option bt_field_class_variant_option; |
| 46 | typedef struct bt_field_class_variant_with_selector_field_integer_signed_option bt_field_class_variant_with_selector_field_integer_signed_option; |
| 47 | typedef struct bt_field_class_variant_with_selector_field_integer_unsigned_option bt_field_class_variant_with_selector_field_integer_unsigned_option; |
| 48 | typedef struct bt_field_path bt_field_path; |
| 49 | typedef struct bt_field_path_item bt_field_path_item; |
| 50 | typedef struct bt_graph bt_graph; |
| 51 | typedef struct bt_integer_range_set bt_integer_range_set; |
| 52 | typedef struct bt_integer_range_set_signed bt_integer_range_set_signed; |
| 53 | typedef struct bt_integer_range_set_unsigned bt_integer_range_set_unsigned; |
| 54 | typedef struct bt_integer_range_signed bt_integer_range_signed; |
| 55 | typedef struct bt_integer_range_unsigned bt_integer_range_unsigned; |
| 56 | typedef struct bt_interrupter bt_interrupter; |
| 57 | typedef struct bt_message bt_message; |
| 58 | typedef struct bt_message_iterator bt_message_iterator; |
| 59 | typedef struct bt_message_iterator_class bt_message_iterator_class; |
| 60 | typedef struct bt_object bt_object; |
| 61 | typedef struct bt_packet bt_packet; |
| 62 | typedef struct bt_plugin bt_plugin; |
| 63 | typedef struct bt_plugin_set bt_plugin_set; |
| 64 | typedef struct bt_plugin_so_shared_lib_handle bt_plugin_so_shared_lib_handle; |
| 65 | typedef struct bt_port bt_port; |
| 66 | typedef struct bt_port_input bt_port_input; |
| 67 | typedef struct bt_port_output bt_port_output; |
| 68 | typedef struct bt_port_output_message_iterator bt_port_output_message_iterator; |
| 69 | typedef struct bt_private_query_executor bt_private_query_executor; |
| 70 | typedef struct bt_query_executor bt_query_executor; |
| 71 | typedef struct bt_self_component bt_self_component; |
| 72 | typedef struct bt_self_component_class bt_self_component_class; |
| 73 | typedef struct bt_self_component_class_filter bt_self_component_class_filter; |
| 74 | typedef struct bt_self_component_class_sink bt_self_component_class_sink; |
| 75 | typedef struct bt_self_component_class_source bt_self_component_class_source; |
| 76 | typedef struct bt_self_component_filter bt_self_component_filter; |
| 77 | typedef struct bt_self_component_filter_configuration bt_self_component_filter_configuration; |
| 78 | typedef struct bt_self_component_port bt_self_component_port; |
| 79 | typedef struct bt_self_component_port_input bt_self_component_port_input; |
| 80 | typedef struct bt_message_iterator bt_message_iterator; |
| 81 | typedef struct bt_self_component_port_output bt_self_component_port_output; |
| 82 | typedef struct bt_self_component_sink bt_self_component_sink; |
| 83 | typedef struct bt_self_component_sink_configuration bt_self_component_sink_configuration; |
| 84 | typedef struct bt_self_component_source bt_self_component_source; |
| 85 | typedef struct bt_self_component_source_configuration bt_self_component_source_configuration; |
| 86 | typedef struct bt_self_message_iterator bt_self_message_iterator; |
| 87 | typedef struct bt_self_message_iterator_configuration bt_self_message_iterator_configuration; |
| 88 | typedef struct bt_self_plugin bt_self_plugin; |
| 89 | typedef struct bt_stream bt_stream; |
| 90 | typedef struct bt_stream_class bt_stream_class; |
| 91 | typedef struct bt_trace bt_trace; |
| 92 | typedef struct bt_trace_class bt_trace_class; |
| 93 | typedef struct bt_value bt_value; |
| 94 | |
| 95 | /*! |
| 96 | @defgroup api-common-types Common C types |
| 97 | |
| 98 | @brief |
| 99 | C types common to many parts of the API. |
| 100 | */ |
| 101 | |
| 102 | /*! @{ */ |
| 103 | |
| 104 | /*! |
| 105 | @brief |
| 106 | \em True value for #bt_bool. |
| 107 | */ |
| 108 | #define BT_TRUE 1 |
| 109 | |
| 110 | /*! |
| 111 | @brief |
| 112 | \em False value for #bt_bool. |
| 113 | */ |
| 114 | #define BT_FALSE 0 |
| 115 | |
| 116 | /*! |
| 117 | @brief |
| 118 | \bt_name boolean type. |
| 119 | |
| 120 | The API uses #bt_bool instead of the C99 \c bool type for |
| 121 | <a href="https://en.wikipedia.org/wiki/Application_binary_interface">application binary interface</a> |
| 122 | reasons. |
| 123 | |
| 124 | Use #BT_TRUE and #BT_FALSE to set and compare #bt_bool variables. |
| 125 | */ |
| 126 | typedef int bt_bool; |
| 127 | |
| 128 | /*! |
| 129 | @brief |
| 130 | Numeric ID which identifies a user listener function. |
| 131 | |
| 132 | Some functions, such as bt_trace_add_destruction_listener(), return a |
| 133 | listener ID when you add a user listener function to some object. You |
| 134 | can then use this listener ID to remove the listener from the object. |
| 135 | */ |
| 136 | typedef uint64_t bt_listener_id; |
| 137 | |
| 138 | /*! |
| 139 | @brief |
| 140 | A |
| 141 | <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier">UUID</a>, |
| 142 | that is, an array of 16 constant bytes. |
| 143 | */ |
| 144 | typedef uint8_t const *bt_uuid; |
| 145 | |
| 146 | /*! |
| 147 | @brief |
| 148 | Availability of an object's property. |
| 149 | |
| 150 | Some getter functions of the API, such as |
| 151 | bt_event_class_get_log_level(), return, by output parameter, an optional |
| 152 | object property which is not a pointer. In that case, the function |
| 153 | either: |
| 154 | |
| 155 | - Returns #BT_PROPERTY_AVAILABILITY_AVAILABLE and sets an output |
| 156 | parameter to the property's value. |
| 157 | - Returns #BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE. |
| 158 | */ |
| 159 | typedef enum bt_property_availability { |
| 160 | /*! |
| 161 | @brief |
| 162 | Property is available. |
| 163 | */ |
| 164 | BT_PROPERTY_AVAILABILITY_AVAILABLE = 1, |
| 165 | |
| 166 | /*! |
| 167 | @brief |
| 168 | Property is not available. |
| 169 | */ |
| 170 | BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE = 0, |
| 171 | } bt_property_availability; |
| 172 | |
| 173 | /*! |
| 174 | @brief |
| 175 | Array of constant \bt_p_msg. |
| 176 | |
| 177 | Such an array is filled by the |
| 178 | \link api-msg-iter-cls-meth-next "next" method\endlink of a |
| 179 | \bt_msg_iter and consumed with bt_message_iterator_next() by another |
| 180 | message iterator or by a \bt_sink_comp. |
| 181 | */ |
| 182 | typedef bt_message const **bt_message_array_const; |
| 183 | |
| 184 | /*! @} */ |
| 185 | |
| 186 | #ifdef __cplusplus |
| 187 | } |
| 188 | #endif |
| 189 | |
| 190 | #endif /* BABELTRACE2_TYPES_H */ |