Skip to content Skip to sidebar Skip to footer

Is It Necessary To Mention All Functions Of The Wrapped .c File In The Interface File Using Swig?

I try to wrap several .c files to make the accessible via Python. If I want to access all functions of all files do I have to mention all the functions in the interface file?

Solution 1:

Yes. But there is a shortcut: SWIG can parse header (.h) files. So most of the time, you can get away with this interface file:

 %module example
 %{
 /* Includes the header in the wrapper code */#include"header.h"
 %}

 /* Parse the header file to generate wrappers */
 %include "header.h"

For more information, search for "SWIG for the truly lazy" at http://www.swig.org/tutorial.html

Post a Comment for "Is It Necessary To Mention All Functions Of The Wrapped .c File In The Interface File Using Swig?"