I have a fairly simple C routine I would like to access via Python, using SWIG:
int routine(char *instring, char *outstring);
The input string is just passed in, and that seems to work. The outstring return is a pointer to a fixed array within the C routine, and my problem is how to pass a python parameter to it using the python interface.
When I use python, I get:
>>retstring = "foo"
>>retval = routine("Hello world", retstring)
This (obviously) doesn't work because the value is lost when the scope returns to the prompt level. But the routine doesn't fail. The problem is, any OTHER parameter I pass in fails because it is not considered a char *.
Other than not returning the string, the routine seems to be working.
I'm not sure what to do. Do I have to modify with typemaps to produce a second return? Is there an example somewhere that shows this?