Q:

Wrap several C-Sources (.c files) to use their functions in Python using SWIG

There are a lot of Tutorials about how to wrap single functions of one .c file. But I want to wrap all functions of several .c files. This is why I included them all in the interface file (interface.i)
/*interface.i*/
%module interface
%include source1.c
%include source2.c
%include source3.c

I am now wondering if I have to include all header files which appear in the .c files. And also if I have to consider the header files which are addressed in the header files.

A:

Usually your C program should have an interface it exposes. For example the source1/2/3.c together with their internal headers source1/2/3.h compile to a foo.dll. Then the interface foo_function.h exposes functions that can be called from outside.
To wrap the external functions you need only the foo_functions.h in your interface.i. You don't need the source1/2/3.h.
The C code may have another foo_constants.h or so, belonging to the interface, with the structs you need and constant definitions that are quite handy. You should add that too.
Additionally you may need some includes from SWIG itself. To generate for example pointer and array handling. Something like:
%include cpointer.i
%pointer_functions(int, intp)
%include carrays.i
%array_functions(unsigned int, uintarray)
Good luck!

