2

I have a C written library and I use swig to get a python wrapper. All types are defined in test.h and function implemented in test.c. I used swig to define a test.i like:

%{
#include "test.h"
%}

%include "test.h"

Everything ran smoothly. However, I have some structure defined in .h like

typedef struct sth STH;
struct sth {
char *name;
STH *next;
}

So right now, the names in python has to be used as .name .next.name and go on like that. Is there any way I can change the C style link to a list in python?

Where is the best step I change them? in the .i file or I have to change test_wrapper.c file? Thanks

c0desniper
  • 61
  • 5
  • I think my 3rd example at: http://stackoverflow.com/a/8828454/168175 should cover this. – Flexo Apr 25 '17 at 08:13

0 Answers0