PageRenderTime 23ms CodeModel.GetById 15ms app.highlight 7ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/python/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
 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%constant int (*ADD)(int,int) = add;
12%constant int (*SUB)(int,int) = sub;
13%constant int (*MUL)(int,int) = mul;
14
15extern int (*funcvar)(int,int);
16