X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace2%2Ftypes.h;h=521c603d522690abe035d73d46f437c6aa03333a;hb=43c59509042845f8d42c3e99ec74d45fa2dc0908;hp=5b49f50cbb9f700d79f46328028f2e77a8c593f1;hpb=b70d57a123c4e4a208b988539a7eb8fceb2b63a7;p=babeltrace.git diff --git a/include/babeltrace2/types.h b/include/babeltrace2/types.h index 5b49f50c..521c603d 100644 --- a/include/babeltrace2/types.h +++ b/include/babeltrace2/types.h @@ -33,53 +33,6 @@ extern "C" { #endif -/** -@defgroup ctypes Babeltrace C types -@ingroup apiref -@brief Babeltrace C types. - -@code -#include -@endcode - -This header contains custom type definitions used across the library. - -@file -@brief Babeltrace C types. -@sa ctypes - -@addtogroup ctypes -@{ -*/ - -/// False boolean value for the #bt_bool type. -#define BT_FALSE 0 - -/// True boolean value for the #bt_bool type. -#define BT_TRUE 1 - -/** -@brief Babeltrace's boolean type. - -Use only the #BT_FALSE and #BT_TRUE definitions for #bt_bool parameters. -It is guaranteed that the library functions which return a #bt_bool -value return either #BT_FALSE or #BT_TRUE. - -You can always test the truthness of a #bt_bool value directly, without -comparing it to #BT_TRUE directly: - -@code -bt_bool ret = bt_some_function(...); - -if (ret) { - // ret is true -} -@endcode -*/ -typedef int bt_bool; - -typedef const uint8_t *bt_uuid; - typedef struct bt_clock_class bt_clock_class; typedef struct bt_clock_snapshot bt_clock_snapshot; typedef struct bt_component bt_component; @@ -87,6 +40,7 @@ typedef struct bt_component_class bt_component_class; typedef struct bt_component_class_filter bt_component_class_filter; typedef struct bt_component_class_sink bt_component_class_sink; typedef struct bt_component_class_source bt_component_class_source; +typedef struct bt_component_descriptor_set bt_component_descriptor_set; typedef struct bt_component_filter bt_component_filter; typedef struct bt_component_sink bt_component_sink; typedef struct bt_component_source bt_component_source; @@ -103,8 +57,8 @@ typedef struct bt_field_class_enumeration_signed_mapping bt_field_class_enumerat typedef struct bt_field_class_enumeration_unsigned_mapping bt_field_class_enumeration_unsigned_mapping; typedef struct bt_field_class_structure_member bt_field_class_structure_member; typedef struct bt_field_class_variant_option bt_field_class_variant_option; -typedef struct bt_field_class_variant_with_selector_signed_option bt_field_class_variant_with_selector_signed_option; -typedef struct bt_field_class_variant_with_selector_unsigned_option bt_field_class_variant_with_selector_unsigned_option; +typedef struct bt_field_class_variant_with_selector_field_integer_signed_option bt_field_class_variant_with_selector_field_integer_signed_option; +typedef struct bt_field_class_variant_with_selector_field_integer_unsigned_option bt_field_class_variant_with_selector_field_integer_unsigned_option; typedef struct bt_field_path bt_field_path; typedef struct bt_field_path_item bt_field_path_item; typedef struct bt_graph bt_graph; @@ -116,10 +70,9 @@ typedef struct bt_integer_range_unsigned bt_integer_range_unsigned; typedef struct bt_interrupter bt_interrupter; typedef struct bt_message bt_message; typedef struct bt_message_iterator bt_message_iterator; +typedef struct bt_message_iterator_class bt_message_iterator_class; typedef struct bt_object bt_object; typedef struct bt_packet bt_packet; -typedef struct bt_packet_context_field bt_packet_context_field; -typedef struct bt_packet_header_field bt_packet_header_field; typedef struct bt_plugin bt_plugin; typedef struct bt_plugin_set bt_plugin_set; typedef struct bt_plugin_so_shared_lib_handle bt_plugin_so_shared_lib_handle; @@ -127,6 +80,7 @@ typedef struct bt_port bt_port; typedef struct bt_port_input bt_port_input; typedef struct bt_port_output bt_port_output; typedef struct bt_port_output_message_iterator bt_port_output_message_iterator; +typedef struct bt_private_query_executor bt_private_query_executor; typedef struct bt_query_executor bt_query_executor; typedef struct bt_self_component bt_self_component; typedef struct bt_self_component_class bt_self_component_class; @@ -134,27 +88,114 @@ typedef struct bt_self_component_class_filter bt_self_component_class_filter; typedef struct bt_self_component_class_sink bt_self_component_class_sink; typedef struct bt_self_component_class_source bt_self_component_class_source; typedef struct bt_self_component_filter bt_self_component_filter; +typedef struct bt_self_component_filter_configuration bt_self_component_filter_configuration; typedef struct bt_self_component_port bt_self_component_port; typedef struct bt_self_component_port_input bt_self_component_port_input; -typedef struct bt_self_component_port_input_message_iterator bt_self_component_port_input_message_iterator; +typedef struct bt_message_iterator bt_message_iterator; typedef struct bt_self_component_port_output bt_self_component_port_output; typedef struct bt_self_component_sink bt_self_component_sink; +typedef struct bt_self_component_sink_configuration bt_self_component_sink_configuration; typedef struct bt_self_component_source bt_self_component_source; +typedef struct bt_self_component_source_configuration bt_self_component_source_configuration; typedef struct bt_self_message_iterator bt_self_message_iterator; +typedef struct bt_self_message_iterator_configuration bt_self_message_iterator_configuration; typedef struct bt_self_plugin bt_self_plugin; -typedef struct bt_self_port bt_self_port; -typedef struct bt_self_port_input bt_self_port_input; -typedef struct bt_self_port_output bt_self_port_output; typedef struct bt_stream bt_stream; typedef struct bt_stream_class bt_stream_class; typedef struct bt_trace bt_trace; typedef struct bt_trace_class bt_trace_class; typedef struct bt_value bt_value; -typedef const char * const *bt_field_class_enumeration_mapping_label_array; -typedef const struct bt_message **bt_message_array_const; +/*! +@defgroup api-common-types Common C types + +@brief + C types common to many parts of the API. +*/ + +/*! @{ */ + +/*! +@brief + \em True value for #bt_bool. +*/ +#define BT_TRUE 1 + +/*! +@brief + \em False value for #bt_bool. +*/ +#define BT_FALSE 0 + +/*! +@brief + \bt_name boolean type. + +The API uses #bt_bool instead of the C99 \c bool type for +application binary interface +reasons. + +Use #BT_TRUE and #BT_FALSE to set and compare #bt_bool variables. +*/ +typedef int bt_bool; + +/*! +@brief + Numeric ID which identifies a user listener function. + +Some functions, such as bt_trace_add_destruction_listener(), return a +listener ID when you add a user listener function to some object. You +can then use this listener ID to remove the listener from the object. +*/ +typedef uint64_t bt_listener_id; + +/*! +@brief + A + UUID, + that is, an array of 16 constant bytes. +*/ +typedef uint8_t const *bt_uuid; + +/*! +@brief + Availability of an object's property. + +Some getter functions of the API, such as +bt_event_class_get_log_level(), return, by output parameter, an optional +object property which is not a pointer. In that case, the function +either: + +- Returns #BT_PROPERTY_AVAILABILITY_AVAILABLE and sets an output + parameter to the property's value. +- Returns #BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE. +*/ +typedef enum bt_property_availability { + /*! + @brief + Property is available. + */ + BT_PROPERTY_AVAILABILITY_AVAILABLE = 1, + + /*! + @brief + Property is not available. + */ + BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE = 0, +} bt_property_availability; + +/*! +@brief + Array of constant \bt_p_msg. + +Such an array is filled by the +\link api-msg-iter-cls-meth-next "next" method\endlink of a +\bt_msg_iter and consumed with bt_message_iterator_next() by another +message iterator or by a \bt_sink_comp. +*/ +typedef bt_message const **bt_message_array_const; -/** @} */ +/*! @} */ #ifdef __cplusplus }