PageRenderTime 20ms CodeModel.GetById 18ms app.highlight 0ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1/* File : example.i */
 2%module example
 3%{
 4#include "example.h"
 5%}
 6
 7/* Wrap a function taking a pointer to a function */
 8extern int  do_op(int a, int b, int (*op)(int, int));
 9
10/* Now install a bunch of "ops" as constants */
11%callback("%(upper)s");
12int add(int, int);
13int sub(int, int);
14int mul(int, int);
15%nocallback;
16
17extern int (*funcvar)(int,int);
18