Hi All,

I am a newbie to Swig. I am trying to export a set of C APIs to Python. I came across this particular API:

int my_function(int a, FOO ***ptr);  //where ptr is an OUTPUT parameter

typedef struct {
    int a;
    ST b;
} FOO;

typedef struct {
   char *c;
} ST;

When wrote the below lines in the interface file, it thrown the following error.
%include "typemaps.i"
%apply FOO **OUTPUT(FOO ***ptr);
int my_function(int a, FOO ***ptr);

Can't apply (FOO ***OUTPUT). No typemaps are defined.

Do I need to write typemaps for FOO structure, similar to the way typemaps were written for default datatypes like int, char.. etc?
I tried to do so, but lost somewhere.

After putting lot of trail and errors, I am writing this mail.

Could you please help me out in writing the swig interface write up for the above function?

Thank you,
Rajesh

Awaiting you