/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

  1. /* File : example.i */
  2. %module example
  3. %{
  4. #include "example.h"
  5. %}
  6. /* Wrap a function taking a pointer to a function */
  7. extern int do_op(int a, int b, int (*op)(int, int));
  8. /* Now install a bunch of "ops" as constants */
  9. %callback("%(upper)s");
  10. int add(int, int);
  11. int sub(int, int);
  12. int mul(int, int);
  13. %nocallback;
  14. extern int (*funcvar)(int,int);