Author: kkaempf Date: Wed Dec 3 16:21:14 2008 New Revision: 11853 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11853&view=rev Log: add Python typemap for XSolvable ** Modified: trunk/sat-solver/bindings/satsolver.i Modified: trunk/sat-solver/bindings/satsolver.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/satsolver.i?rev=11853&r1=11852&r2=11853&view=diff ============================================================================== --- trunk/sat-solver/bindings/satsolver.i (original) +++ trunk/sat-solver/bindings/satsolver.i Wed Dec 3 16:21:14 2008 @@ -301,6 +301,26 @@ } #endif +#if defined(SWIGPYTHON) +/* + * XSolvable array to Python + */ +%typemap(out) XSolvable ** { + int n, i; + + for (n = 0; $1[n];) + n++; + + $result = PyList_New(n); + + for (i = 0; i < n; i++) { + PyObject *item = SWIG_NewPointerObj(SWIG_as_voidptr($1[i]), SWIGTYPE_p__Solvable, 0); + PyList_SetItem($result, i, item); + } + free($1); +} +#endif + typedef int Id; typedef unsigned int Offset; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org