X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace2%2Fbabeltrace.h;h=82c402adbd2956070eb65c075ce511e7abcdc597;hp=45509a8a1087c0251ea69fb0a7097520d8cbde28;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hpb=3fadfbc0c91f82c46bd36e6e0657ea93570c9db1
diff --git a/include/babeltrace2/babeltrace.h b/include/babeltrace2/babeltrace.h
index 45509a8a..82c402ad 100644
--- a/include/babeltrace2/babeltrace.h
+++ b/include/babeltrace2/babeltrace.h
@@ -1,156 +1,108 @@
-#ifndef BABELTRACE_BABELTRACE_H
-#define BABELTRACE_BABELTRACE_H
-
/*
- * Babeltrace API
- *
- * Copyright 2010-2018 EfficiOS Inc.
- *
- * 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.
+ * 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.
*
- * 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.
+ * Do NOT define `__BT_IN_BABELTRACE_H` in user code.
*/
+#ifndef __BT_IN_BABELTRACE_H
+# define __BT_IN_BABELTRACE_H
+#endif
-/* Core API */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+/* Internal: needed by some of the following included headers */
+#include
-/* Legacy API (for CTF writer) */
-#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
-/* CTF writer API */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#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
-/* Legacy API (for CTF writer) */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#define __BT_ATTR_FORMAT_PRINTF(_string_index, _first_to_check) \
+ __attribute__((format(__BT_PRINTF_FORMAT, _string_index, _first_to_check)))
-/* 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
-#include
#include
-#include
#include
-#include
-#include
+#include
#include
-#include
-#include
#include
-#include
#include
-#include
#include
-#include
#include
-#include
#include
+#include
+#include
+#include
+#include
-/* Plugin and plugin development API */
-#include
-#include
-#include
-
-/* Graph, component, and message 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
-#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
+/* Cancel private definitions */
+#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_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 /* BABELTRACE_BABELTRACE_H */
+#endif /* BABELTRACE2_BABELTRACE_H */