SWIG help, very new

andres at corrada.com andres at corrada.com
Wed May 23 23:06:24 EDT 2001


Hi Enrico,

Have you tried adding the following lines to stack.i?:

%{
#include "stack.c"
%}

%include "stack.c"

I'm new to SWIG myself and I'm wrapping a C library so I use .h files but
this might work.

On Wed, May 23, 2001 at 03:33:54PM -0500, Enrico Ng wrote:
> Hi, I'm very new to SWIG.
> I wrote a small stack program in C
> and want to use swig to make a python module with it.
> but it isnt working for me.
> Most likely because I'm not really sure what should go in the interface
> file.
> 
> --
> Enrico Ng <enrico at fnal.gov>
> 
>.
>.
>.
> 
> -------------------------------------------------------------------------
> stack.i
> --------------------------------------------------------------------
> %module stack
> 
> typedef struct stk{int data; struct stk *next; struct stk *prev;}STACK;
> STACK *stack;
> 

------------------------------------------------------
Andres Corrada-Emmanuel   Email: andres at corrada.com
Internet Programming      http://www.mamey.com
------------------------------------------------------




More information about the Python-list mailing list