X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace2%2Fbabeltrace.h;h=82c402adbd2956070eb65c075ce511e7abcdc597;hp=5e099a593b978e0e662ecf0e21a04284c0151422;hb=HEAD;hpb=9103e903a89377e9cfad13905d4f4b650aecd061 diff --git a/include/babeltrace2/babeltrace.h b/include/babeltrace2/babeltrace.h index 5e099a59..82f62514 100644 --- a/include/babeltrace2/babeltrace.h +++ b/include/babeltrace2/babeltrace.h @@ -1,28 +1,12 @@ -#ifndef BABELTRACE2_BABELTRACE_H -#define BABELTRACE2_BABELTRACE_H - /* - * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * SPDX-License-Identifier: MIT * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation */ +#ifndef BABELTRACE2_BABELTRACE_H +#define BABELTRACE2_BABELTRACE_H + /* * Tell the specific headers that they are included from this header. * @@ -44,121 +28,67 @@ # define __BT_UPCAST_CONST(_type, _p) ((const _type *) (_p)) #endif -/* Core API */ -#include -#include -#include -#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))) + +/* Internal: `noexcept` specifier if C++ ≥ 11 */ +#if defined(__cplusplus) && (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)) +# define __BT_NOEXCEPT noexcept +#else +# define __BT_NOEXCEPT +#endif + +#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 - -/* Trace IR API */ -#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 -#include - -/* Component API */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Message iterator API */ -#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 -#include -#include -#include -#include -#include - -/* Query executor API */ -#include -#include -#include - -/* Plugin API */ -#include -#include - -/* Plugin development */ -#include +#include +#include +#include +#include /* Cancel private definitions */ #undef __BT_FUNC_STATUS_AGAIN @@ -170,6 +100,7 @@ #undef __BT_FUNC_STATUS_NOT_FOUND #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 @@ -180,5 +111,6 @@ #undef __BT_LOGGING_LEVEL_ERROR #undef __BT_LOGGING_LEVEL_FATAL #undef __BT_LOGGING_LEVEL_NONE +#undef __BT_NOEXCEPT #endif /* BABELTRACE2_BABELTRACE_H */