5
# First create some objects using the pointer library.
6
print "Testing the pointer library";
7
a = example.ptrcreate("int",37);
8
b = example.ptrcreate("int",42);
9
c = example.ptrcreate("int");
15
# Call the add() function with some pointers
19
r = example.ptrvalue(c)
22
# Clean up the pointers
27
# Now try the typemap library
28
# This should be much easier. Now how it is no longer
29
# necessary to manufacture pointers.
31
print "Trying the typemap library";
32
r = example.sub(37,42)
35
# Now try the version with multiple return values
37
print "Testing multiple return values";
38
q,r = example.divide(42,37)
39
print " 42/37 = %d remainder %d" % (q,r)