X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt.i;h=919fc1dc8988bd9683605704bd4cd84eb0db7fd4;hb=f3847c753f1b4f12353c38d97b0577d9993d19fb;hp=bde8d806343b8d37656308a8fe2a3124f3aaf6a6;hpb=e4b56bb9b7a459b227c4bb124638b0cc8b95718c;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/native_bt.i b/src/bindings/python/bt2/bt2/native_bt.i index bde8d806..919fc1dc 100644 --- a/src/bindings/python/bt2/bt2/native_bt.i +++ b/src/bindings/python/bt2/bt2/native_bt.i @@ -32,14 +32,30 @@ #define BT_LOG_TAG "BT2-PY" #include "logging.h" +/* + * Include before `` because + * `` removes the `__BT_IN_BABELTRACE_H` + * definition. + */ #include -#include + +/* + * 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 + #include "common/assert.h" +#include "py-common/py-common.h" -typedef const uint8_t *bt_uuid; +/* Used by some interface files */ +#include "native_bt_bt2_objects.h" +#include "native_bt_log_and_append_error.h" %} typedef int bt_bool; +typedef uint64_t bt_listener_id; /* For uint*_t/int*_t */ %include "stdint.i" @@ -122,13 +138,15 @@ typedef int bt_bool; $result = SWIG_Python_AppendOutput(resultobj, SWIG_From_unsigned_SS_long_SS_long((uint64_t) (*$1))); } -/* Output argument typemap for initialized double output parameter (always appends) */ -%typemap(in, numinputs=0) (double *OUT) (double temp) { + +/* Output argument typemap for initialized bt_boot output parameter (always appends) */ +%typemap(in, numinputs=0) (bt_bool *) (bt_bool temp) { $1 = &temp; } -%typemap(argout) (double *OUT) { - $result = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*$1))); +%typemap(argout) bt_bool * { + $result = SWIG_Python_AppendOutput(resultobj, + SWIG_From_bool(*$1)); } /* Input argument typemap for UUID bytes */ @@ -159,7 +177,6 @@ typedef int bt_bool; $result = Py_False; } Py_INCREF($result); - return $result; } /* @@ -179,23 +196,43 @@ typedef int bt_bool; $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 + * header, ``. + */ +#define __BT_IN_BABELTRACE_H + +/* Property enumeration */ %include +/* Common function status codes */ +%include + /* 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" %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" %include "native_bt_field_class.i" %include "native_bt_field_path.i" %include "native_bt_graph.i" +%include "native_bt_integer_range_set.i" +%include "native_bt_interrupter.i" %include "native_bt_logging.i" %include "native_bt_message.i" -%include "native_bt_notifier.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" @@ -206,3 +243,13 @@ typedef int bt_bool; %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); + +%}