/tags/rel-1-3-25/SWIG/Examples/python/funcptr2/example.i
# · Swig · 18 lines · 11 code · 4 blank · 3 comment · 0 complexity · 25c2842fa423b12775e66e304a441e7e MD5 · raw file
- /* 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 */
- %callback("%(upper)s");
- int add(int, int);
- int sub(int, int);
- int mul(int, int);
- %nocallback;
- extern int (*funcvar)(int,int);