summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ANNOUNCE2
-rw-r--r--CHANGES189
-rw-r--r--CHANGES.current136
-rw-r--r--COPYRIGHT4
-rw-r--r--Doc/Devel/index.html1
-rw-r--r--Doc/Devel/internals.html164
-rw-r--r--Doc/Devel/tree.html35
-rw-r--r--Doc/Manual/CSharp.html31
-rw-r--r--Doc/Manual/Contents.html106
-rw-r--r--Doc/Manual/D.html444
-rw-r--r--Doc/Manual/Extending.html120
-rw-r--r--Doc/Manual/Go.html30
-rw-r--r--Doc/Manual/Guile.html44
-rw-r--r--Doc/Manual/Introduction.html12
-rw-r--r--Doc/Manual/Java.html263
-rw-r--r--Doc/Manual/Library.html69
-rw-r--r--Doc/Manual/Lisp.html22
-rw-r--r--Doc/Manual/Lua.html74
-rw-r--r--Doc/Manual/Makefile13
-rw-r--r--Doc/Manual/Modula3.html53
-rw-r--r--Doc/Manual/Modules.html3
-rw-r--r--Doc/Manual/Mzscheme.html122
-rw-r--r--Doc/Manual/Ocaml.html64
-rw-r--r--Doc/Manual/Octave.html51
-rw-r--r--Doc/Manual/Perl5.html94
-rw-r--r--Doc/Manual/Php.html48
-rw-r--r--Doc/Manual/Pike.html24
-rw-r--r--Doc/Manual/Python.html150
-rw-r--r--Doc/Manual/R.html16
-rw-r--r--Doc/Manual/Ruby.html445
-rw-r--r--Doc/Manual/SWIG.html308
-rw-r--r--Doc/Manual/SWIGPlus.html17
-rw-r--r--Doc/Manual/Sections.html11
-rw-r--r--Doc/Manual/Tcl.html92
-rw-r--r--Doc/Manual/Typemaps.html16
-rw-r--r--Doc/Manual/Warnings.html5
-rw-r--r--Doc/Manual/chapters4
-rw-r--r--Doc/Manual/linkchecker.config5
-rw-r--r--Doc/Manual/makechap.py2
-rw-r--r--Doc/Manual/maketoc.py4
-rw-r--r--Examples/Makefile.in112
-rw-r--r--Examples/d/callback/Makefile30
-rw-r--r--Examples/d/callback/d1/runme.d36
-rw-r--r--Examples/d/callback/d2/runme.d36
-rw-r--r--Examples/d/callback/example.cxx4
-rw-r--r--Examples/d/callback/example.h24
-rw-r--r--Examples/d/callback/example.i13
-rw-r--r--Examples/d/check.list9
-rw-r--r--Examples/d/class/Makefile30
-rw-r--r--Examples/d/class/d1/runme.d58
-rw-r--r--Examples/d/class/d2/runme.d58
-rw-r--r--Examples/d/class/example.cxx28
-rw-r--r--Examples/d/class/example.h34
-rw-r--r--Examples/d/class/example.i10
-rw-r--r--Examples/d/constants/Makefile30
-rw-r--r--Examples/d/constants/d1/runme.d28
-rw-r--r--Examples/d/constants/d2/runme.d28
-rw-r--r--Examples/d/constants/example.d23
-rw-r--r--Examples/d/constants/example.i32
-rw-r--r--Examples/d/enum/Makefile30
-rw-r--r--Examples/d/enum/d1/runme.d28
-rw-r--r--Examples/d/enum/d2/runme.d28
-rw-r--r--Examples/d/enum/example.cxx37
-rw-r--r--Examples/d/enum/example.h13
-rw-r--r--Examples/d/enum/example.i11
-rw-r--r--Examples/d/extend/Makefile30
-rw-r--r--Examples/d/extend/d1/runme.d75
-rw-r--r--Examples/d/extend/d2/runme.d75
-rw-r--r--Examples/d/extend/example.cxx4
-rw-r--r--Examples/d/extend/example.h56
-rw-r--r--Examples/d/extend/example.i14
-rw-r--r--Examples/d/funcptr/Makefile30
-rw-r--r--Examples/d/funcptr/d1/runme.d42
-rw-r--r--Examples/d/funcptr/d2/runme.d34
-rw-r--r--Examples/d/funcptr/example.c19
-rw-r--r--Examples/d/funcptr/example.h9
-rw-r--r--Examples/d/funcptr/example.i16
-rw-r--r--Examples/d/simple/Makefile30
-rw-r--r--Examples/d/simple/d1/runme.d27
-rw-r--r--Examples/d/simple/d2/runme.d27
-rw-r--r--Examples/d/simple/example.c18
-rw-r--r--Examples/d/simple/example.i7
-rw-r--r--Examples/d/variables/Makefile30
-rw-r--r--Examples/d/variables/d1/runme.d71
-rw-r--r--Examples/d/variables/d2/runme.d71
-rw-r--r--Examples/d/variables/example.c91
-rw-r--r--Examples/d/variables/example.h6
-rw-r--r--Examples/d/variables/example.i49
-rw-r--r--Examples/go/callback/example.go188
-rw-r--r--Examples/go/class/example.go284
-rw-r--r--Examples/go/constants/example.go44
-rw-r--r--Examples/go/enum/example.go93
-rw-r--r--Examples/go/extend/example.go397
-rw-r--r--Examples/go/funcptr/example.go54
-rw-r--r--Examples/go/multimap/example.go55
-rw-r--r--Examples/go/pointer/example.go68
-rw-r--r--Examples/go/reference/example.go126
-rw-r--r--Examples/go/simple/example.go48
-rw-r--r--Examples/go/template/example.go150
-rw-r--r--Examples/go/variables/example.go198
-rw-r--r--Examples/ocaml/argout_ref/example.i4
-rw-r--r--Examples/ocaml/shapes/example.c2
-rw-r--r--Examples/ocaml/shapes/example.h3
-rw-r--r--Examples/ocaml/std_string/README6
-rw-r--r--Examples/ocaml/strings_test/example.h18
-rw-r--r--Examples/php/cpointer/runme.php26
-rw-r--r--Examples/php/overloading/runme.php7
-rw-r--r--Examples/test-suite/abstract_virtual.i6
-rw-r--r--Examples/test-suite/char_binary.i29
-rw-r--r--Examples/test-suite/common.mk17
-rw-r--r--Examples/test-suite/constant_pointers.i5
-rw-r--r--Examples/test-suite/contract.i7
-rw-r--r--Examples/test-suite/csharp/Makefile.in7
-rw-r--r--Examples/test-suite/csharp/csharp_prepost_runme.cs37
-rw-r--r--Examples/test-suite/csharp/director_alternating_runme.cs11
-rw-r--r--Examples/test-suite/csharp/director_protected_runme.cs28
-rw-r--r--Examples/test-suite/csharp/pointer_reference_runme.cs3
-rw-r--r--Examples/test-suite/csharp/rename_pcre_encoder_runme.cs12
-rw-r--r--Examples/test-suite/csharp/rename_pcre_enum_runme.cs24
-rw-r--r--Examples/test-suite/csharp/rename_simple_runme.cs30
-rw-r--r--Examples/test-suite/csharp_attributes.i2
-rw-r--r--Examples/test-suite/csharp_prepost.i5
-rw-r--r--Examples/test-suite/d/Makefile.in81
-rw-r--r--Examples/test-suite/d/README7
-rw-r--r--Examples/test-suite/d/aggregate_runme.1.d25
-rw-r--r--Examples/test-suite/d/aggregate_runme.2.d25
-rw-r--r--Examples/test-suite/d/allprotected_runme.1.d65
-rw-r--r--Examples/test-suite/d/allprotected_runme.2.d65
-rw-r--r--Examples/test-suite/d/apply_strings_runme.1.d12
-rw-r--r--Examples/test-suite/d/apply_strings_runme.2.d12
-rw-r--r--Examples/test-suite/d/bools_runme.1.d20
-rw-r--r--Examples/test-suite/d/bools_runme.2.d20
-rw-r--r--Examples/test-suite/d/catches_runme.1.d33
-rw-r--r--Examples/test-suite/d/catches_runme.2.d33
-rw-r--r--Examples/test-suite/d/char_strings_runme.1.d151
-rw-r--r--Examples/test-suite/d/char_strings_runme.2.d123
-rw-r--r--Examples/test-suite/d/constover_runme.1.d31
-rw-r--r--Examples/test-suite/d/constover_runme.2.d16
-rw-r--r--Examples/test-suite/d/d_nativepointers_runme.1.d36
-rw-r--r--Examples/test-suite/d/d_nativepointers_runme.2.d36
-rw-r--r--Examples/test-suite/d/default_args_runme.1.d127
-rw-r--r--Examples/test-suite/d/default_args_runme.2.d84
-rw-r--r--Examples/test-suite/d/default_constructor_runme.1.d30
-rw-r--r--Examples/test-suite/d/default_constructor_runme.2.d25
-rw-r--r--Examples/test-suite/d/director_alternating_runme.1.d7
-rw-r--r--Examples/test-suite/d/director_alternating_runme.2.d7
-rw-r--r--Examples/test-suite/d/director_basic_runme.1.d59
-rw-r--r--Examples/test-suite/d/director_basic_runme.2.d46
-rw-r--r--Examples/test-suite/d/director_classes_runme.1.d168
-rw-r--r--Examples/test-suite/d/director_classes_runme.2.d169
-rw-r--r--Examples/test-suite/d/director_classic_runme.1.d207
-rw-r--r--Examples/test-suite/d/director_classic_runme.2.d202
-rw-r--r--Examples/test-suite/d/director_ignore_runme.1.d39
-rw-r--r--Examples/test-suite/d/director_ignore_runme.2.d38
-rw-r--r--Examples/test-suite/d/director_primitives_runme.1.d122
-rw-r--r--Examples/test-suite/d/director_primitives_runme.2.d123
-rw-r--r--Examples/test-suite/d/director_protected_runme.1.d50
-rw-r--r--Examples/test-suite/d/director_protected_runme.2.d36
-rw-r--r--Examples/test-suite/d/director_string_runme.1.d46
-rw-r--r--Examples/test-suite/d/director_string_runme.2.d42
-rw-r--r--Examples/test-suite/d/enum_thorough_runme.1.d424
-rw-r--r--Examples/test-suite/d/enum_thorough_runme.2.d425
-rw-r--r--Examples/test-suite/d/inherit_target_language_runme.1.d29
-rw-r--r--Examples/test-suite/d/inherit_target_language_runme.2.d29
-rw-r--r--Examples/test-suite/d/li_attribute_runme.1.d75
-rw-r--r--Examples/test-suite/d/li_attribute_runme.2.d58
-rw-r--r--Examples/test-suite/d/li_boost_shared_ptr_bits_runme.1.d21
-rw-r--r--Examples/test-suite/d/li_boost_shared_ptr_bits_runme.2.d19
-rw-r--r--Examples/test-suite/d/li_boost_shared_ptr_runme.1.d604
-rw-r--r--Examples/test-suite/d/li_boost_shared_ptr_runme.2.d602
-rw-r--r--Examples/test-suite/d/li_std_except_runme.1.d40
-rw-r--r--Examples/test-suite/d/li_std_except_runme.2.d34
-rw-r--r--Examples/test-suite/d/li_std_string_runme.1.d97
-rw-r--r--Examples/test-suite/d/li_std_string_runme.2.d86
-rw-r--r--Examples/test-suite/d/li_std_vector_runme.1.d219
-rw-r--r--Examples/test-suite/d/li_std_vector_runme.2.d207
-rw-r--r--Examples/test-suite/d/li_typemaps_runme.1.d94
-rw-r--r--Examples/test-suite/d/li_typemaps_runme.2.d91
-rw-r--r--Examples/test-suite/d/long_long_runme.1.d35
-rw-r--r--Examples/test-suite/d/long_long_runme.2.d32
-rw-r--r--Examples/test-suite/d/member_pointer_runme.1.d43
-rw-r--r--Examples/test-suite/d/member_pointer_runme.2.d42
-rw-r--r--Examples/test-suite/d/operator_overload_runme.1.d89
-rw-r--r--Examples/test-suite/d/operator_overload_runme.2.d91
-rw-r--r--Examples/test-suite/d/overload_complicated_runme.1.d50
-rw-r--r--Examples/test-suite/d/overload_complicated_runme.2.d34
-rw-r--r--Examples/test-suite/d/overload_template_runme.1.d146
-rw-r--r--Examples/test-suite/d/overload_template_runme.2.d80
-rw-r--r--Examples/test-suite/d/pointer_reference_runme.1.d13
-rw-r--r--Examples/test-suite/d/pointer_reference_runme.2.d14
-rw-r--r--Examples/test-suite/d/preproc_constants_c_runme.1.d63
-rw-r--r--Examples/test-suite/d/preproc_constants_c_runme.2.d63
-rw-r--r--Examples/test-suite/d/preproc_constants_runme.1.d62
-rw-r--r--Examples/test-suite/d/preproc_constants_runme.2.d62
-rw-r--r--Examples/test-suite/d/sizet_runme.1.d15
-rw-r--r--Examples/test-suite/d/sizet_runme.2.d14
-rw-r--r--Examples/test-suite/d/sneaky1_runme.1.d21
-rw-r--r--Examples/test-suite/d/sneaky1_runme.2.d11
-rw-r--r--Examples/test-suite/d/special_variable_macros_runme.1.d39
-rw-r--r--Examples/test-suite/d/special_variable_macros_runme.2.d21
-rw-r--r--Examples/test-suite/d/threads_runme.1.d70
-rw-r--r--Examples/test-suite/d/threads_runme.2.d55
-rw-r--r--Examples/test-suite/d/throw_exception_runme.1.d30
-rw-r--r--Examples/test-suite/d/throw_exception_runme.2.d30
-rw-r--r--Examples/test-suite/d/typemap_namespace_runme.1.d13
-rw-r--r--Examples/test-suite/d/typemap_namespace_runme.2.d9
-rw-r--r--Examples/test-suite/d/typemap_out_optimal_runme.1.d9
-rw-r--r--Examples/test-suite/d/typemap_out_optimal_runme.2.d9
-rw-r--r--Examples/test-suite/d/varargs_runme.1.d20
-rw-r--r--Examples/test-suite/d/varargs_runme.2.d13
-rw-r--r--Examples/test-suite/d/virtual_poly_runme.1.d27
-rw-r--r--Examples/test-suite/d/virtual_poly_runme.2.d22
-rw-r--r--Examples/test-suite/d_exception_name.i15
-rw-r--r--Examples/test-suite/d_nativepointers.i21
-rw-r--r--Examples/test-suite/default_constructor.i6
-rw-r--r--Examples/test-suite/director_alternating.i36
-rw-r--r--Examples/test-suite/director_keywords.i13
-rw-r--r--Examples/test-suite/director_protected.i13
-rw-r--r--Examples/test-suite/director_using.i15
-rw-r--r--Examples/test-suite/dynamic_cast.i13
-rw-r--r--Examples/test-suite/enum_rename.i2
-rw-r--r--Examples/test-suite/enums.i5
-rw-r--r--Examples/test-suite/errors/cpp_inherit.i47
-rw-r--r--Examples/test-suite/errors/cpp_macro_locator.i103
-rw-r--r--Examples/test-suite/errors/cpp_recursive_typedef.i4
-rw-r--r--Examples/test-suite/errors/cpp_shared_ptr.i29
-rw-r--r--Examples/test-suite/errors/expected.log314
-rwxr-xr-xExamples/test-suite/errors/make.sh19
-rw-r--r--Examples/test-suite/errors/pp_constant.i50
-rw-r--r--Examples/test-suite/errors/pp_deprecated.i9
-rw-r--r--Examples/test-suite/errors/pp_illegal_argument.i20
-rw-r--r--Examples/test-suite/errors/pp_macro_defined_unterminated.i6
-rw-r--r--Examples/test-suite/errors/pp_macro_expansion.i10
-rw-r--r--Examples/test-suite/errors/pp_macro_expansion_multiline.i32
-rw-r--r--Examples/test-suite/errors/pp_macro_inline_unterminated.i11
-rw-r--r--Examples/test-suite/errors/pp_pragma.i6
-rw-r--r--Examples/test-suite/errors/pp_variable_args.i10
-rw-r--r--Examples/test-suite/evil_diamond.i3
-rw-r--r--Examples/test-suite/evil_diamond_ns.i3
-rw-r--r--Examples/test-suite/evil_diamond_prop.i1
-rw-r--r--Examples/test-suite/exception_order.i20
-rw-r--r--Examples/test-suite/global_namespace.i22
-rw-r--r--Examples/test-suite/go/char_binary_runme.go25
-rw-r--r--Examples/test-suite/guilescm/ext_test_external.cxx2
-rw-r--r--Examples/test-suite/immutable_values.i (renamed from Examples/test-suite/immutable.i)2
-rw-r--r--Examples/test-suite/import_nomodule.i8
-rw-r--r--Examples/test-suite/inherit_target_language.i8
-rw-r--r--Examples/test-suite/java/Makefile.in4
-rw-r--r--Examples/test-suite/java/char_binary_runme.java24
-rw-r--r--Examples/test-suite/java/director_protected_runme.java32
-rw-r--r--Examples/test-suite/java/global_namespace_runme.java34
-rw-r--r--Examples/test-suite/java/pointer_reference_runme.java3
-rw-r--r--Examples/test-suite/java/preproc_line_file_runme.java68
-rw-r--r--Examples/test-suite/java/rename_pcre_encoder_runme.java14
-rw-r--r--Examples/test-suite/java/rename_pcre_enum_runme.java26
-rw-r--r--Examples/test-suite/java/rname_runme.java2
-rw-r--r--Examples/test-suite/java/smart_pointer_const_overload_runme.java99
-rw-r--r--Examples/test-suite/java/typemap_arrays_runme.java19
-rw-r--r--Examples/test-suite/java/wallkw_runme.java4
-rw-r--r--Examples/test-suite/li_boost_shared_ptr.i3
-rw-r--r--Examples/test-suite/li_boost_shared_ptr_bits.i2
-rw-r--r--Examples/test-suite/li_std_combinations.i2
-rw-r--r--Examples/test-suite/li_typemaps_apply.i46
-rw-r--r--Examples/test-suite/lua/pointer_reference_runme.lua2
-rw-r--r--Examples/test-suite/member_funcptr_galore.i83
-rw-r--r--Examples/test-suite/minherit2.i29
-rw-r--r--Examples/test-suite/multiple_inheritance.i6
-rw-r--r--Examples/test-suite/namespace_class.i4
-rw-r--r--Examples/test-suite/octave/primitive_types_runme.m402
-rw-r--r--Examples/test-suite/octave/samename_runme.m (renamed from Examples/test-suite/samename_runme.m)0
-rw-r--r--Examples/test-suite/operator_overload.i6
-rw-r--r--Examples/test-suite/operator_overload_break.i2
-rw-r--r--Examples/test-suite/operbool.i2
-rwxr-xr-xExamples/test-suite/perl5/char_binary_runme.pl32
-rwxr-xr-xExamples/test-suite/perl5/primitive_types_runme.pl9
-rw-r--r--Examples/test-suite/php/director_protected_runme.php21
-rw-r--r--Examples/test-suite/php/pointer_reference_runme.php3
-rw-r--r--Examples/test-suite/pointer_reference.i6
-rw-r--r--Examples/test-suite/preproc_defined.i108
-rw-r--r--Examples/test-suite/preproc_include.i18
-rw-r--r--Examples/test-suite/preproc_include_a.h3
-rw-r--r--Examples/test-suite/preproc_include_b.h7
-rw-r--r--Examples/test-suite/preproc_include_c.h3
-rw-r--r--Examples/test-suite/preproc_line_file.i95
-rw-r--r--Examples/test-suite/primitive_types.i9
-rw-r--r--Examples/test-suite/pure_virtual.i5
-rw-r--r--Examples/test-suite/python/Makefile.in2
-rw-r--r--Examples/test-suite/python/char_binary_runme.py36
-rw-r--r--Examples/test-suite/python/director_alternating_runme.py5
-rw-r--r--Examples/test-suite/python/director_protected_runme.py43
-rw-r--r--Examples/test-suite/python/global_namespace_runme.py40
-rw-r--r--Examples/test-suite/python/pointer_reference_runme.py16
-rw-r--r--Examples/test-suite/python/preproc_defined_runme.py11
-rw-r--r--Examples/test-suite/python/preproc_include_runme.py11
-rw-r--r--Examples/test-suite/python/primitive_types_runme.py11
-rw-r--r--Examples/test-suite/python/rename_pcre_encoder_runme.py13
-rw-r--r--Examples/test-suite/python/smart_pointer_const_overload_runme.py123
-rw-r--r--Examples/test-suite/python/typemap_arrays_runme.py5
-rw-r--r--Examples/test-suite/r/rename_simple_runme.R20
-rw-r--r--Examples/test-suite/r/unittest.R18
-rw-r--r--Examples/test-suite/rename_camel.i4
-rw-r--r--Examples/test-suite/rename_pcre_encoder.i31
-rw-r--r--Examples/test-suite/rename_pcre_enum.i49
-rw-r--r--Examples/test-suite/rename_simple.i24
-rw-r--r--Examples/test-suite/restrict_cplusplus.i10
-rw-r--r--Examples/test-suite/return_const_value.i1
-rw-r--r--Examples/test-suite/rname.i19
-rw-r--r--Examples/test-suite/samename.i2
-rw-r--r--Examples/test-suite/smart_pointer_const_overload.i74
-rw-r--r--Examples/test-suite/smart_pointer_templatemethods.i13
-rw-r--r--Examples/test-suite/special_variable_macros.i14
-rw-r--r--Examples/test-suite/static_const_member.i3
-rw-r--r--Examples/test-suite/template_basic.i (renamed from Examples/test-suite/template.i)6
-rw-r--r--Examples/test-suite/template_enum.i4
-rw-r--r--Examples/test-suite/template_inherit_abstract.i5
-rw-r--r--[-rwxr-xr-x]Examples/test-suite/threads_exception.i0
-rw-r--r--Examples/test-suite/typemap_arrays.i30
-rw-r--r--Examples/test-suite/typemap_namespace.i9
-rw-r--r--Examples/test-suite/typemap_out_optimal.i6
-rw-r--r--Examples/test-suite/typemap_subst.i4
-rw-r--r--Examples/test-suite/using_composition.i9
-rw-r--r--Examples/test-suite/using_extend.i3
-rw-r--r--Examples/test-suite/using_namespace.i3
-rw-r--r--Examples/test-suite/using_protected.i17
-rw-r--r--Examples/test-suite/varargs.i3
-rw-r--r--Examples/test-suite/wallkw.i4
-rw-r--r--Examples/test-suite/wrapmacro.i2
-rw-r--r--Lib/allkw.swg1
-rw-r--r--Lib/chicken/chicken.swg2
-rw-r--r--Lib/csharp/std_map.i24
-rw-r--r--Lib/csharp/typemaps.i21
-rw-r--r--Lib/csharp/wchar.i204
-rw-r--r--Lib/d/boost_shared_ptr.i201
-rw-r--r--Lib/d/carrays.i111
-rw-r--r--Lib/d/cpointer.i171
-rw-r--r--Lib/d/d.swg46
-rw-r--r--Lib/d/dclassgen.swg142
-rw-r--r--Lib/d/ddirectives.swg10
-rw-r--r--Lib/d/denums.swg60
-rw-r--r--Lib/d/dexception.swg30
-rw-r--r--Lib/d/dhead.swg310
-rw-r--r--Lib/d/director.swg46
-rw-r--r--Lib/d/dkw.swg126
-rw-r--r--Lib/d/dmemberfunctionpointers.swg92
-rw-r--r--Lib/d/doperators.swg259
-rw-r--r--Lib/d/dprimitives.swg158
-rw-r--r--Lib/d/dstrings.swg80
-rw-r--r--Lib/d/dswigtype.swg184
-rw-r--r--Lib/d/dvoid.swg18
-rw-r--r--Lib/d/std_common.i5
-rw-r--r--Lib/d/std_deque.i1
-rw-r--r--Lib/d/std_except.i30
-rw-r--r--Lib/d/std_map.i59
-rw-r--r--Lib/d/std_pair.i34
-rw-r--r--Lib/d/std_shared_ptr.i2
-rw-r--r--Lib/d/std_string.i98
-rw-r--r--Lib/d/std_vector.i591
-rw-r--r--Lib/d/stl.i12
-rw-r--r--Lib/d/typemaps.i298
-rw-r--r--Lib/d/wrapperloader.swg308
-rw-r--r--Lib/exception.i36
-rw-r--r--Lib/go/cdata.i79
-rw-r--r--Lib/go/go.swg41
-rw-r--r--Lib/go/goruntime.swg150
-rw-r--r--Lib/guile/typemaps.i2
-rw-r--r--Lib/java/java.swg15
-rw-r--r--Lib/ocaml/std_string.i180
-rw-r--r--Lib/ocaml/swigp4.ml.in249
-rw-r--r--Lib/ocaml/typemaps.i11
-rw-r--r--Lib/octave/octcontainer.swg3
-rw-r--r--Lib/perl5/perlprimtypes.swg4
-rw-r--r--Lib/php/php.swg19
-rw-r--r--Lib/pike/pike.swg2
-rw-r--r--Lib/python/pycontainer.swg3
-rw-r--r--Lib/python/pyrun.swg6
-rw-r--r--Lib/ruby/rubycontainer.swg3
-rw-r--r--Lib/ruby/rubyerrors.swg2
-rw-r--r--Lib/ruby/timeval.i5
-rw-r--r--Lib/std_except.i2
-rw-r--r--Lib/swig.swg5
-rw-r--r--Lib/typemaps/strings.swg2
-rw-r--r--Lib/typemaps/swigtype.swg2
-rw-r--r--Makefile.in21
-rw-r--r--README15
-rw-r--r--RELEASENOTES9
-rw-r--r--Source/CParse/cscanner.c105
-rw-r--r--Source/CParse/parser.y45
-rw-r--r--Source/DOH/base.c2
-rw-r--r--Source/DOH/doh.h12
-rw-r--r--Source/DOH/dohint.h4
-rw-r--r--Source/DOH/file.c2
-rw-r--r--Source/DOH/hash.c55
-rw-r--r--Source/DOH/list.c2
-rw-r--r--Source/DOH/string.c70
-rw-r--r--Source/Include/swigwarn.h32
-rw-r--r--Source/Makefile.am1
-rw-r--r--Source/Modules/allocate.cxx8
-rw-r--r--Source/Modules/clisp.cxx16
-rw-r--r--Source/Modules/csharp.cxx82
-rw-r--r--Source/Modules/d.cxx4351
-rw-r--r--Source/Modules/go.cxx59
-rw-r--r--Source/Modules/java.cxx32
-rw-r--r--Source/Modules/lang.cxx36
-rw-r--r--Source/Modules/lua.cxx2
-rw-r--r--Source/Modules/main.cxx16
-rw-r--r--Source/Modules/modula3.cxx11
-rw-r--r--Source/Modules/mzscheme.cxx2
-rw-r--r--Source/Modules/ocaml.cxx45
-rw-r--r--Source/Modules/php.cxx21
-rw-r--r--Source/Modules/python.cxx6
-rw-r--r--Source/Modules/r.cxx17
-rw-r--r--Source/Modules/ruby.cxx13
-rw-r--r--Source/Modules/swigmain.cxx2
-rw-r--r--Source/Modules/swigmod.h11
-rw-r--r--Source/Modules/tcl8.cxx5
-rw-r--r--Source/Modules/typepass.cxx23
-rw-r--r--Source/Modules/utils.cxx113
-rw-r--r--Source/Preprocessor/cpp.c321
-rw-r--r--Source/Swig/cwrap.c42
-rw-r--r--Source/Swig/error.c35
-rw-r--r--Source/Swig/include.c2
-rw-r--r--Source/Swig/misc.c219
-rw-r--r--Source/Swig/naming.c111
-rw-r--r--Source/Swig/scanner.c159
-rw-r--r--Source/Swig/stype.c209
-rw-r--r--Source/Swig/swig.h93
-rw-r--r--Source/Swig/swigscan.h2
-rw-r--r--Source/Swig/symbol.c2
-rw-r--r--Source/Swig/tree.c8
-rw-r--r--Source/Swig/typemap.c20
-rw-r--r--Source/Swig/typeobj.c30
-rw-r--r--Source/Swig/typesys.c37
-rw-r--r--Tools/config/ax_boost_base.m4258
-rw-r--r--Tools/config/ax_compare_version.m4177
-rw-r--r--Tools/config/ax_path_generic.m4142
-rwxr-xr-xTools/mkwindows.sh14
-rwxr-xr-xTools/pcre-build.sh53
-rw-r--r--Tools/swig.gdb41
-rw-r--r--configure.in203
439 files changed, 24100 insertions, 4529 deletions
diff --git a/ANNOUNCE b/ANNOUNCE
index ad3e8f8..cdf246e 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,4 +1,4 @@
-*** ANNOUNCE: SWIG 2.0.1 (in progress) ***
+*** ANNOUNCE: SWIG 2.0.2 (in progress) ***
http://www.swig.org
diff --git a/CHANGES b/CHANGES
index f243ff7..bf5e20d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,195 @@ SWIG (Simplified Wrapper and Interface Generator)
See the CHANGES.current file for changes in the current version.
See the RELEASENOTES file for a summary of changes in each release.
+Version 2.0.1 (4 October 2010)
+==============================
+
+2010-10-03: wsfulton
+ Apply patch #3066958 from Mikael Johansson to fix default smart pointer
+ handling when the smart pointer contains both a const and non-const operator->.
+
+2010-10-01: wsfulton
+ Add -pcreversion option to display PCRE version information.
+
+2010-10-01: olly
+ [Ruby] Avoid segfault when a method node has no parentNode
+ (SF#3034054).
+
+2010-10-01: olly
+ [Python] Allow reinitialisation to work with an embedded Python
+ interpreter (patch from Jim Carroll in SF#3075178).
+
+2010-09-28: wsfulton
+ [C#] Apply patch from Tomas Dirvanauskas for std::map wrappers to avoid
+ throwing exceptions with normal usage of iterators.
+
+2010-09-27: olly
+ [Python] Improve error message given when a parameter of the wrong
+ type is passed to an overloaded method (SF#3027355).
+
+2010-09-25: wsfulton
+ Apply SF patch #3075150 - Java directors using static variables in
+ named namespace.
+
+2010-09-24: wsfulton
+ More file and line error/warning reporting fixes where SWIG macros
+ are used within {} braces (where the preprocessor expands macros),
+ for example macros within %inline {...} and %fragment(...) {...}
+ and nested structs.
+
+2010-09-18: wsfulton
+ More file and line error/warning reporting fixes for various inherited
+ class problems.
+
+2010-09-15: wsfulton
+ A much improved debugging of SWIG source experience is now available and
+ documented in the "Debugging SWIG" section in the Doc/Devel/internals.html
+ file, including a swig.dbg support file for the gdb debugger.
+
+2010-09-11: wsfulton
+ Fix incorrect line number reporting in errors/warnings when a macro
+ definition ends with '/' and it is not the end of a C comment.
+
+2010-09-11: wsfulton
+ Fix incorrect line number reporting in errors/warnings after parsing
+ macro invocations with parameters given over more than one line.
+
+2010-09-10: wsfulton
+ Remove extraneous extra line in preprocessed output after including files
+ which would sometimes lead to error/warning messages two lines after the
+ end of the file.
+
+2010-09-10: wsfulton
+ Fix #2149523 - Incorrect line number reporting in errors after parsing macros
+ containing C++ comments.
+
+2010-09-08: olly
+ [PHP] Fix handling of OUTPUT typemaps (Patch from Ryan in SF#3058394).
+
+2010-09-03: wsfulton
+ Fix erroneous line numbers in error messages for macro expansions, for example,
+ the error message now points to instantiation of the macro, ie the last line here:
+
+ #define MACRO2(a, b)
+
+ #define MACRO1(NAME) MACRO2(NAME,2,3)
+
+ MACRO1(abc)
+
+2010-09-02: wsfulton
+ Fix line numbers in error and warning messages for preprocessor messages within
+ %inline, for example:
+
+ %inline %{
+ #define FOOBAR 1
+ #define FOOBAR "hi"
+ %}
+
+2010-09-02: wsfulton
+ Fix line numbers in error and warning messages which were cumulatively one
+ less than they should have been after parsing each %include/%import - bug
+ introduced in swig-1.3.32. Also fix line numbers in error and warning messages
+ when new line characters appear between the %include / %import statement and
+ the filename.
+
+2010-08-30: wsfulton
+ Fix line number and file name reporting for some macro preprocessor warnings.
+ The line number of the macro argument has been corrected and the line number
+ of the start of the macro instead of one past the end of the macro is used.
+ Some examples:
+ file.h:11: Error: Illegal macro argument name '..'
+ file.h:19: Error: Macro 'DUPLICATE' redefined,
+ file.h:15: Error: previous definition of 'DUPLICATE'.
+ file.h:25: Error: Variable-length macro argument must be last parameter
+ file.h:32: Error: Illegal character in macro argument name
+ file.i:37: Error: Macro 'SIT' expects 2 arguments
+
+2010-08-26: wsfulton
+ Fix __LINE__ and __FILE__ expansion reported by Camille Gillot. Mostly this
+ did not work at all. Also fixes SF #2822822.
+
+2010-08-17: wsfulton
+ [Perl] Fix corner case marshalling of doubles - errno was not being correctly
+ set before calling strtod - patch from Justin Vallon - SF Bug #3038936.
+
+2010-08-17: wsfulton
+ Fix make distclean when some of the more obscure languages are detected by
+ configure - fixes from Torsten Landschoff.
+
+2010-07-28: wsfulton
+ Restore configuring out of source for the test-suite since it broke in 1.3.37.
+ As previously, if running 'make check-test-suite' out of source, it needs to be
+ done by invoking configure with a relative path. Invoking configure with an
+ absolute path will not work. Running the full 'make check' still needs to be
+ done in the source tree.
+
+2010-07-16: wsfulton
+ Fix wrapping of function pointers and member function pointers when the function
+ returns by reference.
+
+2010-07-13: vadz
+ Removed support for the old experimental "rxspencer" encoder and
+ "[not]rxsmatch" in %rename (see the 01/16/2006 entry). The new and
+ officially supported "regex" encoder and "[not]regexmatch" checks
+ should be used instead (see the two previous entries). Please
+ replace "%(rxspencer:[pat][subst])s" with "%(regex:/pat/subst/)s"
+ when upgrading. Notice that you will also need to replace the back-
+ references of form "@1" with the more standard "\\1" and may need to
+ adjust your regular expressions syntax as the new regex encoder uses
+ Perl-compatible syntax and not (extended) POSIX syntax as the old one.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2010-07-13: vadz
+ Add "regexmatch", "regextarget" and "notregexmatch" which can be
+ used to apply %rename directives to the declarations matching the
+ specified regular expression only. The first two can be used
+ interchangeably, both of the %renames below do the same thing:
+
+ %rename("$ignore", regexmatch$name="Old$") "";
+ %rename("$ignore", regextarget=1) "Old$";
+
+ (namely ignore the declarations having "Old" suffix).
+
+ "notregexmatch" restricts the match to only the declarations which
+ do not match the regular expression, e.g. here is how to rename to
+ lower case versions all declarations except those consisting from
+ capital letters only:
+
+ %rename("$(lowercase)s", notregexmatch$name="^[A-Z]+$") "";
+
+2010-07-13: vadz
+ Add the new "regex" encoder that can be used in %rename, e.g.
+
+ %rename("regex:/(\\w+)_(.*)/\\2/") "";
+
+ to remove any alphabetical prefix from all identifiers. The syntax
+ of the regular expressions is Perl-like and PCRE library
+ (http://www.pcre.org/) is used to implement this feature but notice
+ that backslashes need to be escaped as usual inside C strings.
+
+ Original patch from Torsten Landschoff.
+
+2010-07-08: wsfulton
+ Fix #3024875 - shared_ptr of classes with non-public destructors. This also fixes
+ the "unref" feature when used on classes with non-public destructors.
+
+2010-06-17: ianlancetaylor
+ [Go] Add the Go language module.
+
+2010-06-10: wsfulton
+ [Lua] Fix SWIG_lua_isnilstring multiply defined when using multiple
+ modules and wrapping strings. Patch from 'Number Cruncher'.
+
+2010-06-10: olly
+ [PHP] Fix directors to correctly call a method with has a
+ different name in PHP to C++ (we were always using the C++ name
+ in this case).
+
+2010-06-03: wsfulton
+ Fix uncompileable code when %rename results in two enum items
+ with the same name. Reported by Vadim Zeitlin.
+
Version 2.0.0 (2 June 2010)
===========================
diff --git a/CHANGES.current b/CHANGES.current
index 63af720..8ae8b78 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -2,26 +2,128 @@ This file contains the changes for the current release.
See the CHANGES file for changes in older releases.
See the RELEASENOTES file for a summary of changes in each release.
-Version 2.0.1 (in progress)
+Version 2.0.2 (in progress)
===========================
-2010-07-16: wsfulton
- Fix wrapping of function pointers and member function pointers when the function
- returns by reference.
+2011-02-13: wsfulton
+ [Ruby] Apply patch #3176274 from James Masters - typecheck typemap for time_t.
-2010-07-08: wsfulton
- Fix #3024875 - shared_ptr of classes with non-public destructors. This also fixes
- the "unref" feature when used on classes with non-public destructors.
+2011-02-13: wsfulton
+ Apply patch #3171793 from szager - protected director methods failing when -fvirtual is used.
-2010-06-10: wsfulton
- [Lua] Fix SWIG_lua_isnilstring multiply defined when using multiple
- modules and wrapping strings. Patch from 'Number Cruncher'.
+2011-02-13: wsfulton
+ Fix #1927852 - #include directives don't preprocess the file passed to it. The fix is for
+ #include with -importall or -includeall, %include and %import, for example:
+ #define FILENAME "abc.h"
+ %include FILENAME
-2010-06-10: olly
- [PHP] Fix directors to correctly call a method with has a
- different name in PHP to C++ (we were always using the C++ name
- in this case).
+2011-02-12: wsfulton
+ Fix #1940536, overactive preprocessor which was expanding defined(...) outside of #if and #elif
+ preprocessor directives.
-2010-06-03: wsfulton
- Fix uncompileable code when %rename results in two enum items
- with the same name. Reported by Vadim Zeitlin.
+2011-02-05: wsfulton
+ [MzScheme] SF #2942899 Add user supplied documentation to help getting started with MzScheme.
+ Update chapter name to MzScheme/Racket accounting for the rename of MzScheme to Racket.
+
+2011-02-05: wsfulton
+ [C#] SF #3085906 - Possible fix running test-suite on Mac OSX.
+
+2011-02-05: wsfulton
+ SF #3173367 Better information during configure about Boost prerequisite for running
+ the test-suite.
+
+2011-02-05: wsfulton
+ SF #3127633 Fix infinite loop in recursive typedef resolution.
+
+2011-02-04: wsfulton
+ [R] SF #3168676 Fix %rename not working for member variables and methods.
+
+2011-02-04: wsfulton
+ [PHP] SF #3166423 Recent PHP versions no longer define zend_error_noreturn - calls to this
+ have been replaced with zend_error.
+
+2011-02-04: wsfulton
+ [clisp] SF #3148200 Fix segfault parsing nested unions.
+
+2011-02-01: wsfulton
+ [C#] Directors - a call to a method being defined in the base class, not
+ overridden in a subclass, but again overridden in a class derived from
+ the first subclass was not being dispatched correctly to the most derived class.
+ See director_alternating.i for an example.
+
+2011-02-01: wsfulton
+ [C#, Java] Any 'using' statements in the protected section of a class were previously
+ ignored with director protected (dirprot) mode.
+
+2011-01-30: wsfulton
+ Fix overloading with const pointer reference (SWIGTYPE *const&) parameters for a
+ number of scripting languages.
+
+2011-01-17: wsfulton
+ New warning for smart pointers if only some of the classes in the inheritance
+ chain are marked as smart pointer, eg, %shared_ptr should be used for all classes
+ in an inheritance hierarchy, so this new warning highlights code where this is
+ not the case.
+
+ example.i:12: Warning 520: Base class 'A' of 'B' is not similarly marked as a smart pointer.
+ example.i:16: Warning 520: Derived class 'C' of 'B' is not similarly marked as a smart pointer.
+
+2011-01-14: wsfulton
+ Added some missing multi-argument typemaps: (char *STRING, size_t LENGTH) and
+ (char *STRING, int LENGTH). Documentation for this updated. Java patch from
+ Volker Grabsch.
+
+2011-01-11: iant
+ Require Go version 7077 or later.
+
+2010-12-30: klickverbot
+ [C#, D, Java] Check for collision of parameter names with target
+ language keywords when generating the director glue code.
+
+ The situation in which the generated could would previously be
+ invalid is illustrated in the new 'director_keywords' test case.
+
+2010-12-23: wsfulton
+ [C#] Fix $csinput special variable not being expanded for csvarin typemaps
+ when used for global variables. Reported by Vadim Zeitlin.
+
+2010-12-14: wsfulton
+ Fix $basemangle expansion in array typemaps. For example if type is int *[3],
+ $basemangle expands to _p_int.
+
+2010-12-07: iant
+ Check that we are using a sufficiently new version of the
+ 6g or 8g Go compiler during configure time. If not, disable Go.
+ Minimum version is now 6707.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2010-12-06: wsfulton
+ Fix #3127394 - use of network paths on Windows/MSys.
+
+2010-11-18: klickverbot
+ [D] Added the D language module.
+
+2010-11-12: vadz
+ Fix handling of multiple regex-using %renames attached to the same
+ declaration. For example, now
+
+ %rename("%(regex/^Set(.*)/put\\1/)s") "";
+ %rename("%(regex/^Get(.*)/get\\1/)s") "";
+
+ works as expected whereas before only the last anonymous rename was
+ taken into account.
+
+2010-10-17: drjoe
+ [R] Fix failure in overloaded functions which was breaking
+ QuantLib-SWIG
+
+2010-10-14: olly
+ [PHP] Allow compilation on non-conforming Microsoft C++ compilers
+ which don't accept: return function_returning_void();
+ Reported by Frank Vanden Berghen on the SWIG mailing list.
+
+2010-10-12: wsfulton
+ Fix unary scope operator (::) (global scope) regression introduced in 2.0.0, reported by
+ Ben Walker. The mangled symbol names were incorrect, sometimes resulting in types being
+ incorrectly treated as opaque types.
diff --git a/COPYRIGHT b/COPYRIGHT
index 40d09a1..1e5d080 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -42,7 +42,7 @@ Past SWIG developers and major contributors include:
Tiger Feng (songyanf@cs.uchicago.edu) (SWIG core)
Mark Rose (mrose@stm.lbl.gov) (Directors)
Jonah Beckford (beckford@usermail.com) (CHICKEN)
- Ahmon Dancy (dancy@franz.com) (Allegro CL)
+ Ahmon Dancy (dancy@franz.com) (Allegro CL)
Dirk Gerrits (Allegro CL)
Neil Cawse (C#)
Harco de Hilster (Java)
@@ -55,6 +55,8 @@ Past SWIG developers and major contributors include:
Mark Gossage (mark@gossage.cjb.net) (Lua)
Gonzalo Garramuno (ggarra@advancedsl.com.ar) (Ruby, Ruby's UTL)
John Lenz (Guile, MzScheme updates, Chicken module, runtime system)
+ Ian Lance Taylor (Go)
+ Vadim Zeitlin (PCRE)
Past contributors include:
James Michael DuPont, Clark McGrew, Dustin Mitchell, Ian Cooke, Catalin Dumitrescu, Baran
diff --git a/Doc/Devel/index.html b/Doc/Devel/index.html
index 55c612e..4ddc63a 100644
--- a/Doc/Devel/index.html
+++ b/Doc/Devel/index.html
@@ -21,6 +21,7 @@ The following documentation describe the internal APIs used by SWIG. These may
<li><a href="parm.html">Parameter and Parameter list handling functions</a>
<li><a href="scanner.html">Generic C/C++ Scanner interface</a>
<li><a href="wrapobj.html">Wrapper objects</a>.
+<li><a href="runtime.txt">SWIG Runtime</a>.
</ul>
<hr>
diff --git a/Doc/Devel/internals.html b/Doc/Devel/internals.html
index 6ac3947..d24869d 100644
--- a/Doc/Devel/internals.html
+++ b/Doc/Devel/internals.html
@@ -7,11 +7,6 @@
<center>
<h1>SWIG Internals Manual</h1>
-<b>Thien-Thi Nguyen <br>
-
-<p>
-David M. Beazley <br>
-
</b>
</center>
@@ -45,6 +40,9 @@ David M. Beazley <br>
<li><a name="i5" href="#5">5. C/C++ Wrapper Support Functions</a>
<li><a name="i6" href="#6">6. Symbol Naming Guidelines for Generated C/C++ Code</a>
<li><a name="i7" href="#7">7. Debugging SWIG</a>
+<ul>
+<li><a name="i7.1" href="#7.1">7.1 Debugging DOH Types The Hard Way</a>
+</ul>
</ul>
<a name="1" href="#i1">
@@ -1015,15 +1013,139 @@ In the past SWIG has generated many symbols which flout the standard especially
<a name="7" href="#i7">
<h2>7. Debugging SWIG</h2>
</a>
-Warning. Debugging SWIG is for the very patient.
+
+<p>
+The DOH types used in the SWIG source code are all typedefined to void.
+Consequently, it is impossible for debuggers to automatically extract any information about DOH objects.
+The easiest approach to debugging and viewing the contents of DOH objects is to make a call into one of the family of SWIG print functions from the debugger.
+The "Debugging Functions" section in <a href="tree.html">SWIG Parse Tree Handling</a> lists them.
+It is sometimes easier to debug by placing a few calls to these functions in code of interest and recompile, especially if your debugger cannot easily make calls into functions within a debugged binary.
+</p>
+
+<p>
+The SWIG distribution comes with some additional support for the gdb debugger in the <tt>Tools/swig.gdb</tt> file.
+Follow the instructions in this file for 'installing'.
+This support file provides an easy way to call into some of the family of SWIG print functions via additional user-defined gdb commands.
+Some usage of the <tt>swigprint</tt> and <tt>locswigprint</tt> user-defined commands are demonstrated below.
+</p>
+
+<p>
+More often than not, a parse tree node needs to be examined.
+The session below displays the node <tt>n</tt> in one of the Java language module wrapper functions.
+The <tt>swigprint</tt> method is used to show the symbol name (<tt>symname</tt> - a DOH String type) and the node (<tt>n</tt> - a DOH Hash type).
+</p>
+<blockquote>
+<pre>
+Breakpoint 1, JAVA::functionWrapper (this=0x97ea5f0, n=0xb7d2afc8) at Modules/java.cxx:799
+799 String *symname = Getattr(n, "sym:name");
+(gdb) next
+800 SwigType *t = Getattr(n, "type");
+(gdb) swigprint symname
+Shape_x_set
+(gdb) swigprint n
+Hash(0xb7d2afc8) {
+ 'membervariableHandler:view' : variableHandler,
+ 'feature:except' : 0,
+ 'name' : x,
+ 'ismember' : 1,
+ 'sym:symtab' : Hash(0xb7d2aca8) {......},
+ 'nodeType' : cdecl,
+ 'nextSibling' : Hash(0xb7d2af98) {.............},
+ 'kind' : variable,
+ 'variableHandler:feature:immutable' : &lt;Object 'VoidObj' at 0xb7cfa008&gt;,
+ 'sym:name' : Shape_x_set,
+ 'view' : membervariableHandler,
+ 'membervariableHandler:sym:name' : x,
+ 'membervariableHandler:type' : double,
+ 'membervariableHandler:parms' : &lt;Object 'VoidObj' at 0xb7cfa008&gt;,
+ 'parentNode' : Hash(0xb7d2abc8) {..............................},
+ 'feature:java:enum' : typesafe,
+ 'access' : public,
+ 'parms' : Hash(0xb7cb9408) {......},
+ 'wrap:action' : if (arg1) (arg1)-&gt;x = arg2;,
+ 'type' : void,
+ 'memberset' : 1,
+ 'sym:overname' : __SWIG_0,
+ 'membervariableHandler:name' : x,
+}
+</pre>
+</blockquote>
+
<p>
+Note that all the attributes in the Hash are shown, including the 'sym:name' attribute which was assigned to the <tt>symname</tt> variable.
+</p>
-The DOH types are all typedefined to void.
-Consequently, it is impossible for debuggers to extract any information about DOH objects.
-Most debuggers will be able to display useful variable information when an object is cast to the appropriate type.
-Below are some tips for displaying some of the DOH objects.
-Be sure to compile with compiler optimisations turned off before attempting the casts shown in a debugger window else they are unlikely to work.
-Even displaying the underlying string in a String* doesn't work straight off in all debuggers due to the multiple definition of String as a struct and a void.
+<p>
+Hash types can be shown either expanded or collapsed.
+When a Hash is shown expanded, all the attributes are displayed along with their values, otherwise a '.' replaces each attribute when collapsed.
+Therefore a count of the dots provides the number of attributes within an unexpanded Hash.
+Below shows the 'parms' Hash being displayed with the default Hash expansion of 1, then with 2 provided as the second argument to <tt>swigprint</tt> to expand to two Hash levels in order to view the contents of the collapsed 'nextSibling' Hash.
+</p>
+
+<blockquote>
+<pre>
+(gdb) swigprint 0xb7cb9408
+Hash(0xb7cb9408) {
+ 'name' : self,
+ 'type' : p.Shape,
+ 'self' : 1,
+ 'nextSibling' : Hash(0xb7cb9498) {...},
+ 'hidden' : 1,
+ 'nodeType' : parm,
+}
+(gdb) swigprint 0xb7cb9408 2
+Hash(0xb7cb9408) {
+ 'name' : self,
+ 'type' : p.Shape,
+ 'self' : 1,
+ 'nextSibling' : Hash(0xb7cb9498) {
+ 'name' : x,
+ 'type' : double,
+ 'nodeType' : parm,
+ },
+ 'hidden' : 1,
+ 'nodeType' : parm,
+}
+</pre>
+</blockquote>
+
+<p>
+The same Hash can also be displayed with file and line location information via the <tt>locswigprint</tt> command.
+</p>
+
+<blockquote>
+<pre>
+(gdb) locswigprint 0xb7cb9408
+example.h:11: [Hash(0xb7cb9408) {
+Hash(0xb7cb9408) {
+ 'name' : self,
+ 'type' : p.Shape,
+ 'self' : 1,
+ 'nextSibling' : Hash(0xb7cb9498) {...},
+ 'hidden' : 1,
+ 'nodeType' : parm,
+}]
+</pre>
+</blockquote>
+
+<p>
+<b>Tip</b>: Commands in gdb can be shortened with whatever makes them unique and can be command completed with the tab key.
+Thus <tt>swigprint</tt> can usually be shortened to <tt>sw</tt> and <tt>locswigprint</tt> to <tt>loc</tt>.
+The help for each command can also be obtained within the debugging session, for example, 'help swigprint'.
+</p>
+
+<p>
+The sub-section below gives pointers for debugging DOH objects using casts and provides an insight into why it can be hard to debug SWIG without the family of print functions.
+<p>
+
+<a name="7.1" href="#i7.1">
+<h3>7.1 Debugging DOH Types The Hard Way</h3>
+</a>
+The DOH types used in SWIG are all typedefined to void and hence the lack of type information for inspecting types within a debugger.
+Most debuggers will however be able to display useful variable information when an object is cast to the appropriate type.
+Getting at the underlying C string within DOH types is cumbersome, but possible with appropriate casts.
+The casts below can be used in a debugger windows, but be sure to compile with compiler optimisations turned off before attempting the casts else they are unlikely to work.
+Even displaying the underlying string in a String * doesn't work straight off in all debuggers due to the multiple definitions of String as a struct and a void.
<p>
Below are a list of common SWIG types.
@@ -1033,36 +1155,30 @@ With each is the cast that can be used in the debugger to extract the underlying
<p>
<li>String *s;</li>
-<br>
-(struct String *)((DohBase *)s)-&gt;data
+<tt>(struct String *)((DohBase *)s)-&gt;data</tt>
<br>
The underlying char * string can be displayed with
<br>
-(*(struct String *)(((DohBase *)s)-&gt;data)).str
+<tt>(*(struct String *)(((DohBase *)s)-&gt;data)).str</tt>
<p>
<li>SwigType *t;</li>
-<br>
-(struct String *)((DohBase *)t)-&gt;data
+<tt>(struct String *)((DohBase *)t)-&gt;data</tt>
<br>
The underlying char * string can be displayed with
<br>
-(*(struct String *)(((DohBase *)t)-&gt;data)).str
+<tt>(*(struct String *)(((DohBase *)t)-&gt;data)).str</tt>
<p>
<li>const_String_or_char_ptr sc;</li>
Either <br>
-(*(struct String *)(((DohBase *)sc)-&gt;data)).str
+<tt>(*(struct String *)(((DohBase *)sc)-&gt;data)).str</tt>
<br> or <br>
-(char *)sc
+<tt>(char *)sc</tt>
<br> will work depending on whether the underlying type is really a String * or char *.
</ul>
-<p>
-Please also read the Debugging Functions section in <a href="tree.html">SWIG Parse Tree Handling</a> for the <tt>Swig_print_node()</tt>, <tt>Swig_print_tree()</tt> and <tt>Swig_print_tags()</tt> functions for displaying node contents. It is often easier to place a few calls to these functions in code of interest and recompile than use the debugger.
-</p>
-
<hr>
Copyright (C) 1999-2010 SWIG Development Team.
diff --git a/Doc/Devel/tree.html b/Doc/Devel/tree.html
index 43ad191..db3c6fe 100644
--- a/Doc/Devel/tree.html
+++ b/Doc/Devel/tree.html
@@ -6,13 +6,6 @@
<body>
<center>
<h1>SWIG Parse Tree Handling</h1>
-
-<p>
-David M. Beazley <br>
-dave-swig@dabeaz.com<br>
-December, 2006<br>
-
-</b>
</center>
<h2>Introduction</h2>
@@ -210,7 +203,33 @@ This function restores a node to the state it was in prior to the last <tt>Swig_
<h2>Debugging Functions</h2>
-The following functions are used to help debug SWIG parse trees.
+<p>
+The following functions can be used to help debug any SWIG DOH object.
+</p>
+
+<b><tt>void Swig_print(DOH *object, int count = -1)</tt></b>
+
+<blockquote>
+Prints to stdout a string representation of any DOH type.
+The number of nested Hash types to expand is set by count (default is 1 if count&lt;0). See Swig_set_max_hash_expand() to change default.
+<pre>
+</pre>
+</blockquote>
+
+<b><tt>void Swig_print_with_location(DOH *object, int count = -1)</tt></b>
+
+<blockquote>
+Prints to stdout a string representation of any DOH type, within [] brackets
+for Hash and List types, prefixed by line and file information.
+The number of nested Hash types to expand is set by count (default is 1 if count&lt;0). See Swig_set_max_hash_expand() to change default.
+<pre>
+</pre>
+</blockquote>
+
+
+<p>
+The following functions can be used to help debug SWIG parse trees.
+</p>
<p>
<b><tt>void Swig_print_tags(Node *node, String_or_char *prefix)</tt></b>
diff --git a/Doc/Manual/CSharp.html b/Doc/Manual/CSharp.html
index 909357f..6691400 100644
--- a/Doc/Manual/CSharp.html
+++ b/Doc/Manual/CSharp.html
@@ -57,7 +57,7 @@ PInvoke is part of the ECMA/ISO C# specification.
It is also better suited for robust production environments due to the Managed C++ flaw called the
<a href="http://msdn.microsoft.com/en-us/library/aa290048(VS.71).aspx">Mixed DLL Loading Problem</a>.
SWIG C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using
-<a href="http://www.mono-project.com/">Mono</a> and <a href="http://www.dotgnu.org/pnet.html">Portable.NET</a>.
+<a href="http://www.mono-project.com/Main_Page">Mono</a> and <a href="http://www.dotgnu.org/pnet.html">Portable.NET</a>.
</p>
<p>
@@ -575,7 +575,8 @@ marshalling for the arrays:
<pre>
[DllImport("example", EntryPoint="CSharp_myArrayCopy")]
public static extern void myArrayCopy([In, MarshalAs(UnmanagedType.LPArray)]int[] jarg1,
- [Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, int jarg3);
+ [Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2,
+ int jarg3);
</pre>
</div>
@@ -624,7 +625,8 @@ and intermediate class method
<pre>
[DllImport("example", EntryPoint="CSharp_myArraySwap")]
public static extern void myArraySwap([In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg1,
- [In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, int jarg3);
+ [In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2,
+ int jarg3);
</pre>
</div>
@@ -696,7 +698,8 @@ As a result, we get the following method in the module class:
fixed ( int *swig_ptrTo_sourceArray = sourceArray ) {
fixed ( int *swig_ptrTo_targetArray = targetArray ) {
{
- examplePINVOKE.myArrayCopy((IntPtr)swig_ptrTo_sourceArray, (IntPtr)swig_ptrTo_targetArray, nitems);
+ examplePINVOKE.myArrayCopy((IntPtr)swig_ptrTo_sourceArray, (IntPtr)swig_ptrTo_targetArray,
+ nitems);
}
}
}
@@ -2109,7 +2112,8 @@ public class example {
try {
examplePINVOKE.addYears(CDate.getCPtr(temppDate), years);
} finally {
- pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(), 0, 0, 0);
+ pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(),
+ 0, 0, 0);
}
}
...
@@ -2126,13 +2130,13 @@ The <tt>subtractYears</tt> method is nearly identical to the above <tt>addYears<
<div class="code">
<pre>
%typemap(csin,
- pre=" using (CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day)) {",
- post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
- " temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
- terminator=" } // terminate temp$csinput using block",
- cshin="ref $csinput"
- ) CDate *
- "$csclassname.getCPtr(temp$csinput)"
+ pre=" using (CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day)) {",
+ post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
+ " temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
+ terminator=" } // terminate temp$csinput using block",
+ cshin="ref $csinput"
+ ) CDate *
+ "$csclassname.getCPtr(temp$csinput)"
void subtractYears(CDate *pDate, int years) {
*pDate = CDate(pDate-&gt;getYear() - years, pDate-&gt;getMonth(), pDate-&gt;getDay());
@@ -2152,7 +2156,8 @@ public class example {
try {
examplePINVOKE.subtractYears(CDate.getCPtr(temppDate), years);
} finally {
- pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(), 0, 0, 0);
+ pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(),
+ 0, 0, 0);
}
} // terminate temppDate using block
}
diff --git a/Doc/Manual/Contents.html b/Doc/Manual/Contents.html
index 66bf412..a828fdd 100644
--- a/Doc/Manual/Contents.html
+++ b/Doc/Manual/Contents.html
@@ -5,7 +5,7 @@
<TITLE>SWIG Users Manual</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
-<H1>SWIG Users Manual</H1>
+<H1><a name="Contents"></a>SWIG Users Manual</H1>
<p>
@@ -152,6 +152,11 @@
<li><a href="SWIG.html#SWIG_nn26">Arrays</a>
<li><a href="SWIG.html#SWIG_readonly_variables">Creating read-only variables</a>
<li><a href="SWIG.html#SWIG_rename_ignore">Renaming and ignoring declarations</a>
+<ul>
+<li><a href="SWIG.html#SWIG_nn29">Simple renaming of specific identifiers</a>
+<li><a href="SWIG.html#SWIG_advanced_renaming">Advanced renaming support</a>
+<li><a href="SWIG.html#SWIG_limiting_renaming">Limiting global renaming rules</a>
+</ul>
<li><a href="SWIG.html#SWIG_default_args">Default/optional arguments</a>
<li><a href="SWIG.html#SWIG_nn30">Pointers to functions and callbacks</a>
</ul>
@@ -489,7 +494,7 @@
<li><a href="Warnings.html#Warnings_nn12">C/C++ Parser (300-399)</a>
<li><a href="Warnings.html#Warnings_nn13">Types and typemaps (400-499) </a>
<li><a href="Warnings.html#Warnings_nn14">Code generation (500-599)</a>
-<li><a href="Warnings.html#Warnings_nn15">Language module specific (800-899) </a>
+<li><a href="Warnings.html#Warnings_nn15">Language module specific (700-899) </a>
<li><a href="Warnings.html#Warnings_nn16">User defined (900-999)</a>
</ul>
<li><a href="Warnings.html#Warnings_nn17">History</a>
@@ -701,7 +706,40 @@
</div>
<!-- INDEX -->
-<h3><a href="Go.html#Go">20 SWIG and Go</a></h3>
+<h3><a href="D.html#D">20 SWIG and D</a></h3>
+
+<!-- INDEX -->
+<div class="sectiontoc">
+<ul>
+<li><a href="D.html#D_introduction">Introduction</a>
+<li><a href="D.html#D_command_line_invocation">Command line invocation</a>
+<li><a href="D.html#D_typemaps">Typemaps</a>
+<ul>
+<li><a href="D.html#D_typemap_name_comparison">C# &lt;-&gt; D name comparison</a>
+<li><a href="D.html#D_ctype_imtype_dtype">ctype, imtype, dtype</a>
+<li><a href="D.html#D_in_out_directorin_direcetorout">in, out, directorin, directorout</a>
+<li><a href="D.html#D_din_dout_ddirectorin_ddirectorout">din, dout, ddirectorin, ddirectorout</a>
+<li><a href="D.html#D_typecheck_typemaps">typecheck typemaps</a>
+<li><a href="D.html#D_code_injection_typemaps">Code injection typemaps</a>
+<li><a href="D.html#D_special_variables">Special variable macros</a>
+</ul>
+<li><a href="D.html#D_features"><tt>%feature</tt>s</a>
+<li><a href="D.html#D_pragmas">Pragmas</a>
+<li><a href="D.html#D_exceptions">D Exceptions</a>
+<li><a href="D.html#D_directors">D Directors</a>
+<li><a href="D.html#D_other_features">Other features</a>
+<ul>
+<li><a href="D.html#D_native_pointer_support">Native pointer support</a>
+<li><a href="D.html#D_operator_overloading">Operator overloading</a>
+<li><a href="D.html#D_test_suite">Running the test-suite</a>
+</ul>
+<li><a href="D.html#D_typemap_examples">D Typemap examples</a>
+<li><a href="D.html#D_planned_features">Work in progress and planned features</a>
+</ul>
+</div>
+<!-- INDEX -->
+
+<h3><a href="Go.html#Go">21 SWIG and Go</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -730,7 +768,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Guile.html#Guile">21 SWIG and Guile</a></h3>
+<h3><a href="Guile.html#Guile">22 SWIG and Guile</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -765,7 +803,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Java.html#Java">22 SWIG and Java</a></h3>
+<h3><a href="Java.html#Java">23 SWIG and Java</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -907,7 +945,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Lisp.html#Lisp">23 SWIG and Common Lisp</a></h3>
+<h3><a href="Lisp.html#Lisp">24 SWIG and Common Lisp</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -930,7 +968,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Lua.html#Lua">24 SWIG and Lua</a></h3>
+<h3><a href="Lua.html#Lua">25 SWIG and Lua</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -987,7 +1025,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Modula3.html#Modula3">25 SWIG and Modula-3</a></h3>
+<h3><a href="Modula3.html#Modula3">26 SWIG and Modula-3</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1025,7 +1063,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Mzscheme.html#Mzscheme">26 SWIG and MzScheme</a></h3>
+<h3><a href="Mzscheme.html#Mzscheme">27 SWIG and MzScheme</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1035,7 +1073,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Ocaml.html#Ocaml">27 SWIG and Ocaml</a></h3>
+<h3><a href="Ocaml.html#Ocaml">28 SWIG and Ocaml</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1086,7 +1124,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Octave.html#Octave">28 SWIG and Octave</a></h3>
+<h3><a href="Octave.html#Octave">29 SWIG and Octave</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1121,7 +1159,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Perl5.html#Perl5">29 SWIG and Perl5</a></h3>
+<h3><a href="Perl5.html#Perl5">30 SWIG and Perl5</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1188,7 +1226,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Php.html#Php">30 SWIG and PHP</a></h3>
+<h3><a href="Php.html#Php">31 SWIG and PHP</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1228,7 +1266,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Pike.html#Pike">31 SWIG and Pike</a></h3>
+<h3><a href="Pike.html#Pike">32 SWIG and Pike</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1252,7 +1290,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Python.html#Python">32 SWIG and Python</a></h3>
+<h3><a href="Python.html#Python">33 SWIG and Python</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1355,7 +1393,23 @@
</div>
<!-- INDEX -->
-<h3><a href="Ruby.html#Ruby">33 SWIG and Ruby</a></h3>
+<h3><a href="R.html#R">34 SWIG and R</a></h3>
+
+<!-- INDEX -->
+<div class="sectiontoc">
+<ul>
+<li><a href="R.html#R_nn2">Bugs</a>
+<li><a href="R.html#R_nn3">Using R and SWIG</a>
+<li><a href="R.html#R_nn4">Precompiling large R files</a>
+<li><a href="R.html#R_nn5">General policy</a>
+<li><a href="R.html#R_language_conventions">Language conventions</a>
+<li><a href="R.html#R_nn6">C++ classes</a>
+<li><a href="R.html#R_nn7">Enumerations</a>
+</ul>
+</div>
+<!-- INDEX -->
+
+<h3><a href="Ruby.html#Ruby">35 SWIG and Ruby</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1489,7 +1543,7 @@
</div>
<!-- INDEX -->
-<h3><a href="Tcl.html#Tcl">34 SWIG and Tcl</a></h3>
+<h3><a href="Tcl.html#Tcl">36 SWIG and Tcl</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@@ -1555,23 +1609,7 @@
</div>
<!-- INDEX -->
-<h3><a href="R.html#R">35 SWIG and R</a></h3>
-
-<!-- INDEX -->
-<div class="sectiontoc">
-<ul>
-<li><a href="R.html#R_nn2">Bugs</a>
-<li><a href="R.html#R_nn3">Using R and SWIG</a>
-<li><a href="R.html#R_nn4">Precompiling large R files</a>
-<li><a href="R.html#R_nn5">General policy</a>
-<li><a href="R.html#R_language_conventions">Language conventions</a>
-<li><a href="R.html#R_nn6">C++ classes</a>
-<li><a href="R.html#R_nn7">Enumerations</a>
-</ul>
-</div>
-<!-- INDEX -->
-
-<h3><a href="Extending.html#Extending">36 Extending SWIG to support new languages</a></h3>
+<h3><a href="Extending.html#Extending">37 Extending SWIG to support new languages</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
diff --git a/Doc/Manual/D.html b/Doc/Manual/D.html
new file mode 100644
index 0000000..6f65db1
--- /dev/null
+++ b/Doc/Manual/D.html
@@ -0,0 +1,444 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>SWIG and D</title>
+<link rel="stylesheet" type="text/css" href="style.css">
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+<body bgcolor="#FFFFFF">
+<H1><a name="D"></a>20 SWIG and D</H1>
+<!-- INDEX -->
+<div class="sectiontoc">
+<ul>
+<li><a href="#D_introduction">Introduction</a>
+<li><a href="#D_command_line_invocation">Command line invocation</a>
+<li><a href="#D_typemaps">Typemaps</a>
+<ul>
+<li><a href="#D_typemap_name_comparison">C# &lt;-&gt; D name comparison</a>
+<li><a href="#D_ctype_imtype_dtype">ctype, imtype, dtype</a>
+<li><a href="#D_in_out_directorin_direcetorout">in, out, directorin, directorout</a>
+<li><a href="#D_din_dout_ddirectorin_ddirectorout">din, dout, ddirectorin, ddirectorout</a>
+<li><a href="#D_typecheck_typemaps">typecheck typemaps</a>
+<li><a href="#D_code_injection_typemaps">Code injection typemaps</a>
+<li><a href="#D_special_variables">Special variable macros</a>
+</ul>
+<li><a href="#D_features"><tt>%feature</tt>s</a>
+<li><a href="#D_pragmas">Pragmas</a>
+<li><a href="#D_exceptions">D Exceptions</a>
+<li><a href="#D_directors">D Directors</a>
+<li><a href="#D_other_features">Other features</a>
+<ul>
+<li><a href="#D_native_pointer_support">Native pointer support</a>
+<li><a href="#D_operator_overloading">Operator overloading</a>
+<li><a href="#D_test_suite">Running the test-suite</a>
+</ul>
+<li><a href="#D_typemap_examples">D Typemap examples</a>
+<li><a href="#D_planned_features">Work in progress and planned features</a>
+</ul>
+</div>
+<!-- INDEX -->
+
+
+
+<H2><a name="D_introduction"></a>20.1 Introduction</H2>
+
+
+<p>From the <a href="http://www.digitalmars.com/d/">D Programming Language</a> web site: <em>»D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. [...] The D language is statically typed and compiles directly to machine code.«</em> As such, it is not very surprising that D is able to directly <a href="http://www.digitalmars.com/d/1.0/interfaceToC.html">interface with C libraries</a>. Why would a SWIG module for D be needed then in the first place?</p>
+
+<p>Well, besides the obvious downside that the C header files have to be manually converted to D modules for this to work, there is one major inconvenience with this approach: D code usually is on a higher abstraction level than C, and many of the features that make D interesting are simply not available when dealing with C libraries, requiring you e.g. to manually convert strings between pointers to <tt>\0</tt>-terminated char arrays and D char arrays, making the algorithms from the D2 standard library unusable with C arrays and data structures, and so on.</p>
+
+<p>While these issues can be worked around relatively easy by hand-coding a thin wrapper layer around the C library in question, there is another issue where writing wrapper code per hand is not feasible: C++ libraries. D did not support interfacing to C++ in version 1 at all, and even if <tt>extern(C++)</tt> has been added to D2, the support is still very limited, and a custom wrapper layer is still required in many cases. </p>
+
+<p>To help addressing these issues, the SWIG C# module has been forked to support D. Is has evolved quite a lot since then, but there are still many similarities, so if you do not find what you are looking for on this page, it might be worth having a look at the chapter on <a href="CSharp.html">C#</a> (and also on <a href="Java.html">Java</a>, since the C# module was in turn forked from it).</p>
+
+
+<H2><a name="D_command_line_invocation"></a>20.2 Command line invocation</H2>
+
+
+<p>To activate the D module, pass the <tt>-d</tt> option to SWIG at the command line. The same standard command line switches as with any other language module are available, plus the following D specific ones:</p>
+
+<dl>
+ <dt><tt>-d2</tt></dt>
+ <dd>
+ <p>By default, SWIG generates code for D1/Tango. Use the <tt>-d2</tt> flag to target D2/Phobos instead.</p>
+ </dd>
+
+ <dt id="D_splitproxy"><tt>-splitproxy</tt></dt>
+ <dd>
+ <p>By default, SWIG generates two D modules: the <em>proxy</em> module, named like the source module (either specified via the <tt>%module</tt> directive or via the <tt>module</tt> command line switch), which contains all the proxy classes, functions, enums, etc., and the <em>intermediary</em> module (named like the proxy module, but suffixed with <tt>_im</tt>), which contains all the <tt>extern(C)</tt> function declarations and other private parts only used internally by the proxy module.</p>
+ <p>If the split proxy mode is enabled by passing this switch at the command line, all proxy classes and enums are emitted to their own D module instead. The main proxy module only contains free functions and constants in this case.</p>
+ </dd>
+
+ <dt><tt>-package &lt;pkg&gt;</tt></dt>
+ <dd>
+ <p>By default, the proxy D modules and the intermediary D module are written to the root package. Using this option, you can specify another target package instead.</p>
+ </dd>
+
+ <dt><tt>-wrapperlibrary &lt;wl&gt;</tt></dt>
+ <dd>
+ <p>The code SWIG generates to dynamically load the C/C++ wrapper layer looks for a library called <tt>$module_wrap</tt> by default. With this switch, you can override the name of the file the wrapper code loads at runtime (the <tt>lib</tt> prefix and the suffix for shared libraries are appended automatically, depending on the OS).</p>
+ <p>This might especially be useful if you want to invoke SWIG several times on separate modules, but compile the resulting code into a single shared library.</p>
+ </dd>
+</dl>
+
+
+<H2><a name="D_typemaps"></a>20.3 Typemaps</H2>
+
+
+<H3><a name="D_typemap_name_comparison"></a>20.3.1 C# &lt;-&gt; D name comparison</H3>
+
+
+<p>If you already know the SWIG C# module, you might find the following name comparison table useful:</p>
+
+<div class="diagram"><pre>
+ ctype &lt;-&gt; ctype
+ imtype &lt;-&gt; imtype
+ cstype &lt;-&gt; dtype
+ csin &lt;-&gt; din
+ csout &lt;-&gt; dout
+ csdirectorin &lt;-&gt; ddirectorin
+ csdirectorout &lt;-&gt; ddirectorout
+ csinterfaces &lt;-&gt; dinterfaces
+ csinterfaces_derived &lt;-&gt; dinterfaces_derived
+ csbase &lt;-&gt; dbase
+ csclassmodifiers &lt;-&gt; dclassmodifiers
+ cscode &lt;-&gt; dcode
+ csimports &lt;-&gt; dimports
+ csbody &lt;-&gt; dbody
+ csfinalize &lt;-&gt; ddestructor
+ csdestruct &lt;-&gt; ddispose
+ csdestruct_derived &lt;-&gt; ddispose_derived
+</pre></div>
+
+
+<H3><a name="D_ctype_imtype_dtype"></a>20.3.2 ctype, imtype, dtype</H3>
+
+
+<p>Mapping of types between the C/C++ library, the C/C++ library wrapper exposing the C functions, the D wrapper module importing these functions and the D proxy code.</p>
+
+<p>The <tt>ctype</tt> typemap is used to determine the types to use in the C wrapper functions. The types from the <tt>imtype</tt> typemap are used in the extern(C) declarations of these functions in the intermediary D module. The <tt>dtype</tt> typemap contains the D types used in the D proxy module/class.</p>
+
+
+<H3><a name="D_in_out_directorin_direcetorout"></a>20.3.3 in, out, directorin, directorout</H3>
+
+
+<p>Used for converting between the types for C/C++ and D when generating the code for the wrapper functions (on the C++ side).</p>
+
+<p>The code from the <tt>in</tt> typemap is used to convert arguments to the C wrapper function to the type used in the wrapped code (<tt>ctype</tt>->original C++ type), the <tt>out</tt> typemap is utilized to convert values from the wrapped code to wrapper function return types (original C++ type-><tt>ctype</tt>).</p>
+
+<p>The <tt>directorin</tt> typemap is used to convert parameters to the type used in the D director callback function, its return value is processed by <tt>directorout</tt> (see below).</p>
+
+
+<H3><a name="D_din_dout_ddirectorin_ddirectorout"></a>20.3.4 din, dout, ddirectorin, ddirectorout</H3>
+
+
+<p>Typemaps for code generation in D proxy and type wrapper classes.</p>
+
+<p id="D_din">The <tt>din</tt> typemap is used for converting function parameter types from the type used in the proxy module or class to the type used in the intermediary D module (the <a href="D.html#D_dinput"><tt>$dinput</tt></a> macro is replaced). To inject further parameter processing code before or after the call to the intermediary layer, the <tt>pre</tt>, <tt>post</tt> and <tt>terminator</tt> attributes can be used (please refer to the <a href="CSharp.html#CSharp_date_marshalling">C# date marshalling example</a> for more information on these).</p>
+
+<p id="D_dout">The <tt>dout</tt> typemap is used for converting function return values from the return type used in the intermediary D module to the type returned by the proxy function. The <tt>$excode</tt> special variable in <tt>dout</tt> typemaps is replaced by the <tt>excode</tt> typemap attribute code if the method can throw any exceptions from unmanaged code, otherwise by nothing (the <a href="D.html#D_imcall"><tt>$imcall</tt> and <tt>$owner</tt></a> macros are replaced).</p>
+
+<p id="D_ddirectorinout">The code from the <tt>ddirectorin</tt> and <tt>ddirectorout</tt> typemaps is used for conversion in director callback functions. Arguments are converted to the type used in the proxy class method they are calling by using the code from <tt>ddirectorin</tt>, the proxy class method return value is converted to the type the C++ code expects via the <tt>ddirectorout</tt> typemap (the <a href="D.html#D_dpcall"><tt>$dcall</tt> and <tt>$winput</tt></a> macros are replaced).</p>
+
+<p>The full chain of type conversions when a director callback is invoked looks like this:</p>
+
+ <div class="diagram"><pre>
+ type CPPClass::method(type a)
+ &uarr; &darr;
+ &lt;directorout&gt; &lt;directorin&gt;
+ &uarr; &darr;
+ ctype methodCallback(ctype a) C++
+ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ imtype methodCallback(imtype a) D
+ &uarr; &darr;
+ &lt;ddirectorout&gt; &lt;ddirectorin&gt;
+ &uarr; &darr;
+ dtype DClass.method(dtype a)</pre></div>
+
+
+<H3><a name="D_typecheck_typemaps"></a>20.3.5 typecheck typemaps</H3>
+
+
+<p>Because, unlike many scripting languages supported by SWIG, D does not need any dynamic dispatch helper to access an overloaded function, the purpose of these is merely to issue a warning for overloaded C++ functions that cannot be overloaded in D (as more than one C++ type maps to a single D type).</p>
+
+
+<H3><a name="D_code_injection_typemaps"></a>20.3.6 Code injection typemaps</H3>
+
+
+<p>These typemaps are used for generating the skeleton of proxy classes for C++ types.</p>
+
+<p>By overriding <tt>dbase</tt>, <tt>dinterfaces</tt> or <tt>dinterfaces_derived</tt>, the inheritance chain of the generated proxy class for a type can be modified. <tt>dclassmodifiers</tt> allows you to add any custom modifiers around the class keyword.</p>
+
+<p>Using <tt>dcode</tt> and <tt>dimports</tt>, you can specify additional D code which will be emitted into the class body respectively the imports section of the D module the class is written to.</p>
+
+<p id="D_class_code_typemaps"><tt>dconstructor</tt>, <tt>ddestructor</tt>, <tt>ddispose</tt> and <tt>ddispose_derived</tt> are used to generate the class constructor, destructor and <tt>dispose()</tt> method, respectively. The auxiliary code for handling the pointer to the C++ object is stored in <tt>dbody</tt> and <tt>dbody_derived</tt>. You can override them for specific types.</p>
+
+
+<H3><a name="D_special_variables"></a>20.3.7 Special variable macros</H3>
+
+
+<p>The standard SWIG special variables are available for use within typemaps as described in the <a href="Typemaps.html#Typemaps">Typemaps documentation</a>, for example <tt>$1</tt>, <tt>$input</tt>, <tt>$result</tt> etc.</p>
+
+<p>When generating D wrappers, a few additional macros are available:</p>
+<dl>
+ <dt><tt>$dclassname</tt> (C#: <tt>$csclassname</tt>)</dt>
+ <dd>
+ <p>This special variable works similar to <a href="Typemaps.html#Typemaps_special_variables"><tt>$n_type</tt></a> in that it returns the name of a type - it expands to the D proxy class name of the type being wrapped. If the type does not have an associated proxy class, it expands to the type wrapper class name, for example, <tt>SWIGTYPE_p_p_SomeCppClass</tt> is generated when wrapping <tt>SomeCppClass **</tt>.</p>
+ <p>There are two other variants available, <tt>$&amp;dclassname</tt> and <tt>$*dclassname</tt>. The former adds a level of indirection, while the latter removes one. For instance, when wrapping <tt>Foo **</tt>, <tt>$*dclassname</tt> would be replaced by the proxy class name corresponding to <tt>Foo *</tt>.</p>
+ </dd>
+
+ <dt><tt>$null</tt></dt>
+ <dd><p>In code inserted into the generated C/C++ wrapper functions, this variable is replaced by either <tt>0</tt> or nothing at all, depending on whether the function has a return value or not. It can be used to bail out early e.g. in case of errors (<tt>return $null;</tt>).</p></dd>
+
+ <dt id="D_dinput"><tt>$dinput</tt> (C#: <tt>$csinput</tt>)</dt>
+ <dd>
+ <p>This variable is used in <tt><a href="D.html#D_din">din</a></tt> typemaps and is replaced by the expression which is to be passed to C/C++.</p>
+ <p>For example, this input</p>
+ <div class="code"><pre>
+%typemap(din) SomeClass * "SomeClass.getCPointer($dinput)"
+
+%inline %{
+ class SomeClass {};
+ void foo(SomeClass *arg);
+%}</pre></div>
+ <p>leads to the following D proxy code being generated:</p>
+<div class="targetlang"><pre>
+void foo(SomeClass arg) {
+ example_im.foo(SomeClass.getCPointer(arg));
+}</pre></div></dd>
+
+ <dt id="D_imcall"><tt>$imcall</tt> and <tt>$owner</tt> (C#: <tt>$imcall</tt>)</dt>
+ <dd>
+ <p>These variables are used in <tt><a href="D.html#D_dout">dout</a></tt> typemaps. <tt>$imcall</tt> contains the call to the intermediary module which provides the value to be used, and <tt>$owner</tt> signals if the caller is responsible for managing the object lifetime (that is, if the called method is a constructor or has been marked via <tt>%newobject</tt>).</p>
+ <p>Consider the following example:</p>
+<div class="code"><pre>
+%typemap(dout) SomeClass * {
+ return new SomeClass($imcall, $owner);
+}
+
+%inline %{
+ class SomeClass;
+ SomeClass *foo();
+
+ %newobject bar();
+ SomeClass *bar();
+%}</pre></div>
+ <p>The code generated for <tt>foo()</tt> and <tt>bar()</tt> looks like this:</p>
+<div class="targetlang"><pre>
+SomeClass foo() {
+ return new SomeClass(example_im.foo(), false);
+}
+
+SomeClass bar() {
+ return new SomeClass(example_im.bar(), true);
+}
+</pre></div>
+ </dd>
+
+ <dt><tt>$dcall</tt> and <tt>$winput</tt> (C#: <tt>$cscall</tt>, <tt>$iminput</tt>)</dt>
+ <dd id="D_dpcall"><p>These variables are used in the director-specific typemaps <a href="D.html#D_ddirectorinout"><tt>ddirectorin</tt></a> and <a href="D.html#D_ddirectorinout"><tt>ddirectorout</tt></a>. They are more or less the reverse of the <tt>$imcall</tt> and <tt>$dinput</tt> macros: <tt>$dcall</tt> contains the invocation of the D proxy method of which the return value is to be passed back to C++, <tt>$winput</tt> contains the parameter value from C++.</p></dd>
+
+ <dt><tt>$excode</tt></dt>
+ <dd><p>This variable is used in <tt>dout</tt> and <tt>dconstructor</tt> typemaps and is filled with the contents of the <tt>excode</tt> typemap attribute if an exception could be thrown from the C++ side. See the <a href="CSharp.html#CSharp_exceptions">C# documentation</a> for details.</p></dd>
+
+ <dt><tt>$dbaseclass</tt></dt>
+ <dd><p>Currently for internal use only, it contains the D name of the C++ base class (if any) inside proxy classes.</p></dd>
+
+ <dt><tt>$directorconnect</tt></dt>
+ <dd>
+ <p>This macro is only valid inside the <tt><a href="D.html#D_class_code_typemaps">dconstructor</a></tt> typemap and contains the value of the <tt>dconstructor</tt> typemap attribute if the currently wrapped class has directors enabled.</p>
+ <p>This is how the default <tt>dconstructor</tt> typemap looks like (you usually do not want to specify a custom one):</p>
+<div class="code"><pre>
+%typemap(dconstructor, excode=SWIGEXCODE,
+ directorconnect="\n swigDirectorConnect();") SWIGTYPE {
+ this($imcall, true);$excode$directorconnect
+}
+</pre></div>
+ </dd>
+
+ <dt id="D_importtype"><tt>$importtype(SomeDType)</tt></dt>
+ <dd>
+ <p>This macro is used in the <tt>dimports</tt> typemap if a dependency on another D type generated by SWIG is added by a custom typemap.</p>
+ <p>Consider the following code snippet:</p>
+<div class="code"><pre>
+%typemap(dinterfaces) SomeClass "AnInterface, AnotherInterface";
+</pre></div>
+ <p>This causes SWIG to add <tt>AnInterface</tt> and <tt>AnotherInterface</tt> to the base class list of <tt>SomeClass</tt>:</p>
+<div class="targetlang"><pre>
+class SomeClass : AnInterface, AnotherInterface {
+ ...
+}
+</pre></div>
+ <p>For this to work, <tt>AnInterface</tt> and <tt>AnotherInterface</tt> have to be in scope. If SWIG is not in split proxy mode, this is already the case, but it it is, they have to be added to the import list via the <tt>dimports</tt> typemap. Additionally, the import statement depends on the package SWIG is configured to emit the modules to.</p>
+ <p>The <tt>$importtype</tt> macro helps you to elegantly solve this problem:</p>
+<div class="code"><pre>
+%typemap(dimports) RemoteMpe %{
+$importtype(AnInterface)
+$importtype(AnotherInterface)
+%}
+</pre></div>
+ <p>If SWIG is in split proxy mode, it expands to an <tt>import</tt> statement for the specified type, to nothing if not.</p>
+ </dd>
+
+ <dt><tt>$module</tt></dt>
+ <dd><p>Expands to the name of the main proxy D module.</p></dd>
+
+ <dt><tt>$imdmodule</tt></dt>
+ <dd><p>Contains the fully qualified name of the intermediary D module.</p></dd>
+</dl>
+
+
+<H2><a name="D_features"></a>20.4 <tt>%feature</tt>s</H2>
+
+
+<p>The D module defines a number of directives which modify the <a href="Customization.html#Customization_features">SWIG features</a> set globally or for a specific declaration:</p>
+
+
+<dl>
+ <dt><tt>%dmanifestconst</tt> and <tt>%dconstvalue(value)</tt></dt>
+ <dd>
+ <p>Out of the box, SWIG generates accessor methods for C <tt>#defines</tt> and C++ constants. The <tt>%dmanifestconst</tt> directive enables wrapping these constants as D manifest constants (<tt>const</tt> in D1, <tt>enum</tt> in D2).</p>
+ <p>For this to work, the C/C++ code for the constant value must directly compile as D code, though. If this is not the case, you can manually override the expression written to the D proxy module using the <tt>%dconstvalue</tt> directive, passing the new value as parameter.</p>
+ <p>For <tt>enum</tt>s, again <tt>%dconstvalue</tt> can be used to override the value of an enum item if the initializer should not compile in D.</p>
+ </dd>
+
+ <dt><tt>%dmethodmodifiers</tt></dt>
+ <dd>
+ <p>This directive can be used to override the modifiers for a proxy function. For instance, you could make a <tt>public</tt> C++ member function <tt>private</tt> in D like this:</p>
+<div class="code"><pre>
+%dmethodmodifiers A::foo "private";
+
+%inline %{
+struct A {
+ void foo();
+};
+%}
+</pre></div>
+ </dd>
+</dl>
+
+
+<H2><a name="D_pragmas"></a>20.5 Pragmas</H2>
+
+
+<p>There are a few SWIG pragmas specific to the D module, which you can use to influence the D code SWIG generates:</p>
+
+<dl>
+ <dt><tt>%pragma(d) imdmodulecode</tt></dt>
+ <dd><p>The passed text (D code) is copied verbatim to the intermediary D module. For example, it can be (and is, internally) used to emit additional private helper code for the use by proxy typemaps.</p></dd>
+
+ <dt><tt>%pragma(d) imdmoduleimports</tt></dt>
+ <dd><p>Additional code to be emitted to the imports section of the intermediary D module (the <a href="D.html#D_importtype">$importtype</a> macro can be used here). You probably want to use this in conjunction with the <tt>imdmodulecode</tt> pragma.</p></dd>
+
+ <dt><tt>%pragma(d) proxydmodulecode</tt></dt>
+ <dd><p>Just like <tt>proxydmodulecode</tt>, the argument is copied to the proxy D module (if SWIG is in <a href="D.html#D_splitproxy">split proxy mode</a>, it is emitted to the main proxy D module only).</p></dd>
+
+ <dt><tt>%pragma(d) globalproxyimports</tt></dt>
+ <dd>
+ <p>The D module currently does not support specifying dependencies on external modules (e.g. from the standard library) for the D typemaps. To add the import statements to the proxy modules (resp. to <em>all</em> proxy modules if in split proxy mode), you can use the <tt>globalproxyimports</tt> directive.</p>
+ <p>For example:</p>
+<div class="code"><pre>
+%typemap(din) char[] "($dinput ? tango.stdc.stringz.toStringz($dinput) : null)"
+%pragma(d) globalproxyimports = "static import tango.stdc.stringz;";
+</pre></div>
+ </dd>
+
+ <dt><tt>%pragma(d) wrapperloadercode</tt></dt>
+ <dd>
+ <p>The D code for loading the wrapper library (it is copied to the intermediary D module). The <tt>$wrapperloaderbindcode</tt> variable is replaced by the list of commands for binding the functions from the wrapper library to the symbols in the intermediary D module.</p>
+ <p>Each time this pragma is specified, the previous value is overwritten.</p>
+ </dd>
+
+ <dt><tt>%pragma(d) wrapperloaderbindcommand</tt></dt>
+ <dd>
+ <p>The D command to use for binding the wrapper functions from the C/C++ library to the symbols in the intermediary D module. The <tt>$function</tt> variable contains the name of the D function in the wrap module, the <tt>$symbol</tt> variable is replaced by the name of the symbol in the library.</p>
+ <p>Each time this pragma is specified, the previous value is overwritten.</p>
+ </dd>
+</dl>
+
+
+<H2><a name="D_exceptions"></a>20.6 D Exceptions</H2>
+
+
+<p>Out of the box, C++ exceptions are fundamentally incompatible to their equivalent in the D world and cannot simply be propagated to a calling D method. There is, however, an easy way to solve this problem: Just catch the exception in the C/C++ wrapper layer, pass the contents to D, and make the wrapper code rethrow the exception in the D world.</p>
+
+<p>The implementation details of this are a bit crude, but the SWIG D module automatically takes care of this, as long as it is able to detect that an exception could potentially be thrown (e.g. because the C++ method has a <tt>throw(...)</tt> exception specification).</p>
+
+<p>As this feature is implemented in exactly the same way it is for C#, please see the <a href="CSharp.html#CSharp_exceptions">C# documentation</a> for a more detailed explanation.</p>
+
+
+<H2><a name="D_directors"></a>20.7 D Directors</H2>
+
+
+<p>When the directors feature is activated, SWIG generates extra code on both the C++ and the D side to enable cross-language polymorphism. Essentially, this means that if you subclass a proxy class in D, C++ code can access any overridden virtual methods just as if you created a derived class in C++.</p>
+
+<p>There is no D specific documentation yet, but the way the feature is implemented is very similar to how it is done in <a href="Java.html#Java_directors">Java</a> and <a href="CSharp.html#CSharp_directors">C#</a>.
+</p>
+
+
+<H2><a name="D_other_features"></a>20.8 Other features</H2>
+
+
+<p>The <a href="SWIGPlus.html#SWIGPlus_nspace"><tt>nspace</tt></a> feature of SWIG is not yet supported for D - all class modules are written to the same package, regardless of which C++ namespace they are in.</p>
+
+
+<H3><a name="D_native_pointer_support"></a>20.8.1 Native pointer support</H3>
+
+
+<p>Contrary to many of the scripting languages supported by SWIG, D fully supports C-style pointers. The D module thus includes a custom mechanism to wrap C pointers directly as D pointers where applicable, that is, if the type that is pointed to is represented the same in C and D (on the bit-level), dubbed a »primtive type« below.</p>
+
+<p>Central to this custom pointer handling scheme are two typemap attributes: the <tt>cprimitive</tt> attribute on the <tt>dtype</tt> typemap and the <tt>nativepointer</tt> attribute on all the typemaps which influence the D side of the code (<tt>dtype</tt>, <tt>din</tt>, <tt>dout</tt>, ...). When a D typemap is looked up, the following happens behind the scenes:</p>
+
+<p>First, the matching typemap is determined by the usual typemap lookup rules. Then, it is checked if the result has the <tt>nativepointer</tt> attribute set. If it is present, it means that its value should replace the typemap value <em>if and only if</em> the actual type the typemap is looked up for is a primitive type, a pointer to a primitive type (through an arbitrary level of indirections), or a function pointer with only primitive types in its signature.</p>
+
+<p>To determine if a type should be considered primitive, the <tt>cprimitive</tt> attribute on its <tt>dtype</tt> attribute is used. For example, the <tt>dtype</tt> typemap for <tt>float</tt> has <tt>cprimitive="1"</tt>, so the code from the <tt>nativepointer</tt> attribute is taken into account e.g. for <tt>float **</tt> or the function pointer <tt>float (*)(float *)</tt>.</p>
+
+
+<H3><a name="D_operator_overloading"></a>20.8.2 Operator overloading</H3>
+
+
+<p>The D module comes with basic operator overloading support for both D1 and D2. There are, however, a few limitations arising from conceptual differences between C++ and D:</p>
+
+<p>The first key difference is that C++ supports free functions as operators (along with argument-dependent lookup), while D requires operators to be member functions of the class they are operating on. SWIG can only automatically generate wrapping code for member function operators; if you want to use operators defined as free functions in D, you need to handle them manually.</p>
+
+<p>Another set of differences between C++ and D concerns individual operators. For example, there are quite a few operators which are overloadable in C++, but not in D, for example <tt>&amp;&amp;</tt> and <tt>||</tt>, but also <tt>!</tt>, and prefix increment/decrement operators in <a href="http://www.digitalmars.com/d/1.0/operatoroverloading.html">D1</a> resp. their postfix pendants in <a href="http://www.digitalmars.com/d/2.0/operatoroverloading.html">D2</a>.</p>
+
+<p>There are also some cases where the operators can be translated to D, but the differences in the implementation details are big enough that a rather involved scheme would be required for automatic wrapping them, which has not been implemented yet. This affects, for example, the array subscript operator, <tt>[]</tt>, in combination with assignments - while <tt>operator []</tt> in C++ simply returns a reference which is then written to, D resorts to a separate <tt>opIndexAssign</tt> method -, or implicit casting (which was introduced in D2 via <tt>alias this</tt>). Despite the lack of automatic support, manually handling these cases should be perfectly possible.</p>
+
+
+<H3><a name="D_test_suite"></a>20.8.3 Running the test-suite</H3>
+
+
+<p>As with any other language, the SWIG test-suite can be built for D using the <tt>*-d-test-suite</tt> targets of the top-level Makefile. By default, D1 is targeted, to build it with D2, use the optional <tt>D_VERSION</tt> variable, e.g. <tt>make check-d-test-suite D_VERSION=2</tt>.</p>
+
+<p>Note: If you want to use GDC on Linux or another platform which requires you to link <tt>libdl</tt> for dynamically loading the shared library, you might have to add <tt>-ldl</tt> manually to the <tt>d_compile</tt> target in <tt>Examples/Makefile</tt>, because GDC does not currently honor the <tt>pragma(lib,...)</tt> statement.</p>
+
+
+<H2><a name="D_typemap_examples"></a>20.9 D Typemap examples</H2>
+
+
+<p>There are no D-specific typemap examples yet. However, with the above <a href="D.html#D_typemap_name_comparison">name comparison table</a>, you should be able to get an idea what can be done by looking at the <a href="CSharp.html#CSharp_typemap_examples">corresponding C# section</a>.</p>
+
+
+
+<H2><a name="D_planned_features"></a>20.10 Work in progress and planned features</H2>
+
+
+<p>There are a couple of features which are not implemented yet, but would be very useful and might be added in the near future:</p>
+
+<ul>
+ <li><em>Static linking:</em> Currently, the C wrapper code is compiled into a dynamic library, out of which the symbol addresses are looked up at runtime by the D part. If statically linking the different languages into one binary was supported, a tool-chain capable of performing IPO at link time could inline the wrapping code, effectively reducing the overhead for simple calls to zero.</li>
+ <li><em>C array handling:</em> Many data structures in some C/C++ libraries contain array containing of a pointer to the first element and the element count. Currently, one must manually writing wrapper code to be able to access these from D. It should be possible to add a set of SWIG macros to semi-automatically generate conversion code.</li>
+</ul>
+
+<p>Some generated code might also be a bit rough around the edges, particularly in the following areas:</p>
+
+<ul>
+ <li><em>Memory management:</em> Although the currently generated wrapper code works fine with regard to the GC for the test-suite, there might be issues coming up in real-world multi-threaded usage.</li>
+ <li><em>D2 support</em>: Originally, the module has been developed for the use with D1, D2/Phobos support has been added in later. The basic features should work equally well for both, but there <em>could</em> be issues concerning const-correctness etc.</li>
+</ul>
+
+
+</body>
+</html>
+
diff --git a/Doc/Manual/Extending.html b/Doc/Manual/Extending.html
index c554d9f..c6e0060 100644
--- a/Doc/Manual/Extending.html
+++ b/Doc/Manual/Extending.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="Extending"></a>36 Extending SWIG to support new languages</H1>
+<H1><a name="Extending"></a>37 Extending SWIG to support new languages</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -75,7 +75,7 @@
-<H2><a name="Extending_nn2"></a>36.1 Introduction</H2>
+<H2><a name="Extending_nn2"></a>37.1 Introduction</H2>
<p>
@@ -91,7 +91,7 @@ Also, this chapter is not meant to be a hand-holding tutorial. As a starting po
you should probably look at one of SWIG's existing modules.
</p>
-<H2><a name="Extending_nn3"></a>36.2 Prerequisites</H2>
+<H2><a name="Extending_nn3"></a>37.2 Prerequisites</H2>
<p>
@@ -121,7 +121,7 @@ obvious, but almost all SWIG directives as well as the low-level generation of
wrapper code are driven by C++ datatypes.
</p>
-<H2><a name="Extending_nn4"></a>36.3 The Big Picture</H2>
+<H2><a name="Extending_nn4"></a>37.3 The Big Picture</H2>
<p>
@@ -158,7 +158,7 @@ role in making the system work. For example, both typemaps and declaration anno
based on pattern matching and interact heavily with the underlying type system.
</p>
-<H2><a name="Extending_nn5"></a>36.4 Execution Model</H2>
+<H2><a name="Extending_nn5"></a>37.4 Execution Model</H2>
<p>
@@ -203,7 +203,7 @@ latter stage of compilation.
The next few sections briefly describe some of these stages.
</p>
-<H3><a name="Extending_nn6"></a>36.4.1 Preprocessing</H3>
+<H3><a name="Extending_nn6"></a>37.4.1 Preprocessing</H3>
<p>
@@ -284,7 +284,7 @@ been expanded as well as everything else that goes into the low-level
construction of the wrapper code.
</p>
-<H3><a name="Extending_nn7"></a>36.4.2 Parsing</H3>
+<H3><a name="Extending_nn7"></a>37.4.2 Parsing</H3>
<p>
@@ -385,7 +385,7 @@ returning a <tt>foo</tt> and taking types <tt>a</tt> and <tt>b</tt> as
arguments).
</p>
-<H3><a name="Extending_nn8"></a>36.4.3 Parse Trees</H3>
+<H3><a name="Extending_nn8"></a>37.4.3 Parse Trees</H3>
<p>
@@ -640,7 +640,7 @@ $ swig -c++ -python -debug-module 4 example.i
</pre>
</div>
-<H3><a name="Extending_nn9"></a>36.4.4 Attribute namespaces</H3>
+<H3><a name="Extending_nn9"></a>37.4.4 Attribute namespaces</H3>
<p>
@@ -659,7 +659,7 @@ that matches the name of the target language. For example, <tt>python:foo</tt>
<tt>perl:foo</tt>.
</p>
-<H3><a name="Extending_nn10"></a>36.4.5 Symbol Tables</H3>
+<H3><a name="Extending_nn10"></a>37.4.5 Symbol Tables</H3>
<p>
@@ -750,7 +750,7 @@ example.i:5. Previous declaration is foo_i(int )
</pre>
</div>
-<H3><a name="Extending_nn11"></a>36.4.6 The %feature directive</H3>
+<H3><a name="Extending_nn11"></a>37.4.6 The %feature directive</H3>
<p>
@@ -806,7 +806,7 @@ For example, the exception code above is simply
stored without any modifications.
</p>
-<H3><a name="Extending_nn12"></a>36.4.7 Code Generation</H3>
+<H3><a name="Extending_nn12"></a>37.4.7 Code Generation</H3>
<p>
@@ -928,7 +928,7 @@ public :
The role of these functions is described shortly.
</p>
-<H3><a name="Extending_nn13"></a>36.4.8 SWIG and XML</H3>
+<H3><a name="Extending_nn13"></a>37.4.8 SWIG and XML</H3>
<p>
@@ -941,7 +941,7 @@ internal data structures, it may be useful to keep XML in the back of
your mind as a model.
</p>
-<H2><a name="Extending_nn14"></a>36.5 Primitive Data Structures</H2>
+<H2><a name="Extending_nn14"></a>37.5 Primitive Data Structures</H2>
<p>
@@ -987,7 +987,7 @@ typedef Hash Typetab;
</pre>
</div>
-<H3><a name="Extending_nn15"></a>36.5.1 Strings</H3>
+<H3><a name="Extending_nn15"></a>37.5.1 Strings</H3>
<p>
@@ -1128,7 +1128,7 @@ Returns the number of replacements made (if any).
</div>
-<H3><a name="Extending_nn16"></a>36.5.2 Hashes</H3>
+<H3><a name="Extending_nn16"></a>37.5.2 Hashes</H3>
<p>
@@ -1205,7 +1205,7 @@ Returns the list of hash table keys.
</div>
-<H3><a name="Extending_nn17"></a>36.5.3 Lists</H3>
+<H3><a name="Extending_nn17"></a>37.5.3 Lists</H3>
<p>
@@ -1294,7 +1294,7 @@ If <tt>t</tt> is not a standard object, it is assumed to be a <tt>char *</tt>
and is used to create a String object.
</div>
-<H3><a name="Extending_nn18"></a>36.5.4 Common operations</H3>
+<H3><a name="Extending_nn18"></a>37.5.4 Common operations</H3>
The following operations are applicable to all datatypes.
@@ -1349,7 +1349,7 @@ objects and report errors.
Gets the line number associated with <tt>x</tt>.
</div>
-<H3><a name="Extending_nn19"></a>36.5.5 Iterating over Lists and Hashes</H3>
+<H3><a name="Extending_nn19"></a>37.5.5 Iterating over Lists and Hashes</H3>
To iterate over the elements of a list or a hash table, the following functions are used:
@@ -1394,7 +1394,7 @@ for (j = First(j); j.item; j= Next(j)) {
</div>
-<H3><a name="Extending_nn20"></a>36.5.6 I/O</H3>
+<H3><a name="Extending_nn20"></a>37.5.6 I/O</H3>
Special I/O functions are used for all internal I/O. These operations
@@ -1531,7 +1531,7 @@ Similarly, the preprocessor and parser all operate on string-files.
</div>
-<H2><a name="Extending_nn21"></a>36.6 Navigating and manipulating parse trees</H2>
+<H2><a name="Extending_nn21"></a>37.6 Navigating and manipulating parse trees</H2>
Parse trees are built as collections of hash tables. Each node is a hash table in which
@@ -1665,7 +1665,7 @@ Deletes a node from the parse tree. Deletion reconnects siblings and properly u
the parent so that sibling nodes are unaffected.
</div>
-<H2><a name="Extending_nn22"></a>36.7 Working with attributes</H2>
+<H2><a name="Extending_nn22"></a>37.7 Working with attributes</H2>
<p>
@@ -1782,7 +1782,7 @@ the attribute is optional. <tt>Swig_restore()</tt> must always be called after
function.
</div>
-<H2><a name="Extending_nn23"></a>36.8 Type system</H2>
+<H2><a name="Extending_nn23"></a>37.8 Type system</H2>
<p>
@@ -1791,7 +1791,7 @@ pointers, references, and pointers to members. A detailed discussion of
type theory is impossible here. However, let's cover the highlights.
</p>
-<H3><a name="Extending_nn24"></a>36.8.1 String encoding of types</H3>
+<H3><a name="Extending_nn24"></a>37.8.1 String encoding of types</H3>
<p>
@@ -1892,7 +1892,7 @@ make the final type, the two parts are just joined together using
string concatenation.
</p>
-<H3><a name="Extending_nn25"></a>36.8.2 Type construction</H3>
+<H3><a name="Extending_nn25"></a>37.8.2 Type construction</H3>
<p>
@@ -2061,7 +2061,7 @@ Returns the prefix of a type. For example, if <tt>ty</tt> is
<tt>ty</tt> is unmodified.
</div>
-<H3><a name="Extending_nn26"></a>36.8.3 Type tests</H3>
+<H3><a name="Extending_nn26"></a>37.8.3 Type tests</H3>
<p>
@@ -2148,7 +2148,7 @@ Checks if <tt>ty</tt> is a varargs type.
Checks if <tt>ty</tt> is a templatized type.
</div>
-<H3><a name="Extending_nn27"></a>36.8.4 Typedef and inheritance</H3>
+<H3><a name="Extending_nn27"></a>37.8.4 Typedef and inheritance</H3>
<p>
@@ -2250,7 +2250,7 @@ Fully reduces <tt>ty</tt> according to typedef rules. Resulting datatype
will consist only of primitive typenames.
</div>
-<H3><a name="Extending_nn28"></a>36.8.5 Lvalues</H3>
+<H3><a name="Extending_nn28"></a>37.8.5 Lvalues</H3>
<p>
@@ -2287,7 +2287,7 @@ Literal y; // type = 'Literal', ltype='p.char'
</pre>
</div>
-<H3><a name="Extending_nn29"></a>36.8.6 Output functions</H3>
+<H3><a name="Extending_nn29"></a>37.8.6 Output functions</H3>
<p>
@@ -2349,7 +2349,7 @@ SWIG, but is most commonly associated with type-descriptor objects
that appear in wrappers (e.g., <tt>SWIGTYPE_p_double</tt>).
</div>
-<H2><a name="Extending_nn30"></a>36.9 Parameters</H2>
+<H2><a name="Extending_nn30"></a>37.9 Parameters</H2>
<p>
@@ -2448,7 +2448,7 @@ included. Used to emit prototypes.
Returns the number of required (non-optional) arguments in <tt>p</tt>.
</div>
-<H2><a name="Extending_nn31"></a>36.10 Writing a Language Module</H2>
+<H2><a name="Extending_nn31"></a>37.10 Writing a Language Module</H2>
<p>
@@ -2463,7 +2463,7 @@ describes the creation of a minimal Python module. You should be able to extra
this to other languages.
</p>
-<H3><a name="Extending_nn32"></a>36.10.1 Execution model</H3>
+<H3><a name="Extending_nn32"></a>37.10.1 Execution model</H3>
<p>
@@ -2473,7 +2473,7 @@ the parsing of command line options, all aspects of code generation are controll
different methods of the <tt>Language</tt> that must be defined by your module.
</p>
-<H3><a name="Extending_starting_out"></a>36.10.2 Starting out</H3>
+<H3><a name="Extending_starting_out"></a>37.10.2 Starting out</H3>
<p>
@@ -2581,7 +2581,7 @@ that activates your module. For example, <tt>swig -python foo.i</tt>. The
messages from your new module should appear.
</p>
-<H3><a name="Extending_nn34"></a>36.10.3 Command line options</H3>
+<H3><a name="Extending_nn34"></a>37.10.3 Command line options</H3>
<p>
@@ -2640,7 +2640,7 @@ to mark the option as valid. If you forget to do this, SWIG will terminate wit
unrecognized command line option error.
</p>
-<H3><a name="Extending_nn35"></a>36.10.4 Configuration and preprocessing</H3>
+<H3><a name="Extending_nn35"></a>37.10.4 Configuration and preprocessing</H3>
<p>
@@ -2689,7 +2689,7 @@ an implementation file <tt>python.cxx</tt> and a configuration file
<tt>python.swg</tt>.
</p>
-<H3><a name="Extending_nn36"></a>36.10.5 Entry point to code generation</H3>
+<H3><a name="Extending_nn36"></a>37.10.5 Entry point to code generation</H3>
<p>
@@ -2747,7 +2747,7 @@ int Python::top(Node *n) {
</pre>
</div>
-<H3><a name="Extending_nn37"></a>36.10.6 Module I/O and wrapper skeleton</H3>
+<H3><a name="Extending_nn37"></a>37.10.6 Module I/O and wrapper skeleton</H3>
<!-- please report bugs in this section to mgossage -->
@@ -2895,7 +2895,7 @@ functionWrapper : void Shape_y_set(Shape *self,double y)
</pre>
</div>
-<H3><a name="Extending_nn38"></a>36.10.7 Low-level code generators</H3>
+<H3><a name="Extending_nn38"></a>37.10.7 Low-level code generators</H3>
<!-- please report bugs in this section to mgossage -->
@@ -3049,7 +3049,7 @@ but without the typemaps, there is still work to do.
</p>
-<H3><a name="Extending_configuration_files"></a>36.10.8 Configuration files</H3>
+<H3><a name="Extending_configuration_files"></a>37.10.8 Configuration files</H3>
<!-- please report bugs in this section to ttn -->
@@ -3193,7 +3193,7 @@ politely displays the ignoring language message.
</dl>
-<H3><a name="Extending_nn40"></a>36.10.9 Runtime support</H3>
+<H3><a name="Extending_nn40"></a>37.10.9 Runtime support</H3>
<p>
@@ -3202,7 +3202,7 @@ Discuss the kinds of functions typically needed for SWIG runtime support (e.g.
the SWIG files that implement those functions.
</p>
-<H3><a name="Extending_nn41"></a>36.10.10 Standard library files</H3>
+<H3><a name="Extending_nn41"></a>37.10.10 Standard library files</H3>
<p>
@@ -3221,7 +3221,7 @@ The following are the minimum that are usually supported:
Please copy these and modify for any new language.
</p>
-<H3><a name="Extending_nn42"></a>36.10.11 User examples</H3>
+<H3><a name="Extending_nn42"></a>37.10.11 User examples</H3>
<p>
@@ -3250,7 +3250,7 @@ during this process, see the section on <a href="#Extending_configuration_files"
files</a>.
</p>
-<H3><a name="Extending_test_suite"></a>36.10.12 Test driven development and the test-suite</H3>
+<H3><a name="Extending_test_suite"></a>37.10.12 Test driven development and the test-suite</H3>
<p>
@@ -3309,7 +3309,7 @@ It is therefore essential that the runtime tests are written in a manner that di
but error/exception out with an error message on stderr on failure.
</p>
-<H4><a name="Extending_running_test_suite"></a>36.10.12.1 Running the test-suite</H4>
+<H4><a name="Extending_running_test_suite"></a>37.10.12.1 Running the test-suite</H4>
<p>
@@ -3477,7 +3477,25 @@ A debugger can also be invoked easily on an individual test, for example gdb:
make ret_by_value.ctest RUNTOOL="gdb --args"
</pre></div>
-<H3><a name="Extending_nn43"></a>36.10.13 Documentation</H3>
+<p>
+SWIG reads the <tt>SWIG_FEATURES</tt> environment variable to obtain options in addition to those passed on the command line.
+This is particularly useful as the entire test-suite or a particular testcase can be run customized by using additional
+arguments, for example the -O optimization flag can be added in, as shown below for the bash shell:
+</p>
+
+<div class="shell"><pre>
+env SWIG_FEATURES=-O make check-python-test-suite
+</pre></div>
+
+<p>
+The syntax for setting environment variables varies from one shell to the next, but it also works as shown in the example below, where some typemap debugging is added in:
+</p>
+
+<div class="shell"><pre>
+make ret_by_value.ctest SWIG_FEATURES="-debug-tmsearch"
+</pre></div>
+
+<H3><a name="Extending_nn43"></a>37.10.13 Documentation</H3>
<p>
@@ -3509,7 +3527,7 @@ Some topics that you'll want to be sure to address include:
if available.
</ul>
-<H3><a name="Extending_prerequisites"></a>36.10.14 Prerequisites for adding a new language module to the SWIG distribution</H3>
+<H3><a name="Extending_prerequisites"></a>37.10.14 Prerequisites for adding a new language module to the SWIG distribution</H3>
<p>
@@ -3566,7 +3584,7 @@ should be added should there be an area not already covered by
the existing tests.
</p>
-<H3><a name="Extending_coding_style_guidelines"></a>36.10.15 Coding style guidelines</H3>
+<H3><a name="Extending_coding_style_guidelines"></a>37.10.15 Coding style guidelines</H3>
<p>
@@ -3590,7 +3608,7 @@ The generated C/C++ code should also follow this style as close as possible. How
should be avoided as unlike the SWIG developers, users will never have consistent tab settings.
</p>
-<H2><a name="Extending_debugging_options"></a>36.11 Debugging Options</H2>
+<H2><a name="Extending_debugging_options"></a>37.11 Debugging Options</H2>
<p>
@@ -3609,13 +3627,15 @@ There are various command line options which can aid debugging a SWIG interface
-debug-top &lt;n&gt; - Display entire parse tree at stages 1-4, &lt;n&gt; is a csv list of stages
-debug-typedef - Display information about the types and typedefs in the interface
-debug-typemap - Display information for debugging typemaps
+-debug-tmsearch - Display typemap search debugging information
+-debug-tmused - Display typemaps used debugging information
</pre></div>
<p>
The complete list of command line options for SWIG are available by running <tt>swig -help</tt>.
</p>
-<H2><a name="Extending_nn46"></a>36.12 Guide to parse tree nodes</H2>
+<H2><a name="Extending_nn46"></a>37.12 Guide to parse tree nodes</H2>
<p>
@@ -4023,7 +4043,7 @@ extern "X" { ... } declaration.
</pre>
</div>
-<H2><a name="Extending_further_info"></a>36.13 Further Development Information</H2>
+<H2><a name="Extending_further_info"></a>37.13 Further Development Information</H2>
<p>
diff --git a/Doc/Manual/Go.html b/Doc/Manual/Go.html
index 5e99a51..d5275ef 100644
--- a/Doc/Manual/Go.html
+++ b/Doc/Manual/Go.html
@@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="#FFFFFF">
-<H1><a name="Go"></a>20 SWIG and Go</H1>
+<H1><a name="Go"></a>21 SWIG and Go</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -41,7 +41,7 @@ the Go programming language
see <a href="http://golang.org/">golang.org</a>.
</p>
-<H2><a name="Go_overview"></a>20.1 Overview</H2>
+<H2><a name="Go_overview"></a>21.1 Overview</H2>
<p>
@@ -65,7 +65,7 @@ checking and runtime library are not used with Go. This should be
borne in mind when reading the rest of the SWIG documentation.
</p>
-<H2><a name="Go_running_swig"></a>20.2 Running SWIG with Go</H2>
+<H2><a name="Go_running_swig"></a>21.2 Running SWIG with Go</H2>
<p>
@@ -74,7 +74,7 @@ default SWIG will generate code for the gc compilers. To generate
code for gccgo, you should also use the <tt>-gccgo</tt> option.
</p>
-<H3><a name="Go_commandline"></a>20.2.1 Additional Commandline Options</H3>
+<H3><a name="Go_commandline"></a>21.2.1 Additional Commandline Options</H3>
<p>
@@ -118,7 +118,7 @@ swig -go -help
</table>
-<H3><a name="Go_outputs"></a>20.2.2 Go Output Files</H3>
+<H3><a name="Go_outputs"></a>21.2.2 Go Output Files</H3>
<p> When generating Go code, SWIG will generate the following
@@ -163,7 +163,7 @@ A typical command sequence would look like this:
% 6l main.6
</pre></div>
-<H2><a name="Go_basic_tour"></a>20.3 A tour of basic C/C++ wrapping</H2>
+<H2><a name="Go_basic_tour"></a>21.3 A tour of basic C/C++ wrapping</H2>
<p>
@@ -173,7 +173,7 @@ modifications have to occur. This section briefly covers the
essential aspects of this wrapping.
</p>
-<H3><a name="Go_package"></a>20.3.1 Go Package Name</H3>
+<H3><a name="Go_package"></a>21.3.1 Go Package Name</H3>
<p>
@@ -183,7 +183,7 @@ directive. You may override this by using SWIG's <tt>-package</tt>
command line option.
</p>
-<H3><a name="Go_names"></a>20.3.2 Go Names</H3>
+<H3><a name="Go_names"></a>21.3.2 Go Names</H3>
<p>
@@ -215,7 +215,7 @@ followed by that name, and the destructor will be
named <tt>Delete</tt> followed by that name.
</p>
-<H3><a name="Go_constants"></a>20.3.3 Go Constants</H3>
+<H3><a name="Go_constants"></a>21.3.3 Go Constants</H3>
<p>
@@ -223,7 +223,7 @@ C/C++ constants created via <tt>#define</tt> or the <tt>%constant</tt>
directive become Go constants, declared with a <tt>const</tt>
declaration.
-<H3><a name="Go_enumerations"></a>20.3.4 Go Enumerations</H3>
+<H3><a name="Go_enumerations"></a>21.3.4 Go Enumerations</H3>
<p>
@@ -233,7 +233,7 @@ usual). The values of the enumeration will become variables in Go;
code should avoid modifying those variables.
</p>
-<H3><a name="Go_classes"></a>20.3.5 Go Classes</H3>
+<H3><a name="Go_classes"></a>21.3.5 Go Classes</H3>
<p>
@@ -280,7 +280,7 @@ to <tt>reinterpret_cast</tt>. This should only be used for very
special cases, such as where C++ would use a <tt>dynamic_cast</tt>.
</p>
-<H4><a name="Go_class_inheritance"></a>20.3.5.1 Go Class Inheritance</H4>
+<H4><a name="Go_class_inheritance"></a>21.3.5.1 Go Class Inheritance</H4>
<p>
@@ -292,7 +292,7 @@ Doing the reverse will require an explicit type assertion, which will
be checked dynamically.
</p>
-<H3><a name="Go_templates"></a>20.3.6 Go Templates</H3>
+<H3><a name="Go_templates"></a>21.3.6 Go Templates</H3>
<p>
@@ -300,7 +300,7 @@ In order to use C++ templates in Go, you must tell SWIG to create
wrappers for a particular template instantation. To do this, use
the <tt>%template</tt> directive.
-<H3><a name="Go_director_classes"></a>20.3.7 Go Director Classes</H3>
+<H3><a name="Go_director_classes"></a>21.3.7 Go Director Classes</H3>
<p>
@@ -343,7 +343,7 @@ method defined in Go. The Go code may of course call other methods on
itself, and those methods may be defined either in Go or in C++.
</p>
-<H3><a name="Go_primitive_type_mappings"></a>20.3.8 Default Go primitive type mappings</H3>
+<H3><a name="Go_primitive_type_mappings"></a>21.3.8 Default Go primitive type mappings</H3>
<p>
diff --git a/Doc/Manual/Guile.html b/Doc/Manual/Guile.html
index 75c3d34..111c482 100644
--- a/Doc/Manual/Guile.html
+++ b/Doc/Manual/Guile.html
@@ -8,7 +8,7 @@
<body bgcolor="#ffffff">
-<H1><a name="Guile"></a>21 SWIG and Guile</H1>
+<H1><a name="Guile"></a>22 SWIG and Guile</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -47,7 +47,7 @@
<p>
This section details guile-specific support in SWIG.
-<H2><a name="Guile_nn2"></a>21.1 Meaning of "Module"</H2>
+<H2><a name="Guile_nn2"></a>22.1 Meaning of "Module"</H2>
<p>
@@ -55,7 +55,7 @@ There are three different concepts of "module" involved, defined
separately for SWIG, Guile, and Libtool. To avoid horrible confusion,
we explicitly prefix the context, e.g., "guile-module".
-<H2><a name="Guile_nn3"></a>21.2 Using the SCM or GH Guile API</H2>
+<H2><a name="Guile_nn3"></a>22.2 Using the SCM or GH Guile API</H2>
<p>The guile module can currently export wrapper files that use the guile GH interface or the
@@ -103,7 +103,7 @@ for the specific API. Currently only the guile language module has created a ma
but there is no reason other languages (like mzscheme or chicken) couldn't also use this.
If that happens, there is A LOT less code duplication in the standard typemaps.</p>
-<H2><a name="Guile_nn4"></a>21.3 Linkage</H2>
+<H2><a name="Guile_nn4"></a>22.3 Linkage</H2>
<p>
@@ -111,7 +111,7 @@ Guile support is complicated by a lack of user community cohesiveness,
which manifests in multiple shared-library usage conventions. A set of
policies implementing a usage convention is called a <b>linkage</b>.
-<H3><a name="Guile_nn5"></a>21.3.1 Simple Linkage</H3>
+<H3><a name="Guile_nn5"></a>22.3.1 Simple Linkage</H3>
<p>
@@ -206,7 +206,7 @@ placed between the <code>define-module</code> form and the
<code>SWIG_init</code> via a preprocessor define to avoid symbol
clashes. For this case, however, passive linkage is available.
-<H3><a name="Guile_nn6"></a>21.3.2 Passive Linkage</H3>
+<H3><a name="Guile_nn6"></a>22.3.2 Passive Linkage</H3>
<p>Passive linkage is just like simple linkage, but it generates an
@@ -216,7 +216,7 @@ package name (see below).
<p>You should use passive linkage rather than simple linkage when you
are using multiple modules.
-<H3><a name="Guile_nn7"></a>21.3.3 Native Guile Module Linkage</H3>
+<H3><a name="Guile_nn7"></a>22.3.3 Native Guile Module Linkage</H3>
<p>SWIG can also generate wrapper code that does all the Guile module
@@ -257,7 +257,7 @@ Newer Guile versions have a shorthand procedure for this:
</div>
</ul>
-<H3><a name="Guile_nn8"></a>21.3.4 Old Auto-Loading Guile Module Linkage</H3>
+<H3><a name="Guile_nn8"></a>22.3.4 Old Auto-Loading Guile Module Linkage</H3>
<p>Guile used to support an autoloading facility for object-code
@@ -283,7 +283,7 @@ option, SWIG generates an exported module initialization function with
an appropriate name.
-<H3><a name="Guile_nn9"></a>21.3.5 Hobbit4D Linkage</H3>
+<H3><a name="Guile_nn9"></a>22.3.5 Hobbit4D Linkage</H3>
<p>
@@ -308,7 +308,7 @@ my/lib/libfoo.so.X.Y.Z and friends. This scheme is still very
experimental; the (hobbit4d link) conventions are not well understood.
</p>
-<H2><a name="Guile_nn10"></a>21.4 Underscore Folding</H2>
+<H2><a name="Guile_nn10"></a>22.4 Underscore Folding</H2>
<p>
@@ -320,7 +320,7 @@ complained so far.
<code>%rename</code> to specify the Guile name of the wrapped
functions and variables (see CHANGES).
-<H2><a name="Guile_nn11"></a>21.5 Typemaps</H2>
+<H2><a name="Guile_nn11"></a>22.5 Typemaps</H2>
<p>
@@ -412,7 +412,7 @@ constant will appear as a scheme variable. See
<a href="Customization.html#Customization_features">Features and the %feature directive</a>
for info on how to apply the %feature.</p>
-<H2><a name="Guile_nn12"></a>21.6 Representation of pointers as smobs</H2>
+<H2><a name="Guile_nn12"></a>22.6 Representation of pointers as smobs</H2>
<p>
@@ -429,11 +429,11 @@ upper half of the CAR is read from this struct.
To get the pointer represented by a smob, the wrapper code calls the
function <code>SWIG_ConvertPtr()</code>, passing a pointer to a struct
representing the expected pointer type. See also
-<a href="Typemaps.html#runtime_type_checker">The run-time type checker</a>.
+<a href="Typemaps.html#Typemaps_runtime_type_checker">The run-time type checker</a>.
If the Scheme object passed was not a SWIG smob representing a compatible
pointer, a <code>wrong-type-arg</code> exception is raised.
-<H3><a name="Guile_nn13"></a>21.6.1 GH Smobs</H3>
+<H3><a name="Guile_nn13"></a>22.6.1 GH Smobs</H3>
<p>
@@ -462,7 +462,7 @@ that created them, so the first module we check will most likely be correct.
Once we have a swig_type_info structure, we loop through the linked list of
casts, using pointer comparisons.</p>
-<H3><a name="Guile_nn14"></a>21.6.2 SCM Smobs</H3>
+<H3><a name="Guile_nn14"></a>22.6.2 SCM Smobs</H3>
<p>The SCM interface (using the "-scm" argument to swig) uses swigrun.swg.
@@ -477,7 +477,7 @@ in the smob tag. If a generated GOOPS module has been loaded, smobs will be wra
GOOPS class.</p>
-<H3><a name="Guile_nn15"></a>21.6.3 Garbage Collection</H3>
+<H3><a name="Guile_nn15"></a>22.6.3 Garbage Collection</H3>
<p>Garbage collection is a feature of the new SCM interface, and it is automatically included
@@ -491,7 +491,7 @@ is exactly like described in <a href="Customization.html#Customization_ownership
Object ownership and %newobject</a> in the SWIG manual. All typemaps use an $owner var, and
the guile module replaces $owner with 0 or 1 depending on feature:new.</p>
-<H2><a name="Guile_nn16"></a>21.7 Exception Handling</H2>
+<H2><a name="Guile_nn16"></a>22.7 Exception Handling</H2>
<p>
@@ -517,7 +517,7 @@ mapping:
The default when not specified here is to use "swig-error".
See Lib/exception.i for details.
-<H2><a name="Guile_nn17"></a>21.8 Procedure documentation</H2>
+<H2><a name="Guile_nn17"></a>22.8 Procedure documentation</H2>
<p>If invoked with the command-line option <code>-procdoc
@@ -553,7 +553,7 @@ like this:
typemap argument <code>doc</code>. See <code>Lib/guile/typemaps.i</code> for
details.
-<H2><a name="Guile_nn18"></a>21.9 Procedures with setters</H2>
+<H2><a name="Guile_nn18"></a>22.9 Procedures with setters</H2>
<p>For global variables, SWIG creates a single wrapper procedure
@@ -581,7 +581,7 @@ struct members, the procedures <code>(<var>struct</var>-<var>member</var>-get
pointer)</code> and <code>(<var>struct-member</var>-set pointer
value)</code> are <em>not</em> generated.
-<H2><a name="Guile_nn19"></a>21.10 GOOPS Proxy Classes</H2>
+<H2><a name="Guile_nn19"></a>22.10 GOOPS Proxy Classes</H2>
<p>SWIG can also generate classes and generic functions for use with
@@ -730,7 +730,7 @@ Notice that &lt;Foo&gt; is used before it is defined. The fix is to just put th
<code>%import "foo.h"</code> before the <code>%inline</code> block.
</p>
-<H3><a name="Guile_nn20"></a>21.10.1 Naming Issues</H3>
+<H3><a name="Guile_nn20"></a>22.10.1 Naming Issues</H3>
<p>As you can see in the example above, there are potential naming conflicts. The default exported
@@ -767,7 +767,7 @@ guile-modules. For example,</p>
(use-modules ((Test) #:renamer (symbol-prefix-proc 'goops:)))
</pre></div>
-<H3><a name="Guile_nn21"></a>21.10.2 Linking</H3>
+<H3><a name="Guile_nn21"></a>22.10.2 Linking</H3>
<p>The guile-modules generated above all need to be linked together. GOOPS support requires
diff --git a/Doc/Manual/Introduction.html b/Doc/Manual/Introduction.html
index 3bac948..a8d15a5 100644
--- a/Doc/Manual/Introduction.html
+++ b/Doc/Manual/Introduction.html
@@ -195,9 +195,9 @@ extern int my_mod(int n, int m);
<p>
The interface file contains ANSI C function prototypes and variable
declarations. The <tt>%module</tt> directive defines the name of the
-module that will be created by SWIG. The <tt>%{,%}</tt> block
-provides a location for inserting additional code such as C header
-files or additional C declarations.
+module that will be created by SWIG. The <tt>%{ %}</tt> block
+provides a location for inserting additional code, such as C header
+files or additional C declarations, into the generated C wrapper code.
<H3><a name="Introduction_nn6"></a>2.3.2 The swig command</H3>
@@ -372,9 +372,9 @@ Microsoft Visual Studio.
<p>
If you are using the GNU Autotools
-(<a href="http://www.gnu.org/software/autoconf">Autoconf</a>/
-<a href="http://www.gnu.org/software/automake">Automake</a>/
-<a href="http://www.gnu.org/software/libtool">Libtool</a>)
+(<a href="http://www.gnu.org/software/autoconf/">Autoconf</a>/
+<a href="http://www.gnu.org/software/automake/">Automake</a>/
+<a href="http://www.gnu.org/software/libtool/">Libtool</a>)
to configure SWIG use in your project, the SWIG Autoconf macros can be used.
The primary macro is <tt>ax_pkg_swig</tt>, see
<a href="http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html#ax_pkg_swig">http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html#ax_pkg_swig</a>.
diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html
index f572ffa..c6ef2b4 100644
--- a/Doc/Manual/Java.html
+++ b/Doc/Manual/Java.html
@@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="#FFFFFF">
-<H1><a name="Java"></a>22 SWIG and Java</H1>
+<H1><a name="Java"></a>23 SWIG and Java</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -154,7 +154,7 @@ It covers most SWIG features, but certain low-level details are covered in less
</p>
-<H2><a name="Java_overview"></a>22.1 Overview</H2>
+<H2><a name="Java_overview"></a>23.1 Overview</H2>
<p>
@@ -166,7 +166,7 @@ SWIG wraps C/C++ code using Java proxy classes and is very useful if you want to
If only one or two JNI functions are needed then using SWIG may be overkill.
SWIG enables a Java program to easily call into C/C++ code from Java.
Historically, SWIG was not able to generate any code to call into Java code from C++.
-However, SWIG now supports full cross language polymorphism and code is generated to call up from C++ to Java when wrapping C++ virtual methods.
+However, SWIG now supports full cross language polymorphism and code is generated to call up from C++ to Java when wrapping C++ virtual methods via the director feature.
</p>
<p>
@@ -189,7 +189,7 @@ Various customisation tips and techniques using SWIG directives are covered.
The latter sections cover the advanced techniques of using typemaps for complete control of the wrapping process.
</p>
-<H2><a name="Java_preliminaries"></a>22.2 Preliminaries</H2>
+<H2><a name="Java_preliminaries"></a>23.2 Preliminaries</H2>
<p>
@@ -205,7 +205,7 @@ Run <tt>make -k check</tt> from the SWIG root directory after installing SWIG on
The Java module requires your system to support shared libraries and dynamic loading.
This is the commonly used method to load JNI code so your system will more than likely support this.</p>
-<H3><a name="Java_running_swig"></a>22.2.1 Running SWIG</H3>
+<H3><a name="Java_running_swig"></a>23.2.1 Running SWIG</H3>
<p>
@@ -264,7 +264,7 @@ The following sections have further practical examples and details on how you mi
compiling and using the generated files.
</p>
-<H3><a name="Java_commandline"></a>22.2.2 Additional Commandline Options</H3>
+<H3><a name="Java_commandline"></a>23.2.2 Additional Commandline Options</H3>
<p>
@@ -301,7 +301,7 @@ swig -java -help
Their use will become clearer by the time you have finished reading this section on SWIG and Java.
</p>
-<H3><a name="Java_getting_right_headers"></a>22.2.3 Getting the right header files</H3>
+<H3><a name="Java_getting_right_headers"></a>23.2.3 Getting the right header files</H3>
<p>
@@ -316,7 +316,7 @@ They are usually in directories like this:</p>
<p>
The exact location may vary on your machine, but the above locations are typical. </p>
-<H3><a name="Java_compiling_dynamic"></a>22.2.4 Compiling a dynamic module</H3>
+<H3><a name="Java_compiling_dynamic"></a>23.2.4 Compiling a dynamic module</H3>
<p>
@@ -352,7 +352,7 @@ The name of the shared library output file is important.
If the name of your SWIG module is "<tt>example</tt>", the name of the corresponding shared library file should be "<tt>libexample.so</tt>" (or equivalent depending on your machine, see <a href="#Java_dynamic_linking_problems">Dynamic linking problems</a> for more information).
The name of the module is specified using the <tt>%module</tt> directive or<tt> -module</tt> command line option.</p>
-<H3><a name="Java_using_module"></a>22.2.5 Using your module</H3>
+<H3><a name="Java_using_module"></a>23.2.5 Using your module</H3>
<p>
@@ -363,7 +363,7 @@ To load your shared native library module in Java, simply use Java's <tt>System.
public class runme {
static {
- System.loadLibrary("example");
+  System.loadLibrary("example");
}
public static void main(String argv[]) {
@@ -387,7 +387,7 @@ $
If it doesn't work have a look at the following section which discusses problems loading the shared library.
</p>
-<H3><a name="Java_dynamic_linking_problems"></a>22.2.6 Dynamic linking problems</H3>
+<H3><a name="Java_dynamic_linking_problems"></a>23.2.6 Dynamic linking problems</H3>
<p>
@@ -474,7 +474,7 @@ The following section also contains some C++ specific linking problems and solut
</p>
-<H3><a name="Java_compilation_problems_cpp"></a>22.2.7 Compilation problems and compiling with C++</H3>
+<H3><a name="Java_compilation_problems_cpp"></a>23.2.7 Compilation problems and compiling with C++</H3>
<p>
@@ -527,7 +527,7 @@ Finally make sure the version of JDK header files matches the version of Java th
</p>
-<H3><a name="Java_building_windows"></a>22.2.8 Building on Windows</H3>
+<H3><a name="Java_building_windows"></a>23.2.8 Building on Windows</H3>
<p>
@@ -536,7 +536,7 @@ You will want to produce a DLL that can be loaded by the Java Virtual Machine.
This section covers the process of using SWIG with Microsoft Visual C++ 6 although the procedure may be similar with other compilers.
In order for everything to work, you will need to have a JDK installed on your machine in order to read the JNI header files.</p>
-<H4><a name="Java_visual_studio"></a>22.2.8.1 Running SWIG from Visual Studio</H4>
+<H4><a name="Java_visual_studio"></a>23.2.8.1 Running SWIG from Visual Studio</H4>
<p>
@@ -575,7 +575,7 @@ To run the native code in the DLL (example.dll), make sure that it is in your pa
If the library fails to load have a look at <a href="#Java_dynamic_linking_problems">Dynamic linking problems</a>.
</p>
-<H4><a name="Java_nmake"></a>22.2.8.2 Using NMAKE</H4>
+<H4><a name="Java_nmake"></a>23.2.8.2 Using NMAKE</H4>
<p>
@@ -634,7 +634,7 @@ Of course you may want to make changes for it to work for C++ by adding in the -
</p>
-<H2><a name="Java_basic_tour"></a>22.3 A tour of basic C/C++ wrapping</H2>
+<H2><a name="Java_basic_tour"></a>23.3 A tour of basic C/C++ wrapping</H2>
<p>
@@ -644,7 +644,7 @@ variables are wrapped with JavaBean type getters and setters and so forth.
This section briefly covers the essential aspects of this wrapping.
</p>
-<H3><a name="Java_module_packages_classes"></a>22.3.1 Modules, packages and generated Java classes</H3>
+<H3><a name="Java_module_packages_classes"></a>23.3.1 Modules, packages and generated Java classes</H3>
<p>
@@ -680,7 +680,7 @@ swig -java -package com.bloggs.swig -outdir com/bloggs/swig example.i
SWIG won't create the directory, so make sure it exists beforehand.
</p>
-<H3><a name="Java_functions"></a>22.3.2 Functions</H3>
+<H3><a name="Java_functions"></a>23.3.2 Functions</H3>
<p>
@@ -714,7 +714,7 @@ System.out.println(example.fact(4));
</pre></div>
-<H3><a name="Java_global_variables"></a>22.3.3 Global variables</H3>
+<H3><a name="Java_global_variables"></a>23.3.3 Global variables</H3>
<p>
@@ -801,7 +801,7 @@ extern char *path; // Read-only (due to %immutable)
</div>
-<H3><a name="Java_constants"></a>22.3.4 Constants</H3>
+<H3><a name="Java_constants"></a>23.3.4 Constants</H3>
<p>
@@ -941,7 +941,7 @@ Or if you decide this practice isn't so bad and your own class implements <tt>ex
</p>
-<H3><a name="Java_enumerations"></a>22.3.5 Enumerations</H3>
+<H3><a name="Java_enumerations"></a>23.3.5 Enumerations</H3>
<p>
@@ -955,7 +955,7 @@ The final two approaches use simple integers for each enum item.
Before looking at the various approaches for wrapping named C/C++ enums, anonymous enums are considered.
</p>
-<H4><a name="Java_anonymous_enums"></a>22.3.5.1 Anonymous enums</H4>
+<H4><a name="Java_anonymous_enums"></a>23.3.5.1 Anonymous enums</H4>
<p>
@@ -1018,7 +1018,7 @@ As in the case of constants, you can access them through either the module class
</p>
-<H4><a name="Java_typesafe_enums"></a>22.3.5.2 Typesafe enums</H4>
+<H4><a name="Java_typesafe_enums"></a>23.3.5.2 Typesafe enums</H4>
<p>
@@ -1112,7 +1112,7 @@ When upgrading to JDK 1.5 or later, proper Java enums could be used instead, wit
The following section details proper Java enum generation.
</p>
-<H4><a name="Java_proper_enums"></a>22.3.5.3 Proper Java enums</H4>
+<H4><a name="Java_proper_enums"></a>23.3.5.3 Proper Java enums</H4>
<p>
@@ -1165,7 +1165,7 @@ The additional support methods need not be generated if none of the enum items h
<a href="#Java_simpler_enum_classes">Simpler Java enums for enums without initializers</a> section.
</p>
-<H4><a name="Java_typeunsafe_enums"></a>22.3.5.4 Type unsafe enums</H4>
+<H4><a name="Java_typeunsafe_enums"></a>23.3.5.4 Type unsafe enums</H4>
<p>
@@ -1213,7 +1213,7 @@ Note that unlike typesafe enums, this approach requires users to mostly use diff
Thus the upgrade path to proper enums provided in JDK 1.5 is more painful.
</p>
-<H4><a name="Java_simple_enums"></a>22.3.5.5 Simple enums</H4>
+<H4><a name="Java_simple_enums"></a>23.3.5.5 Simple enums</H4>
<p>
@@ -1232,7 +1232,7 @@ SWIG-1.3.21 and earlier versions wrapped all enums using this approach.
The type unsafe approach is preferable to this one and this simple approach is only included for backwards compatibility with these earlier versions of SWIG.
</p>
-<H3><a name="Java_pointers"></a>22.3.6 Pointers</H3>
+<H3><a name="Java_pointers"></a>23.3.6 Pointers</H3>
<p>
@@ -1320,7 +1320,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return
a NULL pointer if the conversion can't be performed.
</p>
-<H3><a name="Java_structures"></a>22.3.7 Structures</H3>
+<H3><a name="Java_structures"></a>23.3.7 Structures</H3>
<p>
@@ -1488,7 +1488,7 @@ x.setA(3); // Modify x.a - this is the same as b.f.a
</div>
-<H3><a name="Java_classes"></a>22.3.8 C++ classes</H3>
+<H3><a name="Java_classes"></a>23.3.8 C++ classes</H3>
<p>
@@ -1551,7 +1551,7 @@ int bar = Spam.getBar();
</div>
-<H3><a name="Java_inheritance"></a>22.3.9 C++ inheritance</H3>
+<H3><a name="Java_inheritance"></a>23.3.9 C++ inheritance</H3>
<p>
@@ -1612,7 +1612,7 @@ Note that Java does not support multiple inheritance so any multiple inheritance
A warning is given when multiple inheritance is detected and only the first base class is used.
</p>
-<H3><a name="Java_pointers_refs_arrays"></a>22.3.10 Pointers, references, arrays and pass by value</H3>
+<H3><a name="Java_pointers_refs_arrays"></a>23.3.10 Pointers, references, arrays and pass by value</H3>
<p>
@@ -1667,7 +1667,7 @@ to hold the result and a pointer is returned (Java will release this memory
when the returned object's finalizer is run by the garbage collector).
</p>
-<H4><a name="Java_null_pointers"></a>22.3.10.1 Null pointers</H4>
+<H4><a name="Java_null_pointers"></a>23.3.10.1 Null pointers</H4>
<p>
@@ -1691,7 +1691,7 @@ For <tt>spam1</tt> and <tt>spam4</tt> above the Java <tt>null</tt> gets translat
The converse also occurs, that is, NULL pointers are translated into <tt>null</tt> Java objects when returned from a C/C++ function.
</p>
-<H3><a name="Java_overloaded_functions"></a>22.3.11 C++ overloaded functions</H3>
+<H3><a name="Java_overloaded_functions"></a>23.3.11 C++ overloaded functions</H3>
<p>
@@ -1806,7 +1806,7 @@ void spam(unsigned short); // Ignored
</pre>
</div>
-<H3><a name="Java_default_arguments"></a>22.3.12 C++ default arguments</H3>
+<H3><a name="Java_default_arguments"></a>23.3.12 C++ default arguments</H3>
<p>
@@ -1849,7 +1849,7 @@ Further details on default arguments and how to restore this approach are given
</p>
-<H3><a name="Java_namespaces"></a>22.3.13 C++ namespaces</H3>
+<H3><a name="Java_namespaces"></a>23.3.13 C++ namespaces</H3>
<p>
@@ -1922,12 +1922,14 @@ So if SWIG is run using the <tt>-package com.myco</tt> option, a wrapped class,
<div class="shell">
<pre>
-example.i:16: Error: The nspace feature used on 'MyWorld::Material::Color' is not supported unless a package is specified
-with -package - Java does not support types declared in a named package accessing types declared in an unnamed package.
+example.i:16: Error: The nspace feature used on 'MyWorld::Material::Color' is not supported unless
+a package is specified
+with -package - Java does not support types declared in a named package accessing types declared
+in an unnamed package.
</pre>
</div>
-<H3><a name="Java_templates"></a>22.3.14 C++ templates</H3>
+<H3><a name="Java_templates"></a>23.3.14 C++ templates</H3>
<p>
@@ -1976,7 +1978,7 @@ Obviously, there is more to template wrapping than shown in this example.
More details can be found in the <a href="SWIGPlus.html#SWIGPlus">SWIG and C++</a> chapter.
</p>
-<H3><a name="Java_smart_pointers"></a>22.3.15 C++ Smart Pointers</H3>
+<H3><a name="Java_smart_pointers"></a>23.3.15 C++ Smart Pointers</H3>
<p>
@@ -2060,7 +2062,7 @@ Foo f = p.__deref__(); // Returns underlying Foo *
</pre>
</div>
-<H2><a name="Java_further_details"></a>22.4 Further details on the generated Java classes</H2>
+<H2><a name="Java_further_details"></a>23.4 Further details on the generated Java classes</H2>
<p>
@@ -2075,7 +2077,7 @@ Finally enum classes are covered.
First, the crucial intermediary JNI class is considered.
</p>
-<H3><a name="Java_imclass"></a>22.4.1 The intermediary JNI class</H3>
+<H3><a name="Java_imclass"></a>23.4.1 The intermediary JNI class</H3>
<p>
@@ -2195,7 +2197,7 @@ If <tt>name</tt> is the same as <tt>modulename</tt> then the module class name g
from <tt>modulename</tt> to <tt>modulenameModule</tt>.
</p>
-<H4><a name="Java_imclass_pragmas"></a>22.4.1.1 The intermediary JNI class pragmas</H4>
+<H4><a name="Java_imclass_pragmas"></a>23.4.1.1 The intermediary JNI class pragmas</H4>
<p>
@@ -2274,7 +2276,7 @@ For example, let's change the intermediary JNI class access to just the default
All the methods in the intermediary JNI class will then not be callable outside of the package as the method modifiers have been changed from public access to default access. This is useful if you want to prevent users calling these low level functions.
</p>
-<H3><a name="Java_module_class"></a>22.4.2 The Java module class</H3>
+<H3><a name="Java_module_class"></a>23.4.2 The Java module class</H3>
<p>
@@ -2305,7 +2307,7 @@ example.egg(new Foo());
The primary reason for having the module class wrapping the calls in the intermediary JNI class is to implement static type checking. In this case only a <tt>Foo</tt> can be passed to the <tt>egg</tt> function, whereas any <tt>long</tt> can be passed to the <tt>egg</tt> function in the intermediary JNI class.
</p>
-<H4><a name="Java_module_class_pragmas"></a>22.4.2.1 The Java module class pragmas</H4>
+<H4><a name="Java_module_class_pragmas"></a>23.4.2.1 The Java module class pragmas</H4>
<p>
@@ -2356,7 +2358,7 @@ See <a href="#Java_imclass_pragmas">The intermediary JNI class pragmas</a> secti
</p>
-<H3><a name="Java_proxy_classes"></a>22.4.3 Java proxy classes</H3>
+<H3><a name="Java_proxy_classes"></a>23.4.3 Java proxy classes</H3>
<p>
@@ -2432,7 +2434,7 @@ int y = f.spam(5, new Foo());
</pre>
</div>
-<H4><a name="Java_memory_management"></a>22.4.3.1 Memory management</H4>
+<H4><a name="Java_memory_management"></a>23.4.3.1 Memory management</H4>
<p>
@@ -2594,7 +2596,7 @@ and
</p>
-<H4><a name="Java_inheritance_mirroring"></a>22.4.3.2 Inheritance</H4>
+<H4><a name="Java_inheritance_mirroring"></a>23.4.3.2 Inheritance</H4>
<p>
@@ -2710,7 +2712,7 @@ However, true cross language polymorphism can be achieved using the <a href="#Ja
</p>
-<H4><a name="Java_proxy_classes_gc"></a>22.4.3.3 Proxy classes and garbage collection</H4>
+<H4><a name="Java_proxy_classes_gc"></a>23.4.3.3 Proxy classes and garbage collection</H4>
<p>
@@ -2743,7 +2745,7 @@ Call the <tt>System.runFinalizersOnExit(true)</tt> or <tt>Runtime.getRuntime().r
This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock.
</i></div>
<p>In many cases you will be lucky and find that it works, but it is not to be advocated.
-Have a look at <a href="http://java.sun.com">Sun's Java web site</a> and search for <tt>runFinalizersOnExit</tt>.
+Have a look at <a href="http://www.oracle.com/technetwork/java/index.html">Java web site</a> and search for <tt>runFinalizersOnExit</tt>.
</p></li>
<li><p>
@@ -2793,7 +2795,7 @@ The section on <a href="#Java_typemaps">Java typemaps</a> details how to specify
See the <a href="http://www.devx.com/Java/Article/30192">How to Handle Java Finalization's Memory-Retention Issues</a> article for alternative approaches to managing memory by avoiding finalizers altogether.
</p>
-<H4><a name="Java_pgcpp"></a>22.4.3.4 The premature garbage collection prevention parameter for proxy class marshalling</H4>
+<H4><a name="Java_pgcpp"></a>23.4.3.4 The premature garbage collection prevention parameter for proxy class marshalling</H4>
<p>
@@ -2915,7 +2917,7 @@ For example:
<b>Compatibility note:</b> The generation of this additional parameter did not occur in versions prior to SWIG-1.3.30.
</p>
-<H4><a name="Java_multithread_libraries"></a>22.4.3.5 Single threaded applications and thread safety</H4>
+<H4><a name="Java_multithread_libraries"></a>23.4.3.5 Single threaded applications and thread safety</H4>
<p>
@@ -3003,7 +3005,7 @@ for (int i=0; i&lt;100000; i++) {
</pre></div>
-<H3><a name="Java_type_wrapper_classes"></a>22.4.4 Type wrapper classes</H3>
+<H3><a name="Java_type_wrapper_classes"></a>23.4.4 Type wrapper classes</H3>
<p>
@@ -3090,7 +3092,7 @@ public static void spam(SWIGTYPE_p_int x, SWIGTYPE_p_int y, int z) { ... }
</div>
-<H3><a name="Java_enum_classes"></a>22.4.5 Enum classes</H3>
+<H3><a name="Java_enum_classes"></a>23.4.5 Enum classes</H3>
<p>
@@ -3099,7 +3101,7 @@ The <a href="#Java_enumerations">Enumerations</a> section discussed these but om
The following sub-sections detail the various types of enum classes that can be generated.
</p>
-<H4><a name="Java_typesafe_enums_classes"></a>22.4.5.1 Typesafe enum classes</H4>
+<H4><a name="Java_typesafe_enums_classes"></a>23.4.5.1 Typesafe enum classes</H4>
<p>
@@ -3183,7 +3185,7 @@ The <tt>swigValue</tt> method is used for marshalling in the other direction.
The <tt>toString</tt> method is overridden so that the enum name is available.
</p>
-<H4><a name="Java_proper_enums_classes"></a>22.4.5.2 Proper Java enum classes</H4>
+<H4><a name="Java_proper_enums_classes"></a>23.4.5.2 Proper Java enum classes</H4>
<p>
@@ -3261,7 +3263,7 @@ These needn't be generated if the enum being wrapped does not have any initializ
<a href="#Java_simpler_enum_classes">Simpler Java enums for enums without initializers</a> section describes how typemaps can be used to achieve this.
</p>
-<H4><a name="Java_typeunsafe_enums_classes"></a>22.4.5.3 Type unsafe enum classes</H4>
+<H4><a name="Java_typeunsafe_enums_classes"></a>23.4.5.3 Type unsafe enum classes</H4>
<p>
@@ -3292,7 +3294,7 @@ public final class Beverage {
</pre>
</div>
-<H2><a name="Java_directors"></a>22.5 Cross language polymorphism using directors</H2>
+<H2><a name="Java_directors"></a>23.5 Cross language polymorphism using directors</H2>
<p>
@@ -3314,7 +3316,7 @@ The upshot is that C++ classes can be extended in Java and from C++ these extens
Neither C++ code nor Java code needs to know where a particular method is implemented: the combination of proxy classes, director classes, and C wrapper functions transparently takes care of all the cross-language method routing.
</p>
-<H3><a name="Java_enabling_directors"></a>22.5.1 Enabling directors</H3>
+<H3><a name="Java_enabling_directors"></a>23.5.1 Enabling directors</H3>
<p>
@@ -3385,7 +3387,7 @@ public:
</pre>
</div>
-<H3><a name="Java_directors_classes"></a>22.5.2 Director classes</H3>
+<H3><a name="Java_directors_classes"></a>23.5.2 Director classes</H3>
<p>
@@ -3412,7 +3414,7 @@ If the correct implementation is in Java, the Java API is used to call the metho
</p>
-<H3><a name="Java_directors_overhead"></a>22.5.3 Overhead and code bloat</H3>
+<H3><a name="Java_directors_overhead"></a>23.5.3 Overhead and code bloat</H3>
<p>
@@ -3430,7 +3432,7 @@ This situation can be optimized by selectively enabling director methods (using
</p>
-<H3><a name="Java_directors_example"></a>22.5.4 Simple directors example</H3>
+<H3><a name="Java_directors_example"></a>23.5.4 Simple directors example</H3>
<p>
@@ -3495,7 +3497,7 @@ DirectorDerived::upcall_method() invoked.
</pre>
</div>
-<H3><a name="Java_directors_threading"></a>22.5.5 Director threading issues</H3>
+<H3><a name="Java_directors_threading"></a>23.5.5 Director threading issues</H3>
<p>
@@ -3515,7 +3517,7 @@ Macros can be defined on the commandline when compiling your C++ code, or altern
</pre>
</div>
-<H2><a name="Java_allprotected"></a>22.6 Accessing protected members</H2>
+<H2><a name="Java_allprotected"></a>23.6 Accessing protected members</H2>
<p>
@@ -3611,7 +3613,7 @@ class MyProtectedBase extends ProtectedBase
-<H2><a name="Java_common_customization"></a>22.7 Common customization features</H2>
+<H2><a name="Java_common_customization"></a>23.7 Common customization features</H2>
<p>
@@ -3623,7 +3625,7 @@ be awkward. This section describes some common SWIG features that are used
to improve the interface to existing C/C++ code.
</p>
-<H3><a name="Java_helper_functions"></a>22.7.1 C/C++ helper functions</H3>
+<H3><a name="Java_helper_functions"></a>23.7.1 C/C++ helper functions</H3>
<p>
@@ -3689,7 +3691,7 @@ hard to implement. It is possible to improve on this using Java code, typemaps,
customization features as covered in later sections, but sometimes helper functions are a quick and easy solution to difficult cases.
</p>
-<H3><a name="Java_class_extension"></a>22.7.2 Class extension with %extend</H3>
+<H3><a name="Java_class_extension"></a>23.7.2 Class extension with %extend</H3>
<p>
@@ -3752,7 +3754,7 @@ Vector(2,3,4)
in any way---the extensions only show up in the Java interface.
</p>
-<H3><a name="Java_exception_handling"></a>22.7.3 Exception handling with %exception and %javaexception</H3>
+<H3><a name="Java_exception_handling"></a>23.7.3 Exception handling with %exception and %javaexception</H3>
<p>
@@ -3911,7 +3913,7 @@ to raise exceptions. See the <a href="Library.html#Library">SWIG Library</a> ch
The typemap example <a href="#Java_exception_typemap">Handling C++ exception specifications as Java exceptions</a> provides further exception handling capabilities.
</p>
-<H3><a name="Java_method_access"></a>22.7.4 Method access with %javamethodmodifiers</H3>
+<H3><a name="Java_method_access"></a>23.7.4 Method access with %javamethodmodifiers</H3>
<p>
@@ -3937,7 +3939,7 @@ protected static void protect_me() {
</pre>
</div>
-<H2><a name="Java_tips_techniques"></a>22.8 Tips and techniques</H2>
+<H2><a name="Java_tips_techniques"></a>23.8 Tips and techniques</H2>
<p>
@@ -3947,7 +3949,7 @@ strings and arrays. This chapter discusses the common techniques for
solving these problems.
</p>
-<H3><a name="Java_input_output_parameters"></a>22.8.1 Input and output parameters using primitive pointers and references</H3>
+<H3><a name="Java_input_output_parameters"></a>23.8.1 Input and output parameters using primitive pointers and references</H3>
<p>
@@ -4121,7 +4123,7 @@ void foo(Bar *OUTPUT);
will not have the intended effect since <tt>typemaps.i</tt> does not define an OUTPUT rule for <tt>Bar</tt>.
</p>
-<H3><a name="Java_simple_pointers"></a>22.8.2 Simple pointers</H3>
+<H3><a name="Java_simple_pointers"></a>23.8.2 Simple pointers</H3>
<p>
@@ -4187,7 +4189,7 @@ System.out.println("3 + 4 = " + result);
See the <a href="Library.html#Library">SWIG Library</a> chapter for further details.
</p>
-<H3><a name="Java_c_arrays"></a>22.8.3 Wrapping C arrays with Java arrays</H3>
+<H3><a name="Java_c_arrays"></a>23.8.3 Wrapping C arrays with Java arrays</H3>
<p>
@@ -4254,7 +4256,7 @@ Please be aware that the typemaps in this library are not efficient as all the e
There is an alternative approach using the SWIG array library and this is covered in the next section.
</p>
-<H3><a name="Java_unbounded_c_arrays"></a>22.8.4 Unbounded C Arrays</H3>
+<H3><a name="Java_unbounded_c_arrays"></a>23.8.4 Unbounded C Arrays</H3>
<p>
@@ -4399,7 +4401,50 @@ well suited for applications in which you need to create buffers,
package binary data, etc.
</p>
-<H3><a name="Java_heap_allocations"></a>22.8.5 Overriding new and delete to allocate from Java heap</H3>
+<H3><a name="Java_binary_char"></a>Binary data vs Strings</H3>
+
+<p>
+By default SWIG handles <tt>char *</tt> as a string but there is a handy multi-argument typemap available as mentioned in <a href="Library.html#Library_nn10">Passing binary data</a>.
+The following simple example demonstrates using a byte array instead of passing the default string type and length to the wrapped function.
+</p>
+
+
+<div class="code">
+<pre>
+%apply (char *STRING, size_t LENGTH) { (const char data[], size_t len) }
+%inline %{
+void binaryChar1(const char data[], size_t len) {
+ printf("len: %d data: ", len);
+ for (size_t i=0; i&lt;len; ++i)
+ printf("%x ", data[i]);
+ printf("\n");
+}
+%}
+</pre>
+</div>
+
+<p>
+Calling from Java requires just the byte array to be passed in as the multi-argument typemap being applied reduces the number of arguments in the target language to one, from the original two:
+</p>
+
+<div class="code">
+<pre>
+byte[] data = "hi\0jk".getBytes();
+example.binaryChar1(data);
+</pre>
+</div>
+
+<p>
+resulting in the output
+</p>
+
+<div class="code"><pre>
+$ java runme
+len: 5 data: 68 69 0 6a 6b
+</pre></div>
+
+
+<H3><a name="Java_heap_allocations"></a>23.8.5 Overriding new and delete to allocate from Java heap</H3>
<p>
@@ -4516,7 +4561,7 @@ model and use these functions in place of malloc and free in your own
code.
</p>
-<H2><a name="Java_typemaps"></a>22.9 Java typemaps</H2>
+<H2><a name="Java_typemaps"></a>23.9 Java typemaps</H2>
<p>
@@ -4537,7 +4582,7 @@ Before proceeding, it should be stressed that typemaps are not a required
part of using SWIG---the default wrapping behavior is enough in most cases.
Typemaps are only used if you want to change some aspect of the generated code.
-<H3><a name="Java_default_primitive_type_mappings"></a>22.9.1 Default primitive type mappings</H3>
+<H3><a name="Java_default_primitive_type_mappings"></a>23.9.1 Default primitive type mappings</H3>
<p>
@@ -4689,7 +4734,7 @@ However, the mappings allow the full range of values for each C type from Java.
</p>
-<H3><a name="Java_default_non_primitive_typemaps"></a>22.9.2 Default typemaps for non-primitive types</H3>
+<H3><a name="Java_default_non_primitive_typemaps"></a>23.9.2 Default typemaps for non-primitive types</H3>
<p>
@@ -4704,7 +4749,7 @@ So in summary, the C/C++ pointer to non-primitive types is cast into the 64 bit
The Java type is either the proxy class or type wrapper class.
</p>
-<H3><a name="Java_jvm64"></a>22.9.3 Sixty four bit JVMs</H3>
+<H3><a name="Java_jvm64"></a>23.9.3 Sixty four bit JVMs</H3>
<p>
@@ -4717,7 +4762,7 @@ Unfortunately it won't of course hold true for JNI code.
</p>
-<H3><a name="Java_what_is_typemap"></a>22.9.4 What is a typemap?</H3>
+<H3><a name="Java_what_is_typemap"></a>23.9.4 What is a typemap?</H3>
<p>
@@ -4840,7 +4885,7 @@ int c = example.count('e',"Hello World");
</pre>
</div>
-<H3><a name="Java_typemaps_c_to_java_types"></a>22.9.5 Typemaps for mapping C/C++ types to Java types</H3>
+<H3><a name="Java_typemaps_c_to_java_types"></a>23.9.5 Typemaps for mapping C/C++ types to Java types</H3>
<p>
@@ -5100,7 +5145,7 @@ These are listed below:
</table>
-<H3><a name="Java_typemap_attributes"></a>22.9.6 Java typemap attributes</H3>
+<H3><a name="Java_typemap_attributes"></a>23.9.6 Java typemap attributes</H3>
<p>
@@ -5146,7 +5191,7 @@ The "javain" typemap has the optional 'pre', 'post' and 'pgcppname' attributes.
Note that when the 'pre' or 'post' attributes are specified and the associated type is used in a constructor, a constructor helper function is generated. This is necessary as the Java proxy constructor wrapper makes a call to a support constructor using a <i>this</i> call. In Java the <i>this</i> call must be the first statement in the constructor body. The constructor body thus calls the helper function and the helper function instead makes the JNI call, ensuring the 'pre' code is called before the JNI call is made. There is a <a href="#Java_date_marshalling">Date marshalling</a> example showing 'pre', 'post' and 'pgcppname' attributes in action.
</p>
-<H3><a name="Java_special_variables"></a>22.9.7 Java special variables</H3>
+<H3><a name="Java_special_variables"></a>23.9.7 Java special variables</H3>
<p>
@@ -5297,7 +5342,7 @@ This special variable expands to the intermediary class name. Usually this is th
unless the jniclassname attribute is specified in the <a href="Java.html#Java_module_directive">%module directive</a>.
</p>
-<H3><a name="Java_typemaps_for_c_and_cpp"></a>22.9.8 Typemaps for both C and C++ compilation</H3>
+<H3><a name="Java_typemaps_for_c_and_cpp"></a>23.9.8 Typemaps for both C and C++ compilation</H3>
<p>
@@ -5334,7 +5379,7 @@ If you do not intend your code to be targeting both C and C++ then your typemaps
</p>
-<H3><a name="Java_code_typemaps"></a>22.9.9 Java code typemaps</H3>
+<H3><a name="Java_code_typemaps"></a>23.9.9 Java code typemaps</H3>
<p>
@@ -5540,7 +5585,7 @@ For the typemap to be used in all type wrapper classes, all the different types
Again this is the same that is in "<tt>java.swg</tt>", barring the method modifier for <tt>getCPtr</tt>.
</p>
-<H3><a name="Java_directors_typemaps"></a>22.9.10 Director specific typemaps</H3>
+<H3><a name="Java_directors_typemaps"></a>23.9.10 Director specific typemaps</H3>
<p>
@@ -5765,7 +5810,7 @@ The basic strategy here is to provide a default package typemap for the majority
</div>
-<H2><a name="Java_typemap_examples"></a>22.10 Typemap Examples</H2>
+<H2><a name="Java_typemap_examples"></a>23.10 Typemap Examples</H2>
<p>
@@ -5775,7 +5820,7 @@ the SWIG library.
</p>
-<H3><a name="Java_simpler_enum_classes"></a>22.10.1 Simpler Java enums for enums without initializers</H3>
+<H3><a name="Java_simpler_enum_classes"></a>23.10.1 Simpler Java enums for enums without initializers</H3>
<p>
@@ -5854,7 +5899,7 @@ This would be done by using the original versions of these typemaps in "enums.sw
</p>
-<H3><a name="Java_exception_typemap"></a>22.10.2 Handling C++ exception specifications as Java exceptions</H3>
+<H3><a name="Java_exception_typemap"></a>23.10.2 Handling C++ exception specifications as Java exceptions</H3>
<p>
@@ -5979,7 +6024,7 @@ We could alternatively have used <tt>%rename</tt> to rename <tt>what()</tt> into
</p>
-<H3><a name="Java_nan_exception_typemap"></a>22.10.3 NaN Exception - exception handling for a particular type</H3>
+<H3><a name="Java_nan_exception_typemap"></a>23.10.3 NaN Exception - exception handling for a particular type</H3>
<p>
@@ -6134,7 +6179,7 @@ If we were a martyr to the JNI cause, we could replace the succinct code within
If we had, we would have put it in the "in" typemap which, like all JNI and Java typemaps, also supports the 'throws' attribute.
</p>
-<H3><a name="Java_converting_java_string_arrays"></a>22.10.4 Converting Java String arrays to char ** </H3>
+<H3><a name="Java_converting_java_string_arrays"></a>23.10.4 Converting Java String arrays to char ** </H3>
<p>
@@ -6234,7 +6279,7 @@ public class runme {
static {
try {
- System.loadLibrary("example");
+  System.loadLibrary("example");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. " + e);
System.exit(1);
@@ -6278,7 +6323,7 @@ Lastly the "jni", "jtype" and "jstype" typemaps are also required to specify
what Java types to use.
</p>
-<H3><a name="Java_expanding_java_object"></a>22.10.5 Expanding a Java object to multiple arguments</H3>
+<H3><a name="Java_expanding_java_object"></a>23.10.5 Expanding a Java object to multiple arguments</H3>
<p>
@@ -6360,7 +6405,7 @@ example.foo(new String[]{"red", "green", "blue", "white"});
</div>
-<H3><a name="Java_using_typemaps_return_arguments"></a>22.10.6 Using typemaps to return arguments</H3>
+<H3><a name="Java_using_typemaps_return_arguments"></a>23.10.6 Using typemaps to return arguments</H3>
<p>
@@ -6453,7 +6498,7 @@ public class runme {
static {
try {
- System.loadLibrary("example");
+  System.loadLibrary("example");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. " + e);
System.exit(1);
@@ -6478,7 +6523,7 @@ $ java runme
1 12.0 340.0
</pre></div>
-<H3><a name="Java_adding_downcasts"></a>22.10.7 Adding Java downcasts to polymorphic return types</H3>
+<H3><a name="Java_adding_downcasts"></a>23.10.7 Adding Java downcasts to polymorphic return types</H3>
<p>
@@ -6684,7 +6729,7 @@ SWIG usually generates code which constructs the proxy classes using Java code a
Note that the JNI code above uses a number of string lookups to call a constructor, whereas this would not occur using byte compiled Java code.
</p>
-<H3><a name="Java_adding_equals_method"></a>22.10.8 Adding an equals method to the Java classes</H3>
+<H3><a name="Java_adding_equals_method"></a>23.10.8 Adding an equals method to the Java classes</H3>
<p>
@@ -6728,7 +6773,7 @@ System.out.println("foo1? " + foo1.equals(foo2));
</div>
-<H3><a name="Java_void_pointers"></a>22.10.9 Void pointers and a common Java base class</H3>
+<H3><a name="Java_void_pointers"></a>23.10.9 Void pointers and a common Java base class</H3>
<p>
@@ -6787,7 +6832,7 @@ This example contains some useful functionality which you may want in your code.
<li> It also has a function which effectively implements a cast from the type of the proxy/type wrapper class to a void pointer. This is necessary for passing a proxy class or a type wrapper class to a function that takes a void pointer.
</ul>
-<H3><a name="Java_struct_pointer_pointer"></a>22.10.10 Struct pointer to pointer</H3>
+<H3><a name="Java_struct_pointer_pointer"></a>23.10.10 Struct pointer to pointer</H3>
<p>
@@ -6967,7 +7012,7 @@ The C functional interface has been completely morphed into an object-oriented i
the Butler class would behave much like any pure Java class and feel more natural to Java users.
</p>
-<H3><a name="Java_memory_management_member_variables"></a>22.10.11 Memory management when returning references to member variables</H3>
+<H3><a name="Java_memory_management_member_variables"></a>23.10.11 Memory management when returning references to member variables</H3>
<p>
@@ -7090,7 +7135,7 @@ public class Bike {
Note the <tt>addReference</tt> call.
</p>
-<H3><a name="Java_memory_management_objects"></a>22.10.12 Memory management for objects passed to the C++ layer</H3>
+<H3><a name="Java_memory_management_objects"></a>23.10.12 Memory management for objects passed to the C++ layer</H3>
<p>
@@ -7206,7 +7251,7 @@ The 'javacode' typemap simply adds in the specified code into the Java proxy cla
</div>
-<H3><a name="Java_date_marshalling"></a>22.10.13 Date marshalling using the javain typemap and associated attributes</H3>
+<H3><a name="Java_date_marshalling"></a>23.10.13 Date marshalling using the javain typemap and associated attributes</H3>
<p>
@@ -7383,7 +7428,7 @@ A few things to note:
-<H2><a name="Java_directors_faq"></a>22.11 Living with Java Directors</H2>
+<H2><a name="Java_directors_faq"></a>23.11 Living with Java Directors</H2>
<p>
@@ -7564,10 +7609,10 @@ public abstract class UserVisibleFoo extends Foo {
</li>
</ol>
-<H2><a name="Java_odds_ends"></a>22.12 Odds and ends</H2>
+<H2><a name="Java_odds_ends"></a>23.12 Odds and ends</H2>
-<H3><a name="Java_javadoc_comments"></a>22.12.1 JavaDoc comments</H3>
+<H3><a name="Java_javadoc_comments"></a>23.12.1 JavaDoc comments</H3>
<p>
@@ -7623,7 +7668,7 @@ public class Barmy {
-<H3><a name="Java_functional_interface"></a>22.12.2 Functional interface without proxy classes</H3>
+<H3><a name="Java_functional_interface"></a>23.12.2 Functional interface without proxy classes</H3>
<p>
@@ -7684,7 +7729,7 @@ All destructors have to be called manually for example the <tt>delete_Foo(foo)</
</p>
-<H3><a name="Java_using_own_jni_functions"></a>22.12.3 Using your own JNI functions</H3>
+<H3><a name="Java_using_own_jni_functions"></a>23.12.3 Using your own JNI functions</H3>
<p>
@@ -7734,7 +7779,7 @@ This directive is only really useful if you want to mix your own hand crafted JN
</p>
-<H3><a name="Java_performance"></a>22.12.4 Performance concerns and hints</H3>
+<H3><a name="Java_performance"></a>23.12.4 Performance concerns and hints</H3>
<p>
@@ -7755,7 +7800,7 @@ However, you will have to be careful about memory management and make sure that
This method normally calls the C++ destructor or <tt>free()</tt> for C code.
</p>
-<H3><a name="Java_debugging"></a>22.12.5 Debugging</H3>
+<H3><a name="Java_debugging"></a>23.12.5 Debugging</H3>
<p>
@@ -7777,7 +7822,7 @@ The -verbose:jni and -verbose:gc are also useful options for monitoring code beh
</p>
-<H2><a name="Java_examples"></a>22.13 Examples</H2>
+<H2><a name="Java_examples"></a>23.13 Examples</H2>
<p>
diff --git a/Doc/Manual/Library.html b/Doc/Manual/Library.html
index 285192d..02b8e53 100644
--- a/Doc/Manual/Library.html
+++ b/Doc/Manual/Library.html
@@ -824,20 +824,20 @@ If you have a function that expects binary data,
<div class="code">
<pre>
-int parity(char *str, int len, int initial);
+size_t parity(char *str, size_t len, size_t initial);
</pre>
</div>
<p>
-you can wrap the parameters <tt>(char *str, int len)</tt> as a single
+you can wrap the parameters <tt>(char *str, size_t len)</tt> as a single
argument using a typemap. Just do this:
</p>
<div class="code">
<pre>
-%apply (char *STRING, int LENGTH) { (char *str, int len) };
+%apply (char *STRING, size_t LENGTH) { (char *str, size_t len) };
...
-int parity(char *str, int len, int initial);
+size_t parity(char *str, size_t len, size_t initial);
</pre>
</div>
@@ -854,6 +854,7 @@ Now, in the target language, you can use binary string data like this:
<p>
In the wrapper function, the passed string will be expanded to a pointer and length parameter.
+The <tt>(char *STRING, int LENGTH)</tt> multi-argument typemap is also available in addition to <tt>(char *STRING, size_t LENGTH)</tt>.
</p>
<H3><a name="Library_nn11"></a>8.3.3 Using %newobject to release memory</H3>
@@ -1802,27 +1803,67 @@ struct DerivedIntValue : IntValue {
</div>
<p>
-Note that if the <tt>%shared_ptr</tt> macro is omitted for any class in the inheritance hierarchy, it will
-result in a C++ compiler error.
-For example if the above <tt>%shared_ptr(DerivedIntValue)</tt> is omitted, the following is typical of the compiler error that will result:
+A shared_ptr of the derived class can now be passed to a method where the base is expected in the target language, just as it can in C++:
+</p>
+
+<div class="targetlang">
+<pre>
+DerivedIntValue div = new DerivedIntValue(5678);
+int val3 = example.extractValue(div);
+int val4 = example.extractValueSmart(div);
+</pre>
+</div>
+
+<p>
+If the <tt>%shared_ptr</tt> macro is omitted for any class in the inheritance hierarchy, SWIG will warn about this and the generated code may or may not result in a C++ compilation error.
+For example, the following input:
+</p>
+
+<div class="code">
+<pre>
+%include "boost_shared_ptr.i"
+%shared_ptr(Parent);
+
+%inline %{
+ #include &lt;boost/shared_ptr.hpp&gt;
+ struct GrandParent {
+ virtual ~GrandParent() {}
+ };
+
+ struct Parent : GrandParent {
+ virtual ~Parent() {}
+ };
+
+ struct Child : Parent {
+ virtual ~Child() {}
+ };
+%}
+</pre>
+</div>
+
+<p>
+warns about the missing smart pointer information:
</p>
<div class="shell">
<pre>
-example_wrap.cxx: In function 'void Java_exampleJNI_delete_1DerivedIntValue(JNIEnv*, _jclass*, jlong)':
-example_wrap.cxx:3169: error: 'smartarg1' was not declared in this scope
+example.i:12: Warning 520: Base class 'GrandParent' of 'Parent' is not similarly marked as a smart pointer.
+example.i:16: Warning 520: Derived class 'Child' of 'Parent' is not similarly marked as a smart pointer.
</pre>
</div>
<p>
-A shared_ptr of the derived class can now be passed to a method where the base is expected in the target language, just as it can in C++:
+Adding the missing <tt>%shared_ptr</tt> macros will fix this:
</p>
-<div class="targetlang">
+<div class="code">
<pre>
-DerivedIntValue div = new DerivedIntValue(5678);
-int val3 = example.extractValue(div);
-int val4 = example.extractValueSmart(div);
+%include "boost_shared_ptr.i"
+%shared_ptr(GrandParent);
+%shared_ptr(Parent);
+%shared_ptr(Child);
+
+... as before ...
</pre>
</div>
diff --git a/Doc/Manual/Lisp.html b/Doc/Manual/Lisp.html
index b9b5b6c..92af4e6 100644
--- a/Doc/Manual/Lisp.html
+++ b/Doc/Manual/Lisp.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="Lisp"></a>23 SWIG and Common Lisp</H1>
+<H1><a name="Lisp"></a>24 SWIG and Common Lisp</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -41,7 +41,7 @@
Lisp, Common Foreign Function Interface(CFFI), CLisp and UFFI
foreign function interfaces.
</p>
-<H2><a name="Lisp_nn2"></a>23.1 Allegro Common Lisp</H2>
+<H2><a name="Lisp_nn2"></a>24.1 Allegro Common Lisp</H2>
<p>
@@ -50,7 +50,7 @@
<a href="Allegrocl.html#Allegrocl">here</a>
</p>
-<H2><a name="Lisp_nn3"></a>23.2 Common Foreign Function Interface(CFFI)</H2>
+<H2><a name="Lisp_nn3"></a>24.2 Common Foreign Function Interface(CFFI)</H2>
<p>
@@ -77,7 +77,7 @@ swig -cffi -module <i>module-name</i> <i>file-name</i>
files and the various things which you can do with them.
</p>
-<H3><a name="Lisp_nn4"></a>23.2.1 Additional Commandline Options </H3>
+<H3><a name="Lisp_nn4"></a>24.2.1 Additional Commandline Options </H3>
<p>
@@ -118,7 +118,7 @@ swig -cffi -help
</table>
-<H3><a name="Lisp_nn5"></a>23.2.2 Generating CFFI bindings</H3>
+<H3><a name="Lisp_nn5"></a>24.2.2 Generating CFFI bindings</H3>
As we mentioned earlier the ideal way to use SWIG is to use interface
@@ -392,7 +392,7 @@ The feature <i>intern_function</i> ensures that all C names are
</pre></div>
-<H3><a name="Lisp_nn6"></a>23.2.3 Generating CFFI bindings for C++ code</H3>
+<H3><a name="Lisp_nn6"></a>24.2.3 Generating CFFI bindings for C++ code</H3>
<p>This feature to SWIG (for CFFI) is very new and still far from
@@ -568,7 +568,7 @@ If you have any questions, suggestions, patches, etc., related to CFFI
module feel free to contact us on the SWIG mailing list, and
also please add a "[CFFI]" tag in the subject line.
-<H3><a name="Lisp_nn7"></a>23.2.4 Inserting user code into generated files</H3>
+<H3><a name="Lisp_nn7"></a>24.2.4 Inserting user code into generated files</H3>
<p>
@@ -608,7 +608,7 @@ Note that the block <tt>%{ ... %}</tt> is effectively a shortcut for
</p>
-<H2><a name="Lisp_nn8"></a>23.3 CLISP</H2>
+<H2><a name="Lisp_nn8"></a>24.3 CLISP</H2>
<p>
@@ -638,7 +638,7 @@ swig -clisp -module <i>module-name</i> <i>file-name</i>
interface file for the CLISP module. The CLISP module tries to
produce code which is both human readable and easily modifyable.
</p>
-<H3><a name="Lisp_nn9"></a>23.3.1 Additional Commandline Options </H3>
+<H3><a name="Lisp_nn9"></a>24.3.1 Additional Commandline Options </H3>
<p>
@@ -671,7 +671,7 @@ and global variables will be created otherwise only definitions for<br/>
</table>
-<H3><a name="Lisp_nn10"></a>23.3.2 Details on CLISP bindings</H3>
+<H3><a name="Lisp_nn10"></a>24.3.2 Details on CLISP bindings</H3>
<p>
@@ -795,7 +795,7 @@ struct bar {
</pre></div>
-<H2><a name="Lisp_nn11"></a>23.4 UFFI </H2>
+<H2><a name="Lisp_nn11"></a>24.4 UFFI </H2>
</body>
diff --git a/Doc/Manual/Lua.html b/Doc/Manual/Lua.html
index c07fe66..04f96f2 100644
--- a/Doc/Manual/Lua.html
+++ b/Doc/Manual/Lua.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="Lua"></a>24 SWIG and Lua</H1>
+<H1><a name="Lua"></a>25 SWIG and Lua</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -67,13 +67,13 @@
<p>
Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight configuration language for any program that needs one. Lua is implemented as a library, written in clean C (that is, in the common subset of ANSI C and C++). Its also a <em>really</em> tiny language, less than 6000 lines of code, which compiles to &lt;100 kilobytes of binary code. It can be found at <a href="http://www.lua.org">http://www.lua.org</a>
</p>
-<H2><a name="Lua_nn2"></a>24.1 Preliminaries</H2>
+<H2><a name="Lua_nn2"></a>25.1 Preliminaries</H2>
<p>
The current SWIG implementation is designed to work with Lua 5.0.x and Lua 5.1.x. It should work with later versions of Lua, but certainly not with Lua 4.0 due to substantial API changes. ((Currently SWIG generated code has only been tested on Windows with MingW, though given the nature of Lua, is should not have problems on other OS's)). It is possible to either static link or dynamic link a Lua module into the interpreter (normally Lua static links its libraries, as dynamic linking is not available on all platforms).
</p>
-<H2><a name="Lua_nn3"></a>24.2 Running SWIG</H2>
+<H2><a name="Lua_nn3"></a>25.2 Running SWIG</H2>
<p>
@@ -105,7 +105,7 @@ This creates a C/C++ source file <tt>example_wrap.c</tt> or <tt>example_wrap.cxx
<p>
The name of the wrapper file is derived from the name of the input file. For example, if the input file is <tt>example.i</tt>, the name of the wrapper file is <tt>example_wrap.c</tt>. To change this, you can use the -o option. The wrappered module will export one function <tt>"int luaopen_example(lua_State* L)"</tt> which must be called to register the module with the Lua interpreter. The name "luaopen_example" depends upon the name of the module.
</p>
-<H3><a name="Lua_nn4"></a>24.2.1 Compiling and Linking and Interpreter</H3>
+<H3><a name="Lua_nn4"></a>25.2.1 Compiling and Linking and Interpreter</H3>
<p>
@@ -152,7 +152,7 @@ $ gcc -c example.c -o example.o
$ gcc -I/usr/include/lua -L/usr/lib/lua min.o example_wrap.o example.o -o my_lua
</pre></div>
-<H3><a name="Lua_nn5"></a>24.2.2 Compiling a dynamic module</H3>
+<H3><a name="Lua_nn5"></a>25.2.2 Compiling a dynamic module</H3>
<p>
@@ -220,7 +220,7 @@ Is quite obvious (Go back and consult the Lua documents on how to enable loadlib
-<H3><a name="Lua_nn6"></a>24.2.3 Using your module</H3>
+<H3><a name="Lua_nn6"></a>25.2.3 Using your module</H3>
<p>
@@ -238,19 +238,19 @@ $ ./my_lua
&gt;
</pre></div>
-<H2><a name="Lua_nn7"></a>24.3 A tour of basic C/C++ wrapping</H2>
+<H2><a name="Lua_nn7"></a>25.3 A tour of basic C/C++ wrapping</H2>
<p>
By default, SWIG tries to build a very natural Lua interface to your C/C++ code. This section briefly covers the essential aspects of this wrapping.
</p>
-<H3><a name="Lua_nn8"></a>24.3.1 Modules</H3>
+<H3><a name="Lua_nn8"></a>25.3.1 Modules</H3>
<p>
The SWIG module directive specifies the name of the Lua module. If you specify `module example', then everything is wrapped into a Lua table 'example' containing all the functions and variables. When choosing a module name, make sure you don't use the same name as a built-in Lua command or standard module name.
</p>
-<H3><a name="Lua_nn9"></a>24.3.2 Functions</H3>
+<H3><a name="Lua_nn9"></a>25.3.2 Functions</H3>
<p>
@@ -288,7 +288,7 @@ It is also possible to rename the module with an assignment.
24
</pre></div>
-<H3><a name="Lua_nn10"></a>24.3.3 Global variables</H3>
+<H3><a name="Lua_nn10"></a>25.3.3 Global variables</H3>
<p>
@@ -362,7 +362,7 @@ nil
3.142
</pre></div>
-<H3><a name="Lua_nn11"></a>24.3.4 Constants and enums</H3>
+<H3><a name="Lua_nn11"></a>25.3.4 Constants and enums</H3>
<p>
@@ -385,7 +385,7 @@ example.SUNDAY=0
<p>
Constants are not guaranteed to remain constant in Lua. The name of the constant could be accidentally reassigned to refer to some other object. Unfortunately, there is no easy way for SWIG to generate code that prevents this. You will just have to be careful.
</p>
-<H3><a name="Lua_nn12"></a>24.3.5 Pointers</H3>
+<H3><a name="Lua_nn12"></a>25.3.5 Pointers</H3>
<p>
@@ -423,7 +423,7 @@ Lua enforces the integrity of its userdata, so it is virtually impossible to cor
nil
</pre></div>
-<H3><a name="Lua_nn13"></a>24.3.6 Structures</H3>
+<H3><a name="Lua_nn13"></a>25.3.6 Structures</H3>
<p>
@@ -509,7 +509,7 @@ Because the pointer points inside the structure, you can modify the contents and
&gt; x.a = 3 -- Modifies the same structure
</pre></div>
-<H3><a name="Lua_nn14"></a>24.3.7 C++ classes</H3>
+<H3><a name="Lua_nn14"></a>25.3.7 C++ classes</H3>
<p>
@@ -570,7 +570,7 @@ It is not (currently) possible to access static members of an instance:
-- does NOT work
</pre></div>
-<H3><a name="Lua_nn15"></a>24.3.8 C++ inheritance</H3>
+<H3><a name="Lua_nn15"></a>25.3.8 C++ inheritance</H3>
<p>
@@ -595,7 +595,7 @@ then the function <tt>spam()</tt> accepts a Foo pointer or a pointer to any clas
<p>
It is safe to use multiple inheritance with SWIG.
</p>
-<H3><a name="Lua_nn16"></a>24.3.9 Pointers, references, values, and arrays</H3>
+<H3><a name="Lua_nn16"></a>25.3.9 Pointers, references, values, and arrays</H3>
<p>
@@ -626,7 +626,7 @@ Foo spam7();
<p>
then all three functions will return a pointer to some Foo object. Since the third function (spam7) returns a value, newly allocated memory is used to hold the result and a pointer is returned (Lua will release this memory when the return value is garbage collected). The other two are pointers which are assumed to be managed by the C code and so will not be garbage collected.
</p>
-<H3><a name="Lua_nn17"></a>24.3.10 C++ overloaded functions</H3>
+<H3><a name="Lua_nn17"></a>25.3.10 C++ overloaded functions</H3>
<p>
@@ -712,7 +712,7 @@ Please refer to the "SWIG and C++" chapter for more information about overloadin
<p>
Dealing with the Lua coercion mechanism, the priority is roughly (integers, floats, strings, userdata). But it is better to rename the functions rather than rely upon the ordering.
</p>
-<H3><a name="Lua_nn18"></a>24.3.11 C++ operators</H3>
+<H3><a name="Lua_nn18"></a>25.3.11 C++ operators</H3>
<p>
@@ -824,7 +824,7 @@ It is also possible to overload the operator<tt>[]</tt>, but currently this cann
};
</pre></div>
-<H3><a name="Lua_nn19"></a>24.3.12 Class extension with %extend</H3>
+<H3><a name="Lua_nn19"></a>25.3.12 Class extension with %extend</H3>
<p>
@@ -879,7 +879,7 @@ true
<p>
Extend works with both C and C++ code, on classes and structs. It does not modify the underlying object in any way---the extensions only show up in the Lua interface. The only item to take note of is the code has to use the '$self' instead of 'this', and that you cannot access protected/private members of the code (as you are not officially part of the class).
</p>
-<H3><a name="Lua_nn20"></a>24.3.13 C++ templates</H3>
+<H3><a name="Lua_nn20"></a>25.3.13 C++ templates</H3>
<p>
@@ -914,7 +914,7 @@ In Lua:
<p>
Obviously, there is more to template wrapping than shown in this example. More details can be found in the SWIG and C++ chapter. Some more complicated examples will appear later.
</p>
-<H3><a name="Lua_nn21"></a>24.3.14 C++ Smart Pointers</H3>
+<H3><a name="Lua_nn21"></a>25.3.14 C++ Smart Pointers</H3>
<p>
@@ -966,7 +966,7 @@ If you ever need to access the underlying pointer returned by <tt>operator-&gt;(
&gt; f = p:__deref__() -- Returns underlying Foo *
</pre></div>
-<H3><a name="Lua_nn22"></a>24.3.15 C++ Exceptions</H3>
+<H3><a name="Lua_nn22"></a>25.3.15 C++ Exceptions</H3>
<p>
@@ -1110,12 +1110,12 @@ add exception specification to functions or globally (respectively).
</p>
-<H2><a name="Lua_nn23"></a>24.4 Typemaps</H2>
+<H2><a name="Lua_nn23"></a>25.4 Typemaps</H2>
<p>This section explains what typemaps are and the usage of them. The default wrappering behaviour of SWIG is enough in most cases. However sometimes SWIG may need a little additional assistance to know which typemap to apply to provide the best wrappering. This section will be explaining how to use typemaps to best effect</p>
-<H3><a name="Lua_nn24"></a>24.4.1 What is a typemap?</H3>
+<H3><a name="Lua_nn24"></a>25.4.1 What is a typemap?</H3>
<p>A typemap is nothing more than a code generation rule that is attached to a specific C datatype. For example, to convert integers from Lua to C, you might define a typemap like this:</p>
@@ -1143,7 +1143,7 @@ Received an integer : 6
720
</pre></div>
-<H3><a name="Lua_nn25"></a>24.4.2 Using typemaps</H3>
+<H3><a name="Lua_nn25"></a>25.4.2 Using typemaps</H3>
<p>There are many ready written typemaps built into SWIG for all common types (int, float, short, long, char*, enum and more), which SWIG uses automatically, with no effort required on your part.</p>
@@ -1196,7 +1196,7 @@ void swap(int *sx, int *sy);
<p>Note: C++ references must be handled exactly the same way. However SWIG will automatically wrap a <tt>const int&amp;</tt> as an input parameter (since that it obviously input).</p>
-<H3><a name="Lua_nn26"></a>24.4.3 Typemaps and arrays</H3>
+<H3><a name="Lua_nn26"></a>25.4.3 Typemaps and arrays</H3>
<p>Arrays present a challenge for SWIG, because like pointers SWIG does not know whether these are input or output values, nor
@@ -1260,7 +1260,7 @@ and Lua tables to be 1..N, (the indexing follows the norm for the language). In
<p>Note: SWIG also can support arrays of pointers in a similar manner.</p>
-<H3><a name="Lua_nn27"></a>24.4.4 Typemaps and pointer-pointer functions</H3>
+<H3><a name="Lua_nn27"></a>25.4.4 Typemaps and pointer-pointer functions</H3>
<p>Several C++ libraries use a pointer-pointer functions to create its objects. These functions require a pointer to a pointer which is then filled with the pointer to the new object. Microsoft's COM and DirectX as well as many other libraries have this kind of function. An example is given below:</p>
@@ -1294,7 +1294,7 @@ int Create_Math(iMath** pptr); // its creator (assume it mallocs)
ptr=nil -- the iMath* will be GC'ed as normal
</pre></div>
-<H2><a name="Lua_nn28"></a>24.5 Writing typemaps</H2>
+<H2><a name="Lua_nn28"></a>25.5 Writing typemaps</H2>
<p>This section describes how you can modify SWIG's default wrapping behavior for various C/C++ datatypes using the <tt>%typemap</tt> directive. This is an advanced topic that assumes familiarity with the Lua C API as well as the material in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter.</p>
@@ -1303,7 +1303,7 @@ ptr=nil -- the iMath* will be GC'ed as normal
<p>Before proceeding, you should read the previous section on using typemaps, as well as read the ready written typemaps found in luatypemaps.swg and typemaps.i. These are both well documented and fairly easy to read. You should not attempt to write your own typemaps until you have read and can understand both of these files (they may well also give you a idea to base your worn on).</p>
-<H3><a name="Lua_nn29"></a>24.5.1 Typemaps you can write</H3>
+<H3><a name="Lua_nn29"></a>25.5.1 Typemaps you can write</H3>
<p>There are many different types of typemap that can be written, the full list can be found in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter. However the following are the most commonly used ones.</p>
@@ -1316,7 +1316,7 @@ ptr=nil -- the iMath* will be GC'ed as normal
(the syntax for the typecheck is different from the typemap, see typemaps for details).</li>
</ul>
-<H3><a name="Lua_nn30"></a>24.5.2 SWIG's Lua-C API</H3>
+<H3><a name="Lua_nn30"></a>25.5.2 SWIG's Lua-C API</H3>
<p>This section explains the SWIG specific Lua-C API. It does not cover the main Lua-C api, as this is well documented and not worth covering.</p>
@@ -1365,7 +1365,7 @@ This macro, when called within the context of a SWIG wrappered function, will di
<div class="indent">
Similar to SWIG_fail_arg, except that it will display the swig_type_info information instead.</div>
-<H2><a name="Lua_nn31"></a>24.6 Customization of your Bindings</H2>
+<H2><a name="Lua_nn31"></a>25.6 Customization of your Bindings</H2>
<p>
@@ -1374,7 +1374,7 @@ This section covers adding of some small extra bits to your module to add the la
-<H3><a name="Lua_nn32"></a>24.6.1 Writing your own custom wrappers</H3>
+<H3><a name="Lua_nn32"></a>25.6.1 Writing your own custom wrappers</H3>
<p>
@@ -1393,7 +1393,7 @@ int native_function(lua_State*L) // my native code
The <tt>%native</tt> directive in the above example, tells SWIG that there is a function <tt>int native_function(lua_State*L);</tt> which is to be added into the module under the name '<tt>my_func</tt>'. SWIG will not add any wrappering for this function, beyond adding it into the function table. How you write your code is entirely up to you.
</p>
-<H3><a name="Lua_nn33"></a>24.6.2 Adding additional Lua code</H3>
+<H3><a name="Lua_nn33"></a>25.6.2 Adding additional Lua code</H3>
<p>
@@ -1431,7 +1431,7 @@ Good uses for this feature is adding of new code, or writing helper functions to
See Examples/lua/arrays for an example of this code.
</p>
-<H2><a name="Lua_nn34"></a>24.7 Details on the Lua binding</H2>
+<H2><a name="Lua_nn34"></a>25.7 Details on the Lua binding</H2>
<p>
@@ -1442,7 +1442,7 @@ See Examples/lua/arrays for an example of this code.
</i>
</p>
-<H3><a name="Lua_nn35"></a>24.7.1 Binding global data into the module.</H3>
+<H3><a name="Lua_nn35"></a>25.7.1 Binding global data into the module.</H3>
<p>
@@ -1502,7 +1502,7 @@ end
<p>
That way when you call '<tt>a=example.Foo</tt>', the interpreter looks at the table 'example' sees that there is no field 'Foo' and calls __index. This will in turn check in '.get' table and find the existence of 'Foo' and then return the value of the C function call 'Foo_get()'. Similarly for the code '<tt>example.Foo=10</tt>', the interpreter will check the table, then call the __newindex which will then check the '.set' table and call the C function 'Foo_set(10)'.
</p>
-<H3><a name="Lua_nn36"></a>24.7.2 Userdata and Metatables</H3>
+<H3><a name="Lua_nn36"></a>25.7.2 Userdata and Metatables</H3>
<p>
@@ -1582,7 +1582,7 @@ Note: Both the opaque structures (like the FILE*) and normal wrappered classes/s
<p>
Note: Operator overloads are basically done in the same way, by adding functions such as '__add' &amp; '__call' to the classes metatable. The current implementation is a bit rough as it will add any member function beginning with '__' into the metatable too, assuming its an operator overload.
</p>
-<H3><a name="Lua_nn37"></a>24.7.3 Memory management</H3>
+<H3><a name="Lua_nn37"></a>25.7.3 Memory management</H3>
<p>
diff --git a/Doc/Manual/Makefile b/Doc/Manual/Makefile
index 69d361f..42149ba 100644
--- a/Doc/Manual/Makefile
+++ b/Doc/Manual/Makefile
@@ -15,7 +15,7 @@
# Note the # and " are escaped
HTMLDOC_OPTIONS = "--book --toclevels 4 --no-numbered --toctitle \"Table of Contents\" --title --titleimage swig16.png --linkcolor \#0000ff --linkstyle underline --size Universal --left 0.50in --right 0.50in --top 0.50in --bottom 0.50in --header .t. --footer h.1 --nup 1 --tocheader .t. --tocfooter ..i --portrait --color --no-pscommands --no-xrxcomments --compression=1 --jpeg=0 --fontsize 10.0 --fontspacing 1.2 --headingfont Helvetica --bodyfont Times --headfootsize 10.0 --headfootfont Helvetica --charset iso-8859-1 --links --no-embedfonts --pagemode outline --pagelayout single --firstpage c1 --pageeffect none --pageduration 10 --effectduration 1.0 --no-encryption --permissions all --owner-password \"\" --user-password \"\" --browserwidth 680"
-.PHONY: maketoc check generate all clean validate test
+.PHONY: maketoc check generate all maintainer-clean validate test
all: maketoc check generate
@@ -38,13 +38,13 @@ generate: swightml.book swigpdf.book
htmldoc --batch swigpdf.book || true
python fixstyle.py SWIGDocumentation.html
-swigpdf.book:
+swigpdf.book: chapters Sections.html
echo "#HTMLDOC 1.8.24" > swigpdf.book
echo -t pdf13 -f SWIGDocumentation.pdf $(HTMLDOC_OPTIONS) --stylesheet style.css >> swigpdf.book
echo "Sections.html" >> swigpdf.book
cat chapters >> swigpdf.book
-swightml.book:
+swightml.book: chapters Sections.html
echo "#HTMLDOC 1.8.24" > swightml.book
echo -t html -f SWIGDocumentation.html $(HTMLDOC_OPTIONS) >> swightml.book
echo "Sections.html" >> swightml.book
@@ -69,7 +69,10 @@ test:
validate:
all=`sed '/^#/d' chapters`; for a in $$all; do validate --emacs $$a; done;
-# Link checking using linkchecker (can take a while - 30 mins)
+# Link checking using linkchecker
linkchecker:
- linkchecker --anchors Contents.html
+ @echo -----------------------------------------------------------------------
+ @echo Note linkchecker versions prior to 6.1 do not work properly wrt anchors
+ @echo -----------------------------------------------------------------------
+ linkchecker --config=./linkchecker.config index.html
diff --git a/Doc/Manual/Modula3.html b/Doc/Manual/Modula3.html
index 71611e3..f9400ab 100644
--- a/Doc/Manual/Modula3.html
+++ b/Doc/Manual/Modula3.html
@@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="#FFFFFF">
-<H1><a name="Modula3"></a>25 SWIG and Modula-3</H1>
+<H1><a name="Modula3"></a>26 SWIG and Modula-3</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -54,7 +54,7 @@ especially
<a href="Typemaps.html#Typemaps">typemaps</a>.
</p>
-<H2><a name="Modula3_modula3_overview"></a>25.1 Overview</H2>
+<H2><a name="Modula3_modula3_overview"></a>26.1 Overview</H2>
<p>
@@ -84,7 +84,7 @@ FFTW
</li>
</ol>
-<H3><a name="Modula3_motivation"></a>25.1.1 Motivation</H3>
+<H3><a name="Modula3_motivation"></a>26.1.1 Motivation</H3>
<p>
@@ -131,10 +131,10 @@ functions), but it doesn't allow you to easily integrate a Module-3 module into
a C/C++ project.
</p>
-<H2><a name="Modula3_conception"></a>25.2 Conception</H2>
+<H2><a name="Modula3_conception"></a>26.2 Conception</H2>
-<H3><a name="Modula3_cinterface"></a>25.2.1 Interfaces to C libraries</H3>
+<H3><a name="Modula3_cinterface"></a>26.2.1 Interfaces to C libraries</H3>
<p>
@@ -142,7 +142,7 @@ Modula-3 has integrated support for calling C functions.
This is also extensively used by the standard Modula-3 libraries
to call OS functions.
The Modula-3 part of SWIG and the corresponding SWIG library
-<a href="../../Lib/modula3/modula3.swg"><tt>modula3.swg</tt></a>
+modula3.swg
contain code that uses these features.
Because of the built-in support there is no need
for calling the SWIG kernel to generate wrappers written in C.
@@ -283,7 +283,7 @@ and the principal type must be renamed (<tt>%typemap</tt>).
</p>
-<H3><a name="Modula3_cppinterface"></a>25.2.2 Interfaces to C++ libraries</H3>
+<H3><a name="Modula3_cppinterface"></a>26.2.2 Interfaces to C++ libraries</H3>
<p>
@@ -384,24 +384,23 @@ There is no C++ library I wrote a SWIG interface for,
so I'm not sure if this is possible or sensible, yet.
</p>
-<H2><a name="Modula3_preliminaries"></a>25.3 Preliminaries</H2>
+<H2><a name="Modula3_preliminaries"></a>26.3 Preliminaries</H2>
-<H3><a name="Modula3_compilers"></a>25.3.1 Compilers</H3>
+<H3><a name="Modula3_compilers"></a>26.3.1 Compilers</H3>
<p>
There are different Modula-3 compilers around:
cm3, pm3, ezm3, Klagenfurth Modula-3, Cambridge Modula-3.
SWIG itself does not contain compiler specific code
-but the library file
-<a href="../../Lib/modula3/modula3.swg"><tt>modula3.swg</tt></a>
+but the modula3.swg library file
may do so.
For testing examples I use Critical Mass cm3.
</p>
-<H3><a name="Modula3_commandline"></a>25.3.2 Additional Commandline Options</H3>
+<H3><a name="Modula3_commandline"></a>26.3.2 Additional Commandline Options</H3>
<p>
@@ -478,10 +477,10 @@ Instead generate templates for some basic typemaps.
</tr>
</table>
-<H2><a name="Modula3_typemaps"></a>25.4 Modula-3 typemaps</H2>
+<H2><a name="Modula3_typemaps"></a>26.4 Modula-3 typemaps</H2>
-<H3><a name="Modula3_inoutparam"></a>25.4.1 Inputs and outputs</H3>
+<H3><a name="Modula3_inoutparam"></a>26.4.1 Inputs and outputs</H3>
<p>
@@ -499,9 +498,7 @@ or for a return value.
A further typemap may specify
the direction that is used for certain parameters.
I have chosen this separation
-in order to be able to write general typemaps for the typemap library
-<a href="../../Lib/modula3/modula3.swg"><tt>modula3.swg</tt></a>
-.
+in order to be able to write general typemaps for the modula3.swg typemap library.
In the library code the final usage of the type is not known.
Using separate typemaps for each possible use
allows appropriate definitions for each case.
@@ -697,7 +694,7 @@ consist of the following parts:
</table>
-<H3><a name="Modula3_ordinals"></a>25.4.2 Subranges, Enumerations, Sets</H3>
+<H3><a name="Modula3_ordinals"></a>26.4.2 Subranges, Enumerations, Sets</H3>
<p>
@@ -749,7 +746,7 @@ that I'd like to automate.
</p>
-<H3><a name="Modula3_class"></a>25.4.3 Objects</H3>
+<H3><a name="Modula3_class"></a>26.4.3 Objects</H3>
<p>
@@ -762,7 +759,7 @@ is not really useful, yet.
</p>
-<H3><a name="Modula3_imports"></a>25.4.4 Imports</H3>
+<H3><a name="Modula3_imports"></a>26.4.4 Imports</H3>
<p>
@@ -782,9 +779,7 @@ Unqualified import is not supported.
<p>
It is cumbersome to add this typemap to each piece of Modula-3 code.
It is especially useful when writing general typemaps
-for the typemap library
-<a href="../../Lib/modula3/modula3.swg"><tt>modula3.swg</tt></a>
-.
+for the modula3.swg typemap library.
For a monolithic module you might be better off
if you add the imports directly:
</p>
@@ -797,7 +792,7 @@ IMPORT M3toC;
</pre></div>
-<H3><a name="Modula3_exceptions"></a>25.4.5 Exceptions</H3>
+<H3><a name="Modula3_exceptions"></a>26.4.5 Exceptions</H3>
<p>
@@ -821,7 +816,7 @@ you should declare
<tt>%typemap("m3wrapinconv:throws") blah * %{OSError.E%}</tt>.
</p>
-<H3><a name="Modula3_typemap_example"></a>25.4.6 Example</H3>
+<H3><a name="Modula3_typemap_example"></a>26.4.6 Example</H3>
<p>
@@ -868,10 +863,10 @@ where almost everything is generated by a typemap:
</pre></div>
-<H2><a name="Modula3_hints"></a>25.5 More hints to the generator</H2>
+<H2><a name="Modula3_hints"></a>26.5 More hints to the generator</H2>
-<H3><a name="Modula3_features"></a>25.5.1 Features</H3>
+<H3><a name="Modula3_features"></a>26.5.1 Features</H3>
<table border summary="Modula-3 features">
@@ -908,7 +903,7 @@ where almost everything is generated by a typemap:
</tr>
</table>
-<H3><a name="Modula3_pragmas"></a>25.5.2 Pragmas</H3>
+<H3><a name="Modula3_pragmas"></a>26.5.2 Pragmas</H3>
<table border summary="Modula-3 pragmas">
@@ -931,7 +926,7 @@ where almost everything is generated by a typemap:
</tr>
</table>
-<H2><a name="Modula3_remarks"></a>25.6 Remarks</H2>
+<H2><a name="Modula3_remarks"></a>26.6 Remarks</H2>
<ul>
diff --git a/Doc/Manual/Modules.html b/Doc/Manual/Modules.html
index 69cc58c..70b0f11 100644
--- a/Doc/Manual/Modules.html
+++ b/Doc/Manual/Modules.html
@@ -138,7 +138,8 @@ base class's methods. Typically you will get a warning when the module name is m
</p>
<div class="shell"> <pre>
-derived_module.i:8: Warning 401: Base class 'base' ignored - unknown module name for base. Either import
+derived_module.i:8: Warning 401: Base class 'base' ignored - unknown module name for base. Either
+import
the appropriate module interface file or specify the name of the module in the %import directive.
</pre></div>
diff --git a/Doc/Manual/Mzscheme.html b/Doc/Manual/Mzscheme.html
index 4351e34..984b2dd 100644
--- a/Doc/Manual/Mzscheme.html
+++ b/Doc/Manual/Mzscheme.html
@@ -2,17 +2,19 @@
<!-- Hand-written HTML -->
<html>
<head>
-<title>SWIG and MzScheme</title>
+<title>SWIG and MzScheme/Racket</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="#ffffff">
-<H1><a name="Mzscheme"></a>26 SWIG and MzScheme</H1>
+<H1><a name="Mzscheme"></a>27 SWIG and MzScheme/Racket</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
-<li><a href="#MzScheme_nn2">Creating native MzScheme structures</a>
+<li><a href="#MzScheme_nn2">Creating native structures</a>
+<li><a href="#MzScheme_simple">Simple example</a>
+<li><a href="#MzScheme_external_docs">External documentation</a>
</ul>
</div>
<!-- INDEX -->
@@ -20,9 +22,9 @@
<p>
-This section contains information on SWIG's support of MzScheme.
+This section contains information on SWIG's support of Racket, formally known as MzScheme.
-<H2><a name="MzScheme_nn2"></a>26.1 Creating native MzScheme structures</H2>
+<H2><a name="MzScheme_nn2"></a>27.1 Creating native structures</H2>
<p>
@@ -63,8 +65,116 @@ Then in scheme, you can use regular struct access procedures like
</pre>
</div>
+<H2><a name="MzScheme_simple"></a>27.2 Simple example</H2>
+
+
+<p>
+A few examples are available in the Examples/mzscheme directory.
+The code and log of a session using SWIG below should help getting started.
+</p>
+
+<p>
+C header file:
+</p>
+
+<div class="code">
+<pre>
+// example.h
+int fact(int n);
+</pre>
+</div>
+
+<p>
+C source code:
+</p>
+
+<div class="code">
+<pre>
+// File: example.c
+#include "example.h"
+
+int fact(int n) {
+ if (n &lt; 0) { /* This should probably return an error, but this is simpler */
+ return 0;
+ }
+ if (n == 0) {
+ return 1;
+ }
+ else {
+ /* testing for overflow would be a good idea here */
+ return n * fact(n-1);
+ }
+}
+</pre>
+</div>
+
+<p>
+SWIG interface file:
+</p>
+
+<div class="code">
+<pre>
+/* File: example.i */
+%module example
+
+%{
+#include "example.h"
+%}
+
+int fact(int n);
+</pre>
+</div>
+
+<p>
+The session below using the above files is on an OS X machine, but the points to be made are more general. On OS X, libtool is the tool which creates libraries, which are named .dylib, rather than .so on other unixes, or .dll on Windows.
+</p>
+
+<div class="shell">
+<pre>
+% swig -mzscheme -declaremodule example.i
+% gcc -c -m32 -o example.o example.c # force 32-bit object file (mzscheme is 32-bit only)
+% libtool -dynamic -o libexample.dylib example.o # make it into a library
+% ls # what've we got so far?
+example.c example.o
+example.h example_wrap.c
+example.i libexample.dylib*
+% mzc --cgc --cc example_wrap.c # compile the wrapping code
+% LDFLAGS="-L. -lexample" mzc --ld example_wrap.dylib example_wrap.o # ...and link it
+% mzscheme -e '(path-&gt;string (build-path "compiled" "native" (system-library-subpath)))'
+"compiled/native/i386-macosx/3m"
+% mkdir -p compiled/native/i386-macosx/3m # move the extension library to a magic place
+% mv example_wrap.dylib compiled/native/i386-macosx/3m/example_ss.dylib
+% mzscheme
+Welcome to MzScheme v4.2.4 [3m], Copyright (c) 2004-2010 PLT Scheme Inc.
+&gt; (require "example.ss")
+&gt; (fact 5)
+120
+&gt; ^D
+% echo 'It works!'
+</pre>
+</div>
+
+
+<p>
+Some points of interest:
+</p>
+<ul>
+ <li> This is on a 64-bit machine, so we have to include the -m32 option when building the object file
+ <li> If you want to declare a scheme module (and you probably do), it's important that you include the -declaremodule option to swig (if you miss this out, it'll appear to work, but fail later).
+ <li> Use mzc to compile and then link the wrapped code. You'll probably need to adjust the link flags to refer to the library you're wrapping (you can either do this with an LDFLAGS declaration, as here, or with multiple ++ldf options to mzc).
+ <li> Create the directory with path (build-path "compiled" "native" (system-library-subpath)) and move the freshly-generated .dylib to there, changing its name to module-name_ss.dylib. After that, you can REQUIRE the new module with (require "module-name.ss").
+ <li> The above requests mzc to create an extension using the CGC garbage-collector. The alternative -- the 3m collector -- has generally better performance, but work is still required for SWIG to emit code which is compatible with it.
+</ul>
+
+<H2><a name="MzScheme_external_docs"></a>27.3 External documentation</H2>
+
+
+<p>
+See the <a href="http://docs.racket-lang.org/inside/index.html">C API</a> for more description of using the mechanism for adding extensions. The main documentation is <a href="http://docs.racket-lang.org/">here</a>.
+</p>
+
<p>
-That's pretty much it. It works with nested structs as well.
+Tip: mzc's --vv option is very useful for debugging the inevitable library problems you'll encounter.
</p>
</body>
diff --git a/Doc/Manual/Ocaml.html b/Doc/Manual/Ocaml.html
index 6cbfa55..56c3db1 100644
--- a/Doc/Manual/Ocaml.html
+++ b/Doc/Manual/Ocaml.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
<a name="n1"></a>
-<H1><a name="Ocaml"></a>27 SWIG and Ocaml</H1>
+<H1><a name="Ocaml"></a>28 SWIG and Ocaml</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -80,7 +80,7 @@ If you're not familiar with the Objective Caml language, you can visit
<a href="http://www.ocaml.org/">The Ocaml Website</a>.
</p>
-<H2><a name="Ocaml_nn2"></a>27.1 Preliminaries</H2>
+<H2><a name="Ocaml_nn2"></a>28.1 Preliminaries</H2>
<p>
@@ -93,13 +93,13 @@ examples and test-suite which come with SWIG. You can do this by running
The Ocaml module has been tested using the system's dynamic linking (the
usual -lxxx against libxxx.so, as well as with Gerd Stolpmann's
<a
- href="http://www.ocaml-programming.de/packages/documentation/dl/">Dl package
+ href="http://download.camlcity.org/download/">Dl package
</a>. The ocaml_dynamic and ocaml_dynamic_cpp targets in the
file Examples/Makefile illustrate how to compile and link SWIG modules that
will be loaded dynamically. This has only been tested on Linux so far.
</p>
-<H3><a name="Ocaml_nn3"></a>27.1.1 Running SWIG</H3>
+<H3><a name="Ocaml_nn3"></a>28.1.1 Running SWIG</H3>
<p>
@@ -122,7 +122,7 @@ you will compile the file <tt>example_wrap.c</tt> with <tt>ocamlc</tt> or
the resulting .ml and .mli files as well, and do the final link with -custom
(not needed for native link). </p>
-<H3><a name="Ocaml_nn4"></a>27.1.2 Compiling the code</H3>
+<H3><a name="Ocaml_nn4"></a>28.1.2 Compiling the code</H3>
<p>
@@ -158,7 +158,7 @@ the user more freedom with respect to custom typing.
</pre>
</div>
-<H3><a name="Ocaml_nn5"></a>27.1.3 The camlp4 module</H3>
+<H3><a name="Ocaml_nn5"></a>28.1.3 The camlp4 module</H3>
<p>
@@ -234,7 +234,7 @@ let b = C_string (getenv "PATH")
</td></tr>
</table>
-<H3><a name="Ocaml_nn6"></a>27.1.4 Using your module</H3>
+<H3><a name="Ocaml_nn6"></a>28.1.4 Using your module</H3>
<p>
@@ -248,7 +248,7 @@ When linking any ocaml bytecode with your module, use the -custom
option is not needed when you build native code.
</p>
-<H3><a name="Ocaml_nn7"></a>27.1.5 Compilation problems and compiling with C++</H3>
+<H3><a name="Ocaml_nn7"></a>28.1.5 Compilation problems and compiling with C++</H3>
<p>
@@ -259,7 +259,7 @@ liberal with pointer types may not compile under the C++ compiler.
Most code meant to be compiled as C++ will not have problems.
</p>
-<H2><a name="Ocaml_nn8"></a>27.2 The low-level Ocaml/C interface</H2>
+<H2><a name="Ocaml_nn8"></a>28.2 The low-level Ocaml/C interface</H2>
<p>
@@ -360,7 +360,7 @@ is that you must append them to the return list with swig_result = caml_list_a
signature for a function that uses value in this way.
</p>
-<H3><a name="Ocaml_nn9"></a>27.2.1 The generated module</H3>
+<H3><a name="Ocaml_nn9"></a>28.2.1 The generated module</H3>
<p>
@@ -394,7 +394,7 @@ it describes the output SWIG will generate for class definitions.
</td></tr>
</table>
-<H3><a name="Ocaml_nn10"></a>27.2.2 Enums</H3>
+<H3><a name="Ocaml_nn10"></a>28.2.2 Enums</H3>
<p>
@@ -457,7 +457,7 @@ val x : Enum_test.c_obj = C_enum `a
</pre>
</div>
-<H4><a name="Ocaml_nn11"></a>27.2.2.1 Enum typing in Ocaml</H4>
+<H4><a name="Ocaml_nn11"></a>28.2.2.1 Enum typing in Ocaml</H4>
<p>
@@ -470,10 +470,10 @@ functions imported from different modules. You must convert values to master
values using the swig_val function before sharing them with another module.
</p>
-<H3><a name="Ocaml_nn12"></a>27.2.3 Arrays</H3>
+<H3><a name="Ocaml_nn12"></a>28.2.3 Arrays</H3>
-<H4><a name="Ocaml_nn13"></a>27.2.3.1 Simple types of bounded arrays</H4>
+<H4><a name="Ocaml_nn13"></a>28.2.3.1 Simple types of bounded arrays</H4>
<p>
@@ -494,7 +494,7 @@ arrays of simple types with known bounds in your code, but this only works
for arrays whose bounds are completely specified.
</p>
-<H4><a name="Ocaml_nn14"></a>27.2.3.2 Complex and unbounded arrays</H4>
+<H4><a name="Ocaml_nn14"></a>28.2.3.2 Complex and unbounded arrays</H4>
<p>
@@ -507,7 +507,7 @@ SWIG can't predict which of these methods will be used in the array,
so you have to specify it for yourself in the form of a typemap.
</p>
-<H4><a name="Ocaml_nn15"></a>27.2.3.3 Using an object</H4>
+<H4><a name="Ocaml_nn15"></a>28.2.3.3 Using an object</H4>
<p>
@@ -521,7 +521,7 @@ Consider writing an object when the ending condition of your array is complex,
such as using a required sentinel, etc.
</p>
-<H4><a name="Ocaml_nn16"></a>27.2.3.4 Example typemap for a function taking float * and int</H4>
+<H4><a name="Ocaml_nn16"></a>28.2.3.4 Example typemap for a function taking float * and int</H4>
<p>
@@ -572,7 +572,7 @@ void printfloats( float *tab, int len );
</pre></td></tr></table>
-<H3><a name="Ocaml_nn17"></a>27.2.4 C++ Classes</H3>
+<H3><a name="Ocaml_nn17"></a>28.2.4 C++ Classes</H3>
<p>
@@ -615,7 +615,7 @@ the underlying pointer, so using create_[x]_from_ptr alters the
returned value for the same object.
</p>
-<H4><a name="Ocaml_nn18"></a>27.2.4.1 STL vector and string Example</H4>
+<H4><a name="Ocaml_nn18"></a>28.2.4.1 STL vector and string Example</H4>
<p>
@@ -695,7 +695,7 @@ baz
#
</pre></div>
-<H4><a name="Ocaml_nn19"></a>27.2.4.2 C++ Class Example</H4>
+<H4><a name="Ocaml_nn19"></a>28.2.4.2 C++ Class Example</H4>
<p>
@@ -725,7 +725,7 @@ public:
};
</pre></td></tr></table>
-<H4><a name="Ocaml_nn20"></a>27.2.4.3 Compiling the example</H4>
+<H4><a name="Ocaml_nn20"></a>28.2.4.3 Compiling the example</H4>
<div class="code"><pre>
@@ -743,7 +743,7 @@ bash-2.05a$ ocamlmktop -custom swig.cmo -I `camlp4 -where` \
-L$QTPATH/lib -cclib -lqt
</pre></div>
-<H4><a name="Ocaml_nn21"></a>27.2.4.4 Sample Session</H4>
+<H4><a name="Ocaml_nn21"></a>28.2.4.4 Sample Session</H4>
<div class="code"><pre>
@@ -770,10 +770,10 @@ Assuming you have a working installation of QT, you will see a window
containing the string "hi" in a button.
</p>
-<H3><a name="Ocaml_nn22"></a>27.2.5 Director Classes</H3>
+<H3><a name="Ocaml_nn22"></a>28.2.5 Director Classes</H3>
-<H4><a name="Ocaml_nn23"></a>27.2.5.1 Director Introduction</H4>
+<H4><a name="Ocaml_nn23"></a>28.2.5.1 Director Introduction</H4>
<p>
@@ -800,7 +800,7 @@ class foo {
};
</pre></div>
-<H4><a name="Ocaml_nn24"></a>27.2.5.2 Overriding Methods in Ocaml</H4>
+<H4><a name="Ocaml_nn24"></a>28.2.5.2 Overriding Methods in Ocaml</H4>
<p>
@@ -828,7 +828,7 @@ In this example, I'll examine the objective caml code involved in providing
an overloaded class. This example is contained in Examples/ocaml/shapes.
</p>
-<H4><a name="Ocaml_nn25"></a>27.2.5.3 Director Usage Example</H4>
+<H4><a name="Ocaml_nn25"></a>28.2.5.3 Director Usage Example</H4>
<table border="1" bgcolor="#dddddd" summary="Director usage example">
@@ -887,7 +887,7 @@ in a more effortless style in ocaml, while leaving the "engine" part of the
program in C++.
</p>
-<H4><a name="Ocaml_nn26"></a>27.2.5.4 Creating director objects</H4>
+<H4><a name="Ocaml_nn26"></a>28.2.5.4 Creating director objects</H4>
<p>
@@ -928,7 +928,7 @@ object from causing a core dump, as long as the object is destroyed
properly.
</p>
-<H4><a name="Ocaml_nn27"></a>27.2.5.5 Typemaps for directors, <tt>directorin, directorout, directorargout</tt></H4>
+<H4><a name="Ocaml_nn27"></a>28.2.5.5 Typemaps for directors, <tt>directorin, directorout, directorargout</tt></H4>
<p>
@@ -939,7 +939,7 @@ well as a function return value in the same way you provide function arguments,
and to receive arguments the same way you normally receive function returns.
</p>
-<H4><a name="Ocaml_nn28"></a>27.2.5.6 <tt>directorin</tt> typemap</H4>
+<H4><a name="Ocaml_nn28"></a>28.2.5.6 <tt>directorin</tt> typemap</H4>
<p>
@@ -950,7 +950,7 @@ code receives when you are called. In general, a simple <tt>directorin</tt> typ
can use the same body as a simple <tt>out</tt> typemap.
</p>
-<H4><a name="Ocaml_nn29"></a>27.2.5.7 <tt>directorout</tt> typemap</H4>
+<H4><a name="Ocaml_nn29"></a>28.2.5.7 <tt>directorout</tt> typemap</H4>
<p>
@@ -961,7 +961,7 @@ for the same type, except when there are special requirements for object
ownership, etc.
</p>
-<H4><a name="Ocaml_nn30"></a>27.2.5.8 <tt>directorargout</tt> typemap</H4>
+<H4><a name="Ocaml_nn30"></a>28.2.5.8 <tt>directorargout</tt> typemap</H4>
<p>
@@ -978,7 +978,7 @@ In the event that you don't specify all of the necessary values, integral
values will read zero, and struct or object returns have undefined results.
</p>
-<H3><a name="Ocaml_nn31"></a>27.2.6 Exceptions</H3>
+<H3><a name="Ocaml_nn31"></a>28.2.6 Exceptions</H3>
<p>
diff --git a/Doc/Manual/Octave.html b/Doc/Manual/Octave.html
index be512f0..3c08d84 100644
--- a/Doc/Manual/Octave.html
+++ b/Doc/Manual/Octave.html
@@ -8,7 +8,7 @@
<body bgcolor="#ffffff">
-<H1><a name="Octave"></a>28 SWIG and Octave</H1>
+<H1><a name="Octave"></a>29 SWIG and Octave</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -46,7 +46,7 @@
<p>
Octave is a high-level language intended for numerical programming that is mostly compatible with MATLAB.
-More information can be found at <a href="http://www.octave.org">www.octave.org</a>.
+More information can be found at <a href="http://www.gnu.org/software/octave/">Octave web site</a>.
</p>
<p>
@@ -54,14 +54,14 @@ More information can be found at <a href="http://www.octave.org">www.octave.org<
Also, there are a dozen or so examples in the Examples/octave directory, and hundreds in the test suite (Examples/test-suite and Examples/test-suite/octave).
</p>
-<H2><a name="Octave_nn2"></a>28.1 Preliminaries</H2>
+<H2><a name="Octave_nn2"></a>29.1 Preliminaries</H2>
<p>
The SWIG implemention was first based on Octave 2.9.12, so this is the minimum version required. Testing has only been done on Linux.
</p>
-<H2><a name="Octave_nn3"></a>28.2 Running SWIG</H2>
+<H2><a name="Octave_nn3"></a>29.2 Running SWIG</H2>
<p>
@@ -97,7 +97,7 @@ This creates a C++ source file <tt>example_wrap.cxx</tt>. A C++ file is generate
The swig command line has a number of options you can use, like to redirect it's output. Use <tt>swig --help</tt> to learn about these.
</p>
-<H3><a name="Octave_nn5"></a>28.2.1 Compiling a dynamic module</H3>
+<H3><a name="Octave_nn5"></a>29.2.1 Compiling a dynamic module</H3>
<p>
@@ -124,7 +124,7 @@ $ mkoctfile example_wrap.cxx example.c
<div class="targetlang"><pre>octave:1&gt; example</pre></div>
-<H3><a name="Octave_nn6"></a>28.2.2 Using your module</H3>
+<H3><a name="Octave_nn6"></a>29.2.2 Using your module</H3>
<p>
@@ -142,10 +142,10 @@ octave:4&gt; example.cvar.Foo=4;
octave:5&gt; example.cvar.Foo
ans = 4 </pre></div>
-<H2><a name="Octave_nn7"></a>28.3 A tour of basic C/C++ wrapping</H2>
+<H2><a name="Octave_nn7"></a>29.3 A tour of basic C/C++ wrapping</H2>
-<H3><a name="Octave_nn8"></a>28.3.1 Modules</H3>
+<H3><a name="Octave_nn8"></a>29.3.1 Modules</H3>
<p>
@@ -187,7 +187,7 @@ One can also rename it by simple assignment, e.g.,
octave:1&gt; some_vars = cvar;
</pre></div>
-<H3><a name="Octave_nn9"></a>28.3.2 Functions</H3>
+<H3><a name="Octave_nn9"></a>29.3.2 Functions</H3>
<p>
@@ -204,7 +204,7 @@ int fact(int n); </pre></div>
<div class="targetlang"><pre>octave:1&gt; example.fact(4)
24 </pre></div>
-<H3><a name="Octave_nn10"></a>28.3.3 Global variables</H3>
+<H3><a name="Octave_nn10"></a>29.3.3 Global variables</H3>
<p>
@@ -257,7 +257,7 @@ octave:2&gt; example.PI=3.142;
octave:3&gt; example.PI
ans = 3.1420 </pre></div>
-<H3><a name="Octave_nn11"></a>28.3.4 Constants and enums</H3>
+<H3><a name="Octave_nn11"></a>29.3.4 Constants and enums</H3>
<p>
@@ -279,7 +279,7 @@ example.SCONST="Hello World"
example.SUNDAY=0
.... </pre></div>
-<H3><a name="Octave_nn12"></a>28.3.5 Pointers</H3>
+<H3><a name="Octave_nn12"></a>29.3.5 Pointers</H3>
<p>
@@ -326,7 +326,7 @@ octave:2&gt; f=example.fopen("not there","r");
error: value on right hand side of assignment is undefined
error: evaluating assignment expression near line 2, column 2 </pre></div>
-<H3><a name="Octave_nn13"></a>28.3.6 Structures and C++ classes</H3>
+<H3><a name="Octave_nn13"></a>29.3.6 Structures and C++ classes</H3>
<p>
@@ -461,7 +461,7 @@ ans = 1
Depending on the ownership setting of a <tt>swig_ref</tt>, it may call C++ destructors when its reference count goes to zero. See the section on memory management below for details.
</p>
-<H3><a name="Octave_nn15"></a>28.3.7 C++ inheritance</H3>
+<H3><a name="Octave_nn15"></a>29.3.7 C++ inheritance</H3>
<p>
@@ -470,7 +470,7 @@ This information contains the full class hierarchy. When an indexing operation (
the tree is walked to find a match in the current class as well as any of its bases. The lookup is then cached in the <tt>swig_ref</tt>.
</p>
-<H3><a name="Octave_nn17"></a>28.3.8 C++ overloaded functions</H3>
+<H3><a name="Octave_nn17"></a>29.3.8 C++ overloaded functions</H3>
<p>
@@ -480,7 +480,7 @@ The dispatch function selects which overload to call (if any) based on the passe
<tt>typecheck</tt> typemaps are used to analyze each argument, as well as assign precedence. See the chapter on typemaps for details.
</p>
-<H3><a name="Octave_nn18"></a>28.3.9 C++ operators</H3>
+<H3><a name="Octave_nn18"></a>29.3.9 C++ operators</H3>
<p>
@@ -580,7 +580,7 @@ On the C++ side, the default mappings are as follows:
%rename(__brace) *::operator[];
</pre></div>
-<H3><a name="Octave_nn19"></a>28.3.10 Class extension with %extend</H3>
+<H3><a name="Octave_nn19"></a>29.3.10 Class extension with %extend</H3>
<p>
@@ -610,7 +610,7 @@ octave:3&gt; printf("%s\n",a);
octave:4&gt; a.__str()
4
</pre></div>
-<H3><a name="Octave_nn20"></a>28.3.11 C++ templates</H3>
+<H3><a name="Octave_nn20"></a>29.3.11 C++ templates</H3>
<p>
@@ -687,14 +687,14 @@ ans =
</pre></div>
-<H3><a name="Octave_nn21"></a>28.3.12 C++ Smart Pointers</H3>
+<H3><a name="Octave_nn21"></a>29.3.12 C++ Smart Pointers</H3>
<p>
C++ smart pointers are fully supported as in other modules.
</p>
-<H3><a name="Octave_nn22"></a>28.3.13 Directors (calling Octave from C++ code)</H3>
+<H3><a name="Octave_nn22"></a>29.3.13 Directors (calling Octave from C++ code)</H3>
<p>
@@ -755,7 +755,8 @@ Note that you have to enable directors via the %feature directive (see other mod
<tt>subclass()</tt> will accept any number of C++ bases or other <tt>subclass()</tt>'ed objects, <tt>(string,octave_value)</tt> pairs, and <tt>function_handles</tt>. In the first case, these are taken as base classes; in the second case, as named members (either variables or functions, depending on whether the given value is a function handle); in the third case, as member functions whose name is taken from the given function handle. E.g.,
</p>
<div class="targetlang"><pre>
-octave:1&gt; B=@(some_var=2) subclass(A(),'some_var',some_var,@some_func,'another_func',@(self) do_stuff())
+octave:1&gt; B=@(some_var=2) subclass(A(),'some_var',some_var,@some_func,'another_func',
+@(self) do_stuff())
</pre></div>
<p>
You can also assign non-C++ member variables and functions after construct time. There is no support for non-C++ static members.
@@ -774,14 +775,14 @@ c-side routine called
octave-side routine called
</pre></div>
-<H3><a name="Octave_nn23"></a>28.3.14 Threads</H3>
+<H3><a name="Octave_nn23"></a>29.3.14 Threads</H3>
<p>
The use of threads in wrapped Director code is not supported; i.e., an Octave-side implementation of a C++ class must be called from the Octave interpreter's thread. Anything fancier (apartment/queue model, whatever) is left to the user. Without anything fancier, this amounts to the limitation that Octave must drive the module... like, for example, an optimization package that calls Octave to evaluate an objective function.
</p>
-<H3><a name="Octave_nn24"></a>28.3.15 Memory management</H3>
+<H3><a name="Octave_nn24"></a>29.3.15 Memory management</H3>
<p>
@@ -815,14 +816,14 @@ The %newobject directive may be used to control this behavior for pointers retur
In the case where one wishes for the C++ side to own an object that was created in Octave (especially a Director object), one can use the __disown() method to invert this logic. Then letting the Octave reference count go to zero will not destroy the object, but destroying the object will invalidate the Octave-side object if it still exists (and call destructors of other C++ bases in the case of multiple inheritance/<tt>subclass()</tt>'ing).
</p>
-<H3><a name="Octave_nn25"></a>28.3.16 STL support</H3>
+<H3><a name="Octave_nn25"></a>29.3.16 STL support</H3>
<p>
Various STL library files are provided for wrapping STL containers.
</p>
-<H3><a name="Octave_nn26"></a>28.3.17 Matrix typemaps</H3>
+<H3><a name="Octave_nn26"></a>29.3.17 Matrix typemaps</H3>
<p>
diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html
index 0c2733c..5aae518 100644
--- a/Doc/Manual/Perl5.html
+++ b/Doc/Manual/Perl5.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="Perl5"></a>29 SWIG and Perl5</H1>
+<H1><a name="Perl5"></a>30 SWIG and Perl5</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -87,7 +87,7 @@ later. Earlier versions are problematic and SWIG generated extensions
may not compile or run correctly.
</p>
-<H2><a name="Perl5_nn2"></a>29.1 Overview</H2>
+<H2><a name="Perl5_nn2"></a>30.1 Overview</H2>
<p>
@@ -108,7 +108,7 @@ described. Advanced customization features, typemaps, and other
options are found near the end of the chapter.
</p>
-<H2><a name="Perl5_nn3"></a>29.2 Preliminaries</H2>
+<H2><a name="Perl5_nn3"></a>30.2 Preliminaries</H2>
<p>
@@ -133,7 +133,7 @@ To build the module, you will need to compile the file
<tt>example_wrap.c</tt> and link it with the rest of your program.
</p>
-<H3><a name="Perl5_nn4"></a>29.2.1 Getting the right header files</H3>
+<H3><a name="Perl5_nn4"></a>30.2.1 Getting the right header files</H3>
<p>
@@ -165,7 +165,7 @@ loaded, an easy way to find out is to run Perl itself.
</pre>
</div>
-<H3><a name="Perl5_nn5"></a>29.2.2 Compiling a dynamic module</H3>
+<H3><a name="Perl5_nn5"></a>30.2.2 Compiling a dynamic module</H3>
<p>
@@ -198,7 +198,7 @@ the target should be named `<tt>example.so</tt>',
`<tt>example.sl</tt>', or the appropriate dynamic module name on your system.
</p>
-<H3><a name="Perl5_nn6"></a>29.2.3 Building a dynamic module with MakeMaker</H3>
+<H3><a name="Perl5_nn6"></a>30.2.3 Building a dynamic module with MakeMaker</H3>
<p>
@@ -232,7 +232,7 @@ the preferred approach to compilation. More information about MakeMaker can be
found in "Programming Perl, 2nd ed." by Larry Wall, Tom Christiansen,
and Randal Schwartz.</p>
-<H3><a name="Perl5_nn7"></a>29.2.4 Building a static version of Perl</H3>
+<H3><a name="Perl5_nn7"></a>30.2.4 Building a static version of Perl</H3>
<p>
@@ -301,7 +301,7 @@ added to it. Depending on your machine, you may need to link with
additional libraries such as <tt>-lsocket, -lnsl, -ldl</tt>, etc.
</p>
-<H3><a name="Perl5_nn8"></a>29.2.5 Using the module</H3>
+<H3><a name="Perl5_nn8"></a>30.2.5 Using the module</H3>
<p>
@@ -456,7 +456,7 @@ system configuration (this requires root access and you will need to
read the man pages).
</p>
-<H3><a name="Perl5_nn9"></a>29.2.6 Compilation problems and compiling with C++</H3>
+<H3><a name="Perl5_nn9"></a>30.2.6 Compilation problems and compiling with C++</H3>
<p>
@@ -599,7 +599,7 @@ have to find the macro that conflicts and add an #undef into the .i file. Pleas
any conflicting macros you find to <a href="http://www.swig.org/mail.html">swig-user mailing list</a>.
</p>
-<H3><a name="Perl5_nn10"></a>29.2.7 Compiling for 64-bit platforms</H3>
+<H3><a name="Perl5_nn10"></a>30.2.7 Compiling for 64-bit platforms</H3>
<p>
@@ -626,7 +626,7 @@ also introduce problems on platforms that support more than one
linking standard (e.g., -o32 and -n32 on Irix).
</p>
-<H2><a name="Perl5_nn11"></a>29.3 Building Perl Extensions under Windows</H2>
+<H2><a name="Perl5_nn11"></a>30.3 Building Perl Extensions under Windows</H2>
<p>
@@ -637,7 +637,7 @@ section assumes you are using SWIG with Microsoft Visual C++
although the procedure may be similar with other compilers.
</p>
-<H3><a name="Perl5_nn12"></a>29.3.1 Running SWIG from Developer Studio</H3>
+<H3><a name="Perl5_nn12"></a>30.3.1 Running SWIG from Developer Studio</H3>
<p>
@@ -700,7 +700,7 @@ print "$a\n";
</pre></div>
-<H3><a name="Perl5_nn13"></a>29.3.2 Using other compilers</H3>
+<H3><a name="Perl5_nn13"></a>30.3.2 Using other compilers</H3>
<p>
@@ -708,7 +708,7 @@ SWIG is known to work with Cygwin and may work with other compilers on Windows.
For general hints and suggestions refer to the <a href="Windows.html#Windows">Windows</a> chapter.
</p>
-<H2><a name="Perl5_nn14"></a>29.4 The low-level interface</H2>
+<H2><a name="Perl5_nn14"></a>30.4 The low-level interface</H2>
<p>
@@ -718,7 +718,7 @@ can be used to control your application. However, it is also used to
construct more user-friendly proxy classes as described in the next section.
</p>
-<H3><a name="Perl5_nn15"></a>29.4.1 Functions</H3>
+<H3><a name="Perl5_nn15"></a>30.4.1 Functions</H3>
<p>
@@ -741,7 +741,7 @@ use example;
$a = &amp;example::fact(2);
</pre></div>
-<H3><a name="Perl5_nn16"></a>29.4.2 Global variables</H3>
+<H3><a name="Perl5_nn16"></a>30.4.2 Global variables</H3>
<p>
@@ -811,7 +811,7 @@ extern char *path; // Declared later in the input
</pre>
</div>
-<H3><a name="Perl5_nn17"></a>29.4.3 Constants</H3>
+<H3><a name="Perl5_nn17"></a>30.4.3 Constants</H3>
<p>
@@ -851,7 +851,7 @@ print example::FOO,"\n";
</pre>
</div>
-<H3><a name="Perl5_nn18"></a>29.4.4 Pointers</H3>
+<H3><a name="Perl5_nn18"></a>30.4.4 Pointers</H3>
<p>
@@ -960,7 +960,7 @@ as XS and <tt>xsubpp</tt>. Given the advancement of the SWIG typesystem and the
SWIG and XS, this is no longer supported.
</p>
-<H3><a name="Perl5_nn19"></a>29.4.5 Structures</H3>
+<H3><a name="Perl5_nn19"></a>30.4.5 Structures</H3>
<p>
@@ -1094,7 +1094,7 @@ void Bar_f_set(Bar *b, Foo *val) {
</div>
-<H3><a name="Perl5_nn20"></a>29.4.6 C++ classes</H3>
+<H3><a name="Perl5_nn20"></a>30.4.6 C++ classes</H3>
<p>
@@ -1159,7 +1159,7 @@ provides direct access to C++ objects. A higher level interface using Perl prox
can be built using these low-level accessors. This is described shortly.
</p>
-<H3><a name="Perl5_nn21"></a>29.4.7 C++ classes and type-checking</H3>
+<H3><a name="Perl5_nn21"></a>30.4.7 C++ classes and type-checking</H3>
<p>
@@ -1195,7 +1195,7 @@ If necessary, the type-checker also adjusts the value of the pointer (as is nece
multiple inheritance is used).
</p>
-<H3><a name="Perl5_nn22"></a>29.4.8 C++ overloaded functions</H3>
+<H3><a name="Perl5_nn22"></a>30.4.8 C++ overloaded functions</H3>
<p>
@@ -1239,7 +1239,7 @@ example::Spam_foo_d($s,3.14);
Please refer to the "SWIG Basics" chapter for more information.
</p>
-<H3><a name="Perl5_nn23"></a>29.4.9 Operators</H3>
+<H3><a name="Perl5_nn23"></a>30.4.9 Operators</H3>
<p>
@@ -1266,7 +1266,7 @@ The following C++ operators are currently supported by the Perl module:
<li>operator or </li>
</ul>
-<H3><a name="Perl5_nn24"></a>29.4.10 Modules and packages</H3>
+<H3><a name="Perl5_nn24"></a>30.4.10 Modules and packages</H3>
<p>
@@ -1361,7 +1361,7 @@ print Foo::fact(4),"\n"; # Call a function in package FooBar
</pre></div>
-->
-<H2><a name="Perl5_nn25"></a>29.5 Input and output parameters</H2>
+<H2><a name="Perl5_nn25"></a>30.5 Input and output parameters</H2>
<p>
@@ -1580,7 +1580,7 @@ print "$c\n";
<b>Note:</b> The <tt>REFERENCE</tt> feature is only currently supported for numeric types (integers and floating point).
</p>
-<H2><a name="Perl5_nn26"></a>29.6 Exception handling</H2>
+<H2><a name="Perl5_nn26"></a>30.6 Exception handling</H2>
<p>
@@ -1745,7 +1745,7 @@ This is still supported, but it is deprecated. The newer <tt>%exception</tt> di
functionality, but it has additional capabilities that make it more powerful.
</p>
-<H2><a name="Perl5_nn27"></a>29.7 Remapping datatypes with typemaps</H2>
+<H2><a name="Perl5_nn27"></a>30.7 Remapping datatypes with typemaps</H2>
<p>
@@ -1762,7 +1762,7 @@ Typemaps are only used if you want to change some aspect of the primitive
C-Perl interface.
</p>
-<H3><a name="Perl5_nn28"></a>29.7.1 A simple typemap example</H3>
+<H3><a name="Perl5_nn28"></a>30.7.1 A simple typemap example</H3>
<p>
@@ -1866,7 +1866,7 @@ example::count("e","Hello World");
</div>
-<H3><a name="Perl5_nn29"></a>29.7.2 Perl5 typemaps</H3>
+<H3><a name="Perl5_nn29"></a>30.7.2 Perl5 typemaps</H3>
<p>
@@ -1971,7 +1971,7 @@ Return of C++ member data (all languages).
Check value of input parameter.
</div>
-<H3><a name="Perl5_nn30"></a>29.7.3 Typemap variables</H3>
+<H3><a name="Perl5_nn30"></a>30.7.3 Typemap variables</H3>
<p>
@@ -2042,7 +2042,7 @@ properly assigned.
The Perl name of the wrapper function being created.
</div>
-<H3><a name="Perl5_nn31"></a>29.7.4 Useful functions</H3>
+<H3><a name="Perl5_nn31"></a>30.7.4 Useful functions</H3>
<p>
@@ -2111,7 +2111,7 @@ int sv_isa(SV *, char *0;
</div>
-<H2><a name="Perl5_nn32"></a>29.8 Typemap Examples</H2>
+<H2><a name="Perl5_nn32"></a>30.8 Typemap Examples</H2>
<p>
@@ -2120,7 +2120,7 @@ might look at the files "<tt>perl5.swg</tt>" and "<tt>typemaps.i</tt>" in
the SWIG library.
</p>
-<H3><a name="Perl5_nn33"></a>29.8.1 Converting a Perl5 array to a char **</H3>
+<H3><a name="Perl5_nn33"></a>30.8.1 Converting a Perl5 array to a char **</H3>
<p>
@@ -2212,7 +2212,7 @@ print @$b,"\n"; # Print it out
</pre></div>
-<H3><a name="Perl5_nn34"></a>29.8.2 Return values</H3>
+<H3><a name="Perl5_nn34"></a>30.8.2 Return values</H3>
<p>
@@ -2241,7 +2241,7 @@ can be done using the <tt>EXTEND()</tt> macro as in :
}
</pre></div>
-<H3><a name="Perl5_nn35"></a>29.8.3 Returning values from arguments</H3>
+<H3><a name="Perl5_nn35"></a>30.8.3 Returning values from arguments</H3>
<p>
@@ -2295,7 +2295,7 @@ print "multout(7,13) = @r\n";
($x,$y) = multout(7,13);
</pre></div>
-<H3><a name="Perl5_nn36"></a>29.8.4 Accessing array structure members</H3>
+<H3><a name="Perl5_nn36"></a>30.8.4 Accessing array structure members</H3>
<p>
@@ -2358,7 +2358,7 @@ the "in" typemap in the previous section would be used to convert an
to copy the converted array into a C data structure.
</p>
-<H3><a name="Perl5_nn37"></a>29.8.5 Turning Perl references into C pointers</H3>
+<H3><a name="Perl5_nn37"></a>30.8.5 Turning Perl references into C pointers</H3>
<p>
@@ -2423,7 +2423,7 @@ print "$c\n";
</pre></div>
-<H3><a name="Perl5_nn38"></a>29.8.6 Pointer handling</H3>
+<H3><a name="Perl5_nn38"></a>30.8.6 Pointer handling</H3>
<p>
@@ -2502,7 +2502,7 @@ For example:
</pre>
</div>
-<H2><a name="Perl5_nn39"></a>29.9 Proxy classes</H2>
+<H2><a name="Perl5_nn39"></a>30.9 Proxy classes</H2>
<p>
@@ -2518,7 +2518,7 @@ to the underlying code. This section describes the implementation
details of the proxy interface.
</p>
-<H3><a name="Perl5_nn40"></a>29.9.1 Preliminaries</H3>
+<H3><a name="Perl5_nn40"></a>30.9.1 Preliminaries</H3>
<p>
@@ -2540,7 +2540,7 @@ SWIG creates a collection of high-level Perl wrappers. In your scripts, you wil
high level wrappers. The wrappers, in turn, interact with the low-level procedural module.
</p>
-<H3><a name="Perl5_nn41"></a>29.9.2 Structure and class wrappers</H3>
+<H3><a name="Perl5_nn41"></a>30.9.2 Structure and class wrappers</H3>
<p>
@@ -2666,7 +2666,7 @@ $v-&gt;DESTROY();
</pre></div>
-<H3><a name="Perl5_nn42"></a>29.9.3 Object Ownership</H3>
+<H3><a name="Perl5_nn42"></a>30.9.3 Object Ownership</H3>
<p>
@@ -2753,7 +2753,7 @@ counting, garbage collection, or advanced features one might find in
sophisticated languages.
</p>
-<H3><a name="Perl5_nn43"></a>29.9.4 Nested Objects</H3>
+<H3><a name="Perl5_nn43"></a>30.9.4 Nested Objects</H3>
<p>
@@ -2806,7 +2806,7 @@ $p-&gt;{f}-&gt;{x} = 0.0;
%${$p-&gt;{v}} = ( x=&gt;0, y=&gt;0, z=&gt;0);
</pre></div>
-<H3><a name="Perl5_nn44"></a>29.9.5 Proxy Functions</H3>
+<H3><a name="Perl5_nn44"></a>30.9.5 Proxy Functions</H3>
<p>
@@ -2840,7 +2840,7 @@ This function replaces the original function, but operates in an
identical manner.
</p>
-<H3><a name="Perl5_nn45"></a>29.9.6 Inheritance</H3>
+<H3><a name="Perl5_nn45"></a>30.9.6 Inheritance</H3>
<p>
@@ -2916,7 +2916,7 @@ particular, inheritance of data members is extremely tricky (and I'm
not even sure if it really works).
</p>
-<H3><a name="Perl5_nn46"></a>29.9.7 Modifying the proxy methods</H3>
+<H3><a name="Perl5_nn46"></a>30.9.7 Modifying the proxy methods</H3>
<p>
@@ -2944,7 +2944,7 @@ public:
};
</pre></div>
-<H2><a name="Perl5_nn47"></a>29.10 Adding additional Perl code</H2>
+<H2><a name="Perl5_nn47"></a>30.10 Adding additional Perl code</H2>
<p>
diff --git a/Doc/Manual/Php.html b/Doc/Manual/Php.html
index c9ee74f..797cb05 100644
--- a/Doc/Manual/Php.html
+++ b/Doc/Manual/Php.html
@@ -7,7 +7,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="Php"></a>30 SWIG and PHP</H1>
+<H1><a name="Php"></a>31 SWIG and PHP</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -75,7 +75,7 @@ your extension into php directly, you will need the complete PHP source tree
available.
</p>
-<H2><a name="Php_nn1"></a>30.1 Generating PHP Extensions</H2>
+<H2><a name="Php_nn1"></a>31.1 Generating PHP Extensions</H2>
<p>
@@ -122,7 +122,7 @@ and it doesn't play nicely with package system. We don't recommend
this approach, or provide explicit support for it.
</p>
-<H3><a name="Php_nn1_1"></a>30.1.1 Building a loadable extension</H3>
+<H3><a name="Php_nn1_1"></a>31.1.1 Building a loadable extension</H3>
<p>
@@ -137,7 +137,7 @@ least work for Linux though):
gcc -shared example_wrap.o -o example.so
</pre></div>
-<H3><a name="Php_nn1_3"></a>30.1.2 Using PHP Extensions</H3>
+<H3><a name="Php_nn1_3"></a>31.1.2 Using PHP Extensions</H3>
<p>
@@ -168,7 +168,7 @@ attempts to do the <tt>dl()</tt> call for you:
include("example.php");
</pre></div>
-<H2><a name="Php_nn2"></a>30.2 Basic PHP interface</H2>
+<H2><a name="Php_nn2"></a>31.2 Basic PHP interface</H2>
<p>
@@ -178,7 +178,7 @@ possible for names of symbols in one extension module to clash with
other symbols unless care is taken to <tt>%rename</tt> them.
</p>
-<H3><a name="Php_nn2_1"></a>30.2.1 Constants</H3>
+<H3><a name="Php_nn2_1"></a>31.2.1 Constants</H3>
<p>
@@ -303,7 +303,7 @@ both point to the same value, without the case test taking place. (
Apologies, this paragraph needs rewriting to make some sense. )
</p>
-<H3><a name="Php_nn2_2"></a>30.2.2 Global Variables</H3>
+<H3><a name="Php_nn2_2"></a>31.2.2 Global Variables</H3>
<p>
@@ -352,7 +352,7 @@ undefined.
At this time SWIG does not support custom accessor methods.
</p>
-<H3><a name="Php_nn2_3"></a>30.2.3 Functions</H3>
+<H3><a name="Php_nn2_3"></a>31.2.3 Functions</H3>
<p>
@@ -405,7 +405,7 @@ print $s; # The value of $s was not changed.
-->
-<H3><a name="Php_nn2_4"></a>30.2.4 Overloading</H3>
+<H3><a name="Php_nn2_4"></a>31.2.4 Overloading</H3>
<p>
@@ -461,7 +461,7 @@ taking the integer argument.
</p>
-->
-<H3><a name="Php_nn2_5"></a>30.2.5 Pointers and References</H3>
+<H3><a name="Php_nn2_5"></a>31.2.5 Pointers and References</H3>
<p>
@@ -593,7 +593,7 @@ PHP in a number of ways: by using <tt>unset</tt> on an existing
variable, or assigning <tt>NULL</tt> to a variable.
</p>
-<H3><a name="Php_nn2_6"></a>30.2.6 Structures and C++ classes</H3>
+<H3><a name="Php_nn2_6"></a>31.2.6 Structures and C++ classes</H3>
<p>
@@ -652,7 +652,7 @@ Would be used in the following way from PHP5:
Member variables and methods are accessed using the <tt>-&gt;</tt> operator.
</p>
-<H4><a name="Php_nn2_6_1"></a>30.2.6.1 Using <tt>-noproxy</tt></H4>
+<H4><a name="Php_nn2_6_1"></a>31.2.6.1 Using <tt>-noproxy</tt></H4>
<p>
@@ -678,7 +678,7 @@ Complex_im_set($obj,$d);
Complex_im_get($obj);
</pre></div>
-<H4><a name="Php_nn2_6_2"></a>30.2.6.2 Constructors and Destructors</H4>
+<H4><a name="Php_nn2_6_2"></a>31.2.6.2 Constructors and Destructors</H4>
<p>
@@ -719,7 +719,7 @@ the programmer can either reassign the variable or call
<tt>unset($v)</tt>
</p>
-<H4><a name="Php_nn2_6_3"></a>30.2.6.3 Static Member Variables</H4>
+<H4><a name="Php_nn2_6_3"></a>31.2.6.3 Static Member Variables</H4>
<p>
@@ -762,7 +762,7 @@ Ko::threats(10);
echo "There has now been " . Ko::threats() . " threats\n";
</pre></div>
-<H4><a name="Php_nn2_6_4"></a>30.2.6.4 Static Member Functions</H4>
+<H4><a name="Php_nn2_6_4"></a>31.2.6.4 Static Member Functions</H4>
<p>
@@ -784,7 +784,7 @@ Ko::threats();
</pre></div>
-<H3><a name="Php_nn2_7"></a>30.2.7 PHP Pragmas, Startup and Shutdown code</H3>
+<H3><a name="Php_nn2_7"></a>31.2.7 PHP Pragmas, Startup and Shutdown code</H3>
<p>
@@ -872,7 +872,7 @@ The <tt>%rinit</tt> and <tt>%rshutdown</tt> statements are very similar but inse
into the request init (PHP_RINIT_FUNCTION) and request shutdown (PHP_RSHUTDOWN_FUNCTION) code respectively.
</p>
-<H2><a name="Php_nn3"></a>30.3 Cross language polymorphism</H2>
+<H2><a name="Php_nn3"></a>31.3 Cross language polymorphism</H2>
<p>
@@ -907,7 +907,7 @@ wrapper functions takes care of all the cross-language method routing
transparently.
</p>
-<H3><a name="Php_nn3_1"></a>30.3.1 Enabling directors</H3>
+<H3><a name="Php_nn3_1"></a>31.3.1 Enabling directors</H3>
<p>
@@ -999,7 +999,7 @@ class MyFoo extends Foo {
</div>
-<H3><a name="Php_nn3_2"></a>30.3.2 Director classes</H3>
+<H3><a name="Php_nn3_2"></a>31.3.2 Director classes</H3>
@@ -1079,7 +1079,7 @@ so there is no need for the extra overhead involved with routing the
calls through PHP.
</p>
-<H3><a name="Php_nn3_3"></a>30.3.3 Ownership and object destruction</H3>
+<H3><a name="Php_nn3_3"></a>31.3.3 Ownership and object destruction</H3>
<p>
@@ -1135,7 +1135,7 @@ In this example, we are assuming that FooContainer will take care of
deleting all the Foo pointers it contains at some point.
</p>
-<H3><a name="Php_nn3_4"></a>30.3.4 Exception unrolling</H3>
+<H3><a name="Php_nn3_4"></a>31.3.4 Exception unrolling</H3>
<p>
@@ -1194,7 +1194,7 @@ Swig::DirectorMethodException is thrown, PHP will register the exception
as soon as the C wrapper function returns.
</p>
-<H3><a name="Php_nn3_5"></a>30.3.5 Overhead and code bloat</H3>
+<H3><a name="Php_nn3_5"></a>31.3.5 Overhead and code bloat</H3>
<p>
@@ -1227,7 +1227,7 @@ optimized by selectively enabling director methods (using the %feature
directive) for only those methods that are likely to be extended in PHP.
</p>
-<H3><a name="Php_nn3_6"></a>30.3.6 Typemaps</H3>
+<H3><a name="Php_nn3_6"></a>31.3.6 Typemaps</H3>
<p>
@@ -1241,7 +1241,7 @@ need to be supported.
</p>
-<H3><a name="Php_nn3_7"></a>30.3.7 Miscellaneous</H3>
+<H3><a name="Php_nn3_7"></a>31.3.7 Miscellaneous</H3>
<p> Director typemaps for STL classes are mostly in place, and hence you
diff --git a/Doc/Manual/Pike.html b/Doc/Manual/Pike.html
index 8f9e437..8bd6b41 100644
--- a/Doc/Manual/Pike.html
+++ b/Doc/Manual/Pike.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="Pike"></a>31 SWIG and Pike</H1>
+<H1><a name="Pike"></a>32 SWIG and Pike</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -46,10 +46,10 @@ least, make sure you read the "<a href="SWIG.html#SWIG">SWIG Basics</a>"
chapter.<br>
</p>
-<H2><a name="Pike_nn2"></a>31.1 Preliminaries</H2>
+<H2><a name="Pike_nn2"></a>32.1 Preliminaries</H2>
-<H3><a name="Pike_nn3"></a>31.1.1 Running SWIG</H3>
+<H3><a name="Pike_nn3"></a>32.1.1 Running SWIG</H3>
<p>
@@ -94,7 +94,7 @@ can use the <tt>-o</tt> option:
<div class="code">
<pre>$ <b>swig -pike -o pseudonym.c example.i</b><br></pre>
</div>
-<H3><a name="Pike_nn4"></a>31.1.2 Getting the right header files</H3>
+<H3><a name="Pike_nn4"></a>32.1.2 Getting the right header files</H3>
<p>
@@ -114,7 +114,7 @@ You're looking for files with the names <tt>global.h</tt>, <tt>program.h</tt>
and so on.
</p>
-<H3><a name="Pike_nn5"></a>31.1.3 Using your module</H3>
+<H3><a name="Pike_nn5"></a>32.1.3 Using your module</H3>
<p>
@@ -129,10 +129,10 @@ Pike v7.4 release 10 running Hilfe v3.5 (Incremental Pike Frontend)
(1) Result: 24
</pre></div>
-<H2><a name="Pike_nn6"></a>31.2 Basic C/C++ Mapping</H2>
+<H2><a name="Pike_nn6"></a>32.2 Basic C/C++ Mapping</H2>
-<H3><a name="Pike_nn7"></a>31.2.1 Modules</H3>
+<H3><a name="Pike_nn7"></a>32.2.1 Modules</H3>
<p>
@@ -143,7 +143,7 @@ concerned), SWIG's <tt>%module</tt> directive doesn't really have any
significance.
</p>
-<H3><a name="Pike_nn8"></a>31.2.2 Functions</H3>
+<H3><a name="Pike_nn8"></a>32.2.2 Functions</H3>
<p>
@@ -168,7 +168,7 @@ exactly as you'd expect it to:
(1) Result: 24
</pre></div>
-<H3><a name="Pike_nn9"></a>31.2.3 Global variables</H3>
+<H3><a name="Pike_nn9"></a>32.2.3 Global variables</H3>
<p>
@@ -197,7 +197,7 @@ will result in two functions, <tt>Foo_get()</tt> and <tt>Foo_set()</tt>:
(3) Result: 3.141590
</pre></div>
-<H3><a name="Pike_nn10"></a>31.2.4 Constants and enumerated types</H3>
+<H3><a name="Pike_nn10"></a>32.2.4 Constants and enumerated types</H3>
<p>
@@ -205,7 +205,7 @@ Enumerated types in C/C++ declarations are wrapped as Pike constants,
not as Pike enums.
</p>
-<H3><a name="Pike_nn11"></a>31.2.5 Constructors and Destructors</H3>
+<H3><a name="Pike_nn11"></a>32.2.5 Constructors and Destructors</H3>
<p>
@@ -213,7 +213,7 @@ Constructors are wrapped as <tt>create()</tt> methods, and destructors are
wrapped as <tt>destroy()</tt> methods, for Pike classes.
</p>
-<H3><a name="Pike_nn12"></a>31.2.6 Static Members</H3>
+<H3><a name="Pike_nn12"></a>32.2.6 Static Members</H3>
<p>
diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html
index 23271e6..1b8a3f6 100644
--- a/Doc/Manual/Python.html
+++ b/Doc/Manual/Python.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="Python"></a>32 SWIG and Python</H1>
+<H1><a name="Python"></a>33 SWIG and Python</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -128,7 +128,7 @@ very least, make sure you read the "<a href="SWIG.html#SWIG">SWIG
Basics</a>" chapter.
</p>
-<H2><a name="Python_nn2"></a>32.1 Overview</H2>
+<H2><a name="Python_nn2"></a>33.1 Overview</H2>
<p>
@@ -155,10 +155,10 @@ described followed by a discussion of low-level implementation
details.
</p>
-<H2><a name="Python_nn3"></a>32.2 Preliminaries</H2>
+<H2><a name="Python_nn3"></a>33.2 Preliminaries</H2>
-<H3><a name="Python_nn4"></a>32.2.1 Running SWIG</H3>
+<H3><a name="Python_nn4"></a>33.2.1 Running SWIG</H3>
<p>
@@ -256,13 +256,13 @@ The following sections have further practical examples and details on
how you might go about compiling and using the generated files.
</p>
-<H3><a name="Python_nn6"></a>32.2.2 Using distutils</H3>
+<H3><a name="Python_nn6"></a>33.2.2 Using distutils</H3>
<p>
The preferred approach to building an extension module for python is to compile it with
distutils, which comes with all recent versions of python
-(<a href="http://docs.python.org/dist/dist.html">Distutils Docs</a>).
+(<a href="http://docs.python.org/distutils/index.html">Distutils Docs</a>).
</p>
<p>
@@ -348,7 +348,7 @@ This same approach works on all platforms if the appropriate compiler is install
can even build extensions to the standard Windows Python using MingGW)
</p>
-<H3><a name="Python_nn7"></a>32.2.3 Hand compiling a dynamic module</H3>
+<H3><a name="Python_nn7"></a>33.2.3 Hand compiling a dynamic module</H3>
<p>
@@ -396,7 +396,7 @@ module actually consists of two files; <tt>socket.py</tt> and
</p>
-<H3><a name="Python_nn8"></a>32.2.4 Static linking</H3>
+<H3><a name="Python_nn8"></a>33.2.4 Static linking</H3>
<p>
@@ -475,7 +475,7 @@ If using static linking, you might want to rely on a different approach
(perhaps using distutils).
</p>
-<H3><a name="Python_nn9"></a>32.2.5 Using your module</H3>
+<H3><a name="Python_nn9"></a>33.2.5 Using your module</H3>
<p>
@@ -632,7 +632,7 @@ system configuration (this requires root access and you will need to
read the man pages).
</p>
-<H3><a name="Python_nn10"></a>32.2.6 Compilation of C++ extensions</H3>
+<H3><a name="Python_nn10"></a>33.2.6 Compilation of C++ extensions</H3>
<p>
@@ -724,7 +724,7 @@ erratic program behavior. If working with lots of software components, you
might want to investigate using a more formal standard such as COM.
</p>
-<H3><a name="Python_nn11"></a>32.2.7 Compiling for 64-bit platforms</H3>
+<H3><a name="Python_nn11"></a>33.2.7 Compiling for 64-bit platforms</H3>
<p>
@@ -761,7 +761,7 @@ and -m64 allow you to choose the desired binary format for your python
extension.
</p>
-<H3><a name="Python_nn12"></a>32.2.8 Building Python Extensions under Windows</H3>
+<H3><a name="Python_nn12"></a>33.2.8 Building Python Extensions under Windows</H3>
<p>
@@ -870,7 +870,7 @@ SWIG Wiki</a>.
</p>
-<H2><a name="Python_nn13"></a>32.3 A tour of basic C/C++ wrapping</H2>
+<H2><a name="Python_nn13"></a>33.3 A tour of basic C/C++ wrapping</H2>
<p>
@@ -879,7 +879,7 @@ to your C/C++ code. Functions are wrapped as functions, classes are wrapped as
This section briefly covers the essential aspects of this wrapping.
</p>
-<H3><a name="Python_nn14"></a>32.3.1 Modules</H3>
+<H3><a name="Python_nn14"></a>33.3.1 Modules</H3>
<p>
@@ -892,7 +892,7 @@ module name, make sure you don't use the same name as a built-in
Python command or standard module name.
</p>
-<H3><a name="Python_nn15"></a>32.3.2 Functions</H3>
+<H3><a name="Python_nn15"></a>33.3.2 Functions</H3>
<p>
@@ -916,7 +916,7 @@ like you think it does:
&gt;&gt;&gt;
</pre></div>
-<H3><a name="Python_nn16"></a>32.3.3 Global variables</H3>
+<H3><a name="Python_nn16"></a>33.3.3 Global variables</H3>
<p>
@@ -1054,7 +1054,7 @@ that starts with a leading underscore. SWIG does not create <tt>cvar</tt>
if there are no global variables in a module.
</p>
-<H3><a name="Python_nn17"></a>32.3.4 Constants and enums</H3>
+<H3><a name="Python_nn17"></a>33.3.4 Constants and enums</H3>
<p>
@@ -1094,7 +1094,7 @@ other object. Unfortunately, there is no easy way for SWIG to
generate code that prevents this. You will just have to be careful.
</p>
-<H3><a name="Python_nn18"></a>32.3.5 Pointers</H3>
+<H3><a name="Python_nn18"></a>33.3.5 Pointers</H3>
<p>
@@ -1235,7 +1235,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return
<tt>None</tt> if the conversion can't be performed.
</p>
-<H3><a name="Python_nn19"></a>32.3.6 Structures</H3>
+<H3><a name="Python_nn19"></a>33.3.6 Structures</H3>
<p>
@@ -1424,7 +1424,7 @@ everything works just like you would expect. For example:
</pre>
</div>
-<H3><a name="Python_nn20"></a>32.3.7 C++ classes</H3>
+<H3><a name="Python_nn20"></a>33.3.7 C++ classes</H3>
<p>
@@ -1513,7 +1513,7 @@ they are accessed through <tt>cvar</tt> like this:
</pre>
</div>
-<H3><a name="Python_nn21"></a>32.3.8 C++ inheritance</H3>
+<H3><a name="Python_nn21"></a>33.3.8 C++ inheritance</H3>
<p>
@@ -1568,7 +1568,7 @@ then the function <tt>spam()</tt> accepts <tt>Foo *</tt> or a pointer to any cla
It is safe to use multiple inheritance with SWIG.
</p>
-<H3><a name="Python_nn22"></a>32.3.9 Pointers, references, values, and arrays</H3>
+<H3><a name="Python_nn22"></a>33.3.9 Pointers, references, values, and arrays</H3>
<p>
@@ -1629,7 +1629,7 @@ treated as a returning value, and it will follow the same
allocation/deallocation process.
</p>
-<H3><a name="Python_nn23"></a>32.3.10 C++ overloaded functions</H3>
+<H3><a name="Python_nn23"></a>33.3.10 C++ overloaded functions</H3>
<p>
@@ -1752,7 +1752,7 @@ first declaration takes precedence.
Please refer to the "SWIG and C++" chapter for more information about overloading.
</p>
-<H3><a name="Python_nn24"></a>32.3.11 C++ operators</H3>
+<H3><a name="Python_nn24"></a>33.3.11 C++ operators</H3>
<p>
@@ -1841,7 +1841,7 @@ Also, be aware that certain operators don't map cleanly to Python. For instance
overloaded assignment operators don't map to Python semantics and will be ignored.
</p>
-<H3><a name="Python_nn25"></a>32.3.12 C++ namespaces</H3>
+<H3><a name="Python_nn25"></a>33.3.12 C++ namespaces</H3>
<p>
@@ -1908,7 +1908,7 @@ utilizes thousands of small deeply nested namespaces each with
identical symbol names, well, then you get what you deserve.
</p>
-<H3><a name="Python_nn26"></a>32.3.13 C++ templates</H3>
+<H3><a name="Python_nn26"></a>33.3.13 C++ templates</H3>
<p>
@@ -1962,7 +1962,7 @@ Some more complicated
examples will appear later.
</p>
-<H3><a name="Python_nn27"></a>32.3.14 C++ Smart Pointers</H3>
+<H3><a name="Python_nn27"></a>33.3.14 C++ Smart Pointers</H3>
<p>
@@ -2047,7 +2047,7 @@ simply use the <tt>__deref__()</tt> method. For example:
</div>
-<H3><a name="Python_nn27a"></a>32.3.15 C++ Reference Counted Objects (ref/unref)</H3>
+<H3><a name="Python_nn27a"></a>33.3.15 C++ Reference Counted Objects (ref/unref)</H3>
<p>
@@ -2190,7 +2190,7 @@ python releases the proxy instance.
</p>
-<H2><a name="Python_nn28"></a>32.4 Further details on the Python class interface</H2>
+<H2><a name="Python_nn28"></a>33.4 Further details on the Python class interface</H2>
<p>
@@ -2203,7 +2203,7 @@ of low-level details were omitted. This section provides a brief overview
of how the proxy classes work.
</p>
-<H3><a name="Python_nn29"></a>32.4.1 Proxy classes</H3>
+<H3><a name="Python_nn29"></a>33.4.1 Proxy classes</H3>
<p>
@@ -2292,7 +2292,7 @@ you can attach new Python methods to the class and you can even inherit from it
by Python built-in types until Python 2.2).
</p>
-<H3><a name="Python_nn30"></a>32.4.2 Memory management</H3>
+<H3><a name="Python_nn30"></a>33.4.2 Memory management</H3>
<p>
@@ -2484,7 +2484,7 @@ It is also possible to deal with situations like this using
typemaps--an advanced topic discussed later.
</p>
-<H3><a name="Python_nn31"></a>32.4.3 Python 2.2 and classic classes</H3>
+<H3><a name="Python_nn31"></a>33.4.3 Python 2.2 and classic classes</H3>
<p>
@@ -2521,7 +2521,7 @@ class itself. In Python-2.1 and earlier, they have to be accessed as a global
function or through an instance (see the earlier section).
</p>
-<H2><a name="Python_directors"></a>32.5 Cross language polymorphism</H2>
+<H2><a name="Python_directors"></a>33.5 Cross language polymorphism</H2>
<p>
@@ -2555,7 +2555,7 @@ proxy classes, director classes, and C wrapper functions takes care of
all the cross-language method routing transparently.
</p>
-<H3><a name="Python_nn33"></a>32.5.1 Enabling directors</H3>
+<H3><a name="Python_nn33"></a>33.5.1 Enabling directors</H3>
<p>
@@ -2648,7 +2648,7 @@ class MyFoo(mymodule.Foo):
</div>
-<H3><a name="Python_nn34"></a>32.5.2 Director classes</H3>
+<H3><a name="Python_nn34"></a>33.5.2 Director classes</H3>
@@ -2730,7 +2730,7 @@ so there is no need for the extra overhead involved with routing the
calls through Python.
</p>
-<H3><a name="Python_nn35"></a>32.5.3 Ownership and object destruction</H3>
+<H3><a name="Python_nn35"></a>33.5.3 Ownership and object destruction</H3>
<p>
@@ -2797,7 +2797,7 @@ deleting all the Foo pointers it contains at some point. Note that no hard
references to the Foo objects remain in Python.
</p>
-<H3><a name="Python_nn36"></a>32.5.4 Exception unrolling</H3>
+<H3><a name="Python_nn36"></a>33.5.4 Exception unrolling</H3>
<p>
@@ -2856,7 +2856,7 @@ Swig::DirectorMethodException is thrown, Python will register the
exception as soon as the C wrapper function returns.
</p>
-<H3><a name="Python_nn37"></a>32.5.5 Overhead and code bloat</H3>
+<H3><a name="Python_nn37"></a>33.5.5 Overhead and code bloat</H3>
<p>
@@ -2890,7 +2890,7 @@ directive) for only those methods that are likely to be extended in
Python.
</p>
-<H3><a name="Python_nn38"></a>32.5.6 Typemaps</H3>
+<H3><a name="Python_nn38"></a>33.5.6 Typemaps</H3>
<p>
@@ -2904,7 +2904,7 @@ need to be supported.
</p>
-<H3><a name="Python_nn39"></a>32.5.7 Miscellaneous</H3>
+<H3><a name="Python_nn39"></a>33.5.7 Miscellaneous</H3>
<p>
@@ -2951,7 +2951,7 @@ methods that return const references.
</p>
-<H2><a name="Python_nn40"></a>32.6 Common customization features</H2>
+<H2><a name="Python_nn40"></a>33.6 Common customization features</H2>
<p>
@@ -2964,7 +2964,7 @@ This section describes some common SWIG features that are used to
improve your the interface to an extension module.
</p>
-<H3><a name="Python_nn41"></a>32.6.1 C/C++ helper functions</H3>
+<H3><a name="Python_nn41"></a>33.6.1 C/C++ helper functions</H3>
<p>
@@ -3045,7 +3045,7 @@ hard to implement. It is possible to clean this up using Python code, typemaps,
customization features as covered in later sections.
</p>
-<H3><a name="Python_nn42"></a>32.6.2 Adding additional Python code</H3>
+<H3><a name="Python_nn42"></a>33.6.2 Adding additional Python code</H3>
<p>
@@ -3194,7 +3194,7 @@ public:
-<H3><a name="Python_nn43"></a>32.6.3 Class extension with %extend</H3>
+<H3><a name="Python_nn43"></a>33.6.3 Class extension with %extend</H3>
<p>
@@ -3283,7 +3283,7 @@ Vector(12,14,16)
in any way---the extensions only show up in the Python interface.
</p>
-<H3><a name="Python_nn44"></a>32.6.4 Exception handling with %exception</H3>
+<H3><a name="Python_nn44"></a>33.6.4 Exception handling with %exception</H3>
<p>
@@ -3409,7 +3409,7 @@ The language-independent <tt>exception.i</tt> library file can also be used
to raise exceptions. See the <a href="Library.html#Library">SWIG Library</a> chapter.
</p>
-<H2><a name="Python_nn45"></a>32.7 Tips and techniques</H2>
+<H2><a name="Python_nn45"></a>33.7 Tips and techniques</H2>
<p>
@@ -3419,7 +3419,7 @@ strings, binary data, and arrays. This chapter discusses the common techniques
solving these problems.
</p>
-<H3><a name="Python_nn46"></a>32.7.1 Input and output parameters</H3>
+<H3><a name="Python_nn46"></a>33.7.1 Input and output parameters</H3>
<p>
@@ -3632,7 +3632,7 @@ void foo(Bar *OUTPUT);
may not have the intended effect since <tt>typemaps.i</tt> does not define an OUTPUT rule for <tt>Bar</tt>.
</p>
-<H3><a name="Python_nn47"></a>32.7.2 Simple pointers</H3>
+<H3><a name="Python_nn47"></a>33.7.2 Simple pointers</H3>
<p>
@@ -3701,7 +3701,7 @@ If you replace <tt>%pointer_functions()</tt> by <tt>%pointer_class(type,name)</t
See the <a href="Library.html#Library">SWIG Library</a> chapter for further details.
</p>
-<H3><a name="Python_nn48"></a>32.7.3 Unbounded C Arrays</H3>
+<H3><a name="Python_nn48"></a>33.7.3 Unbounded C Arrays</H3>
<p>
@@ -3763,7 +3763,7 @@ well suited for applications in which you need to create buffers,
package binary data, etc.
</p>
-<H3><a name="Python_nn49"></a>32.7.4 String handling</H3>
+<H3><a name="Python_nn49"></a>33.7.4 String handling</H3>
<p>
@@ -3832,7 +3832,7 @@ If you need to return binary data, you might use the
also be used to extra binary data from arbitrary pointers.
</p>
-<H2><a name="Python_nn53"></a>32.8 Typemaps</H2>
+<H2><a name="Python_nn53"></a>33.8 Typemaps</H2>
<p>
@@ -3849,7 +3849,7 @@ Typemaps are only used if you want to change some aspect of the primitive
C-Python interface or if you want to elevate your guru status.
</p>
-<H3><a name="Python_nn54"></a>32.8.1 What is a typemap?</H3>
+<H3><a name="Python_nn54"></a>33.8.1 What is a typemap?</H3>
<p>
@@ -3965,7 +3965,7 @@ parameter is omitted):
</pre>
</div>
-<H3><a name="Python_nn55"></a>32.8.2 Python typemaps</H3>
+<H3><a name="Python_nn55"></a>33.8.2 Python typemaps</H3>
<p>
@@ -4006,7 +4006,7 @@ a look at the SWIG library version 1.3.20 or so.
</p>
-<H3><a name="Python_nn56"></a>32.8.3 Typemap variables</H3>
+<H3><a name="Python_nn56"></a>33.8.3 Typemap variables</H3>
<p>
@@ -4077,7 +4077,7 @@ properly assigned.
The Python name of the wrapper function being created.
</div>
-<H3><a name="Python_nn57"></a>32.8.4 Useful Python Functions</H3>
+<H3><a name="Python_nn57"></a>33.8.4 Useful Python Functions</H3>
<p>
@@ -4205,7 +4205,7 @@ write me
</pre>
</div>
-<H2><a name="Python_nn58"></a>32.9 Typemap Examples</H2>
+<H2><a name="Python_nn58"></a>33.9 Typemap Examples</H2>
<p>
@@ -4214,7 +4214,7 @@ might look at the files "<tt>python.swg</tt>" and "<tt>typemaps.i</tt>" in
the SWIG library.
</p>
-<H3><a name="Python_nn59"></a>32.9.1 Converting Python list to a char ** </H3>
+<H3><a name="Python_nn59"></a>33.9.1 Converting Python list to a char ** </H3>
<p>
@@ -4294,7 +4294,7 @@ memory allocation is used to allocate memory for the array, the
the C function.
</p>
-<H3><a name="Python_nn60"></a>32.9.2 Expanding a Python object into multiple arguments</H3>
+<H3><a name="Python_nn60"></a>33.9.2 Expanding a Python object into multiple arguments</H3>
<p>
@@ -4373,7 +4373,7 @@ to supply the argument count. This is automatically set by the typemap code. F
</pre>
</div>
-<H3><a name="Python_nn61"></a>32.9.3 Using typemaps to return arguments</H3>
+<H3><a name="Python_nn61"></a>33.9.3 Using typemaps to return arguments</H3>
<p>
@@ -4462,7 +4462,7 @@ function can now be used as follows:
&gt;&gt;&gt;
</pre></div>
-<H3><a name="Python_nn62"></a>32.9.4 Mapping Python tuples into small arrays</H3>
+<H3><a name="Python_nn62"></a>33.9.4 Mapping Python tuples into small arrays</H3>
<p>
@@ -4511,7 +4511,7 @@ array, such an approach would not be recommended for huge arrays, but
for small structures, this approach works fine.
</p>
-<H3><a name="Python_nn63"></a>32.9.5 Mapping sequences to C arrays</H3>
+<H3><a name="Python_nn63"></a>33.9.5 Mapping sequences to C arrays</H3>
<p>
@@ -4592,7 +4592,7 @@ static int convert_darray(PyObject *input, double *ptr, int size) {
%}
%typemap(in) double [ANY](double temp[$1_dim0]) {
- if (!convert_darray($input,temp,$1_dim0))) {
+ if (!convert_darray($input,temp,$1_dim0)) {
return NULL;
}
$1 = &amp;temp[0];
@@ -4600,7 +4600,7 @@ static int convert_darray(PyObject *input, double *ptr, int size) {
</pre>
</div>
-<H3><a name="Python_nn64"></a>32.9.6 Pointer handling</H3>
+<H3><a name="Python_nn64"></a>33.9.6 Pointer handling</H3>
<p>
@@ -4697,7 +4697,7 @@ class object (if applicable).
-<H2><a name="Python_nn65"></a>32.10 Docstring Features</H2>
+<H2><a name="Python_nn65"></a>33.10 Docstring Features</H2>
<p>
@@ -4725,7 +4725,7 @@ of your users much simpler.
</p>
-<H3><a name="Python_nn66"></a>32.10.1 Module docstring</H3>
+<H3><a name="Python_nn66"></a>33.10.1 Module docstring</H3>
<p>
@@ -4759,7 +4759,7 @@ layout of controls on a panel, etc. to be loaded from an XML file."
</div>
-<H3><a name="Python_nn67"></a>32.10.2 %feature("autodoc")</H3>
+<H3><a name="Python_nn67"></a>33.10.2 %feature("autodoc")</H3>
<p>
@@ -4786,7 +4786,7 @@ names, default values if any, and return type if any. There are also
three options for autodoc controlled by the value given to the
feature, described below.
-<H4><a name="Python_nn68"></a>32.10.2.1 %feature("autodoc", "0")</H4>
+<H4><a name="Python_nn68"></a>33.10.2.1 %feature("autodoc", "0")</H4>
<p>
@@ -4815,7 +4815,7 @@ def function_name(*args, **kwargs):
</div>
-<H4><a name="Python_nn69"></a>32.10.2.2 %feature("autodoc", "1")</H4>
+<H4><a name="Python_nn69"></a>33.10.2.2 %feature("autodoc", "1")</H4>
<p>
@@ -4840,7 +4840,7 @@ def function_name(*args, **kwargs):
-<H4><a name="Python_nn70"></a>32.10.2.3 %feature("autodoc", "docstring")</H4>
+<H4><a name="Python_nn70"></a>33.10.2.3 %feature("autodoc", "docstring")</H4>
<p>
@@ -4859,7 +4859,7 @@ void GetPosition(int* OUTPUT, int* OUTPUT);
</div>
-<H3><a name="Python_nn71"></a>32.10.3 %feature("docstring")</H3>
+<H3><a name="Python_nn71"></a>33.10.3 %feature("docstring")</H3>
<p>
@@ -4891,7 +4891,7 @@ with more than one line.
</pre>
</div>
-<H2><a name="Python_nn72"></a>32.11 Python Packages</H2>
+<H2><a name="Python_nn72"></a>33.11 Python Packages</H2>
<p>
@@ -4918,7 +4918,7 @@ and also in base class declarations, etc. if the package name is
different than its own.
</p>
-<H2><a name="Python_python3support"></a>32.12 Python 3 Support</H2>
+<H2><a name="Python_python3support"></a>33.12 Python 3 Support</H2>
<p>
@@ -4945,7 +4945,7 @@ The following are Python 3.0 new features that are currently supported by
SWIG.
</p>
-<H3><a name="Python_nn74"></a>32.12.1 Function annotation</H3>
+<H3><a name="Python_nn74"></a>33.12.1 Function annotation</H3>
<p>
@@ -4977,7 +4977,7 @@ all overloaded functions share the same function in SWIG generated proxy class.
For detailed usage of function annotation, see PEP 3107.
</p>
-<H3><a name="Python_nn75"></a>32.12.2 Buffer interface</H3>
+<H3><a name="Python_nn75"></a>33.12.2 Buffer interface</H3>
<p>
@@ -5129,7 +5129,7 @@ modify the buffer.
</div>
-<H3><a name="Python_nn76"></a>32.12.3 Abstract base classes</H3>
+<H3><a name="Python_nn76"></a>33.12.3 Abstract base classes</H3>
<p>
diff --git a/Doc/Manual/R.html b/Doc/Manual/R.html
index ceea321..e8cee64 100644
--- a/Doc/Manual/R.html
+++ b/Doc/Manual/R.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="R"></a>35 SWIG and R</H1>
+<H1><a name="R"></a>34 SWIG and R</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -33,7 +33,7 @@ compile and run an R interface to QuantLib running on Mandriva Linux
with gcc. The R bindings also work on Microsoft Windows using Visual C++.
</p>
-<H2><a name="R_nn2"></a>35.1 Bugs</H2>
+<H2><a name="R_nn2"></a>34.1 Bugs</H2>
<p>
@@ -45,7 +45,7 @@ Currently the following features are not implemented or broken:
<li>C Array wrappings
</ul>
-<H2><a name="R_nn3"></a>35.2 Using R and SWIG</H2>
+<H2><a name="R_nn3"></a>34.2 Using R and SWIG</H2>
<p>
@@ -119,7 +119,7 @@ Without it, inheritance of wrapped objects may fail.
These two files can be loaded in any order
</p>
-<H2><a name="R_nn4"></a>35.3 Precompiling large R files</H2>
+<H2><a name="R_nn4"></a>34.3 Precompiling large R files</H2>
In cases where the R file is large, one make save a lot of loading
@@ -137,7 +137,7 @@ will save a large amount of loading time.
-<H2><a name="R_nn5"></a>35.4 General policy</H2>
+<H2><a name="R_nn5"></a>34.4 General policy</H2>
<p>
@@ -146,7 +146,7 @@ wrapping over the underlying functions and rely on the R type system
to provide R syntax.
</p>
-<H2><a name="R_language_conventions"></a>35.5 Language conventions</H2>
+<H2><a name="R_language_conventions"></a>34.5 Language conventions</H2>
<p>
@@ -155,7 +155,7 @@ and [ are overloaded to allow for R syntax (one based indices and
slices)
</p>
-<H2><a name="R_nn6"></a>35.6 C++ classes</H2>
+<H2><a name="R_nn6"></a>34.6 C++ classes</H2>
<p>
@@ -167,7 +167,7 @@ keep track of the pointer object which removes the necessity for a lot
of the proxy class baggage you see in other languages.
</p>
-<H2><a name="R_nn7"></a>35.7 Enumerations</H2>
+<H2><a name="R_nn7"></a>34.7 Enumerations</H2>
<p>
diff --git a/Doc/Manual/Ruby.html b/Doc/Manual/Ruby.html
index b61ded8..f21e353 100644
--- a/Doc/Manual/Ruby.html
+++ b/Doc/Manual/Ruby.html
@@ -1,32 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
<title>SWIG and Ruby</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
+<body bgcolor="#ffffff">
-<body style="background-color: rgb(255, 255, 255);">
-
-
-
-
-
-<H1><a name="Ruby"></a>33 SWIG and Ruby</H1>
+<H1><a name="Ruby"></a>35 SWIG and Ruby</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -167,7 +148,7 @@
-<H2><a name="Ruby_nn2"></a>33.1 Preliminaries</H2>
+<H2><a name="Ruby_nn2"></a>35.1 Preliminaries</H2>
<p> SWIG 1.3 is known to work with Ruby versions 1.6 and later.
@@ -190,7 +171,7 @@ of Ruby. </p>
-<H3><a name="Ruby_nn3"></a>33.1.1 Running SWIG</H3>
+<H3><a name="Ruby_nn3"></a>35.1.1 Running SWIG</H3>
<p> To build a Ruby module, run SWIG using the <tt>-ruby</tt>
@@ -244,7 +225,7 @@ to compile this file and link it with the rest of your program. </p>
-<H3><a name="Ruby_nn4"></a>33.1.2 Getting the right header files</H3>
+<H3><a name="Ruby_nn4"></a>35.1.2 Getting the right header files</H3>
<p> In order to compile the wrapper code, the compiler needs the <tt>ruby.h</tt>
@@ -255,7 +236,9 @@ header file. This file is usually contained in a directory such as </p>
<div class="code shell diagram">
-<pre>/usr/lib/ruby/1.8/x86_64-linux-gnu/ruby.h<br>/usr/local/lib/ruby/1.6/i686-linux/ruby.h<br></pre>
+<pre>/usr/lib/ruby/1.8/x86_64-linux-gnu/ruby.h
+/usr/local/lib/ruby/1.6/i686-linux/ruby.h
+</pre>
@@ -276,7 +259,10 @@ installed, you can run Ruby to find out. For example: </p>
<div class="code shell">
-<pre>$ <b>ruby -e 'puts $:.join("\n")'</b><br>/usr/local/lib/ruby/site_ruby/1.6 /usr/local/lib/ruby/site_ruby/1.6/i686-linux<br>/usr/local/lib/ruby/site_ruby /usr/local/lib/ruby/1.6 /usr/local/lib/ruby/1.6/i686-linux .<br> </pre>
+<pre>$ <b>ruby -e 'puts $:.join("\n")'</b>
+/usr/local/lib/ruby/site_ruby/1.6 /usr/local/lib/ruby/site_ruby/1.6/i686-linux
+/usr/local/lib/ruby/site_ruby /usr/local/lib/ruby/1.6 /usr/local/lib/ruby/1.6/i686-linux .
+</pre>
@@ -288,7 +274,7 @@ installed, you can run Ruby to find out. For example: </p>
-<H3><a name="Ruby_nn5"></a>33.1.3 Compiling a dynamic module</H3>
+<H3><a name="Ruby_nn5"></a>35.1.3 Compiling a dynamic module</H3>
<p> Ruby extension modules are typically compiled into shared
@@ -324,16 +310,7 @@ looks like the following:</p>
<div class="code targetlang">
-
-
-
-
<pre>require 'mkmf'<br>create_makefile('example')<br></pre>
-
-
-
-
-
</div>
@@ -401,7 +378,12 @@ can add this: </p>
<div class="code targetlang">
-<pre>open("Makefile", "a") { |mf|<br> puts &lt;&lt;EOM<br> # Your make rules go here<br> EOM<br>}<br></pre>
+<pre>open("Makefile", "a") { |mf|
+ puts &lt;&lt;EOM
+ # Your make rules go here
+ EOM
+}
+</pre>
@@ -424,7 +406,10 @@ operating system would look something like this: </p>
<div class="code shell">
-<pre>$ <b>swig -ruby example.i</b><br>$ <b>gcc -c example.c</b><br>$ <b>gcc -c example_wrap.c -I/usr/local/lib/ruby/1.6/i686-linux</b> <br>$ <b>gcc -shared example.o example_wrap.o -o example.so</b>
+<pre>$ <b>swig -ruby example.i</b>
+$ <b>gcc -c example.c</b>
+$ <b>gcc -c example_wrap.c -I/usr/local/lib/ruby/1.6/i686-linux</b>
+$ <b>gcc -shared example.o example_wrap.o -o example.so</b>
</pre>
@@ -443,7 +428,7 @@ manual pages for your compiler and linker to determine the correct set
of options. You might also check the <a href="http://www.dabeaz.com/cgi-bin/wiki.pl">SWIG Wiki</a>
for additional information. </p>
-<H3><a name="Ruby_nn6"></a>33.1.4 Using your module</H3>
+<H3><a name="Ruby_nn6"></a>35.1.4 Using your module</H3>
<p> Ruby <i>module</i> names must be capitalized,
@@ -456,7 +441,12 @@ module is imported by requiring the <b>etc</b> feature: </p>
<div class="code targetlang">
-<pre># The feature name begins with a lowercase letter...<br>require 'etc'<br><br># ... but the module name begins with an uppercase letter<br>puts "Your login name: #{Etc.getlogin}"<br></pre>
+<pre># The feature name begins with a lowercase letter...
+require 'etc'
+
+# ... but the module name begins with an uppercase letter
+puts "Your login name: #{Etc.getlogin}"
+</pre>
@@ -498,7 +488,7 @@ begins with: </p>
-<H3><a name="Ruby_nn7"></a>33.1.5 Static linking</H3>
+<H3><a name="Ruby_nn7"></a>35.1.5 Static linking</H3>
<p> An alternative approach to dynamic linking is to rebuild the
@@ -519,7 +509,7 @@ finally rebuilding Ruby. </p>
-<H3><a name="Ruby_nn8"></a>33.1.6 Compilation of C++ extensions</H3>
+<H3><a name="Ruby_nn8"></a>35.1.6 Compilation of C++ extensions</H3>
<p> On most machines, C++ extension modules should be linked
@@ -571,7 +561,7 @@ extension, e.g. </p>
-<H2><a name="Ruby_nn9"></a>33.2 Building Ruby Extensions under Windows 95/NT</H2>
+<H2><a name="Ruby_nn9"></a>35.2 Building Ruby Extensions under Windows 95/NT</H2>
<p> Building a SWIG extension to Ruby under Windows 95/NT is
@@ -610,7 +600,7 @@ files. </p>
-<H3><a name="Ruby_nn10"></a>33.2.1 Running SWIG from Developer Studio</H3>
+<H3><a name="Ruby_nn10"></a>35.2.1 Running SWIG from Developer Studio</H3>
<p> If you are developing your application within Microsoft
@@ -752,7 +742,7 @@ directory, then run the Ruby script from the DOS/Command prompt: </p>
-<H2><a name="Ruby_nn11"></a>33.3 The Ruby-to-C/C++ Mapping</H2>
+<H2><a name="Ruby_nn11"></a>35.3 The Ruby-to-C/C++ Mapping</H2>
<p> This section describes the basics of how SWIG maps C or C++
@@ -762,7 +752,7 @@ declarations in your SWIG interface files to Ruby constructs. </p>
-<H3><a name="Ruby_nn12"></a>33.3.1 Modules</H3>
+<H3><a name="Ruby_nn12"></a>35.3.1 Modules</H3>
<p> The SWIG <tt>%module</tt> directive specifies
@@ -931,7 +921,7 @@ Ruby's built-in names. </p>
-<H3><a name="Ruby_nn13"></a>33.3.2 Functions</H3>
+<H3><a name="Ruby_nn13"></a>35.3.2 Functions</H3>
<p> Global functions are wrapped as Ruby module methods. For
@@ -994,7 +984,7 @@ module that can be used like so: </p>
-<H3><a name="Ruby_nn14"></a>33.3.3 Variable Linking</H3>
+<H3><a name="Ruby_nn14"></a>35.3.3 Variable Linking</H3>
<p> C/C++ global variables are wrapped as a pair of singleton
@@ -1094,7 +1084,7 @@ effect until it is explicitly disabled using <tt>%mutable</tt>.
-<H3><a name="Ruby_nn15"></a>33.3.4 Constants</H3>
+<H3><a name="Ruby_nn15"></a>35.3.4 Constants</H3>
<p> C/C++ constants are wrapped as module constants initialized
@@ -1138,7 +1128,7 @@ constant values, e.g. </p>
-<H3><a name="Ruby_nn16"></a>33.3.5 Pointers</H3>
+<H3><a name="Ruby_nn16"></a>35.3.5 Pointers</H3>
<p> "Opaque" pointers to arbitrary C/C++ types (i.e. types that
@@ -1190,7 +1180,7 @@ the Ruby <tt>nil</tt> object. </p>
-<H3><a name="Ruby_nn17"></a>33.3.6 Structures</H3>
+<H3><a name="Ruby_nn17"></a>35.3.6 Structures</H3>
<p> C/C++ structs are wrapped as Ruby classes, with accessor
@@ -1365,7 +1355,7 @@ pointers. For example, </p>
-<H3><a name="Ruby_nn18"></a>33.3.7 C++ classes</H3>
+<H3><a name="Ruby_nn18"></a>35.3.7 C++ classes</H3>
<p> Like structs, C++ classes are wrapped by creating a new Ruby
@@ -1451,7 +1441,7 @@ class. </li>
-<H3><a name="Ruby_nn19"></a>33.3.8 C++ Inheritance</H3>
+<H3><a name="Ruby_nn19"></a>35.3.8 C++ Inheritance</H3>
<p> The SWIG type-checker is fully aware of C++ inheritance.
@@ -1682,7 +1672,7 @@ Typing"</a>). </p>
-<H3><a name="Ruby_nn20"></a>33.3.9 C++ Overloaded Functions</H3>
+<H3><a name="Ruby_nn20"></a>35.3.9 C++ Overloaded Functions</H3>
<p> C++ overloaded functions, methods, and constructors are
@@ -1882,7 +1872,7 @@ and C++"</a> chapter for more information about overloading. </p>
-<H3><a name="Ruby_nn21"></a>33.3.10 C++ Operators</H3>
+<H3><a name="Ruby_nn21"></a>35.3.10 C++ Operators</H3>
<p> For the most part, overloaded operators are handled
@@ -1963,7 +1953,7 @@ on operator overloading</a>. </p>
-<H3><a name="Ruby_nn22"></a>33.3.11 C++ namespaces</H3>
+<H3><a name="Ruby_nn22"></a>35.3.11 C++ namespaces</H3>
<p> SWIG is aware of C++ namespaces, but namespace names do not
@@ -2039,7 +2029,7 @@ identical symbol names, well, then you get what you deserve. </p>
-<H3><a name="Ruby_nn23"></a>33.3.12 C++ templates</H3>
+<H3><a name="Ruby_nn23"></a>35.3.12 C++ templates</H3>
<p> C++ templates don't present a huge problem for SWIG. However,
@@ -2083,7 +2073,7 @@ directive. For example: </p>
-<H3><a name="Ruby_nn23_1"></a>33.3.13 C++ Standard Template Library (STL)</H3>
+<H3><a name="Ruby_nn23_1"></a>35.3.13 C++ Standard Template Library (STL)</H3>
<p> On a related note, the standard SWIG library contains a
@@ -2336,7 +2326,7 @@ chapter.</p>
-<H3><a name="Ruby_C_STL_Functors"></a>33.3.14 C++ STL Functors</H3>
+<H3><a name="Ruby_C_STL_Functors"></a>35.3.14 C++ STL Functors</H3>
<p>Some containers in the STL allow you to modify their default
@@ -2536,7 +2526,7 @@ b<br style="font-weight: bold;">
-<H3><a name="Ruby_C_Iterators"></a>33.3.15 C++ STL Iterators</H3>
+<H3><a name="Ruby_C_Iterators"></a>35.3.15 C++ STL Iterators</H3>
<p>The STL is well known for the use of iterators. &nbsp;There
@@ -2733,7 +2723,7 @@ i<br>
-<span style="font-weight: bold;">&gt;&gt; [3, 4, 5 ]</span></div>
+<b>&gt;&gt; [3, 4, 5 ]</b></div>
@@ -2747,7 +2737,7 @@ i<br>
-<H3><a name="Ruby_nn24"></a>33.3.16 C++ Smart Pointers</H3>
+<H3><a name="Ruby_nn24"></a>35.3.16 C++ Smart Pointers</H3>
<p> In certain C++ programs, it is common to use classes that
@@ -2872,7 +2862,7 @@ method. For example: </p>
-<H3><a name="Ruby_nn25"></a>33.3.17 Cross-Language Polymorphism</H3>
+<H3><a name="Ruby_nn25"></a>35.3.17 Cross-Language Polymorphism</H3>
<p> SWIG's Ruby module supports cross-language polymorphism
@@ -2885,7 +2875,7 @@ using this feature with Ruby. </p>
-<H4><a name="Ruby_nn26"></a>33.3.17.1 Exception Unrolling</H4>
+<H4><a name="Ruby_nn26"></a>35.3.17.1 Exception Unrolling</H4>
<p> Whenever a C++ director class routes one of its virtual
@@ -2923,7 +2913,7 @@ caught here and a C++ exception is raised in its place. </p>
-<H2><a name="Ruby_nn27"></a>33.4 Naming</H2>
+<H2><a name="Ruby_nn27"></a>35.4 Naming</H2>
<p>Ruby has several common naming conventions. Constants are
@@ -3019,7 +3009,7 @@ planned to become the default option in future releases.</p>
-<H3><a name="Ruby_nn28"></a>33.4.1 Defining Aliases</H3>
+<H3><a name="Ruby_nn28"></a>35.4.1 Defining Aliases</H3>
<p> It's a fairly common practice in the Ruby built-ins and
@@ -3111,7 +3101,7 @@ Features"</a>) for more details).</p>
-<H3><a name="Ruby_nn29"></a>33.4.2 Predicate Methods</H3>
+<H3><a name="Ruby_nn29"></a>35.4.2 Predicate Methods</H3>
<p> Ruby methods that return a boolean value and end in a
@@ -3200,7 +3190,7 @@ Features"</a>) for more details). </p>
-<H3><a name="Ruby_nn30"></a>33.4.3 Bang Methods</H3>
+<H3><a name="Ruby_nn30"></a>35.4.3 Bang Methods</H3>
<p> Ruby methods that modify an object in-place and end in an
@@ -3264,7 +3254,7 @@ Features"</a>) for more details). </p>
-<H3><a name="Ruby_nn31"></a>33.4.4 Getters and Setters</H3>
+<H3><a name="Ruby_nn31"></a>35.4.4 Getters and Setters</H3>
<p> Often times a C++ library will expose properties through
@@ -3334,7 +3324,7 @@ methods to be exposed in Ruby as <tt>value</tt> and <tt>value=.
-<H2><a name="Ruby_nn32"></a>33.5 Input and output parameters</H2>
+<H2><a name="Ruby_nn32"></a>35.5 Input and output parameters</H2>
<p> A common problem in some C programs is handling parameters
@@ -3585,10 +3575,10 @@ of <tt>%apply</tt> </p>
-<H2><a name="Ruby_nn33"></a>33.6 Exception handling </H2>
+<H2><a name="Ruby_nn33"></a>35.6 Exception handling </H2>
-<H3><a name="Ruby_nn34"></a>33.6.1 Using the %exception directive </H3>
+<H3><a name="Ruby_nn34"></a>35.6.1 Using the %exception directive </H3>
<p>The SWIG <tt>%exception</tt> directive can be
@@ -3683,7 +3673,7 @@ Features</a> for more examples.</p>
-<H3><a name="Ruby_nn34_2"></a>33.6.2 Handling Ruby Blocks </H3>
+<H3><a name="Ruby_nn34_2"></a>35.6.2 Handling Ruby Blocks </H3>
<p>One of the highlights of Ruby and most of its standard library
@@ -3864,7 +3854,7 @@ RUBY_YIELD_SELF );<br>
<p>For more information on typemaps, see <a href="#Ruby_nn37">Typemaps</a>.</p>
-<H3><a name="Ruby_nn35"></a>33.6.3 Raising exceptions </H3>
+<H3><a name="Ruby_nn35"></a>35.6.3 Raising exceptions </H3>
<p>There are three ways to raise exceptions from C++ code to
@@ -4625,7 +4615,7 @@ the built-in Ruby exception types.</p>
-<H3><a name="Ruby_nn36"></a>33.6.4 Exception classes </H3>
+<H3><a name="Ruby_nn36"></a>35.6.4 Exception classes </H3>
<p>Starting with SWIG 1.3.28, the Ruby module supports the <tt>%exceptionclass</tt>
@@ -4683,7 +4673,7 @@ providing for a more natural integration between C++ code and Ruby code.</p>
-<H2><a name="Ruby_nn37"></a>33.7 Typemaps</H2>
+<H2><a name="Ruby_nn37"></a>35.7 Typemaps</H2>
<p> This section describes how you can modify SWIG's default
@@ -4706,7 +4696,7 @@ of the primitive C-Ruby interface.</p>
-<H3><a name="Ruby_nn38"></a>33.7.1 What is a typemap?</H3>
+<H3><a name="Ruby_nn38"></a>35.7.1 What is a typemap?</H3>
<p> A typemap is nothing more than a code generation rule that is
@@ -4968,7 +4958,7 @@ to be used as follows (notice how the length parameter is omitted): </p>
-<H3><a name="Ruby_Typemap_scope"></a>33.7.2 Typemap scope</H3>
+<H3><a name="Ruby_Typemap_scope"></a>35.7.2 Typemap scope</H3>
<p> Once defined, a typemap remains in effect for all of the
@@ -5016,7 +5006,7 @@ where the class itself is defined. For example:</p>
-<H3><a name="Ruby_Copying_a_typemap"></a>33.7.3 Copying a typemap</H3>
+<H3><a name="Ruby_Copying_a_typemap"></a>35.7.3 Copying a typemap</H3>
<p> A typemap is copied by using assignment. For example:</p>
@@ -5118,7 +5108,7 @@ rules as for <tt>
-<H3><a name="Ruby_Deleting_a_typemap"></a>33.7.4 Deleting a typemap</H3>
+<H3><a name="Ruby_Deleting_a_typemap"></a>35.7.4 Deleting a typemap</H3>
<p> A typemap can be deleted by simply defining no code. For
@@ -5170,7 +5160,7 @@ typemaps immediately after the clear operation.</p>
-<H3><a name="Ruby_Placement_of_typemaps"></a>33.7.5 Placement of typemaps</H3>
+<H3><a name="Ruby_Placement_of_typemaps"></a>35.7.5 Placement of typemaps</H3>
<p> Typemap declarations can be declared in the global scope,
@@ -5254,7 +5244,7 @@ string</tt>
-<H3><a name="Ruby_nn39"></a>33.7.6 Ruby typemaps</H3>
+<H3><a name="Ruby_nn39"></a>35.7.6 Ruby typemaps</H3>
<p>The following list details all of the typemap methods that
@@ -5264,7 +5254,7 @@ can be used by the Ruby module: </p>
-<H4><a name="Ruby_in_typemap"></a>33.7.6.1 &nbsp;"in" typemap</H4>
+<H4><a name="Ruby_in_typemap"></a>35.7.6.1 &nbsp;"in" typemap</H4>
<p>Converts Ruby objects to input
@@ -5507,7 +5497,7 @@ arguments to be specified. For example:</p>
-<H4><a name="Ruby_typecheck_typemap"></a>33.7.6.2 "typecheck" typemap</H4>
+<H4><a name="Ruby_typecheck_typemap"></a>35.7.6.2 "typecheck" typemap</H4>
<p> The "typecheck" typemap is used to support overloaded
@@ -5548,7 +5538,7 @@ on "Typemaps and Overloading."</p>
-<H4><a name="Ruby_out_typemap"></a>33.7.6.3 &nbsp;"out" typemap</H4>
+<H4><a name="Ruby_out_typemap"></a>35.7.6.3 &nbsp;"out" typemap</H4>
<p>Converts return value of a C function
@@ -5780,7 +5770,7 @@ version of the C datatype matched by the typemap.</td>
-<H4><a name="Ruby_arginit_typemap"></a>33.7.6.4 "arginit" typemap</H4>
+<H4><a name="Ruby_arginit_typemap"></a>35.7.6.4 "arginit" typemap</H4>
<p> The "arginit" typemap is used to set the initial value of a
@@ -5805,7 +5795,7 @@ applications. For example:</p>
-<H4><a name="Ruby_default_typemap"></a>33.7.6.5 "default" typemap</H4>
+<H4><a name="Ruby_default_typemap"></a>35.7.6.5 "default" typemap</H4>
<p> The "default" typemap is used to turn an argument into a
@@ -5847,7 +5837,7 @@ default argument wrapping.</p>
-<H4><a name="Ruby_check_typemap"></a>33.7.6.6 "check" typemap</H4>
+<H4><a name="Ruby_check_typemap"></a>35.7.6.6 "check" typemap</H4>
<p> The "check" typemap is used to supply value checking code
@@ -5871,7 +5861,7 @@ arguments have been converted. For example:</p>
-<H4><a name="Ruby_argout_typemap_"></a>33.7.6.7 "argout" typemap</H4>
+<H4><a name="Ruby_argout_typemap_"></a>35.7.6.7 "argout" typemap</H4>
<p> The "argout" typemap is used to return values from arguments.
@@ -6029,7 +6019,7 @@ some function like SWIG_Ruby_AppendOutput.</p>
-<H4><a name="Ruby_freearg_typemap_"></a>33.7.6.8 "freearg" typemap</H4>
+<H4><a name="Ruby_freearg_typemap_"></a>35.7.6.8 "freearg" typemap</H4>
<p> The "freearg" typemap is used to cleanup argument data. It is
@@ -6065,7 +6055,7 @@ abort prematurely.</p>
-<H4><a name="Ruby_newfree_typemap"></a>33.7.6.9 "newfree" typemap</H4>
+<H4><a name="Ruby_newfree_typemap"></a>35.7.6.9 "newfree" typemap</H4>
<p> The "newfree" typemap is used in conjunction with the <tt>%newobject</tt>
@@ -6096,7 +6086,7 @@ ownership and %newobject</a> for further details.</p>
-<H4><a name="Ruby_memberin_typemap"></a>33.7.6.10 "memberin" typemap</H4>
+<H4><a name="Ruby_memberin_typemap"></a>35.7.6.10 "memberin" typemap</H4>
<p> The "memberin" typemap is used to copy data from<em> an
@@ -6129,7 +6119,7 @@ other objects.</p>
-<H4><a name="Ruby_varin_typemap"></a>33.7.6.11 "varin" typemap</H4>
+<H4><a name="Ruby_varin_typemap"></a>35.7.6.11 "varin" typemap</H4>
<p> The "varin" typemap is used to convert objects in the target
@@ -6140,7 +6130,7 @@ This is implementation specific.</p>
-<H4><a name="Ruby_varout_typemap_"></a>33.7.6.12 "varout" typemap</H4>
+<H4><a name="Ruby_varout_typemap_"></a>35.7.6.12 "varout" typemap</H4>
<p> The "varout" typemap is used to convert a C/C++ object to an
@@ -6151,7 +6141,7 @@ This is implementation specific.</p>
-<H4><a name="Ruby_throws_typemap"></a>33.7.6.13 "throws" typemap</H4>
+<H4><a name="Ruby_throws_typemap"></a>35.7.6.13 "throws" typemap</H4>
<p> The "throws" typemap is only used when SWIG parses a C++
@@ -6210,7 +6200,7 @@ handling with %exception</a> section.</p>
-<H4><a name="Ruby_directorin_typemap"></a>33.7.6.14 directorin typemap</H4>
+<H4><a name="Ruby_directorin_typemap"></a>35.7.6.14 directorin typemap</H4>
<p>Converts C++ objects in director
@@ -6464,7 +6454,7 @@ referring to the class itself.</td>
-<H4><a name="Ruby_directorout_typemap"></a>33.7.6.15 directorout typemap</H4>
+<H4><a name="Ruby_directorout_typemap"></a>35.7.6.15 directorout typemap</H4>
<p>Converts Ruby objects in director
@@ -6724,7 +6714,7 @@ exception.<br>
-<H4><a name="Ruby_directorargout_typemap"></a>33.7.6.16 directorargout typemap</H4>
+<H4><a name="Ruby_directorargout_typemap"></a>35.7.6.16 directorargout typemap</H4>
<p>Output argument processing in director
@@ -6964,7 +6954,7 @@ referring to the instance of the class itself</td>
-<H4><a name="Ruby_ret_typemap"></a>33.7.6.17 ret typemap</H4>
+<H4><a name="Ruby_ret_typemap"></a>35.7.6.17 ret typemap</H4>
<p>Cleanup of function return values
@@ -6974,7 +6964,7 @@ referring to the instance of the class itself</td>
-<H4><a name="Ruby_globalin_typemap"></a>33.7.6.18 globalin typemap</H4>
+<H4><a name="Ruby_globalin_typemap"></a>35.7.6.18 globalin typemap</H4>
<p>Setting of C global variables
@@ -6984,7 +6974,7 @@ referring to the instance of the class itself</td>
-<H3><a name="Ruby_nn40"></a>33.7.7 Typemap variables</H3>
+<H3><a name="Ruby_nn40"></a>35.7.7 Typemap variables</H3>
<p>
@@ -7094,7 +7084,7 @@ being created. </div>
-<H3><a name="Ruby_nn41"></a>33.7.8 Useful Functions</H3>
+<H3><a name="Ruby_nn41"></a>35.7.8 Useful Functions</H3>
<p> When you write a typemap, you usually have to work directly
@@ -7118,7 +7108,7 @@ across multiple languages.</p>
-<H4><a name="Ruby_nn42"></a>33.7.8.1 C Datatypes to Ruby Objects</H4>
+<H4><a name="Ruby_nn42"></a>35.7.8.1 C Datatypes to Ruby Objects</H4>
<div class="diagram">
@@ -7174,7 +7164,7 @@ SWIG_From_float(float)</td>
-<H4><a name="Ruby_nn43"></a>33.7.8.2 Ruby Objects to C Datatypes</H4>
+<H4><a name="Ruby_nn43"></a>35.7.8.2 Ruby Objects to C Datatypes</H4>
<p>Here, while the Ruby versions return the value directly, the SWIG
@@ -7263,7 +7253,7 @@ Ruby_Format_TypeError( "$1_name", "$1_type","$symname", $argnum, $input
-<H4><a name="Ruby_nn44"></a>33.7.8.3 Macros for VALUE</H4>
+<H4><a name="Ruby_nn44"></a>35.7.8.3 Macros for VALUE</H4>
<p> <tt>RSTRING_LEN(str)</tt> </p>
@@ -7326,7 +7316,7 @@ Ruby_Format_TypeError( "$1_name", "$1_type","$symname", $argnum, $input
-<H4><a name="Ruby_nn45"></a>33.7.8.4 Exceptions</H4>
+<H4><a name="Ruby_nn45"></a>35.7.8.4 Exceptions</H4>
<p> <tt>void rb_raise(VALUE exception, const char *fmt,
@@ -7493,7 +7483,7 @@ arguments are interpreted as with <tt>printf()</tt>. </div>
-<H4><a name="Ruby_nn46"></a>33.7.8.5 Iterators</H4>
+<H4><a name="Ruby_nn46"></a>35.7.8.5 Iterators</H4>
<p> <tt>void rb_iter_break()</tt> </p>
@@ -7595,7 +7585,7 @@ VALUE), VALUE value)</tt></p>
-<H3><a name="Ruby_nn47"></a>33.7.9 Typemap Examples</H3>
+<H3><a name="Ruby_nn47"></a>35.7.9 Typemap Examples</H3>
<p> This section includes a few examples of typemaps. For more
@@ -7606,7 +7596,7 @@ directory. </p>
-<H3><a name="Ruby_nn48"></a>33.7.10 Converting a Ruby array to a char **</H3>
+<H3><a name="Ruby_nn48"></a>35.7.10 Converting a Ruby array to a char **</H3>
<p> A common problem in many C programs is the processing of
@@ -7661,7 +7651,7 @@ after the execution of the C function. </p>
-<H3><a name="Ruby_nn49"></a>33.7.11 Collecting arguments in a hash</H3>
+<H3><a name="Ruby_nn49"></a>35.7.11 Collecting arguments in a hash</H3>
<p> Ruby's solution to the "keyword arguments" capability of some
@@ -7940,7 +7930,7 @@ directory of the SWIG distribution. </p>
-<H3><a name="Ruby_nn50"></a>33.7.12 Pointer handling</H3>
+<H3><a name="Ruby_nn50"></a>35.7.12 Pointer handling</H3>
<p> Occasionally, it might be necessary to convert pointer values
@@ -8039,7 +8029,7 @@ For example: </p>
-<H4><a name="Ruby_nn51"></a>33.7.12.1 Ruby Datatype Wrapping</H4>
+<H4><a name="Ruby_nn51"></a>35.7.12.1 Ruby Datatype Wrapping</H4>
<p> <tt>VALUE Data_Wrap_Struct(VALUE class, void
@@ -8090,7 +8080,7 @@ and assigns that pointer to <i>ptr</i>. </div>
-<H3><a name="Ruby_nn52"></a>33.7.13 Example: STL Vector to Ruby Array</H3>
+<H3><a name="Ruby_nn52"></a>35.7.13 Example: STL Vector to Ruby Array</H3>
<p>Another use for macros and type maps is to create a Ruby array
@@ -8199,7 +8189,7 @@ the<a href="#Ruby_nn23_1"> C++ Standard Template Library</a>.<br>
-<H2><a name="Ruby_nn65"></a>33.8 Docstring Features</H2>
+<H2><a name="Ruby_nn65"></a>35.8 Docstring Features</H2>
<p>
@@ -8260,7 +8250,7 @@ generate ri documentation from a c wrap file, you could do:</p>
-<H3><a name="Ruby_nn66"></a>33.8.1 Module docstring</H3>
+<H3><a name="Ruby_nn66"></a>35.8.1 Module docstring</H3>
<p>
@@ -8311,7 +8301,7 @@ macro. For example:
-<H3><a name="Ruby_nn67"></a>33.8.2 %feature("autodoc")</H3>
+<H3><a name="Ruby_nn67"></a>35.8.2 %feature("autodoc")</H3>
<p>Since SWIG does know everything about the function it wraps,
@@ -8340,7 +8330,7 @@ feature, described below.
-<H4><a name="Ruby_nn68"></a>33.8.2.1 %feature("autodoc", "0")</H4>
+<H4><a name="Ruby_nn68"></a>35.8.2.1 %feature("autodoc", "0")</H4>
<p>
@@ -8388,7 +8378,7 @@ Then Ruby code like this will be generated:
-<H4><a name="Ruby_autodoc1"></a>33.8.2.2 %feature("autodoc", "1")</H4>
+<H4><a name="Ruby_autodoc1"></a>35.8.2.2 %feature("autodoc", "1")</H4>
<p>
@@ -8420,7 +8410,7 @@ this:
-<H4><a name="Ruby_autodoc2"></a>33.8.2.3 %feature("autodoc", "2")</H4>
+<H4><a name="Ruby_autodoc2"></a>35.8.2.3 %feature("autodoc", "2")</H4>
<p>
@@ -8436,7 +8426,7 @@ this:
-<H4><a name="Ruby_feature_autodoc3"></a>33.8.2.4 %feature("autodoc", "3")</H4>
+<H4><a name="Ruby_feature_autodoc3"></a>35.8.2.4 %feature("autodoc", "3")</H4>
<p>
@@ -8464,7 +8454,7 @@ this:
-<H4><a name="Ruby_nn70"></a>33.8.2.5 %feature("autodoc", "docstring")</H4>
+<H4><a name="Ruby_nn70"></a>35.8.2.5 %feature("autodoc", "docstring")</H4>
<p>
@@ -8492,7 +8482,7 @@ generated string. For example:
-<H3><a name="Ruby_nn71"></a>33.8.3 %feature("docstring")</H3>
+<H3><a name="Ruby_nn71"></a>35.8.3 %feature("docstring")</H3>
<p>
@@ -8507,10 +8497,10 @@ docstring and they are output together. </p>
-<H2><a name="Ruby_nn53"></a>33.9 Advanced Topics</H2>
+<H2><a name="Ruby_nn53"></a>35.9 Advanced Topics</H2>
-<H3><a name="Ruby_operator_overloading"></a>33.9.1 Operator overloading</H3>
+<H3><a name="Ruby_operator_overloading"></a>35.9.1 Operator overloading</H3>
<p> SWIG allows operator overloading with, by using the <tt>%extend</tt>
@@ -9527,7 +9517,7 @@ parses the expression <i>a != b</i> as <i>!(a == b)</i>.
-<H3><a name="Ruby_nn55"></a>33.9.2 Creating Multi-Module Packages</H3>
+<H3><a name="Ruby_nn55"></a>35.9.2 Creating Multi-Module Packages</H3>
<p> The chapter on <a href="Modules.html#Modules">Working
@@ -9708,7 +9698,7 @@ initialized: </p>
-<H3><a name="Ruby_nn56"></a>33.9.3 Specifying Mixin Modules</H3>
+<H3><a name="Ruby_nn56"></a>35.9.3 Specifying Mixin Modules</H3>
<p> The Ruby language doesn't support multiple inheritance, but
@@ -9806,7 +9796,7 @@ Features"</a>) for more details). </p>
-<H2><a name="Ruby_nn57"></a>33.10 Memory Management</H2>
+<H2><a name="Ruby_nn57"></a>35.10 Memory Management</H2>
<p>One of the most common issues in generating SWIG bindings for
@@ -9853,7 +9843,7 @@ understanding of how the underlying library manages memory.</p>
-<H3><a name="Ruby_nn58"></a>33.10.1 Mark and Sweep Garbage Collector </H3>
+<H3><a name="Ruby_nn58"></a>35.10.1 Mark and Sweep Garbage Collector </H3>
<p>Ruby uses a mark and sweep garbage collector. When the garbage
@@ -9901,7 +9891,7 @@ this memory. </p>
-<H3><a name="Ruby_nn59"></a>33.10.2 Object Ownership</H3>
+<H3><a name="Ruby_nn59"></a>35.10.2 Object Ownership</H3>
<p>As described above, memory management depends on clearly
@@ -10098,7 +10088,38 @@ classes is:</p>
<div class="code">
-<pre>/* File RubyOwnershipExample.i */<br><br>%module RubyOwnershipExample<br><br>%{<br>#include "RubyOwnershipExample.h"<br>%}<br><br>class Foo<br>{<br>public:<br> Foo();<br> ~Foo();<br>};<br><br>class Bar<br>{<br> Foo *foo_;<br>public:<br> Bar();<br> ~Bar();<br> Foo* get_foo();<br><br><span style="font-weight: bold;"> %newobject get_new_foo;</span><br> Foo* get_new_foo();<br><br><span style="font-weight: bold;"> %apply SWIGTYPE *DISOWN {Foo *foo};</span><br> void set_foo(Foo *foo);<br><span style="font-weight: bold;"> %clear Foo *foo;</span><br>};<br><br></pre>
+<pre>/* File RubyOwnershipExample.i */
+
+%module RubyOwnershipExample
+
+%{
+#include "RubyOwnershipExample.h"
+%}
+
+class Foo
+{
+public:
+ Foo();
+ ~Foo();
+};
+
+class Bar
+{
+ Foo *foo_;
+public:
+ Bar();
+ ~Bar();
+ Foo* get_foo();
+
+<b> %newobject get_new_foo;</b>
+ Foo* get_new_foo();
+
+<b> %apply SWIGTYPE *DISOWN {Foo *foo};</b>
+ void set_foo(Foo *foo);
+<b> %clear Foo *foo;</b>
+};
+
+</pre>
@@ -10128,7 +10149,7 @@ classes is:</p>
-<H3><a name="Ruby_nn60"></a>33.10.3 Object Tracking</H3>
+<H3><a name="Ruby_nn60"></a>35.10.3 Object Tracking</H3>
<p>The remaining parts of this section will use the class library
@@ -10165,7 +10186,35 @@ class library models a zoo and the animals it contains. </p>
<div class="code targetlang">
-<pre>$ <span style="font-weight: bold;">irb</span><br>irb(main):001:0&gt; <span style="font-weight: bold;">require 'example'</span><br>=&gt; true<br><br>irb(main):002:0&gt; <span style="font-weight: bold;">tiger1 = Example::Animal.new("tiger1")</span><br>=&gt; #&lt;Example::Animal:0x2be3820&gt;<br><br>irb(main):004:0&gt; <span style="font-weight: bold;">tiger1.get_name()</span><br>=&gt; "tiger1"<br><br>irb(main):003:0&gt; <span style="font-weight: bold;">zoo = Example::Zoo.new()</span><br>=&gt; #&lt;Example::Zoo:0x2be0a60&gt;<br><br>irb(main):006:0&gt; <span style="font-weight: bold;">zoo.add_animal(tiger)</span><br>=&gt; nil<br><br>irb(main):007:0&gt; <span style="font-weight: bold;">zoo.get_num_animals()</span><br>=&gt; 1<br><br>irb(main):007:0&gt; <span style="font-weight: bold;">tiger2 = zoo.remove_animal(0)</span><br>=&gt; #&lt;Example::Animal:0x2bd4a18&gt;<br><br>irb(main):008:0&gt; <span style="font-weight: bold;">tiger2.get_name()</span><br>=&gt; "tiger1"<br><br>irb(main):009:0&gt; <span style="font-weight: bold;">tiger1.equal?(tiger2)</span><br>=&gt; false<br><br></pre>
+<pre>$ <b>irb</b>
+irb(main):001:0&gt; <b>require 'example'</b>
+=&gt; true
+
+irb(main):002:0&gt; <b>tiger1 = Example::Animal.new("tiger1")</b>
+=&gt; #&lt;Example::Animal:0x2be3820&gt;
+
+irb(main):004:0&gt; <b>tiger1.get_name()</b>
+=&gt; "tiger1"
+
+irb(main):003:0&gt; <b>zoo = Example::Zoo.new()</b>
+=&gt; #&lt;Example::Zoo:0x2be0a60&gt;
+
+irb(main):006:0&gt; <b>zoo.add_animal(tiger)</b>
+=&gt; nil
+
+irb(main):007:0&gt; <b>zoo.get_num_animals()</b>
+=&gt; 1
+
+irb(main):007:0&gt; <b>tiger2 = zoo.remove_animal(0)</b>
+=&gt; #&lt;Example::Animal:0x2bd4a18&gt;
+
+irb(main):008:0&gt; <b>tiger2.get_name()</b>
+=&gt; "tiger1"
+
+irb(main):009:0&gt; <b>tiger1.equal?(tiger2)</b>
+=&gt; false
+
+</pre>
@@ -10192,7 +10241,16 @@ the same underlying C++ object. This can cause problems. For example:<br>
<div class="code targetlang">
-<pre>irb(main):010:0&gt; <span style="font-weight: bold;">tiger1 = nil</span><br>=&gt; nil<br><br>irb(main):011:0&gt; <span style="font-weight: bold;">GC.start</span><br>=&gt; nil<br><br>irb(main):012:0&gt; <span style="font-weight: bold;">tiger2.get_name()</span><br>(irb):12: [BUG] Segmentation fault<br><br></pre>
+<pre>irb(main):010:0&gt; <b>tiger1 = nil</b>
+=&gt; nil
+
+irb(main):011:0&gt; <b>GC.start</b>
+=&gt; nil
+
+irb(main):012:0&gt; <b>tiger2.get_name()</b>
+(irb):12: [BUG] Segmentation fault
+
+</pre>
@@ -10251,7 +10309,7 @@ class-by-class basis if needed. To fix the example above:</p>
<div class="code">
-<pre>%module example<br><br>%{<br>#include "example.h"<br>%}<br><br><span style="font-weight: bold;">/* Tell SWIG that create_animal creates a new object */</span><br><span style="font-weight: bold;">%newobject Zoo::create_animal;</span><br><br><span style="font-weight: bold;">/* Tell SWIG to keep track of mappings between C/C++ structs/classes. */</span><br style="font-weight: bold;"><span style="font-weight: bold;">%trackobjects;</span><br><br>%include "example.h"</pre>
+<pre>%module example<br><br>%{<br>#include "example.h"<br>%}<br><br><b>/* Tell SWIG that create_animal creates a new object */</b><br><b>%newobject Zoo::create_animal;</b><br><br><b>/* Tell SWIG to keep track of mappings between C/C++ structs/classes. */</b><br style="font-weight: bold;"><b>%trackobjects;</b><br><br>%include "example.h"</pre>
@@ -10282,7 +10340,7 @@ class-by-class basis if needed. To fix the example above:</p>
<div class="code targetlang">
-<pre>$ <span style="font-weight: bold;">irb</span><br>irb(main):001:0&gt; <span style="font-weight: bold;">require 'example'</span><br>=&gt; true<br><br>irb(main):002:0&gt; <span style="font-weight: bold;">tiger1 = Example::Animal.new("tiger1")</span><br>=&gt; #&lt;Example::Animal:0x2be37d8&gt;<br><br>irb(main):003:0&gt; <span style="font-weight: bold;">zoo = Example::Zoo.new()</span><br>=&gt; #&lt;Example::Zoo:0x2be0a18&gt;<br><br>irb(main):004:0&gt; <span style="font-weight: bold;">zoo.add_animal(tiger1)</span><br>=&gt; nil<br><br>irb(main):006:0&gt; <span style="font-weight: bold;">tiger2 = zoo.remove_animal(0)</span><br>=&gt; #&lt;Example::Animal:0x2be37d8&gt;<br><br>irb(main):007:0&gt; <span style="font-weight: bold;">tiger1.equal?(tiger2)</span><br>=&gt; true<br><br>irb(main):008:0&gt; <span style="font-weight: bold;">tiger1 = nil</span><br>=&gt; nil<br><br>irb(main):009:0&gt; <span style="font-weight: bold;">GC.start</span><br>=&gt; nil<br><br>irb(main):010:0&gt; <span style="font-weight: bold;">tiger.get_name()</span><br>=&gt; "tiger1"<br>irb(main):011:0&gt;<br><br></pre>
+<pre>$ <b>irb</b><br>irb(main):001:0&gt; <b>require 'example'</b><br>=&gt; true<br><br>irb(main):002:0&gt; <b>tiger1 = Example::Animal.new("tiger1")</b><br>=&gt; #&lt;Example::Animal:0x2be37d8&gt;<br><br>irb(main):003:0&gt; <b>zoo = Example::Zoo.new()</b><br>=&gt; #&lt;Example::Zoo:0x2be0a18&gt;<br><br>irb(main):004:0&gt; <b>zoo.add_animal(tiger1)</b><br>=&gt; nil<br><br>irb(main):006:0&gt; <b>tiger2 = zoo.remove_animal(0)</b><br>=&gt; #&lt;Example::Animal:0x2be37d8&gt;<br><br>irb(main):007:0&gt; <b>tiger1.equal?(tiger2)</b><br>=&gt; true<br><br>irb(main):008:0&gt; <b>tiger1 = nil</b><br>=&gt; nil<br><br>irb(main):009:0&gt; <b>GC.start</b><br>=&gt; nil<br><br>irb(main):010:0&gt; <b>tiger.get_name()</b><br>=&gt; "tiger1"<br>irb(main):011:0&gt;<br><br></pre>
@@ -10342,7 +10400,7 @@ methods.</p>
-<H3><a name="Ruby_nn61"></a>33.10.4 Mark Functions</H3>
+<H3><a name="Ruby_nn61"></a>35.10.4 Mark Functions</H3>
<p>With a bit more testing, we see that our class library still
@@ -10359,7 +10417,7 @@ has problems. For example:<br>
<div class="targetlang">
-<pre>$ <b>irb</b><br>irb(main):001:0&gt; <span style="font-weight: bold;">require 'example'</span><br>=&gt; true<br><br>irb(main):002:0&gt; tiger1 = <span style="font-weight: bold;">Example::Animal.new("tiger1")</span><br>=&gt; #&lt;Example::Animal:0x2bea6a8&gt;<br><br>irb(main):003:0&gt; zoo = <span style="font-weight: bold;">Example::Zoo.new()</span><br>=&gt; #&lt;Example::Zoo:0x2be7960&gt;<br><br>irb(main):004:0&gt; <span style="font-weight: bold;">zoo.add_animal(tiger1)</span><br>=&gt; nil<br><br>irb(main):007:0&gt; <span style="font-weight: bold;">tiger1 = nil</span><br>=&gt; nil<br><br>irb(main):007:0&gt; <span style="font-weight: bold;">GC.start</span><br>=&gt; nil<br><br>irb(main):005:0&gt; <span style="font-weight: bold;">tiger2 = zoo.get_animal(0)</span><br>(irb):12: [BUG] Segmentation fault</pre>
+<pre>$ <b>irb</b><br>irb(main):001:0&gt; <b>require 'example'</b><br>=&gt; true<br><br>irb(main):002:0&gt; tiger1 = <b>Example::Animal.new("tiger1")</b><br>=&gt; #&lt;Example::Animal:0x2bea6a8&gt;<br><br>irb(main):003:0&gt; zoo = <b>Example::Zoo.new()</b><br>=&gt; #&lt;Example::Zoo:0x2be7960&gt;<br><br>irb(main):004:0&gt; <b>zoo.add_animal(tiger1)</b><br>=&gt; nil<br><br>irb(main):007:0&gt; <b>tiger1 = nil</b><br>=&gt; nil<br><br>irb(main):007:0&gt; <b>GC.start</b><br>=&gt; nil<br><br>irb(main):005:0&gt; <b>tiger2 = zoo.get_animal(0)</b><br>(irb):12: [BUG] Segmentation fault</pre>
@@ -10407,7 +10465,7 @@ implementation is:</p>
<div class="code">
-<pre>%module example<br><br>%{<br>#include "example.h"<br>%}<br><br>/* Keep track of mappings between C/C++ structs/classes<br> and Ruby objects so we can implement a mark function. */<br><span style="font-weight: bold;">%trackobjects;</span><br><br>/* Specify the mark function */<br><span style="font-weight: bold;">%markfunc Zoo "mark_Zoo";</span><br><br>%include "example.h"<br><br>%header %{<br><br>static void mark_Zoo(void* ptr) {<br> Zoo* zoo = (Zoo*) ptr;<br><br> /* Loop over each object and tell the garbage collector<br> that we are holding a reference to them. */<br> int count = zoo-&gt;get_num_animals();<br><br> for(int i = 0; i &lt; count; ++i) {<br> Animal* animal = zoo-&gt;get_animal(i);<br> VALUE object = SWIG_RubyInstanceFor(animal);<br><br> if (object != Qnil) {<br> rb_gc_mark(object);<br> }<br> }<br>}<br>%}<br><br></pre>
+<pre>%module example<br><br>%{<br>#include "example.h"<br>%}<br><br>/* Keep track of mappings between C/C++ structs/classes<br> and Ruby objects so we can implement a mark function. */<br><b>%trackobjects;</b><br><br>/* Specify the mark function */<br><b>%markfunc Zoo "mark_Zoo";</b><br><br>%include "example.h"<br><br>%header %{<br><br>static void mark_Zoo(void* ptr) {<br> Zoo* zoo = (Zoo*) ptr;<br><br> /* Loop over each object and tell the garbage collector<br> that we are holding a reference to them. */<br> int count = zoo-&gt;get_num_animals();<br><br> for(int i = 0; i &lt; count; ++i) {<br> Animal* animal = zoo-&gt;get_animal(i);<br> VALUE object = SWIG_RubyInstanceFor(animal);<br><br> if (object != Qnil) {<br> rb_gc_mark(object);<br> }<br> }<br>}<br>%}<br><br></pre>
@@ -10436,7 +10494,7 @@ test suite.</p>
<div class="targetlang">
-<pre>$ <b>irb<br></b>irb(main):002:0&gt; <span style="font-weight: bold;">tiger1=Example::Animal.new("tiger1")</span><br>=&gt; #&lt;Example::Animal:0x2be3bf8&gt;<br><br>irb(main):003:0&gt; <span style="font-weight: bold;">Example::Zoo.new()</span><br>=&gt; #&lt;Example::Zoo:0x2be1780&gt;<br><br>irb(main):004:0&gt; <span style="font-weight: bold;">zoo = Example::Zoo.new()</span><br>=&gt; #&lt;Example::Zoo:0x2bde9c0&gt;<br><br>irb(main):005:0&gt; <span style="font-weight: bold;">zoo.add_animal(tiger1)</span><br>=&gt; nil<br><br>irb(main):009:0&gt; <span style="font-weight: bold;">tiger1 = nil</span><br>=&gt; nil<br><br>irb(main):010:0&gt; <span style="font-weight: bold;">GC.start</span><br>=&gt; nil<br>irb(main):014:0&gt; <span style="font-weight: bold;">tiger2 = zoo.get_animal(0)</span><br>=&gt; #&lt;Example::Animal:0x2be3bf8&gt;<br><br>irb(main):015:0&gt; <span style="font-weight: bold;">tiger2.get_name()</span><br>=&gt; "tiger1"<br>irb(main):016:0&gt;<br><br></pre>
+<pre>$ <b>irb<br></b>irb(main):002:0&gt; <b>tiger1=Example::Animal.new("tiger1")</b><br>=&gt; #&lt;Example::Animal:0x2be3bf8&gt;<br><br>irb(main):003:0&gt; <b>Example::Zoo.new()</b><br>=&gt; #&lt;Example::Zoo:0x2be1780&gt;<br><br>irb(main):004:0&gt; <b>zoo = Example::Zoo.new()</b><br>=&gt; #&lt;Example::Zoo:0x2bde9c0&gt;<br><br>irb(main):005:0&gt; <b>zoo.add_animal(tiger1)</b><br>=&gt; nil<br><br>irb(main):009:0&gt; <b>tiger1 = nil</b><br>=&gt; nil<br><br>irb(main):010:0&gt; <b>GC.start</b><br>=&gt; nil<br>irb(main):014:0&gt; <b>tiger2 = zoo.get_animal(0)</b><br>=&gt; #&lt;Example::Animal:0x2be3bf8&gt;<br><br>irb(main):015:0&gt; <b>tiger2.get_name()</b><br>=&gt; "tiger1"<br>irb(main):016:0&gt;<br><br></pre>
@@ -10460,7 +10518,7 @@ test suite.</p>
-<H3><a name="Ruby_nn62"></a>33.10.5 Free Functions</H3>
+<H3><a name="Ruby_nn62"></a>35.10.5 Free Functions</H3>
<p>By default, SWIG creates a "free" function that is called when
@@ -10512,14 +10570,22 @@ directive, let's slightly change our example. Assume that the zoo
object is responsible for freeing animal that it contains. This means
that the <span style="font-family: monospace;">Zoo::add_animal</span>
function should be marked with a <span style="font-family: monospace;">DISOWN</span> typemap
-and the destructor should be updated as below::</p>
+and the destructor should be updated as below:</p>
<div class="code">
-<pre>Zoo::~Zoo() {<br> IterType iter = this-&gt;animals.begin();<br> IterType end = this-&gt;animals.end();<br><br> for(iter; iter != end; ++iter) {<br> Animal* animal = *iter;<br> delete animal;<br> }<br>}</pre>
+<pre>Zoo::~Zoo() {
+ IterType iter = this-&gt;animals.begin();
+ IterType end = this-&gt;animals.end();
+
+ for(iter; iter != end; ++iter) {
+ Animal* animal = *iter;
+ delete animal;
+ }
+}</pre>
@@ -10538,7 +10604,29 @@ and the destructor should be updated as below::</p>
<div class="code targetlang">
-<pre class="targetlang"><span style="font-weight: bold;">$irb</span><br>irb(main):002:0&gt; <span style="font-weight: bold;">require 'example'</span><br>=&gt; true<br><br>irb(main):003:0&gt; <span style="font-weight: bold;">zoo = Example::Zoo.new()</span><br>=&gt; #&lt;Example::Zoo:0x2be0fe8&gt;<br><br>irb(main):005:0&gt; <span style="font-weight: bold;">tiger1 = Example::Animal.new("tiger1")</span><br>=&gt; #&lt;Example::Animal:0x2bda760&gt;<br><br>irb(main):006:0&gt; <span style="font-weight: bold;">zoo.add_animal(tiger1)</span><br>=&gt; nil<br><br>irb(main):007:0&gt; <span style="font-weight: bold;">zoo = nil</span><br>=&gt; nil<br><br>irb(main):008:0&gt; <span style="font-weight: bold;">GC.start</span><br>=&gt; nil<br><br>irb(main):009:0&gt; <span style="font-weight: bold;">tiger1.get_name()</span><br>(irb):12: [BUG] Segmentation fault<br><br></pre>
+<pre class="targetlang"><b>$irb</b>
+irb(main):002:0&gt; <b>require 'example'</b>
+=&gt; true
+
+irb(main):003:0&gt; <b>zoo = Example::Zoo.new()</b>
+=&gt; #&lt;Example::Zoo:0x2be0fe8&gt;
+
+irb(main):005:0&gt; <b>tiger1 = Example::Animal.new("tiger1")</b>
+=&gt; #&lt;Example::Animal:0x2bda760&gt;
+
+irb(main):006:0&gt; <b>zoo.add_animal(tiger1)</b>
+=&gt; nil
+
+irb(main):007:0&gt; <b>zoo = nil</b>
+=&gt; nil
+
+irb(main):008:0&gt; <b>GC.start</b>
+=&gt; nil
+
+irb(main):009:0&gt; <b>tiger1.get_name()</b>
+(irb):12: [BUG] Segmentation fault
+
+</pre>
@@ -10571,7 +10659,49 @@ existing Ruby object to the destroyed C++ object and raise an exception.<br>
<div class="code">
-<pre>%module example<br><br>%{<br>#include "example.h"<br>%}<br><br>/* Specify that ownership is transferred to the zoo<br> when calling add_animal */<br>%apply SWIGTYPE *DISOWN { Animal* animal };<br><br>/* Track objects */<br>%trackobjects;<br><br>/* Specify the mark function */<br>%freefunc Zoo "free_Zoo";<br><br>%include "example.h"<br><br>%header %{<br> static void free_Zoo(void* ptr) {<br> Zoo* zoo = (Zoo*) ptr;<br><br> /* Loop over each animal */<br> int count = zoo-&gt;get_num_animals();<br><br> for(int i = 0; i &lt; count; ++i) {<br> /* Get an animal */<br> Animal* animal = zoo-&gt;get_animal(i);<br><br> /* Unlink the Ruby object from the C++ object */<br> SWIG_RubyUnlinkObjects(animal);<br><br> /* Now remove the tracking for this animal */<br> SWIG_RubyRemoveTracking(animal);<br> }<br><br> /* Now call SWIG_RubyRemoveTracking for the zoo */<br> SWIG_RubyRemoveTracking(ptr);<br> <br> /* Now free the zoo which will free the animals it contains */<br> delete zoo;<br> }<br>%} </pre>
+<pre>%module example
+
+%{
+#include "example.h"
+%}
+
+/* Specify that ownership is transferred to the zoo
+ when calling add_animal */
+%apply SWIGTYPE *DISOWN { Animal* animal };
+
+/* Track objects */
+%trackobjects;
+
+/* Specify the mark function */
+%freefunc Zoo "free_Zoo";
+
+%include "example.h"
+
+%header %{
+ static void free_Zoo(void* ptr) {
+ Zoo* zoo = (Zoo*) ptr;
+
+ /* Loop over each animal */
+ int count = zoo-&gt;get_num_animals();
+
+ for(int i = 0; i &lt; count; ++i) {
+ /* Get an animal */
+ Animal* animal = zoo-&gt;get_animal(i);
+
+ /* Unlink the Ruby object from the C++ object */
+ SWIG_RubyUnlinkObjects(animal);
+
+ /* Now remove the tracking for this animal */
+ SWIG_RubyRemoveTracking(animal);
+ }
+
+ /* Now call SWIG_RubyRemoveTracking for the zoo */
+ SWIG_RubyRemoveTracking(ptr);
+
+ /* Now free the zoo which will free the animals it contains */
+ delete zoo;
+ }
+%} </pre>
@@ -10590,7 +10720,30 @@ existing Ruby object to the destroyed C++ object and raise an exception.<br>
<div class="code targetlang">
-<pre><span style="font-weight: bold;">$irb</span><br>irb(main):002:0&gt; <span style="font-weight: bold;">require 'example'</span><br>=&gt; true<br><br>irb(main):003:0&gt; <span style="font-weight: bold;">zoo = Example::Zoo.new()</span><br>=&gt; #&lt;Example::Zoo:0x2be0fe8&gt;<br><br>irb(main):005:0&gt; <span style="font-weight: bold;">tiger1 = Example::Animal.new("tiger1")</span><br>=&gt; #&lt;Example::Animal:0x2bda760&gt;<br><br>irb(main):006:0&gt; <span style="font-weight: bold;">zoo.add_animal(tiger1)</span><br>=&gt; nil<br><br>irb(main):007:0&gt; <span style="font-weight: bold;">zoo = nil</span><br>=&gt; nil<br><br>irb(main):008:0&gt; <span style="font-weight: bold;">GC.start</span><br>=&gt; nil<br><br>irb(main):009:0&gt; <span style="font-weight: bold;">tiger1.get_name()</span><br>RuntimeError: This Animal * already released<br> from (irb):10:in `get_name'<br> from (irb):10<br>irb(main):011:0&gt;</pre>
+<pre><b>$irb</b>
+irb(main):002:0&gt; <b>require 'example'</b>
+=&gt; true
+
+irb(main):003:0&gt; <b>zoo = Example::Zoo.new()</b>
+=&gt; #&lt;Example::Zoo:0x2be0fe8&gt;
+
+irb(main):005:0&gt; <b>tiger1 = Example::Animal.new("tiger1")</b>
+=&gt; #&lt;Example::Animal:0x2bda760&gt;
+
+irb(main):006:0&gt; <b>zoo.add_animal(tiger1)</b>
+=&gt; nil
+
+irb(main):007:0&gt; <b>zoo = nil</b>
+=&gt; nil
+
+irb(main):008:0&gt; <b>GC.start</b>
+=&gt; nil
+
+irb(main):009:0&gt; <b>tiger1.get_name()</b>
+RuntimeError: This Animal * already released
+ from (irb):10:in `get_name'
+ from (irb):10
+irb(main):011:0&gt;</pre>
@@ -10615,7 +10768,7 @@ been freed, and thus raises a runtime exception.</p>
-<H3><a name="Ruby_nn63"></a>33.10.6 Embedded Ruby and the C++ Stack</H3>
+<H3><a name="Ruby_nn63"></a>35.10.6 Embedded Ruby and the C++ Stack</H3>
<p>As has been said, the Ruby GC runs and marks objects before
diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html
index d523bee..fd510f2 100644
--- a/Doc/Manual/SWIG.html
+++ b/Doc/Manual/SWIG.html
@@ -44,6 +44,11 @@
<li><a href="#SWIG_nn26">Arrays</a>
<li><a href="#SWIG_readonly_variables">Creating read-only variables</a>
<li><a href="#SWIG_rename_ignore">Renaming and ignoring declarations</a>
+<ul>
+<li><a href="#SWIG_nn29">Simple renaming of specific identifiers</a>
+<li><a href="#SWIG_advanced_renaming">Advanced renaming support</a>
+<li><a href="#SWIG_limiting_renaming">Limiting global renaming rules</a>
+</ul>
<li><a href="#SWIG_default_args">Default/optional arguments</a>
<li><a href="#SWIG_nn30">Pointers to functions and callbacks</a>
</ul>
@@ -142,6 +147,7 @@ can be obtained by typing <tt>swig -help</tt> or <tt>swig
-o <em>outfile</em> Name of output file
-outcurrentdir Set default output dir to current dir instead of input file's path
-outdir <em>dir</em> Set language specific files output directory
+-pcreversion Display PCRE version information
-swiglib Show location of SWIG library
-version Show SWIG version number
@@ -1662,6 +1668,9 @@ generate a warning message. Simply change the directives to <tt>%immutable;</t
<H3><a name="SWIG_rename_ignore"></a>5.4.7 Renaming and ignoring declarations</H3>
+<H4><a name="SWIG_nn29"></a>5.4.7.1 Simple renaming of specific identifiers</H4>
+
+
<p>
Normally, the name of a C declaration is used when that declaration is
wrapped into the target language. However, this may generate a
@@ -1742,12 +1751,6 @@ declarations. If you need to remove a whole section of problematic code, the SW
</p>
<p>
-More powerful variants of <tt>%rename</tt> and <tt>%ignore</tt> directives can be used to help
-wrap C++ overloaded functions and methods or C++ methods which use default arguments. This is described in the
-<a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a> section in the C++ chapter.
-</p>
-
-<p>
<b>Compatibility note: </b> Older versions of SWIG provided a special <tt>%name</tt> directive for renaming declarations.
For example:
</p>
@@ -1763,6 +1766,290 @@ This directive is still supported, but it is deprecated and should probably be a
directive is more powerful and better supports wrapping of raw header file information.
</p>
+<H4><a name="SWIG_advanced_renaming"></a>5.4.7.2 Advanced renaming support</H4>
+
+
+<p>
+While writing <tt>%rename</tt> for specific declarations is simple enough,
+sometimes the same renaming rule needs to be applied to many, maybe all,
+identifiers in the SWIG input. For example, it may be necessary to apply some
+transformation to all the names in the target language to better follow its
+naming conventions, like adding a specific prefix to all wrapped functions. Doing it individually
+for each function is impractical so SWIG supports applying a renaming rule to
+all declarations if the name of the identifier to be renamed is not specified:
+</p>
+
+<div class="code">
+<pre>
+%rename("myprefix_%s") ""; // print&nbsp;-&gt;&nbsp;myprefix_print
+</pre>
+</div>
+
+<p>
+This also shows that the argument of <tt>%rename</tt> doesn't have to be a
+literal string but can be a <tt>printf()</tt>-like format string. In the
+simplest form, <tt>"%s"</tt> is replaced with the name of the original
+declaration, as shown above. However this is not always enough and SWIG
+provides extensions to the usual format string syntax to allow applying a
+(SWIG-defined) function to the argument. For example, to wrap all C functions
+<tt>do_something_long()</tt> as more Java-like <tt>doSomethingLong()</tt> you
+can use the <tt>"lowercamelcase"</tt> extended format specifier like this:
+</p>
+
+<div class="code">
+<pre>
+%rename("%(lowercamelcase)s") ""; // foo_bar -&gt; fooBar; FooBar -&gt; fooBar
+</pre>
+</div>
+
+<p>
+Some functions can be parametrized, for example the <tt>"strip"</tt> one
+strips the provided prefix from its argument. The prefix is specified as part
+of the format string, following a colon after the function name:
+</p>
+<div class="code">
+<pre>
+%rename("%(strip:[wx])s") ""; // wxHello -&gt; Hello; FooBar -&gt; FooBar
+</pre>
+</div>
+
+<p>
+Below is the table summarizing all currently defined functions with an example
+of applying each one. Note that some of them have two names, a shorter one
+and a more descriptive one, but the two functions are otherwise equivalent:
+</p>
+<table summary="Format string functions" border="1" cellpadding="5">
+<tr>
+ <th>Function</th><th>Returns</th><th colspan=2>Example (in/out)</th>
+</tr>
+<tr>
+ <td><tt>uppercase</tt> or <tt>upper</tt></td>
+ <td>Upper case version of the string.</td>
+ <td><tt>Print</tt></td><td><tt>PRINT</tt></td>
+</tr>
+<tr>
+ <td><tt>lowercase</tt> or <tt>lower</tt></td>
+ <td>Lower case version of the string.</td>
+ <td><tt>Print</tt></td><td><tt>print</tt></td>
+</tr>
+<tr>
+ <td><tt>title</tt></td>
+ <td>String with first letter capitalized and the rest in lower case.</td>
+ <td><tt>print</tt></td><td><tt>Print</tt></td>
+</tr>
+<tr>
+ <td><tt>firstuppercase</tt></td>
+ <td>String with the first letter capitalized and the rest unchanged.</td>
+ <td><tt>printIt</tt></td><td><tt>PrintIt</tt></td>
+</tr>
+<tr>
+ <td><tt>firstlowercase</tt></td>
+ <td>String with the first letter in lower case and the rest unchanged.</td>
+ <td><tt>PrintIt</tt></td><td><tt>printIt</tt></td>
+</tr>
+<tr>
+ <td><tt>camelcase</tt> or <tt>ctitle</tt></td>
+ <td>String with capitalized first letter and any letter following an
+ underscore (which are removed in the process) and rest in lower case.</td>
+ <td><tt>print_it</tt></td><td><tt>PrintIt</tt></td>
+</tr>
+<tr>
+ <td><tt>lowercamelcase</tt> or <tt>lctitle</tt></td>
+ <td>String with every letter following an underscore (which is removed in
+ the process) capitalized and rest, including the first letter, in lower
+ case.</td>
+ <td><tt>print_it</tt></td><td><tt>printIt</tt></td>
+</tr>
+<tr>
+ <td><tt>undercase</tt> or <tt>utitle</tt></td>
+ <td>Lower case string with underscores inserted before every upper case
+ letter in the original string and any number not at the end of string.
+ Logically, this is the reverse of <tt>camelcase</tt>.</td>
+ <td><tt>PrintIt</tt></td><td><tt>print_it</tt></td>
+</tr>
+<tr>
+ <td><tt>schemify</tt></td>
+ <td>String with all underscores replaced with dashes, resulting in more
+ Lispers/Schemers-pleasing name.</td>
+ <td><tt>print_it</tt></td><td><tt>print-it</tt></td>
+</tr>
+<tr>
+ <td><tt>strip:[prefix]</tt></td>
+ <td>String without the given prefix or the original string if it doesn't
+ start with this prefix. Note that square brackets should be used
+ literally, e.g. <tt>%rename("strip:[wx]")</tt></td>
+ <td><tt>wxPrint</tt></td><td><tt>Print</tt></td>
+</tr>
+<tr>
+ <td><span style="white-space: nowrap;"><tt>regex:/pattern/subst/</tt></span></td>
+ <td>String after (Perl-like) regex substitution operation. This function
+ allows to apply arbitrary regular expressions to the identifier names. The
+ <i>pattern</i> part is a regular expression in Perl syntax (as supported
+ by the <a href="http://www.pcre.org/">Perl Compatible Regular Expressions (PCRE)</a>)
+ library and the <i>subst</i> string
+ can contain back-references introduced by <tt>'\'</tt> or, as backslashes need
+ to be escaped in C strings, rather by <tt>"\\"</tt>. For example, to remove
+ any alphabetic prefix before an underscore you could use the following directive:
+ <tt>%rename("regex:/(\\w+)_(.*)/\\2/")</tt></td>
+ <td><tt>Prefix_Print</tt></td><td><tt>Print</tt></td>
+</tr>
+<tr>
+ <td><tt>command:cmd</tt></td>
+ <td>Output of an external command <tt>cmd</tt> with the string passed to
+ it as input. Notice that this function is extremely slow compared to all
+ the other ones as it involves spawning a separate process and using it for
+ many declarations is not recommended. The <i>cmd</i> is not enclosed in
+ square brackets but must be terminated with a triple <tt>'&lt;'</tt> sign,
+ e.g. <tt>%rename("command:tr&nbsp;-d&nbsp;aeiou &lt;&lt;&lt;")</tt>
+ (nonsensical example removing all vowels)</td>
+ <td><tt>Print</tt></td><td><tt>Prnt</tt></td>
+</tr>
+</table>
+
+<p>
+The most general function of all of the above ones (not counting
+<tt>command</tt> which is even more powerful in principle but which should
+generally be avoided because of performance considerations) is the
+<tt>regex</tt> one. Here are some more examples of its use:
+</p>
+
+<div class="code">
+<pre>
+// Strip the wx prefix from all identifiers except those starting with wxEVT
+%rename("%(regex:/wx(?!EVT)(.*)/\\1/)s") ""; // wxSomeWidget -&gt; SomeWidget
+ // wxEVT_PAINT -&gt; wxEVT_PAINT
+
+// Apply a rule for renaming the enum elements to avoid the common prefixes
+// which are redundant in C#/Java
+%rename("%(regex:/^([A-Z][a-z]+)+_(.*)/\\2/)s", %$isenumitem) ""; // Colour_Red -&gt; Red
+
+// Remove all "Set/Get" prefixes.
+%rename("%(regex:/^(Set|Get)(.*)/\\2/)s") ""; // SetValue -&gt; Value
+ // GetValue -&gt; Value
+</pre>
+</div>
+
+<p>
+As before, everything that was said above about <tt>%rename</tt> also applies to
+<tt>%ignore</tt>. In fact, the latter is just a special case of the former and
+ignoring an identifier is the same as renaming it to the special
+<tt>"$ignore"</tt> value. So the following snippets
+</p>
+
+<div class="code">
+<pre>
+%ignore print;
+</pre>
+</div>
+
+<p>
+and
+</p>
+
+<div class="code">
+<pre>
+%rename("$ignore") print;
+</pre>
+</div>
+
+<p>
+are exactly equivalent and <tt>%rename</tt> can be used to selectively ignore
+multiple declarations using the previously described matching possibilities.
+</p>
+
+<H4><a name="SWIG_limiting_renaming"></a>5.4.7.3 Limiting global renaming rules</H4>
+
+
+<p>
+As explained in the previous sections, it is possible to either rename
+individual declarations or apply a rename rule to all of them at once. In
+practice, the latter is however rarely appropriate as there are always some
+exceptions to the general rules. To deal with them, the scope of an unnamed
+<tt>%rename</tt> can be limited using subsequent <tt>match</tt> parameters.
+They can be applied to any of the attributes associated by SWIG with the
+declarations appearing in its input. For example:
+</p>
+<div class="code">
+<pre>
+%rename("foo", match$name="bar") "";
+</pre>
+</div>
+<p>
+can be used to achieve the same effect as the simpler
+</p>
+<div class="code">
+<pre>
+%rename("foo") bar;
+</pre>
+</div>
+<p>
+and so is not very interesting on its own. However <tt>match</tt> can also be
+applied to the declaration type, for example <tt>match="class"</tt> restricts
+the match to class declarations only (in C++) and <tt>match="enumitem"</tt>
+restricts it to the enum elements. SWIG also provides convenience macros for
+such match expressions, for example
+</p>
+<div class="code">
+<pre>
+%rename("%(title)s", %$isenumitem) "";
+</pre>
+</div>
+<p>
+will capitalize the names of all the enum elements but not change the case of
+the other declarations. Similarly, <tt>%$isclass</tt>, <tt>%$isfunction</tt>
+and <tt>%$isvariable</tt> can be used. Many other checks are possible and this
+documentation is not exhaustive, see "%rename predicates" section of
+<tt>swig.swg</tt> for the full list of supported match expressions.
+</p>
+
+<p>
+In addition to literally matching some string with <tt>match</tt> you can
+also use <tt>regexmatch</tt> or <tt>notregexmatch</tt> to match a string
+against a regular expression. For example, to ignore all functions having
+"Old" as a suffix you could use
+</p>
+<div class="code">
+<pre>
+%rename("$ignore", regexmatch$name="Old$") "";
+</pre>
+</div>
+<p>
+For simple cases like this, specifying the regular expression for the
+declaration name directly can be preferable and can also be done using
+<tt>regextarget</tt>:
+</p>
+<div class="code">
+<pre>
+%rename("$ignore", regextarget=1) "Old$";
+</pre>
+</div>
+Notice that the check is done only against the name of the declaration
+itself, if you need to match the full name of a C++ declaration you
+must use <tt>fullname</tt> attribute:
+<div class="code">
+<pre>
+%rename("$ignore", regextarget=1, fullname=1) "NameSpace::ClassName::.*Old$";
+</pre>
+</div>
+
+<p>
+As for <tt>notregexmatch</tt>, it restricts the match only to the strings not
+matching the specified regular expression. So to rename all declarations to lower case
+except those consisting of capital letters only:
+</p>
+<div class="code">
+<pre>
+%rename("$(lower)s", notregexmatch$name="^[A-Z]+$") "";
+</pre>
+</div>
+
+<p>
+Finally, variants of <tt>%rename</tt> and <tt>%ignore</tt> directives can be used to help
+wrap C++ overloaded functions and methods or C++ methods which use default arguments. This is described in the
+<a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a> section in the C++ chapter.
+</p>
+
+
<H3><a name="SWIG_default_args"></a>5.4.8 Default/optional arguments</H3>
@@ -1926,13 +2213,13 @@ normally, just use the original function name such as <tt>add()</tt>.
<p>
SWIG provides a number of extensions to standard C printf formatting
that may be useful in this context. For instance, the following
-variation installs the callbacks as all upper-case constants such as
+variation installs the callbacks as all upper case constants such as
<tt>ADD</tt>, <tt>SUB</tt>, and <tt>MUL</tt>:
</p>
<div class="code"><pre>
/* Some callback functions */
-%callback("%(upper)s");
+%callback("%(uppercase)s");
int add(int,int);
int sub(int,int);
int mul(int,int);
@@ -1940,7 +2227,7 @@ int mul(int,int);
</pre></div>
<p>
-A format string of <tt>"%(lower)s"</tt> converts all characters to lower-case.
+A format string of <tt>"%(lowercase)s"</tt> converts all characters to lower case.
A string of <tt>"%(title)s"</tt> capitalizes the first character and converts the
rest to lower case.
</p>
@@ -1949,7 +2236,8 @@ rest to lower case.
And now, a final note about function pointer support. Although SWIG
does not normally allow callback functions to be written in the target language, this
can be accomplished with the use of typemaps and other advanced SWIG features.
-This is described in a later chapter.
+See the <a href="Typemaps.html#Typemaps">Typemaps chapter</a> for more about typemaps
+and individual target language chapters for more on callbacks and the 'director' feature.
</p>
<H2><a name="SWIG_nn31"></a>5.5 Structures and unions</H2>
diff --git a/Doc/Manual/SWIGPlus.html b/Doc/Manual/SWIGPlus.html
index f9bfc8e..c8e5ee8 100644
--- a/Doc/Manual/SWIGPlus.html
+++ b/Doc/Manual/SWIGPlus.html
@@ -4192,8 +4192,9 @@ In the example below, the generic template type is used to rename to <tt>bbb</tt
<div class="code">
<pre>
-%rename(bbb) Space::ABC::aaa(T t); // will match but with lower precedence than ccc
-%rename(ccc) Space::ABC&lt;Space::XYZ&gt;::aaa(Space::XYZ t); // will match but with higher precedence than bbb
+%rename(bbb) Space::ABC::aaa(T t); // will match but with lower precedence than ccc
+%rename(ccc) Space::ABC&lt;Space::XYZ&gt;::aaa(Space::XYZ t);// will match but with higher precedence
+ // than bbb
namespace Space {
class XYZ {};
@@ -4214,9 +4215,9 @@ Below shows how %rename can be placed inside a namespace.
<div class="code">
<pre>
namespace Space {
- %rename(bbb) ABC::aaa(T t); // will match but with lower precedence than ccc
- %rename(ccc) ABC&lt;Space::XYZ&gt;::aaa(Space::XYZ t); // will match but with higher precedence than bbb
- %rename(ddd) ABC&lt;Space::XYZ&gt;::aaa(XYZ t); // will not match
+ %rename(bbb) ABC::aaa(T t); // will match but with lower precedence than ccc
+ %rename(ccc) ABC&lt;Space::XYZ&gt;::aaa(Space::XYZ t);// will match but with higher precedence than bbb
+ %rename(ddd) ABC&lt;Space::XYZ&gt;::aaa(XYZ t); // will not match
}
namespace Space {
@@ -4238,11 +4239,11 @@ The following example shows how %rename can be placed within %extend.
<pre>
namespace Space {
%extend ABC {
- %rename(bbb) aaa(T t); // will match but with lower precedence than ccc
+ %rename(bbb) aaa(T t); // will match but with lower precedence than ccc
}
%extend ABC&lt;Space::XYZ&gt; {
- %rename(ccc) aaa(Space::XYZ t); // will match but with higher precedence than bbb
- %rename(ddd) aaa(XYZ t); // will not match
+ %rename(ccc) aaa(Space::XYZ t);// will match but with higher precedence than bbb
+ %rename(ddd) aaa(XYZ t); // will not match
}
}
diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html
index 8693adc..8f171b9 100644
--- a/Doc/Manual/Sections.html
+++ b/Doc/Manual/Sections.html
@@ -6,7 +6,7 @@
<body bgcolor="#ffffff">
<H1><a name="Sections"></a>SWIG-2.0 Documentation</H1>
-Last update : SWIG-2.0.1 (in progress)
+Last update : SWIG-2.0.2 (in progress)
<H2>Sections</H2>
@@ -19,7 +19,7 @@ Last update : SWIG-2.0.1 (in progress)
<li><a href="SWIG.html#SWIG">SWIG Basics</a> (Read this!)</li>
<li><a href="SWIGPlus.html#SWIGPlus">SWIG and C++</a></li>
<li><a href="Preprocessor.html#Preprocessor">The SWIG preprocessor</a></li>
-<li><a href="Library.html#Library">The SWIG Library</a></li>
+<li><a href="Library.html#Library">The SWIG library</a></li>
<li><a href="Arguments.html#Arguments">Argument handling</a></li>
<li><a href="Typemaps.html#Typemaps">Typemaps</a></li>
<li><a href="Customization.html#Customization">Customization features</a></li>
@@ -36,21 +36,22 @@ Last update : SWIG-2.0.1 (in progress)
<li><a href="Allegrocl.html#Allegrocl">Allegro CL support</a></li>
<li><a href="CSharp.html#CSharp">C# support</a></li>
<li><a href="Chicken.html#Chicken">Chicken support</a></li>
+<li><a href="D.html#D">D support</a></li>
<li><a href="Go.html#Go">Go support</a></li>
<li><a href="Guile.html#Guile">Guile support</a></li>
<li><a href="Java.html#Java">Java support</a></li>
-<li><a href="Lua.html#Lua">Lua support</a></li>
<li><a href="Lisp.html#Lisp">Common Lisp support</a></li>
+<li><a href="Lua.html#Lua">Lua support</a></li>
<li><a href="Modula3.html#Modula3">Modula3 support</a></li>
-<li><a href="Mzscheme.html#MzScheme">MzScheme support</a></li>
+<li><a href="Mzscheme.html#Mzscheme">MzScheme support</a></li>
<li><a href="Ocaml.html#Ocaml">Ocaml support</a></li>
<li><a href="Octave.html#Octave">Octave support</a></li>
<li><a href="Perl5.html#Perl5">Perl5 support</a></li>
<li><a href="Php.html#Php">PHP support</a></li>
<li><a href="Pike.html#Pike">Pike support</a></li>
<li><a href="Python.html#Python">Python support</a></li>
-<li><a href="Ruby.html#Ruby">Ruby support</a></li>
<li><a href="R.html#R">R support</a></li>
+<li><a href="Ruby.html#Ruby">Ruby support</a></li>
<li><a href="Tcl.html#Tcl">Tcl support</a></li>
</ul>
diff --git a/Doc/Manual/Tcl.html b/Doc/Manual/Tcl.html
index d47dae5..c677f6e 100644
--- a/Doc/Manual/Tcl.html
+++ b/Doc/Manual/Tcl.html
@@ -6,7 +6,7 @@
</head>
<body bgcolor="#ffffff">
-<H1><a name="Tcl"></a>34 SWIG and Tcl</H1>
+<H1><a name="Tcl"></a>36 SWIG and Tcl</H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@@ -83,7 +83,7 @@ Tcl 8.0 or a later release. Earlier releases of SWIG supported Tcl 7.x, but
this is no longer supported.
</p>
-<H2><a name="Tcl_nn2"></a>34.1 Preliminaries</H2>
+<H2><a name="Tcl_nn2"></a>36.1 Preliminaries</H2>
<p>
@@ -109,7 +109,7 @@ build a Tcl extension module. To finish building the module, you
need to compile this file and link it with the rest of your program.
</p>
-<H3><a name="Tcl_nn3"></a>34.1.1 Getting the right header files</H3>
+<H3><a name="Tcl_nn3"></a>36.1.1 Getting the right header files</H3>
<p>
@@ -127,7 +127,7 @@ this is the case, you should probably make a symbolic link so that <tt>tcl.h</tt
header file.
</p>
-<H3><a name="Tcl_nn4"></a>34.1.2 Compiling a dynamic module</H3>
+<H3><a name="Tcl_nn4"></a>36.1.2 Compiling a dynamic module</H3>
<p>
@@ -162,7 +162,7 @@ The name of the module is specified using the <tt>%module</tt> directive or the
<tt> -module</tt> command line option.
</p>
-<H3><a name="Tcl_nn5"></a>34.1.3 Static linking</H3>
+<H3><a name="Tcl_nn5"></a>36.1.3 Static linking</H3>
<p>
@@ -228,7 +228,7 @@ minimal in most situations (and quite frankly not worth the extra
hassle in the opinion of this author).
</p>
-<H3><a name="Tcl_nn6"></a>34.1.4 Using your module</H3>
+<H3><a name="Tcl_nn6"></a>36.1.4 Using your module</H3>
<p>
@@ -356,7 +356,7 @@ to the default system configuration (this requires root access and you will need
the man pages).
</p>
-<H3><a name="Tcl_nn7"></a>34.1.5 Compilation of C++ extensions</H3>
+<H3><a name="Tcl_nn7"></a>36.1.5 Compilation of C++ extensions</H3>
<p>
@@ -439,7 +439,7 @@ erratic program behavior. If working with lots of software components, you
might want to investigate using a more formal standard such as COM.
</p>
-<H3><a name="Tcl_nn8"></a>34.1.6 Compiling for 64-bit platforms</H3>
+<H3><a name="Tcl_nn8"></a>36.1.6 Compiling for 64-bit platforms</H3>
<p>
@@ -466,7 +466,7 @@ also introduce problems on platforms that support more than one
linking standard (e.g., -o32 and -n32 on Irix).
</p>
-<H3><a name="Tcl_nn9"></a>34.1.7 Setting a package prefix</H3>
+<H3><a name="Tcl_nn9"></a>36.1.7 Setting a package prefix</H3>
<p>
@@ -485,7 +485,7 @@ option will append the prefix to the name when creating a command and
call it "<tt>Foo_bar</tt>".
</p>
-<H3><a name="Tcl_nn10"></a>34.1.8 Using namespaces</H3>
+<H3><a name="Tcl_nn10"></a>36.1.8 Using namespaces</H3>
<p>
@@ -507,7 +507,7 @@ When the<tt> -namespace</tt> option is used, objects in the module
are always accessed with the namespace name such as <tt>Foo::bar</tt>.
</p>
-<H2><a name="Tcl_nn11"></a>34.2 Building Tcl/Tk Extensions under Windows 95/NT</H2>
+<H2><a name="Tcl_nn11"></a>36.2 Building Tcl/Tk Extensions under Windows 95/NT</H2>
<p>
@@ -518,7 +518,7 @@ covers the process of using SWIG with Microsoft Visual C++.
although the procedure may be similar with other compilers.
</p>
-<H3><a name="Tcl_nn12"></a>34.2.1 Running SWIG from Developer Studio</H3>
+<H3><a name="Tcl_nn12"></a>36.2.1 Running SWIG from Developer Studio</H3>
<p>
@@ -576,7 +576,7 @@ MSDOS &gt; tclsh80
%
</pre></div>
-<H3><a name="Tcl_nn13"></a>34.2.2 Using NMAKE</H3>
+<H3><a name="Tcl_nn13"></a>36.2.2 Using NMAKE</H3>
<p>
@@ -639,7 +639,7 @@ to get you started. With a little practice, you'll be making lots of
Tcl extensions.
</p>
-<H2><a name="Tcl_nn14"></a>34.3 A tour of basic C/C++ wrapping</H2>
+<H2><a name="Tcl_nn14"></a>36.3 A tour of basic C/C++ wrapping</H2>
<p>
@@ -650,7 +650,7 @@ classes. This section briefly covers the essential aspects of this
wrapping.
</p>
-<H3><a name="Tcl_nn15"></a>34.3.1 Modules</H3>
+<H3><a name="Tcl_nn15"></a>36.3.1 Modules</H3>
<p>
@@ -684,7 +684,7 @@ To fix this, supply an extra argument to <tt>load</tt> like this:
</pre>
</div>
-<H3><a name="Tcl_nn16"></a>34.3.2 Functions</H3>
+<H3><a name="Tcl_nn16"></a>36.3.2 Functions</H3>
<p>
@@ -709,7 +709,7 @@ like you think it does:
%
</pre></div>
-<H3><a name="Tcl_nn17"></a>34.3.3 Global variables</H3>
+<H3><a name="Tcl_nn17"></a>36.3.3 Global variables</H3>
<p>
@@ -789,7 +789,7 @@ extern char *path; // Read-only (due to %immutable)
</pre>
</div>
-<H3><a name="Tcl_nn18"></a>34.3.4 Constants and enums</H3>
+<H3><a name="Tcl_nn18"></a>36.3.4 Constants and enums</H3>
<p>
@@ -873,7 +873,7 @@ When an identifier name is given, it is used to perform an implicit hash-table l
conversion. This allows the <tt>global</tt> statement to be omitted.
</p>
-<H3><a name="Tcl_nn19"></a>34.3.5 Pointers</H3>
+<H3><a name="Tcl_nn19"></a>36.3.5 Pointers</H3>
<p>
@@ -969,7 +969,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return
<tt>None</tt> if the conversion can't be performed.
</p>
-<H3><a name="Tcl_nn20"></a>34.3.6 Structures</H3>
+<H3><a name="Tcl_nn20"></a>36.3.6 Structures</H3>
<p>
@@ -1251,7 +1251,7 @@ Note: Tcl only destroys the underlying object if it has ownership. See the
memory management section that appears shortly.
</p>
-<H3><a name="Tcl_nn21"></a>34.3.7 C++ classes</H3>
+<H3><a name="Tcl_nn21"></a>36.3.7 C++ classes</H3>
<p>
@@ -1318,7 +1318,7 @@ In Tcl, the static member is accessed as follows:
</pre>
</div>
-<H3><a name="Tcl_nn22"></a>34.3.8 C++ inheritance</H3>
+<H3><a name="Tcl_nn22"></a>36.3.8 C++ inheritance</H3>
<p>
@@ -1367,7 +1367,7 @@ For instance:
It is safe to use multiple inheritance with SWIG.
</p>
-<H3><a name="Tcl_nn23"></a>34.3.9 Pointers, references, values, and arrays</H3>
+<H3><a name="Tcl_nn23"></a>36.3.9 Pointers, references, values, and arrays</H3>
<p>
@@ -1421,7 +1421,7 @@ to hold the result and a pointer is returned (Tcl will release this memory
when the return value is garbage collected).
</p>
-<H3><a name="Tcl_nn24"></a>34.3.10 C++ overloaded functions</H3>
+<H3><a name="Tcl_nn24"></a>36.3.10 C++ overloaded functions</H3>
<p>
@@ -1544,7 +1544,7 @@ first declaration takes precedence.
Please refer to the "SWIG and C++" chapter for more information about overloading.
</p>
-<H3><a name="Tcl_nn25"></a>34.3.11 C++ operators</H3>
+<H3><a name="Tcl_nn25"></a>36.3.11 C++ operators</H3>
<p>
@@ -1646,7 +1646,7 @@ There are ways to make this operator appear as part of the class using the <tt>%
Keep reading.
</p>
-<H3><a name="Tcl_nn26"></a>34.3.12 C++ namespaces</H3>
+<H3><a name="Tcl_nn26"></a>36.3.12 C++ namespaces</H3>
<p>
@@ -1710,7 +1710,7 @@ utilizes thousands of small deeply nested namespaces each with
identical symbol names, well, then you get what you deserve.
</p>
-<H3><a name="Tcl_nn27"></a>34.3.13 C++ templates</H3>
+<H3><a name="Tcl_nn27"></a>36.3.13 C++ templates</H3>
<p>
@@ -1762,7 +1762,7 @@ More details can be found in the <a href="SWIGPlus.html#SWIGPlus">SWIG and C++</
examples will appear later.
</p>
-<H3><a name="Tcl_nn28"></a>34.3.14 C++ Smart Pointers</H3>
+<H3><a name="Tcl_nn28"></a>36.3.14 C++ Smart Pointers</H3>
<p>
@@ -1846,7 +1846,7 @@ simply use the <tt>__deref__()</tt> method. For example:
</pre>
</div>
-<H2><a name="Tcl_nn29"></a>34.4 Further details on the Tcl class interface</H2>
+<H2><a name="Tcl_nn29"></a>36.4 Further details on the Tcl class interface</H2>
<p>
@@ -1859,7 +1859,7 @@ of low-level details were omitted. This section provides a brief overview
of how the proxy classes work.
</p>
-<H3><a name="Tcl_nn30"></a>34.4.1 Proxy classes</H3>
+<H3><a name="Tcl_nn30"></a>36.4.1 Proxy classes</H3>
<p>
@@ -1924,7 +1924,7 @@ function. This allows objects to be encapsulated objects that look a lot like
as shown in the last section.
</p>
-<H3><a name="Tcl_nn31"></a>34.4.2 Memory management</H3>
+<H3><a name="Tcl_nn31"></a>36.4.2 Memory management</H3>
<p>
@@ -2112,7 +2112,7 @@ typemaps--an advanced topic discussed later.
</p>
-<H2><a name="Tcl_nn32"></a>34.5 Input and output parameters</H2>
+<H2><a name="Tcl_nn32"></a>36.5 Input and output parameters</H2>
<p>
@@ -2300,7 +2300,7 @@ set c [lindex $dim 1]
</pre>
</div>
-<H2><a name="Tcl_nn33"></a>34.6 Exception handling </H2>
+<H2><a name="Tcl_nn33"></a>36.6 Exception handling </H2>
<p>
@@ -2434,7 +2434,7 @@ Since SWIG's exception handling is user-definable, you are not limited to C++ ex
See the chapter on "<a href="Customization.html#Customization">Customization Features</a>" for more examples.
</p>
-<H2><a name="Tcl_nn34"></a>34.7 Typemaps</H2>
+<H2><a name="Tcl_nn34"></a>36.7 Typemaps</H2>
<p>
@@ -2451,7 +2451,7 @@ Typemaps are only used if you want to change some aspect of the primitive
C-Tcl interface.
</p>
-<H3><a name="Tcl_nn35"></a>34.7.1 What is a typemap?</H3>
+<H3><a name="Tcl_nn35"></a>36.7.1 What is a typemap?</H3>
<p>
@@ -2568,7 +2568,7 @@ parameter is omitted):
</pre>
</div>
-<H3><a name="Tcl_nn36"></a>34.7.2 Tcl typemaps</H3>
+<H3><a name="Tcl_nn36"></a>36.7.2 Tcl typemaps</H3>
<p>
@@ -2706,7 +2706,7 @@ Initialize an argument to a value before any conversions occur.
Examples of these methods will appear shortly.
</p>
-<H3><a name="Tcl_nn37"></a>34.7.3 Typemap variables</H3>
+<H3><a name="Tcl_nn37"></a>36.7.3 Typemap variables</H3>
<p>
@@ -2777,7 +2777,7 @@ properly assigned.
The Tcl name of the wrapper function being created.
</div>
-<H3><a name="Tcl_nn38"></a>34.7.4 Converting a Tcl list to a char ** </H3>
+<H3><a name="Tcl_nn38"></a>36.7.4 Converting a Tcl list to a char ** </H3>
<p>
@@ -2839,7 +2839,7 @@ argv[2] = Larry
3
</pre></div>
-<H3><a name="Tcl_nn39"></a>34.7.5 Returning values in arguments</H3>
+<H3><a name="Tcl_nn39"></a>36.7.5 Returning values in arguments</H3>
<p>
@@ -2881,7 +2881,7 @@ result, a Tcl function using these typemaps will work like this :
%
</pre></div>
-<H3><a name="Tcl_nn40"></a>34.7.6 Useful functions</H3>
+<H3><a name="Tcl_nn40"></a>36.7.6 Useful functions</H3>
<p>
@@ -2958,7 +2958,7 @@ int Tcl_IsShared(Tcl_Obj *obj);
</pre>
</div>
-<H3><a name="Tcl_nn41"></a>34.7.7 Standard typemaps</H3>
+<H3><a name="Tcl_nn41"></a>36.7.7 Standard typemaps</H3>
<p>
@@ -3042,7 +3042,7 @@ work)
</pre>
</div>
-<H3><a name="Tcl_nn42"></a>34.7.8 Pointer handling</H3>
+<H3><a name="Tcl_nn42"></a>36.7.8 Pointer handling</H3>
<p>
@@ -3118,7 +3118,7 @@ For example:
</pre>
</div>
-<H2><a name="Tcl_nn43"></a>34.8 Turning a SWIG module into a Tcl Package.</H2>
+<H2><a name="Tcl_nn43"></a>36.8 Turning a SWIG module into a Tcl Package.</H2>
<p>
@@ -3190,7 +3190,7 @@ As a final note, most SWIG examples do not yet use the
to use the <tt>load</tt> command instead.
</p>
-<H2><a name="Tcl_nn44"></a>34.9 Building new kinds of Tcl interfaces (in Tcl)</H2>
+<H2><a name="Tcl_nn44"></a>36.9 Building new kinds of Tcl interfaces (in Tcl)</H2>
<p>
@@ -3289,7 +3289,7 @@ danger of blowing something up (although it is easily accomplished
with an out of bounds array access).
</p>
-<H3><a name="Tcl_nn45"></a>34.9.1 Proxy classes</H3>
+<H3><a name="Tcl_nn45"></a>36.9.1 Proxy classes</H3>
<p>
@@ -3410,7 +3410,7 @@ short, but clever Tcl script can be combined with SWIG to do many
interesting things.
</p>
-<H2><a name="Tcl_nn46"></a>34.10 Tcl/Tk Stubs</H2>
+<H2><a name="Tcl_nn46"></a>36.10 Tcl/Tk Stubs</H2>
<p>
diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html
index 1568c08..6331aa1 100644
--- a/Doc/Manual/Typemaps.html
+++ b/Doc/Manual/Typemaps.html
@@ -1711,7 +1711,8 @@ you'll find the full typemap contents (example shown below for Python):
%typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &amp;argp,$descriptor, $disown | 0 );
if (!SWIG_IsOK(res)) {
- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
+ SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument "
+ "$argnum"" of type '" "$type""'");
}
$1 = ($ltype)(argp);
}
@@ -1732,7 +1733,8 @@ SWIGINTERN PyObject *_wrap_foo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
...
res1 = SWIG_ConvertPtr(obj0, &amp;argp1,SWIGTYPE_p_a_4__int, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "foo" "', argument " "1"" of type '" "int [10][4]""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "foo" "', argument "
+ "1"" of type '" "int [10][4]""'");
}
arg1 = (int (*)[4])(argp1);
...
@@ -1791,7 +1793,8 @@ void set_value(const char* val) {}
}
}
-%apply SWIGTYPE * { const char* val, const char* another_value } // use default pointer handling instead of strings
+// use default pointer handling instead of strings
+%apply SWIGTYPE * { const char* val, const char* another_value }
%typemap(check) const char* val = char* NON_NULL;
@@ -3296,7 +3299,8 @@ SWIG can detect when the "optimal" attribute cannot be used and will ignore it a
<div class="targetlang">
<pre>
example.i:28: Warning 474: Method XX::create() usage of the optimal attribute ignored
-example.i:14: Warning 474: in the out typemap as the following cannot be used to generate optimal code:
+example.i:14: Warning 474: in the out typemap as the following cannot be used to generate
+optimal code:
try {
result = XX::create();
} catch(const std::exception &amp;e) {
@@ -3317,8 +3321,8 @@ In fact SWIG attempts to detect this and will issue a warning something like:
<div class="targetlang">
<pre>
-example.i:21: Warning 475: Multiple calls to XX::create() might be generated due to optimal attribute usage in
-example.i:7: Warning 475: the out typemap.
+example.i:21: Warning 475: Multiple calls to XX::create() might be generated due to
+example.i:7: Warning 475: optimal attribute usage in the out typemap.
</pre>
</div>
diff --git a/Doc/Manual/Warnings.html b/Doc/Manual/Warnings.html
index 96e3590..325bf2f 100644
--- a/Doc/Manual/Warnings.html
+++ b/Doc/Manual/Warnings.html
@@ -25,7 +25,7 @@
<li><a href="#Warnings_nn12">C/C++ Parser (300-399)</a>
<li><a href="#Warnings_nn13">Types and typemaps (400-499) </a>
<li><a href="#Warnings_nn14">Code generation (500-599)</a>
-<li><a href="#Warnings_nn15">Language module specific (800-899) </a>
+<li><a href="#Warnings_nn15">Language module specific (700-899) </a>
<li><a href="#Warnings_nn16">User defined (900-999)</a>
</ul>
<li><a href="#Warnings_nn17">History</a>
@@ -513,9 +513,10 @@ example.i(4) : Syntax error in input.
<li>517.
<li>518. Portability warning: File <em>file1</em> will be overwritten by <em>file2</em> on case insensitive filesystems such as Windows' FAT32 and NTFS unless the class/module name is renamed.
<li>519. %template() contains no name. Template method ignored: <em>declaration</em>
+<li>520. <em>Base/Derived</em> class '<em>classname1</em>' of '<em>classname2</em>' is not similarly marked as a smart pointer.
</ul>
-<H3><a name="Warnings_nn15"></a>14.9.6 Language module specific (800-899) </H3>
+<H3><a name="Warnings_nn15"></a>14.9.6 Language module specific (700-899) </H3>
<ul>
diff --git a/Doc/Manual/chapters b/Doc/Manual/chapters
index cd39999..924c8cf 100644
--- a/Doc/Manual/chapters
+++ b/Doc/Manual/chapters
@@ -17,6 +17,7 @@ CCache.html
Allegrocl.html
CSharp.html
Chicken.html
+D.html
Go.html
Guile.html
Java.html
@@ -30,8 +31,7 @@ Perl5.html
Php.html
Pike.html
Python.html
+R.html
Ruby.html
Tcl.html
-R.html
Extending.html
-
diff --git a/Doc/Manual/linkchecker.config b/Doc/Manual/linkchecker.config
new file mode 100644
index 0000000..a947b27
--- /dev/null
+++ b/Doc/Manual/linkchecker.config
@@ -0,0 +1,5 @@
+[checking]
+anchors=1
+
+[filtering]
+ignorewarnings=http-robots-denied
diff --git a/Doc/Manual/makechap.py b/Doc/Manual/makechap.py
index 4dd048c..8225bfc 100644
--- a/Doc/Manual/makechap.py
+++ b/Doc/Manual/makechap.py
@@ -1,4 +1,4 @@
-#!/usr/local/bin/python
+#!/usr/bin/env python
###############################################################################
# Takes a chapter as input and adds internal links and numbering to all
diff --git a/Doc/Manual/maketoc.py b/Doc/Manual/maketoc.py
index c78bcfd..d8c4aa7 100644
--- a/Doc/Manual/maketoc.py
+++ b/Doc/Manual/maketoc.py
@@ -1,4 +1,4 @@
-#!/usr/local/bin/python
+#!/usr/bin/env python
import sys
import os
@@ -12,7 +12,7 @@ print >>f, """
<TITLE>SWIG Users Manual</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
-<H1>SWIG Users Manual</H1>
+<H1><a name="Contents"></a>SWIG Users Manual</H1>
<p>
"""
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
index 06965fa..9641103 100644
--- a/Examples/Makefile.in
+++ b/Examples/Makefile.in
@@ -69,7 +69,7 @@ IOBJS = $(IWRAP:.i=.@OBJEXT@)
CPP_DLLIBS = #-L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
-L/usr/local/lib -lg++ -lstdc++ -lgcc
-# Solaris workshop 5.0
+# Solaris workshop 5.0
# CPP_DLLIBS = -L/opt/SUNWspro/lib -lCrun
# Symbols used for using shared libraries
@@ -159,7 +159,7 @@ tcl_cpp: $(SRCS)
# -----------------------------------------------------------------
tcl_clean:
- rm -f *_wrap* *~ .~* mytclsh@EXEEXT@
+ rm -f *_wrap* *~ .~* mytclsh@EXEEXT@
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *@SO@
@@ -296,9 +296,9 @@ python_static_cpp: $(SRCS)
$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
$(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET)
-# -----------------------------------------------------------------
+# -----------------------------------------------------------------
# Running a Python example
-# -----------------------------------------------------------------
+# -----------------------------------------------------------------
ifeq (,$(PY3))
PYSCRIPT = runme.py
@@ -313,7 +313,7 @@ python_run: $(PYSCRIPT)
runme3.py: runme.py
cp $< $@
- $(PY2TO3) -w $@ >/dev/null 2>&1
+ $(PY2TO3) -w $@ >/dev/null 2>&1
# -----------------------------------------------------------------
# Cleaning the python examples
@@ -332,7 +332,7 @@ python_clean:
# Make sure these locate your Octave installation
OCTAVE_INCLUDE= $(DEFS) @OCTAVEEXT@
-OCTAVE_LIB =
+OCTAVE_LIB =
# Extra Octave specific dynamic linking options
OCTAVE_DLNK = @OCTAVEDYNAMICLINKING@
@@ -548,14 +548,14 @@ mzscheme: $(SRCS)
mzscheme_cpp: $(SRCS)
$(SWIG) -mzscheme -c++ $(SWIGOPT) $(INTERFACEPATH)
$(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ICXXSRCS) $(SRCS) $(CXXSRCS)
- $(CXXSHARED) $(CFLAGS) -o $(LIBPREFIX)$(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS)
+ $(CXXSHARED) $(CFLAGS) -o $(LIBPREFIX)$(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS)
# -----------------------------------------------------------------
# Cleaning the mzscheme examples
# -----------------------------------------------------------------
mzscheme_clean:
- rm -f *_wrap* *~ .~*
+ rm -f *_wrap* *~ .~*
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *@SO@
@@ -632,7 +632,7 @@ ocaml_static_cpp: $(SRCS)
$(OCAMLCORE)
$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH)
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
- $(OCC) -cc '$(CXX)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
+ $(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS)
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
$(OCC) -g -c $(INTERFACE:%.i=%.ml)
@@ -643,13 +643,13 @@ ocaml_static_cpp: $(SRCS)
$(INTERFACE:%.i=%.cmo) \
$(PROGFILE:%.ml=%.cmo) \
$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
- -cclib "$(LIBS)" -cc '$(CXX)'
+ -cclib "$(LIBS)" -cc '$(CXX) -Wno-write-strings'
ocaml_static_cpp_toplevel: $(SRCS)
$(OCAMLCORE)
$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH)
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
- $(OCC) -cc '$(CXX)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
+ $(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS)
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
$(OCC) -g -c $(INTERFACE:%.i=%.ml)
@@ -657,17 +657,17 @@ ocaml_static_cpp_toplevel: $(SRCS)
$(OCC) $(OCAMLPP) -c $(PROGFILE)
$(NOLINK) || $(OCAMLMKTOP) \
swig.cmo \
- -I $(OCAMLP4WHERE) camlp4o.cma swigp4.cmo \
+ -I $(OCAMLP4WHERE) dynlink.cma camlp4o.cma swigp4.cmo \
-g -ccopt -g -cclib -g -custom -o $(TARGET)_top \
$(INTERFACE:%.i=%.cmo) \
$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
- -cclib "$(LIBS)" -cc '$(CXX)'
+ -cclib "$(LIBS)" -cc '$(CXX) -Wno-write-strings'
ocaml_dynamic_cpp: $(SRCS)
$(OCAMLCORE)
$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH)
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
- $(OCC) -cc '$(CXX)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
+ $(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS) -ccopt -fPIC
$(CXXSHARED) $(CFLAGS) -o $(INTERFACE:%.i=%@SO@) \
$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
@@ -684,7 +684,7 @@ ocaml_dynamic_cpp: $(SRCS)
$(OCC) -cclib -export-dynamic -g -ccopt -g -cclib -g -custom \
-o $(TARGET) \
-package dl -linkpkg \
- $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) -cc '$(CXX)'
+ $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) -cc '$(CXX) -Wno-write-strings'
ocaml_clean:
rm -f *_wrap* *~ .~* *.cmo *.cmi $(MLFILE) $(MLFILE)i swig.mli swig.cmi swig.ml swig.cmo swigp4.ml swigp4.cmo
@@ -844,7 +844,7 @@ pike_cpp_static: $(SRCS)
# -----------------------------------------------------------------
pike_clean:
- rm -f *_wrap* *~ .~* mypike@EXEEXT@
+ rm -f *_wrap* *~ .~* mypike@EXEEXT@
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *@SO@
@@ -861,7 +861,7 @@ CHICKEN_CFLAGS = @CHICKENOPTS@
CHICKENOPTS = -quiet
CHICKEN_MAIN =
-# SWIG produces $(ISRCS) (the C wrapper file)
+# SWIG produces $(ISRCS) (the C wrapper file)
# and $(CHICKEN_GENERATED_SCHEME) (the Scheme wrapper file):
CHICKEN_GENERATED_SCHEME = $(INTERFACE:.i=.scm)
CHICKEN_COMPILED_SCHEME = $(INTERFACE:.i=_chicken.c)
@@ -1053,12 +1053,12 @@ lua_clean:
allegrocl: $(SRCS)
$(SWIG) -allegrocl -cwrap $(SWIGOPT) $(INTERFACEPATH)
- $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
allegrocl_cpp: $(SRCS)
$(SWIG) -c++ -allegrocl $(SWIGOPT) $(INTERFACEPATH)
- $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
allegrocl_clean:
@@ -1087,12 +1087,12 @@ clisp_clean:
cffi: $(SRCS)
$(SWIG) -cffi $(SWIGOPT) $(INTERFACEPATH)
-# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
+# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
# $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
cffi_cpp: $(SRCS)
$(SWIG) -c++ -cffi $(SWIGOPT) $(INTERFACEPATH)
- $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
cffi_clean:
@@ -1106,12 +1106,12 @@ cffi_clean:
uffi: $(SRCS)
$(SWIG) -uffi $(SWIGOPT) $(INTERFACEPATH)
-# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
+# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
# $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
uffi_cpp: $(SRCS)
$(SWIG) -c++ -uffi $(SWIGOPT) $(INTERFACEPATH)
-# $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
+# $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
# $(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
uffi_clean:
@@ -1241,3 +1241,69 @@ go_clean:
rm -f *_wrap* *_gc* .~* runme
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *.[568] *.a *@SO@
+
+##################################################################
+##### D ######
+##################################################################
+
+DLIBPREFIX = @DLIBPREFIX@
+
+ifeq (,$(D_VERSION))
+ D_VERSION = @DDEFAULTVERSION@
+endif
+
+ifeq (2,$(D_VERSION))
+ SWIGD = $(SWIG) -d -d2
+ DCOMPILER = @D2COMPILER@
+else
+ SWIGD = $(SWIG) -d
+ DCOMPILER = @D1COMPILER@
+endif
+
+ifeq (dmd,$(DCOMPILER))
+ # DMD is 32bit only by now
+ DCFLAGS = -m32
+endif
+
+# ----------------------------------------------------------------
+# Build a dynamically loadable D wrapper for a C module
+# ----------------------------------------------------------------
+
+d: $(SRCS)
+ $(SWIGD) $(SWIGOPT) $(INTERFACEPATH)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES)
+ $(LDSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(DLIBPREFIX)$(TARGET)$(SO)
+
+# ----------------------------------------------------------------
+# Build a dynamically loadable D wrapper for a C++ module
+# ----------------------------------------------------------------
+
+d_cpp: $(SRCS)
+ $(SWIGD) -c++ $(SWIGOPT) $(INTERFACEPATH)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES)
+ $(CXXSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(DLIBPREFIX)$(TARGET)$(SO)
+
+# ----------------------------------------------------------------
+# Compile D files
+# ----------------------------------------------------------------
+
+# Clear the DFLAGS environment variable for the compiler call itself
+# to work around a discrepancy in argument handling between DMD and LDC.
+d_compile: $(SRCS)
+ DFLAGS="" $(COMPILETOOL) $(DCOMPILER) $(DFLAGS) $(DSRCS)
+
+# -----------------------------------------------------------------
+# Run D example
+# -----------------------------------------------------------------
+
+d_run:
+ env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./runme
+
+# -----------------------------------------------------------------
+# Clean the D examples
+# -----------------------------------------------------------------
+
+d_clean:
+ rm -f *_wrap* *~ .~* runme runme.exe `find . -name \*.d | grep -v runme.d`
+ rm -f core @EXTRA_CLEAN@
+ rm -f *.@OBJEXT@ *@SO@
diff --git a/Examples/d/callback/Makefile b/Examples/d/callback/Makefile
new file mode 100644
index 0000000..b5808cf
--- /dev/null
+++ b/Examples/d/callback/Makefile
@@ -0,0 +1,30 @@
+ifeq (2,$(D_VERSION))
+ WORKING_DIR = d2/
+else
+ WORKING_DIR = d1/
+endif
+
+TOP = ../../..
+SWIG = $(TOP)/../preinst-swig
+EXTRA_CFLAGS = -I../ ../example.cxx example_wrap.cxx
+EXTRA_LDFLAGS = example.o example_wrap.o
+TARGET = example_wrap
+SWIGOPT =
+DSRCS = *.d
+DFLAGS = -ofrunme
+
+
+all:: d
+
+d::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \
+ $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
+
+clean::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_clean
+
+check: all
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_run
diff --git a/Examples/d/callback/d1/runme.d b/Examples/d/callback/d1/runme.d
new file mode 100644
index 0000000..e34e096
--- /dev/null
+++ b/Examples/d/callback/d1/runme.d
@@ -0,0 +1,36 @@
+module runme;
+
+import tango.io.Stdout;
+import example;
+
+public class DCallback : Callback {
+ public override void run() {
+ Stdout( "DCallback.run()" ).newline;
+ }
+}
+
+void main() {
+ auto caller = new Caller();
+
+ Stdout( "Adding and calling a normal C++ callback" ).newline;
+ Stdout( "----------------------------------------" ).newline;
+ {
+ scope auto callback = new Callback();
+ caller.setCallback(callback);
+ caller.call();
+ caller.resetCallback();
+ }
+
+ Stdout.newline;
+ Stdout( "Adding and calling a D callback" ).newline;
+ Stdout( "-------------------------------" ).newline;
+ {
+ scope auto callback = new DCallback();
+ caller.setCallback(callback);
+ caller.call();
+ caller.resetCallback();
+ }
+
+ Stdout.newline;
+ Stdout( "D exit" ).newline;
+}
diff --git a/Examples/d/callback/d2/runme.d b/Examples/d/callback/d2/runme.d
new file mode 100644
index 0000000..88ffcde
--- /dev/null
+++ b/Examples/d/callback/d2/runme.d
@@ -0,0 +1,36 @@
+module runme;
+
+import std.stdio;
+import example;
+
+public class DCallback : Callback {
+ public override void run() {
+ writeln( "DCallback.run()" );
+ }
+}
+
+void main() {
+ auto caller = new Caller();
+
+ writeln( "Adding and calling a normal C++ callback" );
+ writeln( "----------------------------------------" );
+ {
+ scope auto callback = new Callback();
+ caller.setCallback(callback);
+ caller.call();
+ caller.resetCallback();
+ }
+
+ writeln();
+ writeln( "Adding and calling a D callback" );
+ writeln( "-------------------------------" );
+ {
+ scope auto callback = new DCallback();
+ caller.setCallback(callback);
+ caller.call();
+ caller.resetCallback();
+ }
+
+ writeln();
+ writeln( "D exit" );
+}
diff --git a/Examples/d/callback/example.cxx b/Examples/d/callback/example.cxx
new file mode 100644
index 0000000..450d756
--- /dev/null
+++ b/Examples/d/callback/example.cxx
@@ -0,0 +1,4 @@
+/* File : example.cxx */
+
+#include "example.h"
+
diff --git a/Examples/d/callback/example.h b/Examples/d/callback/example.h
new file mode 100644
index 0000000..38d25a0
--- /dev/null
+++ b/Examples/d/callback/example.h
@@ -0,0 +1,24 @@
+/* File : example.h */
+
+#include <cstdio>
+#include <iostream>
+
+class Callback {
+public:
+ virtual ~Callback() { std::cout << "Callback::~Callback()" << std:: endl; }
+ virtual void run() { std::cout << "Callback::run()" << std::endl; }
+};
+
+
+class Caller {
+private:
+ Callback *_callback;
+public:
+ Caller(): _callback(0) {}
+ ~Caller() { delCallback(); }
+ void delCallback() { delete _callback; _callback = 0; }
+ void setCallback(Callback *cb) { delCallback(); _callback = cb; }
+ void resetCallback() { _callback = 0; }
+ void call() { if (_callback) _callback->run(); }
+};
+
diff --git a/Examples/d/callback/example.i b/Examples/d/callback/example.i
new file mode 100644
index 0000000..90beda0
--- /dev/null
+++ b/Examples/d/callback/example.i
@@ -0,0 +1,13 @@
+/* File : example.i */
+%module(directors="1") example
+%{
+#include "example.h"
+%}
+
+%include "std_string.i"
+
+/* turn on director wrapping Callback */
+%feature("director") Callback;
+
+%include "example.h"
+
diff --git a/Examples/d/check.list b/Examples/d/check.list
new file mode 100644
index 0000000..010e7bb
--- /dev/null
+++ b/Examples/d/check.list
@@ -0,0 +1,9 @@
+# See top-level Makefile.in.
+callback
+class
+constants
+enum
+extend
+funcptr
+simple
+variables
diff --git a/Examples/d/class/Makefile b/Examples/d/class/Makefile
new file mode 100644
index 0000000..b5808cf
--- /dev/null
+++ b/Examples/d/class/Makefile
@@ -0,0 +1,30 @@
+ifeq (2,$(D_VERSION))
+ WORKING_DIR = d2/
+else
+ WORKING_DIR = d1/
+endif
+
+TOP = ../../..
+SWIG = $(TOP)/../preinst-swig
+EXTRA_CFLAGS = -I../ ../example.cxx example_wrap.cxx
+EXTRA_LDFLAGS = example.o example_wrap.o
+TARGET = example_wrap
+SWIGOPT =
+DSRCS = *.d
+DFLAGS = -ofrunme
+
+
+all:: d
+
+d::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \
+ $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
+
+clean::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_clean
+
+check: all
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_run
diff --git a/Examples/d/class/d1/runme.d b/Examples/d/class/d1/runme.d
new file mode 100644
index 0000000..b0c4263
--- /dev/null
+++ b/Examples/d/class/d1/runme.d
@@ -0,0 +1,58 @@
+// This example illustrates how C++ classes can be used from D using SWIG.
+// The D class gets mapped onto the C++ class and behaves as if it is a D class.
+module runme;
+
+import tango.io.Stdout;
+import example;
+
+void main() {
+ // ----- Object creation -----
+
+ Stdout( "Creating some objects:" ).newline;
+
+ {
+ scope Square s = new Square(10);
+ scope Circle c = new Circle(10);
+
+ // ----- Access a static member -----
+ Stdout.format( "{} shapes were created.", Shape.nshapes ).newline;
+
+ // ----- Member data access -----
+
+ // Notice how we can do this using functions specific to
+ // the 'Circle' class.
+ c.x = 20;
+ c.y = 30;
+
+ // Now use the same functions in the base class
+ Shape shape = s;
+ shape.x = -10;
+ shape.y = 5;
+
+ Stdout( "\nHere is their current position:" ).newline;
+ Stdout.format( " Circle = ( {}, {} )", c.x, c.y ).newline;
+ Stdout.format( " Square = ( {}, {} )", s.x, s.y ).newline;
+
+ // ----- Call some methods -----
+
+ Stdout( "\nHere are some properties of the shapes:" ).newline;
+ Shape[] shapes = [ cast(Shape) c, cast(Shape) s ];
+ foreach ( currentShape; shapes )
+ {
+ Stdout.format( " {}", currentShape.classinfo.name ).newline;
+ Stdout.format( " area = {}", currentShape.area() ).newline;
+ Stdout.format( " perimeter = {}", currentShape.perimeter() ).newline;
+ }
+
+ // Notice how the area() and perimeter() functions really
+ // invoke the appropriate virtual method on each object.
+
+ // ----- Delete everything -----
+ Stdout( "\nGuess I'll clean up now:" ).newline;
+ // Note: when this using scope is exited the D destructors are called which
+ // in turn call the C++ destructors.
+ }
+
+ Stdout.format( "{} shapes remain", Shape.nshapes ).newline;
+ Stdout( "\nGoodbye!" ).newline;
+}
diff --git a/Examples/d/class/d2/runme.d b/Examples/d/class/d2/runme.d
new file mode 100644
index 0000000..2e86c5f
--- /dev/null
+++ b/Examples/d/class/d2/runme.d
@@ -0,0 +1,58 @@
+// This example illustrates how C++ classes can be used from D using SWIG.
+// The D class gets mapped onto the C++ class and behaves as if it is a D class.
+module runme;
+
+import std.stdio;
+import example;
+
+void main() {
+ // ----- Object creation -----
+
+ writeln( "Creating some objects:" );
+
+ {
+ scope Square s = new Square(10);
+ scope Circle c = new Circle(10);
+
+ // ----- Access a static member -----
+ writefln( "%s shapes were created.", Shape.nshapes );
+
+ // ----- Member data access -----
+
+ // Notice how we can do this using functions specific to
+ // the 'Circle' class.
+ c.x = 20;
+ c.y = 30;
+
+ // Now use the same functions in the base class
+ Shape shape = s;
+ shape.x = -10;
+ shape.y = 5;
+
+ writeln( "\nHere is their current position:" );
+ writefln( " Circle = ( %s, %s )", c.x, c.y );
+ writefln( " Square = ( %s, %s )", s.x, s.y );
+
+ // ----- Call some methods -----
+
+ writeln( "\nHere are some properties of the shapes:" );
+ Shape[] shapes = [ cast(Shape) c, cast(Shape) s ];
+ foreach ( currentShape; shapes )
+ {
+ writefln( " %s", currentShape.classinfo.name );
+ writefln( " area = %s", currentShape.area() );
+ writefln( " perimeter = %s", currentShape.perimeter() );
+ }
+
+ // Notice how the area() and perimeter() functions really
+ // invoke the appropriate virtual method on each object.
+
+ // ----- Delete everything -----
+ writeln( "\nGuess I'll clean up now:" );
+ // Note: when this using scope is exited the D destructors are called which
+ // in turn call the C++ destructors.
+ }
+
+ writefln( "%s shapes remain", Shape.nshapes );
+ writeln( "\nGoodbye!" );
+}
diff --git a/Examples/d/class/example.cxx b/Examples/d/class/example.cxx
new file mode 100644
index 0000000..1e8e203
--- /dev/null
+++ b/Examples/d/class/example.cxx
@@ -0,0 +1,28 @@
+/* File : example.c */
+
+#include "example.h"
+#define M_PI 3.14159265358979323846
+
+/* Move the shape to a new location */
+void Shape::move(double dx, double dy) {
+ x += dx;
+ y += dy;
+}
+
+int Shape::nshapes = 0;
+
+double Circle::area(void) {
+ return M_PI*radius*radius;
+}
+
+double Circle::perimeter(void) {
+ return 2*M_PI*radius;
+}
+
+double Square::area(void) {
+ return width*width;
+}
+
+double Square::perimeter(void) {
+ return 4*width;
+}
diff --git a/Examples/d/class/example.h b/Examples/d/class/example.h
new file mode 100644
index 0000000..0d4527e
--- /dev/null
+++ b/Examples/d/class/example.h
@@ -0,0 +1,34 @@
+/* File : example.h */
+
+class Shape {
+public:
+ Shape() {
+ nshapes++;
+ }
+ virtual ~Shape() {
+ nshapes--;
+ };
+ double x, y;
+ void move(double dx, double dy);
+ virtual double area(void) = 0;
+ virtual double perimeter(void) = 0;
+ static int nshapes;
+};
+
+class Circle : public Shape {
+private:
+ double radius;
+public:
+ Circle(double r) : radius(r) { };
+ virtual double area(void);
+ virtual double perimeter(void);
+};
+
+class Square : public Shape {
+private:
+ double width;
+public:
+ Square(double w) : width(w) { };
+ virtual double area(void);
+ virtual double perimeter(void);
+};
diff --git a/Examples/d/class/example.i b/Examples/d/class/example.i
new file mode 100644
index 0000000..75700b3
--- /dev/null
+++ b/Examples/d/class/example.i
@@ -0,0 +1,10 @@
+/* File : example.i */
+%module example
+
+%{
+#include "example.h"
+%}
+
+/* Let's just grab the original header file here */
+%include "example.h"
+
diff --git a/Examples/d/constants/Makefile b/Examples/d/constants/Makefile
new file mode 100644
index 0000000..4120552
--- /dev/null
+++ b/Examples/d/constants/Makefile
@@ -0,0 +1,30 @@
+ifeq (2,$(D_VERSION))
+ WORKING_DIR = d2/
+else
+ WORKING_DIR = d1/
+endif
+
+TOP = ../../..
+SWIG = $(TOP)/../preinst-swig
+EXTRA_CFLAGS = -I../ example_wrap.c
+EXTRA_LDFLAGS = example_wrap.o
+TARGET = example_wrap
+SWIGOPT =
+DSRCS = *.d
+DFLAGS = -ofrunme
+
+
+all:: d
+
+d::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
+ $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
+
+clean::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_clean
+
+check: all
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_run
diff --git a/Examples/d/constants/d1/runme.d b/Examples/d/constants/d1/runme.d
new file mode 100644
index 0000000..47362cb
--- /dev/null
+++ b/Examples/d/constants/d1/runme.d
@@ -0,0 +1,28 @@
+module runme;
+
+import tango.io.Stdout;
+static import example;
+
+void main() {
+ Stdout.formatln("ICONST = {} (should be 42)", example.ICONST);
+ Stdout.formatln("FCONST = {} (should be 2.18)", example.FCONST);
+ Stdout.formatln("CCONST = {} (should be 'x')", example.CCONST);
+ Stdout.formatln("CCONST2 = {} (this should be on a new line)", example.CCONST2);
+ Stdout.formatln("SCONST = {} (should be 'Hello World')", example.SCONST);
+ Stdout.formatln("SCONST2 = {} (should be '\"Hello World\"')", example.SCONST2);
+ Stdout.formatln("EXPR = {} (should be 48.55)", example.EXPR);
+ Stdout.formatln("iconst = {} (should be 37)", example.iconst);
+ Stdout.formatln("fconst = {} (should be 3.14)", example.fconst);
+
+ static if (is(typeof(example.EXTERN))) {
+ Stdout.formatln("EXTERN should not be defined, but is: {}.", example.EXTERN );
+ } else {
+ Stdout.formatln("EXTERN isn't defined (good)");
+ }
+
+ static if (is(typeof(example.FOO))) {
+ Stdout.formatln("FOO should not be defined, but is: {}.", example.FOO);
+ } else {
+ Stdout.formatln("FOO isn't defined (good)");
+ }
+}
diff --git a/Examples/d/constants/d2/runme.d b/Examples/d/constants/d2/runme.d
new file mode 100644
index 0000000..4be510d
--- /dev/null
+++ b/Examples/d/constants/d2/runme.d
@@ -0,0 +1,28 @@
+module runme;
+
+import std.stdio;
+static import example;
+
+void main() {
+ writefln("ICONST = %s (should be 42)", example.ICONST);
+ writefln("FCONST = %s (should be 2.1828)", example.FCONST);
+ writefln("CCONST = %s (should be 'x')", example.CCONST);
+ writefln("CCONST2 = %s (this should be on a new line)", example.CCONST2);
+ writefln("SCONST = %s (should be 'Hello World')", example.SCONST);
+ writefln("SCONST2 = %s (should be '\"Hello World\"')", example.SCONST2);
+ writefln("EXPR = %s (should be 48.5484)", example.EXPR);
+ writefln("iconst = %s (should be 37)", example.iconst);
+ writefln("fconst = %s (should be 3.14)", example.fconst);
+
+ static if (is(typeof(example.EXTERN))) {
+ writefln("EXTERN should not be defined, but is: %s.", example.EXTERN );
+ } else {
+ writeln("EXTERN isn't defined (good)");
+ }
+
+ static if (is(typeof(example.FOO))) {
+ writefln("FOO should not be defined, but is: %s.", example.FOO);
+ } else {
+ writeln("FOO isn't defined (good)");
+ }
+}
diff --git a/Examples/d/constants/example.d b/Examples/d/constants/example.d
new file mode 100644
index 0000000..7448d0a
--- /dev/null
+++ b/Examples/d/constants/example.d
@@ -0,0 +1,23 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.41
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+module example;
+
+static import example_wrap;
+
+static import tango.stdc.stringz;
+
+public const int ICONST = 42;
+public const double FCONST = 2.1828;
+public const char CCONST = 'x';
+public const char CCONST2 = '\n';
+public const char[] SCONST = "Hello World";
+public const char[] SCONST2 = "\"Hello World\"";
+public const double EXPR = 42+3*(2.1828);
+public const int iconst = 37;
+public const double fconst = 3.14;
diff --git a/Examples/d/constants/example.i b/Examples/d/constants/example.i
new file mode 100644
index 0000000..edeb258
--- /dev/null
+++ b/Examples/d/constants/example.i
@@ -0,0 +1,32 @@
+/* File : example.i */
+%module example
+
+/* Force the generated D code to use the C constant values rather than
+ retrieving them at runtime. You can also try disabling the feature and
+ compare the generated code. */
+%dmanifestconst;
+
+
+/* A few preprocessor macros */
+
+#define ICONST 42
+#define FCONST 2.1828
+#define CCONST 'x'
+#define CCONST2 '\n'
+#define SCONST "Hello World"
+#define SCONST2 "\"Hello World\""
+
+/* This should work just fine */
+#define EXPR ICONST + 3*(FCONST)
+
+/* This shouldn't do anything */
+#define EXTERN extern
+
+/* Neither should this (BAR isn't defined) */
+#define FOO (ICONST + BAR)
+
+
+/* The following directives also produce constants */
+
+%constant int iconst = 37;
+%constant double fconst = 3.14;
diff --git a/Examples/d/enum/Makefile b/Examples/d/enum/Makefile
new file mode 100644
index 0000000..b5808cf
--- /dev/null
+++ b/Examples/d/enum/Makefile
@@ -0,0 +1,30 @@
+ifeq (2,$(D_VERSION))
+ WORKING_DIR = d2/
+else
+ WORKING_DIR = d1/
+endif
+
+TOP = ../../..
+SWIG = $(TOP)/../preinst-swig
+EXTRA_CFLAGS = -I../ ../example.cxx example_wrap.cxx
+EXTRA_LDFLAGS = example.o example_wrap.o
+TARGET = example_wrap
+SWIGOPT =
+DSRCS = *.d
+DFLAGS = -ofrunme
+
+
+all:: d
+
+d::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \
+ $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
+
+clean::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_clean
+
+check: all
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_run
diff --git a/Examples/d/enum/d1/runme.d b/Examples/d/enum/d1/runme.d
new file mode 100644
index 0000000..d986986
--- /dev/null
+++ b/Examples/d/enum/d1/runme.d
@@ -0,0 +1,28 @@
+module runme;
+
+import tango.io.Stdout;
+import example;
+
+void main() {
+ Stdout( "Printing out some enum values:" ).newline;
+ Stdout(" color:").newline;
+ Stdout.formatln(" {} = {}", color.RED, cast(int)color.RED);
+ Stdout.formatln(" {} = {}", color.BLUE, cast(int)color.BLUE);
+ Stdout.formatln(" {} = {}", color.GREEN, cast(int)color.GREEN);
+
+ Stdout("\n Foo.speed:").newline;
+ Stdout.formatln(" Foo.{} = {}", Foo.speed.IMPULSE, cast(int)Foo.speed.IMPULSE);
+ Stdout.formatln(" Foo.{} = {}", Foo.speed.WARP, cast(int)Foo.speed.WARP);
+ Stdout.formatln(" Foo.{} = {}", Foo.speed.LUDICROUS , cast(int)Foo.speed.LUDICROUS);
+
+ Stdout("\nTesting use of enums with functions:").newline;
+ example.enum_test(color.RED, Foo.speed.IMPULSE);
+ example.enum_test(color.BLUE, Foo.speed.WARP);
+ example.enum_test(color.GREEN, Foo.speed.LUDICROUS);
+
+ Stdout( "\nTesting use of enum with class method:" ).newline;
+ scope f = new Foo();
+ f.enum_test(Foo.speed.IMPULSE);
+ f.enum_test(Foo.speed.WARP);
+ f.enum_test(Foo.speed.LUDICROUS);
+}
diff --git a/Examples/d/enum/d2/runme.d b/Examples/d/enum/d2/runme.d
new file mode 100644
index 0000000..acaec8a
--- /dev/null
+++ b/Examples/d/enum/d2/runme.d
@@ -0,0 +1,28 @@
+module runme;
+
+import std.stdio;
+import example;
+
+void main() {
+ writeln( "Printing out some enum values:" );
+ writeln(" color:");
+ writefln(" %s = %s", color.RED, cast(int)color.RED);
+ writefln(" %s = %s", color.BLUE, cast(int)color.BLUE);
+ writefln(" %s = %s", color.GREEN, cast(int)color.GREEN);
+
+ writeln("\n Foo.speed:");
+ writefln(" Foo.%s = %s", Foo.speed.IMPULSE, cast(int)Foo.speed.IMPULSE);
+ writefln(" Foo.%s = %s", Foo.speed.WARP, cast(int)Foo.speed.WARP);
+ writefln(" Foo.%s = %s", Foo.speed.LUDICROUS , cast(int)Foo.speed.LUDICROUS);
+
+ writeln("\nTesting use of enums with functions:");
+ example.enum_test(color.RED, Foo.speed.IMPULSE);
+ example.enum_test(color.BLUE, Foo.speed.WARP);
+ example.enum_test(color.GREEN, Foo.speed.LUDICROUS);
+
+ writeln( "\nTesting use of enum with class method:" );
+ scope f = new Foo();
+ f.enum_test(Foo.speed.IMPULSE);
+ f.enum_test(Foo.speed.WARP);
+ f.enum_test(Foo.speed.LUDICROUS);
+}
diff --git a/Examples/d/enum/example.cxx b/Examples/d/enum/example.cxx
new file mode 100644
index 0000000..df7bb63
--- /dev/null
+++ b/Examples/d/enum/example.cxx
@@ -0,0 +1,37 @@
+/* File : example.cxx */
+
+#include "example.h"
+#include <stdio.h>
+
+void Foo::enum_test(speed s) {
+ if (s == IMPULSE) {
+ printf("IMPULSE speed\n");
+ } else if (s == WARP) {
+ printf("WARP speed\n");
+ } else if (s == LUDICROUS) {
+ printf("LUDICROUS speed\n");
+ } else {
+ printf("Unknown speed\n");
+ }
+}
+
+void enum_test(color c, Foo::speed s) {
+ if (c == RED) {
+ printf("color = RED, ");
+ } else if (c == BLUE) {
+ printf("color = BLUE, ");
+ } else if (c == GREEN) {
+ printf("color = GREEN, ");
+ } else {
+ printf("color = Unknown color!, ");
+ }
+ if (s == Foo::IMPULSE) {
+ printf("speed = IMPULSE speed\n");
+ } else if (s == Foo::WARP) {
+ printf("speed = WARP speed\n");
+ } else if (s == Foo::LUDICROUS) {
+ printf("speed = LUDICROUS speed\n");
+ } else {
+ printf("speed = Unknown speed!\n");
+ }
+}
diff --git a/Examples/d/enum/example.h b/Examples/d/enum/example.h
new file mode 100644
index 0000000..9119cd9
--- /dev/null
+++ b/Examples/d/enum/example.h
@@ -0,0 +1,13 @@
+/* File : example.h */
+
+enum color { RED, BLUE, GREEN };
+
+class Foo {
+ public:
+ Foo() { }
+ enum speed { IMPULSE=10, WARP=20, LUDICROUS=30 };
+ void enum_test(speed s);
+};
+
+void enum_test(color c, Foo::speed s);
+
diff --git a/Examples/d/enum/example.i b/Examples/d/enum/example.i
new file mode 100644
index 0000000..23ee8a8
--- /dev/null
+++ b/Examples/d/enum/example.i
@@ -0,0 +1,11 @@
+/* File : example.i */
+%module example
+
+%{
+#include "example.h"
+%}
+
+/* Let's just grab the original header file here */
+
+%include "example.h"
+
diff --git a/Examples/d/extend/Makefile b/Examples/d/extend/Makefile
new file mode 100644
index 0000000..b5808cf
--- /dev/null
+++ b/Examples/d/extend/Makefile
@@ -0,0 +1,30 @@
+ifeq (2,$(D_VERSION))
+ WORKING_DIR = d2/
+else
+ WORKING_DIR = d1/
+endif
+
+TOP = ../../..
+SWIG = $(TOP)/../preinst-swig
+EXTRA_CFLAGS = -I../ ../example.cxx example_wrap.cxx
+EXTRA_LDFLAGS = example.o example_wrap.o
+TARGET = example_wrap
+SWIGOPT =
+DSRCS = *.d
+DFLAGS = -ofrunme
+
+
+all:: d
+
+d::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \
+ $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
+
+clean::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_clean
+
+check: all
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_run
diff --git a/Examples/d/extend/d1/runme.d b/Examples/d/extend/d1/runme.d
new file mode 100644
index 0000000..96501d1
--- /dev/null
+++ b/Examples/d/extend/d1/runme.d
@@ -0,0 +1,75 @@
+/// This file illustrates the cross language polymorphism using directors.
+module runme;
+
+import example;
+import tango.io.Stdout;
+
+// CEO class, which overrides Employee.getPosition().
+class CEO : Manager {
+public:
+ this( char[] name ) {
+ super( name );
+ }
+
+ override char[] getPosition() {
+ return "CEO";
+ }
+
+ // Public method to stop the SWIG proxy base class from thinking it owns the underlying C++ memory.
+ void disownMemory() {
+ swigCMemOwn = false;
+ }
+}
+
+void main() {
+ // Create an instance of CEO, a class derived from the D proxy of the
+ // underlying C++ class. The calls to getName() and getPosition() are standard,
+ // the call to getTitle() uses the director wrappers to call CEO.getPosition().
+
+ auto e = new CEO( "Alice" );
+ Stdout.formatln( "{} is a {}.", e.getName(), e.getPosition() );
+ Stdout.formatln( "Just call her '{}'.", e.getTitle() );
+ Stdout( "----------------------" ).newline;
+
+ {
+ // Create a new EmployeeList instance. This class does not have a C++
+ // director wrapper, but can be used freely with other classes that do.
+ scope auto list = new EmployeeList();
+
+ // EmployeeList owns its items, so we must surrender ownership of objects we add.
+ e.disownMemory();
+ list.addEmployee(e);
+ Stdout( "----------------------" ).newline;
+
+ // Now we access the first four items in list (three are C++ objects that
+ // EmployeeList's constructor adds, the last is our CEO). The virtual
+ // methods of all these instances are treated the same. For items 0, 1, and
+ // 2, all methods resolve in C++. For item 3, our CEO, getTitle calls
+ // getPosition which resolves in D. The call to getPosition is
+ // slightly different, however, because of the overidden getPosition() call, since
+ // now the object reference has been "laundered" by passing through
+ // EmployeeList as an Employee*. Previously, D resolved the call
+ // immediately in CEO, but now D thinks the object is an instance of
+ // class Employee. So the call passes through the
+ // Employee proxy class and on to the C wrappers and C++ director,
+ // eventually ending up back at the D CEO implementation of getPosition().
+ // The call to getTitle() for item 3 runs the C++ Employee::getTitle()
+ // method, which in turn calls getPosition(). This virtual method call
+ // passes down through the C++ director class to the D implementation
+ // in CEO. All this routing takes place transparently.
+
+ Stdout( "(position, title) for items 0-3:" ).newline;
+ Stdout.formatln( " {}, '{}'", list.getItem(0).getPosition(), list.getItem(0).getTitle() );
+ Stdout.formatln( " {}, '{}'", list.getItem(1).getPosition(), list.getItem(1).getTitle() );
+ Stdout.formatln( " {}, '{}'", list.getItem(2).getPosition(), list.getItem(2).getTitle() );
+ Stdout.formatln( " {}, '{}'", list.getItem(3).getPosition(), list.getItem(3).getTitle() );
+ Stdout( "----------------------" ).newline;
+
+ // All Employees will be destroyed when the EmployeeList goes out of scope,
+ // including the CEO instance.
+ }
+ Stdout( "----------------------" ).newline;
+
+ // All done.
+ Stdout( "Exiting cleanly from D code." ).newline;
+}
diff --git a/Examples/d/extend/d2/runme.d b/Examples/d/extend/d2/runme.d
new file mode 100644
index 0000000..1ea6dfd
--- /dev/null
+++ b/Examples/d/extend/d2/runme.d
@@ -0,0 +1,75 @@
+/// This file illustrates the cross language polymorphism using directors.
+module runme;
+
+import std.stdio;
+import example;
+
+// CEO class, which overrides Employee.getPosition().
+class CEO : Manager {
+public:
+ this( string name ) {
+ super( name );
+ }
+
+ override string getPosition() const {
+ return "CEO";
+ }
+
+ // Public method to stop the SWIG proxy base class from thinking it owns the underlying C++ memory.
+ void disownMemory() {
+ swigCMemOwn = false;
+ }
+}
+
+void main() {
+ // Create an instance of CEO, a class derived from the D proxy of the
+ // underlying C++ class. The calls to getName() and getPosition() are standard,
+ // the call to getTitle() uses the director wrappers to call CEO.getPosition().
+
+ auto e = new CEO( "Alice" );
+ writefln( "%s is a %s.", e.getName(), e.getPosition() );
+ writefln( "Just call her '%s'.", e.getTitle() );
+ writeln( "----------------------" );
+
+ {
+ // Create a new EmployeeList instance. This class does not have a C++
+ // director wrapper, but can be used freely with other classes that do.
+ scope auto list = new EmployeeList();
+
+ // EmployeeList owns its items, so we must surrender ownership of objects we add.
+ e.disownMemory();
+ list.addEmployee(e);
+ writeln( "----------------------" );
+
+ // Now we access the first four items in list (three are C++ objects that
+ // EmployeeList's constructor adds, the last is our CEO). The virtual
+ // methods of all these instances are treated the same. For items 0, 1, and
+ // 2, all methods resolve in C++. For item 3, our CEO, getTitle calls
+ // getPosition which resolves in D. The call to getPosition is
+ // slightly different, however, because of the overidden getPosition() call, since
+ // now the object reference has been "laundered" by passing through
+ // EmployeeList as an Employee*. Previously, D resolved the call
+ // immediately in CEO, but now D thinks the object is an instance of
+ // class Employee. So the call passes through the
+ // Employee proxy class and on to the C wrappers and C++ director,
+ // eventually ending up back at the D CEO implementation of getPosition().
+ // The call to getTitle() for item 3 runs the C++ Employee::getTitle()
+ // method, which in turn calls getPosition(). This virtual method call
+ // passes down through the C++ director class to the D implementation
+ // in CEO. All this routing takes place transparently.
+
+ writeln( "(position, title) for items 0-3:" );
+ writefln( " %s, '%s'", list.getItem(0).getPosition(), list.getItem(0).getTitle() );
+ writefln( " %s, '%s'", list.getItem(1).getPosition(), list.getItem(1).getTitle() );
+ writefln( " %s, '%s'", list.getItem(2).getPosition(), list.getItem(2).getTitle() );
+ writefln( " %s, '%s'", list.getItem(3).getPosition(), list.getItem(3).getTitle() );
+ writeln( "----------------------" );
+
+ // All Employees will be destroyed when the EmployeeList goes out of scope,
+ // including the CEO instance.
+ }
+ writeln( "----------------------" );
+
+ // All done.
+ writeln( "Exiting cleanly from D code." );
+}
diff --git a/Examples/d/extend/example.cxx b/Examples/d/extend/example.cxx
new file mode 100644
index 0000000..450d756
--- /dev/null
+++ b/Examples/d/extend/example.cxx
@@ -0,0 +1,4 @@
+/* File : example.cxx */
+
+#include "example.h"
+
diff --git a/Examples/d/extend/example.h b/Examples/d/extend/example.h
new file mode 100644
index 0000000..7ad93fb
--- /dev/null
+++ b/Examples/d/extend/example.h
@@ -0,0 +1,56 @@
+/* File : example.h */
+
+#include <cstdio>
+#include <iostream>
+#include <vector>
+#include <string>
+#include <cmath>
+
+class Employee {
+private:
+ std::string name;
+public:
+ Employee(const char* n): name(n) {}
+ virtual std::string getTitle() { return getPosition() + " " + getName(); }
+ virtual std::string getName() { return name; }
+ virtual std::string getPosition() const { return "Employee"; }
+ virtual ~Employee() { printf("~Employee() @ %p\n", this); }
+};
+
+
+class Manager: public Employee {
+public:
+ Manager(const char* n): Employee(n) {}
+ virtual std::string getPosition() const { return "Manager"; }
+};
+
+
+class EmployeeList {
+ std::vector<Employee*> list;
+public:
+ EmployeeList() {
+ list.push_back(new Employee("Bob"));
+ list.push_back(new Employee("Jane"));
+ list.push_back(new Manager("Ted"));
+ }
+ void addEmployee(Employee *p) {
+ list.push_back(p);
+ std::cout << "New employee added. Current employees are:" << std::endl;
+ std::vector<Employee*>::iterator i;
+ for (i=list.begin(); i!=list.end(); i++) {
+ std::cout << " " << (*i)->getTitle() << std::endl;
+ }
+ }
+ const Employee *getItem(int i) {
+ return list[i];
+ }
+ ~EmployeeList() {
+ std::vector<Employee*>::iterator i;
+ std::cout << "~EmployeeList, deleting " << list.size() << " employees." << std::endl;
+ for (i=list.begin(); i!=list.end(); i++) {
+ delete *i;
+ }
+ std::cout << "~EmployeeList empty." << std::endl;
+ }
+};
+
diff --git a/Examples/d/extend/example.i b/Examples/d/extend/example.i
new file mode 100644
index 0000000..0647e13
--- /dev/null
+++ b/Examples/d/extend/example.i
@@ -0,0 +1,14 @@
+/* File : example.i */
+%module(directors="1") example
+%{
+#include "example.h"
+%}
+
+%include "std_string.i"
+
+/* turn on director wrapping for Manager */
+%feature("director") Employee;
+%feature("director") Manager;
+
+%include "example.h"
+
diff --git a/Examples/d/funcptr/Makefile b/Examples/d/funcptr/Makefile
new file mode 100644
index 0000000..09efa8d
--- /dev/null
+++ b/Examples/d/funcptr/Makefile
@@ -0,0 +1,30 @@
+ifeq (2,$(D_VERSION))
+ WORKING_DIR = d2/
+else
+ WORKING_DIR = d1/
+endif
+
+TOP = ../../..
+SWIG = $(TOP)/../preinst-swig
+EXTRA_CFLAGS = -I../ ../example.c example_wrap.c
+EXTRA_LDFLAGS = example.o example_wrap.o
+TARGET = example_wrap
+SWIGOPT =
+DSRCS = *.d
+DFLAGS = -ofrunme
+
+
+all:: d
+
+d::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
+ $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
+
+clean::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_clean
+
+check: all
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_run
diff --git a/Examples/d/funcptr/d1/runme.d b/Examples/d/funcptr/d1/runme.d
new file mode 100644
index 0000000..1461c15
--- /dev/null
+++ b/Examples/d/funcptr/d1/runme.d
@@ -0,0 +1,42 @@
+module runme;
+
+import tango.io.Stdout;
+static import example;
+
+extern(C) int add(int a, int b) {
+ return a + b;
+}
+
+extern(C) int sub(int a, int b) {
+ return a - b;
+}
+
+extern(C) int mul(int a, int b) {
+ return a * b;
+}
+
+void main() {
+ int a = 37;
+ int b = 42;
+
+ Stdout( "a = " )( a ).newline;
+ Stdout( "b = " )( b ).newline;
+
+ Stdout( "Trying some C callback functions:" ).newline;
+ Stdout( " ADD(a,b) = " )( example.do_op( a, b, example.ADD ) ).newline;
+ Stdout( " SUB(a,b) = " )( example.do_op( a, b, example.SUB ) ).newline;
+ Stdout( " MUL(a,b) = " )( example.do_op( a, b, example.MUL ) ).newline;
+
+ version (LDC) {
+ // Currently, there is no way to specify the calling convention for
+ // function pointer parameters in D, but LDC does strict typechecking for
+ // them (which is reasonable, but not covered by the language spec yet).
+ // As a result, there is no way to make the code below compile with LDC at
+ // the moment, so just skip it.
+ } else {
+ Stdout( "Now the same with callback functions defined in D:" ).newline;
+ Stdout( " add(a,b) = " )( example.do_op( a, b, &add ) ).newline;
+ Stdout( " sub(a,b) = " )( example.do_op( a, b, &sub ) ).newline;
+ Stdout( " mul(a,b) = " )( example.do_op( a, b, &mul ) ).newline;
+ }
+}
diff --git a/Examples/d/funcptr/d2/runme.d b/Examples/d/funcptr/d2/runme.d
new file mode 100644
index 0000000..929911d
--- /dev/null
+++ b/Examples/d/funcptr/d2/runme.d
@@ -0,0 +1,34 @@
+module runme;
+
+import std.stdio;
+static import example;
+
+extern(C) int add(int a, int b) {
+ return a + b;
+}
+
+extern(C) int sub(int a, int b) {
+ return a - b;
+}
+
+extern(C) int mul(int a, int b) {
+ return a * b;
+}
+
+void main() {
+ int a = 37;
+ int b = 42;
+
+ writefln( "a = %s", a );
+ writefln( "b = %s", b );
+
+ writeln( "Trying some C callback functions:" );
+ writefln( " ADD(a,b) = %s", example.do_op( a, b, example.ADD ) );
+ writefln( " SUB(a,b) = %s", example.do_op( a, b, example.SUB ) );
+ writefln( " MUL(a,b) = %s", example.do_op( a, b, example.MUL ) );
+
+ writeln( "Now the same with callback functions defined in D:" );
+ writefln( " add(a,b) = %s", example.do_op( a, b, &add ) );
+ writefln( " sub(a,b) = %s", example.do_op( a, b, &sub ) );
+ writefln( " mul(a,b) = %s", example.do_op( a, b, &mul ) );
+}
diff --git a/Examples/d/funcptr/example.c b/Examples/d/funcptr/example.c
new file mode 100644
index 0000000..5c4a3da
--- /dev/null
+++ b/Examples/d/funcptr/example.c
@@ -0,0 +1,19 @@
+/* File : example.c */
+
+int do_op(int a, int b, int (*op)(int,int)) {
+ return (*op)(a,b);
+}
+
+int add(int a, int b) {
+ return a+b;
+}
+
+int sub(int a, int b) {
+ return a-b;
+}
+
+int mul(int a, int b) {
+ return a*b;
+}
+
+int (*funcvar)(int,int) = add;
diff --git a/Examples/d/funcptr/example.h b/Examples/d/funcptr/example.h
new file mode 100644
index 0000000..9936e24
--- /dev/null
+++ b/Examples/d/funcptr/example.h
@@ -0,0 +1,9 @@
+/* file: example.h */
+
+extern int do_op(int,int, int (*op)(int,int));
+extern int add(int,int);
+extern int sub(int,int);
+extern int mul(int,int);
+
+extern int (*funcvar)(int,int);
+
diff --git a/Examples/d/funcptr/example.i b/Examples/d/funcptr/example.i
new file mode 100644
index 0000000..8b3bef6
--- /dev/null
+++ b/Examples/d/funcptr/example.i
@@ -0,0 +1,16 @@
+/* File : example.i */
+%module example
+%{
+#include "example.h"
+%}
+
+/* Wrap a function taking a pointer to a function */
+extern int do_op(int a, int b, int (*op)(int, int));
+
+/* Now install a bunch of "ops" as constants */
+%constant int (*ADD)(int,int) = add;
+%constant int (*SUB)(int,int) = sub;
+%constant int (*MUL)(int,int) = mul;
+
+extern int (*funcvar)(int,int);
+
diff --git a/Examples/d/simple/Makefile b/Examples/d/simple/Makefile
new file mode 100644
index 0000000..ae173a5
--- /dev/null
+++ b/Examples/d/simple/Makefile
@@ -0,0 +1,30 @@
+ifeq (2,$(D_VERSION))
+ WORKING_DIR = d2/
+else
+ WORKING_DIR = d1/
+endif
+
+TOP = ../../..
+SWIG = $(TOP)/../preinst-swig
+EXTRA_CFLAGS = -I../ ../example.c example_wrap.c
+EXTRA_LDFLAGS = example.o example_wrap.o
+TARGET = example_wrap
+SWIGOPT =
+DSRCS = *.d
+DFLAGS = -ofrunme
+
+
+all:: d
+
+d::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
+ $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
+
+clean::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_clean
+
+check: all
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_run
diff --git a/Examples/d/simple/d1/runme.d b/Examples/d/simple/d1/runme.d
new file mode 100644
index 0000000..1293f18
--- /dev/null
+++ b/Examples/d/simple/d1/runme.d
@@ -0,0 +1,27 @@
+module runme;
+
+import tango.io.Stdout;
+static import example;
+
+void main() {
+ /*
+ * Call our gcd() function.
+ */
+ int x = 42;
+ int y = 105;
+ int g = example.gcd( x, y );
+ Stdout.format( "The gcd of {} and {} is {}.", x, y, g ).newline;
+
+ /*
+ * Manipulate the Foo global variable.
+ */
+
+ // Output its current value
+ Stdout.format( "Foo = {}", example.Foo ).newline;
+
+ // Change its value
+ example.Foo = 3.1415926;
+
+ // See if the change took effect
+ Stdout.format( "Foo = {}", example.Foo ).newline;
+}
diff --git a/Examples/d/simple/d2/runme.d b/Examples/d/simple/d2/runme.d
new file mode 100644
index 0000000..7f27892
--- /dev/null
+++ b/Examples/d/simple/d2/runme.d
@@ -0,0 +1,27 @@
+module runme;
+
+import std.stdio;
+static import example;
+
+void main() {
+ /*
+ * Call our gcd() function.
+ */
+ int x = 42;
+ int y = 105;
+ int g = example.gcd(x, y);
+ writefln("The gcd of %s and %s is %s.", x, y, g);
+
+ /*
+ * Manipulate the Foo global variable.
+ */
+
+ // Output its current value
+ writefln("Foo = %s", example.Foo);
+
+ // Change its value
+ example.Foo = 3.1415926;
+
+ // See if the change took effect
+ writefln("Foo = %s", example.Foo);
+}
diff --git a/Examples/d/simple/example.c b/Examples/d/simple/example.c
new file mode 100644
index 0000000..1c2af78
--- /dev/null
+++ b/Examples/d/simple/example.c
@@ -0,0 +1,18 @@
+/* File : example.c */
+
+/* A global variable */
+double Foo = 3.0;
+
+/* Compute the greatest common divisor of positive integers */
+int gcd(int x, int y) {
+ int g;
+ g = y;
+ while (x > 0) {
+ g = x;
+ x = y % x;
+ y = g;
+ }
+ return g;
+}
+
+
diff --git a/Examples/d/simple/example.i b/Examples/d/simple/example.i
new file mode 100644
index 0000000..24093b9
--- /dev/null
+++ b/Examples/d/simple/example.i
@@ -0,0 +1,7 @@
+/* File : example.i */
+%module example
+
+%inline %{
+extern int gcd(int x, int y);
+extern double Foo;
+%}
diff --git a/Examples/d/variables/Makefile b/Examples/d/variables/Makefile
new file mode 100644
index 0000000..ae173a5
--- /dev/null
+++ b/Examples/d/variables/Makefile
@@ -0,0 +1,30 @@
+ifeq (2,$(D_VERSION))
+ WORKING_DIR = d2/
+else
+ WORKING_DIR = d1/
+endif
+
+TOP = ../../..
+SWIG = $(TOP)/../preinst-swig
+EXTRA_CFLAGS = -I../ ../example.c example_wrap.c
+EXTRA_LDFLAGS = example.o example_wrap.o
+TARGET = example_wrap
+SWIGOPT =
+DSRCS = *.d
+DFLAGS = -ofrunme
+
+
+all:: d
+
+d::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
+ $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
+
+clean::
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_clean
+
+check: all
+ cd $(WORKING_DIR); \
+ $(MAKE) -f $(TOP)/Makefile d_run
diff --git a/Examples/d/variables/d1/runme.d b/Examples/d/variables/d1/runme.d
new file mode 100644
index 0000000..35c896b
--- /dev/null
+++ b/Examples/d/variables/d1/runme.d
@@ -0,0 +1,71 @@
+// This example illustrates global variable access from C#.
+module runme;
+
+import tango.io.Stdout;
+static import example;
+
+void main() {
+ // Try to set the values of some global variables
+ example.ivar = 42;
+ example.svar = -31000;
+ example.lvar = 65537;
+ example.uivar = 123456;
+ example.usvar = 61000;
+ example.ulvar = 654321;
+ example.scvar = -13;
+ example.ucvar = 251;
+ example.cvar = 'S';
+ example.fvar = 3.14159f;
+ example.dvar = 2.1828;
+ example.strvar = "Hello World";
+ example.iptrvar = example.new_int(37);
+ example.ptptr = example.new_Point(37,42);
+ example.name = "Bill";
+
+ // Now print out the values of the variables
+ Stdout.formatln( "Variables (printed from D):" );
+ Stdout.formatln( "ivar = {}", example.ivar );
+ Stdout.formatln( "svar = {}", example.svar );
+ Stdout.formatln( "lvar = {}", example.lvar );
+ Stdout.formatln( "uivar = {}", example.uivar );
+ Stdout.formatln( "usvar = {}", example.usvar );
+ Stdout.formatln( "ulvar = {}", example.ulvar );
+ Stdout.formatln( "scvar = {}", example.scvar );
+ Stdout.formatln( "ucvar = {}", example.ucvar );
+ Stdout.formatln( "fvar = {}", example.fvar );
+ Stdout.formatln( "dvar = {}", example.dvar );
+ Stdout.formatln( "cvar = {}", example.cvar );
+ Stdout.formatln( "strvar = {}", example.strvar );
+ Stdout.formatln( "cstrvar = {}", example.cstrvar );
+ Stdout.formatln( "iptrvar = {}", example.iptrvar );
+ Stdout.formatln( "name = {}", example.name );
+ Stdout.formatln( "ptptr = {} {}", example.ptptr, example.Point_print(example.ptptr) );
+ Stdout.formatln( "pt = {} {}", example.pt, example.Point_print(example.pt) );
+ Stdout.formatln( "status = {}", example.status );
+
+ Stdout.formatln( "\nVariables (printed from the C library):" );
+ example.print_vars();
+
+ Stdout.formatln( "\nNow I'm going to try and modify some read only variables:" );
+ Stdout.formatln( "Checking that the read only variables are readonly..." );
+
+ Stdout( " 'path'..." );
+ static if ( is( typeof( example.path = "a" ) ) )
+ Stdout.formatln("Oh dear, this variable is not read only!");
+ else
+ Stdout.formatln("Good.");
+
+ Stdout( " 'status'..." );
+ static if ( is( typeof( example.status = 2 ) ) )
+ Stdout.formatln("Oh dear, this variable is not read only!");
+ else
+ Stdout.formatln("Good.");
+
+ Stdout.formatln( "\nI'm going to try and update a structure variable:" );
+
+ example.pt = example.ptptr;
+
+ Stdout( "The new value is " ).flush;
+ example.pt_print();
+ Stdout.formatln( "You should see the value {}", example.Point_print(example.ptptr) );
+}
diff --git a/Examples/d/variables/d2/runme.d b/Examples/d/variables/d2/runme.d
new file mode 100644
index 0000000..f80b818
--- /dev/null
+++ b/Examples/d/variables/d2/runme.d
@@ -0,0 +1,71 @@
+// This example illustrates global variable access from C#.
+module runme;
+
+import std.stdio;
+static import example;
+
+void main() {
+ // Try to set the values of some global variables
+ example.ivar = 42;
+ example.svar = -31000;
+ example.lvar = 65537;
+ example.uivar = 123456;
+ example.usvar = 61000;
+ example.ulvar = 654321;
+ example.scvar = -13;
+ example.ucvar = 251;
+ example.cvar = 'S';
+ example.fvar = 3.14159f;
+ example.dvar = 2.1828;
+ example.strvar = "Hello World";
+ example.iptrvar = example.new_int(37);
+ example.ptptr = example.new_Point(37,42);
+ example.name = "Bill";
+
+ // Now print out the values of the variables
+ writefln( "Variables (printed from D):" );
+ writefln( "ivar = %s", example.ivar );
+ writefln( "svar = %s", example.svar );
+ writefln( "lvar = %s", example.lvar );
+ writefln( "uivar = %s", example.uivar );
+ writefln( "usvar = %s", example.usvar );
+ writefln( "ulvar = %s", example.ulvar );
+ writefln( "scvar = %s", example.scvar );
+ writefln( "ucvar = %s", example.ucvar );
+ writefln( "fvar = %s", example.fvar );
+ writefln( "dvar = %s", example.dvar );
+ writefln( "cvar = %s", example.cvar );
+ writefln( "strvar = %s", example.strvar );
+ writefln( "cstrvar = %s", example.cstrvar );
+ writefln( "iptrvar = %s", example.iptrvar );
+ writefln( "name = %s", example.name );
+ writefln( "ptptr = %s %s", example.ptptr, example.Point_print(example.ptptr) );
+ writefln( "pt = %s %s", example.pt, example.Point_print(example.pt) );
+ writefln( "status = %s", example.status );
+
+ writefln( "\nVariables (printed from the C library):" );
+ example.print_vars();
+
+ writefln( "\nNow I'm going to try and modify some read only variables:" );
+ writefln( "Checking that the read only variables are readonly..." );
+
+ writeln( " 'path'..." );
+ static if ( is( typeof( example.path = "a" ) ) )
+ writefln("Oh dear, this variable is not read only!");
+ else
+ writefln("Good.");
+
+ writeln( " 'status'..." );
+ static if ( is( typeof( example.status = 2 ) ) )
+ writefln("Oh dear, this variable is not read only!");
+ else
+ writefln("Good.");
+
+ writefln( "\nI'm going to try and update a structure variable:" );
+
+ example.pt = example.ptptr;
+
+ write( "The new value is " );
+ example.pt_print();
+ writefln( "You should see the value %s", example.Point_print(example.ptptr) );
+}
diff --git a/Examples/d/variables/example.c b/Examples/d/variables/example.c
new file mode 100644
index 0000000..1bf9c12
--- /dev/null
+++ b/Examples/d/variables/example.c
@@ -0,0 +1,91 @@
+/* File : example.c */
+
+/* I'm a file containing some C global variables */
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "example.h"
+
+int ivar = 0;
+short svar = 0;
+long lvar = 0;
+unsigned int uivar = 0;
+unsigned short usvar = 0;
+unsigned long ulvar = 0;
+signed char scvar = 0;
+unsigned char ucvar = 0;
+char cvar = 0;
+float fvar = 0;
+double dvar = 0;
+char *strvar = 0;
+const char cstrvar[] = "Goodbye";
+int *iptrvar = 0;
+char name[256] = "Dave";
+char path[256] = "/home/beazley";
+
+
+/* Global variables involving a structure */
+Point *ptptr = 0;
+Point pt = { 10, 20 };
+
+/* A variable that we will make read-only in the interface */
+int status = 1;
+
+/* A debugging function to print out their values */
+
+void print_vars() {
+ printf("ivar = %d\n", ivar);
+ printf("svar = %d\n", svar);
+ printf("lvar = %ld\n", lvar);
+ printf("uivar = %u\n", uivar);
+ printf("usvar = %u\n", usvar);
+ printf("ulvar = %lu\n", ulvar);
+ printf("scvar = %d\n", scvar);
+ printf("ucvar = %u\n", ucvar);
+ printf("fvar = %g\n", fvar);
+ printf("dvar = %g\n", dvar);
+ printf("cvar = %c\n", cvar);
+ printf("strvar = %s\n", strvar ? strvar : "(null)");
+ printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)");
+ printf("iptrvar = %p\n", iptrvar);
+ printf("name = %s\n", name);
+ printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0);
+ printf("pt = (%d, %d)\n", pt.x, pt.y);
+ printf("status = %d\n", status);
+}
+
+/* A function to create an integer (to test iptrvar) */
+
+int *new_int(int value) {
+ int *ip = (int *) malloc(sizeof(int));
+ *ip = value;
+ return ip;
+}
+
+/* A function to create a point */
+
+Point *new_Point(int x, int y) {
+ Point *p = (Point *) malloc(sizeof(Point));
+ p->x = x;
+ p->y = y;
+ return p;
+}
+
+char * Point_print(Point *p) {
+ static char buffer[256];
+ if (p) {
+ sprintf(buffer,"(%d, %d)", p->x,p->y);
+ } else {
+ sprintf(buffer,"null");
+ }
+ return buffer;
+}
+
+void pt_print() {
+ printf("(%d, %d)\n", pt.x, pt.y);
+}
diff --git a/Examples/d/variables/example.h b/Examples/d/variables/example.h
new file mode 100644
index 0000000..0f7e895
--- /dev/null
+++ b/Examples/d/variables/example.h
@@ -0,0 +1,6 @@
+/* File: example.h */
+
+typedef struct {
+ int x,y;
+} Point;
+
diff --git a/Examples/d/variables/example.i b/Examples/d/variables/example.i
new file mode 100644
index 0000000..591b871
--- /dev/null
+++ b/Examples/d/variables/example.i
@@ -0,0 +1,49 @@
+/* File : example.i */
+%module example
+%{
+#include "example.h"
+%}
+
+/* Some global variable declarations */
+%inline %{
+extern int ivar;
+extern short svar;
+extern long lvar;
+extern unsigned int uivar;
+extern unsigned short usvar;
+extern unsigned long ulvar;
+extern signed char scvar;
+extern unsigned char ucvar;
+extern char cvar;
+extern float fvar;
+extern double dvar;
+extern char *strvar;
+extern const char cstrvar[];
+extern int *iptrvar;
+extern char name[256];
+
+extern Point *ptptr;
+extern Point pt;
+%}
+
+
+/* Some read-only variables */
+
+%immutable;
+
+%inline %{
+extern int status;
+extern char path[256];
+%}
+
+%mutable;
+
+/* Some helper functions to make it easier to test */
+%inline %{
+extern void print_vars();
+extern int *new_int(int value);
+extern Point *new_Point(int x, int y);
+extern char *Point_print(Point *p);
+extern void pt_print();
+%}
+
diff --git a/Examples/go/callback/example.go b/Examples/go/callback/example.go
deleted file mode 100644
index 5c0cfb0..0000000
--- a/Examples/go/callback/example.go
+++ /dev/null
@@ -1,188 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-type _swig_DirectorCallback struct {
- SwigcptrCallback
- v interface{}
-}
-
-func (p *_swig_DirectorCallback) Swigcptr() uintptr {
- return p.SwigcptrCallback.Swigcptr()
-}
-
-func (p *_swig_DirectorCallback) SwigIsCallback() {
-}
-
-func (p *_swig_DirectorCallback) DirectorInterface() interface{} {
- return p.v
-}
-
-func _swig_NewDirectorCallbackCallback(*_swig_DirectorCallback) SwigcptrCallback
-
-func NewDirectorCallback(v interface{}) Callback {
- p := &_swig_DirectorCallback{0, v}
- p.SwigcptrCallback = _swig_NewDirectorCallbackCallback(p)
- return p
-}
-
-func _swig_wrap_DeleteDirectorCallback(uintptr)
-
-func DeleteDirectorCallback(arg1 Callback) {
- _swig_wrap_DeleteDirectorCallback(arg1.Swigcptr())
-}
-
-func Swiggo_DeleteDirector_Callback(p *_swig_DirectorCallback) {
- p.SwigcptrCallback = 0
-}
-
-type _swig_DirectorInterfaceCallbackRun interface {
- Run()
-}
-
-func _swig_wrap__swig_DirectorCallback_upcall_Run(SwigcptrCallback)
-func (swig_p *_swig_DirectorCallback) Run() {
- if swig_g, swig_ok := swig_p.v.(_swig_DirectorInterfaceCallbackRun); swig_ok {
- swig_g.Run()
- return
- }
- _swig_wrap__swig_DirectorCallback_upcall_Run(swig_p.SwigcptrCallback)
-}
-
-func DirectorCallbackRun(p Callback) {
- _swig_wrap__swig_DirectorCallback_upcall_Run(p.(*_swig_DirectorCallback).SwigcptrCallback)
-}
-
-func Swig_DirectorCallback_callback_run(p *_swig_DirectorCallback) {
- p.Run()
-}
-
-type SwigcptrCallback uintptr
-
-func (p SwigcptrCallback) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrCallback) SwigIsCallback() {
-}
-
-func (p SwigcptrCallback) DirectorInterface() interface{} {
- return nil
-}
-
-func _swig_wrap_delete_Callback(uintptr)
-
-func DeleteCallback(arg1 Callback) {
- _swig_wrap_delete_Callback(arg1.Swigcptr())
-}
-
-func _swig_wrap_Callback_run(SwigcptrCallback)
-
-func (arg1 SwigcptrCallback) Run() {
- _swig_wrap_Callback_run(arg1)
-}
-
-func _swig_wrap_new_Callback() SwigcptrCallback
-
-func NewCallback() Callback {
- return _swig_wrap_new_Callback()
-}
-
-type Callback interface {
- Swigcptr() uintptr
- SwigIsCallback()
- DirectorInterface() interface{}
- Run()
-}
-
-type SwigcptrCaller uintptr
-
-func (p SwigcptrCaller) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrCaller) SwigIsCaller() {
-}
-
-func _swig_wrap_new_Caller() SwigcptrCaller
-
-func NewCaller() Caller {
- return _swig_wrap_new_Caller()
-}
-
-func _swig_wrap_delete_Caller(uintptr)
-
-func DeleteCaller(arg1 Caller) {
- _swig_wrap_delete_Caller(arg1.Swigcptr())
-}
-
-func _swig_wrap_Caller_delCallback(SwigcptrCaller)
-
-func (arg1 SwigcptrCaller) DelCallback() {
- _swig_wrap_Caller_delCallback(arg1)
-}
-
-func _swig_wrap_Caller_setCallback(SwigcptrCaller, uintptr)
-
-func (arg1 SwigcptrCaller) SetCallback(arg2 Callback) {
- _swig_wrap_Caller_setCallback(arg1, arg2.Swigcptr())
-}
-
-func _swig_wrap_Caller_call(SwigcptrCaller)
-
-func (arg1 SwigcptrCaller) Call() {
- _swig_wrap_Caller_call(arg1)
-}
-
-type Caller interface {
- Swigcptr() uintptr
- SwigIsCaller()
- DelCallback()
- SetCallback(arg2 Callback)
- Call()
-}
-
-
-type SwigcptrSwigDirector_Callback uintptr
-type SwigDirector_Callback interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrSwigDirector_Callback) Swigcptr() uintptr {
- return uintptr(p)
-}
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/class/example.go b/Examples/go/class/example.go
deleted file mode 100644
index ec8113a..0000000
--- a/Examples/go/class/example.go
+++ /dev/null
@@ -1,284 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-type SwigcptrShape uintptr
-
-func (p SwigcptrShape) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrShape) SwigIsShape() {
-}
-
-func _swig_wrap_delete_Shape(uintptr)
-
-func DeleteShape(arg1 Shape) {
- _swig_wrap_delete_Shape(arg1.Swigcptr())
-}
-
-func _swig_wrap_Shape_x_set(SwigcptrShape, float64)
-
-func (arg1 SwigcptrShape) SetX(arg2 float64) {
- _swig_wrap_Shape_x_set(arg1, arg2)
-}
-
-func _swig_wrap_Shape_x_get(SwigcptrShape) float64
-
-func (arg1 SwigcptrShape) GetX() float64 {
- return _swig_wrap_Shape_x_get(arg1)
-}
-
-func _swig_wrap_Shape_y_set(SwigcptrShape, float64)
-
-func (arg1 SwigcptrShape) SetY(arg2 float64) {
- _swig_wrap_Shape_y_set(arg1, arg2)
-}
-
-func _swig_wrap_Shape_y_get(SwigcptrShape) float64
-
-func (arg1 SwigcptrShape) GetY() float64 {
- return _swig_wrap_Shape_y_get(arg1)
-}
-
-func _swig_wrap_Shape_move(SwigcptrShape, float64, float64)
-
-func (arg1 SwigcptrShape) Move(arg2 float64, arg3 float64) {
- _swig_wrap_Shape_move(arg1, arg2, arg3)
-}
-
-func _swig_wrap_Shape_area(SwigcptrShape) float64
-
-func (arg1 SwigcptrShape) Area() float64 {
- return _swig_wrap_Shape_area(arg1)
-}
-
-func _swig_wrap_Shape_perimeter(SwigcptrShape) float64
-
-func (arg1 SwigcptrShape) Perimeter() float64 {
- return _swig_wrap_Shape_perimeter(arg1)
-}
-
-func _swig_wrap_Shape_nshapes_set(int)
-
-func SetShapeNshapes(arg1 int) {
- _swig_wrap_Shape_nshapes_set(arg1)
-}
-
-func GetShapeNshapes() int
-type Shape interface {
- Swigcptr() uintptr
- SwigIsShape()
- SetX(arg2 float64)
- GetX() float64
- SetY(arg2 float64)
- GetY() float64
- Move(arg2 float64, arg3 float64)
- Area() float64
- Perimeter() float64
-}
-
-type SwigcptrCircle uintptr
-
-func (p SwigcptrCircle) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrCircle) SwigIsCircle() {
-}
-
-func _swig_wrap_new_Circle(float64) SwigcptrCircle
-
-func NewCircle(arg1 float64) Circle {
- return _swig_wrap_new_Circle(arg1)
-}
-
-func _swig_wrap_Circle_area(SwigcptrCircle) float64
-
-func (arg1 SwigcptrCircle) Area() float64 {
- return _swig_wrap_Circle_area(arg1)
-}
-
-func _swig_wrap_Circle_perimeter(SwigcptrCircle) float64
-
-func (arg1 SwigcptrCircle) Perimeter() float64 {
- return _swig_wrap_Circle_perimeter(arg1)
-}
-
-func _swig_wrap_delete_Circle(uintptr)
-
-func DeleteCircle(arg1 Circle) {
- _swig_wrap_delete_Circle(arg1.Swigcptr())
-}
-
-func _swig_wrap_SetCircle_X(SwigcptrCircle, float64)
-
-func (_swig_base SwigcptrCircle) SetX(arg1 float64) {
- _swig_wrap_SetCircle_X(_swig_base, arg1)
-}
-
-func _swig_wrap_GetCircle_X(SwigcptrCircle) float64
-
-func (_swig_base SwigcptrCircle) GetX() float64 {
- return _swig_wrap_GetCircle_X(_swig_base)
-}
-
-func _swig_wrap_SetCircle_Y(SwigcptrCircle, float64)
-
-func (_swig_base SwigcptrCircle) SetY(arg1 float64) {
- _swig_wrap_SetCircle_Y(_swig_base, arg1)
-}
-
-func _swig_wrap_GetCircle_Y(SwigcptrCircle) float64
-
-func (_swig_base SwigcptrCircle) GetY() float64 {
- return _swig_wrap_GetCircle_Y(_swig_base)
-}
-
-func _swig_wrap_Circle_move(SwigcptrCircle, float64, float64)
-
-func (_swig_base SwigcptrCircle) Move(arg1 float64, arg2 float64) {
- _swig_wrap_Circle_move(_swig_base, arg1, arg2)
-}
-
-func (p SwigcptrCircle) SwigIsShape() {
-}
-
-func (p SwigcptrCircle) SwigGetShape() Shape {
- return SwigcptrShape(p.Swigcptr())
-}
-
-type Circle interface {
- Swigcptr() uintptr
- SwigIsCircle()
- Area() float64
- Perimeter() float64
- SetX(arg1 float64)
- GetX() float64
- SetY(arg1 float64)
- GetY() float64
- Move(arg1 float64, arg2 float64)
- SwigIsShape()
- SwigGetShape() Shape
-}
-
-type SwigcptrSquare uintptr
-
-func (p SwigcptrSquare) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrSquare) SwigIsSquare() {
-}
-
-func _swig_wrap_new_Square(float64) SwigcptrSquare
-
-func NewSquare(arg1 float64) Square {
- return _swig_wrap_new_Square(arg1)
-}
-
-func _swig_wrap_Square_area(SwigcptrSquare) float64
-
-func (arg1 SwigcptrSquare) Area() float64 {
- return _swig_wrap_Square_area(arg1)
-}
-
-func _swig_wrap_Square_perimeter(SwigcptrSquare) float64
-
-func (arg1 SwigcptrSquare) Perimeter() float64 {
- return _swig_wrap_Square_perimeter(arg1)
-}
-
-func _swig_wrap_delete_Square(uintptr)
-
-func DeleteSquare(arg1 Square) {
- _swig_wrap_delete_Square(arg1.Swigcptr())
-}
-
-func _swig_wrap_SetSquare_X(SwigcptrSquare, float64)
-
-func (_swig_base SwigcptrSquare) SetX(arg1 float64) {
- _swig_wrap_SetSquare_X(_swig_base, arg1)
-}
-
-func _swig_wrap_GetSquare_X(SwigcptrSquare) float64
-
-func (_swig_base SwigcptrSquare) GetX() float64 {
- return _swig_wrap_GetSquare_X(_swig_base)
-}
-
-func _swig_wrap_SetSquare_Y(SwigcptrSquare, float64)
-
-func (_swig_base SwigcptrSquare) SetY(arg1 float64) {
- _swig_wrap_SetSquare_Y(_swig_base, arg1)
-}
-
-func _swig_wrap_GetSquare_Y(SwigcptrSquare) float64
-
-func (_swig_base SwigcptrSquare) GetY() float64 {
- return _swig_wrap_GetSquare_Y(_swig_base)
-}
-
-func _swig_wrap_Square_move(SwigcptrSquare, float64, float64)
-
-func (_swig_base SwigcptrSquare) Move(arg1 float64, arg2 float64) {
- _swig_wrap_Square_move(_swig_base, arg1, arg2)
-}
-
-func (p SwigcptrSquare) SwigIsShape() {
-}
-
-func (p SwigcptrSquare) SwigGetShape() Shape {
- return SwigcptrShape(p.Swigcptr())
-}
-
-type Square interface {
- Swigcptr() uintptr
- SwigIsSquare()
- Area() float64
- Perimeter() float64
- SetX(arg1 float64)
- GetX() float64
- SetY(arg1 float64)
- GetY() float64
- Move(arg1 float64, arg2 float64)
- SwigIsShape()
- SwigGetShape() Shape
-}
-
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/constants/example.go b/Examples/go/constants/example.go
deleted file mode 100644
index 0e5e664..0000000
--- a/Examples/go/constants/example.go
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-const ICONST int = 42
-const FCONST float64 = 2.1828
-const CCONST byte = 'x'
-func _swig_getCCONST2() byte
-var CCONST2 byte = _swig_getCCONST2()
-const SCONST string = "Hello World"
-func _swig_getSCONST2() string
-var SCONST2 string = _swig_getSCONST2()
-func _swig_getEXPR() float64
-var EXPR float64 = _swig_getEXPR()
-const Iconst int = 37
-const Fconst float64 = 3.14
-
diff --git a/Examples/go/enum/example.go b/Examples/go/enum/example.go
deleted file mode 100644
index 4653ab5..0000000
--- a/Examples/go/enum/example.go
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-type Color int
-func _swig_getRED() Color
-var RED Color = _swig_getRED()
-func _swig_getBLUE() Color
-var BLUE Color = _swig_getBLUE()
-func _swig_getGREEN() Color
-var GREEN Color = _swig_getGREEN()
-type SwigcptrFoo uintptr
-
-func (p SwigcptrFoo) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrFoo) SwigIsFoo() {
-}
-
-func _swig_wrap_new_Foo() SwigcptrFoo
-
-func NewFoo() Foo {
- return _swig_wrap_new_Foo()
-}
-
-type FooSpeed int
-func _swig_getFoo_IMPULSE_Foo() FooSpeed
-var FooIMPULSE FooSpeed = _swig_getFoo_IMPULSE_Foo()
-func _swig_getFoo_WARP_Foo() FooSpeed
-var FooWARP FooSpeed = _swig_getFoo_WARP_Foo()
-func _swig_getFoo_LUDICROUS_Foo() FooSpeed
-var FooLUDICROUS FooSpeed = _swig_getFoo_LUDICROUS_Foo()
-func _swig_wrap_Foo_enum_test(SwigcptrFoo, FooSpeed)
-
-func (arg1 SwigcptrFoo) Enum_test(arg2 FooSpeed) {
- _swig_wrap_Foo_enum_test(arg1, arg2)
-}
-
-func _swig_wrap_delete_Foo(uintptr)
-
-func DeleteFoo(arg1 Foo) {
- _swig_wrap_delete_Foo(arg1.Swigcptr())
-}
-
-type Foo interface {
- Swigcptr() uintptr
- SwigIsFoo()
- Enum_test(arg2 FooSpeed)
-}
-
-func _swig_wrap_enum_test(Color, FooSpeed)
-
-func Enum_test(arg1 Color, arg2 FooSpeed) {
- _swig_wrap_enum_test(arg1, arg2)
-}
-
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/extend/example.go b/Examples/go/extend/example.go
deleted file mode 100644
index 08f21e6..0000000
--- a/Examples/go/extend/example.go
+++ /dev/null
@@ -1,397 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-type _swig_DirectorEmployee struct {
- SwigcptrEmployee
- v interface{}
-}
-
-func (p *_swig_DirectorEmployee) Swigcptr() uintptr {
- return p.SwigcptrEmployee.Swigcptr()
-}
-
-func (p *_swig_DirectorEmployee) SwigIsEmployee() {
-}
-
-func (p *_swig_DirectorEmployee) DirectorInterface() interface{} {
- return p.v
-}
-
-func _swig_NewDirectorEmployeeEmployee(*_swig_DirectorEmployee, string) SwigcptrEmployee
-
-func NewDirectorEmployee(v interface{}, arg1 string) Employee {
- p := &_swig_DirectorEmployee{0, v}
- p.SwigcptrEmployee = _swig_NewDirectorEmployeeEmployee(p, arg1)
- return p
-}
-
-type _swig_DirectorInterfaceEmployeeGetTitle interface {
- GetTitle() string
-}
-
-func _swig_wrap__swig_DirectorEmployee_upcall_GetTitle(SwigcptrEmployee) string
-func (swig_p *_swig_DirectorEmployee) GetTitle() string {
- if swig_g, swig_ok := swig_p.v.(_swig_DirectorInterfaceEmployeeGetTitle); swig_ok {
- return swig_g.GetTitle()
- }
- return _swig_wrap__swig_DirectorEmployee_upcall_GetTitle(swig_p.SwigcptrEmployee)
-}
-
-func DirectorEmployeeGetTitle(p Employee) string {
- return _swig_wrap__swig_DirectorEmployee_upcall_GetTitle(p.(*_swig_DirectorEmployee).SwigcptrEmployee)
-}
-
-func Swig_DirectorEmployee_callback_getTitle(p *_swig_DirectorEmployee) (swig_result string) {
- return p.GetTitle()
-}
-
-type _swig_DirectorInterfaceEmployeeGetName interface {
- GetName() string
-}
-
-func _swig_wrap__swig_DirectorEmployee_upcall_GetName(SwigcptrEmployee) string
-func (swig_p *_swig_DirectorEmployee) GetName() string {
- if swig_g, swig_ok := swig_p.v.(_swig_DirectorInterfaceEmployeeGetName); swig_ok {
- return swig_g.GetName()
- }
- return _swig_wrap__swig_DirectorEmployee_upcall_GetName(swig_p.SwigcptrEmployee)
-}
-
-func DirectorEmployeeGetName(p Employee) string {
- return _swig_wrap__swig_DirectorEmployee_upcall_GetName(p.(*_swig_DirectorEmployee).SwigcptrEmployee)
-}
-
-func Swig_DirectorEmployee_callback_getName(p *_swig_DirectorEmployee) (swig_result string) {
- return p.GetName()
-}
-
-type _swig_DirectorInterfaceEmployeeGetPosition interface {
- GetPosition() string
-}
-
-func _swig_wrap__swig_DirectorEmployee_upcall_GetPosition(SwigcptrEmployee) string
-func (swig_p *_swig_DirectorEmployee) GetPosition() string {
- if swig_g, swig_ok := swig_p.v.(_swig_DirectorInterfaceEmployeeGetPosition); swig_ok {
- return swig_g.GetPosition()
- }
- return _swig_wrap__swig_DirectorEmployee_upcall_GetPosition(swig_p.SwigcptrEmployee)
-}
-
-func DirectorEmployeeGetPosition(p Employee) string {
- return _swig_wrap__swig_DirectorEmployee_upcall_GetPosition(p.(*_swig_DirectorEmployee).SwigcptrEmployee)
-}
-
-func Swig_DirectorEmployee_callback_getPosition(p *_swig_DirectorEmployee) (swig_result string) {
- return p.GetPosition()
-}
-
-func _swig_wrap_DeleteDirectorEmployee(uintptr)
-
-func DeleteDirectorEmployee(arg1 Employee) {
- _swig_wrap_DeleteDirectorEmployee(arg1.Swigcptr())
-}
-
-func Swiggo_DeleteDirector_Employee(p *_swig_DirectorEmployee) {
- p.SwigcptrEmployee = 0
-}
-
-type SwigcptrEmployee uintptr
-
-func (p SwigcptrEmployee) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrEmployee) SwigIsEmployee() {
-}
-
-func (p SwigcptrEmployee) DirectorInterface() interface{} {
- return nil
-}
-
-func _swig_wrap_new_Employee(string) SwigcptrEmployee
-
-func NewEmployee(arg1 string) Employee {
- return _swig_wrap_new_Employee(arg1)
-}
-
-func _swig_wrap_Employee_getTitle(SwigcptrEmployee) string
-
-func (arg1 SwigcptrEmployee) GetTitle() string {
- return _swig_wrap_Employee_getTitle(arg1)
-}
-
-func _swig_wrap_Employee_getName(SwigcptrEmployee) string
-
-func (arg1 SwigcptrEmployee) GetName() string {
- return _swig_wrap_Employee_getName(arg1)
-}
-
-func _swig_wrap_Employee_getPosition(SwigcptrEmployee) string
-
-func (arg1 SwigcptrEmployee) GetPosition() string {
- return _swig_wrap_Employee_getPosition(arg1)
-}
-
-func _swig_wrap_delete_Employee(uintptr)
-
-func DeleteEmployee(arg1 Employee) {
- _swig_wrap_delete_Employee(arg1.Swigcptr())
-}
-
-type Employee interface {
- Swigcptr() uintptr
- SwigIsEmployee()
- DirectorInterface() interface{}
- GetTitle() string
- GetName() string
- GetPosition() string
-}
-
-type _swig_DirectorManager struct {
- SwigcptrManager
- v interface{}
-}
-
-func (p *_swig_DirectorManager) Swigcptr() uintptr {
- return p.SwigcptrManager.Swigcptr()
-}
-
-func (p *_swig_DirectorManager) SwigIsManager() {
-}
-
-func (p *_swig_DirectorManager) DirectorInterface() interface{} {
- return p.v
-}
-
-func _swig_NewDirectorManagerManager(*_swig_DirectorManager, string) SwigcptrManager
-
-func NewDirectorManager(v interface{}, arg1 string) Manager {
- p := &_swig_DirectorManager{0, v}
- p.SwigcptrManager = _swig_NewDirectorManagerManager(p, arg1)
- return p
-}
-
-type _swig_DirectorInterfaceManagerGetTitle interface {
- GetTitle() string
-}
-
-func _swig_wrap__swig_DirectorManager_upcall_GetTitle(SwigcptrManager) string
-func (swig_p *_swig_DirectorManager) GetTitle() string {
- if swig_g, swig_ok := swig_p.v.(_swig_DirectorInterfaceManagerGetTitle); swig_ok {
- return swig_g.GetTitle()
- }
- return _swig_wrap__swig_DirectorManager_upcall_GetTitle(swig_p.SwigcptrManager)
-}
-
-func DirectorManagerGetTitle(p Manager) string {
- return _swig_wrap__swig_DirectorManager_upcall_GetTitle(p.(*_swig_DirectorManager).SwigcptrManager)
-}
-
-func Swig_DirectorManager_callback_getTitle(p *_swig_DirectorManager) (swig_result string) {
- return p.GetTitle()
-}
-
-type _swig_DirectorInterfaceManagerGetName interface {
- GetName() string
-}
-
-func _swig_wrap__swig_DirectorManager_upcall_GetName(SwigcptrManager) string
-func (swig_p *_swig_DirectorManager) GetName() string {
- if swig_g, swig_ok := swig_p.v.(_swig_DirectorInterfaceManagerGetName); swig_ok {
- return swig_g.GetName()
- }
- return _swig_wrap__swig_DirectorManager_upcall_GetName(swig_p.SwigcptrManager)
-}
-
-func DirectorManagerGetName(p Manager) string {
- return _swig_wrap__swig_DirectorManager_upcall_GetName(p.(*_swig_DirectorManager).SwigcptrManager)
-}
-
-func Swig_DirectorManager_callback_getName(p *_swig_DirectorManager) (swig_result string) {
- return p.GetName()
-}
-
-type _swig_DirectorInterfaceManagerGetPosition interface {
- GetPosition() string
-}
-
-func _swig_wrap__swig_DirectorManager_upcall_GetPosition(SwigcptrManager) string
-func (swig_p *_swig_DirectorManager) GetPosition() string {
- if swig_g, swig_ok := swig_p.v.(_swig_DirectorInterfaceManagerGetPosition); swig_ok {
- return swig_g.GetPosition()
- }
- return _swig_wrap__swig_DirectorManager_upcall_GetPosition(swig_p.SwigcptrManager)
-}
-
-func DirectorManagerGetPosition(p Manager) string {
- return _swig_wrap__swig_DirectorManager_upcall_GetPosition(p.(*_swig_DirectorManager).SwigcptrManager)
-}
-
-func Swig_DirectorManager_callback_getPosition(p *_swig_DirectorManager) (swig_result string) {
- return p.GetPosition()
-}
-
-func _swig_wrap_DeleteDirectorManager(uintptr)
-
-func DeleteDirectorManager(arg1 Manager) {
- _swig_wrap_DeleteDirectorManager(arg1.Swigcptr())
-}
-
-func Swiggo_DeleteDirector_Manager(p *_swig_DirectorManager) {
- p.SwigcptrManager = 0
-}
-
-type SwigcptrManager uintptr
-
-func (p SwigcptrManager) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrManager) SwigIsManager() {
-}
-
-func (p SwigcptrManager) DirectorInterface() interface{} {
- return nil
-}
-
-func _swig_wrap_new_Manager(string) SwigcptrManager
-
-func NewManager(arg1 string) Manager {
- return _swig_wrap_new_Manager(arg1)
-}
-
-func _swig_wrap_Manager_getPosition(SwigcptrManager) string
-
-func (arg1 SwigcptrManager) GetPosition() string {
- return _swig_wrap_Manager_getPosition(arg1)
-}
-
-func _swig_wrap_delete_Manager(uintptr)
-
-func DeleteManager(arg1 Manager) {
- _swig_wrap_delete_Manager(arg1.Swigcptr())
-}
-
-func _swig_wrap_Manager_getTitle(SwigcptrManager) string
-
-func (_swig_base SwigcptrManager) GetTitle() string {
- return _swig_wrap_Manager_getTitle(_swig_base)
-}
-
-func _swig_wrap_Manager_getName(SwigcptrManager) string
-
-func (_swig_base SwigcptrManager) GetName() string {
- return _swig_wrap_Manager_getName(_swig_base)
-}
-
-func (p SwigcptrManager) SwigIsEmployee() {
-}
-
-func (p SwigcptrManager) SwigGetEmployee() Employee {
- return SwigcptrEmployee(p.Swigcptr())
-}
-
-type Manager interface {
- Swigcptr() uintptr
- SwigIsManager()
- DirectorInterface() interface{}
- GetPosition() string
- GetTitle() string
- GetName() string
- SwigIsEmployee()
- SwigGetEmployee() Employee
-}
-
-type SwigcptrEmployeeList uintptr
-
-func (p SwigcptrEmployeeList) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrEmployeeList) SwigIsEmployeeList() {
-}
-
-func _swig_wrap_new_EmployeeList() SwigcptrEmployeeList
-
-func NewEmployeeList() EmployeeList {
- return _swig_wrap_new_EmployeeList()
-}
-
-func _swig_wrap_EmployeeList_addEmployee(SwigcptrEmployeeList, uintptr)
-
-func (arg1 SwigcptrEmployeeList) AddEmployee(arg2 Employee) {
- _swig_wrap_EmployeeList_addEmployee(arg1, arg2.Swigcptr())
-}
-
-func _swig_wrap_EmployeeList_get_item(SwigcptrEmployeeList, int) SwigcptrEmployee
-
-func (arg1 SwigcptrEmployeeList) Get_item(arg2 int) Employee {
- return _swig_wrap_EmployeeList_get_item(arg1, arg2)
-}
-
-func _swig_wrap_delete_EmployeeList(uintptr)
-
-func DeleteEmployeeList(arg1 EmployeeList) {
- _swig_wrap_delete_EmployeeList(arg1.Swigcptr())
-}
-
-type EmployeeList interface {
- Swigcptr() uintptr
- SwigIsEmployeeList()
- AddEmployee(arg2 Employee)
- Get_item(arg2 int) Employee
-}
-
-
-type SwigcptrSwigDirector_Manager uintptr
-type SwigDirector_Manager interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrSwigDirector_Manager) Swigcptr() uintptr {
- return uintptr(p)
-}
-
-type SwigcptrSwigDirector_Employee uintptr
-type SwigDirector_Employee interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrSwigDirector_Employee) Swigcptr() uintptr {
- return uintptr(p)
-}
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/funcptr/example.go b/Examples/go/funcptr/example.go
deleted file mode 100644
index b059bae..0000000
--- a/Examples/go/funcptr/example.go
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-func Do_op(int, int, _swig_fnptr) int
-func _swig_getADD() _swig_fnptr
-var ADD _swig_fnptr = _swig_getADD()
-func _swig_getSUB() _swig_fnptr
-var SUB _swig_fnptr = _swig_getSUB()
-func _swig_getMUL() _swig_fnptr
-var MUL _swig_fnptr = _swig_getMUL()
-func _swig_wrap_funcvar_set(_swig_fnptr)
-
-func SetFuncvar(arg1 _swig_fnptr) {
- _swig_wrap_funcvar_set(arg1)
-}
-
-func GetFuncvar() _swig_fnptr
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/multimap/example.go b/Examples/go/multimap/example.go
deleted file mode 100644
index 59ed9ea..0000000
--- a/Examples/go/multimap/example.go
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-func Gcd(int, int) int
-func Gcdmain([]string) int
-func Count(string, byte) int
-func _swig_wrap_capitalize([]string)
-
-func Capitalize(arg1 []string) {
- _swig_wrap_capitalize(arg1)
-}
-
-func _swig_wrap_circle(float64, float64)
-
-func Circle(arg1 float64, arg2 float64) {
- _swig_wrap_circle(arg1, arg2)
-}
-
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/pointer/example.go b/Examples/go/pointer/example.go
deleted file mode 100644
index 567c41c..0000000
--- a/Examples/go/pointer/example.go
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-func _swig_wrap_add(*int, *int, *int)
-
-func Add(arg1 *int, arg2 *int, arg3 *int) {
- _swig_wrap_add(arg1, arg2, arg3)
-}
-
-func New_intp() *int
-func Copy_intp(int) *int
-func _swig_wrap_delete_intp(*int)
-
-func Delete_intp(arg1 *int) {
- _swig_wrap_delete_intp(arg1)
-}
-
-func _swig_wrap_intp_assign(*int, int)
-
-func Intp_assign(arg1 *int, arg2 int) {
- _swig_wrap_intp_assign(arg1, arg2)
-}
-
-func Intp_value(*int) int
-func _swig_wrap_sub(int, int, []int)
-
-func Sub(arg1 int, arg2 int, arg3 []int) {
- _swig_wrap_sub(arg1, arg2, arg3)
-}
-
-func Divide(int, int, []int) int
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/reference/example.go b/Examples/go/reference/example.go
deleted file mode 100644
index fb98f8a..0000000
--- a/Examples/go/reference/example.go
+++ /dev/null
@@ -1,126 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-type SwigcptrVector uintptr
-
-func (p SwigcptrVector) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrVector) SwigIsVector() {
-}
-
-func _swig_wrap_new_Vector(float64, float64, float64) SwigcptrVector
-
-func NewVector(arg1 float64, arg2 float64, arg3 float64) Vector {
- return _swig_wrap_new_Vector(arg1, arg2, arg3)
-}
-
-func _swig_wrap_delete_Vector(uintptr)
-
-func DeleteVector(arg1 Vector) {
- _swig_wrap_delete_Vector(arg1.Swigcptr())
-}
-
-func _swig_wrap_Vector_print(SwigcptrVector) string
-
-func (arg1 SwigcptrVector) Print() string {
- return _swig_wrap_Vector_print(arg1)
-}
-
-type Vector interface {
- Swigcptr() uintptr
- SwigIsVector()
- Print() string
-}
-
-func _swig_wrap_addv(uintptr, uintptr) SwigcptrVector
-
-func Addv(arg1 Vector, arg2 Vector) Vector {
- return _swig_wrap_addv(arg1.Swigcptr(), arg2.Swigcptr())
-}
-
-type SwigcptrVectorArray uintptr
-
-func (p SwigcptrVectorArray) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrVectorArray) SwigIsVectorArray() {
-}
-
-func _swig_wrap_new_VectorArray(int) SwigcptrVectorArray
-
-func NewVectorArray(arg1 int) VectorArray {
- return _swig_wrap_new_VectorArray(arg1)
-}
-
-func _swig_wrap_delete_VectorArray(uintptr)
-
-func DeleteVectorArray(arg1 VectorArray) {
- _swig_wrap_delete_VectorArray(arg1.Swigcptr())
-}
-
-func _swig_wrap_VectorArray_size(SwigcptrVectorArray) int
-
-func (arg1 SwigcptrVectorArray) Size() int {
- return _swig_wrap_VectorArray_size(arg1)
-}
-
-func _swig_wrap_VectorArray_get(SwigcptrVectorArray, int) SwigcptrVector
-
-func (arg1 SwigcptrVectorArray) Get(arg2 int) Vector {
- return _swig_wrap_VectorArray_get(arg1, arg2)
-}
-
-func _swig_wrap_VectorArray_set(SwigcptrVectorArray, int, uintptr)
-
-func (arg1 SwigcptrVectorArray) Set(arg2 int, arg3 Vector) {
- _swig_wrap_VectorArray_set(arg1, arg2, arg3.Swigcptr())
-}
-
-type VectorArray interface {
- Swigcptr() uintptr
- SwigIsVectorArray()
- Size() int
- Get(arg2 int) Vector
- Set(arg2 int, arg3 Vector)
-}
-
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/simple/example.go b/Examples/go/simple/example.go
deleted file mode 100644
index df0e705..0000000
--- a/Examples/go/simple/example.go
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-func Gcd(int, int) int
-func _swig_wrap_Foo_set(float64)
-
-func SetFoo(arg1 float64) {
- _swig_wrap_Foo_set(arg1)
-}
-
-func GetFoo() float64
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/template/example.go b/Examples/go/template/example.go
deleted file mode 100644
index 671b5c2..0000000
--- a/Examples/go/template/example.go
+++ /dev/null
@@ -1,150 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-func Maxint(int, int) int
-func Maxdouble(float64, float64) float64
-type SwigcptrVecint uintptr
-
-func (p SwigcptrVecint) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrVecint) SwigIsVecint() {
-}
-
-func _swig_wrap_new_vecint(int) SwigcptrVecint
-
-func NewVecint(arg1 int) Vecint {
- return _swig_wrap_new_vecint(arg1)
-}
-
-func _swig_wrap_vecint_get(SwigcptrVecint, int) *int
-
-func (arg1 SwigcptrVecint) Get(arg2 int) *int {
- return _swig_wrap_vecint_get(arg1, arg2)
-}
-
-func _swig_wrap_vecint_set(SwigcptrVecint, int, *int)
-
-func (arg1 SwigcptrVecint) Set(arg2 int, arg3 *int) {
- _swig_wrap_vecint_set(arg1, arg2, arg3)
-}
-
-func _swig_wrap_vecint_getitem(SwigcptrVecint, int) int
-
-func (arg1 SwigcptrVecint) Getitem(arg2 int) int {
- return _swig_wrap_vecint_getitem(arg1, arg2)
-}
-
-func _swig_wrap_vecint_setitem(SwigcptrVecint, int, int)
-
-func (arg1 SwigcptrVecint) Setitem(arg2 int, arg3 int) {
- _swig_wrap_vecint_setitem(arg1, arg2, arg3)
-}
-
-func _swig_wrap_delete_vecint(uintptr)
-
-func DeleteVecint(arg1 Vecint) {
- _swig_wrap_delete_vecint(arg1.Swigcptr())
-}
-
-type Vecint interface {
- Swigcptr() uintptr
- SwigIsVecint()
- Get(arg2 int) *int
- Set(arg2 int, arg3 *int)
- Getitem(arg2 int) int
- Setitem(arg2 int, arg3 int)
-}
-
-type SwigcptrVecdouble uintptr
-
-func (p SwigcptrVecdouble) Swigcptr() uintptr {
- return (uintptr)(p)
-}
-
-func (p SwigcptrVecdouble) SwigIsVecdouble() {
-}
-
-func _swig_wrap_new_vecdouble(int) SwigcptrVecdouble
-
-func NewVecdouble(arg1 int) Vecdouble {
- return _swig_wrap_new_vecdouble(arg1)
-}
-
-func _swig_wrap_vecdouble_get(SwigcptrVecdouble, int) *float64
-
-func (arg1 SwigcptrVecdouble) Get(arg2 int) *float64 {
- return _swig_wrap_vecdouble_get(arg1, arg2)
-}
-
-func _swig_wrap_vecdouble_set(SwigcptrVecdouble, int, *float64)
-
-func (arg1 SwigcptrVecdouble) Set(arg2 int, arg3 *float64) {
- _swig_wrap_vecdouble_set(arg1, arg2, arg3)
-}
-
-func _swig_wrap_vecdouble_getitem(SwigcptrVecdouble, int) float64
-
-func (arg1 SwigcptrVecdouble) Getitem(arg2 int) float64 {
- return _swig_wrap_vecdouble_getitem(arg1, arg2)
-}
-
-func _swig_wrap_vecdouble_setitem(SwigcptrVecdouble, int, float64)
-
-func (arg1 SwigcptrVecdouble) Setitem(arg2 int, arg3 float64) {
- _swig_wrap_vecdouble_setitem(arg1, arg2, arg3)
-}
-
-func _swig_wrap_delete_vecdouble(uintptr)
-
-func DeleteVecdouble(arg1 Vecdouble) {
- _swig_wrap_delete_vecdouble(arg1.Swigcptr())
-}
-
-type Vecdouble interface {
- Swigcptr() uintptr
- SwigIsVecdouble()
- Get(arg2 int) *float64
- Set(arg2 int, arg3 *float64)
- Getitem(arg2 int) float64
- Setitem(arg2 int, arg3 float64)
-}
-
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/go/variables/example.go b/Examples/go/variables/example.go
deleted file mode 100644
index f4f299b..0000000
--- a/Examples/go/variables/example.go
+++ /dev/null
@@ -1,198 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-package example
-
-
-type _swig_fnptr *byte
-type _swig_memberptr *byte
-
-
-func _swig_allocatememory(int) *byte
-func _swig_internal_allocate(len int) *byte {
- return _swig_allocatememory(len)
-}
-
-func _swig_allocatestring(*byte, int) string
-func _swig_internal_makegostring(p *byte, l int) string {
- return _swig_allocatestring(p, l)
-}
-
-func _swig_internal_gopanic(p *byte, l int) {
- panic(_swig_allocatestring(p, l))
-}
-
-func _swig_wrap_ivar_set(int)
-
-func SetIvar(arg1 int) {
- _swig_wrap_ivar_set(arg1)
-}
-
-func GetIvar() int
-func _swig_wrap_svar_set(int16)
-
-func SetSvar(arg1 int16) {
- _swig_wrap_svar_set(arg1)
-}
-
-func GetSvar() int16
-func _swig_wrap_lvar_set(int32)
-
-func SetLvar(arg1 int32) {
- _swig_wrap_lvar_set(arg1)
-}
-
-func GetLvar() int32
-func _swig_wrap_uivar_set(uint)
-
-func SetUivar(arg1 uint) {
- _swig_wrap_uivar_set(arg1)
-}
-
-func GetUivar() uint
-func _swig_wrap_usvar_set(uint16)
-
-func SetUsvar(arg1 uint16) {
- _swig_wrap_usvar_set(arg1)
-}
-
-func GetUsvar() uint16
-func _swig_wrap_ulvar_set(uint32)
-
-func SetUlvar(arg1 uint32) {
- _swig_wrap_ulvar_set(arg1)
-}
-
-func GetUlvar() uint32
-func _swig_wrap_scvar_set(int8)
-
-func SetScvar(arg1 int8) {
- _swig_wrap_scvar_set(arg1)
-}
-
-func GetScvar() int8
-func _swig_wrap_ucvar_set(byte)
-
-func SetUcvar(arg1 byte) {
- _swig_wrap_ucvar_set(arg1)
-}
-
-func GetUcvar() byte
-func _swig_wrap_cvar_set(byte)
-
-func SetCvar(arg1 byte) {
- _swig_wrap_cvar_set(arg1)
-}
-
-func GetCvar() byte
-func _swig_wrap_fvar_set(float32)
-
-func SetFvar(arg1 float32) {
- _swig_wrap_fvar_set(arg1)
-}
-
-func GetFvar() float32
-func _swig_wrap_dvar_set(float64)
-
-func SetDvar(arg1 float64) {
- _swig_wrap_dvar_set(arg1)
-}
-
-func GetDvar() float64
-func _swig_wrap_strvar_set(string)
-
-func SetStrvar(arg1 string) {
- _swig_wrap_strvar_set(arg1)
-}
-
-func GetStrvar() string
-func GetCstrvar() string
-func _swig_wrap_iptrvar_set(*int)
-
-func SetIptrvar(arg1 *int) {
- _swig_wrap_iptrvar_set(arg1)
-}
-
-func GetIptrvar() *int
-func _swig_wrap_name_set(string)
-
-func SetName(arg1 string) {
- _swig_wrap_name_set(arg1)
-}
-
-func GetName() string
-func _swig_wrap_ptptr_set(uintptr)
-
-func SetPtptr(arg1 Point) {
- _swig_wrap_ptptr_set(arg1.Swigcptr())
-}
-
-func _swig_wrap_ptptr_get() SwigcptrPoint
-
-func GetPtptr() Point {
- return _swig_wrap_ptptr_get()
-}
-
-func _swig_wrap_pt_set(uintptr)
-
-func SetPt(arg1 Point) {
- _swig_wrap_pt_set(arg1.Swigcptr())
-}
-
-func _swig_wrap_pt_get() SwigcptrPoint
-
-func GetPt() Point {
- return _swig_wrap_pt_get()
-}
-
-func GetStatus() int
-func GetPath() string
-func _swig_wrap_print_vars()
-
-func Print_vars() {
- _swig_wrap_print_vars()
-}
-
-func New_int(int) *int
-func _swig_wrap_new_Point(int, int) SwigcptrPoint
-
-func New_Point(arg1 int, arg2 int) Point {
- return _swig_wrap_new_Point(arg1, arg2)
-}
-
-func _swig_wrap_Point_print(uintptr) string
-
-func Point_print(arg1 Point) string {
- return _swig_wrap_Point_print(arg1.Swigcptr())
-}
-
-func _swig_wrap_pt_print()
-
-func Pt_print() {
- _swig_wrap_pt_print()
-}
-
-
-type SwigcptrPoint uintptr
-type Point interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrPoint) Swigcptr() uintptr {
- return uintptr(p)
-}
-
-type SwigcptrVoid uintptr
-type Void interface {
- Swigcptr() uintptr;
-}
-func (p SwigcptrVoid) Swigcptr() uintptr {
- return uintptr(p)
-}
-
diff --git a/Examples/ocaml/argout_ref/example.i b/Examples/ocaml/argout_ref/example.i
index a0be05f..5ea6777 100644
--- a/Examples/ocaml/argout_ref/example.i
+++ b/Examples/ocaml/argout_ref/example.i
@@ -1,4 +1,8 @@
/* File : example.i */
%module example
+%{
+extern "C" void factor(int &x, int &y);
+%}
+
extern "C" void factor(int &x, int &y);
diff --git a/Examples/ocaml/shapes/example.c b/Examples/ocaml/shapes/example.c
index bf0fff9..26c1b80 100644
--- a/Examples/ocaml/shapes/example.c
+++ b/Examples/ocaml/shapes/example.c
@@ -46,3 +46,5 @@ void draw_depth_map( volume *v, int div_x, int div_y ) {
}
double volume::depth( double x, double y ) { return 0.0; }
+
+volume::~volume() { }
diff --git a/Examples/ocaml/shapes/example.h b/Examples/ocaml/shapes/example.h
index 4b16444..68cb6ee 100644
--- a/Examples/ocaml/shapes/example.h
+++ b/Examples/ocaml/shapes/example.h
@@ -9,7 +9,8 @@ public:
class volume {
public:
- virtual double depth( double x, double y );
+ virtual double depth( double x, double y );
+ virtual ~volume();
};
extern void draw_shape_coverage( shape *s, int div_x, int div_y );
diff --git a/Examples/ocaml/std_string/README b/Examples/ocaml/std_string/README
index 5665530..ccebecb 100644
--- a/Examples/ocaml/std_string/README
+++ b/Examples/ocaml/std_string/README
@@ -1,3 +1,9 @@
+--- New ---
+
+It's not possible to access std::(w)string at the moment as it breaks other string examples.
+
+--- Old ---
+
This example shows how to use both std::string and std::wstring in Ocaml,
and also demonstrates that one might use this to make a locale-obedient
Ocaml program.
diff --git a/Examples/ocaml/strings_test/example.h b/Examples/ocaml/strings_test/example.h
index 3417981..959404b 100644
--- a/Examples/ocaml/strings_test/example.h
+++ b/Examples/ocaml/strings_test/example.h
@@ -1,14 +1,18 @@
/* -*- mode: c++ -*- */
/* File : example.h -- Tests all string typemaps */
+#include <sys/time.h>
+#include <time.h>
+
void takes_std_string( std::string in ) {
cout << "takes_std_string( \"" << in << "\" );" << endl;
}
std::string gives_std_string() {
- time_t t;
-
- return std::string( asctime( localtime( &t ) ) );
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ return std::string( asctime( localtime( &tv.tv_sec ) ) );
}
void takes_char_ptr( char *p ) {
@@ -24,10 +28,10 @@ void takes_and_gives_std_string( std::string &inout ) {
inout.insert( inout.end(), ']' );
}
-void takes_and_gives_char_ptr( char *&ptr ) {
- char *pout = strchr( ptr, '.' );
- if( pout ) ptr = pout + 1;
- else ptr = "foo";
+void takes_and_gives_char_ptr( char *&inout ) {
+ char *pout = strchr( inout, '.' );
+ if( pout ) inout = pout + 1;
+ else inout = "foo";
}
/*
diff --git a/Examples/php/cpointer/runme.php b/Examples/php/cpointer/runme.php
index 48f0ad6..22e8a68 100644
--- a/Examples/php/cpointer/runme.php
+++ b/Examples/php/cpointer/runme.php
@@ -6,40 +6,42 @@
print "Testing the pointer library\n";
- $a = new_intp();
- $b = new_intp();
- $c = new_intp();
- intp_assign($a,37);
- intp_assign($b,42);
+ $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";
print " c = $c\n";
# Call the add() function wuth some pointers
- add($a,$b,$c);
+ example::add($a,$b,$c);
# Now get the result
- $r = intp_value($c);
+ $r = example::intp_value($c);
print " 37 + 42 = $r\n";
# Clean up the pointers
- delete_intp($a);
- delete_intp($b);
- delete_intp($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
# necessary to manufacture pointers.
print "Trying the typemap library\n";
- $r = sub(37,42);
+ $r = example::sub(37,42);
print " 37 - 42 = $r\n";
# Now try the version with multiple return values
# print "Testing multiple return values\n";
- # ($q,$r) = divide(42,37);
+ # $a = example::divide(42,37);
+ # $q = $a[0]
+ # $r = $a[1]
# print " 42/37 = $q remainder $r\n";
?>
diff --git a/Examples/php/overloading/runme.php b/Examples/php/overloading/runme.php
index 0104444..56d5151 100644
--- a/Examples/php/overloading/runme.php
+++ b/Examples/php/overloading/runme.php
@@ -35,11 +35,10 @@ print " Square = (" . $s->x . "," . $s->y . ")\n";
# ----- Call some methods -----
-print "\nHere are some properties of the shapes:\n";
+print "\nCall some overloaded methods:\n";
foreach (array(1, 2.1, "quick brown fox", $c, $s) as $o) {
- print " ".get_class($o)." \$o\n";
- print " overloaded = " . overloaded($o) . "\n";
- }
+ print " overloaded = " . overloaded($o) . "\n";
+}
# Need to unset($o) or else we hang on to a reference to the Square object.
unset($o);
diff --git a/Examples/test-suite/abstract_virtual.i b/Examples/test-suite/abstract_virtual.i
index 2e4d105..d8372c9 100644
--- a/Examples/test-suite/abstract_virtual.i
+++ b/Examples/test-suite/abstract_virtual.i
@@ -2,10 +2,12 @@
%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
- SWIGWARN_PHP_MULTIPLE_INHERITANCE) D; /* C#, Java, PHP multiple inheritance */
+ SWIGWARN_D_MULTIPLE_INHERITANCE,
+ SWIGWARN_PHP_MULTIPLE_INHERITANCE) D; /* C#, D, Java, PHP multiple inheritance */
%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
- SWIGWARN_PHP_MULTIPLE_INHERITANCE) E; /* C#, Java, PHP multiple inheritance */
+ SWIGWARN_D_MULTIPLE_INHERITANCE,
+ SWIGWARN_PHP_MULTIPLE_INHERITANCE) E; /* C#, D, Java, PHP multiple inheritance */
%inline %{
#if defined(_MSC_VER)
diff --git a/Examples/test-suite/char_binary.i b/Examples/test-suite/char_binary.i
new file mode 100644
index 0000000..7787929
--- /dev/null
+++ b/Examples/test-suite/char_binary.i
@@ -0,0 +1,29 @@
+/*
+A test case for testing non null terminated char pointers.
+*/
+
+%module char_binary
+
+%apply (char *STRING, size_t LENGTH) { (const char *str, size_t len) }
+
+%inline %{
+struct Test {
+ size_t strlen(const char *str, size_t len) {
+ return len;
+ }
+};
+
+typedef char namet[5];
+namet var_namet;
+
+typedef char* pchar;
+pchar var_pchar;
+%}
+
+// Remove string handling typemaps and treat as pointer
+%typemap(freearg) SWIGTYPE * ""
+%apply SWIGTYPE * { char * }
+
+%include "carrays.i"
+%array_functions(char, pchar);
+
diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk
index c195254..5f30120 100644
--- a/Examples/test-suite/common.mk
+++ b/Examples/test-suite/common.mk
@@ -154,6 +154,7 @@ CPP_TEST_CASES += \
derived_nested \
destructor_reprotected \
director_abstract \
+ director_alternating \
director_basic \
director_classes \
director_classic \
@@ -166,6 +167,7 @@ CPP_TEST_CASES += \
director_finalizer \
director_frob \
director_ignore \
+ director_keywords \
director_namespace_clash \
director_nested \
director_overload \
@@ -228,9 +230,11 @@ CPP_TEST_CASES += \
li_cpointer \
li_stdint \
li_typemaps \
+ li_typemaps_apply \
li_windows \
long_long_apply \
memberin_extend \
+ member_funcptr_galore \
member_pointer \
member_template \
minherit \
@@ -283,7 +287,10 @@ CPP_TEST_CASES += \
rename3 \
rename4 \
rename_scope \
+ rename_simple \
rename_strip_encoder \
+ rename_pcre_encoder \
+ rename_pcre_enum \
restrict_cplusplus \
return_const_value \
return_value_scope \
@@ -292,6 +299,7 @@ CPP_TEST_CASES += \
sizet \
smart_pointer_const \
smart_pointer_const2 \
+ smart_pointer_const_overload \
smart_pointer_extend \
smart_pointer_member \
smart_pointer_multi \
@@ -315,11 +323,11 @@ CPP_TEST_CASES += \
struct_initialization_cpp \
struct_value \
symbol_clash \
- template \
template_arg_replace \
template_arg_scope \
template_arg_typename \
template_array_numeric \
+ template_basic \
template_base_template \
template_classes \
template_const_ref \
@@ -393,6 +401,7 @@ CPP_TEST_CASES += \
typedef_scope \
typedef_sizet \
typedef_struct \
+ typemap_arrays \
typemap_delete \
typemap_global_scope \
typemap_namespace \
@@ -463,7 +472,7 @@ C_TEST_CASES += \
extern_declaration \
funcptr \
function_typedef \
- immutable \
+ immutable_values \
inctest \
integers \
keyword_rename \
@@ -484,6 +493,9 @@ C_TEST_CASES += \
overload_extendc \
preproc \
preproc_constants_c \
+ preproc_defined \
+ preproc_include \
+ preproc_line_file \
ret_by_value \
simple_array \
sizeof_pointer \
@@ -507,6 +519,7 @@ MULTI_CPP_TEST_CASES += \
# Custom tests - tests with additional commandline options
wallkw.cpptest: SWIGOPT += -Wallkw
+preproc_include.ctest: SWIGOPT += -includeall
NOT_BROKEN_TEST_CASES = $(CPP_TEST_CASES:=.cpptest) \
diff --git a/Examples/test-suite/constant_pointers.i b/Examples/test-suite/constant_pointers.i
index 7d46cdb..388970c 100644
--- a/Examples/test-suite/constant_pointers.i
+++ b/Examples/test-suite/constant_pointers.i
@@ -5,7 +5,8 @@ This testcase primarily test constant pointers, eg int* const. Only a getter is
%module constant_pointers
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */
-%warnfilter(SWIGWARN_GO_NAME_CONFLICT); /* Ignoring 'Foo' due to Go name ('Foo') conflict with 'foo' */
+%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG); /* Setting a pointer/reference variable may leak memory. */
+
%inline %{
@@ -50,7 +51,7 @@ public:
private:
MemberVariablesTest& operator=(const MemberVariablesTest&);
};
-void foo(const int *const i) {}
+void foofunction(const int *const i) {}
typedef int *typedef1, typedef2, *const typedef3;
int int1, int2=2, *int3, *const int4 = &GlobalInt;
diff --git a/Examples/test-suite/contract.i b/Examples/test-suite/contract.i
index b979ef1..0ad7e8e 100644
--- a/Examples/test-suite/contract.i
+++ b/Examples/test-suite/contract.i
@@ -3,12 +3,17 @@
%warnfilter(SWIGWARN_RUBY_MULTIPLE_INHERITANCE,
SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
- SWIGWARN_PHP_MULTIPLE_INHERITANCE) C; /* Ruby, C#, Java, PHP multiple inheritance */
+ SWIGWARN_D_MULTIPLE_INHERITANCE,
+ SWIGWARN_PHP_MULTIPLE_INHERITANCE) C; /* Ruby, C#, D, Java, PHP multiple inheritance */
#ifdef SWIGCSHARP
%ignore B::bar; // otherwise get a warning: `C.bar' no suitable methods found to override
#endif
+#ifdef SWIGD
+%ignore B::bar; // Prevents getting an error that C.bar does not override any function because multiple inheritance is not supported.
+#endif
+
%contract test_preassert(int a, int b) {
require:
a > 0;
diff --git a/Examples/test-suite/csharp/Makefile.in b/Examples/test-suite/csharp/Makefile.in
index 5f50095..18f10c5 100644
--- a/Examples/test-suite/csharp/Makefile.in
+++ b/Examples/test-suite/csharp/Makefile.in
@@ -8,8 +8,8 @@ INTERPRETER = @CSHARPCILINTERPRETER@
CSHARPPATHSEPARATOR = "@CSHARPPATHSEPARATOR@"
CSHARPCYGPATH_W = @CSHARPCYGPATH_W@
srcdir = @srcdir@
-top_srcdir = @top_srcdir@/..
-top_builddir = @top_builddir@/..
+top_srcdir = ../@top_srcdir@
+top_builddir = ../@top_builddir@
CPP_TEST_CASES = \
csharp_attributes \
@@ -64,12 +64,13 @@ setup = \
# Compiles C# files then runs the testcase. A testcase is only run if
# a file is found which has _runme.cs appended after the testcase name.
# Note C# uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows and SHLIB_PATH on HPUX.
+# DYLD_FALLBACK_LIBRARY_PATH is cleared for MacOSX.
run_testcase = \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
$(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile \
CSHARPFLAGS='-nologo $(CSHARPFLAGSSPECIAL) -out:$*_runme.exe' \
CSHARPSRCS='`$(CSHARPCYGPATH_W) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile && \
- env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" $(RUNTOOL) $(INTERPRETER) $*_runme.exe; \
+ env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" DYLD_FALLBACK_LIBRARY_PATH= $(RUNTOOL) $(INTERPRETER) $*_runme.exe; \
else \
cd $* && \
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
diff --git a/Examples/test-suite/csharp/csharp_prepost_runme.cs b/Examples/test-suite/csharp/csharp_prepost_runme.cs
index d0bacda..f76dae3 100644
--- a/Examples/test-suite/csharp/csharp_prepost_runme.cs
+++ b/Examples/test-suite/csharp/csharp_prepost_runme.cs
@@ -55,6 +55,43 @@ public class csharp_prepost_runme {
throw new Exception("Expecting CustomInt attribute");
}
}
+ // Dates
+ {
+ // pre post typemap attributes example
+ System.DateTime dateIn = new System.DateTime(2011, 4, 13);
+ System.DateTime dateOut = new System.DateTime();
+
+ // Note in calls below, dateIn remains unchanged and dateOut
+ // is set to a new value by the C++ call
+ csharp_prepostNamespace.Action action = new csharp_prepostNamespace.Action(dateIn, out dateOut);
+ if (dateOut != dateIn)
+ throw new Exception("dates wrong");
+
+ dateIn = new System.DateTime(2012, 7, 14);
+ action.doSomething(dateIn, out dateOut);
+ if (dateOut != dateIn)
+ throw new Exception("dates wrong");
+
+ System.DateTime refDate = new System.DateTime(1999, 12, 31);
+ if (csharp_prepost.ImportantDate != refDate)
+ throw new Exception("dates wrong");
+
+ refDate = new System.DateTime(1999, 12, 31);
+ csharp_prepost.ImportantDate = refDate;
+ System.DateTime importantDate = csharp_prepost.ImportantDate;
+ if (importantDate != refDate)
+ throw new Exception("dates wrong");
+
+ System.DateTime christmasEve = new System.DateTime(2000, 12, 24);
+ csharp_prepost.addYears(ref christmasEve, 10);
+ if (christmasEve != new System.DateTime(2010, 12, 24))
+ throw new Exception("dates wrong");
+
+ Person person = new Person();
+ person.Birthday = christmasEve;
+ if (person.Birthday != christmasEve)
+ throw new Exception("dates wrong");
+ }
}
private static void Assert(double d1, double d2) {
if (d1 != d2)
diff --git a/Examples/test-suite/csharp/director_alternating_runme.cs b/Examples/test-suite/csharp/director_alternating_runme.cs
new file mode 100644
index 0000000..1936521
--- /dev/null
+++ b/Examples/test-suite/csharp/director_alternating_runme.cs
@@ -0,0 +1,11 @@
+
+using System;
+using director_alternatingNamespace;
+
+public class director_alternating_runme {
+ public static void Main() {
+ if (director_alternating.getBar().id() != director_alternating.idFromGetBar())
+ throw new Exception("idFromGetBar failed");
+ }
+}
+
diff --git a/Examples/test-suite/csharp/director_protected_runme.cs b/Examples/test-suite/csharp/director_protected_runme.cs
index ee4697b..b44c3b7 100644
--- a/Examples/test-suite/csharp/director_protected_runme.cs
+++ b/Examples/test-suite/csharp/director_protected_runme.cs
@@ -16,6 +16,7 @@ public class runme
Foo f = b.create();
FooBar fb = new FooBar();
FooBar2 fb2 = new FooBar2();
+ FooBar3 fb3 = new FooBar3();
String s;
s = fb.used();
@@ -37,6 +38,21 @@ public class runme
s = fb.pong();
if ( s != ("Bar::pong();Foo::pong();FooBar::ping();"))
throw new Exception("bad FooBar::pong");
+
+// if (fb3.cheer() != "FooBar3::cheer();")
+// throw new Exception("bad fb3::cheer");
+
+ if (fb2.callping() != "FooBar2::ping();")
+ throw new Exception("bad fb2.callping");
+
+ if (fb2.callcheer() != "FooBar2::pang();Bar::pong();Foo::pong();FooBar2::ping();")
+ throw new Exception("bad fb2.callcheer");
+
+ if (fb3.callping() != "Bar::ping();")
+ throw new Exception("bad fb3.callping");
+
+ if (fb3.callcheer() != "FooBar3::cheer();")
+ throw new Exception("bad fb3.callcheer");
}
}
@@ -69,4 +85,16 @@ class FooBar2 : Bar
}
}
+class FooBar3 : Bar
+{
+ public FooBar3() : base()
+ {
+ }
+
+ protected override String cheer()
+ {
+ return "FooBar3::cheer();";
+ }
+}
+
}
diff --git a/Examples/test-suite/csharp/pointer_reference_runme.cs b/Examples/test-suite/csharp/pointer_reference_runme.cs
index d005551..2b9f526 100644
--- a/Examples/test-suite/csharp/pointer_reference_runme.cs
+++ b/Examples/test-suite/csharp/pointer_reference_runme.cs
@@ -12,6 +12,9 @@ public class pointer_reference_runme {
Struct ss = new Struct(20);
pointer_reference.set(ss);
if (Struct.instance.value != 20) throw new Exception("set test failed");
+
+ if (pointer_reference.overloading(1) != 111) throw new Exception("overload test 1 failed");
+ if (pointer_reference.overloading(ss) != 222) throw new Exception("overload test 2 failed");
}
}
diff --git a/Examples/test-suite/csharp/rename_pcre_encoder_runme.cs b/Examples/test-suite/csharp/rename_pcre_encoder_runme.cs
new file mode 100644
index 0000000..f6289e7
--- /dev/null
+++ b/Examples/test-suite/csharp/rename_pcre_encoder_runme.cs
@@ -0,0 +1,12 @@
+using System;
+using rename_pcre_encoderNamespace;
+
+public class runme {
+ static void Main() {
+ SomeWidget w = new SomeWidget();
+ w.putBorderWidth(17);
+ if ( w.getBorderWidth() != 17 )
+ throw new Exception(String.Format("Border with should be 17, not {0}",
+ w.getBorderWidth()));
+ }
+}
diff --git a/Examples/test-suite/csharp/rename_pcre_enum_runme.cs b/Examples/test-suite/csharp/rename_pcre_enum_runme.cs
new file mode 100644
index 0000000..0143eda
--- /dev/null
+++ b/Examples/test-suite/csharp/rename_pcre_enum_runme.cs
@@ -0,0 +1,24 @@
+using System;
+using rename_pcre_enumNamespace;
+
+public class runme {
+ static void Main() {
+ Foo foo = Foo.First;
+ if ( foo == Foo.Second )
+ throw new Exception("Enum values should be different");
+
+ // Check that Foo_Max enum element was ignored.
+ int numFooEnumElements = Enum.GetValues(typeof(Foo)).Length;
+ if ( numFooEnumElements != 2 )
+ throw new Exception(String.Format("Enum should have 2 elements, not {0}",
+ numFooEnumElements));
+
+ BoundaryCondition bc = BoundaryCondition.MaxMax;
+ if ( (int)bc != 2 )
+ throw new Exception("Wrong enum value");
+
+ Colour c = Colour.red;
+ if ( c == Colour.blue )
+ throw new Exception("Enum values should be different");
+ }
+}
diff --git a/Examples/test-suite/csharp/rename_simple_runme.cs b/Examples/test-suite/csharp/rename_simple_runme.cs
new file mode 100644
index 0000000..edf05ad
--- /dev/null
+++ b/Examples/test-suite/csharp/rename_simple_runme.cs
@@ -0,0 +1,30 @@
+
+using System;
+using rename_simpleNamespace;
+
+public class rename_simple_runme {
+
+ public static void Main() {
+ NewStruct s = new NewStruct();
+ check(111, s.NewInstanceVariable, "NewInstanceVariable");
+ check(222, s.NewInstanceMethod(), "NewInstanceMethod");
+ check(333, NewStruct.NewStaticMethod(), "NewStaticMethod");
+ check(444, NewStruct.NewStaticVariable, "NewStaticVariable");
+ check(555, rename_simple.NewFunction(), "NewFunction");
+ check(666, rename_simple.NewGlobalVariable, "NewGlobalVariable");
+
+ s.NewInstanceVariable = 1111;
+ NewStruct.NewStaticVariable = 4444;
+ rename_simple.NewGlobalVariable = 6666;
+
+ check(1111, s.NewInstanceVariable, "NewInstanceVariable");
+ check(4444, NewStruct.NewStaticVariable, "NewStaticVariable");
+ check(6666, rename_simple.NewGlobalVariable, "NewGlobalVariable");
+ }
+
+ public static void check(int expected, int actual, string msg) {
+ if (expected != actual)
+ throw new Exception("Failed: Expected: " + expected + " actual: " + actual + " " + msg);
+ }
+}
+
diff --git a/Examples/test-suite/csharp_attributes.i b/Examples/test-suite/csharp_attributes.i
index bca595d..f679d8c 100644
--- a/Examples/test-suite/csharp_attributes.i
+++ b/Examples/test-suite/csharp_attributes.i
@@ -56,7 +56,7 @@ double MoreStations::WestonSuperMare = 0.0;
%inline %{
struct YetMoreStations {
- virtual int Slough(int x) {}
+ virtual int Slough(int x) { return x; }
virtual ~YetMoreStations() {}
};
%}
diff --git a/Examples/test-suite/csharp_prepost.i b/Examples/test-suite/csharp_prepost.i
index 817f5b9..31e6ec7 100644
--- a/Examples/test-suite/csharp_prepost.i
+++ b/Examples/test-suite/csharp_prepost.i
@@ -79,7 +79,7 @@ struct PrePost2 {
// Check attributes in the typemaps
%typemap(cstype, inattributes="[CustomInt]") int val "int"
-%typemap(csin, pre=" int tmp_$csinput = $csinput * 100;") int "tmp_$csinput"
+%typemap(csin, pre=" int tmp_$csinput = $csinput * 100;") int val "tmp_$csinput"
%typemap(imtype, out="IntPtr/*overridden*/", outattributes="[CustomIntPtr]") CsinAttributes * "HandleRef/*overridden*/"
%inline %{
@@ -188,5 +188,8 @@ void subtractYears(CDate *pDate, int years) {
%inline %{
CDate ImportantDate = CDate(1999, 12, 31);
+struct Person {
+ CDate Birthday;
+};
%}
diff --git a/Examples/test-suite/d/Makefile.in b/Examples/test-suite/d/Makefile.in
new file mode 100644
index 0000000..0f5bf8c
--- /dev/null
+++ b/Examples/test-suite/d/Makefile.in
@@ -0,0 +1,81 @@
+#######################################################################
+# Makefile for D test-suite
+#######################################################################
+
+LANGUAGE = d
+srcdir = @srcdir@
+top_srcdir = ../@top_srcdir@
+top_builddir = ../@top_builddir@
+
+ifeq (2,$(D_VERSION))
+ VERSIONSUFFIX = .2
+else
+ VERSIONSUFFIX = .1
+endif
+
+TESTSUFFIX = _runme$(VERSIONSUFFIX).d
+
+CPP_TEST_CASES = \
+ d_exception_name \
+ d_nativepointers \
+ exception_partial_info
+
+include $(srcdir)/../common.mk
+
+# Override some variables from common.mk:
+
+TARGETSUFFIX = _wrap
+
+SWIGOPT+=-splitproxy -package $*
+
+# Rules for the different types of tests
+%.cpptest:
+ $(setup)
+ +(cd $*$(VERSIONSUFFIX) && $(swig_and_compile_cpp))
+ +$(run_testcase)
+
+%.ctest:
+ $(setup)
+ +(cd $*$(VERSIONSUFFIX) && $(swig_and_compile_c))
+ +$(run_testcase)
+
+%.multicpptest:
+ $(setup)
+ +(cd $*$(VERSIONSUFFIX) && $(swig_and_compile_multi_cpp))
+ +$(run_testcase)
+
+# Makes a directory for the testcase if it does not exist
+setup = \
+ if [ -f $(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) ]; then \
+ echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
+ else \
+ echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
+ fi; \
+ if [ ! -d $*$(VERSIONSUFFIX) ]; then \
+ mkdir $*$(VERSIONSUFFIX); \
+ fi; \
+ if [ ! -d $*$(VERSIONSUFFIX)/$* ]; then \
+ mkdir $*$(VERSIONSUFFIX)/$*; \
+ fi
+
+# Compiles D files then runs the testcase. A testcase is only run if
+# a file is found which has _runme.d appended after the testcase name.
+run_testcase = \
+ if [ -f $(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) ]; then \
+ cd $*$(VERSIONSUFFIX) && \
+ $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
+ DFLAGS='-of$*_runme' \
+ DSRCS='../$(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) $*/*.d' d_compile && \
+ env LD_LIBRARY_PATH=".:$$LD_LIBRARY_PATH" $(RUNTOOL) ./$*_runme; \
+ else \
+ cd $*$(VERSIONSUFFIX) && \
+ $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
+ DFLAGS='-c' \
+ DSRCS='$*/*.d' d_compile && cd .. ; \
+ fi
+
+# Clean: remove testcase directories
+%.clean:
+ @if [ -d $*$(VERSIONSUFFIX) ]; then \
+ rm -rf $*$(VERSIONSUFFIX); \
+ fi
diff --git a/Examples/test-suite/d/README b/Examples/test-suite/d/README
new file mode 100644
index 0000000..bb53728
--- /dev/null
+++ b/Examples/test-suite/d/README
@@ -0,0 +1,7 @@
+D language module testsuite
+---------------------------
+
+Please see ../README for the common readme file.
+
+By default the D1 version is built, set D_VERSION=2 (in the environment or at
+the make command line) to run it for D2 instead.
diff --git a/Examples/test-suite/d/aggregate_runme.1.d b/Examples/test-suite/d/aggregate_runme.1.d
new file mode 100644
index 0000000..a00d34c
--- /dev/null
+++ b/Examples/test-suite/d/aggregate_runme.1.d
@@ -0,0 +1,25 @@
+module aggregate_runme;
+
+import aggregate.aggregate;
+
+void main() {
+ // Confirm that move() returns correct results under normal use.
+ int result = move(UP);
+ if (result != UP) throw new Exception("UP failed");
+
+ result = move(DOWN);
+ if (result != DOWN) throw new Exception("DOWN failed");
+
+ result = move(LEFT);
+ if (result != LEFT) throw new Exception("LEFT failed");
+
+ result = move(RIGHT);
+ if (result != RIGHT) throw new Exception("RIGHT failed");
+
+ // Confirm that move() raises an exception when the contract is violated.
+ try {
+ move(0);
+ throw new Exception("0 test failed");
+ }
+ catch (Exception e) {}
+}
diff --git a/Examples/test-suite/d/aggregate_runme.2.d b/Examples/test-suite/d/aggregate_runme.2.d
new file mode 100644
index 0000000..a00d34c
--- /dev/null
+++ b/Examples/test-suite/d/aggregate_runme.2.d
@@ -0,0 +1,25 @@
+module aggregate_runme;
+
+import aggregate.aggregate;
+
+void main() {
+ // Confirm that move() returns correct results under normal use.
+ int result = move(UP);
+ if (result != UP) throw new Exception("UP failed");
+
+ result = move(DOWN);
+ if (result != DOWN) throw new Exception("DOWN failed");
+
+ result = move(LEFT);
+ if (result != LEFT) throw new Exception("LEFT failed");
+
+ result = move(RIGHT);
+ if (result != RIGHT) throw new Exception("RIGHT failed");
+
+ // Confirm that move() raises an exception when the contract is violated.
+ try {
+ move(0);
+ throw new Exception("0 test failed");
+ }
+ catch (Exception e) {}
+}
diff --git a/Examples/test-suite/d/allprotected_runme.1.d b/Examples/test-suite/d/allprotected_runme.1.d
new file mode 100644
index 0000000..82a180e
--- /dev/null
+++ b/Examples/test-suite/d/allprotected_runme.1.d
@@ -0,0 +1,65 @@
+module allprotected_runme;
+
+import allprotected.Klass;
+import allprotected.ProtectedBase;
+
+void main() {
+ auto mpb = new MyProtectedBase("MyProtectedBase");
+ mpb.accessProtected();
+}
+
+class MyProtectedBase : ProtectedBase {
+public:
+ this(char[] name) {
+ super(name);
+ }
+
+ void accessProtected() {
+ char[] s = virtualMethod();
+ if (s != "ProtectedBase")
+ throw new Exception("Failed");
+
+ Klass k = instanceMethod(new Klass("xyz"));
+ if (k.getName() != "xyz")
+ throw new Exception("Failed");
+
+ k = instanceOverloaded(new Klass("xyz"));
+ if (k.getName() != "xyz")
+ throw new Exception("Failed");
+
+ k = instanceOverloaded(new Klass("xyz"), "abc");
+ if (k.getName() != "abc")
+ throw new Exception("Failed");
+
+ k = staticMethod(new Klass("abc"));
+ if (k.getName() != "abc")
+ throw new Exception("Failed");
+
+ k = staticOverloaded(new Klass("xyz"));
+ if (k.getName() != "xyz")
+ throw new Exception("Failed");
+
+ k = staticOverloaded(new Klass("xyz"), "abc");
+ if (k.getName() != "abc")
+ throw new Exception("Failed");
+
+ instanceMemberVariable = 30;
+ int i = instanceMemberVariable;
+ if (i != 30)
+ throw new Exception("Failed");
+
+ staticMemberVariable = 40;
+ i = staticMemberVariable;
+ if (i != 40)
+ throw new Exception("Failed");
+
+ i = staticConstMemberVariable;
+ if (i != 20)
+ throw new Exception("Failed");
+
+ anEnum = ProtectedBase.AnEnum.EnumVal1;
+ ProtectedBase.AnEnum ae = anEnum;
+ if (ae != ProtectedBase.AnEnum.EnumVal1)
+ throw new Exception("Failed");
+ }
+}
diff --git a/Examples/test-suite/d/allprotected_runme.2.d b/Examples/test-suite/d/allprotected_runme.2.d
new file mode 100644
index 0000000..7992302
--- /dev/null
+++ b/Examples/test-suite/d/allprotected_runme.2.d
@@ -0,0 +1,65 @@
+module allprotected_runme;
+
+import allprotected.Klass;
+import allprotected.ProtectedBase;
+
+void main() {
+ auto mpb = new MyProtectedBase("MyProtectedBase");
+ mpb.accessProtected();
+}
+
+class MyProtectedBase : ProtectedBase {
+public:
+ this(string name) {
+ super(name);
+ }
+
+ void accessProtected() {
+ string s = virtualMethod();
+ if (s != "ProtectedBase")
+ throw new Exception("Failed");
+
+ Klass k = instanceMethod(new Klass("xyz"));
+ if (k.getName() != "xyz")
+ throw new Exception("Failed");
+
+ k = instanceOverloaded(new Klass("xyz"));
+ if (k.getName() != "xyz")
+ throw new Exception("Failed");
+
+ k = instanceOverloaded(new Klass("xyz"), "abc");
+ if (k.getName() != "abc")
+ throw new Exception("Failed");
+
+ k = staticMethod(new Klass("abc"));
+ if (k.getName() != "abc")
+ throw new Exception("Failed");
+
+ k = staticOverloaded(new Klass("xyz"));
+ if (k.getName() != "xyz")
+ throw new Exception("Failed");
+
+ k = staticOverloaded(new Klass("xyz"), "abc");
+ if (k.getName() != "abc")
+ throw new Exception("Failed");
+
+ instanceMemberVariable = 30;
+ int i = instanceMemberVariable;
+ if (i != 30)
+ throw new Exception("Failed");
+
+ staticMemberVariable = 40;
+ i = staticMemberVariable;
+ if (i != 40)
+ throw new Exception("Failed");
+
+ i = staticConstMemberVariable;
+ if (i != 20)
+ throw new Exception("Failed");
+
+ anEnum = ProtectedBase.AnEnum.EnumVal1;
+ ProtectedBase.AnEnum ae = anEnum;
+ if (ae != ProtectedBase.AnEnum.EnumVal1)
+ throw new Exception("Failed");
+ }
+}
diff --git a/Examples/test-suite/d/apply_strings_runme.1.d b/Examples/test-suite/d/apply_strings_runme.1.d
new file mode 100644
index 0000000..960caa4
--- /dev/null
+++ b/Examples/test-suite/d/apply_strings_runme.1.d
@@ -0,0 +1,12 @@
+module apply_strings_runme;
+
+import apply_strings.apply_strings;
+
+const char[] TEST_MESSAGE = "A message from target language to the C++ world and back again.";
+
+void main() {
+ if (UCharFunction(TEST_MESSAGE) != TEST_MESSAGE) throw new Exception("UCharFunction failed");
+ if (SCharFunction(TEST_MESSAGE) != TEST_MESSAGE) throw new Exception("SCharFunction failed");
+ auto pChar = CharFunction(null);
+ if (pChar !is null) throw new Exception("CharFunction failed");
+}
diff --git a/Examples/test-suite/d/apply_strings_runme.2.d b/Examples/test-suite/d/apply_strings_runme.2.d
new file mode 100644
index 0000000..86183f8
--- /dev/null
+++ b/Examples/test-suite/d/apply_strings_runme.2.d
@@ -0,0 +1,12 @@
+module apply_strings_runme;
+
+import apply_strings.apply_strings;
+
+enum string TEST_MESSAGE = "A message from target language to the C++ world and back again.";
+
+void main() {
+ if (UCharFunction(TEST_MESSAGE) != TEST_MESSAGE) throw new Exception("UCharFunction failed");
+ if (SCharFunction(TEST_MESSAGE) != TEST_MESSAGE) throw new Exception("SCharFunction failed");
+ auto pChar = CharFunction(null);
+ if (pChar !is null) throw new Exception("CharFunction failed");
+}
diff --git a/Examples/test-suite/d/bools_runme.1.d b/Examples/test-suite/d/bools_runme.1.d
new file mode 100644
index 0000000..f501b07
--- /dev/null
+++ b/Examples/test-suite/d/bools_runme.1.d
@@ -0,0 +1,20 @@
+/// This is the bool runtime testcase. It checks that the C++ bool type works.
+module bools_runme;
+
+import bools.bools;
+
+void main() {
+ bool t = true;
+ bool f = false;
+
+ check_bo(f);
+ check_bo(t);
+}
+
+void check_bo(bool input) {
+ for (int i = 0; i < 1000; ++i) {
+ if (bo(input) != input) {
+ throw new Exception("Runtime test check_bo failed.");
+ }
+ }
+}
diff --git a/Examples/test-suite/d/bools_runme.2.d b/Examples/test-suite/d/bools_runme.2.d
new file mode 100644
index 0000000..f501b07
--- /dev/null
+++ b/Examples/test-suite/d/bools_runme.2.d
@@ -0,0 +1,20 @@
+/// This is the bool runtime testcase. It checks that the C++ bool type works.
+module bools_runme;
+
+import bools.bools;
+
+void main() {
+ bool t = true;
+ bool f = false;
+
+ check_bo(f);
+ check_bo(t);
+}
+
+void check_bo(bool input) {
+ for (int i = 0; i < 1000; ++i) {
+ if (bo(input) != input) {
+ throw new Exception("Runtime test check_bo failed.");
+ }
+ }
+}
diff --git a/Examples/test-suite/d/catches_runme.1.d b/Examples/test-suite/d/catches_runme.1.d
new file mode 100644
index 0000000..55b1813
--- /dev/null
+++ b/Examples/test-suite/d/catches_runme.1.d
@@ -0,0 +1,33 @@
+module catches_runme;
+
+import catches.catches;
+
+void main() {
+ test({ test_catches(1); }, "C++ int exception thrown, value: 1");
+ test({ test_catches(2); }, "two");
+ test({ test_catches(3); }, "C++ ThreeException const & exception thrown");
+
+ test({ test_exception_specification(1); }, "C++ int exception thrown, value: 1");
+ test({ test_exception_specification(2); }, "unknown exception");
+ test({ test_exception_specification(3); }, "unknown exception");
+
+ test({ test_catches_all(1); }, "unknown exception");
+}
+
+void test(void delegate() command, char[] expectedMessage) {
+ bool didntThrow;
+ try {
+ command();
+ didntThrow = true;
+ } catch (Exception e) {
+ if (e.msg != expectedMessage) {
+ throw new Exception("Failed to propagate C++ exception. Expected '" ~
+ expectedMessage ~ "', but received '" ~ e.msg ~ "'.");
+ }
+ }
+
+ if (didntThrow) {
+ throw new Exception("Failed to propagate C++ exception. Expected '" ~
+ expectedMessage ~ "', but no exception was thrown.");
+ }
+}
diff --git a/Examples/test-suite/d/catches_runme.2.d b/Examples/test-suite/d/catches_runme.2.d
new file mode 100644
index 0000000..5085584
--- /dev/null
+++ b/Examples/test-suite/d/catches_runme.2.d
@@ -0,0 +1,33 @@
+module catches_runme;
+
+import catches.catches;
+
+void main() {
+ test({ test_catches(1); }, "C++ int exception thrown, value: 1");
+ test({ test_catches(2); }, "two");
+ test({ test_catches(3); }, "C++ ThreeException const & exception thrown");
+
+ test({ test_exception_specification(1); }, "C++ int exception thrown, value: 1");
+ test({ test_exception_specification(2); }, "unknown exception");
+ test({ test_exception_specification(3); }, "unknown exception");
+
+ test({ test_catches_all(1); }, "unknown exception");
+}
+
+void test(void delegate() command, string expectedMessage) {
+ bool didntThrow;
+ try {
+ command();
+ didntThrow = true;
+ } catch (Exception e) {
+ if (e.msg != expectedMessage) {
+ throw new Exception("Failed to propagate C++ exception. Expected '" ~
+ expectedMessage ~ "', but received '" ~ e.msg ~ "'.");
+ }
+ }
+
+ if (didntThrow) {
+ throw new Exception("Failed to propagate C++ exception. Expected '" ~
+ expectedMessage ~ "', but no exception was thrown.");
+ }
+}
diff --git a/Examples/test-suite/d/char_strings_runme.1.d b/Examples/test-suite/d/char_strings_runme.1.d
new file mode 100644
index 0000000..cde6fe0
--- /dev/null
+++ b/Examples/test-suite/d/char_strings_runme.1.d
@@ -0,0 +1,151 @@
+module char_strings_runme;
+
+import tango.text.convert.Integer;
+import char_strings.char_strings;
+
+const char[] CPLUSPLUS_MSG = "A message from the deep dark world of C++, where anything is possible.";
+const char[] OTHERLAND_MSG = "Little message from the safe world.";
+
+void main() {
+ const uint count = 10000;
+ uint i = 0;
+
+ // get functions
+ for (i=0; i<count; i++) {
+ char[] str = GetCharHeapString();
+ if (str != CPLUSPLUS_MSG)
+ throw new Exception("Test char get 1 failed, iteration " ~ toString(i));
+ DeleteCharHeapString();
+ }
+
+ for (i=0; i<count; i++) {
+ char[] str = GetConstCharProgramCodeString();
+ if (str != CPLUSPLUS_MSG)
+ throw new Exception("Test char get 2 failed, iteration " ~ toString(i));
+ DeleteCharHeapString();
+ }
+
+ for (i=0; i<count; i++) {
+ char[] str = GetCharStaticString();
+ if (str != CPLUSPLUS_MSG)
+ throw new Exception("Test char get 3 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ char[] str = GetCharStaticStringFixed();
+ if (str != CPLUSPLUS_MSG)
+ throw new Exception("Test char get 4 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ char[] str = GetConstCharStaticStringFixed();
+ if (str != CPLUSPLUS_MSG)
+ throw new Exception("Test char get 5 failed, iteration " ~ toString(i));
+ }
+
+ // set functions
+ for (i=0; i<count; i++) {
+ if (!SetCharHeapString(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char set 1 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetCharStaticString(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char set 2 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetCharArrayStaticString(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char set 3 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetConstCharHeapString(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char set 4 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetConstCharStaticString(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char set 5 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetConstCharArrayStaticString(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char set 6 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetCharConstStaticString(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char set 7 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetConstCharConstStaticString(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char set 8 failed, iteration " ~ toString(i));
+ }
+
+ // get set function
+ for (i=0; i<count*10; i++) {
+ char[] ping = OTHERLAND_MSG ~ toString(i);
+ char[] pong = CharPingPong(ping);
+ if (ping != pong)
+ throw new Exception("Test PingPong 1 failed.\nExpected:" ~ ping ~ "\nReceived:" ~ pong);
+ }
+
+ // variables
+ for (i=0; i<count; i++) {
+ global_char = OTHERLAND_MSG ~ toString(i);
+ if (global_char != OTHERLAND_MSG ~ toString(i))
+ throw new Exception("Test variables 1 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ global_char_array1 = OTHERLAND_MSG ~ toString(i);
+ if (global_char_array1 != OTHERLAND_MSG ~ toString(i))
+ throw new Exception("Test variables 2 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ global_char_array2 = OTHERLAND_MSG ~ toString(i);
+ if (global_char_array2 != OTHERLAND_MSG ~ toString(i))
+ throw new Exception("Test variables 3 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (global_const_char != CPLUSPLUS_MSG)
+ throw new Exception("Test variables 4 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (global_const_char_array1 != CPLUSPLUS_MSG)
+ throw new Exception("Test variables 5 failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (global_const_char_array2 != CPLUSPLUS_MSG)
+ throw new Exception("Test variables 6 failed, iteration " ~ toString(i));
+ }
+
+ // char *& tests
+ for (i=0; i<count; i++) {
+ char[] str = GetCharPointerRef();
+ if (str != CPLUSPLUS_MSG)
+ throw new Exception("Test char pointer ref get failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetCharPointerRef(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test char pointer ref set failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ char[] str = GetConstCharPointerRef();
+ if (str != CPLUSPLUS_MSG)
+ throw new Exception("Test const char pointer ref get failed, iteration " ~ toString(i));
+ }
+
+ for (i=0; i<count; i++) {
+ if (!SetConstCharPointerRef(OTHERLAND_MSG ~ toString(i), i))
+ throw new Exception("Test const char pointer ref set failed, iteration " ~ toString(i));
+ }
+}
diff --git a/Examples/test-suite/d/char_strings_runme.2.d b/Examples/test-suite/d/char_strings_runme.2.d
new file mode 100644
index 0000000..5fe28e9
--- /dev/null
+++ b/Examples/test-suite/d/char_strings_runme.2.d
@@ -0,0 +1,123 @@
+module char_strings_runme;
+
+import std.conv;
+import std.exception;
+import std.range;
+import char_strings.char_strings;
+
+enum CPLUSPLUS_MSG = "A message from the deep dark world of C++, where anything is possible.";
+enum OTHERLAND_MSG = "Little message from the safe world.";
+enum TEST_RANGE = iota(0, 10000);
+
+void main() {
+ // get functions