From: Dzhelil R. <dz...@gm...> - 2008-09-11 21:07:28
|
Hello, The Swig tutorial at http://www.swig.org/Doc1.3/Typemaps.html#Typemaps_nn16 mentions that one can define an input typemap for consecutive function arguments like this: %typemap(in) (char *str, int len) { $1 = PyString_AsString($input); /* char *str */ $2 = PyString_Size($input); /* int len */ } ... int count(char *str, int len, char c); And this can be called from python as > count(string, c) I want to do the same thing for an out typemap for a C struct of the form: struct _foo { char *array; int len; char c; } Foo; so that from python one can reference the array and characeter as: > count.array, count.c Thanks! |