PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/octave/funcptr/example.i

#
Swig | 16 lines | 9 code | 4 blank | 3 comment | 0 complexity | 53fa3de256346426072daa7f5e1e1d2a MD5 | raw file
 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