/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/ruby/funcptr/example.i
# · Swig · 15 lines · 8 code · 4 blank · 3 comment · 0 complexity · c588f39d9ea6bdedd0d408f877d42561 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 */
- %constant int (*ADD)(int,int) = add;
- %constant int (*SUB)(int,int) = sub;
- %constant int (*MUL)(int,int) = mul;