24
25
<li><a href="Preface.html#Preface_nn10">Credits</a>
25
26
<li><a href="Preface.html#Preface_nn11">Bug reports</a>
29
31
<h3><a href="Introduction.html#Introduction">2 Introduction</a></h3>
34
<div class="sectiontoc">
33
36
<li><a href="Introduction.html#Introduction_nn2">What is SWIG?</a>
34
37
<li><a href="Introduction.html#Introduction_nn3">Why use SWIG?</a>
46
49
<li><a href="Introduction.html#Introduction_nn12">Hands off code generation</a>
47
50
<li><a href="Introduction.html#Introduction_nn13">SWIG and freedom</a>
51
55
<h3><a href="Windows.html#Windows">3 Getting started on Windows </a></h3>
58
<div class="sectiontoc">
55
60
<li><a href="Windows.html#Windows_nn2">Installation on Windows</a>
80
85
<li><a href="Windows.html#examples_cygwin">Running the examples on Windows using Cygwin</a>
85
91
<h3><a href="Scripting.html#Scripting">4 Scripting Languages</a></h3>
94
<div class="sectiontoc">
89
96
<li><a href="Scripting.html#Scripting_nn2">The two language view of the world</a>
90
97
<li><a href="Scripting.html#Scripting_nn3">How does a scripting language talk to C?</a>
140
149
<li><a href="SWIG.html#SWIG_nn24">Linking to structure variables</a>
141
150
<li><a href="SWIG.html#SWIG_nn25">Linking to <tt>char *</tt></a>
142
151
<li><a href="SWIG.html#SWIG_nn26">Arrays</a>
143
<li><a href="SWIG.html#SWIG_nn27">Creating read-only variables</a>
152
<li><a href="SWIG.html#SWIG_readonly_variables">Creating read-only variables</a>
144
153
<li><a href="SWIG.html#SWIG_nn28">Renaming and ignoring declarations</a>
145
154
<li><a href="SWIG.html#SWIG_default_args">Default/optional arguments</a>
146
155
<li><a href="SWIG.html#SWIG_nn30">Pointers to functions and callbacks</a>
152
161
<li><a href="SWIG.html#SWIG_nn34">Array members</a>
153
162
<li><a href="SWIG.html#SWIG_nn35">Structure data members</a>
154
163
<li><a href="SWIG.html#SWIG_nn36">C constructors and destructors </a>
155
<li><a href="SWIG.html#SWIG_nn37">Adding member functions to C structures</a>
164
<li><a href="SWIG.html#SWIG_adding_member_functions">Adding member functions to C structures</a>
156
165
<li><a href="SWIG.html#SWIG_nn38">Nested structures</a>
157
166
<li><a href="SWIG.html#SWIG_nn39">Other things to note about structure wrapping</a>
172
181
<li><a href="SWIG.html#SWIG_nn50">What to do with main()</a>
177
187
<h3><a href="SWIGPlus.html#SWIGPlus">6 SWIG and C++</a></h3>
190
<div class="sectiontoc">
181
192
<li><a href="SWIGPlus.html#SWIGPlus_nn2">Comments on C++ Wrapping</a>
182
193
<li><a href="SWIGPlus.html#SWIGPlus_nn3">Approach</a>
212
223
<li><a href="SWIGPlus.html#SWIGPlus_nn29">Class extension</a>
213
224
<li><a href="SWIGPlus.html#SWIGPlus_nn30">Templates</a>
214
225
<li><a href="SWIGPlus.html#SWIGPlus_nn31">Namespaces</a>
215
<li><a href="SWIGPlus.html#SWIGPlus_nn32">Exception specifiers</a>
226
<li><a href="SWIGPlus.html#SWIGPlus_exception_specifications">Exception specifications</a>
216
227
<li><a href="SWIGPlus.html#SWIGPlus_nn33">Pointers to Members</a>
217
228
<li><a href="SWIGPlus.html#SWIGPlus_nn34">Smart pointers and operator->()</a>
218
229
<li><a href="SWIGPlus.html#SWIGPlus_nn35">Using declarations and inheritance</a>
227
238
<li><a href="SWIGPlus.html#SWIGPlus_nn42">Where to go for more information</a>
231
243
<h3><a href="Preprocessor.html#Preprocessor">7 Preprocessing</a></h3>
246
<div class="sectiontoc">
235
248
<li><a href="Preprocessor.html#Preprocessor_nn2">File inclusion</a>
236
249
<li><a href="Preprocessor.html#Preprocessor_nn3">File imports</a>
242
255
<li><a href="Preprocessor.html#Preprocessor_nn9">Preprocessing and { ... }</a>
243
256
<li><a href="Preprocessor.html#Preprocessor_nn10">Viewing preprocessor output</a>
247
261
<h3><a href="Library.html#Library">8 SWIG library</a></h3>
264
<div class="sectiontoc">
251
266
<li><a href="Library.html#Library_nn2">The %include directive and library search path</a>
252
267
<li><a href="Library.html#Library_nn3">C Arrays and Pointers</a>
263
278
<li><a href="Library.html#Library_nn11">Using %newobject to release memory</a>
264
279
<li><a href="Library.html#Library_nn12">cstring.i</a>
266
<li><a href="Library.html#Library_nn13">C++ Library</a>
281
<li><a href="Library.html#Library_stl_cpp_library">STL/C++ Library</a>
268
283
<li><a href="Library.html#Library_nn14">std_string.i</a>
269
284
<li><a href="Library.html#Library_nn15">std_vector.i</a>
285
<li><a href="Library.html#Library_stl_exceptions">STL exceptions</a>
271
287
<li><a href="Library.html#Library_nn16">Utility Libraries</a>
273
289
<li><a href="Library.html#Library_nn17">exception.i</a>
278
295
<h3><a href="Arguments.html#Arguments">9 Argument Handling</a></h3>
298
<div class="sectiontoc">
282
300
<li><a href="Arguments.html#Arguments_nn2">The typemaps.i library</a>
356
376
<li><a href="Typemaps.html#Typemaps_nn42">Multi-argument typemaps</a>
357
377
<li><a href="Typemaps.html#runtime_type_checker">The run-time type checker</a>
379
<li><a href="Typemaps.html#Typemaps_nn45">Implementation</a>
380
<li><a href="Typemaps.html#Typemaps_nn46">Usage</a>
358
382
<li><a href="Typemaps.html#Typemaps_overloading">Typemaps and overloading</a>
359
<li><a href="Typemaps.html#Typemaps_nn45">More about <tt>%apply</tt> and <tt>%clear</tt></a>
360
<li><a href="Typemaps.html#Typemaps_nn46">Reducing wrapper code size</a>
383
<li><a href="Typemaps.html#Typemaps_nn48">More about <tt>%apply</tt> and <tt>%clear</tt></a>
384
<li><a href="Typemaps.html#Typemaps_nn49">Reducing wrapper code size</a>
361
385
<li><a href="Typemaps.html#Typemaps_nn47">Passing data between typemaps</a>
362
<li><a href="Typemaps.html#Typemaps_nn48">Where to go for more information?</a>
386
<li><a href="Typemaps.html#Typemaps_nn51">Where to go for more information?</a>
366
391
<h3><a href="Customization.html#Customization">11 Customization Features</a></h3>
394
<div class="sectiontoc">
370
396
<li><a href="Customization.html#exception">Exception handling with %exception</a>
378
404
<li><a href="Customization.html#ownership">Object ownership and %newobject</a>
379
405
<li><a href="Customization.html#features">Features and the %feature directive</a>
407
<li><a href="Customization.html#Customization_feature_flags">Feature flags</a>
408
<li><a href="Customization.html#Customization_clearing_features">Clearing features</a>
381
409
<li><a href="Customization.html#Customization_features_default_args">Features and default arguments</a>
382
410
<li><a href="Customization.html#features_example">Feature example</a>
387
416
<h3><a href="Contract.html#Contract">12 Contracts</a></h3>
419
<div class="sectiontoc">
391
421
<li><a href="Contract.html#Contract_nn2">The %contract directive</a>
392
422
<li><a href="Contract.html#Contract_nn3">%contract and classes</a>
393
423
<li><a href="Contract.html#Contract_nn4">Constant aggregation and %aggregate_check</a>
394
424
<li><a href="Contract.html#Contract_nn5">Notes</a>
398
429
<h3><a href="Varargs.html#Varargs">13 Variable Length Arguments</a></h3>
432
<div class="sectiontoc">
402
434
<li><a href="Varargs.html#Varargs_nn2">Introduction</a>
403
435
<li><a href="Varargs.html#Varargs_nn3">The Problem</a>
409
441
<li><a href="Varargs.html#Varargs_nn9">C++ Issues</a>
410
442
<li><a href="Varargs.html#Varargs_nn10">Discussion</a>
414
447
<h3><a href="Warnings.html#Warnings">14 Warning Messages</a></h3>
450
<div class="sectiontoc">
418
452
<li><a href="Warnings.html#Warnings_nn2">Introduction</a>
419
453
<li><a href="Warnings.html#Warnings_nn3">Warning message suppression</a>
435
469
<li><a href="Warnings.html#Warnings_nn17">History</a>
439
474
<h3><a href="Modules.html#Modules">15 Working with Modules</a></h3>
477
<div class="sectiontoc">
443
479
<li><a href="Modules.html#Modules_nn2">The SWIG runtime code</a>
444
<li><a href="Modules.html#Modules_nn3">A word of caution about static libraries</a>
445
<li><a href="Modules.html#Modules_nn4">References</a>
446
<li><a href="Modules.html#Modules_nn5">Reducing the wrapper file size</a>
480
<li><a href="Modules.html#external_run_time">External access to the runtime</a>
481
<li><a href="Modules.html#Modules_nn4">A word of caution about static libraries</a>
482
<li><a href="Modules.html#Modules_nn5">References</a>
483
<li><a href="Modules.html#Modules_nn6">Reducing the wrapper file size</a>
450
488
<h3><a href="CSharp.html#CSharp">16 SWIG and C#</a></h3>
491
<div class="sectiontoc">
493
<li><a href="CSharp.html#csharp_introduction">Introduction</a>
494
<li><a href="CSharp.html#csharp_differences_java">Differences to the Java module</a>
495
<li><a href="CSharp.html#csharp_exceptions">C# Exceptions</a>
497
<li><a href="CSharp.html#csharp_exception_example_check_typemap">C# exception example using "check" typemap</a>
498
<li><a href="CSharp.html#csharp_exception_example_percent_exception">C# exception example using %exception</a>
499
<li><a href="CSharp.html#csharp_exception_example_exception_specifications">C# exception example using exception specifications</a>
500
<li><a href="CSharp.html#csharp_custom_application_exception">Custom C# ApplicationException example</a>
455
506
<h3><a href="Chicken.html#Chicken">17 SWIG and Chicken</a></h3>
509
<div class="sectiontoc">
459
511
<li><a href="Chicken.html#Chicken_nn2">Preliminaries</a>
467
519
<li><a href="Chicken.html#Chicken_nn7">Modules</a>
468
520
<li><a href="Chicken.html#Chicken_nn8">Constants and Variables</a>
469
521
<li><a href="Chicken.html#Chicken_nn9">Functions</a>
522
<li><a href="Chicken.html#Chicken_nn10">Exceptions</a>
471
<li><a href="Chicken.html#Chicken_nn10">TinyCLOS</a>
472
<li><a href="Chicken.html#Chicken_nn11">Compilation</a>
524
<li><a href="Chicken.html#Chicken_nn11">TinyCLOS</a>
473
525
<li><a href="Chicken.html#Chicken_nn12">Linkage</a>
475
<li><a href="Chicken.html#Chicken_nn13">Shared library</a>
476
<li><a href="Chicken.html#Chicken_nn14">Static binary</a>
478
<li><a href="Chicken.html#Chicken_nn15">Typemaps</a>
479
<li><a href="Chicken.html#Chicken_nn16">Pointers</a>
480
<li><a href="Chicken.html#Chicken_nn17">Unsupported features and known problems</a>
527
<li><a href="Chicken.html#Chicken_nn13">Static binary or shared library linked at compile time</a>
528
<li><a href="Chicken.html#Chicken_nn14">Building chicken extension libraries</a>
529
<li><a href="Chicken.html#Chicken_nn15">Linking multiple SWIG modules with TinyCLOS</a>
531
<li><a href="Chicken.html#Chicken_nn16">Typemaps</a>
532
<li><a href="Chicken.html#Chicken_nn17">Pointers</a>
534
<li><a href="Chicken.html#collection">Garbage collection</a>
536
<li><a href="Chicken.html#Chicken_nn18">Unsupported features and known problems</a>
484
541
<h3><a href="Guile.html#Guile">18 SWIG and Guile</a></h3>
544
<div class="sectiontoc">
488
546
<li><a href="Guile.html#Guile_nn2">Meaning of "Module"</a>
489
547
<li><a href="Guile.html#Guile_nn3">Using the SCM or GH Guile API</a>
630
690
<li><a href="Java.html#adding_downcasts">Adding Java downcasts to polymorphic return types</a>
631
691
<li><a href="Java.html#adding_equals_method">Adding an equals method to the Java classes</a>
632
692
<li><a href="Java.html#void_pointers">Void pointers and a common Java base class</a>
693
<li><a href="Java.html#struct_pointer_pointer">Struct pointer to pointer</a>
634
695
<li><a href="Java.html#java_directors_faq">Living with Java Directors</a>
635
696
<li><a href="Java.html#odds_ends">Odds and ends</a>
681
744
<li><a href="Modula3.html#remarks">Remarks</a>
685
749
<h3><a href="Mzscheme.html#Mzscheme">21 SWIG and MzScheme</a></h3>
752
<div class="sectiontoc">
689
754
<li><a href="Mzscheme.html#MzScheme_nn2">Creating native MzScheme structures</a>
693
759
<h3><a href="Ocaml.html#Ocaml">22 SWIG and Ocaml</a></h3>
762
<div class="sectiontoc">
697
764
<li><a href="Ocaml.html#Ocaml_nn2">Preliminaries</a>
801
870
<li><a href="Perl5.html#Perl5_nn46">Modifying the proxy methods</a>
806
876
<h3><a href="Php.html#Php">24 SWIG and PHP4</a></h3>
810
<li><a href="Php.html#Php_nn2">Preliminaries</a>
811
<li><a href="Php.html#Php_nn3">Building PHP4 Extensions</a>
813
<li><a href="Php.html#Php_nn4">Building a loadable extension</a>
814
<li><a href="Php.html#Php_nn5">Basic PHP4 interface</a>
815
<li><a href="Php.html#Php_nn6">Functions</a>
816
<li><a href="Php.html#Php_nn7">Global Variables</a>
817
<li><a href="Php.html#Php_nn8">Pointers </a>
818
<li><a href="Php.html#Php_nn9">Structures and C++ classes</a>
819
<li><a href="Php.html#Php_nn10">Constants</a>
820
<li><a href="Php.html#Php_nn11">Proxy classes</a>
821
<li><a href="Php.html#Php_nn12">Constructors and Destructers</a>
822
<li><a href="Php.html#Php_nn13">Static Member Variables</a>
823
<li><a href="Php.html#Php_nn14">PHP4 Pragmas</a>
824
<li><a href="Php.html#Php_nn15">Building extensions into php</a>
825
<li><a href="Php.html#Php_nn16">To be furthered...</a>
879
<div class="sectiontoc">
881
<li><a href="Php.html#Php_nn1">Generating PHP4 Extensions</a>
883
<li><a href="Php.html#Php_nn1_1">Building a loadable extension</a>
884
<li><a href="Php.html#Php_nn1_2">Building extensions into PHP</a>
885
<li><a href="Php.html#Php_nn1_3">Using PHP4 Extensions</a>
887
<li><a href="Php.html#Php_nn2">Basic PHP4 interface</a>
889
<li><a href="Php.html#Php_nn2_1">Constants</a>
890
<li><a href="Php.html#Php_nn2_2">Global Variables</a>
891
<li><a href="Php.html#Php_nn2_3">Functions</a>
892
<li><a href="Php.html#Php_nn2_4">Overloading</a>
893
<li><a href="Php.html#Php_nn2_5">Pointers and References</a>
894
<li><a href="Php.html#Php_nn2_6">Structures and C++ classes</a>
896
<li><a href="Php.html#Php_nn2_6_1">Using <tt>-noproxy</tt></a>
897
<li><a href="Php.html#Php_nn2_6_2">Constructors and Destructors</a>
898
<li><a href="Php.html#Php_nn2_6_3">Static Member Variables</a>
899
<li><a href="Php.html#Php_nn2_6_4">Static Member Functions</a>
901
<li><a href="Php.html#Php_nn2_7">PHP4 Pragmas, Startup and Shutdown code</a>
830
907
<h3><a href="Pike.html#Pike">25 SWIG and Pike</a></h3>
910
<div class="sectiontoc">
834
912
<li><a href="Pike.html#Pike_nn2">Preliminaries</a>
882
962
<li><a href="Python.html#Python_nn25">C++ namespaces</a>
883
963
<li><a href="Python.html#Python_nn26">C++ templates</a>
884
964
<li><a href="Python.html#Python_nn27">C++ Smart Pointers</a>
965
<li><a href="Python.html#Python_nn27a">C++ Reference Counted Objects (ref/unref)</a>
886
967
<li><a href="Python.html#Python_nn28">Further details on the Python class interface</a>
889
970
<li><a href="Python.html#Python_nn30">Memory management</a>
890
971
<li><a href="Python.html#Python_nn31">Python 2.2 and classic classes</a>
892
<li><a href="Python.html#directors">Cross language polymorphism (experimental)</a>
973
<li><a href="Python.html#directors">Cross language polymorphism</a>
894
975
<li><a href="Python.html#Python_nn33">Enabling directors</a>
895
976
<li><a href="Python.html#Python_nn34">Director classes</a>
987
1070
<li><a href="Ruby.html#Ruby_nn27">Input and output parameters</a>
988
<li><a href="Ruby.html#Ruby_nn28">Simple exception handling </a>
989
1071
<li><a href="Ruby.html#Ruby_nn29">Typemaps</a>
991
1073
<li><a href="Ruby.html#Ruby_nn30">What is a typemap?</a>
1017
1099
<li><a href="Ruby.html#Ruby_nn48">Defining Aliases</a>
1018
1100
<li><a href="Ruby.html#Ruby_nn49">Predicate Methods</a>
1019
1101
<li><a href="Ruby.html#Ruby_nn50">Specifying Mixin Modules</a>
1020
<li><a href="Ruby.html#Ruby_nn51">Interacting with Ruby's Garbage Collector</a>
1103
<li><a href="Ruby.html#Ruby_nn51">Memory Management</a>
1105
<li><a href="Ruby.html#Ruby_nn53">Object Ownership</a>
1106
<li><a href="Ruby.html#Ruby_nn54">Object Tracking</a>
1107
<li><a href="Ruby.html#Ruby_nn55">Mark Functions</a>
1108
<li><a href="Ruby.html#Ruby_nn56">Free Functions</a>
1025
1114
<h3><a href="Tcl.html#Tcl">28 SWIG and Tcl</a></h3>
1117
<div class="sectiontoc">
1029
1119
<li><a href="Tcl.html#Tcl_nn2">Preliminaries</a>
1083
1173
<li><a href="Tcl.html#Tcl_nn45">Proxy classes</a>
1088
<h3><a href="Extending.html#Extending">29 Extending SWIG</a></h3>
1179
<h3><a href="Lua.html#Lua">29 SWIG and Lua</a></h3>
1182
<div class="sectiontoc">
1184
<li><a href="Lua.html#Lua_nn2">Preliminaries</a>
1185
<li><a href="Lua.html#Lua_nn3">Running SWIG</a>
1187
<li><a href="Lua.html#Lua_nn4">Compiling and Linking and Interpreter</a>
1188
<li><a href="Lua.html#Lua_nn5">Compiling a dynamic module</a>
1189
<li><a href="Lua.html#Lua_nn6">Using your module</a>
1191
<li><a href="Lua.html#Lua_nn7">A tour of basic C/C++ wrapping</a>
1193
<li><a href="Lua.html#Lua_nn8">Modules</a>
1194
<li><a href="Lua.html#Lua_nn9">Functions</a>
1195
<li><a href="Lua.html#Lua_nn10">Global variables</a>
1196
<li><a href="Lua.html#Lua_nn11">Constants and enums</a>
1197
<li><a href="Lua.html#Lua_nn12">Pointers</a>
1198
<li><a href="Lua.html#Lua_nn13">Structures</a>
1199
<li><a href="Lua.html#Lua_nn14">C++ classes</a>
1200
<li><a href="Lua.html#Lua_nn15">C++ inheritance</a>
1201
<li><a href="Lua.html#Lua_nn16">Pointers, references, values, and arrays</a>
1202
<li><a href="Lua.html#Lua_nn17">C++ overloaded functions</a>
1203
<li><a href="Lua.html#Lua_nn18">C++ operators</a>
1204
<li><a href="Lua.html#Lua_nn19">Class extension with %extend</a>
1205
<li><a href="Lua.html#Lua_nn20">C++ templates</a>
1206
<li><a href="Lua.html#Lua_nn21">C++ Smart Pointers</a>
1208
<li><a href="Lua.html#Lua_nn22">Details on the Lua binding</a>
1210
<li><a href="Lua.html#Lua_nn23">Binding global data into the module.</a>
1211
<li><a href="Lua.html#Lua_nn24">Userdata and Metatables</a>
1212
<li><a href="Lua.html#Lua_nn25">Memory management</a>
1218
<h3><a href="Extending.html#Extending">30 Extending SWIG</a></h3>
1221
<div class="sectiontoc">
1092
1223
<li><a href="Extending.html#Extending_nn2">Introduction</a>
1093
1224
<li><a href="Extending.html#Extending_nn3">Prerequisites</a>