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

« back to all changes in this revision

Viewing changes to Examples/perl5/funcptr/example.pl

  • 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.pl
 
2
 
 
3
use example;
 
4
 
 
5
$a = 37;
 
6
$b = 42;
 
7
 
 
8
# Now call our C function with a bunch of callbacks
 
9
 
 
10
print "Trying some C callback functions\n";
 
11
print "    a        = $a\n";
 
12
print "    b        = $b\n";
 
13
print "    ADD(a,b) = ", example::do_op($a,$b,$example::ADD),"\n";
 
14
print "    SUB(a,b) = ", example::do_op($a,$b,$example::SUB),"\n";
 
15
print "    MUL(a,b) = ", example::do_op($a,$b,$example::MUL),"\n";
 
16
 
 
17
print "Here is what the C callback function objects look like in Perl\n";
 
18
print "    ADD      = $example::ADD\n";
 
19
print "    SUB      = $example::SUB\n";
 
20
print "    MUL      = $example::MUL\n";
 
21