bt2: Adapt test_message.py and make it pass
[babeltrace.git] / bindings / python / bt2 / bt2 / native_bt_message.i
index c4f1937f71099fdd04f5b3b857dd748bd825a872..2c3f850e06975f8ee4287a02a5525e259d6a8571 100644 (file)
  * THE SOFTWARE.
  */
 
  * 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 {
 /* From message-const.h */
 
 typedef enum bt_message_type {
This page took 0.023173 seconds and 4 git commands to generate.