<P>Hi, Everyone,</P>
<P>I am a newbie to both Swig and Python. I am trying to export a set of C APIs to Python. </P>
<P>My C function is </P>
<P>int getInfor( char* name, int height, int weight, Infor** infor) //where infor is an OUTPUT parameter</P>
<P>{</P>
<P>......</P>
<P>*infor = (Infor*)malloc(sizeof(Infor));</P>
<P>......</P>
<P>}</P>
<P> </P>
<P>The declare of structure Infor is :</P>
<P> typedef struct {<BR> char  name[20];<BR> int   height;<BR> int   weight;<BR>} Infor</P>
<P> </P>
<P>When wrote the below lines in the interface file named Extest.i</P>
<P>%module Extest<BR>%{<BR>#include "Extest.h"<BR>%}</P>
<P>%typemap(out) Infor **OUTPUT {Infor **c}<BR>%apply int *OUTPUT {int *c}<BR>%include "Extest.h"</P>
<P> </P>
<P>And then, How to write testing python file to call the function named getInfor()?</P>
<P>such as in test.py</P>
<P> </P>
<P>infor = Extest.Infor()</P>
<P>res = Extest.getInfor("Test Name", 175, 80, infor)</P>
<P> </P>
<P>when run upper's test.py, Error occured. The message is </P>
<P>TypeError: in method 'getInfor', argument 4 of type 'Infor **'</P>
<P> </P>
<P>How to write the test.py to transfer the  'Infor **' type's parameter?</P>
<P>After putting lot of trail and errors, I am writing this mail.</P>
<P>Could you please help me to write the test.py or swig interface file for the above function?</P>
<P>Thank you,<BR>jemmy</P>
<P>Awaiting you</P>