X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace2%2Fbabeltrace.h;h=c94576a7810f825a2cfec808eba94a4f5dc1b191;hb=8b305066676fc7aa433e8eb668f9de8802008025;hp=739e76b3b3a1b4ae142a995a94646df3d5cff4e3;hpb=bbb7b5f044dc06e50eaa34ed3a880b34e1e7ebb8;p=babeltrace.git diff --git a/include/babeltrace2/babeltrace.h b/include/babeltrace2/babeltrace.h index 739e76b3..c94576a7 100644 --- a/include/babeltrace2/babeltrace.h +++ b/include/babeltrace2/babeltrace.h @@ -32,130 +32,93 @@ # define __BT_IN_BABELTRACE_H #endif -/* Need by some of the following included headers */ +/* Internal: needed by some of the following included headers */ #include -/* Core API */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/* Internal: needed by some of the following included headers */ +#ifdef __cplusplus +# define __BT_UPCAST(_type, _p) static_cast<_type *>(static_cast(_p)) +# define __BT_UPCAST_CONST(_type, _p) static_cast(static_cast(_p)) +#else +# define __BT_UPCAST(_type, _p) ((_type *) (_p)) +# define __BT_UPCAST_CONST(_type, _p) ((const _type *) (_p)) +#endif -/* Trace IR API */ -#include +/* + * Internal: attribute suitable to tag functions as having printf()-like + * arguments. + * + * We always define `__USE_MINGW_ANSI_STDIO` when building with MinGW, so use + * `gnu_printf` directly rather than `__MINGW_PRINTF_FORMAT` (which would require + * including `stdio.h`). + */ +#ifdef __MINGW32__ +# define __BT_PRINTF_FORMAT gnu_printf +#else +# define __BT_PRINTF_FORMAT printf +#endif + +#define __BT_ATTR_FORMAT_PRINTF(_string_index, _first_to_check) \ + __attribute__((format(__BT_PRINTF_FORMAT, _string_index, _first_to_check))) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include #include -#include #include -#include #include -#include -#include +#include #include -#include -#include #include -#include #include -#include #include -#include #include -#include #include - -/* Component class API */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Component API */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Message iterator API */ -#include -#include -#include -#include - -/* Message API */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Graph API */ -#include -#include -#include -#include -#include -#include - -/* Query executor API */ -#include -#include - -/* Plugin API */ -#include -#include - -/* Plugin development */ -#include +#include +#include +#include +#include /* Cancel private definitions */ -#undef __BT_FUNC_STATUS_OVERFLOW -#undef __BT_FUNC_STATUS_INVALID_PARAMS -#undef __BT_FUNC_STATUS_INVALID_OBJECT -#undef __BT_FUNC_STATUS_MEMORY_ERROR -#undef __BT_FUNC_STATUS_LOADING_ERROR -#undef __BT_FUNC_STATUS_ERROR -#undef __BT_FUNC_STATUS_OK +#undef __BT_FUNC_STATUS_AGAIN #undef __BT_FUNC_STATUS_END +#undef __BT_FUNC_STATUS_ERROR +#undef __BT_FUNC_STATUS_INTERRUPTED +#undef __BT_FUNC_STATUS_UNKNOWN_OBJECT +#undef __BT_FUNC_STATUS_MEMORY_ERROR #undef __BT_FUNC_STATUS_NOT_FOUND -#undef __BT_FUNC_STATUS_AGAIN -#undef __BT_FUNC_STATUS_UNSUPPORTED -#undef __BT_FUNC_STATUS_CANCELED +#undef __BT_FUNC_STATUS_OK +#undef __BT_FUNC_STATUS_OVERFLOW_ERROR +#undef __BT_FUNC_STATUS_USER_ERROR #undef __BT_IN_BABELTRACE_H +#undef __BT_UPCAST +#undef __BT_UPCAST_CONST +#undef __BT_LOGGING_LEVEL_TRACE +#undef __BT_LOGGING_LEVEL_DEBUG +#undef __BT_LOGGING_LEVEL_INFO +#undef __BT_LOGGING_LEVEL_WARNING +#undef __BT_LOGGING_LEVEL_ERROR +#undef __BT_LOGGING_LEVEL_FATAL +#undef __BT_LOGGING_LEVEL_NONE #endif /* BABELTRACE2_BABELTRACE_H */