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

« back to all changes in this revision

Viewing changes to Examples/octave/funcptr/example.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-06-20 18:33:37 UTC
  • mfrom: (1.2.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080620183337-hockvwcewu29409c
Tags: 1.3.35-4ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop support for pike.
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - Force a few environment variables.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* File : example.c */
 
2
 
 
3
int do_op(int a, int b, int (*op)(int,int)) {
 
4
  return (*op)(a,b);
 
5
}
 
6
 
 
7
int add(int a, int b) {
 
8
  return a+b;
 
9
}
 
10
 
 
11
int sub(int a, int b) {
 
12
  return a-b;
 
13
}
 
14
 
 
15
int mul(int a, int b) {
 
16
  return a*b;
 
17
}
 
18
 
 
19
int (*funcvar)(int,int) = add;