X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=bindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt.i;h=59595a3117965a5bb432d39b2819d7236a8ef614;hb=c7eee084ca459af66ba1f6d375fba3f89db93584;hp=c7ae8d63359cc4e36bd5c1b218f81ba856e37e3b;hpb=e373846d806aacb2841f4dd399a28296e2b5c5fe;p=babeltrace.git diff --git a/bindings/python/bt2/bt2/native_bt.i b/bindings/python/bt2/bt2/native_bt.i index c7ae8d63..59595a31 100644 --- a/bindings/python/bt2/bt2/native_bt.i +++ b/bindings/python/bt2/bt2/native_bt.i @@ -126,6 +126,22 @@ typedef int bt_bool; } } +/* Output argument typemap for value output (always appends) */ +%typemap(in, numinputs=0) struct bt_value **BTOUTVALUE (struct bt_value *temp_value = NULL) { + $1 = &temp_value; +} + +%typemap(argout) struct bt_value **BTOUTVALUE { + if (*$1) { + /* SWIG_Python_AppendOutput() steals the created object */ + $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(SWIG_as_voidptr(*$1), SWIGTYPE_p_bt_value, 0)); + } else { + /* SWIG_Python_AppendOutput() steals Py_None */ + Py_INCREF(Py_None); + $result = SWIG_Python_AppendOutput($result, Py_None); + } +} + /* Output argument typemap for initialized uint64_t output parameter (always appends) */ %typemap(in, numinputs=0) uint64_t *OUTPUTINIT (uint64_t temp = -1ULL) { $1 = &temp; @@ -194,6 +210,7 @@ typedef int bt_bool; %include "native_btpacket.i" %include "native_btplugin.i" %include "native_btport.i" +%include "native_btqueryexec.i" %include "native_btref.i" %include "native_btstream.i" %include "native_btstreamclass.i"