Move to kernel style SPDX license identifiers
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt.i
index 4f349f5c36e1e0b76c375e5978b8a7898af86a8a..6a79cfefc1c57df61a7706338f17feb11839d12b 100644 (file)
@@ -1,25 +1,7 @@
 /*
- * The MIT License (MIT)
+ * SPDX-License-Identifier: MIT
  *
  * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
- *
- * 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:
- *
- * 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.
  */
 
 #ifndef SWIGPYTHON
 
 #include "common/assert.h"
 #include "py-common/py-common.h"
+
+/* Used by some interface files */
+#include "native_bt_bt2_objects.h"
+#include "native_bt_log_and_append_error.h"
 %}
 
 typedef int bt_bool;
@@ -135,6 +121,16 @@ typedef uint64_t bt_listener_id;
                        SWIG_From_unsigned_SS_long_SS_long((uint64_t) (*$1)));
 }
 
+/* Output argument typemap for initialized bt_boot output parameter (always appends) */
+%typemap(in, numinputs=0) (bt_bool *) (bt_bool temp) {
+       $1 = &temp;
+}
+
+%typemap(argout) bt_bool * {
+       $result = SWIG_Python_AppendOutput(resultobj,
+                       SWIG_From_bool(*$1));
+}
+
 /* Input argument typemap for UUID bytes */
 %typemap(in) bt_uuid {
        $1 = (unsigned char *) PyBytes_AsString($input);
@@ -182,6 +178,10 @@ typedef uint64_t bt_listener_id;
        $result = $1;
 }
 
+/* Native part initialization and finalization */
+void bt_bt2_init_from_bt2(void);
+void bt_bt2_exit_handler(void);
+
 /*
  * Define `__BT_IN_BABELTRACE_H` to allow specific headers to be
  * included. This remains defined as long as we don't include the main
@@ -189,13 +189,20 @@ typedef uint64_t bt_listener_id;
  */
 #define __BT_IN_BABELTRACE_H
 
-/* Property enumeration */
-%include <babeltrace2/property.h>
+/*
+ * Define `__BT_ATTR_FORMAT_PRINTF` to nothing, otherwise SWIG fails to parse
+ * the included header files that use it.
+ */
+#define __BT_ATTR_FORMAT_PRINTF(_string_index, _first_to_check)
+
+/* Common types */
+%include <babeltrace2/types.h>
 
 /* Common function status codes */
 %include <babeltrace2/func-status.h>
 
 /* Per-module interface files */
+%include "native_bt_autodisc.i"
 %include "native_bt_clock_class.i"
 %include "native_bt_clock_snapshot.i"
 %include "native_bt_component.i"
@@ -213,6 +220,7 @@ typedef uint64_t bt_listener_id;
 %include "native_bt_logging.i"
 %include "native_bt_message.i"
 %include "native_bt_message_iterator.i"
+%include "native_bt_mip.i"
 %include "native_bt_packet.i"
 %include "native_bt_plugin.i"
 %include "native_bt_port.i"
@@ -223,3 +231,13 @@ typedef uint64_t bt_listener_id;
 %include "native_bt_trace_class.i"
 %include "native_bt_value.i"
 %include "native_bt_version.i"
+
+%{
+
+/*
+ * This function is defined by SWIG.  Declare here to avoid a
+ * -Wmissing-prototypes warning.
+ */
+PyObject *SWIG_init(void);
+
+%}
This page took 0.024105 seconds and 4 git commands to generate.