~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/ruby/funcptr/example.i

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2002-03-29 01:56:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020329015607-c0wt03xu8oy9ioj7
Tags: upstream-1.3.11
ImportĀ upstreamĀ versionĀ 1.3.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* File : example.i */
 
2
%module example
 
3
%{
 
4
#include "example.h"
 
5
%}
 
6
 
 
7
/* Wrap a function taking a pointer to a function */
 
8
extern 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
 
 
15