5 # First create some objects using the pointer library.
6 print "Testing the pointer library\n"
7 a = Example::new_intp()
8 b = Example::new_intp()
9 c = Example::new_intp()
11 Example::intp_assign(a,37)
12 Example::intp_assign(b,42)
18 # Call the add() function with some pointers
22 r = Example::intp_value(c)
23 print " 37 + 42 = #{r}\n"
25 # Clean up the pointers
26 Example::delete_intp(a)
27 Example::delete_intp(b)
28 Example::delete_intp(c)
30 # Now try the typemap library
31 # This should be much easier. Now how it is no longer
32 # necessary to manufacture pointers.
34 print "Trying the typemap library\n"
35 r = Example::sub(37, 42)
36 print " 37 - 42 = #{r}\n"
38 # Now try the version with multiple return values
40 print "Testing multiple return values\n"
41 q, r = Example::divide(42, 37)
42 print " 42/37 = #{q} remainder #{r}\n"