X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=bindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_message.i;fp=bindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_message.i;h=2c3f850e06975f8ee4287a02a5525e259d6a8571;hp=c4f1937f71099fdd04f5b3b857dd748bd825a872;hb=9ec609eca33472c516129ba3b1257fbfc1978e77;hpb=1eccc498917f855490876fc8b3e41f90f89f1c6d diff --git a/bindings/python/bt2/bt2/native_bt_message.i b/bindings/python/bt2/bt2/native_bt_message.i index c4f1937f..2c3f850e 100644 --- a/bindings/python/bt2/bt2/native_bt_message.i +++ b/bindings/python/bt2/bt2/native_bt_message.i @@ -22,6 +22,28 @@ * THE SOFTWARE. */ + +/* Output argument typemap for clock value output (always appends) */ +%typemap(in, numinputs=0) + (const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT) + (bt_clock_snapshot *temp_clock_snapshot = NULL) { + $1 = &temp_clock_snapshot; +} + +%typemap(argout) + (const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT) { + if (*$1) { + /* SWIG_Python_AppendOutput() steals the created object */ + $result = SWIG_Python_AppendOutput($result, + SWIG_NewPointerObj(SWIG_as_voidptr(*$1), + SWIGTYPE_p_bt_clock_snapshot, 0)); + } else { + /* SWIG_Python_AppendOutput() steals Py_None */ + Py_INCREF(Py_None); + $result = SWIG_Python_AppendOutput($result, Py_None); + } +} + /* From message-const.h */ typedef enum bt_message_type {