The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6fcc22a1f8
commit
516036631c
1508 changed files with 125983 additions and 44037 deletions
10
SWIG/Examples/perl5/pointer/.cvsignore
Normal file
10
SWIG/Examples/perl5/pointer/.cvsignore
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
example.pm
|
||||
*_wrap.c
|
||||
*_wrap.cxx
|
||||
example.dll
|
||||
example.dsw
|
||||
example.ncb
|
||||
example.opt
|
||||
example.plg
|
||||
Release
|
||||
Debug
|
||||
|
|
@ -13,6 +13,6 @@ static::
|
|||
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
|
||||
|
||||
clean::
|
||||
rm -f *_wrap* *.o core *~ *.so *.pm myperl
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_clean
|
||||
|
||||
check: all
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
/* First we'll use the pointer library */
|
||||
extern void add(int *x, int *y, int *result);
|
||||
%include pointer.i
|
||||
%include cpointer.i
|
||||
%pointer_functions(int, intp);
|
||||
|
||||
/* Next we'll use some typemaps */
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ use example;
|
|||
|
||||
# First create some objects using the pointer library.
|
||||
print "Testing the pointer library\n";
|
||||
$a = example::ptrcreate("int",37);
|
||||
$b = example::ptrcreate("int",42);
|
||||
$c = example::ptrcreate("int");
|
||||
$a = example::new_intp();
|
||||
$b = example::new_intp();
|
||||
$c = example::new_intp();
|
||||
example::intp_assign($a,37);
|
||||
example::intp_assign($b,42);
|
||||
|
||||
print " a = $a\n";
|
||||
print " b = $b\n";
|
||||
|
|
@ -16,13 +18,13 @@ print " c = $c\n";
|
|||
example::add($a,$b,$c);
|
||||
|
||||
# Now get the result
|
||||
$r = example::ptrvalue($c);
|
||||
$r = example::intp_value($c);
|
||||
print " 37 + 42 = $r\n";
|
||||
|
||||
# Clean up the pointers
|
||||
example::ptrfree($a);
|
||||
example::ptrfree($b);
|
||||
example::ptrfree($c);
|
||||
example::delete_intp($a);
|
||||
example::delete_intp($b);
|
||||
example::delete_intp($c);
|
||||
|
||||
# Now try the typemap library
|
||||
# This should be much easier. Now how it is no longer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue