SWIG – anatomy of a wrapper function
This bit of documentation was in Swig 1.1 but never made it into later versions. I find it extremely helpful. Hopefully, the maintainers would re-include these in future documentation.
Wrapping C or C++ code for consumption by scripting languages takes several phases. The next few diagrams show the anatomy of a wrapper function and how typemaps get applied.
Typemaps are executed in the following order:
- %typemap(default)
- %typemap(arginit)
- %typemap(ignore) – deprecated, use numinputs=0
- %typemap(in[,numinputs=0])
- %typemap(check)
- %typemap(out)
- %typemap(argout)
- %typemap(freearg)
- %typemap(ret)
About this entry
You’re currently reading “ SWIG – anatomy of a wrapper function ,” an entry on Chui's Counterpoint
- Published:
- 8.22.12 / 11pm
- Category:
- General


Comments are closed
Comments are currently closed on this entry.