/trunk/Examples/go/funcptr/example.i
Swig | 16 lines | 9 code | 4 blank | 3 comment | 0 complexity | 53fa3de256346426072daa7f5e1e1d2a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- /* File : example.i */
- %module example
- %{
- #include "example.h"
- %}
- /* Wrap a function taking a pointer to a function */
- extern int do_op(int a, int b, int (*op)(int, int));
- /* Now install a bunch of "ops" as constants */
- %constant int (*ADD)(int,int) = add;
- %constant int (*SUB)(int,int) = sub;
- %constant int (*MUL)(int,int) = mul;
- extern int (*funcvar)(int,int);