bt2: make bt2.Error wrap current thread's error
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt.i
index 293189d619c3c0ff34daba2c096a4b1163cff55f..d27e4279ade8103799e043c0d29af120c4070242 100644 (file)
 #define BT_LOG_TAG "BT2-PY"
 #include "logging.h"
 
+/*
+ * Include before `<babeltrace2/func-status.h>` because
+ * `<babeltrace2/babeltrace.h>` removes the `__BT_IN_BABELTRACE_H`
+ * definition.
+ */
 #include <babeltrace2/babeltrace.h>
-#include <babeltrace2/property.h>
+
+/*
+ * This is not part of the API, but because those bindings reside within
+ * the project, we take the liberty to use them.
+ */
+#define __BT_IN_BABELTRACE_H
+#include <babeltrace2/func-status.h>
+
 #include "common/assert.h"
 #include "py-common/py-common.h"
 
@@ -152,7 +164,6 @@ typedef int bt_bool;
                $result = Py_False;
        }
        Py_INCREF($result);
-       return $result;
 }
 
 /*
@@ -172,14 +183,26 @@ typedef int bt_bool;
        $result = $1;
 }
 
+/*
+ * Define `__BT_IN_BABELTRACE_H` to allow specific headers to be
+ * included. This remains defined as long as we don't include the main
+ * header, `<babeltrace2/babeltrace.h>`.
+ */
+#define __BT_IN_BABELTRACE_H
+
+/* Property enumeration */
 %include <babeltrace2/property.h>
 
+/* Common function status codes */
+%include <babeltrace2/func-status.h>
+
 /* Per-module interface files */
 %include "native_bt_clock_class.i"
 %include "native_bt_clock_snapshot.i"
 %include "native_bt_component.i"
 %include "native_bt_component_class.i"
 %include "native_bt_connection.i"
+%include "native_bt_error.i"
 %include "native_bt_event.i"
 %include "native_bt_event_class.i"
 %include "native_bt_field.i"
@@ -193,6 +216,7 @@ typedef int bt_bool;
 %include "native_bt_plugin.i"
 %include "native_bt_port.i"
 %include "native_bt_query_exec.i"
+%include "native_bt_integer_range_set.i"
 %include "native_bt_stream.i"
 %include "native_bt_stream_class.i"
 %include "native_bt_trace.i"
This page took 0.025158 seconds and 4 git commands to generate.