[GRASS-user] Question with Python-SWIG example
Hamish
hamish_b at yahoo.com
Sun Apr 18 10:50:35 EDT 2010
Glynn wrote:
> It might also be possible to use the SWIG wrappers
> for the structure types, but I can't figure out how to
> convert between a bare pointer and the SWIG wrapper.
>
> Nor can I figure out how to make use of any pointers
> returned from functions. Typemaps exist to allow strings,
> arrays, etc to be converted to pointers when passing them
> into functions, but it isn't possible to do the reverse
> (converting to a pointer discards the size and type;
> converting from a pointer would require some way
> to obtain this information). The functions generated by
> cpointer.i and carrays.i don't seem to work as expected
> (I get a segfault).
this may be a completely useless suggestion because I only half-
understand the issues, but better to say something than not- if it
helps at all, remember the trunk/swig/python/NumPtr/ library, as
demonstrated by trunk/swig/python/examples/m.distance.py.
regards,
Hamish
More information about the grass-user
mailing list