mirror of https://github.com/swig/swig
Put the chapters back in order after erroneously incorrectly reordering them in last checkin
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10294 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9d4fe6576d
commit
c99fe90574
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<H1><a name="Allegrocl_nn1"></a>1 SWIG and Allegro Common Lisp</H1>
|
||||
<H1><a name="Allegrocl_nn1"></a>16 SWIG and Allegro Common Lisp</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -135,10 +135,10 @@ be unhappy to see some enterprising folk use this work to add
|
|||
to it.
|
||||
</p>
|
||||
|
||||
<H2><a name="Allegrocl_nn2"></a>1.1 Basics</H2>
|
||||
<H2><a name="Allegrocl_nn2"></a>16.1 Basics</H2>
|
||||
|
||||
|
||||
<H3><a name="Allegrocl_nn3"></a>1.1.1 Running Swig</H3>
|
||||
<H3><a name="Allegrocl_nn3"></a>16.1.1 Running Swig</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -360,7 +360,7 @@ need to link in the Allegro shared library. The library you create from
|
|||
the C++ wrapper will be what you then load into Allegro CL.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn4"></a>1.1.2 Command Line Options</H3>
|
||||
<H3><a name="Allegrocl_nn4"></a>16.1.2 Command Line Options</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -396,7 +396,7 @@ See <a href="#Allegrocl_nn47">Section 17.5 Identifier converter
|
|||
functions</a> for more details.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn5"></a>1.1.3 Inserting user code into generated files</H3>
|
||||
<H3><a name="Allegrocl_nn5"></a>16.1.3 Inserting user code into generated files</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -436,7 +436,7 @@ Note that the block <tt>%{ ... %}</tt> is effectively a shortcut for
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Allegrocl_nn6"></a>1.2 Wrapping Overview</H2>
|
||||
<H2><a name="Allegrocl_nn6"></a>16.2 Wrapping Overview</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -446,7 +446,7 @@ New users to SWIG are encouraged to read
|
|||
interested in generating an interface to C++.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn7"></a>1.2.1 Function Wrapping</H3>
|
||||
<H3><a name="Allegrocl_nn7"></a>16.2.1 Function Wrapping</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -499,7 +499,7 @@ interested in generating an interface to C++.
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Allegrocl_nn8"></a>1.2.2 Foreign Wrappers</H3>
|
||||
<H3><a name="Allegrocl_nn8"></a>16.2.2 Foreign Wrappers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -512,7 +512,7 @@ interested in generating an interface to C++.
|
|||
typemap.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn9"></a>1.2.3 FFI Wrappers</H3>
|
||||
<H3><a name="Allegrocl_nn9"></a>16.2.3 FFI Wrappers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -593,7 +593,7 @@ char *xxx();
|
|||
ff:def-foreign-call's.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn10"></a>1.2.4 Non-overloaded Defuns</H3>
|
||||
<H3><a name="Allegrocl_nn10"></a>16.2.4 Non-overloaded Defuns</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -606,7 +606,7 @@ char *xxx();
|
|||
this function can be manipulated via the <tt>lout</tt> typemap.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn11"></a>1.2.5 Overloaded Defuns</H3>
|
||||
<H3><a name="Allegrocl_nn11"></a>16.2.5 Overloaded Defuns</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -622,7 +622,7 @@ char *xxx();
|
|||
can be manipulated via the <tt>lout</tt> typemap.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn12"></a>1.2.6 What about constant and variable access?</H3>
|
||||
<H3><a name="Allegrocl_nn12"></a>16.2.6 What about constant and variable access?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -635,7 +635,7 @@ char *xxx();
|
|||
into the foreign module.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn13"></a>1.2.7 Object Wrapping</H3>
|
||||
<H3><a name="Allegrocl_nn13"></a>16.2.7 Object Wrapping</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -657,7 +657,7 @@ char *xxx();
|
|||
foreign function interface.
|
||||
</p>
|
||||
|
||||
<H2><a name="Allegrocl_nn14"></a>1.3 Wrapping Details</H2>
|
||||
<H2><a name="Allegrocl_nn14"></a>16.3 Wrapping Details</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -665,7 +665,7 @@ char *xxx();
|
|||
translated into lisp.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn15"></a>1.3.1 Namespaces</H3>
|
||||
<H3><a name="Allegrocl_nn15"></a>16.3.1 Namespaces</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -742,7 +742,7 @@ namespace car {
|
|||
function such as <tt>(car '(1 2 3)</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn16"></a>1.3.2 Constants</H3>
|
||||
<H3><a name="Allegrocl_nn16"></a>16.3.2 Constants</H3>
|
||||
|
||||
|
||||
|
||||
|
@ -803,7 +803,7 @@ namespace car {
|
|||
not use the <tt>-nocwrap</tt> command-line option.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn17"></a>1.3.3 Variables</H3>
|
||||
<H3><a name="Allegrocl_nn17"></a>16.3.3 Variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -881,7 +881,7 @@ globalvar> (globalvar.nnn::glob_float)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Allegrocl_nn18"></a>1.3.4 Enumerations</H3>
|
||||
<H3><a name="Allegrocl_nn18"></a>16.3.4 Enumerations</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -957,7 +957,7 @@ EXPORT const int ACL_ENUM___FOO3__SWIG_0 = FOO3;
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Allegrocl_nn19"></a>1.3.5 Arrays</H3>
|
||||
<H3><a name="Allegrocl_nn19"></a>16.3.5 Arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1105,10 +1105,10 @@ namespace BAR {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Allegrocl_nn20"></a>1.3.6 Classes and Structs and Unions (oh my!)</H3>
|
||||
<H3><a name="Allegrocl_nn20"></a>16.3.6 Classes and Structs and Unions (oh my!)</H3>
|
||||
|
||||
|
||||
<H4><a name="Allegrocl_nn21"></a>1.3.6.1 CLOS wrapping of</H4>
|
||||
<H4><a name="Allegrocl_nn21"></a>16.3.6.1 CLOS wrapping of</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1123,7 +1123,7 @@ namespace BAR {
|
|||
integer values.
|
||||
</p>
|
||||
|
||||
<H4><a name="Allegrocl_nn22"></a>1.3.6.2 CLOS Inheritance</H4>
|
||||
<H4><a name="Allegrocl_nn22"></a>16.3.6.2 CLOS Inheritance</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1136,7 +1136,7 @@ namespace BAR {
|
|||
parameter.
|
||||
</p>
|
||||
|
||||
<H4><a name="Allegrocl_nn23"></a>1.3.6.3 Member fields and functions</H4>
|
||||
<H4><a name="Allegrocl_nn23"></a>16.3.6.3 Member fields and functions</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1152,7 +1152,7 @@ namespace BAR {
|
|||
the interface does nothing for <tt>friend</tt> directives,
|
||||
</p>
|
||||
|
||||
<H4><a name="Allegrocl_nn24"></a>1.3.6.4 Why not directly access C++ classes using foreign types?</H4>
|
||||
<H4><a name="Allegrocl_nn24"></a>16.3.6.4 Why not directly access C++ classes using foreign types?</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1170,11 +1170,11 @@ namespace BAR {
|
|||
use the more robust wrapper functions.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn25"></a>1.3.7 Templates</H3>
|
||||
<H3><a name="Allegrocl_nn25"></a>16.3.7 Templates</H3>
|
||||
|
||||
|
||||
|
||||
<H4><a name="Allegrocl_nn26"></a>1.3.7.1 Generating wrapper code for templates</H4>
|
||||
<H4><a name="Allegrocl_nn26"></a>16.3.7.1 Generating wrapper code for templates</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1187,7 +1187,7 @@ namespace BAR {
|
|||
directive.
|
||||
</p>
|
||||
|
||||
<H4><a name="Allegrocl_nn27"></a>1.3.7.2 Implicit Template instantiation</H4>
|
||||
<H4><a name="Allegrocl_nn27"></a>16.3.7.2 Implicit Template instantiation</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1197,7 +1197,7 @@ namespace BAR {
|
|||
class schema.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn28"></a>1.3.8 Typedef, Templates, and Synonym Types</H3>
|
||||
<H3><a name="Allegrocl_nn28"></a>16.3.8 Typedef, Templates, and Synonym Types</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1277,7 +1277,7 @@ synonym>
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="Allegrocl_nn29"></a>1.3.8.1 Choosing a primary type</H4>
|
||||
<H4><a name="Allegrocl_nn29"></a>16.3.8.1 Choosing a primary type</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1298,7 +1298,7 @@ synonym>
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<H3><a name="Allegrocl_nn30"></a>1.3.9 Function overloading/Parameter defaulting</H3>
|
||||
<H3><a name="Allegrocl_nn30"></a>16.3.9 Function overloading/Parameter defaulting</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1461,7 +1461,7 @@ overload>
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Allegrocl_nn31"></a>1.3.10 Operator wrapping and Operator overloading</H3>
|
||||
<H3><a name="Allegrocl_nn31"></a>16.3.10 Operator wrapping and Operator overloading</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1607,7 +1607,7 @@ opoverload>
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Allegrocl_nn32"></a>1.3.11 Varargs</H3>
|
||||
<H3><a name="Allegrocl_nn32"></a>16.3.11 Varargs</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1628,7 +1628,7 @@ opoverload>
|
|||
with other ways such functions can be wrapped.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn33"></a>1.3.12 C++ Exceptions</H3>
|
||||
<H3><a name="Allegrocl_nn33"></a>16.3.12 C++ Exceptions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1640,7 +1640,7 @@ opoverload>
|
|||
implemented.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn34"></a>1.3.13 Pass by value, pass by reference</H3>
|
||||
<H3><a name="Allegrocl_nn34"></a>16.3.13 Pass by value, pass by reference</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1652,7 +1652,7 @@ opoverload>
|
|||
newly defined types.
|
||||
</p>
|
||||
|
||||
<H2><a name="Allegrocl_nn35"></a>1.4 Typemaps</H2>
|
||||
<H2><a name="Allegrocl_nn35"></a>16.4 Typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1663,7 +1663,7 @@ opoverload>
|
|||
on <a href="Typemaps.html#Typemaps">Typemaps</a> for more information.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn36"></a>1.4.1 Code Generation in the C++ Wrapper</H3>
|
||||
<H3><a name="Allegrocl_nn36"></a>16.4.1 Code Generation in the C++ Wrapper</H3>
|
||||
|
||||
|
||||
|
||||
|
@ -1693,7 +1693,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="Allegrocl_nn37"></a>1.4.1.1 IN Typemap</H4>
|
||||
<H4><a name="Allegrocl_nn37"></a>16.4.1.1 IN Typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1728,7 +1728,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="Allegrocl_nn38"></a>1.4.1.2 OUT Typemap</H4>
|
||||
<H4><a name="Allegrocl_nn38"></a>16.4.1.2 OUT Typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1752,7 +1752,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="Allegrocl_nn39"></a>1.4.1.3 CTYPE Typemap</H4>
|
||||
<H4><a name="Allegrocl_nn39"></a>16.4.1.3 CTYPE Typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1784,7 +1784,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
these <a href="Typemaps.html#Typemaps_nn25">common typemaps</a> here.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn40"></a>1.4.2 Code generation in Lisp wrappers</H3>
|
||||
<H3><a name="Allegrocl_nn40"></a>16.4.2 Code generation in Lisp wrappers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1803,7 +1803,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
<a href="#Allegrocl_nn15">16.3.1 Namespaces</a> for details.
|
||||
</p>
|
||||
|
||||
<H4><a name="Allegrocl_nn41"></a>1.4.2.1 LIN Typemap</H4>
|
||||
<H4><a name="Allegrocl_nn41"></a>16.4.2.1 LIN Typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1846,7 +1846,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="Allegrocl_nn42"></a>1.4.2.2 LOUT Typemap</H4>
|
||||
<H4><a name="Allegrocl_nn42"></a>16.4.2.2 LOUT Typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1889,7 +1889,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="Allegrocl_nn43"></a>1.4.2.3 FFITYPE Typemap</H4>
|
||||
<H4><a name="Allegrocl_nn43"></a>16.4.2.3 FFITYPE Typemap</H4>
|
||||
|
||||
|
||||
|
||||
|
@ -1939,7 +1939,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="Allegrocl_nn44"></a>1.4.2.4 LISPTYPE Typemap</H4>
|
||||
<H4><a name="Allegrocl_nn44"></a>16.4.2.4 LISPTYPE Typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1959,7 +1959,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="Allegrocl_nn45"></a>1.4.2.5 LISPCLASS Typemap</H4>
|
||||
<H4><a name="Allegrocl_nn45"></a>16.4.2.5 LISPCLASS Typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1983,7 +1983,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Allegrocl_nn46"></a>1.4.3 Modifying SWIG behavior using typemaps</H3>
|
||||
<H3><a name="Allegrocl_nn46"></a>16.4.3 Modifying SWIG behavior using typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2017,10 +2017,10 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Allegrocl_nn47"></a>1.5 Identifier Converter functions</H2>
|
||||
<H2><a name="Allegrocl_nn47"></a>16.5 Identifier Converter functions</H2>
|
||||
|
||||
|
||||
<H3><a name="Allegrocl_nn48"></a>1.5.1 Creating symbols in the lisp environment</H3>
|
||||
<H3><a name="Allegrocl_nn48"></a>16.5.1 Creating symbols in the lisp environment</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2041,11 +2041,11 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
of arguments.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn49"></a>1.5.2 Existing identifier-converter functions</H3>
|
||||
<H3><a name="Allegrocl_nn49"></a>16.5.2 Existing identifier-converter functions</H3>
|
||||
|
||||
|
||||
<p>Two basic identifier routines have been defined.
|
||||
<H4><a name="Allegrocl_nn50"></a>1.5.2.1 identifier-convert-null</H4>
|
||||
<H4><a name="Allegrocl_nn50"></a>16.5.2.1 identifier-convert-null</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2054,7 +2054,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
strings, from which a symbol will be created.
|
||||
</p>
|
||||
|
||||
<H4><a name="Allegrocl_nn51"></a>1.5.2.2 identifier-convert-lispify</H4>
|
||||
<H4><a name="Allegrocl_nn51"></a>16.5.2.2 identifier-convert-lispify</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2063,7 +2063,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
same symbol transformations.
|
||||
</p>
|
||||
|
||||
<H4><a name="Allegrocl_nn52"></a>1.5.2.3 Default identifier to symbol conversions</H4>
|
||||
<H4><a name="Allegrocl_nn52"></a>16.5.2.3 Default identifier to symbol conversions</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2072,7 +2072,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
default naming conventions.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn53"></a>1.5.3 Defining your own identifier-converter</H3>
|
||||
<H3><a name="Allegrocl_nn53"></a>16.5.3 Defining your own identifier-converter</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2128,7 +2128,7 @@ indicating the number of arguments passed to the routine indicated by
|
|||
this identifier.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn54"></a>1.5.4 Instructing SWIG to use a particular identifier-converter</H3>
|
||||
<H3><a name="Allegrocl_nn54"></a>16.5.4 Instructing SWIG to use a particular identifier-converter</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Arguments"></a>2 Argument Handling</H1>
|
||||
<H1><a name="Arguments"></a>9 Argument Handling</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -44,7 +44,7 @@ return multiple values through the arguments of a function. This chapter
|
|||
describes some of the techniques for doing this.
|
||||
</p>
|
||||
|
||||
<H2><a name="Arguments_nn2"></a>2.1 The typemaps.i library</H2>
|
||||
<H2><a name="Arguments_nn2"></a>9.1 The typemaps.i library</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -52,7 +52,7 @@ This section describes the <tt>typemaps.i</tt> library file--commonly used to
|
|||
change certain properties of argument conversion.
|
||||
</p>
|
||||
|
||||
<H3><a name="Arguments_nn3"></a>2.1.1 Introduction</H3>
|
||||
<H3><a name="Arguments_nn3"></a>9.1.1 Introduction</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -196,7 +196,7 @@ else. To clear a typemap, the <tt>%clear</tt> directive should be used. For e
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Arguments_nn4"></a>2.1.2 Input parameters</H3>
|
||||
<H3><a name="Arguments_nn4"></a>9.1.2 Input parameters</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -249,7 +249,7 @@ When the function is used in the scripting language interpreter, it will work li
|
|||
result = add(3,4)
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Arguments_nn5"></a>2.1.3 Output parameters</H3>
|
||||
<H3><a name="Arguments_nn5"></a>9.1.3 Output parameters</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -316,7 +316,7 @@ iresult, dresult = foo(3.5, 2)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Arguments_nn6"></a>2.1.4 Input/Output parameters</H3>
|
||||
<H3><a name="Arguments_nn6"></a>9.1.4 Input/Output parameters</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -381,7 +381,7 @@ rather than directly overwriting the value of the original input object.
|
|||
SWIG. Backwards compatibility is preserved, but deprecated.
|
||||
</p>
|
||||
|
||||
<H3><a name="Arguments_nn7"></a>2.1.5 Using different names</H3>
|
||||
<H3><a name="Arguments_nn7"></a>9.1.5 Using different names</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -415,7 +415,7 @@ Typemap declarations are lexically scoped so a typemap takes effect from the poi
|
|||
file or a matching <tt>%clear</tt> declaration.
|
||||
</p>
|
||||
|
||||
<H2><a name="Arguments_nn8"></a>2.2 Applying constraints to input values</H2>
|
||||
<H2><a name="Arguments_nn8"></a>9.2 Applying constraints to input values</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -425,7 +425,7 @@ insure that a value is positive, or that a pointer is non-NULL. This
|
|||
can be accomplished including the <tt>constraints.i</tt> library file.
|
||||
</p>
|
||||
|
||||
<H3><a name="Arguments_nn9"></a>2.2.1 Simple constraint example</H3>
|
||||
<H3><a name="Arguments_nn9"></a>9.2.1 Simple constraint example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -451,7 +451,7 @@ the arguments violate the constraint condition, a scripting language
|
|||
exception will be raised. As a result, it is possible to catch bad
|
||||
values, prevent mysterious program crashes and so on.</p>
|
||||
|
||||
<H3><a name="Arguments_nn10"></a>2.2.2 Constraint methods</H3>
|
||||
<H3><a name="Arguments_nn10"></a>9.2.2 Constraint methods</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -467,7 +467,7 @@ NONNULL Non-NULL pointer (pointers only).
|
|||
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Arguments_nn11"></a>2.2.3 Applying constraints to new datatypes</H3>
|
||||
<H3><a name="Arguments_nn11"></a>9.2.3 Applying constraints to new datatypes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF">
|
||||
<H1><a name="CSharp"></a>5 SWIG and C#</H1>
|
||||
<H1><a name="CSharp"></a>17 SWIG and C#</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="csharp_introduction"></a>5.1 Introduction</H2>
|
||||
<H2><a name="csharp_introduction"></a>17.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -59,7 +59,7 @@ The <a href="http://msdn.microsoft.com">Microsoft Developer Network (MSDN)</a> h
|
|||
Monodoc, available from the Mono project, has a very useful section titled <a href="http://www.mono-project.com/Interop_with_Native_Libraries">Interop with native libraries</a>.
|
||||
</p>
|
||||
|
||||
<H2><a name="csharp_differences_java"></a>5.2 Differences to the Java module</H2>
|
||||
<H2><a name="csharp_differences_java"></a>17.2 Differences to the Java module</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -397,7 +397,7 @@ Windows users can also get the examples working using a
|
|||
<a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> environment for automatic configuration of the example makefiles.
|
||||
Any one of the three C# compilers (Portable.NET, Mono or Microsoft) can be detected from within a Cygwin or Mingw environment if installed in your path.
|
||||
|
||||
<H2><a name="csharp_exceptions"></a>5.3 C# Exceptions</H2>
|
||||
<H2><a name="csharp_exceptions"></a>17.3 C# Exceptions</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -494,7 +494,7 @@ set so should only be used when a C# exception is not created.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="csharp_exception_example_check_typemap"></a>5.3.1 C# exception example using "check" typemap</H3>
|
||||
<H3><a name="csharp_exception_example_check_typemap"></a>17.3.1 C# exception example using "check" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -676,7 +676,7 @@ method and C# code does not handle pending exceptions via the canthrow attribute
|
|||
Actually it will issue this warning for any function beginning with <tt>SWIG_CSharpSetPendingException</tt>.
|
||||
</P>
|
||||
|
||||
<H3><a name="csharp_exception_example_percent_exception"></a>5.3.2 C# exception example using %exception</H3>
|
||||
<H3><a name="csharp_exception_example_percent_exception"></a>17.3.2 C# exception example using %exception</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -741,7 +741,7 @@ The managed code generated does check for the pending exception as mentioned ear
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="csharp_exception_example_exception_specifications"></a>5.3.3 C# exception example using exception specifications</H3>
|
||||
<H3><a name="csharp_exception_example_exception_specifications"></a>17.3.3 C# exception example using exception specifications</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -798,7 +798,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_evensonly(int jarg1) {
|
|||
Multiple catch handlers are generated should there be more than one exception specifications declared.
|
||||
</p>
|
||||
|
||||
<H3><a name="csharp_custom_application_exception"></a>5.3.4 Custom C# ApplicationException example</H3>
|
||||
<H3><a name="csharp_custom_application_exception"></a>17.3.4 Custom C# ApplicationException example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -932,7 +932,7 @@ try {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="csharp_directors"></a>5.4 C# Directors</H2>
|
||||
<H2><a name="csharp_directors"></a>17.4 C# Directors</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -945,7 +945,7 @@ The following sections provide information on the C# director implementation and
|
|||
However, the <a href="Java.html#java_directors">Java directors</a> section should also be read in order to gain more insight into directors.
|
||||
</p>
|
||||
|
||||
<H3><a name="csharp_directors_example"></a>5.4.1 Directors example</H3>
|
||||
<H3><a name="csharp_directors_example"></a>17.4.1 Directors example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1066,7 +1066,7 @@ CSharpDerived - UIntMethod(123)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="csharp_directors_implementation"></a>5.4.2 Directors implementation</H3>
|
||||
<H3><a name="csharp_directors_implementation"></a>17.4.2 Directors implementation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1252,7 +1252,7 @@ void SwigDirector_Base::BaseBoolMethod(Base const &b, bool flag) {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="csharp_director_caveats"></a>5.4.3 Director caveats</H3>
|
||||
<H3><a name="csharp_director_caveats"></a>17.4.3 Director caveats</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1300,7 +1300,7 @@ However, a call from C# to <tt>CSharpDefaults.DefaultMethod()</tt> will of cours
|
|||
should pass the call on to <tt>CSharpDefaults.DefaultMethod(int)</tt>using the C++ default value, as shown above.
|
||||
</p>
|
||||
|
||||
<H2><a name="csharp_typemap_examples"></a>5.5 C# Typemap examples</H2>
|
||||
<H2><a name="csharp_typemap_examples"></a>17.5 C# Typemap examples</H2>
|
||||
|
||||
|
||||
This section includes a few examples of typemaps. For more examples, you
|
||||
|
@ -1308,7 +1308,7 @@ might look at the files "<tt>csharp.swg</tt>" and "<tt>typemaps.i</tt>" in
|
|||
the SWIG library.
|
||||
|
||||
|
||||
<H3><a name="csharp_memory_management_member_variables"></a>5.5.1 Memory management when returning references to member variables</H3>
|
||||
<H3><a name="csharp_memory_management_member_variables"></a>17.5.1 Memory management when returning references to member variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1432,7 +1432,7 @@ public class Bike : IDisposable {
|
|||
Note the <tt>addReference</tt> call.
|
||||
</p>
|
||||
|
||||
<H3><a name="csharp_memory_management_objects"></a>5.5.2 Memory management for objects passed to the C++ layer</H3>
|
||||
<H3><a name="csharp_memory_management_objects"></a>17.5.2 Memory management for objects passed to the C++ layer</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1551,7 +1551,7 @@ The 'cscode' typemap simply adds in the specified code into the C# proxy class.
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="csharp_date_marshalling"></a>5.5.3 Date marshalling using the csin typemap and associated attributes</H3>
|
||||
<H3><a name="csharp_date_marshalling"></a>17.5.3 Date marshalling using the csin typemap and associated attributes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1788,7 +1788,7 @@ public class example {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="csharp_date_properties"></a>5.5.4 A date example demonstrating marshalling of C# properties</H3>
|
||||
<H3><a name="csharp_date_properties"></a>17.5.4 A date example demonstrating marshalling of C# properties</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1888,7 +1888,7 @@ Some points to note:
|
|||
</ul>
|
||||
|
||||
|
||||
<H3><a name="csharp_partial_classes"></a>5.5.5 Turning wrapped classes into partial classes</H3>
|
||||
<H3><a name="csharp_partial_classes"></a>17.5.5 Turning wrapped classes into partial classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1988,7 +1988,7 @@ demonstrating that the class contains methods calling both unmanaged code - <tt>
|
|||
The following example is an alternative approach to adding managed code to the generated proxy class.
|
||||
</p>
|
||||
|
||||
<H3><a name="csharp_extending_proxy_class"></a>5.5.6 Extending proxy classes with additional C# code</H3>
|
||||
<H3><a name="csharp_extending_proxy_class"></a>17.5.6 Extending proxy classes with additional C# code</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<H1><a name="Chicken"></a>3 SWIG and Chicken</H1>
|
||||
<H1><a name="Chicken"></a>18 SWIG and Chicken</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -72,7 +72,7 @@
|
|||
|
||||
</p>
|
||||
|
||||
<H2><a name="Chicken_nn2"></a>3.1 Preliminaries</H2>
|
||||
<H2><a name="Chicken_nn2"></a>18.1 Preliminaries</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -90,7 +90,7 @@
|
|||
CHICKEN.
|
||||
</p>
|
||||
|
||||
<H3><a name="Chicken_nn3"></a>3.1.1 Running SWIG in C mode</H3>
|
||||
<H3><a name="Chicken_nn3"></a>18.1.1 Running SWIG in C mode</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -123,7 +123,7 @@
|
|||
object files and linked into your project.
|
||||
</p>
|
||||
|
||||
<H3><a name="Chicken_nn4"></a>3.1.2 Running SWIG in C++ mode</H3>
|
||||
<H3><a name="Chicken_nn4"></a>18.1.2 Running SWIG in C++ mode</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -152,10 +152,10 @@
|
|||
object files and linked into your project.
|
||||
</p>
|
||||
|
||||
<H2><a name="Chicken_nn5"></a>3.2 Code Generation</H2>
|
||||
<H2><a name="Chicken_nn5"></a>18.2 Code Generation</H2>
|
||||
|
||||
|
||||
<H3><a name="Chicken_nn6"></a>3.2.1 Naming Conventions</H3>
|
||||
<H3><a name="Chicken_nn6"></a>18.2.1 Naming Conventions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -171,7 +171,7 @@
|
|||
<tt>%rename</tt> SWIG directive in the SWIG interface file.
|
||||
</p>
|
||||
|
||||
<H3><a name="Chicken_nn7"></a>3.2.2 Modules</H3>
|
||||
<H3><a name="Chicken_nn7"></a>18.2.2 Modules</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -193,7 +193,7 @@
|
|||
(uses <i>modulename</i>))</code> CHICKEN Scheme form.
|
||||
</p>
|
||||
|
||||
<H3><a name="Chicken_nn8"></a>3.2.3 Constants and Variables</H3>
|
||||
<H3><a name="Chicken_nn8"></a>18.2.3 Constants and Variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -230,7 +230,7 @@
|
|||
for info on how to apply the %feature.
|
||||
</p>
|
||||
|
||||
<H3><a name="Chicken_nn9"></a>3.2.4 Functions</H3>
|
||||
<H3><a name="Chicken_nn9"></a>18.2.4 Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -249,7 +249,7 @@
|
|||
parameters). The return values can then be accessed with <code>(call-with-values)</code>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Chicken_nn10"></a>3.2.5 Exceptions</H3>
|
||||
<H3><a name="Chicken_nn10"></a>18.2.5 Exceptions</H3>
|
||||
|
||||
|
||||
<p>The SWIG chicken module has support for exceptions thrown from
|
||||
|
@ -291,7 +291,7 @@
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H2><a name="Chicken_nn11"></a>3.3 TinyCLOS</H2>
|
||||
<H2><a name="Chicken_nn11"></a>18.3 TinyCLOS</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -334,7 +334,7 @@
|
|||
|
||||
</p>
|
||||
|
||||
<H2><a name="Chicken_nn12"></a>3.4 Linkage</H2>
|
||||
<H2><a name="Chicken_nn12"></a>18.4 Linkage</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -355,7 +355,7 @@
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Chicken_nn13"></a>3.4.1 Static binary or shared library linked at compile time</H3>
|
||||
<H3><a name="Chicken_nn13"></a>18.4.1 Static binary or shared library linked at compile time</H3>
|
||||
|
||||
|
||||
<p>We can easily use csc to build a static binary.</p>
|
||||
|
@ -396,7 +396,7 @@ in which case the test script does not need to be linked with example.so. The t
|
|||
be run with <tt>csi</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Chicken_nn14"></a>3.4.2 Building chicken extension libraries</H3>
|
||||
<H3><a name="Chicken_nn14"></a>18.4.2 Building chicken extension libraries</H3>
|
||||
|
||||
|
||||
<p>Building a shared library like in the above section only works if the library
|
||||
|
@ -454,7 +454,7 @@ distributed and used by anyone, even if SWIG is not installed.</p>
|
|||
<p>See the <tt>Examples/chicken/egg</tt> directory in the SWIG source for an example that builds
|
||||
two eggs, one using the first method and one using the second method.</p>
|
||||
|
||||
<H3><a name="Chicken_nn15"></a>3.4.3 Linking multiple SWIG modules with TinyCLOS</H3>
|
||||
<H3><a name="Chicken_nn15"></a>18.4.3 Linking multiple SWIG modules with TinyCLOS</H3>
|
||||
|
||||
|
||||
<p>Linking together multiple modules that share type information using the <code>%import</code>
|
||||
|
@ -478,7 +478,7 @@ with <code>(declare (uses ...))</code>.
|
|||
To create an extension library or an egg, just create a <tt>module_load.scm</tt> file that <code>(declare (uses ...))</code>
|
||||
all the modules.</p>
|
||||
|
||||
<H2><a name="Chicken_nn16"></a>3.5 Typemaps</H2>
|
||||
<H2><a name="Chicken_nn16"></a>18.5 Typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -487,7 +487,7 @@ all the modules.</p>
|
|||
<code>Lib/chicken/chicken.swg</code>.
|
||||
</p>
|
||||
|
||||
<H2><a name="Chicken_nn17"></a>3.6 Pointers</H2>
|
||||
<H2><a name="Chicken_nn17"></a>18.6 Pointers</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -520,7 +520,7 @@ all the modules.</p>
|
|||
type. flags is either zero or SWIG_POINTER_DISOWN (see below).
|
||||
</p>
|
||||
|
||||
<H3><a name="collection"></a>3.6.1 Garbage collection</H3>
|
||||
<H3><a name="collection"></a>18.6.1 Garbage collection</H3>
|
||||
|
||||
|
||||
<p>If the owner flag passed to <code>SWIG_NewPointerObj</code> is 1, <code>NewPointerObj</code> will add a
|
||||
|
@ -551,7 +551,7 @@ all the modules.</p>
|
|||
must be called manually.
|
||||
</p>
|
||||
|
||||
<H2><a name="Chicken_nn18"></a>3.7 Unsupported features and known problems</H2>
|
||||
<H2><a name="Chicken_nn18"></a>18.7 Unsupported features and known problems</H2>
|
||||
|
||||
|
||||
<ul>
|
||||
|
@ -561,7 +561,7 @@ all the modules.</p>
|
|||
<a href="SWIGPlus.html#SWIGPlus_default_args">%feature(compactdefaultargs)</a>.</li>
|
||||
</ul>
|
||||
|
||||
<H3><a name="Chicken_nn19"></a>3.7.1 TinyCLOS problems with Chicken version <= 1.92</H3>
|
||||
<H3><a name="Chicken_nn19"></a>18.7.1 TinyCLOS problems with Chicken version <= 1.92</H3>
|
||||
|
||||
|
||||
<p>In Chicken versions equal to or below 1.92, TinyCLOS has a limitation such that generic methods do not properly work on methods
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Contract"></a>4 Contracts</H1>
|
||||
<H1><a name="Contract"></a>12 Contracts</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -38,7 +38,7 @@ When one of the rules is violated by a script, a runtime exception is
|
|||
generated rather than having the program continue to execute.
|
||||
</p>
|
||||
|
||||
<H2><a name="Contract_nn2"></a>4.1 The %contract directive</H2>
|
||||
<H2><a name="Contract_nn2"></a>12.1 The %contract directive</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -94,7 +94,7 @@ RuntimeError: Contract violation: require: (arg1>=0)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Contract_nn3"></a>4.2 %contract and classes</H2>
|
||||
<H2><a name="Contract_nn3"></a>12.2 %contract and classes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -173,7 +173,7 @@ specified for the derived class all must hold. In the above example,
|
|||
this means that both the arguments to <tt>Spam::bar</tt> must be positive.
|
||||
</p>
|
||||
|
||||
<H2><a name="Contract_nn4"></a>4.3 Constant aggregation and %aggregate_check</H2>
|
||||
<H2><a name="Contract_nn4"></a>12.3 Constant aggregation and %aggregate_check</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -262,7 +262,7 @@ Regrettably, there is no automatic way to perform similar checks with enums valu
|
|||
release.
|
||||
</p>
|
||||
|
||||
<H2><a name="Contract_nn5"></a>4.4 Notes</H2>
|
||||
<H2><a name="Contract_nn5"></a>12.4 Notes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Customization"></a>6 Customization Features</H1>
|
||||
<H1><a name="Customization"></a>11 Customization Features</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -45,7 +45,7 @@ of exception handling is presented. Then, a more general-purpose
|
|||
customization mechanism known as "features" is described.
|
||||
</p>
|
||||
|
||||
<H2><a name="exception"></a>6.1 Exception handling with %exception</H2>
|
||||
<H2><a name="exception"></a>11.1 Exception handling with %exception</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -85,7 +85,7 @@ for exception handling. That directive is deprecated--<tt>%exception</tt>
|
|||
provides the same functionality, but is substantially more flexible.
|
||||
</p>
|
||||
|
||||
<H3><a name="Customization_nn3"></a>6.1.1 Handling exceptions in C code</H3>
|
||||
<H3><a name="Customization_nn3"></a>11.1.1 Handling exceptions in C code</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -151,7 +151,7 @@ Each target language has its own approach to creating a runtime error/exception
|
|||
and for Perl it is the <tt>croak</tt> method shown above.
|
||||
</p>
|
||||
|
||||
<H3><a name="Customization_nn4"></a>6.1.2 Exception handling with longjmp()</H3>
|
||||
<H3><a name="Customization_nn4"></a>11.1.2 Exception handling with longjmp()</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -225,7 +225,7 @@ Note: This implementation is only intended to illustrate the general idea. To m
|
|||
modify it to handle nested <tt>try</tt> declarations.
|
||||
</p>
|
||||
|
||||
<H3><a name="Customization_nn5"></a>6.1.3 Handling C++ exceptions</H3>
|
||||
<H3><a name="Customization_nn5"></a>11.1.3 Handling C++ exceptions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -260,7 +260,7 @@ class OutOfMemory {};
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Customization_allowexcept"></a>6.1.4 Exception handlers for variables</H3>
|
||||
<H3><a name="Customization_allowexcept"></a>11.1.4 Exception handlers for variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -285,7 +285,7 @@ The <tt>%allowexception</tt> feature works like any other feature and so can be
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Customization_nn6"></a>6.1.5 Defining different exception handlers</H3>
|
||||
<H3><a name="Customization_nn6"></a>11.1.5 Defining different exception handlers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -422,7 +422,7 @@ declarations. However, it never really worked that well and the new
|
|||
%exception directive is much better.
|
||||
</p>
|
||||
|
||||
<H3><a name="Customization_exception_special_variables"></a>6.1.6 Special variables for %exception</H3>
|
||||
<H3><a name="Customization_exception_special_variables"></a>11.1.6 Special variables for %exception</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -510,7 +510,7 @@ Below shows the expansions for the 1st of the overloaded <tt>something</tt> wrap
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="Customization_nn7"></a>6.1.7 Using The SWIG exception library</H3>
|
||||
<H3><a name="Customization_nn7"></a>11.1.7 Using The SWIG exception library</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -567,7 +567,7 @@ it can be used elsewhere in SWIG. This includes typemaps and helper
|
|||
functions.
|
||||
</p>
|
||||
|
||||
<H2><a name="ownership"></a>6.2 Object ownership and %newobject</H2>
|
||||
<H2><a name="ownership"></a>11.2 Object ownership and %newobject</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -719,7 +719,7 @@ char *strdup(const char *s);
|
|||
The results might not be what you expect.
|
||||
</p>
|
||||
|
||||
<H2><a name="features"></a>6.3 Features and the %feature directive</H2>
|
||||
<H2><a name="features"></a>11.3 Features and the %feature directive</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -801,7 +801,7 @@ The following are all equivalent:
|
|||
The syntax in the first variation will generate the <tt>{ }</tt> delimiters used whereas the other variations will not.
|
||||
</p>
|
||||
|
||||
<H3><a name="Customization_feature_attributes"></a>6.3.1 Feature attributes</H3>
|
||||
<H3><a name="Customization_feature_attributes"></a>11.3.1 Feature attributes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -842,7 +842,7 @@ In the following example, <tt>MyExceptionClass</tt> is the name of the Java clas
|
|||
Further details can be obtained from the <a href="Java.html#exception_handling">Java exception handling</a> section.
|
||||
</p>
|
||||
|
||||
<H3><a name="Customization_feature_flags"></a>6.3.2 Feature flags</H3>
|
||||
<H3><a name="Customization_feature_flags"></a>11.3.2 Feature flags</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -940,7 +940,7 @@ in the <tt>swig.swg</tt> Library file. The following shows the alternative synta
|
|||
The concept of clearing features is discussed next.
|
||||
</p>
|
||||
|
||||
<H3><a name="Customization_clearing_features"></a>6.3.3 Clearing features</H3>
|
||||
<H3><a name="Customization_clearing_features"></a>11.3.3 Clearing features</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1019,7 +1019,7 @@ but this will:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Customization_features_default_args"></a>6.3.4 Features and default arguments</H3>
|
||||
<H3><a name="Customization_features_default_args"></a>11.3.4 Features and default arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1094,7 +1094,7 @@ specifying or not specifying default arguments in a feature is not applicable as
|
|||
in SWIG-1.3.23 when the approach to wrapping methods with default arguments was changed.
|
||||
</p>
|
||||
|
||||
<H3><a name="features_example"></a>6.3.5 Feature example</H3>
|
||||
<H3><a name="features_example"></a>11.3.5 Feature example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Extending"></a>7 Extending SWIG to support new languages</H1>
|
||||
<H1><a name="Extending"></a>34 Extending SWIG to support new languages</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -73,7 +73,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="Extending_nn2"></a>7.1 Introduction</H2>
|
||||
<H2><a name="Extending_nn2"></a>34.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -89,7 +89,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>7.2 Prerequisites</H2>
|
||||
<H2><a name="Extending_nn3"></a>34.2 Prerequisites</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -119,7 +119,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>7.3 The Big Picture</H2>
|
||||
<H2><a name="Extending_nn4"></a>34.3 The Big Picture</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -156,7 +156,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>7.4 Execution Model</H2>
|
||||
<H2><a name="Extending_nn5"></a>34.4 Execution Model</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -201,7 +201,7 @@ latter stage of compilation.
|
|||
The next few sections briefly describe some of these stages.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn6"></a>7.4.1 Preprocessing</H3>
|
||||
<H3><a name="Extending_nn6"></a>34.4.1 Preprocessing</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -281,7 +281,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>7.4.2 Parsing</H3>
|
||||
<H3><a name="Extending_nn7"></a>34.4.2 Parsing</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -382,7 +382,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>7.4.3 Parse Trees</H3>
|
||||
<H3><a name="Extending_nn8"></a>34.4.3 Parse Trees</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -636,7 +636,7 @@ $ swig -c++ -python -debug-module 4 example.i
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn9"></a>7.4.4 Attribute namespaces</H3>
|
||||
<H3><a name="Extending_nn9"></a>34.4.4 Attribute namespaces</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -655,7 +655,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>7.4.5 Symbol Tables</H3>
|
||||
<H3><a name="Extending_nn10"></a>34.4.5 Symbol Tables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -746,7 +746,7 @@ example.i:5. Previous declaration is foo_i(int )
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn11"></a>7.4.6 The %feature directive</H3>
|
||||
<H3><a name="Extending_nn11"></a>34.4.6 The %feature directive</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -802,7 +802,7 @@ For example, the exception code above is simply
|
|||
stored without any modifications.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn12"></a>7.4.7 Code Generation</H3>
|
||||
<H3><a name="Extending_nn12"></a>34.4.7 Code Generation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -924,7 +924,7 @@ public :
|
|||
The role of these functions is described shortly.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn13"></a>7.4.8 SWIG and XML</H3>
|
||||
<H3><a name="Extending_nn13"></a>34.4.8 SWIG and XML</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -937,7 +937,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>7.5 Primitive Data Structures</H2>
|
||||
<H2><a name="Extending_nn14"></a>34.5 Primitive Data Structures</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -983,7 +983,7 @@ typedef Hash Typetab;
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn15"></a>7.5.1 Strings</H3>
|
||||
<H3><a name="Extending_nn15"></a>34.5.1 Strings</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1124,7 +1124,7 @@ Returns the number of replacements made (if any).
|
|||
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn16"></a>7.5.2 Hashes</H3>
|
||||
<H3><a name="Extending_nn16"></a>34.5.2 Hashes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1201,7 +1201,7 @@ Returns the list of hash table keys.
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn17"></a>7.5.3 Lists</H3>
|
||||
<H3><a name="Extending_nn17"></a>34.5.3 Lists</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1290,7 +1290,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>7.5.4 Common operations</H3>
|
||||
<H3><a name="Extending_nn18"></a>34.5.4 Common operations</H3>
|
||||
|
||||
|
||||
The following operations are applicable to all datatypes.
|
||||
|
@ -1345,7 +1345,7 @@ objects and report errors.
|
|||
Gets the line number associated with <tt>x</tt>.
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn19"></a>7.5.5 Iterating over Lists and Hashes</H3>
|
||||
<H3><a name="Extending_nn19"></a>34.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:
|
||||
|
@ -1390,7 +1390,7 @@ for (j = First(j); j.item; j= Next(j)) {
|
|||
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn20"></a>7.5.6 I/O</H3>
|
||||
<H3><a name="Extending_nn20"></a>34.5.6 I/O</H3>
|
||||
|
||||
|
||||
Special I/O functions are used for all internal I/O. These operations
|
||||
|
@ -1526,7 +1526,7 @@ Similarly, the preprocessor and parser all operate on string-files.
|
|||
|
||||
</div>
|
||||
|
||||
<H2><a name="Extending_nn21"></a>7.6 Navigating and manipulating parse trees</H2>
|
||||
<H2><a name="Extending_nn21"></a>34.6 Navigating and manipulating parse trees</H2>
|
||||
|
||||
|
||||
Parse trees are built as collections of hash tables. Each node is a hash table in which
|
||||
|
@ -1660,7 +1660,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>7.7 Working with attributes</H2>
|
||||
<H2><a name="Extending_nn22"></a>34.7 Working with attributes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1777,7 +1777,7 @@ the attribute is optional. <tt>Swig_restore()</tt> must always be called after
|
|||
function.
|
||||
</div>
|
||||
|
||||
<H2><a name="Extending_nn23"></a>7.8 Type system</H2>
|
||||
<H2><a name="Extending_nn23"></a>34.8 Type system</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1786,7 +1786,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>7.8.1 String encoding of types</H3>
|
||||
<H3><a name="Extending_nn24"></a>34.8.1 String encoding of types</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1887,7 +1887,7 @@ make the final type, the two parts are just joined together using
|
|||
string concatenation.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn25"></a>7.8.2 Type construction</H3>
|
||||
<H3><a name="Extending_nn25"></a>34.8.2 Type construction</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2056,7 +2056,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>7.8.3 Type tests</H3>
|
||||
<H3><a name="Extending_nn26"></a>34.8.3 Type tests</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2143,7 +2143,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>7.8.4 Typedef and inheritance</H3>
|
||||
<H3><a name="Extending_nn27"></a>34.8.4 Typedef and inheritance</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2245,7 +2245,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>7.8.5 Lvalues</H3>
|
||||
<H3><a name="Extending_nn28"></a>34.8.5 Lvalues</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2282,7 +2282,7 @@ Literal y; // type = 'Literal', ltype='p.char'
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn29"></a>7.8.6 Output functions</H3>
|
||||
<H3><a name="Extending_nn29"></a>34.8.6 Output functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2344,7 +2344,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>7.9 Parameters</H2>
|
||||
<H2><a name="Extending_nn30"></a>34.9 Parameters</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2443,7 +2443,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>7.10 Writing a Language Module</H2>
|
||||
<H2><a name="Extending_nn31"></a>34.10 Writing a Language Module</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2458,7 +2458,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>7.10.1 Execution model</H3>
|
||||
<H3><a name="Extending_nn32"></a>34.10.1 Execution model</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2468,7 +2468,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_nn33"></a>7.10.2 Starting out</H3>
|
||||
<H3><a name="Extending_nn33"></a>34.10.2 Starting out</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2576,7 +2576,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>7.10.3 Command line options</H3>
|
||||
<H3><a name="Extending_nn34"></a>34.10.3 Command line options</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2635,7 +2635,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>7.10.4 Configuration and preprocessing</H3>
|
||||
<H3><a name="Extending_nn35"></a>34.10.4 Configuration and preprocessing</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2684,7 +2684,7 @@ an implementation file <tt>python.cxx</tt> and a configuration file
|
|||
<tt>python.swg</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn36"></a>7.10.5 Entry point to code generation</H3>
|
||||
<H3><a name="Extending_nn36"></a>34.10.5 Entry point to code generation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2742,7 +2742,7 @@ int Python::top(Node *n) {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn37"></a>7.10.6 Module I/O and wrapper skeleton</H3>
|
||||
<H3><a name="Extending_nn37"></a>34.10.6 Module I/O and wrapper skeleton</H3>
|
||||
|
||||
|
||||
<!-- please report bugs in this section to mgossage -->
|
||||
|
@ -2884,7 +2884,7 @@ functionWrapper : void Shape_y_set(Shape *self,double y)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn38"></a>7.10.7 Low-level code generators</H3>
|
||||
<H3><a name="Extending_nn38"></a>34.10.7 Low-level code generators</H3>
|
||||
|
||||
|
||||
<!-- please report bugs in this section to mgossage -->
|
||||
|
@ -3038,7 +3038,7 @@ but without the typemaps, there is still work to do.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn39"></a>7.10.8 Configuration files</H3>
|
||||
<H3><a name="Extending_nn39"></a>34.10.8 Configuration files</H3>
|
||||
|
||||
|
||||
<!-- please report bugs in this section to ttn -->
|
||||
|
@ -3188,7 +3188,7 @@ politely displays the ignoring language message.
|
|||
</dl>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn40"></a>7.10.9 Runtime support</H3>
|
||||
<H3><a name="Extending_nn40"></a>34.10.9 Runtime support</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3197,7 +3197,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>7.10.10 Standard library files</H3>
|
||||
<H3><a name="Extending_nn41"></a>34.10.10 Standard library files</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3216,7 +3216,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>7.10.11 Examples and test cases</H3>
|
||||
<H3><a name="Extending_nn42"></a>34.10.11 Examples and test cases</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3245,7 +3245,7 @@ during this process, see the section on <a href="#n37a">configuration
|
|||
files</a>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn43"></a>7.10.12 Documentation</H3>
|
||||
<H3><a name="Extending_nn43"></a>34.10.12 Documentation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3277,7 +3277,7 @@ Some topics that you'll want to be sure to address include:
|
|||
if available.
|
||||
</ul>
|
||||
|
||||
<H3><a name="Extending_prerequisites"></a>7.10.13 Prerequisites for adding a new language module to the SWIG distribution</H3>
|
||||
<H3><a name="Extending_prerequisites"></a>34.10.13 Prerequisites for adding a new language module to the SWIG distribution</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3334,7 +3334,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>7.10.14 Coding style guidelines</H3>
|
||||
<H3><a name="Extending_coding_style_guidelines"></a>34.10.14 Coding style guidelines</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3358,13 +3358,13 @@ 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_nn44"></a>7.11 Typemaps</H2>
|
||||
<H2><a name="Extending_nn44"></a>34.11 Typemaps</H2>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn45"></a>7.11.1 Proxy classes</H3>
|
||||
<H3><a name="Extending_nn45"></a>34.11.1 Proxy classes</H3>
|
||||
|
||||
|
||||
<H2><a name="Extending_nn46"></a>7.12 Guide to parse tree nodes</H2>
|
||||
<H2><a name="Extending_nn46"></a>34.12 Guide to parse tree nodes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<H1><a name="Guile"></a>8 SWIG and Guile</H1>
|
||||
<H1><a name="Guile"></a>19 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>8.1 Meaning of "Module"</H2>
|
||||
<H2><a name="Guile_nn2"></a>19.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>8.2 Using the SCM or GH Guile API</H2>
|
||||
<H2><a name="Guile_nn3"></a>19.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>8.3 Linkage</H2>
|
||||
<H2><a name="Guile_nn4"></a>19.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>8.3.1 Simple Linkage</H3>
|
||||
<H3><a name="Guile_nn5"></a>19.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>8.3.2 Passive Linkage</H3>
|
||||
<H3><a name="Guile_nn6"></a>19.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>8.3.3 Native Guile Module Linkage</H3>
|
||||
<H3><a name="Guile_nn7"></a>19.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>8.3.4 Old Auto-Loading Guile Module Linkage</H3>
|
||||
<H3><a name="Guile_nn8"></a>19.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>8.3.5 Hobbit4D Linkage</H3>
|
||||
<H3><a name="Guile_nn9"></a>19.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>8.4 Underscore Folding</H2>
|
||||
<H2><a name="Guile_nn10"></a>19.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>8.5 Typemaps</H2>
|
||||
<H2><a name="Guile_nn11"></a>19.5 Typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -412,7 +412,7 @@ constant will appear as a scheme variable. See
|
|||
<a href="Customization.html#features">Features and the %feature directive</a>
|
||||
for info on how to apply the %feature.</p>
|
||||
|
||||
<H2><a name="Guile_nn12"></a>8.6 Representation of pointers as smobs</H2>
|
||||
<H2><a name="Guile_nn12"></a>19.6 Representation of pointers as smobs</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -433,7 +433,7 @@ representing the expected pointer type. See also
|
|||
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>8.6.1 GH Smobs</H3>
|
||||
<H3><a name="Guile_nn13"></a>19.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>8.6.2 SCM Smobs</H3>
|
||||
<H3><a name="Guile_nn14"></a>19.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>8.6.3 Garbage Collection</H3>
|
||||
<H3><a name="Guile_nn15"></a>19.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#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>8.7 Exception Handling</H2>
|
||||
<H2><a name="Guile_nn16"></a>19.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>8.8 Procedure documentation</H2>
|
||||
<H2><a name="Guile_nn17"></a>19.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>8.9 Procedures with setters</H2>
|
||||
<H2><a name="Guile_nn18"></a>19.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>8.10 GOOPS Proxy Classes</H2>
|
||||
<H2><a name="Guile_nn19"></a>19.10 GOOPS Proxy Classes</H2>
|
||||
|
||||
|
||||
<p>SWIG can also generate classes and generic functions for use with
|
||||
|
@ -730,7 +730,7 @@ Notice that <Foo> 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>8.10.1 Naming Issues</H3>
|
||||
<H3><a name="Guile_nn20"></a>19.10.1 Naming Issues</H3>
|
||||
|
||||
|
||||
<p>As you can see in the example above, there are potential naming conflicts. The default exported
|
||||
|
@ -769,7 +769,7 @@ guile-modules. For example,</p>
|
|||
|
||||
<p>TODO: Renaming class name prefixes?</p>
|
||||
|
||||
<H3><a name="Guile_nn21"></a>8.10.2 Linking</H3>
|
||||
<H3><a name="Guile_nn21"></a>19.10.2 Linking</H3>
|
||||
|
||||
|
||||
<p>The guile-modules generated above all need to be linked together. GOOPS support requires
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Introduction"></a>9 Introduction</H1>
|
||||
<H1><a name="Introduction"></a>2 Introduction</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="Introduction_nn2"></a>9.1 What is SWIG?</H2>
|
||||
<H2><a name="Introduction_nn2"></a>2.1 What is SWIG?</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -70,7 +70,7 @@ project, it is particularly well suited to software development in the
|
|||
small; especially the research and development work that is commonly found
|
||||
in scientific and engineering projects.
|
||||
|
||||
<H2><a name="Introduction_nn3"></a>9.2 Why use SWIG?</H2>
|
||||
<H2><a name="Introduction_nn3"></a>2.2 Why use SWIG?</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -142,7 +142,7 @@ it provides a wide variety of customization features that let you change almost
|
|||
every aspect of the language bindings. This is the main reason why SWIG has such a large
|
||||
user manual ;-).
|
||||
|
||||
<H2><a name="Introduction_nn4"></a>9.3 A SWIG example</H2>
|
||||
<H2><a name="Introduction_nn4"></a>2.3 A SWIG example</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -173,7 +173,7 @@ variable <tt>My_variable</tt> from Tcl. You start by making a SWIG
|
|||
interface file as shown below (by convention, these files carry a .i
|
||||
suffix) :
|
||||
|
||||
<H3><a name="Introduction_nn5"></a>9.3.1 SWIG interface file</H3>
|
||||
<H3><a name="Introduction_nn5"></a>2.3.1 SWIG interface file</H3>
|
||||
|
||||
|
||||
<div class="code"><pre>
|
||||
|
@ -198,7 +198,7 @@ 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.
|
||||
|
||||
<H3><a name="Introduction_nn6"></a>9.3.2 The swig command</H3>
|
||||
<H3><a name="Introduction_nn6"></a>2.3.2 The swig command</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -232,7 +232,7 @@ and variables declared in the SWIG interface. A look at the file
|
|||
<tt>example_wrap.c</tt> reveals a hideous mess. However, you
|
||||
almost never need to worry about it.
|
||||
|
||||
<H3><a name="Introduction_nn7"></a>9.3.3 Building a Perl5 module</H3>
|
||||
<H3><a name="Introduction_nn7"></a>2.3.3 Building a Perl5 module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -258,7 +258,7 @@ unix >
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="Introduction_nn8"></a>9.3.4 Building a Python module</H3>
|
||||
<H3><a name="Introduction_nn8"></a>2.3.4 Building a Python module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -282,7 +282,7 @@ Type "copyright", "credits" or "license" for more information.
|
|||
7.5
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Introduction_nn9"></a>9.3.5 Shortcuts</H3>
|
||||
<H3><a name="Introduction_nn9"></a>2.3.5 Shortcuts</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -308,7 +308,7 @@ print $example::My_variable + 4.5, "\n";
|
|||
7.5
|
||||
</pre></div>
|
||||
|
||||
<H2><a name="Introduction_nn10"></a>9.4 Supported C/C++ language features</H2>
|
||||
<H2><a name="Introduction_nn10"></a>2.4 Supported C/C++ language features</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -348,7 +348,7 @@ wrapping simple C++ code. In fact, SWIG is able handle C++ code that
|
|||
stresses the very limits of many C++ compilers.
|
||||
|
||||
|
||||
<H2><a name="Introduction_nn11"></a>9.5 Non-intrusive interface building</H2>
|
||||
<H2><a name="Introduction_nn11"></a>2.5 Non-intrusive interface building</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -360,7 +360,7 @@ interface and reuse the code in other applications. It is also
|
|||
possible to support different types of interfaces depending on the application.
|
||||
</p>
|
||||
|
||||
<H2><a name="Introduction_build_system"></a>9.6 Incorporating SWIG into a build system</H2>
|
||||
<H2><a name="Introduction_build_system"></a>2.6 Incorporating SWIG into a build system</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -417,7 +417,7 @@ The above example will generate native build files such as makefiles, nmake file
|
|||
which will invoke SWIG and compile the generated C++ files into _example.so (UNIX) or _example.dll (Windows).
|
||||
</p>
|
||||
|
||||
<H2><a name="Introduction_nn12"></a>9.7 Hands off code generation</H2>
|
||||
<H2><a name="Introduction_nn12"></a>2.7 Hands off code generation</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -430,7 +430,7 @@ it allows others to forget about the low-level implementation
|
|||
details.
|
||||
</p>
|
||||
|
||||
<H2><a name="Introduction_nn13"></a>9.8 SWIG and freedom</H2>
|
||||
<H2><a name="Introduction_nn13"></a>2.8 SWIG and freedom</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF">
|
||||
<H1><a name="Java"></a>10 SWIG and Java</H1>
|
||||
<H1><a name="Java"></a>20 SWIG and Java</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -151,7 +151,7 @@ It covers most SWIG features, but certain low-level details are covered in less
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="java_overview"></a>10.1 Overview</H2>
|
||||
<H2><a name="java_overview"></a>20.1 Overview</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -186,7 +186,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>10.2 Preliminaries</H2>
|
||||
<H2><a name="java_preliminaries"></a>20.2 Preliminaries</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -202,7 +202,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="running_swig"></a>10.2.1 Running SWIG</H3>
|
||||
<H3><a name="running_swig"></a>20.2.1 Running SWIG</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -255,7 +255,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>10.2.2 Additional Commandline Options</H3>
|
||||
<H3><a name="java_commandline"></a>20.2.2 Additional Commandline Options</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -292,7 +292,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="getting_right_headers"></a>10.2.3 Getting the right header files</H3>
|
||||
<H3><a name="getting_right_headers"></a>20.2.3 Getting the right header files</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -307,7 +307,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="compiling_dynamic"></a>10.2.4 Compiling a dynamic module</H3>
|
||||
<H3><a name="compiling_dynamic"></a>20.2.4 Compiling a dynamic module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -343,7 +343,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="#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="using_module"></a>10.2.5 Using your module</H3>
|
||||
<H3><a name="using_module"></a>20.2.5 Using your module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -378,7 +378,7 @@ $
|
|||
If it doesn't work have a look at the following section which discusses problems loading the shared library.
|
||||
</p>
|
||||
|
||||
<H3><a name="dynamic_linking_problems"></a>10.2.6 Dynamic linking problems</H3>
|
||||
<H3><a name="dynamic_linking_problems"></a>20.2.6 Dynamic linking problems</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -452,7 +452,7 @@ The following section also contains some C++ specific linking problems and solut
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="compilation_problems_cpp"></a>10.2.7 Compilation problems and compiling with C++</H3>
|
||||
<H3><a name="compilation_problems_cpp"></a>20.2.7 Compilation problems and compiling with C++</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -505,7 +505,7 @@ Finally make sure the version of JDK header files matches the version of Java th
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="building_windows"></a>10.2.8 Building on Windows</H3>
|
||||
<H3><a name="building_windows"></a>20.2.8 Building on Windows</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -514,7 +514,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="visual_studio"></a>10.2.8.1 Running SWIG from Visual Studio</H4>
|
||||
<H4><a name="visual_studio"></a>20.2.8.1 Running SWIG from Visual Studio</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -553,7 +553,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="#dynamic_linking_problems">Dynamic linking problems</a>.
|
||||
</p>
|
||||
|
||||
<H4><a name="nmake"></a>10.2.8.2 Using NMAKE</H4>
|
||||
<H4><a name="nmake"></a>20.2.8.2 Using NMAKE</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -612,7 +612,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>10.3 A tour of basic C/C++ wrapping</H2>
|
||||
<H2><a name="java_basic_tour"></a>20.3 A tour of basic C/C++ wrapping</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -622,7 +622,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="module_packages_classes"></a>10.3.1 Modules, packages and generated Java classes</H3>
|
||||
<H3><a name="module_packages_classes"></a>20.3.1 Modules, packages and generated Java classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -656,7 +656,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.
|
||||
|
||||
<H3><a name="functions"></a>10.3.2 Functions</H3>
|
||||
<H3><a name="functions"></a>20.3.2 Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -690,7 +690,7 @@ System.out.println(example.fact(4));
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="global_variables"></a>10.3.3 Global variables</H3>
|
||||
<H3><a name="global_variables"></a>20.3.3 Global variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -777,7 +777,7 @@ extern char *path; // Read-only (due to %immutable)
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="constants"></a>10.3.4 Constants</H3>
|
||||
<H3><a name="constants"></a>20.3.4 Constants</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -917,7 +917,7 @@ Or if you decide this practice isn't so bad and your own class implements <tt>ex
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="enumerations"></a>10.3.5 Enumerations</H3>
|
||||
<H3><a name="enumerations"></a>20.3.5 Enumerations</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -931,7 +931,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="anonymous_enums"></a>10.3.5.1 Anonymous enums</H4>
|
||||
<H4><a name="anonymous_enums"></a>20.3.5.1 Anonymous enums</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -994,7 +994,7 @@ As in the case of constants, you can access them through either the module class
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="typesafe_enums"></a>10.3.5.2 Typesafe enums</H4>
|
||||
<H4><a name="typesafe_enums"></a>20.3.5.2 Typesafe enums</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1087,7 +1087,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="proper_enums"></a>10.3.5.3 Proper Java enums</H4>
|
||||
<H4><a name="proper_enums"></a>20.3.5.3 Proper Java enums</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1140,7 +1140,7 @@ The additional support methods need not be generated if none of the enum items h
|
|||
<a href="#simpler_enum_classes">Simpler Java enums for enums without initializers</a> section.
|
||||
</p>
|
||||
|
||||
<H4><a name="typeunsafe_enums"></a>10.3.5.4 Type unsafe enums</H4>
|
||||
<H4><a name="typeunsafe_enums"></a>20.3.5.4 Type unsafe enums</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1188,7 +1188,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="simple_enums"></a>10.3.5.5 Simple enums</H4>
|
||||
<H4><a name="simple_enums"></a>20.3.5.5 Simple enums</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1207,7 +1207,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="pointers"></a>10.3.6 Pointers</H3>
|
||||
<H3><a name="pointers"></a>20.3.6 Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1295,7 +1295,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="structures"></a>10.3.7 Structures</H3>
|
||||
<H3><a name="structures"></a>20.3.7 Structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1463,7 +1463,7 @@ x.setA(3); // Modify x.a - this is the same as b.f.a
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="classes"></a>10.3.8 C++ classes</H3>
|
||||
<H3><a name="classes"></a>20.3.8 C++ classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1526,7 +1526,7 @@ int bar = Spam.getBar();
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="inheritance"></a>10.3.9 C++ inheritance</H3>
|
||||
<H3><a name="inheritance"></a>20.3.9 C++ inheritance</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1587,7 +1587,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="pointers_refs_arrays"></a>10.3.10 Pointers, references, arrays and pass by value</H3>
|
||||
<H3><a name="pointers_refs_arrays"></a>20.3.10 Pointers, references, arrays and pass by value</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1642,7 +1642,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="null_pointers"></a>10.3.10.1 Null pointers</H4>
|
||||
<H4><a name="null_pointers"></a>20.3.10.1 Null pointers</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1666,7 +1666,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="overloaded_functions"></a>10.3.11 C++ overloaded functions</H3>
|
||||
<H3><a name="overloaded_functions"></a>20.3.11 C++ overloaded functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1781,7 +1781,7 @@ void spam(unsigned short); // Ignored
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="java_default_arguments"></a>10.3.12 C++ default arguments</H3>
|
||||
<H3><a name="java_default_arguments"></a>20.3.12 C++ default arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1824,7 +1824,7 @@ Further details on default arguments and how to restore this approach are given
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="namespaces"></a>10.3.13 C++ namespaces</H3>
|
||||
<H3><a name="namespaces"></a>20.3.13 C++ namespaces</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1884,7 +1884,7 @@ symbols separate, consider wrapping them as separate SWIG modules.
|
|||
Each SWIG module can be placed into a separate package.
|
||||
</p>
|
||||
|
||||
<H3><a name="templates"></a>10.3.14 C++ templates</H3>
|
||||
<H3><a name="templates"></a>20.3.14 C++ templates</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1933,7 +1933,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="smart_pointers"></a>10.3.15 C++ Smart Pointers</H3>
|
||||
<H3><a name="smart_pointers"></a>20.3.15 C++ Smart Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2017,7 +2017,7 @@ Foo f = p.__deref__(); // Returns underlying Foo *
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="further_details"></a>10.4 Further details on the generated Java classes</H2>
|
||||
<H2><a name="further_details"></a>20.4 Further details on the generated Java classes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2032,7 +2032,7 @@ Finally enum classes are covered.
|
|||
First, the crucial intermediary JNI class is considered.
|
||||
</p>
|
||||
|
||||
<H3><a name="imclass"></a>10.4.1 The intermediary JNI class</H3>
|
||||
<H3><a name="imclass"></a>20.4.1 The intermediary JNI class</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2152,7 +2152,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="imclass_pragmas"></a>10.4.1.1 The intermediary JNI class pragmas</H4>
|
||||
<H4><a name="imclass_pragmas"></a>20.4.1.1 The intermediary JNI class pragmas</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2231,7 +2231,7 @@ For example, let's change the intermediary JNI class access to public.
|
|||
All the methods in the intermediary JNI class will then be callable outside of the package as the method modifiers are public by default.
|
||||
</p>
|
||||
|
||||
<H3><a name="java_module_class"></a>10.4.2 The Java module class</H3>
|
||||
<H3><a name="java_module_class"></a>20.4.2 The Java module class</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2262,7 +2262,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="module_class_pragmas"></a>10.4.2.1 The Java module class pragmas</H4>
|
||||
<H4><a name="module_class_pragmas"></a>20.4.2.1 The Java module class pragmas</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2313,7 +2313,7 @@ See <a href="#imclass_pragmas">The intermediary JNI class pragmas</a> section fo
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="java_proxy_classes"></a>10.4.3 Java proxy classes</H3>
|
||||
<H3><a name="java_proxy_classes"></a>20.4.3 Java proxy classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2389,7 +2389,7 @@ int y = f.spam(5, new Foo());
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H4><a name="memory_management"></a>10.4.3.1 Memory management</H4>
|
||||
<H4><a name="memory_management"></a>20.4.3.1 Memory management</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2551,7 +2551,7 @@ and
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="inheritance_mirroring"></a>10.4.3.2 Inheritance</H4>
|
||||
<H4><a name="inheritance_mirroring"></a>20.4.3.2 Inheritance</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2667,7 +2667,7 @@ However, true cross language polymorphism can be achieved using the <a href="#ja
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="proxy_classes_gc"></a>10.4.3.3 Proxy classes and garbage collection</H4>
|
||||
<H4><a name="proxy_classes_gc"></a>20.4.3.3 Proxy classes and garbage collection</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2750,7 +2750,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>10.4.3.4 The premature garbage collection prevention parameter for proxy class marshalling</H4>
|
||||
<H4><a name="java_pgcpp"></a>20.4.3.4 The premature garbage collection prevention parameter for proxy class marshalling</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2868,7 +2868,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>10.4.3.5 Single threaded applications and thread safety</H4>
|
||||
<H4><a name="java_multithread_libraries"></a>20.4.3.5 Single threaded applications and thread safety</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2956,7 +2956,7 @@ for (int i=0; i<100000; i++) {
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="type_wrapper_classes"></a>10.4.4 Type wrapper classes</H3>
|
||||
<H3><a name="type_wrapper_classes"></a>20.4.4 Type wrapper classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3043,7 +3043,7 @@ public static void spam(SWIGTYPE_p_int x, SWIGTYPE_p_int y, int z) { ... }
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="enum_classes"></a>10.4.5 Enum classes</H3>
|
||||
<H3><a name="enum_classes"></a>20.4.5 Enum classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3052,7 +3052,7 @@ The <a href="#enumerations">Enumerations</a> section discussed these but omitted
|
|||
The following sub-sections detail the various types of enum classes that can be generated.
|
||||
</p>
|
||||
|
||||
<H4><a name="typesafe_enums_classes"></a>10.4.5.1 Typesafe enum classes</H4>
|
||||
<H4><a name="typesafe_enums_classes"></a>20.4.5.1 Typesafe enum classes</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3136,7 +3136,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="proper_enums_classes"></a>10.4.5.2 Proper Java enum classes</H4>
|
||||
<H4><a name="proper_enums_classes"></a>20.4.5.2 Proper Java enum classes</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3214,7 +3214,7 @@ These needn't be generated if the enum being wrapped does not have any initializ
|
|||
<a href="#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="typeunsafe_enums_classes"></a>10.4.5.3 Type unsafe enum classes</H4>
|
||||
<H4><a name="typeunsafe_enums_classes"></a>20.4.5.3 Type unsafe enum classes</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3245,7 +3245,7 @@ public final class Beverage {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="java_directors"></a>10.5 Cross language polymorphism using directors (experimental)</H2>
|
||||
<H2><a name="java_directors"></a>20.5 Cross language polymorphism using directors (experimental)</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3267,7 +3267,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>10.5.1 Enabling directors</H3>
|
||||
<H3><a name="java_enabling_directors"></a>20.5.1 Enabling directors</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3338,7 +3338,7 @@ public:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="java_directors_classes"></a>10.5.2 Director classes</H3>
|
||||
<H3><a name="java_directors_classes"></a>20.5.2 Director classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3365,7 +3365,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>10.5.3 Overhead and code bloat</H3>
|
||||
<H3><a name="java_directors_overhead"></a>20.5.3 Overhead and code bloat</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3383,7 +3383,7 @@ This situation can be optimized by selectively enabling director methods (using
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="java_directors_example"></a>10.5.4 Simple directors example</H3>
|
||||
<H3><a name="java_directors_example"></a>20.5.4 Simple directors example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3448,7 +3448,7 @@ directorDerived::upcall_method() invoked.
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="common_customization"></a>10.6 Common customization features</H2>
|
||||
<H2><a name="common_customization"></a>20.6 Common customization features</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3460,7 +3460,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="helper_functions"></a>10.6.1 C/C++ helper functions</H3>
|
||||
<H3><a name="helper_functions"></a>20.6.1 C/C++ helper functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3526,7 +3526,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="class_extension"></a>10.6.2 Class extension with %extend</H3>
|
||||
<H3><a name="class_extension"></a>20.6.2 Class extension with %extend</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3589,7 +3589,7 @@ Vector(2,3,4)
|
|||
in any way---the extensions only show up in the Java interface.
|
||||
</p>
|
||||
|
||||
<H3><a name="exception_handling"></a>10.6.3 Exception handling with %exception and %javaexception</H3>
|
||||
<H3><a name="exception_handling"></a>20.6.3 Exception handling with %exception and %javaexception</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3746,7 +3746,7 @@ to raise exceptions. See the <a href="Library.html#Library">SWIG Library</a> ch
|
|||
The typemap example <a href="#exception_typemap">Handling C++ exception specifications as Java exceptions</a> provides further exception handling capabilities.
|
||||
</p>
|
||||
|
||||
<H3><a name="method_access"></a>10.6.4 Method access with %javamethodmodifiers</H3>
|
||||
<H3><a name="method_access"></a>20.6.4 Method access with %javamethodmodifiers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3772,7 +3772,7 @@ protected static void protect_me() {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="tips_techniques"></a>10.7 Tips and techniques</H2>
|
||||
<H2><a name="tips_techniques"></a>20.7 Tips and techniques</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3782,7 +3782,7 @@ strings and arrays. This chapter discusses the common techniques for
|
|||
solving these problems.
|
||||
</p>
|
||||
|
||||
<H3><a name="input_output_parameters"></a>10.7.1 Input and output parameters using primitive pointers and references</H3>
|
||||
<H3><a name="input_output_parameters"></a>20.7.1 Input and output parameters using primitive pointers and references</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3956,7 +3956,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="simple_pointers"></a>10.7.2 Simple pointers</H3>
|
||||
<H3><a name="simple_pointers"></a>20.7.2 Simple pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4022,7 +4022,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="c_arrays"></a>10.7.3 Wrapping C arrays with Java arrays</H3>
|
||||
<H3><a name="c_arrays"></a>20.7.3 Wrapping C arrays with Java arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4089,7 +4089,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="unbounded_c_arrays"></a>10.7.4 Unbounded C Arrays</H3>
|
||||
<H3><a name="unbounded_c_arrays"></a>20.7.4 Unbounded C Arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4234,7 +4234,7 @@ well suited for applications in which you need to create buffers,
|
|||
package binary data, etc.
|
||||
</p>
|
||||
|
||||
<H3><a name="java_heap_allocations"></a>10.7.5 Overriding new and delete to allocate from Java heap</H3>
|
||||
<H3><a name="java_heap_allocations"></a>20.7.5 Overriding new and delete to allocate from Java heap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4351,7 +4351,7 @@ model and use these functions in place of malloc and free in your own
|
|||
code.
|
||||
</p>
|
||||
|
||||
<H2><a name="java_typemaps"></a>10.8 Java typemaps</H2>
|
||||
<H2><a name="java_typemaps"></a>20.8 Java typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4372,7 +4372,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="default_primitive_type_mappings"></a>10.8.1 Default primitive type mappings</H3>
|
||||
<H3><a name="default_primitive_type_mappings"></a>20.8.1 Default primitive type mappings</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4524,7 +4524,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>10.8.2 Default typemaps for non-primitive types</H3>
|
||||
<H3><a name="Java_default_non_primitive_typemaps"></a>20.8.2 Default typemaps for non-primitive types</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4539,7 +4539,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="jvm64"></a>10.8.3 Sixty four bit JVMs</H3>
|
||||
<H3><a name="jvm64"></a>20.8.3 Sixty four bit JVMs</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4552,7 +4552,7 @@ Unfortunately it won't of course hold true for JNI code.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="what_is_typemap"></a>10.8.4 What is a typemap?</H3>
|
||||
<H3><a name="what_is_typemap"></a>20.8.4 What is a typemap?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4675,7 +4675,7 @@ int c = example.count('e',"Hello World");
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="typemaps_c_to_java_types"></a>10.8.5 Typemaps for mapping C/C++ types to Java types</H3>
|
||||
<H3><a name="typemaps_c_to_java_types"></a>20.8.5 Typemaps for mapping C/C++ types to Java types</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4935,7 +4935,7 @@ These are listed below:
|
|||
|
||||
</table>
|
||||
|
||||
<H3><a name="typemap_attributes"></a>10.8.6 Java typemap attributes</H3>
|
||||
<H3><a name="typemap_attributes"></a>20.8.6 Java typemap attributes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4981,7 +4981,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="special_variables"></a>10.8.7 Java special variables</H3>
|
||||
<H3><a name="special_variables"></a>20.8.7 Java special variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -5124,7 +5124,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="typemaps_for_c_and_cpp"></a>10.8.8 Typemaps for both C and C++ compilation</H3>
|
||||
<H3><a name="typemaps_for_c_and_cpp"></a>20.8.8 Typemaps for both C and C++ compilation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -5161,7 +5161,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>10.8.9 Java code typemaps</H3>
|
||||
<H3><a name="java_code_typemaps"></a>20.8.9 Java code typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -5357,7 +5357,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>10.8.10 Director specific typemaps</H3>
|
||||
<H3><a name="java_directors_typemaps"></a>20.8.10 Director specific typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -5582,7 +5582,7 @@ The basic strategy here is to provide a default package typemap for the majority
|
|||
|
||||
</div>
|
||||
|
||||
<H2><a name="typemap_examples"></a>10.9 Typemap Examples</H2>
|
||||
<H2><a name="typemap_examples"></a>20.9 Typemap Examples</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -5592,7 +5592,7 @@ the SWIG library.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="simpler_enum_classes"></a>10.9.1 Simpler Java enums for enums without initializers</H3>
|
||||
<H3><a name="simpler_enum_classes"></a>20.9.1 Simpler Java enums for enums without initializers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -5671,7 +5671,7 @@ This would be done by using the original versions of these typemaps in "enums.sw
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="exception_typemap"></a>10.9.2 Handling C++ exception specifications as Java exceptions</H3>
|
||||
<H3><a name="exception_typemap"></a>20.9.2 Handling C++ exception specifications as Java exceptions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -5796,7 +5796,7 @@ We could alternatively have used <tt>%rename</tt> to rename <tt>what()</tt> into
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="nan_exception_typemap"></a>10.9.3 NaN Exception - exception handling for a particular type</H3>
|
||||
<H3><a name="nan_exception_typemap"></a>20.9.3 NaN Exception - exception handling for a particular type</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -5951,7 +5951,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="converting_java_string_arrays"></a>10.9.4 Converting Java String arrays to char ** </H3>
|
||||
<H3><a name="converting_java_string_arrays"></a>20.9.4 Converting Java String arrays to char ** </H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -6095,7 +6095,7 @@ Lastly the "jni", "jtype" and "jstype" typemaps are also required to specify
|
|||
what Java types to use.
|
||||
</p>
|
||||
|
||||
<H3><a name="expanding_java_object"></a>10.9.5 Expanding a Java object to multiple arguments</H3>
|
||||
<H3><a name="expanding_java_object"></a>20.9.5 Expanding a Java object to multiple arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -6177,7 +6177,7 @@ example.foo(new String[]{"red", "green", "blue", "white"});
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="using_typemaps_return_arguments"></a>10.9.6 Using typemaps to return arguments</H3>
|
||||
<H3><a name="using_typemaps_return_arguments"></a>20.9.6 Using typemaps to return arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -6295,7 +6295,7 @@ $ java main
|
|||
1 12.0 340.0
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="adding_downcasts"></a>10.9.7 Adding Java downcasts to polymorphic return types</H3>
|
||||
<H3><a name="adding_downcasts"></a>20.9.7 Adding Java downcasts to polymorphic return types</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -6501,7 +6501,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="adding_equals_method"></a>10.9.8 Adding an equals method to the Java classes</H3>
|
||||
<H3><a name="adding_equals_method"></a>20.9.8 Adding an equals method to the Java classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -6545,7 +6545,7 @@ System.out.println("foo1? " + foo1.equals(foo2));
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="void_pointers"></a>10.9.9 Void pointers and a common Java base class</H3>
|
||||
<H3><a name="void_pointers"></a>20.9.9 Void pointers and a common Java base class</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -6604,7 +6604,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="struct_pointer_pointer"></a>10.9.10 Struct pointer to pointer</H3>
|
||||
<H3><a name="struct_pointer_pointer"></a>20.9.10 Struct pointer to pointer</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -6784,7 +6784,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>10.9.11 Memory management when returning references to member variables</H3>
|
||||
<H3><a name="java_memory_management_member_variables"></a>20.9.11 Memory management when returning references to member variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -6907,7 +6907,7 @@ public class Bike {
|
|||
Note the <tt>addReference</tt> call.
|
||||
</p>
|
||||
|
||||
<H3><a name="java_memory_management_objects"></a>10.9.12 Memory management for objects passed to the C++ layer</H3>
|
||||
<H3><a name="java_memory_management_objects"></a>20.9.12 Memory management for objects passed to the C++ layer</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -7023,7 +7023,7 @@ The 'javacode' typemap simply adds in the specified code into the Java proxy cla
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="java_date_marshalling"></a>10.9.13 Date marshalling using the javain typemap and associated attributes</H3>
|
||||
<H3><a name="java_date_marshalling"></a>20.9.13 Date marshalling using the javain typemap and associated attributes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -7200,7 +7200,7 @@ A few things to note:
|
|||
|
||||
|
||||
|
||||
<H2><a name="java_directors_faq"></a>10.10 Living with Java Directors</H2>
|
||||
<H2><a name="java_directors_faq"></a>20.10 Living with Java Directors</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -7381,10 +7381,10 @@ public abstract class UserVisibleFoo extends Foo {
|
|||
</li>
|
||||
</ol>
|
||||
|
||||
<H2><a name="odds_ends"></a>10.11 Odds and ends</H2>
|
||||
<H2><a name="odds_ends"></a>20.11 Odds and ends</H2>
|
||||
|
||||
|
||||
<H3><a name="javadoc_comments"></a>10.11.1 JavaDoc comments</H3>
|
||||
<H3><a name="javadoc_comments"></a>20.11.1 JavaDoc comments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -7440,7 +7440,7 @@ public class Barmy {
|
|||
|
||||
|
||||
|
||||
<H3><a name="functional_interface"></a>10.11.2 Functional interface without proxy classes</H3>
|
||||
<H3><a name="functional_interface"></a>20.11.2 Functional interface without proxy classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -7501,7 +7501,7 @@ All destructors have to be called manually for example the <tt>delete_Foo(foo)</
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="using_own_jni_functions"></a>10.11.3 Using your own JNI functions</H3>
|
||||
<H3><a name="using_own_jni_functions"></a>20.11.3 Using your own JNI functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -7551,7 +7551,7 @@ This directive is only really useful if you want to mix your own hand crafted JN
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="performance"></a>10.11.4 Performance concerns and hints</H3>
|
||||
<H3><a name="performance"></a>20.11.4 Performance concerns and hints</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -7573,7 +7573,7 @@ This method normally calls the C++ destructor or <tt>free()</tt> for C code.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="java_examples"></a>10.12 Examples</H2>
|
||||
<H2><a name="java_examples"></a>20.12 Examples</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Library"></a>11 SWIG library</H1>
|
||||
<H1><a name="Library"></a>8 SWIG library</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -57,7 +57,7 @@ Alternative libraries provide similar functionality. Please read this chapter
|
|||
carefully if you used the old libraries.
|
||||
</p>
|
||||
|
||||
<H2><a name="Library_nn2"></a>11.1 The %include directive and library search path</H2>
|
||||
<H2><a name="Library_nn2"></a>8.1 The %include directive and library search path</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -88,7 +88,7 @@ Set the environment variable to hold an alternative library directory.
|
|||
The directories that are searched are displayed when using <tt>-verbose</tt> commandline option.
|
||||
</p>
|
||||
|
||||
<H2><a name="Library_nn3"></a>11.2 C Arrays and Pointers</H2>
|
||||
<H2><a name="Library_nn3"></a>8.2 C Arrays and Pointers</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -100,7 +100,7 @@ pointers as class-like objects. Since these functions provide direct access to
|
|||
memory, their use is potentially unsafe and you should exercise caution.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn4"></a>11.2.1 cpointer.i</H3>
|
||||
<H3><a name="Library_nn4"></a>8.2.1 cpointer.i</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -316,7 +316,7 @@ In this example, the function <tt>int_to_uint()</tt> would be used to cast type
|
|||
<b>Note:</b> When working with simple pointers, typemaps can often be used to provide more seamless operation.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn5"></a>11.2.2 carrays.i</H3>
|
||||
<H3><a name="Library_nn5"></a>8.2.2 carrays.i</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -492,7 +492,7 @@ you should consider using a special array object rather than a bare pointer.
|
|||
used with types of <tt>char</tt> or <tt>char *</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn6"></a>11.2.3 cmalloc.i</H3>
|
||||
<H3><a name="Library_nn6"></a>8.2.3 cmalloc.i</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -653,7 +653,7 @@ Now, in a script:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Library_nn7"></a>11.2.4 cdata.i</H3>
|
||||
<H3><a name="Library_nn7"></a>8.2.4 cdata.i</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -751,7 +751,7 @@ char *cdata_<em>name</em>(type* ptr, int nitems)
|
|||
Clearly they are unsafe.
|
||||
</p>
|
||||
|
||||
<H2><a name="Library_nn8"></a>11.3 C String Handling</H2>
|
||||
<H2><a name="Library_nn8"></a>8.3 C String Handling</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -771,7 +771,7 @@ morality. The modules in this section provide basic functionality
|
|||
for manipulating raw C strings.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn9"></a>11.3.1 Default string handling</H3>
|
||||
<H3><a name="Library_nn9"></a>8.3.1 Default string handling</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -812,7 +812,7 @@ interpreter and lead to a crash). Furthermore, the default behavior does
|
|||
not work well with binary data. Instead, strings are assumed to be NULL-terminated.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn10"></a>11.3.2 Passing binary data</H3>
|
||||
<H3><a name="Library_nn10"></a>8.3.2 Passing binary data</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -853,7 +853,7 @@ Now, in the target language, you can use binary string data like this:
|
|||
In the wrapper function, the passed string will be expanded to a pointer and length parameter.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn11"></a>11.3.3 Using %newobject to release memory</H3>
|
||||
<H3><a name="Library_nn11"></a>8.3.3 Using %newobject to release memory</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -891,7 +891,7 @@ char *foo();
|
|||
This will release the result.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn12"></a>11.3.4 cstring.i</H3>
|
||||
<H3><a name="Library_nn12"></a>8.3.4 cstring.i</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1351,7 +1351,7 @@ structure or class instead.
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<H2><a name="Library_stl_cpp_library"></a>11.4 STL/C++ Library</H2>
|
||||
<H2><a name="Library_stl_cpp_library"></a>8.4 STL/C++ Library</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1387,7 +1387,7 @@ Please look for the library files in the appropriate language library directory.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Library_nn14"></a>11.4.1 std_string.i</H3>
|
||||
<H3><a name="Library_nn14"></a>8.4.1 std_string.i</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1476,7 +1476,7 @@ void foo(string s, const String &t); // std_string typemaps still applie
|
|||
We're looking into it.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn15"></a>11.4.2 std_vector.i</H3>
|
||||
<H3><a name="Library_nn15"></a>8.4.2 std_vector.i</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1660,7 +1660,7 @@ details and the public API exposed to the interpreter vary.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Library_stl_exceptions"></a>11.4.3 STL exceptions</H3>
|
||||
<H3><a name="Library_stl_exceptions"></a>8.4.3 STL exceptions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1711,10 +1711,10 @@ Any thrown STL exceptions will then be gracefully handled instead of causing a c
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Library_nn16"></a>11.5 Utility Libraries</H2>
|
||||
<H2><a name="Library_nn16"></a>8.5 Utility Libraries</H2>
|
||||
|
||||
|
||||
<H3><a name="Library_nn17"></a>11.5.1 exception.i</H3>
|
||||
<H3><a name="Library_nn17"></a>8.5.1 exception.i</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Lisp_nn1"></a>12 SWIG and Common Lisp</H1>
|
||||
<H1><a name="Lisp_nn1"></a>21 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>12.1 Allegro Common Lisp</H2>
|
||||
<H2><a name="Lisp_nn2"></a>21.1 Allegro Common Lisp</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -50,7 +50,7 @@
|
|||
<a href="Allegrocl.html#Allegrocl_nn1">here</a>
|
||||
</p>
|
||||
|
||||
<H2><a name="Lisp_nn3"></a>12.2 Common Foreign Function Interface(CFFI)</H2>
|
||||
<H2><a name="Lisp_nn3"></a>21.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>12.2.1 Additional Commandline Options </H3>
|
||||
<H3><a name="Lisp_nn4"></a>21.2.1 Additional Commandline Options </H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -118,7 +118,7 @@ swig -cffi -help
|
|||
|
||||
</table>
|
||||
|
||||
<H3><a name="Lisp_nn5"></a>12.2.2 Generating CFFI bindings</H3>
|
||||
<H3><a name="Lisp_nn5"></a>21.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>12.2.3 Generating CFFI bindings for C++ code</H3>
|
||||
<H3><a name="Lisp_nn6"></a>21.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>12.2.4 Inserting user code into generated files</H3>
|
||||
<H3><a name="Lisp_nn7"></a>21.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>12.3 CLISP</H2>
|
||||
<H2><a name="Lisp_nn8"></a>21.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>12.3.1 Additional Commandline Options </H3>
|
||||
<H3><a name="Lisp_nn9"></a>21.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>12.3.2 Details on CLISP bindings</H3>
|
||||
<H3><a name="Lisp_nn10"></a>21.3.2 Details on CLISP bindings</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -795,7 +795,7 @@ struct bar {
|
|||
|
||||
</pre></div>
|
||||
|
||||
<H2><a name="Lisp_nn11"></a>12.4 UFFI </H2>
|
||||
<H2><a name="Lisp_nn11"></a>21.4 UFFI </H2>
|
||||
|
||||
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Lua_nn1"></a>13 SWIG and Lua</H1>
|
||||
<H1><a name="Lua_nn1"></a>22 SWIG and Lua</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -50,13 +50,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 <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>13.1 Preliminaries</H2>
|
||||
<H2><a name="Lua_nn2"></a>22.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>13.2 Running SWIG</H2>
|
||||
<H2><a name="Lua_nn3"></a>22.2 Running SWIG</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -88,7 +88,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>13.2.1 Compiling and Linking and Interpreter</H3>
|
||||
<H3><a name="Lua_nn4"></a>22.2.1 Compiling and Linking and Interpreter</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -135,7 +135,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>13.2.2 Compiling a dynamic module</H3>
|
||||
<H3><a name="Lua_nn5"></a>22.2.2 Compiling a dynamic module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -203,7 +203,7 @@ Is quite obvious (Go back and consult the Lua documents on how to enable loadlib
|
|||
|
||||
|
||||
|
||||
<H3><a name="Lua_nn6"></a>13.2.3 Using your module</H3>
|
||||
<H3><a name="Lua_nn6"></a>22.2.3 Using your module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -221,19 +221,19 @@ $ ./my_lua
|
|||
>
|
||||
</pre></div>
|
||||
|
||||
<H2><a name="Lua_nn7"></a>13.3 A tour of basic C/C++ wrapping</H2>
|
||||
<H2><a name="Lua_nn7"></a>22.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>13.3.1 Modules</H3>
|
||||
<H3><a name="Lua_nn8"></a>22.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>13.3.2 Functions</H3>
|
||||
<H3><a name="Lua_nn9"></a>22.3.2 Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -271,7 +271,7 @@ It is also possible to rename the module with an assignment.
|
|||
24
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Lua_nn10"></a>13.3.3 Global variables</H3>
|
||||
<H3><a name="Lua_nn10"></a>22.3.3 Global variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -345,7 +345,7 @@ nil
|
|||
3.142
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Lua_nn11"></a>13.3.4 Constants and enums</H3>
|
||||
<H3><a name="Lua_nn11"></a>22.3.4 Constants and enums</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -368,7 +368,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>13.3.5 Pointers</H3>
|
||||
<H3><a name="Lua_nn12"></a>22.3.5 Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -406,7 +406,7 @@ Lua enforces the integrity of its userdata, so it is virtually impossible to cor
|
|||
nil
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Lua_nn13"></a>13.3.6 Structures</H3>
|
||||
<H3><a name="Lua_nn13"></a>22.3.6 Structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -492,7 +492,7 @@ Because the pointer points inside the structure, you can modify the contents and
|
|||
> x.a = 3 -- Modifies the same structure
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Lua_nn14"></a>13.3.7 C++ classes</H3>
|
||||
<H3><a name="Lua_nn14"></a>22.3.7 C++ classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -553,7 +553,7 @@ It is not (currently) possible to access static members of an instance:
|
|||
-- does NOT work
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Lua_nn15"></a>13.3.8 C++ inheritance</H3>
|
||||
<H3><a name="Lua_nn15"></a>22.3.8 C++ inheritance</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -578,7 +578,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>13.3.9 Pointers, references, values, and arrays</H3>
|
||||
<H3><a name="Lua_nn16"></a>22.3.9 Pointers, references, values, and arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -609,7 +609,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>13.3.10 C++ overloaded functions</H3>
|
||||
<H3><a name="Lua_nn17"></a>22.3.10 C++ overloaded functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -695,7 +695,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>13.3.11 C++ operators</H3>
|
||||
<H3><a name="Lua_nn18"></a>22.3.11 C++ operators</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -807,7 +807,7 @@ It is also possible to overload the operator<tt>[]</tt>, but currently this cann
|
|||
};
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Lua_nn19"></a>13.3.12 Class extension with %extend</H3>
|
||||
<H3><a name="Lua_nn19"></a>22.3.12 Class extension with %extend</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -862,7 +862,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>13.3.13 C++ templates</H3>
|
||||
<H3><a name="Lua_nn20"></a>22.3.13 C++ templates</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -897,7 +897,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>13.3.14 C++ Smart Pointers</H3>
|
||||
<H3><a name="Lua_nn21"></a>22.3.14 C++ Smart Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -949,7 +949,7 @@ If you ever need to access the underlying pointer returned by <tt>operator->(
|
|||
> f = p:__deref__() -- Returns underlying Foo *
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Lua_nn22"></a>13.3.15 Writing your own custom wrappers</H3>
|
||||
<H3><a name="Lua_nn22"></a>22.3.15 Writing your own custom wrappers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -968,7 +968,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>
|
||||
|
||||
<H2><a name="Lua_nn23"></a>13.4 Details on the Lua binding</H2>
|
||||
<H2><a name="Lua_nn23"></a>22.4 Details on the Lua binding</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -979,7 +979,7 @@ The <tt>%native</tt> directive in the above example, tells SWIG that there is a
|
|||
</i>
|
||||
</p>
|
||||
|
||||
<H3><a name="Lua_nn24"></a>13.4.1 Binding global data into the module.</H3>
|
||||
<H3><a name="Lua_nn24"></a>22.4.1 Binding global data into the module.</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1039,7 +1039,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_nn25"></a>13.4.2 Userdata and Metatables</H3>
|
||||
<H3><a name="Lua_nn25"></a>22.4.2 Userdata and Metatables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1119,7 +1119,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' & '__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_nn26"></a>13.4.3 Memory management</H3>
|
||||
<H3><a name="Lua_nn26"></a>22.4.3 Memory management</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF">
|
||||
<H1><a name="Modula3"></a>14 SWIG and Modula-3</H1>
|
||||
<H1><a name="Modula3"></a>23 SWIG and Modula-3</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -57,7 +57,7 @@ especially
|
|||
<a href="Typemaps.html">typemaps</a>.
|
||||
</p>
|
||||
|
||||
<H2><a name="modula3_overview"></a>14.1 Overview</H2>
|
||||
<H2><a name="modula3_overview"></a>23.1 Overview</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -90,7 +90,7 @@ So the introduction got a bit longer than it should ... ;-)
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="whyscripting"></a>14.1.1 Why not scripting ?</H3>
|
||||
<H3><a name="whyscripting"></a>23.1.1 Why not scripting ?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -126,7 +126,7 @@ are not advantages of the language itself
|
|||
but can be provided by function libraries.
|
||||
</p>
|
||||
|
||||
<H3><a name="whymodula3"></a>14.1.2 Why Modula-3 ?</H3>
|
||||
<H3><a name="whymodula3"></a>23.1.2 Why Modula-3 ?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -166,7 +166,7 @@ it's statically typed, too.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="whycpp"></a>14.1.3 Why C / C++ ?</H3>
|
||||
<H3><a name="whycpp"></a>23.1.3 Why C / C++ ?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -179,7 +179,7 @@ Even more fortunately even non-C libraries may provide C header files.
|
|||
This is where SWIG becomes helpful.
|
||||
</p>
|
||||
|
||||
<H3><a name="whyswig"></a>14.1.4 Why SWIG ?</H3>
|
||||
<H3><a name="whyswig"></a>23.1.4 Why SWIG ?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -252,10 +252,10 @@ integrate Modula-3 code into a C / C++ project.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="conception"></a>14.2 Conception</H2>
|
||||
<H2><a name="conception"></a>23.2 Conception</H2>
|
||||
|
||||
|
||||
<H3><a name="cinterface"></a>14.2.1 Interfaces to C libraries</H3>
|
||||
<H3><a name="cinterface"></a>23.2.1 Interfaces to C libraries</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -404,7 +404,7 @@ and the principal type must be renamed (<tt>%typemap</tt>).
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="cppinterface"></a>14.2.2 Interfaces to C++ libraries</H3>
|
||||
<H3><a name="cppinterface"></a>23.2.2 Interfaces to C++ libraries</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -505,10 +505,10 @@ 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="preliminaries"></a>14.3 Preliminaries</H2>
|
||||
<H2><a name="preliminaries"></a>23.3 Preliminaries</H2>
|
||||
|
||||
|
||||
<H3><a name="compilers"></a>14.3.1 Compilers</H3>
|
||||
<H3><a name="compilers"></a>23.3.1 Compilers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -522,7 +522,7 @@ For testing examples I use Critical Mass cm3.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="commandline"></a>14.3.2 Additional Commandline Options</H3>
|
||||
<H3><a name="commandline"></a>23.3.2 Additional Commandline Options</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -599,10 +599,10 @@ Instead generate templates for some basic typemaps.
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<H2><a name="modula3_typemaps"></a>14.4 Modula-3 typemaps</H2>
|
||||
<H2><a name="modula3_typemaps"></a>23.4 Modula-3 typemaps</H2>
|
||||
|
||||
|
||||
<H3><a name="inoutparam"></a>14.4.1 Inputs and outputs</H3>
|
||||
<H3><a name="inoutparam"></a>23.4.1 Inputs and outputs</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -818,7 +818,7 @@ consist of the following parts:
|
|||
</table>
|
||||
|
||||
|
||||
<H3><a name="ordinals"></a>14.4.2 Subranges, Enumerations, Sets</H3>
|
||||
<H3><a name="ordinals"></a>23.4.2 Subranges, Enumerations, Sets</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -870,7 +870,7 @@ that I'd like to automate.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="class"></a>14.4.3 Objects</H3>
|
||||
<H3><a name="class"></a>23.4.3 Objects</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -883,7 +883,7 @@ is not really useful, yet.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="imports"></a>14.4.4 Imports</H3>
|
||||
<H3><a name="imports"></a>23.4.4 Imports</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -918,7 +918,7 @@ IMPORT M3toC;
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="exceptions"></a>14.4.5 Exceptions</H3>
|
||||
<H3><a name="exceptions"></a>23.4.5 Exceptions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -942,7 +942,7 @@ you should declare
|
|||
<tt>%typemap("m3wrapinconv:throws") blah * %{OSError.E%}</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="typemap_example"></a>14.4.6 Example</H3>
|
||||
<H3><a name="typemap_example"></a>23.4.6 Example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -989,10 +989,10 @@ where almost everything is generated by a typemap:
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H2><a name="hints"></a>14.5 More hints to the generator</H2>
|
||||
<H2><a name="hints"></a>23.5 More hints to the generator</H2>
|
||||
|
||||
|
||||
<H3><a name="features"></a>14.5.1 Features</H3>
|
||||
<H3><a name="features"></a>23.5.1 Features</H3>
|
||||
|
||||
|
||||
<table border summary="Modula-3 features">
|
||||
|
@ -1029,7 +1029,7 @@ where almost everything is generated by a typemap:
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<H3><a name="pragmas"></a>14.5.2 Pragmas</H3>
|
||||
<H3><a name="pragmas"></a>23.5.2 Pragmas</H3>
|
||||
|
||||
|
||||
<table border summary="Modula-3 pragmas">
|
||||
|
@ -1052,7 +1052,7 @@ where almost everything is generated by a typemap:
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<H2><a name="remarks"></a>14.6 Remarks</H2>
|
||||
<H2><a name="remarks"></a>23.6 Remarks</H2>
|
||||
|
||||
|
||||
<ul>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<H1><a name="MzScheme"></a>16 SWIG and MzScheme</H1>
|
||||
<H1><a name="MzScheme"></a>24 SWIG and MzScheme</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -22,7 +22,7 @@
|
|||
<p>
|
||||
This section contains information on SWIG's support of MzScheme.
|
||||
|
||||
<H2><a name="MzScheme_nn2"></a>16.1 Creating native MzScheme structures</H2>
|
||||
<H2><a name="MzScheme_nn2"></a>24.1 Creating native MzScheme structures</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
<body bgcolor="#ffffff">
|
||||
<a name="n1"></a>
|
||||
<H1><a name="Ocaml"></a>17 SWIG and Ocaml</H1>
|
||||
<H1><a name="Ocaml"></a>25 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>17.1 Preliminaries</H2>
|
||||
<H2><a name="Ocaml_nn2"></a>25.1 Preliminaries</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -99,7 +99,7 @@ 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>17.1.1 Running SWIG</H3>
|
||||
<H3><a name="Ocaml_nn3"></a>25.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>17.1.2 Compiling the code</H3>
|
||||
<H3><a name="Ocaml_nn4"></a>25.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>17.1.3 The camlp4 module</H3>
|
||||
<H3><a name="Ocaml_nn5"></a>25.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>17.1.4 Using your module</H3>
|
||||
<H3><a name="Ocaml_nn6"></a>25.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>17.1.5 Compilation problems and compiling with C++</H3>
|
||||
<H3><a name="Ocaml_nn7"></a>25.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>17.2 The low-level Ocaml/C interface</H2>
|
||||
<H2><a name="Ocaml_nn8"></a>25.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>17.2.1 The generated module</H3>
|
||||
<H3><a name="Ocaml_nn9"></a>25.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>17.2.2 Enums</H3>
|
||||
<H3><a name="Ocaml_nn10"></a>25.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>17.2.2.1 Enum typing in Ocaml</H4>
|
||||
<H4><a name="Ocaml_nn11"></a>25.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>17.2.3 Arrays</H3>
|
||||
<H3><a name="Ocaml_nn12"></a>25.2.3 Arrays</H3>
|
||||
|
||||
|
||||
<H4><a name="Ocaml_nn13"></a>17.2.3.1 Simple types of bounded arrays</H4>
|
||||
<H4><a name="Ocaml_nn13"></a>25.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>17.2.3.2 Complex and unbounded arrays</H4>
|
||||
<H4><a name="Ocaml_nn14"></a>25.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>17.2.3.3 Using an object</H4>
|
||||
<H4><a name="Ocaml_nn15"></a>25.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>17.2.3.4 Example typemap for a function taking float * and int</H4>
|
||||
<H4><a name="Ocaml_nn16"></a>25.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>17.2.4 C++ Classes</H3>
|
||||
<H3><a name="Ocaml_nn17"></a>25.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>17.2.4.1 STL vector and string Example</H4>
|
||||
<H4><a name="Ocaml_nn18"></a>25.2.4.1 STL vector and string Example</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -695,7 +695,7 @@ baz
|
|||
#
|
||||
</pre></div>
|
||||
|
||||
<H4><a name="Ocaml_nn19"></a>17.2.4.2 C++ Class Example</H4>
|
||||
<H4><a name="Ocaml_nn19"></a>25.2.4.2 C++ Class Example</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -725,7 +725,7 @@ public:
|
|||
};
|
||||
</pre></td></tr></table>
|
||||
|
||||
<H4><a name="Ocaml_nn20"></a>17.2.4.3 Compiling the example</H4>
|
||||
<H4><a name="Ocaml_nn20"></a>25.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>17.2.4.4 Sample Session</H4>
|
||||
<H4><a name="Ocaml_nn21"></a>25.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>17.2.5 Director Classes</H3>
|
||||
<H3><a name="Ocaml_nn22"></a>25.2.5 Director Classes</H3>
|
||||
|
||||
|
||||
<H4><a name="Ocaml_nn23"></a>17.2.5.1 Director Introduction</H4>
|
||||
<H4><a name="Ocaml_nn23"></a>25.2.5.1 Director Introduction</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -800,7 +800,7 @@ class foo {
|
|||
};
|
||||
</pre></div>
|
||||
|
||||
<H4><a name="Ocaml_nn24"></a>17.2.5.2 Overriding Methods in Ocaml</H4>
|
||||
<H4><a name="Ocaml_nn24"></a>25.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>17.2.5.3 Director Usage Example</H4>
|
||||
<H4><a name="Ocaml_nn25"></a>25.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>17.2.5.4 Creating director objects</H4>
|
||||
<H4><a name="Ocaml_nn26"></a>25.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>17.2.5.5 Typemaps for directors, <tt>directorin, directorout, directorargout</tt></H4>
|
||||
<H4><a name="Ocaml_nn27"></a>25.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>17.2.5.6 <tt>directorin</tt> typemap</H4>
|
||||
<H4><a name="Ocaml_nn28"></a>25.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>17.2.5.7 <tt>directorout</tt> typemap</H4>
|
||||
<H4><a name="Ocaml_nn29"></a>25.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>17.2.5.8 <tt>directorargout</tt> typemap</H4>
|
||||
<H4><a name="Ocaml_nn30"></a>25.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>17.2.6 Exceptions</H3>
|
||||
<H3><a name="Ocaml_nn31"></a>25.2.6 Exceptions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<H1><a name="Octave"></a>18 SWIG and Octave</H1>
|
||||
<H1><a name="Octave"></a>26 SWIG and Octave</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -63,14 +63,14 @@ For now, the best way to find information about how to use the Octave module is
|
|||
The bulk of the Octave-specific wrapper generator code is in Source/Modules/octave.cxx. The runtime components are in Lib/octave, and in particular Lib/octave/octrun.swg.
|
||||
</p>
|
||||
|
||||
<H2><a name="Octave_nn2"></a>18.1 Preliminaries</H2>
|
||||
<H2><a name="Octave_nn2"></a>26.1 Preliminaries</H2>
|
||||
|
||||
|
||||
<p>
|
||||
The current SWIG implemention is based on Octave 2.9.12. Support for other versions (in particular the recent 3.0) has not been tested, nor has support for any OS other than Linux.
|
||||
</p>
|
||||
|
||||
<H2><a name="Octave_nn3"></a>18.2 Running SWIG</H2>
|
||||
<H2><a name="Octave_nn3"></a>26.2 Running SWIG</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -102,7 +102,7 @@ This creates a C/C++ source file <tt>example_wrap.cxx</tt>. The generated C++ so
|
|||
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>18.2.1 Compiling a dynamic module</H3>
|
||||
<H3><a name="Octave_nn5"></a>26.2.1 Compiling a dynamic module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -134,7 +134,7 @@ $ mkoctfile example_wrap.cxx example.c
|
|||
</p>
|
||||
|
||||
<p>
|
||||
<H3><a name="Octave_nn6"></a>18.2.2 Using your module</H3>
|
||||
<H3><a name="Octave_nn6"></a>26.2.2 Using your module</H3>
|
||||
|
||||
|
||||
</p>
|
||||
|
@ -156,10 +156,10 @@ octave:5> example.cvar.Foo
|
|||
ans = 4 </pre></div>
|
||||
</p>
|
||||
|
||||
<H2><a name="Octave_nn7"></a>18.3 A tour of basic C/C++ wrapping</H2>
|
||||
<H2><a name="Octave_nn7"></a>26.3 A tour of basic C/C++ wrapping</H2>
|
||||
|
||||
|
||||
<H3><a name="Octave_nn8"></a>18.3.1 Modules</H3>
|
||||
<H3><a name="Octave_nn8"></a>26.3.1 Modules</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -207,7 +207,7 @@ octave:1> some_vars = cvar;
|
|||
</div></pre>
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn9"></a>18.3.2 Functions</H3>
|
||||
<H3><a name="Octave_nn9"></a>26.3.2 Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -229,7 +229,7 @@ int fact(int n); </pre></div>
|
|||
</p>
|
||||
|
||||
<p>
|
||||
<H3><a name="Octave_nn10"></a>18.3.3 Global variables</H3>
|
||||
<H3><a name="Octave_nn10"></a>26.3.3 Global variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -292,7 +292,7 @@ octave:3> example.PI
|
|||
ans = 3.1420 </pre></div>
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn11"></a>18.3.4 Constants and enums</H3>
|
||||
<H3><a name="Octave_nn11"></a>26.3.4 Constants and enums</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -319,7 +319,7 @@ example.SUNDAY=0
|
|||
</p>
|
||||
|
||||
<p>
|
||||
<H3><a name="Octave_nn12"></a>18.3.5 Pointers</H3>
|
||||
<H3><a name="Octave_nn12"></a>26.3.5 Pointers</H3>
|
||||
|
||||
|
||||
</p>
|
||||
|
@ -376,7 +376,7 @@ error: value on right hand side of assignment is undefined
|
|||
error: evaluating assignment expression near line 2, column 2 </pre></div>
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn13"></a>18.3.6 Structures</H3>
|
||||
<H3><a name="Octave_nn13"></a>26.3.6 Structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -406,21 +406,21 @@ ans = 5
|
|||
</pre></div>
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn14"></a>18.3.7 C++ classes</H3>
|
||||
<H3><a name="Octave_nn14"></a>26.3.7 C++ classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
C++ classes are handled in a way identical to other modules.
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn15"></a>18.3.8 C++ inheritance</H3>
|
||||
<H3><a name="Octave_nn15"></a>26.3.8 C++ inheritance</H3>
|
||||
|
||||
|
||||
<p>
|
||||
Inheritance is handled in a way identical to other modules.
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn16"></a>18.3.9 Pointers, references, values, and arrays</H3>
|
||||
<H3><a name="Octave_nn16"></a>26.3.9 Pointers, references, values, and arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -430,14 +430,14 @@ Pointers, references, values, and arrays are handled in the same way as other mo
|
|||
There are still some failing tests relating to global arrays.
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn17"></a>18.3.10 C++ overloaded functions</H3>
|
||||
<H3><a name="Octave_nn17"></a>26.3.10 C++ overloaded functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
Overloaded functions are supported, and handled as in other modules.
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn18"></a>18.3.11 C++ operators</H3>
|
||||
<H3><a name="Octave_nn18"></a>26.3.11 C++ operators</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -547,7 +547,7 @@ On the C++ side, the default mappings are as follows:
|
|||
%rename(__brace) *::operator[];
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Octave_nn19"></a>18.3.12 Class extension with %extend</H3>
|
||||
<H3><a name="Octave_nn19"></a>26.3.12 Class extension with %extend</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -581,21 +581,21 @@ octave:4> a.__str()
|
|||
4
|
||||
</pre></div>
|
||||
</p>
|
||||
<H3><a name="Octave_nn20"></a>18.3.13 C++ templates</H3>
|
||||
<H3><a name="Octave_nn20"></a>26.3.13 C++ templates</H3>
|
||||
|
||||
|
||||
<p>
|
||||
C++ templates are fully supported, as in other modules.
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn21"></a>18.3.14 C++ Smart Pointers</H3>
|
||||
<H3><a name="Octave_nn21"></a>26.3.14 C++ Smart Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
C++ smart pointers are fully supported, as in other modules.
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn22"></a>18.3.15 Directors (calling Octave from C++ code)</H3>
|
||||
<H3><a name="Octave_nn22"></a>26.3.15 Directors (calling Octave from C++ code)</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -687,14 +687,14 @@ octave-side routine called
|
|||
</pre></div>
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn23"></a>18.3.16 Threads</H3>
|
||||
<H3><a name="Octave_nn23"></a>26.3.16 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>18.3.17 Memory management</H3>
|
||||
<H3><a name="Octave_nn24"></a>26.3.17 Memory management</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -729,14 +729,14 @@ A destructing
|
|||
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>18.3.18 STL support</H3>
|
||||
<H3><a name="Octave_nn25"></a>26.3.18 STL support</H3>
|
||||
|
||||
|
||||
<p>
|
||||
This is some skeleton support for various STL containers, but this work is not finished.
|
||||
</p>
|
||||
|
||||
<H3><a name="Octave_nn26"></a>18.3.19 Matrix typemaps</H3>
|
||||
<H3><a name="Octave_nn26"></a>26.3.19 Matrix typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Perl5"></a>19 SWIG and Perl5</H1>
|
||||
<H1><a name="Perl5"></a>27 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>19.1 Overview</H2>
|
||||
<H2><a name="Perl5_nn2"></a>27.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>19.2 Preliminaries</H2>
|
||||
<H2><a name="Perl5_nn3"></a>27.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>19.2.1 Getting the right header files</H3>
|
||||
<H3><a name="Perl5_nn4"></a>27.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>19.2.2 Compiling a dynamic module</H3>
|
||||
<H3><a name="Perl5_nn5"></a>27.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>19.2.3 Building a dynamic module with MakeMaker</H3>
|
||||
<H3><a name="Perl5_nn6"></a>27.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>19.2.4 Building a static version of Perl</H3>
|
||||
<H3><a name="Perl5_nn7"></a>27.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>19.2.5 Using the module</H3>
|
||||
<H3><a name="Perl5_nn8"></a>27.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>19.2.6 Compilation problems and compiling with C++</H3>
|
||||
<H3><a name="Perl5_nn9"></a>27.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>19.2.7 Compiling for 64-bit platforms</H3>
|
||||
<H3><a name="Perl5_nn10"></a>27.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>19.3 Building Perl Extensions under Windows</H2>
|
||||
<H2><a name="Perl5_nn11"></a>27.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>19.3.1 Running SWIG from Developer Studio</H3>
|
||||
<H3><a name="Perl5_nn12"></a>27.3.1 Running SWIG from Developer Studio</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -700,7 +700,7 @@ print "$a\n";
|
|||
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Perl5_nn13"></a>19.3.2 Using other compilers</H3>
|
||||
<H3><a name="Perl5_nn13"></a>27.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>19.4 The low-level interface</H2>
|
||||
<H2><a name="Perl5_nn14"></a>27.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>19.4.1 Functions</H3>
|
||||
<H3><a name="Perl5_nn15"></a>27.4.1 Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -741,7 +741,7 @@ use example;
|
|||
$a = &example::fact(2);
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Perl5_nn16"></a>19.4.2 Global variables</H3>
|
||||
<H3><a name="Perl5_nn16"></a>27.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>19.4.3 Constants</H3>
|
||||
<H3><a name="Perl5_nn17"></a>27.4.3 Constants</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -838,7 +838,7 @@ $example::FOO = 2; # Error
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Perl5_nn18"></a>19.4.4 Pointers</H3>
|
||||
<H3><a name="Perl5_nn18"></a>27.4.4 Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -947,7 +947,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>19.4.5 Structures</H3>
|
||||
<H3><a name="Perl5_nn19"></a>27.4.5 Structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1081,7 +1081,7 @@ void Bar_f_set(Bar *b, Foo *val) {
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Perl5_nn20"></a>19.4.6 C++ classes</H3>
|
||||
<H3><a name="Perl5_nn20"></a>27.4.6 C++ classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1146,7 +1146,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>19.4.7 C++ classes and type-checking</H3>
|
||||
<H3><a name="Perl5_nn21"></a>27.4.7 C++ classes and type-checking</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1182,7 +1182,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>19.4.8 C++ overloaded functions</H3>
|
||||
<H3><a name="Perl5_nn22"></a>27.4.8 C++ overloaded functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1226,7 +1226,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>19.4.9 Operators</H3>
|
||||
<H3><a name="Perl5_nn23"></a>27.4.9 Operators</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1253,7 +1253,7 @@ The following C++ operators are currently supported by the Perl module:
|
|||
<li>operator or </li>
|
||||
</ul>
|
||||
|
||||
<H3><a name="Perl5_nn24"></a>19.4.10 Modules and packages</H3>
|
||||
<H3><a name="Perl5_nn24"></a>27.4.10 Modules and packages</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1320,7 +1320,7 @@ print Foo::fact(4),"\n"; # Call a function in package FooBar
|
|||
</pre></div>
|
||||
-->
|
||||
|
||||
<H2><a name="Perl5_nn25"></a>19.5 Input and output parameters</H2>
|
||||
<H2><a name="Perl5_nn25"></a>27.5 Input and output parameters</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1539,7 +1539,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>19.6 Exception handling </H2>
|
||||
<H2><a name="Perl5_nn26"></a>27.6 Exception handling </H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1704,7 +1704,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>19.7 Remapping datatypes with typemaps</H2>
|
||||
<H2><a name="Perl5_nn27"></a>27.7 Remapping datatypes with typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1721,7 +1721,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>19.7.1 A simple typemap example</H3>
|
||||
<H3><a name="Perl5_nn28"></a>27.7.1 A simple typemap example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1825,7 +1825,7 @@ example::count("e","Hello World");
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Perl5_nn29"></a>19.7.2 Perl5 typemaps</H3>
|
||||
<H3><a name="Perl5_nn29"></a>27.7.2 Perl5 typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1930,7 +1930,7 @@ Return of C++ member data (all languages).
|
|||
Check value of input parameter.
|
||||
</div>
|
||||
|
||||
<H3><a name="Perl5_nn30"></a>19.7.3 Typemap variables</H3>
|
||||
<H3><a name="Perl5_nn30"></a>27.7.3 Typemap variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2001,7 +2001,7 @@ properly assigned.
|
|||
The Perl name of the wrapper function being created.
|
||||
</div>
|
||||
|
||||
<H3><a name="Perl5_nn31"></a>19.7.4 Useful functions</H3>
|
||||
<H3><a name="Perl5_nn31"></a>27.7.4 Useful functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2070,7 +2070,7 @@ int sv_isa(SV *, char *0;
|
|||
</div>
|
||||
|
||||
|
||||
<H2><a name="Perl5_nn32"></a>19.8 Typemap Examples</H2>
|
||||
<H2><a name="Perl5_nn32"></a>27.8 Typemap Examples</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2079,7 +2079,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>19.8.1 Converting a Perl5 array to a char ** </H3>
|
||||
<H3><a name="Perl5_nn33"></a>27.8.1 Converting a Perl5 array to a char ** </H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2171,7 +2171,7 @@ print @$b,"\n"; # Print it out
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="Perl5_nn34"></a>19.8.2 Return values </H3>
|
||||
<H3><a name="Perl5_nn34"></a>27.8.2 Return values </H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2200,7 +2200,7 @@ can be done using the <tt>EXTEND()</tt> macro as in :
|
|||
}
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Perl5_nn35"></a>19.8.3 Returning values from arguments</H3>
|
||||
<H3><a name="Perl5_nn35"></a>27.8.3 Returning values from arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2254,7 +2254,7 @@ print "multout(7,13) = @r\n";
|
|||
($x,$y) = multout(7,13);
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Perl5_nn36"></a>19.8.4 Accessing array structure members</H3>
|
||||
<H3><a name="Perl5_nn36"></a>27.8.4 Accessing array structure members</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2317,7 +2317,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>19.8.5 Turning Perl references into C pointers</H3>
|
||||
<H3><a name="Perl5_nn37"></a>27.8.5 Turning Perl references into C pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2382,7 +2382,7 @@ print "$c\n";
|
|||
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Perl5_nn38"></a>19.8.6 Pointer handling</H3>
|
||||
<H3><a name="Perl5_nn38"></a>27.8.6 Pointer handling</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2461,7 +2461,7 @@ For example:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Perl5_nn39"></a>19.9 Proxy classes</H2>
|
||||
<H2><a name="Perl5_nn39"></a>27.9 Proxy classes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2477,7 +2477,7 @@ to the underlying code. This section describes the implementation
|
|||
details of the proxy interface.
|
||||
</p>
|
||||
|
||||
<H3><a name="Perl5_nn40"></a>19.9.1 Preliminaries</H3>
|
||||
<H3><a name="Perl5_nn40"></a>27.9.1 Preliminaries</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2499,7 +2499,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>19.9.2 Structure and class wrappers</H3>
|
||||
<H3><a name="Perl5_nn41"></a>27.9.2 Structure and class wrappers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2625,7 +2625,7 @@ $v->DESTROY();
|
|||
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Perl5_nn42"></a>19.9.3 Object Ownership</H3>
|
||||
<H3><a name="Perl5_nn42"></a>27.9.3 Object Ownership</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2712,7 +2712,7 @@ counting, garbage collection, or advanced features one might find in
|
|||
sophisticated languages.
|
||||
</p>
|
||||
|
||||
<H3><a name="Perl5_nn43"></a>19.9.4 Nested Objects</H3>
|
||||
<H3><a name="Perl5_nn43"></a>27.9.4 Nested Objects</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2765,7 +2765,7 @@ $p->{f}->{x} = 0.0;
|
|||
%${$p->{v}} = ( x=>0, y=>0, z=>0);
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Perl5_nn44"></a>19.9.5 Proxy Functions</H3>
|
||||
<H3><a name="Perl5_nn44"></a>27.9.5 Proxy Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2799,7 +2799,7 @@ This function replaces the original function, but operates in an
|
|||
identical manner.
|
||||
</p>
|
||||
|
||||
<H3><a name="Perl5_nn45"></a>19.9.6 Inheritance</H3>
|
||||
<H3><a name="Perl5_nn45"></a>27.9.6 Inheritance</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2875,7 +2875,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>19.9.7 Modifying the proxy methods</H3>
|
||||
<H3><a name="Perl5_nn46"></a>27.9.7 Modifying the proxy methods</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2903,7 +2903,7 @@ public:
|
|||
};
|
||||
</pre></div>
|
||||
|
||||
<H2><a name="Perl5_nn47"></a>19.10 Adding additional Perl code</H2>
|
||||
<H2><a name="Perl5_nn47"></a>27.10 Adding additional Perl code</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Php"></a>20 SWIG and PHP</H1>
|
||||
<H1><a name="Php"></a>28 SWIG and PHP</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -67,7 +67,7 @@ your extension into php directly, you will need the complete PHP source tree
|
|||
available.
|
||||
</p>
|
||||
|
||||
<H2><a name="Php_nn1"></a>20.1 Generating PHP Extensions</H2>
|
||||
<H2><a name="Php_nn1"></a>28.1 Generating PHP Extensions</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -114,7 +114,7 @@ this approach, but if you really want to do this, the <tt>-phpfull</tt>
|
|||
command line argument to swig may be of use - see below for details.
|
||||
</p>
|
||||
|
||||
<H3><a name="Php_nn1_1"></a>20.1.1 Building a loadable extension</H3>
|
||||
<H3><a name="Php_nn1_1"></a>28.1.1 Building a loadable extension</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -138,7 +138,7 @@ add them to your Makefile or other build system directly. We recommend that
|
|||
you don't use <tt>-make</tt> and it's likely to be removed at some point.
|
||||
</p>
|
||||
|
||||
<H3><a name="Php_nn1_2"></a>20.1.2 Building extensions into PHP</H3>
|
||||
<H3><a name="Php_nn1_2"></a>28.1.2 Building extensions into PHP</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -257,7 +257,7 @@ which contains your new module. You can test it with a php script which
|
|||
does not have the 'dl' command as used above.
|
||||
</p>
|
||||
|
||||
<H3><a name="Php_nn1_3"></a>20.1.3 Using PHP Extensions</H3>
|
||||
<H3><a name="Php_nn1_3"></a>28.1.3 Using PHP Extensions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -288,7 +288,7 @@ attempts to do the <tt>dl()</tt> call for you:
|
|||
include("example.php");
|
||||
</pre></div>
|
||||
|
||||
<H2><a name="Php_nn2"></a>20.2 Basic PHP interface</H2>
|
||||
<H2><a name="Php_nn2"></a>28.2 Basic PHP interface</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -298,7 +298,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>20.2.1 Constants</H3>
|
||||
<H3><a name="Php_nn2_1"></a>28.2.1 Constants</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -423,7 +423,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>20.2.2 Global Variables</H3>
|
||||
<H3><a name="Php_nn2_2"></a>28.2.2 Global Variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -472,7 +472,7 @@ undefined.
|
|||
At this time SWIG does not support custom accessor methods.
|
||||
</p>
|
||||
|
||||
<H3><a name="Php_nn2_3"></a>20.2.3 Functions</H3>
|
||||
<H3><a name="Php_nn2_3"></a>28.2.3 Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -525,7 +525,7 @@ print $s; # The value of $s was not changed.
|
|||
-->
|
||||
|
||||
|
||||
<H3><a name="Php_nn2_4"></a>20.2.4 Overloading</H3>
|
||||
<H3><a name="Php_nn2_4"></a>28.2.4 Overloading</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -581,7 +581,7 @@ taking the integer argument.
|
|||
</p>
|
||||
-->
|
||||
|
||||
<H3><a name="Php_nn2_5"></a>20.2.5 Pointers and References</H3>
|
||||
<H3><a name="Php_nn2_5"></a>28.2.5 Pointers and References</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -713,7 +713,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>20.2.6 Structures and C++ classes</H3>
|
||||
<H3><a name="Php_nn2_6"></a>28.2.6 Structures and C++ classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -783,7 +783,7 @@ Would be used in the following way from either PHP4 or PHP5:
|
|||
Member variables and methods are accessed using the <tt>-></tt> operator.
|
||||
</p>
|
||||
|
||||
<H4><a name="Php_nn2_6_1"></a>20.2.6.1 Using <tt>-noproxy</tt></H4>
|
||||
<H4><a name="Php_nn2_6_1"></a>28.2.6.1 Using <tt>-noproxy</tt></H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -809,7 +809,7 @@ Complex_im_set($obj,$d);
|
|||
Complex_im_get($obj);
|
||||
</pre></div>
|
||||
|
||||
<H4><a name="Php_nn2_6_2"></a>20.2.6.2 Constructors and Destructors</H4>
|
||||
<H4><a name="Php_nn2_6_2"></a>28.2.6.2 Constructors and Destructors</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -850,7 +850,7 @@ the programmer can either reassign the variable or call
|
|||
<tt>unset($v)</tt>
|
||||
</p>
|
||||
|
||||
<H4><a name="Php_nn2_6_3"></a>20.2.6.3 Static Member Variables</H4>
|
||||
<H4><a name="Php_nn2_6_3"></a>28.2.6.3 Static Member Variables</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -893,7 +893,7 @@ Ko::threats(10);
|
|||
echo "There has now been " . Ko::threats() . " threats\n";
|
||||
|
||||
</pre></div>
|
||||
<H4><a name="Php_nn2_6_4"></a>20.2.6.4 Static Member Functions</H4>
|
||||
<H4><a name="Php_nn2_6_4"></a>28.2.6.4 Static Member Functions</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -915,7 +915,7 @@ Ko::threats();
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="Php_nn2_7"></a>20.2.7 PHP Pragmas, Startup and Shutdown code</H3>
|
||||
<H3><a name="Php_nn2_7"></a>28.2.7 PHP Pragmas, Startup and Shutdown code</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Pike"></a>21 SWIG and Pike</H1>
|
||||
<H1><a name="Pike"></a>29 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>21.1 Preliminaries</H2>
|
||||
<H2><a name="Pike_nn2"></a>29.1 Preliminaries</H2>
|
||||
|
||||
|
||||
<H3><a name="Pike_nn3"></a>21.1.1 Running SWIG</H3>
|
||||
<H3><a name="Pike_nn3"></a>29.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>21.1.2 Getting the right header files</H3>
|
||||
<H3><a name="Pike_nn4"></a>29.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>21.1.3 Using your module</H3>
|
||||
<H3><a name="Pike_nn5"></a>29.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>21.2 Basic C/C++ Mapping</H2>
|
||||
<H2><a name="Pike_nn6"></a>29.2 Basic C/C++ Mapping</H2>
|
||||
|
||||
|
||||
<H3><a name="Pike_nn7"></a>21.2.1 Modules</H3>
|
||||
<H3><a name="Pike_nn7"></a>29.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>21.2.2 Functions</H3>
|
||||
<H3><a name="Pike_nn8"></a>29.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>21.2.3 Global variables</H3>
|
||||
<H3><a name="Pike_nn9"></a>29.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>21.2.4 Constants and enumerated types</H3>
|
||||
<H3><a name="Pike_nn10"></a>29.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>21.2.5 Constructors and Destructors</H3>
|
||||
<H3><a name="Pike_nn11"></a>29.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>21.2.6 Static Members</H3>
|
||||
<H3><a name="Pike_nn12"></a>29.2.6 Static Members</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Preface"></a>22 Preface</H1>
|
||||
<H1><a name="Preface"></a>1 Preface</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -26,7 +26,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="Preface_nn2"></a>22.1 Introduction</H2>
|
||||
<H2><a name="Preface_nn2"></a>1.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -49,7 +49,7 @@ has since evolved into a general purpose tool that is used in a wide
|
|||
variety of applications--in fact almost anything where C/C++ programming
|
||||
is involved.
|
||||
|
||||
<H2><a name="Preface_nn3"></a>22.2 Special Introduction for Version 1.3</H2>
|
||||
<H2><a name="Preface_nn3"></a>1.2 Special Introduction for Version 1.3</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -63,7 +63,7 @@ including Guile, Java, Mzscheme, Ocaml, Perl, Pike, PHP, Python, Ruby,
|
|||
and Tcl.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preface_nn4"></a>22.3 SWIG Versions</H2>
|
||||
<H2><a name="Preface_nn4"></a>1.3 SWIG Versions</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -76,7 +76,7 @@ create a stable SWIG-2.0 release. Don't let the development status
|
|||
of SWIG-1.3 scare you---it is much more stable (and capable) than SWIG-1.1p5.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preface_nn5"></a>22.4 SWIG resources</H2>
|
||||
<H2><a name="Preface_nn5"></a>1.4 SWIG resources</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -115,7 +115,7 @@ about this can be obtained at:
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H2><a name="Preface_nn6"></a>22.5 Prerequisites</H2>
|
||||
<H2><a name="Preface_nn6"></a>1.5 Prerequisites</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -140,7 +140,7 @@ However, this isn't meant to be a tutorial on C++ programming. For many
|
|||
of the gory details, you will almost certainly want to consult a good C++ reference. If you don't program
|
||||
in C++, you may just want to skip those parts of the manual.
|
||||
|
||||
<H2><a name="Preface_nn7"></a>22.6 Organization of this manual</H2>
|
||||
<H2><a name="Preface_nn7"></a>1.6 Organization of this manual</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -153,7 +153,7 @@ to know. Caveat: we are currently working on a documentation rewrite and many
|
|||
of the older language module chapters are still somewhat out of date.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preface_nn8"></a>22.7 How to avoid reading the manual</H2>
|
||||
<H2><a name="Preface_nn8"></a>1.7 How to avoid reading the manual</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -165,7 +165,7 @@ The SWIG distribution also comes with a large directory of
|
|||
examples that illustrate different topics.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preface_nn9"></a>22.8 Backwards Compatibility</H2>
|
||||
<H2><a name="Preface_nn9"></a>1.8 Backwards Compatibility</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -206,7 +206,7 @@ Note: The version symbol is not defined in the generated SWIG
|
|||
wrapper file. The SWIG preprocessor has defined SWIG_VERSION since SWIG-1.3.11.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preface_nn10"></a>22.9 Credits</H2>
|
||||
<H2><a name="Preface_nn10"></a>1.9 Credits</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -232,7 +232,7 @@ Gary Holt have provided a great deal of input on improving SWIG's
|
|||
Perl5 implementation. Kevin Butler contributed the first Windows NT
|
||||
port.
|
||||
|
||||
<H2><a name="Preface_nn11"></a>22.10 Bug reports</H2>
|
||||
<H2><a name="Preface_nn11"></a>1.10 Bug reports</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Preprocessor"></a>23 Preprocessing</H1>
|
||||
<H1><a name="Preprocessor"></a>7 Preprocessing</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -34,7 +34,7 @@ However, a number of modifications and enhancements have been made. This
|
|||
chapter describes some of these modifications.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_nn2"></a>23.1 File inclusion</H2>
|
||||
<H2><a name="Preprocessor_nn2"></a>7.1 File inclusion</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -60,7 +60,7 @@ By default, the <tt>#include</tt> is ignored unless you run SWIG with the
|
|||
is that you often don't want SWIG to try and wrap everything included
|
||||
in standard header system headers and auxiliary files.
|
||||
|
||||
<H2><a name="Preprocessor_nn3"></a>23.2 File imports</H2>
|
||||
<H2><a name="Preprocessor_nn3"></a>7.2 File imports</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -89,7 +89,7 @@ The <tt>-importall</tt> directive tells SWIG to follow all <tt>#include</tt> sta
|
|||
as imports. This might be useful if you want to extract type definitions from system
|
||||
header files without generating any wrappers.
|
||||
|
||||
<H2><a name="Preprocessor_condition_compilation"></a>23.3 Conditional Compilation</H2>
|
||||
<H2><a name="Preprocessor_condition_compilation"></a>7.3 Conditional Compilation</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -150,7 +150,7 @@ SWIG (except for the symbol `<tt>SWIG</tt>' which is only defined
|
|||
within the SWIG compiler).
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_nn5"></a>23.4 Macro Expansion</H2>
|
||||
<H2><a name="Preprocessor_nn5"></a>7.4 Macro Expansion</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -205,7 +205,7 @@ like <tt>#x</tt>. This is a non-standard SWIG extension.
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<H2><a name="Preprocessor_nn6"></a>23.5 SWIG Macros</H2>
|
||||
<H2><a name="Preprocessor_nn6"></a>7.5 SWIG Macros</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -251,7 +251,7 @@ many of SWIG's advanced features and libraries are built using this mechanism (s
|
|||
support).
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_nn7"></a>23.6 C99 and GNU Extensions</H2>
|
||||
<H2><a name="Preprocessor_nn7"></a>7.6 C99 and GNU Extensions</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -307,7 +307,7 @@ interface building. However, they are used internally to implement a number of
|
|||
SWIG directives and are provided to make SWIG more compatible with C99 code.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_nn8"></a>23.7 Preprocessing and %{ ... %} & " ... " delimiters</H2>
|
||||
<H2><a name="Preprocessor_nn8"></a>7.7 Preprocessing and %{ ... %} & " ... " delimiters</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -332,7 +332,7 @@ the contents of the <tt>%{ ... %}</tt> block are copied without
|
|||
modification to the output (including all preprocessor directives).
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_nn9"></a>23.8 Preprocessing and { ... } delimiters</H2>
|
||||
<H2><a name="Preprocessor_nn9"></a>7.8 Preprocessing and { ... } delimiters</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -374,7 +374,7 @@ to actually go into the wrapper file, prefix the preprocessor directives with <t
|
|||
SWIG will strip the extra <tt>%</tt> and leave the preprocessor directive in the code.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_typemap_delimiters"></a>23.9 Preprocessor and Typemaps</H2>
|
||||
<H2><a name="Preprocessor_typemap_delimiters"></a>7.9 Preprocessor and Typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -445,7 +445,7 @@ would generate
|
|||
</div>
|
||||
|
||||
|
||||
<H2><a name="Preprocessor_nn10"></a>23.10 Viewing preprocessor output</H2>
|
||||
<H2><a name="Preprocessor_nn10"></a>7.10 Viewing preprocessor output</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -455,7 +455,7 @@ Instead the results after the preprocessor has run are displayed.
|
|||
This might be useful as an aid to debugging and viewing the results of macro expansions.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_warning_error"></a>23.11 The #error and #warning directives</H2>
|
||||
<H2><a name="Preprocessor_warning_error"></a>7.11 The #error and #warning directives</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Python"></a>24 SWIG and Python</H1>
|
||||
<H1><a name="Python"></a>30 SWIG and Python</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -125,7 +125,7 @@ very least, make sure you read the "<a href="SWIG.html#SWIG">SWIG
|
|||
Basics</a>" chapter.
|
||||
</p>
|
||||
|
||||
<H2><a name="Python_nn2"></a>24.1 Overview</H2>
|
||||
<H2><a name="Python_nn2"></a>30.1 Overview</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -152,10 +152,10 @@ described followed by a discussion of low-level implementation
|
|||
details.
|
||||
</p>
|
||||
|
||||
<H2><a name="Python_nn3"></a>24.2 Preliminaries</H2>
|
||||
<H2><a name="Python_nn3"></a>30.2 Preliminaries</H2>
|
||||
|
||||
|
||||
<H3><a name="Python_nn4"></a>24.2.1 Running SWIG</H3>
|
||||
<H3><a name="Python_nn4"></a>30.2.1 Running SWIG</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -253,7 +253,7 @@ 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>24.2.2 Using distutils</H3>
|
||||
<H3><a name="Python_nn6"></a>30.2.2 Using distutils</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -345,7 +345,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>24.2.3 Hand compiling a dynamic module</H3>
|
||||
<H3><a name="Python_nn7"></a>30.2.3 Hand compiling a dynamic module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -393,7 +393,7 @@ module actually consists of two files; <tt>socket.py</tt> and
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Python_nn8"></a>24.2.4 Static linking</H3>
|
||||
<H3><a name="Python_nn8"></a>30.2.4 Static linking</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -472,7 +472,7 @@ If using static linking, you might want to rely on a different approach
|
|||
(perhaps using distutils).
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn9"></a>24.2.5 Using your module</H3>
|
||||
<H3><a name="Python_nn9"></a>30.2.5 Using your module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -629,7 +629,7 @@ system configuration (this requires root access and you will need to
|
|||
read the man pages).
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn10"></a>24.2.6 Compilation of C++ extensions</H3>
|
||||
<H3><a name="Python_nn10"></a>30.2.6 Compilation of C++ extensions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -728,7 +728,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>24.2.7 Compiling for 64-bit platforms</H3>
|
||||
<H3><a name="Python_nn11"></a>30.2.7 Compiling for 64-bit platforms</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -765,7 +765,7 @@ and -m64 allow you to choose the desired binary format for your python
|
|||
extension.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn12"></a>24.2.8 Building Python Extensions under Windows</H3>
|
||||
<H3><a name="Python_nn12"></a>30.2.8 Building Python Extensions under Windows</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -874,7 +874,7 @@ SWIG Wiki</a>.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Python_nn13"></a>24.3 A tour of basic C/C++ wrapping</H2>
|
||||
<H2><a name="Python_nn13"></a>30.3 A tour of basic C/C++ wrapping</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -883,7 +883,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>24.3.1 Modules</H3>
|
||||
<H3><a name="Python_nn14"></a>30.3.1 Modules</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -896,7 +896,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>24.3.2 Functions</H3>
|
||||
<H3><a name="Python_nn15"></a>30.3.2 Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -920,7 +920,7 @@ like you think it does:
|
|||
>>>
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Python_nn16"></a>24.3.3 Global variables</H3>
|
||||
<H3><a name="Python_nn16"></a>30.3.3 Global variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1058,7 +1058,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>24.3.4 Constants and enums</H3>
|
||||
<H3><a name="Python_nn17"></a>30.3.4 Constants and enums</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1098,7 +1098,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>24.3.5 Pointers</H3>
|
||||
<H3><a name="Python_nn18"></a>30.3.5 Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1239,7 +1239,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>24.3.6 Structures</H3>
|
||||
<H3><a name="Python_nn19"></a>30.3.6 Structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1428,7 +1428,7 @@ everything works just like you would expect. For example:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Python_nn20"></a>24.3.7 C++ classes</H3>
|
||||
<H3><a name="Python_nn20"></a>30.3.7 C++ classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1517,7 +1517,7 @@ they are accessed through <tt>cvar</tt> like this:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Python_nn21"></a>24.3.8 C++ inheritance</H3>
|
||||
<H3><a name="Python_nn21"></a>30.3.8 C++ inheritance</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1572,7 +1572,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>24.3.9 Pointers, references, values, and arrays</H3>
|
||||
<H3><a name="Python_nn22"></a>30.3.9 Pointers, references, values, and arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1633,7 +1633,7 @@ treated as a returning value, and it will follow the same
|
|||
allocation/deallocation process.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn23"></a>24.3.10 C++ overloaded functions</H3>
|
||||
<H3><a name="Python_nn23"></a>30.3.10 C++ overloaded functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1756,7 +1756,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>24.3.11 C++ operators</H3>
|
||||
<H3><a name="Python_nn24"></a>30.3.11 C++ operators</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1845,7 +1845,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>24.3.12 C++ namespaces</H3>
|
||||
<H3><a name="Python_nn25"></a>30.3.12 C++ namespaces</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1912,7 +1912,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>24.3.13 C++ templates</H3>
|
||||
<H3><a name="Python_nn26"></a>30.3.13 C++ templates</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1966,7 +1966,7 @@ Some more complicated
|
|||
examples will appear later.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn27"></a>24.3.14 C++ Smart Pointers</H3>
|
||||
<H3><a name="Python_nn27"></a>30.3.14 C++ Smart Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2051,7 +2051,7 @@ simply use the <tt>__deref__()</tt> method. For example:
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Python_nn27a"></a>24.3.15 C++ Reference Counted Objects (ref/unref)</H3>
|
||||
<H3><a name="Python_nn27a"></a>30.3.15 C++ Reference Counted Objects (ref/unref)</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2213,7 +2213,7 @@ python releases the proxy instance.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Python_nn28"></a>24.4 Further details on the Python class interface</H2>
|
||||
<H2><a name="Python_nn28"></a>30.4 Further details on the Python class interface</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2226,7 +2226,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>24.4.1 Proxy classes</H3>
|
||||
<H3><a name="Python_nn29"></a>30.4.1 Proxy classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2315,7 +2315,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>24.4.2 Memory management</H3>
|
||||
<H3><a name="Python_nn30"></a>30.4.2 Memory management</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2502,7 +2502,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>24.4.3 Python 2.2 and classic classes</H3>
|
||||
<H3><a name="Python_nn31"></a>30.4.3 Python 2.2 and classic classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2539,7 +2539,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="directors"></a>24.5 Cross language polymorphism</H2>
|
||||
<H2><a name="directors"></a>30.5 Cross language polymorphism</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2573,7 +2573,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>24.5.1 Enabling directors</H3>
|
||||
<H3><a name="Python_nn33"></a>30.5.1 Enabling directors</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2666,7 +2666,7 @@ class MyFoo(mymodule.Foo):
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Python_nn34"></a>24.5.2 Director classes</H3>
|
||||
<H3><a name="Python_nn34"></a>30.5.2 Director classes</H3>
|
||||
|
||||
|
||||
|
||||
|
@ -2748,7 +2748,7 @@ so there is no need for the extra overhead involved with routing the
|
|||
calls through Python.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn35"></a>24.5.3 Ownership and object destruction</H3>
|
||||
<H3><a name="Python_nn35"></a>30.5.3 Ownership and object destruction</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2815,7 +2815,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>24.5.4 Exception unrolling</H3>
|
||||
<H3><a name="Python_nn36"></a>30.5.4 Exception unrolling</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2874,7 +2874,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>24.5.5 Overhead and code bloat</H3>
|
||||
<H3><a name="Python_nn37"></a>30.5.5 Overhead and code bloat</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2908,7 +2908,7 @@ directive) for only those methods that are likely to be extended in
|
|||
Python.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn38"></a>24.5.6 Typemaps</H3>
|
||||
<H3><a name="Python_nn38"></a>30.5.6 Typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2922,7 +2922,7 @@ need to be supported.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Python_nn39"></a>24.5.7 Miscellaneous</H3>
|
||||
<H3><a name="Python_nn39"></a>30.5.7 Miscellaneous</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2969,7 +2969,7 @@ methods that return const references.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Python_nn40"></a>24.6 Common customization features</H2>
|
||||
<H2><a name="Python_nn40"></a>30.6 Common customization features</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2982,7 +2982,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>24.6.1 C/C++ helper functions</H3>
|
||||
<H3><a name="Python_nn41"></a>30.6.1 C/C++ helper functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3063,7 +3063,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>24.6.2 Adding additional Python code</H3>
|
||||
<H3><a name="Python_nn42"></a>30.6.2 Adding additional Python code</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3212,7 +3212,7 @@ public:
|
|||
|
||||
|
||||
|
||||
<H3><a name="Python_nn43"></a>24.6.3 Class extension with %extend</H3>
|
||||
<H3><a name="Python_nn43"></a>30.6.3 Class extension with %extend</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3301,7 +3301,7 @@ Vector(12,14,16)
|
|||
in any way---the extensions only show up in the Python interface.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn44"></a>24.6.4 Exception handling with %exception</H3>
|
||||
<H3><a name="Python_nn44"></a>30.6.4 Exception handling with %exception</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3427,7 +3427,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>24.7 Tips and techniques</H2>
|
||||
<H2><a name="Python_nn45"></a>30.7 Tips and techniques</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3437,7 +3437,7 @@ strings, binary data, and arrays. This chapter discusses the common techniques
|
|||
solving these problems.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn46"></a>24.7.1 Input and output parameters</H3>
|
||||
<H3><a name="Python_nn46"></a>30.7.1 Input and output parameters</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3650,7 +3650,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>24.7.2 Simple pointers</H3>
|
||||
<H3><a name="Python_nn47"></a>30.7.2 Simple pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3719,7 +3719,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>24.7.3 Unbounded C Arrays</H3>
|
||||
<H3><a name="Python_nn48"></a>30.7.3 Unbounded C Arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3781,7 +3781,7 @@ well suited for applications in which you need to create buffers,
|
|||
package binary data, etc.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn49"></a>24.7.4 String handling</H3>
|
||||
<H3><a name="Python_nn49"></a>30.7.4 String handling</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3850,16 +3850,16 @@ If you need to return binary data, you might use the
|
|||
also be used to extra binary data from arbitrary pointers.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn50"></a>24.7.5 Arrays</H3>
|
||||
<H3><a name="Python_nn50"></a>30.7.5 Arrays</H3>
|
||||
|
||||
|
||||
<H3><a name="Python_nn51"></a>24.7.6 String arrays</H3>
|
||||
<H3><a name="Python_nn51"></a>30.7.6 String arrays</H3>
|
||||
|
||||
|
||||
<H3><a name="Python_nn52"></a>24.7.7 STL wrappers</H3>
|
||||
<H3><a name="Python_nn52"></a>30.7.7 STL wrappers</H3>
|
||||
|
||||
|
||||
<H2><a name="Python_nn53"></a>24.8 Typemaps</H2>
|
||||
<H2><a name="Python_nn53"></a>30.8 Typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3876,7 +3876,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>24.8.1 What is a typemap?</H3>
|
||||
<H3><a name="Python_nn54"></a>30.8.1 What is a typemap?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3992,7 +3992,7 @@ parameter is omitted):
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Python_nn55"></a>24.8.2 Python typemaps</H3>
|
||||
<H3><a name="Python_nn55"></a>30.8.2 Python typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4033,7 +4033,7 @@ a look at the SWIG library version 1.3.20 or so.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Python_nn56"></a>24.8.3 Typemap variables</H3>
|
||||
<H3><a name="Python_nn56"></a>30.8.3 Typemap variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4104,7 +4104,7 @@ properly assigned.
|
|||
The Python name of the wrapper function being created.
|
||||
</div>
|
||||
|
||||
<H3><a name="Python_nn57"></a>24.8.4 Useful Python Functions</H3>
|
||||
<H3><a name="Python_nn57"></a>30.8.4 Useful Python Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4232,7 +4232,7 @@ write me
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Python_nn58"></a>24.9 Typemap Examples</H2>
|
||||
<H2><a name="Python_nn58"></a>30.9 Typemap Examples</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4241,7 +4241,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>24.9.1 Converting Python list to a char ** </H3>
|
||||
<H3><a name="Python_nn59"></a>30.9.1 Converting Python list to a char ** </H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4321,7 +4321,7 @@ memory allocation is used to allocate memory for the array, the
|
|||
the C function.
|
||||
</p>
|
||||
|
||||
<H3><a name="Python_nn60"></a>24.9.2 Expanding a Python object into multiple arguments</H3>
|
||||
<H3><a name="Python_nn60"></a>30.9.2 Expanding a Python object into multiple arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4400,7 +4400,7 @@ to supply the argument count. This is automatically set by the typemap code. F
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Python_nn61"></a>24.9.3 Using typemaps to return arguments</H3>
|
||||
<H3><a name="Python_nn61"></a>30.9.3 Using typemaps to return arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4489,7 +4489,7 @@ function can now be used as follows:
|
|||
>>>
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Python_nn62"></a>24.9.4 Mapping Python tuples into small arrays</H3>
|
||||
<H3><a name="Python_nn62"></a>30.9.4 Mapping Python tuples into small arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4538,7 +4538,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>24.9.5 Mapping sequences to C arrays</H3>
|
||||
<H3><a name="Python_nn63"></a>30.9.5 Mapping sequences to C arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4627,7 +4627,7 @@ static int convert_darray(PyObject *input, double *ptr, int size) {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Python_nn64"></a>24.9.6 Pointer handling</H3>
|
||||
<H3><a name="Python_nn64"></a>30.9.6 Pointer handling</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4724,7 +4724,7 @@ class object (if applicable).
|
|||
|
||||
|
||||
|
||||
<H2><a name="Python_nn65"></a>24.10 Docstring Features</H2>
|
||||
<H2><a name="Python_nn65"></a>30.10 Docstring Features</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4752,7 +4752,7 @@ of your users much simpler.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Python_nn66"></a>24.10.1 Module docstring</H3>
|
||||
<H3><a name="Python_nn66"></a>30.10.1 Module docstring</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4786,7 +4786,7 @@ layout of controls on a panel, etc. to be loaded from an XML file."
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Python_nn67"></a>24.10.2 %feature("autodoc")</H3>
|
||||
<H3><a name="Python_nn67"></a>30.10.2 %feature("autodoc")</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4813,7 +4813,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>24.10.2.1 %feature("autodoc", "0")</H4>
|
||||
<H4><a name="Python_nn68"></a>30.10.2.1 %feature("autodoc", "0")</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4842,7 +4842,7 @@ def function_name(*args, **kwargs):
|
|||
</div>
|
||||
|
||||
|
||||
<H4><a name="Python_nn69"></a>24.10.2.2 %feature("autodoc", "1")</H4>
|
||||
<H4><a name="Python_nn69"></a>30.10.2.2 %feature("autodoc", "1")</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4867,7 +4867,7 @@ def function_name(*args, **kwargs):
|
|||
|
||||
|
||||
|
||||
<H4><a name="Python_nn70"></a>24.10.2.3 %feature("autodoc", "docstring")</H4>
|
||||
<H4><a name="Python_nn70"></a>30.10.2.3 %feature("autodoc", "docstring")</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4886,7 +4886,7 @@ void GetPosition(int* OUTPUT, int* OUTPUT);
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Python_nn71"></a>24.10.3 %feature("docstring")</H3>
|
||||
<H3><a name="Python_nn71"></a>30.10.3 %feature("docstring")</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4918,7 +4918,7 @@ with more than one line.
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Python_nn72"></a>24.11 Python Packages</H2>
|
||||
<H2><a name="Python_nn72"></a>30.11 Python Packages</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="R"></a>25 SWIG and R</H1>
|
||||
<H1><a name="R"></a>33 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>25.1 Bugs</H2>
|
||||
<H2><a name="R_nn2"></a>33.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>25.2 Using R and SWIG</H2>
|
||||
<H2><a name="R_nn3"></a>33.2 Using R and SWIG</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -99,7 +99,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>25.3 Precompiling large R files</H2>
|
||||
<H2><a name="R_nn4"></a>33.3 Precompiling large R files</H2>
|
||||
|
||||
|
||||
In cases where the R file is large, one make save a lot of loading
|
||||
|
@ -117,7 +117,7 @@ will save a large amount of loading time.
|
|||
|
||||
|
||||
|
||||
<H2><a name="R_nn5"></a>25.4 General policy</H2>
|
||||
<H2><a name="R_nn5"></a>33.4 General policy</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -126,7 +126,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>25.5 Language conventions</H2>
|
||||
<H2><a name="R_language_conventions"></a>33.5 Language conventions</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -135,7 +135,7 @@ and [ are overloaded to allow for R syntax (one based indices and
|
|||
slices)
|
||||
</p>
|
||||
|
||||
<H2><a name="R_nn6"></a>25.6 C++ classes</H2>
|
||||
<H2><a name="R_nn6"></a>33.6 C++ classes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -147,7 +147,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>25.7 Enumerations</H2>
|
||||
<H2><a name="R_nn7"></a>33.7 Enumerations</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
|
||||
|
||||
<H1><a name="Ruby"></a>26 SWIG and Ruby</H1>
|
||||
<H1><a name="Ruby"></a>31 SWIG and Ruby</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -167,7 +167,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn2"></a>26.1 Preliminaries</H2>
|
||||
<H2><a name="Ruby_nn2"></a>31.1 Preliminaries</H2>
|
||||
|
||||
|
||||
<p> SWIG 1.3 is known to work with Ruby versions 1.6 and later.
|
||||
|
@ -190,7 +190,7 @@ of Ruby. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn3"></a>26.1.1 Running SWIG</H3>
|
||||
<H3><a name="Ruby_nn3"></a>31.1.1 Running SWIG</H3>
|
||||
|
||||
|
||||
<p> To build a Ruby module, run SWIG using the <tt>-ruby</tt>
|
||||
|
@ -244,7 +244,7 @@ to compile this file and link it with the rest of your program. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn4"></a>26.1.2 Getting the right header files</H3>
|
||||
<H3><a name="Ruby_nn4"></a>31.1.2 Getting the right header files</H3>
|
||||
|
||||
|
||||
<p> In order to compile the wrapper code, the compiler needs the <tt>ruby.h</tt>
|
||||
|
@ -288,7 +288,7 @@ installed, you can run Ruby to find out. For example: </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn5"></a>26.1.3 Compiling a dynamic module</H3>
|
||||
<H3><a name="Ruby_nn5"></a>31.1.3 Compiling a dynamic module</H3>
|
||||
|
||||
|
||||
<p> Ruby extension modules are typically compiled into shared
|
||||
|
@ -443,7 +443,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>26.1.4 Using your module</H3>
|
||||
<H3><a name="Ruby_nn6"></a>31.1.4 Using your module</H3>
|
||||
|
||||
|
||||
<p> Ruby <i>module</i> names must be capitalized,
|
||||
|
@ -498,7 +498,7 @@ begins with: </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn7"></a>26.1.5 Static linking</H3>
|
||||
<H3><a name="Ruby_nn7"></a>31.1.5 Static linking</H3>
|
||||
|
||||
|
||||
<p> An alternative approach to dynamic linking is to rebuild the
|
||||
|
@ -519,7 +519,7 @@ finally rebuilding Ruby. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn8"></a>26.1.6 Compilation of C++ extensions</H3>
|
||||
<H3><a name="Ruby_nn8"></a>31.1.6 Compilation of C++ extensions</H3>
|
||||
|
||||
|
||||
<p> On most machines, C++ extension modules should be linked
|
||||
|
@ -571,7 +571,7 @@ extension, e.g. </p>
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn9"></a>26.2 Building Ruby Extensions under Windows 95/NT</H2>
|
||||
<H2><a name="Ruby_nn9"></a>31.2 Building Ruby Extensions under Windows 95/NT</H2>
|
||||
|
||||
|
||||
<p> Building a SWIG extension to Ruby under Windows 95/NT is
|
||||
|
@ -610,7 +610,7 @@ files. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn10"></a>26.2.1 Running SWIG from Developer Studio</H3>
|
||||
<H3><a name="Ruby_nn10"></a>31.2.1 Running SWIG from Developer Studio</H3>
|
||||
|
||||
|
||||
<p> If you are developing your application within Microsoft
|
||||
|
@ -752,7 +752,7 @@ directory, then run the Ruby script from the DOS/Command prompt: </p>
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn11"></a>26.3 The Ruby-to-C/C++ Mapping</H2>
|
||||
<H2><a name="Ruby_nn11"></a>31.3 The Ruby-to-C/C++ Mapping</H2>
|
||||
|
||||
|
||||
<p> This section describes the basics of how SWIG maps C or C++
|
||||
|
@ -762,7 +762,7 @@ declarations in your SWIG interface files to Ruby constructs. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn12"></a>26.3.1 Modules</H3>
|
||||
<H3><a name="Ruby_nn12"></a>31.3.1 Modules</H3>
|
||||
|
||||
|
||||
<p> The SWIG <tt>%module</tt> directive specifies
|
||||
|
@ -931,7 +931,7 @@ Ruby's built-in names. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn13"></a>26.3.2 Functions</H3>
|
||||
<H3><a name="Ruby_nn13"></a>31.3.2 Functions</H3>
|
||||
|
||||
|
||||
<p> Global functions are wrapped as Ruby module methods. For
|
||||
|
@ -994,7 +994,7 @@ module that can be used like so: </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn14"></a>26.3.3 Variable Linking</H3>
|
||||
<H3><a name="Ruby_nn14"></a>31.3.3 Variable Linking</H3>
|
||||
|
||||
|
||||
<p> C/C++ global variables are wrapped as a pair of singleton
|
||||
|
@ -1094,7 +1094,7 @@ effect until it is explicitly disabled using <tt>%mutable</tt>.
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn15"></a>26.3.4 Constants</H3>
|
||||
<H3><a name="Ruby_nn15"></a>31.3.4 Constants</H3>
|
||||
|
||||
|
||||
<p> C/C++ constants are wrapped as module constants initialized
|
||||
|
@ -1138,7 +1138,7 @@ constant values, e.g. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn16"></a>26.3.5 Pointers</H3>
|
||||
<H3><a name="Ruby_nn16"></a>31.3.5 Pointers</H3>
|
||||
|
||||
|
||||
<p> "Opaque" pointers to arbitrary C/C++ types (i.e. types that
|
||||
|
@ -1190,7 +1190,7 @@ the Ruby <tt>nil</tt> object. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn17"></a>26.3.6 Structures</H3>
|
||||
<H3><a name="Ruby_nn17"></a>31.3.6 Structures</H3>
|
||||
|
||||
|
||||
<p> C/C++ structs are wrapped as Ruby classes, with accessor
|
||||
|
@ -1365,7 +1365,7 @@ pointers. For example, </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn18"></a>26.3.7 C++ classes</H3>
|
||||
<H3><a name="Ruby_nn18"></a>31.3.7 C++ classes</H3>
|
||||
|
||||
|
||||
<p> Like structs, C++ classes are wrapped by creating a new Ruby
|
||||
|
@ -1451,7 +1451,7 @@ class. </li>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn19"></a>26.3.8 C++ Inheritance</H3>
|
||||
<H3><a name="Ruby_nn19"></a>31.3.8 C++ Inheritance</H3>
|
||||
|
||||
|
||||
<p> The SWIG type-checker is fully aware of C++ inheritance.
|
||||
|
@ -1682,7 +1682,7 @@ Typing"</a>). </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn20"></a>26.3.9 C++ Overloaded Functions</H3>
|
||||
<H3><a name="Ruby_nn20"></a>31.3.9 C++ Overloaded Functions</H3>
|
||||
|
||||
|
||||
<p> C++ overloaded functions, methods, and constructors are
|
||||
|
@ -1878,7 +1878,7 @@ and C++"</a> chapter for more information about overloading. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn21"></a>26.3.10 C++ Operators</H3>
|
||||
<H3><a name="Ruby_nn21"></a>31.3.10 C++ Operators</H3>
|
||||
|
||||
|
||||
<p> For the most part, overloaded operators are handled
|
||||
|
@ -1959,7 +1959,7 @@ on operator overloading</a>. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn22"></a>26.3.11 C++ namespaces</H3>
|
||||
<H3><a name="Ruby_nn22"></a>31.3.11 C++ namespaces</H3>
|
||||
|
||||
|
||||
<p> SWIG is aware of C++ namespaces, but namespace names do not
|
||||
|
@ -2035,7 +2035,7 @@ identical symbol names, well, then you get what you deserve. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn23"></a>26.3.12 C++ templates</H3>
|
||||
<H3><a name="Ruby_nn23"></a>31.3.12 C++ templates</H3>
|
||||
|
||||
|
||||
<p> C++ templates don't present a huge problem for SWIG. However,
|
||||
|
@ -2079,7 +2079,7 @@ directive. For example: </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn23_1"></a>26.3.13 C++ Standard Template Library (STL)</H3>
|
||||
<H3><a name="Ruby_nn23_1"></a>31.3.13 C++ Standard Template Library (STL)</H3>
|
||||
|
||||
|
||||
<p> On a related note, the standard SWIG library contains a
|
||||
|
@ -2332,7 +2332,7 @@ chapter.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="C_STL_Functors"></a>26.3.14 C++ STL Functors</H3>
|
||||
<H3><a name="C_STL_Functors"></a>31.3.14 C++ STL Functors</H3>
|
||||
|
||||
|
||||
<p>Some containers in the STL allow you to modify their default
|
||||
|
@ -2532,7 +2532,7 @@ b<br style="font-weight: bold;">
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_C_Iterators"></a>26.3.15 C++ STL Iterators</H3>
|
||||
<H3><a name="Ruby_C_Iterators"></a>31.3.15 C++ STL Iterators</H3>
|
||||
|
||||
|
||||
<p>The STL is well known for the use of iterators. There
|
||||
|
@ -2743,7 +2743,7 @@ i<br>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn24"></a>26.3.16 C++ Smart Pointers</H3>
|
||||
<H3><a name="Ruby_nn24"></a>31.3.16 C++ Smart Pointers</H3>
|
||||
|
||||
|
||||
<p> In certain C++ programs, it is common to use classes that
|
||||
|
@ -2868,7 +2868,7 @@ method. For example: </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn25"></a>26.3.17 Cross-Language Polymorphism</H3>
|
||||
<H3><a name="Ruby_nn25"></a>31.3.17 Cross-Language Polymorphism</H3>
|
||||
|
||||
|
||||
<p> SWIG's Ruby module supports cross-language polymorphism
|
||||
|
@ -2881,7 +2881,7 @@ using this feature with Ruby. </p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn26"></a>26.3.17.1 Exception Unrolling</H4>
|
||||
<H4><a name="Ruby_nn26"></a>31.3.17.1 Exception Unrolling</H4>
|
||||
|
||||
|
||||
<p> Whenever a C++ director class routes one of its virtual
|
||||
|
@ -2919,7 +2919,7 @@ caught here and a C++ exception is raised in its place. </p>
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn27"></a>26.4 Naming</H2>
|
||||
<H2><a name="Ruby_nn27"></a>31.4 Naming</H2>
|
||||
|
||||
|
||||
<p>Ruby has several common naming conventions. Constants are
|
||||
|
@ -3015,7 +3015,7 @@ planned to become the default option in future releases.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn28"></a>26.4.1 Defining Aliases</H3>
|
||||
<H3><a name="Ruby_nn28"></a>31.4.1 Defining Aliases</H3>
|
||||
|
||||
|
||||
<p> It's a fairly common practice in the Ruby built-ins and
|
||||
|
@ -3107,7 +3107,7 @@ Features"</a>) for more details).</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn29"></a>26.4.2 Predicate Methods</H3>
|
||||
<H3><a name="Ruby_nn29"></a>31.4.2 Predicate Methods</H3>
|
||||
|
||||
|
||||
<p> Ruby methods that return a boolean value and end in a
|
||||
|
@ -3196,7 +3196,7 @@ Features"</a>) for more details). </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn30"></a>26.4.3 Bang Methods</H3>
|
||||
<H3><a name="Ruby_nn30"></a>31.4.3 Bang Methods</H3>
|
||||
|
||||
|
||||
<p> Ruby methods that modify an object in-place and end in an
|
||||
|
@ -3260,7 +3260,7 @@ Features"</a>) for more details). </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn31"></a>26.4.4 Getters and Setters</H3>
|
||||
<H3><a name="Ruby_nn31"></a>31.4.4 Getters and Setters</H3>
|
||||
|
||||
|
||||
<p> Often times a C++ library will expose properties through
|
||||
|
@ -3330,7 +3330,7 @@ methods to be exposed in Ruby as <tt>value</tt> and <tt>value=.
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn32"></a>26.5 Input and output parameters</H2>
|
||||
<H2><a name="Ruby_nn32"></a>31.5 Input and output parameters</H2>
|
||||
|
||||
|
||||
<p> A common problem in some C programs is handling parameters
|
||||
|
@ -3581,10 +3581,10 @@ of <tt>%apply</tt> </p>
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn33"></a>26.6 Exception handling </H2>
|
||||
<H2><a name="Ruby_nn33"></a>31.6 Exception handling </H2>
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn34"></a>26.6.1 Using the %exception directive </H3>
|
||||
<H3><a name="Ruby_nn34"></a>31.6.1 Using the %exception directive </H3>
|
||||
|
||||
|
||||
<p>The SWIG <tt>%exception</tt> directive can be
|
||||
|
@ -3679,7 +3679,7 @@ Features</a> for more examples.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn34_2"></a>26.6.2 Handling Ruby Blocks </H3>
|
||||
<H3><a name="Ruby_nn34_2"></a>31.6.2 Handling Ruby Blocks </H3>
|
||||
|
||||
|
||||
<p>One of the highlights of Ruby and most of its standard library
|
||||
|
@ -3860,7 +3860,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>26.6.3 Raising exceptions </H3>
|
||||
<H3><a name="Ruby_nn35"></a>31.6.3 Raising exceptions </H3>
|
||||
|
||||
|
||||
<p>There are three ways to raise exceptions from C++ code to
|
||||
|
@ -4621,7 +4621,7 @@ the built-in Ruby exception types.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn36"></a>26.6.4 Exception classes </H3>
|
||||
<H3><a name="Ruby_nn36"></a>31.6.4 Exception classes </H3>
|
||||
|
||||
|
||||
<p>Starting with SWIG 1.3.28, the Ruby module supports the <tt>%exceptionclass</tt>
|
||||
|
@ -4679,7 +4679,7 @@ providing for a more natural integration between C++ code and Ruby code.</p>
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn37"></a>26.7 Typemaps</H2>
|
||||
<H2><a name="Ruby_nn37"></a>31.7 Typemaps</H2>
|
||||
|
||||
|
||||
<p> This section describes how you can modify SWIG's default
|
||||
|
@ -4702,7 +4702,7 @@ of the primitive C-Ruby interface.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn38"></a>26.7.1 What is a typemap?</H3>
|
||||
<H3><a name="Ruby_nn38"></a>31.7.1 What is a typemap?</H3>
|
||||
|
||||
|
||||
<p> A typemap is nothing more than a code generation rule that is
|
||||
|
@ -4964,7 +4964,7 @@ to be used as follows (notice how the length parameter is omitted): </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_Typemap_scope"></a>26.7.2 Typemap scope</H3>
|
||||
<H3><a name="Ruby_Typemap_scope"></a>31.7.2 Typemap scope</H3>
|
||||
|
||||
|
||||
<p> Once defined, a typemap remains in effect for all of the
|
||||
|
@ -5012,7 +5012,7 @@ where the class itself is defined. For example:</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_Copying_a_typemap"></a>26.7.3 Copying a typemap</H3>
|
||||
<H3><a name="Ruby_Copying_a_typemap"></a>31.7.3 Copying a typemap</H3>
|
||||
|
||||
|
||||
<p> A typemap is copied by using assignment. For example:</p>
|
||||
|
@ -5114,7 +5114,7 @@ rules as for <tt>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_Deleting_a_typemap"></a>26.7.4 Deleting a typemap</H3>
|
||||
<H3><a name="Ruby_Deleting_a_typemap"></a>31.7.4 Deleting a typemap</H3>
|
||||
|
||||
|
||||
<p> A typemap can be deleted by simply defining no code. For
|
||||
|
@ -5166,7 +5166,7 @@ typemaps immediately after the clear operation.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_Placement_of_typemaps"></a>26.7.5 Placement of typemaps</H3>
|
||||
<H3><a name="Ruby_Placement_of_typemaps"></a>31.7.5 Placement of typemaps</H3>
|
||||
|
||||
|
||||
<p> Typemap declarations can be declared in the global scope,
|
||||
|
@ -5250,7 +5250,7 @@ string</tt>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn39"></a>26.7.6 Ruby typemaps</H3>
|
||||
<H3><a name="Ruby_nn39"></a>31.7.6 Ruby typemaps</H3>
|
||||
|
||||
|
||||
<p>The following list details all of the typemap methods that
|
||||
|
@ -5260,7 +5260,7 @@ can be used by the Ruby module: </p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_in_typemap"></a>26.7.6.1 "in" typemap</H4>
|
||||
<H4><a name="Ruby_in_typemap"></a>31.7.6.1 "in" typemap</H4>
|
||||
|
||||
|
||||
<p>Converts Ruby objects to input
|
||||
|
@ -5503,7 +5503,7 @@ arguments to be specified. For example:</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_typecheck_typemap"></a>26.7.6.2 "typecheck" typemap</H4>
|
||||
<H4><a name="Ruby_typecheck_typemap"></a>31.7.6.2 "typecheck" typemap</H4>
|
||||
|
||||
|
||||
<p> The "typecheck" typemap is used to support overloaded
|
||||
|
@ -5544,7 +5544,7 @@ on "Typemaps and Overloading."</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_out_typemap"></a>26.7.6.3 "out" typemap</H4>
|
||||
<H4><a name="Ruby_out_typemap"></a>31.7.6.3 "out" typemap</H4>
|
||||
|
||||
|
||||
<p>Converts return value of a C function
|
||||
|
@ -5776,7 +5776,7 @@ version of the C datatype matched by the typemap.</td>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_arginit_typemap"></a>26.7.6.4 "arginit" typemap</H4>
|
||||
<H4><a name="Ruby_arginit_typemap"></a>31.7.6.4 "arginit" typemap</H4>
|
||||
|
||||
|
||||
<p> The "arginit" typemap is used to set the initial value of a
|
||||
|
@ -5801,7 +5801,7 @@ applications. For example:</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_default_typemap"></a>26.7.6.5 "default" typemap</H4>
|
||||
<H4><a name="Ruby_default_typemap"></a>31.7.6.5 "default" typemap</H4>
|
||||
|
||||
|
||||
<p> The "default" typemap is used to turn an argument into a
|
||||
|
@ -5843,7 +5843,7 @@ default argument wrapping.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_check_typemap"></a>26.7.6.6 "check" typemap</H4>
|
||||
<H4><a name="Ruby_check_typemap"></a>31.7.6.6 "check" typemap</H4>
|
||||
|
||||
|
||||
<p> The "check" typemap is used to supply value checking code
|
||||
|
@ -5867,7 +5867,7 @@ arguments have been converted. For example:</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_argout_typemap_"></a>26.7.6.7 "argout" typemap</H4>
|
||||
<H4><a name="Ruby_argout_typemap_"></a>31.7.6.7 "argout" typemap</H4>
|
||||
|
||||
|
||||
<p> The "argout" typemap is used to return values from arguments.
|
||||
|
@ -6025,7 +6025,7 @@ some function like SWIG_Ruby_AppendOutput.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_freearg_typemap_"></a>26.7.6.8 "freearg" typemap</H4>
|
||||
<H4><a name="Ruby_freearg_typemap_"></a>31.7.6.8 "freearg" typemap</H4>
|
||||
|
||||
|
||||
<p> The "freearg" typemap is used to cleanup argument data. It is
|
||||
|
@ -6061,7 +6061,7 @@ abort prematurely.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_newfree_typemap"></a>26.7.6.9 "newfree" typemap</H4>
|
||||
<H4><a name="Ruby_newfree_typemap"></a>31.7.6.9 "newfree" typemap</H4>
|
||||
|
||||
|
||||
<p> The "newfree" typemap is used in conjunction with the <tt>%newobject</tt>
|
||||
|
@ -6092,7 +6092,7 @@ ownership and %newobject</a> for further details.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_memberin_typemap"></a>26.7.6.10 "memberin" typemap</H4>
|
||||
<H4><a name="Ruby_memberin_typemap"></a>31.7.6.10 "memberin" typemap</H4>
|
||||
|
||||
|
||||
<p> The "memberin" typemap is used to copy data from<em> an
|
||||
|
@ -6125,7 +6125,7 @@ other objects.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_varin_typemap"></a>26.7.6.11 "varin" typemap</H4>
|
||||
<H4><a name="Ruby_varin_typemap"></a>31.7.6.11 "varin" typemap</H4>
|
||||
|
||||
|
||||
<p> The "varin" typemap is used to convert objects in the target
|
||||
|
@ -6136,7 +6136,7 @@ This is implementation specific.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_varout_typemap_"></a>26.7.6.12 "varout" typemap</H4>
|
||||
<H4><a name="Ruby_varout_typemap_"></a>31.7.6.12 "varout" typemap</H4>
|
||||
|
||||
|
||||
<p> The "varout" typemap is used to convert a C/C++ object to an
|
||||
|
@ -6147,7 +6147,7 @@ This is implementation specific.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_throws_typemap"></a>26.7.6.13 "throws" typemap</H4>
|
||||
<H4><a name="Ruby_throws_typemap"></a>31.7.6.13 "throws" typemap</H4>
|
||||
|
||||
|
||||
<p> The "throws" typemap is only used when SWIG parses a C++
|
||||
|
@ -6206,7 +6206,7 @@ handling with %exception</a> section.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_directorin_typemap"></a>26.7.6.14 directorin typemap</H4>
|
||||
<H4><a name="Ruby_directorin_typemap"></a>31.7.6.14 directorin typemap</H4>
|
||||
|
||||
|
||||
<p>Converts C++ objects in director
|
||||
|
@ -6460,7 +6460,7 @@ referring to the class itself.</td>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_directorout_typemap"></a>26.7.6.15 directorout typemap</H4>
|
||||
<H4><a name="Ruby_directorout_typemap"></a>31.7.6.15 directorout typemap</H4>
|
||||
|
||||
|
||||
<p>Converts Ruby objects in director
|
||||
|
@ -6720,7 +6720,7 @@ exception.<br>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_directorargout_typemap"></a>26.7.6.16 directorargout typemap</H4>
|
||||
<H4><a name="Ruby_directorargout_typemap"></a>31.7.6.16 directorargout typemap</H4>
|
||||
|
||||
|
||||
<p>Output argument processing in director
|
||||
|
@ -6960,7 +6960,7 @@ referring to the instance of the class itself</td>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_ret_typemap"></a>26.7.6.17 ret typemap</H4>
|
||||
<H4><a name="Ruby_ret_typemap"></a>31.7.6.17 ret typemap</H4>
|
||||
|
||||
|
||||
<p>Cleanup of function return values
|
||||
|
@ -6970,7 +6970,7 @@ referring to the instance of the class itself</td>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_globalin_typemap"></a>26.7.6.18 globalin typemap</H4>
|
||||
<H4><a name="Ruby_globalin_typemap"></a>31.7.6.18 globalin typemap</H4>
|
||||
|
||||
|
||||
<p>Setting of C global variables
|
||||
|
@ -6980,7 +6980,7 @@ referring to the instance of the class itself</td>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn40"></a>26.7.7 Typemap variables</H3>
|
||||
<H3><a name="Ruby_nn40"></a>31.7.7 Typemap variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -7090,7 +7090,7 @@ being created. </div>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn41"></a>26.7.8 Useful Functions</H3>
|
||||
<H3><a name="Ruby_nn41"></a>31.7.8 Useful Functions</H3>
|
||||
|
||||
|
||||
<p> When you write a typemap, you usually have to work directly
|
||||
|
@ -7114,7 +7114,7 @@ across multiple languages.</p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn42"></a>26.7.8.1 C Datatypes to Ruby Objects</H4>
|
||||
<H4><a name="Ruby_nn42"></a>31.7.8.1 C Datatypes to Ruby Objects</H4>
|
||||
|
||||
|
||||
<div class="diagram">
|
||||
|
@ -7170,7 +7170,7 @@ SWIG_From_float(float)</td>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn43"></a>26.7.8.2 Ruby Objects to C Datatypes</H4>
|
||||
<H4><a name="Ruby_nn43"></a>31.7.8.2 Ruby Objects to C Datatypes</H4>
|
||||
|
||||
|
||||
<p>Here, while the Ruby versions return the value directly, the SWIG
|
||||
|
@ -7259,7 +7259,7 @@ Ruby_Format_TypeError( "$1_name", "$1_type","$symname", $argnum, $input
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn44"></a>26.7.8.3 Macros for VALUE</H4>
|
||||
<H4><a name="Ruby_nn44"></a>31.7.8.3 Macros for VALUE</H4>
|
||||
|
||||
|
||||
<p> <tt>RSTRING_LEN(str)</tt> </p>
|
||||
|
@ -7322,7 +7322,7 @@ Ruby_Format_TypeError( "$1_name", "$1_type","$symname", $argnum, $input
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn45"></a>26.7.8.4 Exceptions</H4>
|
||||
<H4><a name="Ruby_nn45"></a>31.7.8.4 Exceptions</H4>
|
||||
|
||||
|
||||
<p> <tt>void rb_raise(VALUE exception, const char *fmt,
|
||||
|
@ -7489,7 +7489,7 @@ arguments are interpreted as with <tt>printf()</tt>. </div>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn46"></a>26.7.8.5 Iterators</H4>
|
||||
<H4><a name="Ruby_nn46"></a>31.7.8.5 Iterators</H4>
|
||||
|
||||
|
||||
<p> <tt>void rb_iter_break()</tt> </p>
|
||||
|
@ -7591,7 +7591,7 @@ VALUE), VALUE value)</tt></p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn47"></a>26.7.9 Typemap Examples</H3>
|
||||
<H3><a name="Ruby_nn47"></a>31.7.9 Typemap Examples</H3>
|
||||
|
||||
|
||||
<p> This section includes a few examples of typemaps. For more
|
||||
|
@ -7602,7 +7602,7 @@ directory. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn48"></a>26.7.10 Converting a Ruby array to a char **</H3>
|
||||
<H3><a name="Ruby_nn48"></a>31.7.10 Converting a Ruby array to a char **</H3>
|
||||
|
||||
|
||||
<p> A common problem in many C programs is the processing of
|
||||
|
@ -7657,7 +7657,7 @@ after the execution of the C function. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn49"></a>26.7.11 Collecting arguments in a hash</H3>
|
||||
<H3><a name="Ruby_nn49"></a>31.7.11 Collecting arguments in a hash</H3>
|
||||
|
||||
|
||||
<p> Ruby's solution to the "keyword arguments" capability of some
|
||||
|
@ -7936,7 +7936,7 @@ directory of the SWIG distribution. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn50"></a>26.7.12 Pointer handling</H3>
|
||||
<H3><a name="Ruby_nn50"></a>31.7.12 Pointer handling</H3>
|
||||
|
||||
|
||||
<p> Occasionally, it might be necessary to convert pointer values
|
||||
|
@ -8035,7 +8035,7 @@ For example: </p>
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn51"></a>26.7.12.1 Ruby Datatype Wrapping</H4>
|
||||
<H4><a name="Ruby_nn51"></a>31.7.12.1 Ruby Datatype Wrapping</H4>
|
||||
|
||||
|
||||
<p> <tt>VALUE Data_Wrap_Struct(VALUE class, void
|
||||
|
@ -8086,7 +8086,7 @@ and assigns that pointer to <i>ptr</i>. </div>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn52"></a>26.7.13 Example: STL Vector to Ruby Array</H3>
|
||||
<H3><a name="Ruby_nn52"></a>31.7.13 Example: STL Vector to Ruby Array</H3>
|
||||
|
||||
|
||||
<p>Another use for macros and type maps is to create a Ruby array
|
||||
|
@ -8195,7 +8195,7 @@ the<a href="#Ruby_nn23_1"> C++ Standard Template Library</a>.<br>
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn65"></a>26.8 Docstring Features</H2>
|
||||
<H2><a name="Ruby_nn65"></a>31.8 Docstring Features</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -8256,7 +8256,7 @@ generate ri documentation from a c wrap file, you could do:</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn66"></a>26.8.1 Module docstring</H3>
|
||||
<H3><a name="Ruby_nn66"></a>31.8.1 Module docstring</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -8307,7 +8307,7 @@ macro. For example:
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn67"></a>26.8.2 %feature("autodoc")</H3>
|
||||
<H3><a name="Ruby_nn67"></a>31.8.2 %feature("autodoc")</H3>
|
||||
|
||||
|
||||
<p>Since SWIG does know everything about the function it wraps,
|
||||
|
@ -8336,7 +8336,7 @@ feature, described below.
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn68"></a>26.8.2.1 %feature("autodoc", "0")</H4>
|
||||
<H4><a name="Ruby_nn68"></a>31.8.2.1 %feature("autodoc", "0")</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -8384,7 +8384,7 @@ Then Ruby code like this will be generated:
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_autodoc1"></a>26.8.2.2 %feature("autodoc", "1")</H4>
|
||||
<H4><a name="Ruby_autodoc1"></a>31.8.2.2 %feature("autodoc", "1")</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -8416,7 +8416,7 @@ this:
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_autodoc2"></a>26.8.2.3 %feature("autodoc", "2")</H4>
|
||||
<H4><a name="Ruby_autodoc2"></a>31.8.2.3 %feature("autodoc", "2")</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -8432,7 +8432,7 @@ this:
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_feature_autodoc3"></a>26.8.2.4 %feature("autodoc", "3")</H4>
|
||||
<H4><a name="Ruby_feature_autodoc3"></a>31.8.2.4 %feature("autodoc", "3")</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -8460,7 +8460,7 @@ this:
|
|||
|
||||
|
||||
|
||||
<H4><a name="Ruby_nn70"></a>26.8.2.5 %feature("autodoc", "docstring")</H4>
|
||||
<H4><a name="Ruby_nn70"></a>31.8.2.5 %feature("autodoc", "docstring")</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -8488,7 +8488,7 @@ generated string. For example:
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn71"></a>26.8.3 %feature("docstring")</H3>
|
||||
<H3><a name="Ruby_nn71"></a>31.8.3 %feature("docstring")</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -8503,10 +8503,10 @@ docstring and they are output together. </p>
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn53"></a>26.9 Advanced Topics</H2>
|
||||
<H2><a name="Ruby_nn53"></a>31.9 Advanced Topics</H2>
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn54"></a>26.9.1 Operator overloading</H3>
|
||||
<H3><a name="Ruby_nn54"></a>31.9.1 Operator overloading</H3>
|
||||
|
||||
|
||||
<p> SWIG allows operator overloading with, by using the <tt>%extend</tt>
|
||||
|
@ -9523,7 +9523,7 @@ parses the expression <i>a != b</i> as <i>!(a == b)</i>.
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn55"></a>26.9.2 Creating Multi-Module Packages</H3>
|
||||
<H3><a name="Ruby_nn55"></a>31.9.2 Creating Multi-Module Packages</H3>
|
||||
|
||||
|
||||
<p> The chapter on <a href="Modules.html">Working
|
||||
|
@ -9704,7 +9704,7 @@ initialized: </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn56"></a>26.9.3 Specifying Mixin Modules</H3>
|
||||
<H3><a name="Ruby_nn56"></a>31.9.3 Specifying Mixin Modules</H3>
|
||||
|
||||
|
||||
<p> The Ruby language doesn't support multiple inheritance, but
|
||||
|
@ -9802,7 +9802,7 @@ Features"</a>) for more details). </p>
|
|||
|
||||
|
||||
|
||||
<H2><a name="Ruby_nn57"></a>26.10 Memory Management</H2>
|
||||
<H2><a name="Ruby_nn57"></a>31.10 Memory Management</H2>
|
||||
|
||||
|
||||
<p>One of the most common issues in generating SWIG bindings for
|
||||
|
@ -9849,7 +9849,7 @@ understanding of how the underlying library manages memory.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn58"></a>26.10.1 Mark and Sweep Garbage Collector </H3>
|
||||
<H3><a name="Ruby_nn58"></a>31.10.1 Mark and Sweep Garbage Collector </H3>
|
||||
|
||||
|
||||
<p>Ruby uses a mark and sweep garbage collector. When the garbage
|
||||
|
@ -9897,7 +9897,7 @@ this memory. </p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn59"></a>26.10.2 Object Ownership</H3>
|
||||
<H3><a name="Ruby_nn59"></a>31.10.2 Object Ownership</H3>
|
||||
|
||||
|
||||
<p>As described above, memory management depends on clearly
|
||||
|
@ -10124,7 +10124,7 @@ classes is:</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn60"></a>26.10.3 Object Tracking</H3>
|
||||
<H3><a name="Ruby_nn60"></a>31.10.3 Object Tracking</H3>
|
||||
|
||||
|
||||
<p>The remaining parts of this section will use the class library
|
||||
|
@ -10338,7 +10338,7 @@ methods.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn61"></a>26.10.4 Mark Functions</H3>
|
||||
<H3><a name="Ruby_nn61"></a>31.10.4 Mark Functions</H3>
|
||||
|
||||
|
||||
<p>With a bit more testing, we see that our class library still
|
||||
|
@ -10456,7 +10456,7 @@ test suite.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn62"></a>26.10.5 Free Functions</H3>
|
||||
<H3><a name="Ruby_nn62"></a>31.10.5 Free Functions</H3>
|
||||
|
||||
|
||||
<p>By default, SWIG creates a "free" function that is called when
|
||||
|
@ -10611,7 +10611,7 @@ been freed, and thus raises a runtime exception.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn63"></a>26.10.6 Embedded Ruby and the C++ Stack</H3>
|
||||
<H3><a name="Ruby_nn63"></a>31.10.6 Embedded Ruby and the C++ Stack</H3>
|
||||
|
||||
|
||||
<p>As has been said, the Ruby GC runs and marks objects before
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="SWIG"></a>28 SWIG Basics</H1>
|
||||
<H1><a name="SWIG"></a>5 SWIG Basics</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -88,7 +88,7 @@ Specific details about each target language are described in later
|
|||
chapters.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIG_nn2"></a>28.1 Running SWIG</H2>
|
||||
<H2><a name="SWIG_nn2"></a>5.1 Running SWIG</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -146,7 +146,7 @@ can be obtained by typing <tt>swig -help</tt> or <tt>swig
|
|||
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="SWIG_nn3"></a>28.1.1 Input format</H3>
|
||||
<H3><a name="SWIG_nn3"></a>5.1.1 Input format</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -198,7 +198,7 @@ semantics in SWIG is analogous to that of the declarations section
|
|||
used in input files to parser generation tools such as yacc or bison.
|
||||
</p>
|
||||
|
||||
<H3><a name="output"></a>28.1.2 SWIG Output</H3>
|
||||
<H3><a name="output"></a>5.1.2 SWIG Output</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -247,7 +247,7 @@ cppfiles/example_wrap.cpp
|
|||
pyfiles/example.py
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="SWIG_nn5"></a>28.1.3 Comments</H3>
|
||||
<H3><a name="SWIG_nn5"></a>5.1.3 Comments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -257,7 +257,7 @@ documentation files. However, this feature is currently under repair
|
|||
and will reappear in a later SWIG release.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn6"></a>28.1.4 C Preprocessor</H3>
|
||||
<H3><a name="SWIG_nn6"></a>5.1.4 C Preprocessor</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -281,7 +281,7 @@ make it more powerful than the normal C preprocessor. These
|
|||
extensions are described in the "<a href="Preprocessor.html#Preprocessor">Preprocessor</a>" chapter.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn7"></a>28.1.5 SWIG Directives</H3>
|
||||
<H3><a name="SWIG_nn7"></a>5.1.5 SWIG Directives</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -312,7 +312,7 @@ included in C header files using conditional compilation like this:
|
|||
it is parsing an input file.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn8"></a>28.1.6 Parser Limitations</H3>
|
||||
<H3><a name="SWIG_nn8"></a>5.1.6 Parser Limitations</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -400,7 +400,7 @@ does not utilize a separate <em>typedef-name</em> terminal symbol as
|
|||
described on p. 234 of K&R).
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIG_nn9"></a>28.2 Wrapping Simple C Declarations</H2>
|
||||
<H2><a name="SWIG_nn9"></a>5.2 Wrapping Simple C Declarations</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -463,7 +463,7 @@ environments, and semantics, it is not always possible to do so. The
|
|||
next few sections describes various aspects of this mapping.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn10"></a>28.2.1 Basic Type Handling</H3>
|
||||
<H3><a name="SWIG_nn10"></a>5.2.1 Basic Type Handling</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -588,7 +588,7 @@ will use the same internal representation (e.g., UCS-2 vs. UCS-4).
|
|||
You may need to write some special conversion functions.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn11"></a>28.2.2 Global Variables</H3>
|
||||
<H3><a name="SWIG_nn11"></a>5.2.2 Global Variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -643,7 +643,7 @@ Earlier versions of SWIG incorrectly handled <tt>const</tt> and created
|
|||
constants instead.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn12"></a>28.2.3 Constants</H3>
|
||||
<H3><a name="SWIG_nn12"></a>5.2.3 Constants</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -726,7 +726,7 @@ is only used when you want to add constants to the scripting language
|
|||
interface that are not defined in the original header file.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn13"></a>28.2.4 A brief word about <tt>const</tt></H3>
|
||||
<H3><a name="SWIG_nn13"></a>5.2.4 A brief word about <tt>const</tt></H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -822,7 +822,7 @@ const int spam = 42;
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="SWIG_nn14"></a>28.2.5 A cautionary tale of <tt>char *</tt></H3>
|
||||
<H3><a name="SWIG_nn14"></a>5.2.5 A cautionary tale of <tt>char *</tt></H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -861,7 +861,7 @@ input values. However, it must be noted that you could change the behavior of
|
|||
using <a href="Typemaps.html#Typemaps">typemaps</a>.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIG_nn15"></a>28.3 Pointers and complex objects</H2>
|
||||
<H2><a name="SWIG_nn15"></a>5.3 Pointers and complex objects</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -869,7 +869,7 @@ Most C programs manipulate arrays, structures, and other types of objects. This
|
|||
discusses the handling of these datatypes.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn16"></a>28.3.1 Simple pointers</H3>
|
||||
<H3><a name="SWIG_nn16"></a>5.3.1 Simple pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -935,7 +935,7 @@ simplified and less prone to error.
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<H3><a name="SWIG_nn17"></a>28.3.2 Run time pointer type checking</H3>
|
||||
<H3><a name="SWIG_nn17"></a>5.3.2 Run time pointer type checking</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -957,7 +957,7 @@ as sentinel values or to denote a missing/empty value. Therefore,
|
|||
SWIG leaves NULL pointer checking up to the application.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn18"></a>28.3.3 Derived types, structs, and classes</H3>
|
||||
<H3><a name="SWIG_nn18"></a>5.3.3 Derived types, structs, and classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1014,7 +1014,7 @@ In this case <tt>f1</tt>,<tt> f2</tt>, and <tt>buffer</tt> are all
|
|||
opaque objects containing C pointers. It doesn't matter what value
|
||||
they contain--our program works just fine without this knowledge.</p>
|
||||
|
||||
<H3><a name="SWIG_nn19"></a>28.3.4 Undefined datatypes</H3>
|
||||
<H3><a name="SWIG_nn19"></a>5.3.4 Undefined datatypes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1074,7 +1074,7 @@ The only way to fix this problem is to make sure you properly declare type names
|
|||
|
||||
<!-- We might want to add an error reporting flag to swig -->
|
||||
|
||||
<H3><a name="SWIG_nn20"></a>28.3.5 Typedef</H3>
|
||||
<H3><a name="SWIG_nn20"></a>5.3.5 Typedef</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1163,7 +1163,7 @@ The corresponding wrapper function will accept arguments of
|
|||
type <tt>unsigned int *</tt> or <tt>size_t *</tt>.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIG_nn21"></a>28.4 Other Practicalities</H2>
|
||||
<H2><a name="SWIG_nn21"></a>5.4 Other Practicalities</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1173,7 +1173,7 @@ more difficult to map to a scripting language interface. This section describes
|
|||
some of these issues.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn22"></a>28.4.1 Passing structures by value</H3>
|
||||
<H3><a name="SWIG_nn22"></a>5.4.1 Passing structures by value</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1204,7 +1204,7 @@ to Vectors instead of Vectors. For the most part, this transformation
|
|||
is transparent so you might not notice.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn23"></a>28.4.2 Return by value</H3>
|
||||
<H3><a name="SWIG_nn23"></a>5.4.2 Return by value</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1259,7 +1259,7 @@ don't work correctly if <tt>Vector</tt> doesn't define a default
|
|||
constructor. The section on SWIG and C++ has more information about this case.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn24"></a>28.4.3 Linking to structure variables</H3>
|
||||
<H3><a name="SWIG_nn24"></a>5.4.3 Linking to structure variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1291,7 +1291,7 @@ C++ classes must supply a properly defined copy constructor in order for
|
|||
assignment to work correctly.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn25"></a>28.4.4 Linking to <tt>char *</tt></H3>
|
||||
<H3><a name="SWIG_nn25"></a>5.4.4 Linking to <tt>char *</tt></H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1420,7 +1420,7 @@ value is not released.
|
|||
|
||||
|
||||
|
||||
<H3><a name="SWIG_nn26"></a>28.4.5 Arrays</H3>
|
||||
<H3><a name="SWIG_nn26"></a>5.4.5 Arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1556,7 +1556,7 @@ void pathname_set(char *value) {
|
|||
In the target language, the value can be set like a normal variable.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_readonly_variables"></a>28.4.6 Creating read-only variables</H3>
|
||||
<H3><a name="SWIG_readonly_variables"></a>5.4.6 Creating read-only variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1630,7 +1630,7 @@ generate a warning message. Simply change the directives to <tt>%immutable;</t
|
|||
<tt>%mutable;</tt> to silence the warning. Don't forget the extra semicolon!
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_rename_ignore"></a>28.4.7 Renaming and ignoring declarations</H3>
|
||||
<H3><a name="SWIG_rename_ignore"></a>5.4.7 Renaming and ignoring declarations</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1733,7 +1733,7 @@ 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>
|
||||
|
||||
<H3><a name="SWIG_default_args"></a>28.4.8 Default/optional arguments</H3>
|
||||
<H3><a name="SWIG_default_args"></a>5.4.8 Default/optional arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1770,7 +1770,7 @@ Please refer to the section on <a href="SWIGPlus.html#SWIGPlus_default_args">def
|
|||
in the C++ chapter for further details.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn30"></a>28.4.9 Pointers to functions and callbacks</H3>
|
||||
<H3><a name="SWIG_nn30"></a>5.4.9 Pointers to functions and callbacks</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1922,7 +1922,7 @@ can be accomplished with the use of typemaps and other advanced SWIG features.
|
|||
This is described in a later chapter.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIG_nn31"></a>28.5 Structures and unions</H2>
|
||||
<H2><a name="SWIG_nn31"></a>5.5 Structures and unions</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2004,7 +2004,7 @@ delete_Vector(v)
|
|||
However, most of SWIG's language modules also provide a high-level interface that is more convenient. Keep reading.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn32"></a>28.5.1 Typedef and structures</H3>
|
||||
<H3><a name="SWIG_nn32"></a>5.5.1 Typedef and structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2050,7 +2050,7 @@ vector_struct</tt>, SWIG knows that this is the same as
|
|||
<tt>Vector</tt> and it generates the appropriate type-checking code.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn33"></a>28.5.2 Character strings and structures</H3>
|
||||
<H3><a name="SWIG_nn33"></a>5.5.2 Character strings and structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2097,7 +2097,7 @@ Note: If the <tt>-c++</tt> option is used, <tt>new</tt> and <tt>delete</tt> are
|
|||
perform memory allocation.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn34"></a>28.5.3 Array members</H3>
|
||||
<H3><a name="SWIG_nn34"></a>5.5.3 Array members</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2119,7 +2119,7 @@ discussed in a later chapter. In many cases, the warning message is
|
|||
harmless.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_structure_data_members"></a>28.5.4 Structure data members</H3>
|
||||
<H3><a name="SWIG_structure_data_members"></a>5.5.4 Structure data members</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2225,7 +2225,7 @@ class, or union. This is unlikely to break existing code. However, if you ne
|
|||
datatype is really a struct, simply use a forward struct declaration such as <tt>"struct Foo;"</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn36"></a>28.5.5 C constructors and destructors </H3>
|
||||
<H3><a name="SWIG_nn36"></a>5.5.5 C constructors and destructors </H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2314,7 +2314,7 @@ the target languages, and is highly recommended you don't use them.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="SWIG_adding_member_functions"></a>28.5.6 Adding member functions to C structures</H3>
|
||||
<H3><a name="SWIG_adding_member_functions"></a>5.5.6 Adding member functions to C structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2540,7 +2540,7 @@ be used to extend a structure with more than just methods, a more suitable
|
|||
directive name has been chosen.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nested_structs"></a>28.5.7 Nested structures</H3>
|
||||
<H3><a name="SWIG_nested_structs"></a>5.5.7 Nested structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2618,7 +2618,7 @@ advisable to double-check them after running SWIG. Although,
|
|||
there is a good chance that they will work, you may have to
|
||||
modify the interface file in certain cases.
|
||||
|
||||
<H3><a name="SWIG_nn39"></a>28.5.8 Other things to note about structure wrapping</H3>
|
||||
<H3><a name="SWIG_nn39"></a>5.5.8 Other things to note about structure wrapping</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2680,7 +2680,7 @@ interface described here, most of SWIG's language modules use it in
|
|||
some way or another.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIG_nn40"></a>28.6 Code Insertion</H2>
|
||||
<H2><a name="SWIG_nn40"></a>5.6 Code Insertion</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2690,7 +2690,7 @@ additional C code to perform initialization or other operations.
|
|||
There are four common ways to insert code, but it's useful to know how the
|
||||
output of SWIG is structured first.</p>
|
||||
|
||||
<H3><a name="SWIG_nn41"></a>28.6.1 The output of SWIG</H3>
|
||||
<H3><a name="SWIG_nn41"></a>5.6.1 The output of SWIG</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2721,7 +2721,7 @@ the module upon loading.
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<H3><a name="SWIG_nn42"></a>28.6.2 Code insertion blocks</H3>
|
||||
<H3><a name="SWIG_nn42"></a>5.6.2 Code insertion blocks</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2792,7 +2792,7 @@ static Vector *new_Vector() {
|
|||
Vector *new_Vector();
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="SWIG_nn43"></a>28.6.3 Inlined code blocks</H3>
|
||||
<H3><a name="SWIG_nn43"></a>5.6.3 Inlined code blocks</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2819,7 +2819,7 @@ declaration. Since the code inside an <tt>%inline %{ ... %}</tt> block
|
|||
is given to both the C compiler and SWIG, it is illegal to include any
|
||||
SWIG directives inside a <tt>%{ ... %}</tt> block.</p>
|
||||
|
||||
<H3><a name="SWIG_nn44"></a>28.6.4 Initialization blocks</H3>
|
||||
<H3><a name="SWIG_nn44"></a>5.6.4 Initialization blocks</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2834,7 +2834,7 @@ initialization on module loading, you could write this:
|
|||
%}
|
||||
</pre></div>
|
||||
|
||||
<H2><a name="SWIG_nn45"></a>28.7 An Interface Building Strategy</H2>
|
||||
<H2><a name="SWIG_nn45"></a>5.7 An Interface Building Strategy</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2842,7 +2842,7 @@ This section describes the general approach for building interface
|
|||
with SWIG. The specifics related to a particular scripting language
|
||||
are found in later chapters.</p>
|
||||
|
||||
<H3><a name="SWIG_nn46"></a>28.7.1 Preparing a C program for SWIG</H3>
|
||||
<H3><a name="SWIG_nn46"></a>5.7.1 Preparing a C program for SWIG</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2890,7 +2890,7 @@ to the <a href="http://www.swig.org/mail.html">swig-devel mailing list</a> or to
|
|||
<a href="http://www.swig.org/bugs.html">SWIG bug tracker</a>.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIG_nn47"></a>28.7.2 The SWIG interface file</H3>
|
||||
<H3><a name="SWIG_nn47"></a>5.7.2 The SWIG interface file</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2938,7 +2938,7 @@ have made an interface file like this as well:</p>
|
|||
<p>
|
||||
Naturally, your mileage may vary.</p>
|
||||
|
||||
<H3><a name="SWIG_nn48"></a>28.7.3 Why use separate interface files?</H3>
|
||||
<H3><a name="SWIG_nn48"></a>5.7.3 Why use separate interface files?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2967,7 +2967,7 @@ and immediately see what is available without having to dig it out of
|
|||
header files.
|
||||
</ul>
|
||||
|
||||
<H3><a name="SWIG_nn49"></a>28.7.4 Getting the right header files</H3>
|
||||
<H3><a name="SWIG_nn49"></a>5.7.4 Getting the right header files</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2987,7 +2987,7 @@ include certain header files by using a <tt>%{,%}</tt> block like this:
|
|||
...
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="SWIG_nn50"></a>28.7.5 What to do with main()</H3>
|
||||
<H3><a name="SWIG_nn50"></a>5.7.5 What to do with main()</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="SWIGPlus"></a>29 SWIG and C++</H1>
|
||||
<H1><a name="SWIGPlus"></a>6 SWIG and C++</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -71,7 +71,7 @@ how SWIG wraps ANSI C. Support for C++ builds upon ANSI C
|
|||
wrapping and that material will be useful in understanding this chapter.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn2"></a>29.1 Comments on C++ Wrapping</H2>
|
||||
<H2><a name="SWIGPlus_nn2"></a>6.1 Comments on C++ Wrapping</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -113,7 +113,7 @@ crossing language boundaries and provides many opportunities to shoot
|
|||
yourself in the foot. You will just have to be careful.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn3"></a>29.2 Approach</H2>
|
||||
<H2><a name="SWIGPlus_nn3"></a>6.2 Approach</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -154,7 +154,7 @@ proxy classes. More detailed coverage can be found in the documentation
|
|||
for each target language.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn4"></a>29.3 Supported C++ features</H2>
|
||||
<H2><a name="SWIGPlus_nn4"></a>6.3 Supported C++ features</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -194,7 +194,7 @@ in future releases. However, we make no promises. Also, submitting a bug repor
|
|||
good way to get problems fixed (wink).
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn5"></a>29.4 Command line options and compilation</H2>
|
||||
<H2><a name="SWIGPlus_nn5"></a>6.4 Command line options and compilation</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -228,7 +228,7 @@ details. The SWIG Wiki also has further details.
|
|||
The <tt>-noproxy</tt> commandline option is recognised by many target languages and will generate just this
|
||||
interface as in earlier versions.
|
||||
|
||||
<H2><a name="SWIGPlus_nn38"></a>29.5 Proxy classes</H2>
|
||||
<H2><a name="SWIGPlus_nn38"></a>6.5 Proxy classes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -240,7 +240,7 @@ wrapped by a Python proxy class. Or if you're building a Java module, each
|
|||
C++ class is wrapped by a Java proxy class.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nn39"></a>29.5.1 Construction of proxy classes</H3>
|
||||
<H3><a name="SWIGPlus_nn39"></a>6.5.1 Construction of proxy classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -322,7 +322,7 @@ Whenever possible, proxies try to take advantage of language features that are s
|
|||
might include operator overloading, exception handling, and other features.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nn40"></a>29.5.2 Resource management in proxies</H3>
|
||||
<H3><a name="SWIGPlus_nn40"></a>6.5.2 Resource management in proxies</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -476,7 +476,7 @@ every possible memory management problem. However, proxies do provide a mechani
|
|||
can be used (if necessary) to address some of the more tricky memory management problems.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nn41"></a>29.5.3 Language specific details</H3>
|
||||
<H3><a name="SWIGPlus_nn41"></a>6.5.3 Language specific details</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -484,7 +484,7 @@ Language specific details on proxy classes are contained in the chapters describ
|
|||
chapter has merely introduced the topic in a very general way.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn6"></a>29.6 Simple C++ wrapping</H2>
|
||||
<H2><a name="SWIGPlus_nn6"></a>6.6 Simple C++ wrapping</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -517,7 +517,7 @@ To generate wrappers for this class, SWIG first reduces the class to a collectio
|
|||
accessor functions which are then used by the proxy classes.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nn7"></a>29.6.1 Constructors and destructors</H3>
|
||||
<H3><a name="SWIGPlus_nn7"></a>6.6.1 Constructors and destructors</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -534,7 +534,7 @@ void delete_List(List *l) {
|
|||
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="SWIGPlus_nn8"></a>29.6.2 Default constructors, copy constructors and implicit destructors</H3>
|
||||
<H3><a name="SWIGPlus_nn8"></a>6.6.2 Default constructors, copy constructors and implicit destructors</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -683,7 +683,7 @@ leaks, and so it is strongly recommended to not use them.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="SWIGPlus_nn9"></a>29.6.3 When constructor wrappers aren't created</H3>
|
||||
<H3><a name="SWIGPlus_nn9"></a>6.6.3 When constructor wrappers aren't created</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -760,7 +760,7 @@ public:
|
|||
More information about <tt>%feature</tt> can be found in the <a href="Customization.html#Customization">Customization features</a> chapter.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nn10"></a>29.6.4 Copy constructors</H3>
|
||||
<H3><a name="SWIGPlus_nn10"></a>6.6.4 Copy constructors</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -862,7 +862,7 @@ constructor is set to <tt>new_CopyFoo()</tt>. This is the same as in
|
|||
older versions.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nn11"></a>29.6.5 Member functions</H3>
|
||||
<H3><a name="SWIGPlus_nn11"></a>6.6.5 Member functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -888,7 +888,7 @@ wrapper functions. However, the name and calling convention of the
|
|||
low-level procedural wrappers match the accessor function prototype described above.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nn12"></a>29.6.6 Static members</H3>
|
||||
<H3><a name="SWIGPlus_nn12"></a>6.6.6 Static members</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -898,7 +898,7 @@ transformations. For example, the static member function
|
|||
in the generated wrapper code.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_member_data"></a>29.6.7 Member data</H3>
|
||||
<H3><a name="SWIGPlus_member_data"></a>6.6.7 Member data</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1082,7 +1082,7 @@ a few problems related to structure wrapping and some of SWIG's
|
|||
customization features.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_default_args"></a>29.7 Default arguments</H2>
|
||||
<H2><a name="SWIGPlus_default_args"></a>6.7 Default arguments</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1185,7 +1185,7 @@ Keyword arguments are a language feature of some scripting languages, for exampl
|
|||
SWIG is unable to support kwargs when wrapping overloaded methods, so the default approach cannot be used.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn15"></a>29.8 Protection</H2>
|
||||
<H2><a name="SWIGPlus_nn15"></a>6.8 Protection</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1205,7 +1205,7 @@ until you explicitly give a `<tt>public:</tt>' declaration (This is
|
|||
the same convention used by C++).
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn16"></a>29.9 Enums and constants</H2>
|
||||
<H2><a name="SWIGPlus_nn16"></a>6.9 Enums and constants</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1235,7 +1235,7 @@ Swig_STOUT = Swig::STOUT
|
|||
Members declared as <tt>const</tt> are wrapped as read-only members and do not create constants.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn17"></a>29.10 Friends</H2>
|
||||
<H2><a name="SWIGPlus_nn17"></a>6.10 Friends</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1296,7 +1296,7 @@ namespace bar {
|
|||
and a wrapper for the method 'blah' will not be generated.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn18"></a>29.11 References and pointers</H2>
|
||||
<H2><a name="SWIGPlus_nn18"></a>6.11 References and pointers</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1396,7 +1396,7 @@ templates and the STL. This was first added in SWIG-1.3.12.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="SWIGPlus_nn19"></a>29.12 Pass and return by value</H2>
|
||||
<H2><a name="SWIGPlus_nn19"></a>6.12 Pass and return by value</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1480,7 +1480,7 @@ It is not used for C++ pointers or references.
|
|||
if possible (consider using references instead).
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn20"></a>29.13 Inheritance</H2>
|
||||
<H2><a name="SWIGPlus_nn20"></a>6.13 Inheritance</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1666,7 +1666,7 @@ functions for virtual members that are already defined in a base
|
|||
class.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn21"></a>29.14 A brief discussion of multiple inheritance, pointers, and type checking</H2>
|
||||
<H2><a name="SWIGPlus_nn21"></a>6.14 A brief discussion of multiple inheritance, pointers, and type checking</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1798,7 +1798,7 @@ int y = B_function((B *) pB);
|
|||
In practice, the pointer is held as an integral number in the target language proxy class.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_overloaded_methods"></a>29.15 Wrapping Overloaded Functions and Methods</H2>
|
||||
<H2><a name="SWIGPlus_overloaded_methods"></a>6.15 Wrapping Overloaded Functions and Methods</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1861,7 +1861,7 @@ it might be used like this
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="SWIGPlus_nn24"></a>29.15.1 Dispatch function generation</H3>
|
||||
<H3><a name="SWIGPlus_nn24"></a>6.15.1 Dispatch function generation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1986,7 +1986,7 @@ checked in the same order as they appear in this ranking.
|
|||
If you're still confused, don't worry about it---SWIG is probably doing the right thing.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nn25"></a>29.15.2 Ambiguity in Overloading</H3>
|
||||
<H3><a name="SWIGPlus_nn25"></a>6.15.2 Ambiguity in Overloading</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2101,7 +2101,7 @@ it means that the target language module has not yet implemented support for ove
|
|||
functions and methods. The only way to fix the problem is to read the next section.
|
||||
</p>
|
||||
|
||||
<H3><a name="ambiguity_resolution_renaming"></a>29.15.3 Ambiguity resolution and renaming</H3>
|
||||
<H3><a name="ambiguity_resolution_renaming"></a>6.15.3 Ambiguity resolution and renaming</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2530,7 +2530,7 @@ to wrapping methods with default arguments was introduced.
|
|||
|
||||
</ul>
|
||||
|
||||
<H3><a name="SWIGPlus_nn27"></a>29.15.4 Comments on overloading</H3>
|
||||
<H3><a name="SWIGPlus_nn27"></a>6.15.4 Comments on overloading</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2547,7 +2547,7 @@ As a general rule, statically typed languages like Java are able to provide more
|
|||
than dynamically typed languages like Perl, Python, Ruby, and Tcl.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn28"></a>29.16 Wrapping overloaded operators</H2>
|
||||
<H2><a name="SWIGPlus_nn28"></a>6.16 Wrapping overloaded operators</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2731,7 +2731,7 @@ are ignored as well as conversion operators.
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<H2><a name="SWIGPlus_class_extension"></a>29.17 Class extension</H2>
|
||||
<H2><a name="SWIGPlus_class_extension"></a>6.17 Class extension</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2824,7 +2824,7 @@ be used to extend a structure with more than just methods, a more suitable
|
|||
directive name has been chosen.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn30"></a>29.18 Templates</H2>
|
||||
<H2><a name="SWIGPlus_nn30"></a>6.18 Templates</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3607,7 +3607,7 @@ as the class name. For example:
|
|||
Similar changes apply to typemaps and other customization features.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn31"></a>29.19 Namespaces</H2>
|
||||
<H2><a name="SWIGPlus_nn31"></a>6.19 Namespaces</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4052,7 +4052,7 @@ with any namespace awareness. In the future, language modules may or may not p
|
|||
more advanced namespace support.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_renaming_templated_types_namespaces"></a>29.20 Renaming templated types in namespaces</H2>
|
||||
<H2><a name="SWIGPlus_renaming_templated_types_namespaces"></a>6.20 Renaming templated types in namespaces</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4129,7 +4129,7 @@ namespace Space {
|
|||
</div>
|
||||
|
||||
|
||||
<H2><a name="SWIGPlus_exception_specifications"></a>29.21 Exception specifications</H2>
|
||||
<H2><a name="SWIGPlus_exception_specifications"></a>6.21 Exception specifications</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4180,7 +4180,7 @@ Consult the "<a href="Customization.html#exception">Exception handling with %exc
|
|||
The next section details a way of simulating an exception specification or replacing an existing one.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_catches"></a>29.22 Exception handling with %catches</H2>
|
||||
<H2><a name="SWIGPlus_catches"></a>6.22 Exception handling with %catches</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4230,7 +4230,7 @@ just a single catch handler for the base class, <tt>EBase</tt> will be generated
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="SWIGPlus_nn33"></a>29.23 Pointers to Members</H2>
|
||||
<H2><a name="SWIGPlus_nn33"></a>6.23 Pointers to Members</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4280,7 +4280,7 @@ when checking types. However, no such support is currently provided
|
|||
for member pointers.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn34"></a>29.24 Smart pointers and operator->()</H2>
|
||||
<H2><a name="SWIGPlus_nn34"></a>6.24 Smart pointers and operator->()</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4490,7 +4490,7 @@ p = f.__deref__() # Raw pointer from operator->
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="SWIGPlus_nn35"></a>29.25 Using declarations and inheritance</H2>
|
||||
<H2><a name="SWIGPlus_nn35"></a>6.25 Using declarations and inheritance</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4653,7 +4653,7 @@ public:
|
|||
</div>
|
||||
</ul>
|
||||
|
||||
<H2><a name="SWIGPlus_nested_classes"></a>29.26 Nested classes</H2>
|
||||
<H2><a name="SWIGPlus_nested_classes"></a>6.26 Nested classes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4744,7 +4744,7 @@ typedef Outer::Inner Inner;
|
|||
The downside to this approach is having to maintain two definitions of <tt>Inner</tt>, the real one and the one in the interface file that SWIG parses.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn37"></a>29.27 A brief rant about const-correctness</H2>
|
||||
<H2><a name="SWIGPlus_nn37"></a>6.27 A brief rant about const-correctness</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -4802,7 +4802,7 @@ using another tool if maintaining constness is the most important part
|
|||
of your project.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn42"></a>29.28 Where to go for more information</H2>
|
||||
<H2><a name="SWIGPlus_nn42"></a>6.28 Where to go for more information</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Scripting"></a>27 Scripting Languages</H1>
|
||||
<H1><a name="Scripting"></a>4 Scripting Languages</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -37,7 +37,7 @@ programming and the mechanisms by which scripting language interpreters
|
|||
access C and C++ code.
|
||||
</p>
|
||||
|
||||
<H2><a name="Scripting_nn2"></a>27.1 The two language view of the world</H2>
|
||||
<H2><a name="Scripting_nn2"></a>4.1 The two language view of the world</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -68,7 +68,7 @@ languages can be used for rapid prototyping, interactive debugging,
|
|||
scripting, and access to high-level data structures such associative
|
||||
arrays. </p>
|
||||
|
||||
<H2><a name="Scripting_nn3"></a>27.2 How does a scripting language talk to C?</H2>
|
||||
<H2><a name="Scripting_nn3"></a>4.2 How does a scripting language talk to C?</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -93,7 +93,7 @@ function, arguments, and so forth. The next few sections illustrate
|
|||
the process.
|
||||
</p>
|
||||
|
||||
<H3><a name="Scripting_nn4"></a>27.2.1 Wrapper functions</H3>
|
||||
<H3><a name="Scripting_nn4"></a>4.2.1 Wrapper functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -165,7 +165,7 @@ Python. Both require special wrappers to be written and both need
|
|||
additional initialization code. Only the specific details are
|
||||
different.</p>
|
||||
|
||||
<H3><a name="Scripting_nn5"></a>27.2.2 Variable linking</H3>
|
||||
<H3><a name="Scripting_nn5"></a>4.2.2 Variable linking</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -201,7 +201,7 @@ typing <tt>$Foo = 4</tt> would call the underlying set function to change
|
|||
the value.
|
||||
</p>
|
||||
|
||||
<H3><a name="Scripting_nn6"></a>27.2.3 Constants</H3>
|
||||
<H3><a name="Scripting_nn6"></a>4.2.3 Constants</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -222,7 +222,7 @@ functions for creating variables so installing constants is usually
|
|||
a trivial exercise.
|
||||
</p>
|
||||
|
||||
<H3><a name="Scripting_nn7"></a>27.2.4 Structures and classes</H3>
|
||||
<H3><a name="Scripting_nn7"></a>4.2.4 Structures and classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -283,7 +283,7 @@ internals of an object, the interpreter does not need to know anything
|
|||
about the actual representation of a <tt>Vector</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Scripting_nn8"></a>27.2.5 Proxy classes</H3>
|
||||
<H3><a name="Scripting_nn8"></a>4.2.5 Proxy classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -345,7 +345,7 @@ affect both objects equally and for all practical purposes, it appears
|
|||
as if you are simply manipulating a C/C++ object.
|
||||
</p>
|
||||
|
||||
<H2><a name="Scripting_nn9"></a>27.3 Building scripting language extensions</H2>
|
||||
<H2><a name="Scripting_nn9"></a>4.3 Building scripting language extensions</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -358,7 +358,7 @@ recompile the scripting language interpreter with your extensions
|
|||
added to it.
|
||||
</p>
|
||||
|
||||
<H3><a name="Scripting_nn10"></a>27.3.1 Shared libraries and dynamic loading</H3>
|
||||
<H3><a name="Scripting_nn10"></a>4.3.1 Shared libraries and dynamic loading</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -405,7 +405,7 @@ changing the link line to the following :</p>
|
|||
c++ -shared example.o example_wrap.o -o example.so
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Scripting_nn11"></a>27.3.2 Linking with shared libraries</H3>
|
||||
<H3><a name="Scripting_nn11"></a>4.3.2 Linking with shared libraries</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -452,7 +452,7 @@ the path using linker options instead.
|
|||
|
||||
</ul>
|
||||
|
||||
<H3><a name="Scripting_nn12"></a>27.3.3 Static linking</H3>
|
||||
<H3><a name="Scripting_nn12"></a>4.3.3 Static linking</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Tcl"></a>30 SWIG and Tcl</H1>
|
||||
<H1><a name="Tcl"></a>32 SWIG and Tcl</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -82,7 +82,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>30.1 Preliminaries</H2>
|
||||
<H2><a name="Tcl_nn2"></a>32.1 Preliminaries</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -108,7 +108,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>30.1.1 Getting the right header files</H3>
|
||||
<H3><a name="Tcl_nn3"></a>32.1.1 Getting the right header files</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -126,7 +126,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>30.1.2 Compiling a dynamic module</H3>
|
||||
<H3><a name="Tcl_nn4"></a>32.1.2 Compiling a dynamic module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -161,7 +161,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>30.1.3 Static linking</H3>
|
||||
<H3><a name="Tcl_nn5"></a>32.1.3 Static linking</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -227,7 +227,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>30.1.4 Using your module</H3>
|
||||
<H3><a name="Tcl_nn6"></a>32.1.4 Using your module</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -355,7 +355,7 @@ to the default system configuration (this requires root access and you will need
|
|||
the man pages).
|
||||
</p>
|
||||
|
||||
<H3><a name="Tcl_nn7"></a>30.1.5 Compilation of C++ extensions</H3>
|
||||
<H3><a name="Tcl_nn7"></a>32.1.5 Compilation of C++ extensions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -438,7 +438,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>30.1.6 Compiling for 64-bit platforms</H3>
|
||||
<H3><a name="Tcl_nn8"></a>32.1.6 Compiling for 64-bit platforms</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -465,7 +465,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>30.1.7 Setting a package prefix</H3>
|
||||
<H3><a name="Tcl_nn9"></a>32.1.7 Setting a package prefix</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -484,7 +484,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>30.1.8 Using namespaces</H3>
|
||||
<H3><a name="Tcl_nn10"></a>32.1.8 Using namespaces</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -506,7 +506,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>30.2 Building Tcl/Tk Extensions under Windows 95/NT</H2>
|
||||
<H2><a name="Tcl_nn11"></a>32.2 Building Tcl/Tk Extensions under Windows 95/NT</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -517,7 +517,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>30.2.1 Running SWIG from Developer Studio</H3>
|
||||
<H3><a name="Tcl_nn12"></a>32.2.1 Running SWIG from Developer Studio</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -575,7 +575,7 @@ MSDOS > tclsh80
|
|||
%
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Tcl_nn13"></a>30.2.2 Using NMAKE</H3>
|
||||
<H3><a name="Tcl_nn13"></a>32.2.2 Using NMAKE</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -638,7 +638,7 @@ to get you started. With a little practice, you'll be making lots of
|
|||
Tcl extensions.
|
||||
</p>
|
||||
|
||||
<H2><a name="Tcl_nn14"></a>30.3 A tour of basic C/C++ wrapping</H2>
|
||||
<H2><a name="Tcl_nn14"></a>32.3 A tour of basic C/C++ wrapping</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -649,7 +649,7 @@ classes. This section briefly covers the essential aspects of this
|
|||
wrapping.
|
||||
</p>
|
||||
|
||||
<H3><a name="Tcl_nn15"></a>30.3.1 Modules</H3>
|
||||
<H3><a name="Tcl_nn15"></a>32.3.1 Modules</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -683,7 +683,7 @@ To fix this, supply an extra argument to <tt>load</tt> like this:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Tcl_nn16"></a>30.3.2 Functions</H3>
|
||||
<H3><a name="Tcl_nn16"></a>32.3.2 Functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -708,7 +708,7 @@ like you think it does:
|
|||
%
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Tcl_nn17"></a>30.3.3 Global variables</H3>
|
||||
<H3><a name="Tcl_nn17"></a>32.3.3 Global variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -788,7 +788,7 @@ extern char *path; // Read-only (due to %immutable)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Tcl_nn18"></a>30.3.4 Constants and enums</H3>
|
||||
<H3><a name="Tcl_nn18"></a>32.3.4 Constants and enums</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -872,7 +872,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>30.3.5 Pointers</H3>
|
||||
<H3><a name="Tcl_nn19"></a>32.3.5 Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -968,7 +968,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>30.3.6 Structures</H3>
|
||||
<H3><a name="Tcl_nn20"></a>32.3.6 Structures</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1250,7 +1250,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>30.3.7 C++ classes</H3>
|
||||
<H3><a name="Tcl_nn21"></a>32.3.7 C++ classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1317,7 +1317,7 @@ In Tcl, the static member is accessed as follows:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Tcl_nn22"></a>30.3.8 C++ inheritance</H3>
|
||||
<H3><a name="Tcl_nn22"></a>32.3.8 C++ inheritance</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1366,7 +1366,7 @@ For instance:
|
|||
It is safe to use multiple inheritance with SWIG.
|
||||
</p>
|
||||
|
||||
<H3><a name="Tcl_nn23"></a>30.3.9 Pointers, references, values, and arrays</H3>
|
||||
<H3><a name="Tcl_nn23"></a>32.3.9 Pointers, references, values, and arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1420,7 +1420,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>30.3.10 C++ overloaded functions</H3>
|
||||
<H3><a name="Tcl_nn24"></a>32.3.10 C++ overloaded functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1543,7 +1543,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>30.3.11 C++ operators</H3>
|
||||
<H3><a name="Tcl_nn25"></a>32.3.11 C++ operators</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1645,7 +1645,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>30.3.12 C++ namespaces</H3>
|
||||
<H3><a name="Tcl_nn26"></a>32.3.12 C++ namespaces</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1709,7 +1709,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>30.3.13 C++ templates</H3>
|
||||
<H3><a name="Tcl_nn27"></a>32.3.13 C++ templates</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1761,7 +1761,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>30.3.14 C++ Smart Pointers</H3>
|
||||
<H3><a name="Tcl_nn28"></a>32.3.14 C++ Smart Pointers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1845,7 +1845,7 @@ simply use the <tt>__deref__()</tt> method. For example:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Tcl_nn29"></a>30.4 Further details on the Tcl class interface</H2>
|
||||
<H2><a name="Tcl_nn29"></a>32.4 Further details on the Tcl class interface</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1858,7 +1858,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>30.4.1 Proxy classes</H3>
|
||||
<H3><a name="Tcl_nn30"></a>32.4.1 Proxy classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1923,7 +1923,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>30.4.2 Memory management</H3>
|
||||
<H3><a name="Tcl_nn31"></a>32.4.2 Memory management</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2111,7 +2111,7 @@ typemaps--an advanced topic discussed later.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Tcl_nn32"></a>30.5 Input and output parameters</H2>
|
||||
<H2><a name="Tcl_nn32"></a>32.5 Input and output parameters</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2299,7 +2299,7 @@ set c [lindex $dim 1]
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Tcl_nn33"></a>30.6 Exception handling </H2>
|
||||
<H2><a name="Tcl_nn33"></a>32.6 Exception handling </H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2433,7 +2433,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>30.7 Typemaps</H2>
|
||||
<H2><a name="Tcl_nn34"></a>32.7 Typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2450,7 +2450,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>30.7.1 What is a typemap?</H3>
|
||||
<H3><a name="Tcl_nn35"></a>32.7.1 What is a typemap?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2567,7 +2567,7 @@ parameter is omitted):
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Tcl_nn36"></a>30.7.2 Tcl typemaps</H3>
|
||||
<H3><a name="Tcl_nn36"></a>32.7.2 Tcl typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2705,7 +2705,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>30.7.3 Typemap variables</H3>
|
||||
<H3><a name="Tcl_nn37"></a>32.7.3 Typemap variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2776,7 +2776,7 @@ properly assigned.
|
|||
The Tcl name of the wrapper function being created.
|
||||
</div>
|
||||
|
||||
<H3><a name="Tcl_nn38"></a>30.7.4 Converting a Tcl list to a char ** </H3>
|
||||
<H3><a name="Tcl_nn38"></a>32.7.4 Converting a Tcl list to a char ** </H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2838,7 +2838,7 @@ argv[2] = Larry
|
|||
3
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Tcl_nn39"></a>30.7.5 Returning values in arguments</H3>
|
||||
<H3><a name="Tcl_nn39"></a>32.7.5 Returning values in arguments</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2880,7 +2880,7 @@ result, a Tcl function using these typemaps will work like this :
|
|||
%
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="Tcl_nn40"></a>30.7.6 Useful functions</H3>
|
||||
<H3><a name="Tcl_nn40"></a>32.7.6 Useful functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2957,7 +2957,7 @@ int Tcl_IsShared(Tcl_Obj *obj);
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Tcl_nn41"></a>30.7.7 Standard typemaps</H3>
|
||||
<H3><a name="Tcl_nn41"></a>32.7.7 Standard typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3041,7 +3041,7 @@ work)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Tcl_nn42"></a>30.7.8 Pointer handling</H3>
|
||||
<H3><a name="Tcl_nn42"></a>32.7.8 Pointer handling</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3117,7 +3117,7 @@ For example:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Tcl_nn43"></a>30.8 Turning a SWIG module into a Tcl Package.</H2>
|
||||
<H2><a name="Tcl_nn43"></a>32.8 Turning a SWIG module into a Tcl Package.</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3189,7 +3189,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>30.9 Building new kinds of Tcl interfaces (in Tcl)</H2>
|
||||
<H2><a name="Tcl_nn44"></a>32.9 Building new kinds of Tcl interfaces (in Tcl)</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3288,7 +3288,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>30.9.1 Proxy classes</H3>
|
||||
<H3><a name="Tcl_nn45"></a>32.9.1 Proxy classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Typemaps"></a>31 Typemaps</H1>
|
||||
<H1><a name="Typemaps"></a>10 Typemaps</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -85,7 +85,7 @@
|
|||
<b>Disclaimer: This chapter is under construction!</b>
|
||||
</p>
|
||||
|
||||
<H2><a name="Typemaps_nn2"></a>31.1 Introduction</H2>
|
||||
<H2><a name="Typemaps_nn2"></a>10.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -102,7 +102,7 @@ to re-read the earlier chapters if you have found your way to this
|
|||
chapter with only a vague idea of what SWIG already does by default.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn3"></a>31.1.1 Type conversion</H3>
|
||||
<H3><a name="Typemaps_nn3"></a>10.1.1 Type conversion</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -195,7 +195,7 @@ to read the extension documentation for your favorite language to know
|
|||
how it works (an exercise left to the reader).
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn4"></a>31.1.2 Typemaps</H3>
|
||||
<H3><a name="Typemaps_nn4"></a>10.1.2 Typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -293,7 +293,7 @@ parts of the generated wrapper functions. Because arbitrary code can be insert
|
|||
possible to completely change the way in which values are converted.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn5"></a>31.1.3 Pattern matching</H3>
|
||||
<H3><a name="Typemaps_nn5"></a>10.1.3 Pattern matching</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -395,7 +395,7 @@ In this case, a single input object is expanded into a pair of C arguments. Thi
|
|||
provides a hint to the unusual variable naming scheme involving <tt>$1</tt>, <tt>$2</tt>, and so forth.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn6"></a>31.1.4 Reusing typemaps</H3>
|
||||
<H3><a name="Typemaps_nn6"></a>10.1.4 Reusing typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -451,7 +451,7 @@ typedef int size_t;
|
|||
then SWIG already knows that the <tt>int</tt> typemaps apply. You don't have to do anything.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn7"></a>31.1.5 What can be done with typemaps?</H3>
|
||||
<H3><a name="Typemaps_nn7"></a>10.1.5 What can be done with typemaps?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -563,7 +563,7 @@ typemaps that expand upon this list. For example, the Java module defines a var
|
|||
aspects of the Java bindings. Consult language specific documentation for further details.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn8"></a>31.1.6 What can't be done with typemaps?</H3>
|
||||
<H3><a name="Typemaps_nn8"></a>10.1.6 What can't be done with typemaps?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -626,7 +626,7 @@ void wrap_foo(char *s, int x) {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Typemaps_nn9"></a>31.1.7 The rest of this chapter</H3>
|
||||
<H3><a name="Typemaps_nn9"></a>10.1.7 The rest of this chapter</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -646,14 +646,14 @@ of "The C Programming Language" by Kernighan and Ritchie or
|
|||
"The C++ Programming Language" by Stroustrup before going any further.
|
||||
</p>
|
||||
|
||||
<H2><a name="Typemaps_nn10"></a>31.2 Typemap specifications</H2>
|
||||
<H2><a name="Typemaps_nn10"></a>10.2 Typemap specifications</H2>
|
||||
|
||||
|
||||
<p>
|
||||
This section describes the behavior of the <tt>%typemap</tt> directive itself.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn11"></a>31.2.1 Defining a typemap</H3>
|
||||
<H3><a name="Typemaps_nn11"></a>10.2.1 Defining a typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -765,7 +765,7 @@ Admittedly, it's not the most readable syntax at first glance. However, the pur
|
|||
individual pieces will become clear.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn12"></a>31.2.2 Typemap scope</H3>
|
||||
<H3><a name="Typemaps_nn12"></a>10.2.2 Typemap scope</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -815,7 +815,7 @@ class Foo {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Typemaps_nn13"></a>31.2.3 Copying a typemap</H3>
|
||||
<H3><a name="Typemaps_nn13"></a>10.2.3 Copying a typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -873,7 +873,7 @@ The patterns for <tt>%apply</tt> follow the same rules as for <tt>%typemap</tt>.
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Typemaps_nn14"></a>31.2.4 Deleting a typemap</H3>
|
||||
<H3><a name="Typemaps_nn14"></a>10.2.4 Deleting a typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -906,7 +906,7 @@ For example:
|
|||
after the clear operation.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn15"></a>31.2.5 Placement of typemaps</H3>
|
||||
<H3><a name="Typemaps_nn15"></a>10.2.5 Placement of typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -986,14 +986,14 @@ It should be noted that for scoping to work, SWIG has to know that <tt>string</t
|
|||
within a particular namespace. In this example, this is done using the class declaration <tt>class string</tt>.
|
||||
</p>
|
||||
|
||||
<H2><a name="Typemaps_nn16"></a>31.3 Pattern matching rules</H2>
|
||||
<H2><a name="Typemaps_nn16"></a>10.3 Pattern matching rules</H2>
|
||||
|
||||
|
||||
<p>
|
||||
The section describes the pattern matching rules by which C datatypes are associated with typemaps.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn17"></a>31.3.1 Basic matching rules</H3>
|
||||
<H3><a name="Typemaps_nn17"></a>10.3.1 Basic matching rules</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1084,7 +1084,7 @@ void F(int x[1000]); // int [ANY] rule (typemap 5)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Typemaps_nn18"></a>31.3.2 Typedef reductions</H3>
|
||||
<H3><a name="Typemaps_nn18"></a>10.3.2 Typedef reductions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1239,7 +1239,7 @@ is rather esoteric--there's little practical reason to write a typemap quite lik
|
|||
to confuse your coworkers even more.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn19"></a>31.3.3 Default typemaps</H3>
|
||||
<H3><a name="Typemaps_nn19"></a>10.3.3 Default typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1327,7 +1327,7 @@ definitions are usually found in the SWIG library in a file such as
|
|||
<tt>python.swg</tt>, <tt>tcl8.swg</tt>, etc.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_mixed_default"></a>31.3.4 Mixed default typemaps</H3>
|
||||
<H3><a name="Typemaps_mixed_default"></a>10.3.4 Mixed default typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1376,7 +1376,7 @@ Expect to see them being used more and more within the various libraries in late
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Typemaps_nn20"></a>31.3.5 Multi-arguments typemaps</H3>
|
||||
<H3><a name="Typemaps_nn20"></a>10.3.5 Multi-arguments typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1406,7 +1406,7 @@ but all subsequent arguments must match exactly.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Typemaps_nn21"></a>31.4 Code generation rules</H2>
|
||||
<H2><a name="Typemaps_nn21"></a>10.4 Code generation rules</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1414,7 +1414,7 @@ This section describes rules by which typemap code is inserted into
|
|||
the generated wrapper code.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn22"></a>31.4.1 Scope</H3>
|
||||
<H3><a name="Typemaps_nn22"></a>10.4.1 Scope</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1488,7 +1488,7 @@ These two forms are mainly used for cosmetics--the specified code is not enclose
|
|||
a block scope when it is emitted. This sometimes results in a less complicated looking wrapper function.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn23"></a>31.4.2 Declaring new local variables</H3>
|
||||
<H3><a name="Typemaps_nn23"></a>10.4.2 Declaring new local variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1639,7 +1639,7 @@ each type must have its own local variable declaration.
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Typemaps_special_variables"></a>31.4.3 Special variables</H3>
|
||||
<H3><a name="Typemaps_special_variables"></a>10.4.3 Special variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1890,7 +1890,7 @@ Another approach, which only works for arrays is to use the <tt>$1_basetype</tt>
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Typemaps_nn25"></a>31.5 Common typemap methods</H2>
|
||||
<H2><a name="Typemaps_nn25"></a>10.5 Common typemap methods</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1898,7 +1898,7 @@ The set of typemaps recognized by a language module may vary. However,
|
|||
the following typemap methods are nearly universal:
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn26"></a>31.5.1 "in" typemap</H3>
|
||||
<H3><a name="Typemaps_nn26"></a>10.5.1 "in" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1953,7 +1953,7 @@ At this time, only zero or one arguments may be converted.
|
|||
is the same as the old "ignore" typemap.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn27"></a>31.5.2 "typecheck" typemap</H3>
|
||||
<H3><a name="Typemaps_nn27"></a>10.5.2 "typecheck" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -1979,7 +1979,7 @@ If you define new "in" typemaps <em>and</em> your program uses overloaded method
|
|||
"typecheck" typemaps. More details about this follow in a later section on "Typemaps and Overloading."
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn28"></a>31.5.3 "out" typemap</H3>
|
||||
<H3><a name="Typemaps_nn28"></a>10.5.3 "out" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2006,7 +2006,7 @@ $symname - Name of function/method being wrapped
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Typemaps_nn29"></a>31.5.4 "arginit" typemap</H3>
|
||||
<H3><a name="Typemaps_nn29"></a>10.5.4 "arginit" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2025,7 +2025,7 @@ For example:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Typemaps_nn30"></a>31.5.5 "default" typemap</H3>
|
||||
<H3><a name="Typemaps_nn30"></a>10.5.5 "default" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2058,7 +2058,7 @@ See the <a href="SWIG.html#SWIG_default_args">Default/optional arguments</a> sec
|
|||
for further information on default argument wrapping.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn31"></a>31.5.6 "check" typemap</H3>
|
||||
<H3><a name="Typemaps_nn31"></a>10.5.6 "check" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2077,7 +2077,7 @@ converted. For example:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Typemaps_nn32"></a>31.5.7 "argout" typemap</H3>
|
||||
<H3><a name="Typemaps_nn32"></a>10.5.7 "argout" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2123,7 +2123,7 @@ return values are often appended to return value of the function.
|
|||
See the <tt>typemaps.i</tt> library for examples.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn33"></a>31.5.8 "freearg" typemap</H3>
|
||||
<H3><a name="Typemaps_nn33"></a>10.5.8 "freearg" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2156,7 +2156,7 @@ be used in other typemaps whenever a wrapper function needs to abort
|
|||
prematurely.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn34"></a>31.5.9 "newfree" typemap</H3>
|
||||
<H3><a name="Typemaps_nn34"></a>10.5.9 "newfree" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2185,7 +2185,7 @@ string *foo();
|
|||
See <a href="Customization.html#ownership">Object ownership and %newobject</a> for further details.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn35"></a>31.5.10 "memberin" typemap</H3>
|
||||
<H3><a name="Typemaps_nn35"></a>10.5.10 "memberin" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2207,7 +2207,7 @@ It is rarely necessary to write "memberin" typemaps---SWIG already provides
|
|||
a default implementation for arrays, strings, and other objects.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn36"></a>31.5.11 "varin" typemap</H3>
|
||||
<H3><a name="Typemaps_nn36"></a>10.5.11 "varin" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2215,7 +2215,7 @@ The "varin" typemap is used to convert objects in the target language to C for t
|
|||
purposes of assigning to a C/C++ global variable. This is implementation specific.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn37"></a>31.5.12 "varout" typemap</H3>
|
||||
<H3><a name="Typemaps_nn37"></a>10.5.12 "varout" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2223,7 +2223,7 @@ The "varout" typemap is used to convert a C/C++ object to an object in the targe
|
|||
language when reading a C/C++ global variable. This is implementation specific.
|
||||
</p>
|
||||
|
||||
<H3><a name="throws_typemap"></a>31.5.13 "throws" typemap</H3>
|
||||
<H3><a name="throws_typemap"></a>10.5.13 "throws" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2269,7 +2269,7 @@ Note that if your methods do not have an exception specification yet they do thr
|
|||
For a neat way to handle these, see the <a href="Customization.html#exception">Exception handling with %exception</a> section.
|
||||
</p>
|
||||
|
||||
<H2><a name="Typemaps_nn39"></a>31.6 Some typemap examples</H2>
|
||||
<H2><a name="Typemaps_nn39"></a>10.6 Some typemap examples</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2277,7 +2277,7 @@ This section contains a few examples. Consult language module documentation
|
|||
for more examples.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn40"></a>31.6.1 Typemaps for arrays</H3>
|
||||
<H3><a name="Typemaps_nn40"></a>10.6.1 Typemaps for arrays</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2537,7 +2537,7 @@ Now, you will find that member access is quite nice:
|
|||
useless and has since been eliminated. To return structure members, simply use the "out" typemap.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn41"></a>31.6.2 Implementing constraints with typemaps</H3>
|
||||
<H3><a name="Typemaps_nn41"></a>10.6.2 Implementing constraints with typemaps</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2589,7 +2589,7 @@ rather than blindly passing values to the underlying C/C++ program.</p>
|
|||
Note: A more advanced constraint checking system is in development. Stay tuned.
|
||||
</p>
|
||||
|
||||
<H2><a name="Typemaps_nn43"></a>31.7 Typemaps for multiple languages</H2>
|
||||
<H2><a name="Typemaps_nn43"></a>10.7 Typemaps for multiple languages</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2619,7 +2619,7 @@ The example above also shows a common approach of issuing a warning for an as ye
|
|||
<tt>%typemap(ruby,in) int "$1 = NUM2INT($input);"</tt>.
|
||||
</p>
|
||||
|
||||
<H2><a name="Typemaps_nn42"></a>31.8 Multi-argument typemaps</H2>
|
||||
<H2><a name="Typemaps_nn42"></a>10.8 Multi-argument typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2884,7 +2884,7 @@ when crossing languages you may need to worry about issues such as row-major vs.
|
|||
ordering (and perform conversions if needed).
|
||||
</p>
|
||||
|
||||
<H2><a name="runtime_type_checker"></a>31.9 The run-time type checker</H2>
|
||||
<H2><a name="runtime_type_checker"></a>10.9 The run-time type checker</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -2910,7 +2910,7 @@ language modules.</li>
|
|||
<li>Modules can be unloaded from the type system.</li>
|
||||
</ul>
|
||||
|
||||
<H3><a name="Typemaps_nn45"></a>31.9.1 Implementation</H3>
|
||||
<H3><a name="Typemaps_nn45"></a>10.9.1 Implementation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3096,7 +3096,7 @@ structures rather than creating new ones. These <tt>swig_module_info</tt>
|
|||
structures are chained together in a circularly linked list.
|
||||
</p>
|
||||
|
||||
<H3><a name="Typemaps_nn46"></a>31.9.2 Usage</H3>
|
||||
<H3><a name="Typemaps_nn46"></a>10.9.2 Usage</H3>
|
||||
|
||||
|
||||
<p>This section covers how to use these functions from typemaps. To learn how to
|
||||
|
@ -3190,7 +3190,7 @@ probably just look at the output of SWIG to get a better sense for how types are
|
|||
managed.
|
||||
</p>
|
||||
|
||||
<H2><a name="Typemaps_overloading"></a>31.10 Typemaps and overloading</H2>
|
||||
<H2><a name="Typemaps_overloading"></a>10.10 Typemaps and overloading</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3499,7 +3499,7 @@ Subsequent "in" typemaps would then perform more extensive type-checking.
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<H2><a name="Typemaps_nn48"></a>31.11 More about <tt>%apply</tt> and <tt>%clear</tt></H2>
|
||||
<H2><a name="Typemaps_nn48"></a>10.11 More about <tt>%apply</tt> and <tt>%clear</tt></H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3584,7 +3584,7 @@ example:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Typemaps_nn49"></a>31.12 Reducing wrapper code size</H2>
|
||||
<H2><a name="Typemaps_nn49"></a>10.12 Reducing wrapper code size</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3665,7 +3665,7 @@ convert_float_array(PyObject *input, int size) {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Typemaps_nn47"></a>31.13 Passing data between typemaps</H2>
|
||||
<H2><a name="Typemaps_nn47"></a>10.13 Passing data between typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -3702,7 +3702,7 @@ sure that the typemaps sharing information have exactly the same types and names
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Typemaps_nn51"></a>31.14 Where to go for more information?</H2>
|
||||
<H2><a name="Typemaps_nn51"></a>10.14 Where to go for more information?</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Varargs"></a>32 Variable Length Arguments</H1>
|
||||
<H1><a name="Varargs"></a>13 Variable Length Arguments</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -42,7 +42,7 @@ added in SWIG-1.3.12. Most other wrapper generation tools have
|
|||
wisely chosen to avoid this issue.
|
||||
</p>
|
||||
|
||||
<H2><a name="Varargs_nn2"></a>32.1 Introduction</H2>
|
||||
<H2><a name="Varargs_nn2"></a>13.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -139,7 +139,7 @@ List make_list(const char *s, ...) {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Varargs_nn3"></a>32.2 The Problem</H2>
|
||||
<H2><a name="Varargs_nn3"></a>13.2 The Problem</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -232,7 +232,7 @@ can also support real varargs wrapping (with stack-frame manipulation) if you
|
|||
are willing to get hands dirty. Keep reading.
|
||||
</p>
|
||||
|
||||
<H2><a name="Varargs_nn4"></a>32.3 Default varargs support</H2>
|
||||
<H2><a name="Varargs_nn4"></a>13.3 Default varargs support</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -285,7 +285,7 @@ instance, you could make function calls like this (in Python):
|
|||
Notice how string formatting is being done in Python instead of C.
|
||||
</p>
|
||||
|
||||
<H2><a name="Varargs_nn5"></a>32.4 Argument replacement using %varargs</H2>
|
||||
<H2><a name="Varargs_nn5"></a>13.4 Argument replacement using %varargs</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -347,7 +347,7 @@ mixed argument types such as <tt>printf()</tt>. Providing general purpose
|
|||
wrappers to such functions presents special problems (covered shortly).
|
||||
</p>
|
||||
|
||||
<H2><a name="Varargs_nn6"></a>32.5 Varargs and typemaps</H2>
|
||||
<H2><a name="Varargs_nn6"></a>13.5 Varargs and typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -499,7 +499,7 @@ really want to elevate your guru status and increase your job
|
|||
security, continue to the next section.
|
||||
</p>
|
||||
|
||||
<H2><a name="Varargs_nn7"></a>32.6 Varargs wrapping with libffi</H2>
|
||||
<H2><a name="Varargs_nn7"></a>13.6 Varargs wrapping with libffi</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -751,7 +751,7 @@ provide an argument number for the first extra argument. This can be used to in
|
|||
values. Please consult the chapter on each language module for more details.
|
||||
</p>
|
||||
|
||||
<H2><a name="Varargs_nn8"></a>32.7 Wrapping of va_list</H2>
|
||||
<H2><a name="Varargs_nn8"></a>13.7 Wrapping of va_list</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -775,7 +775,7 @@ call-stack. It's not clear that exporting a <tt>va_list</tt> would
|
|||
have any use or that it would work at all.
|
||||
</p>
|
||||
|
||||
<H2><a name="Varargs_nn9"></a>32.8 C++ Issues</H2>
|
||||
<H2><a name="Varargs_nn9"></a>13.8 C++ Issues</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -844,7 +844,7 @@ design or to provide an alternative interface using a helper function than it is
|
|||
fully general wrapper to a varargs C++ member function.
|
||||
</p>
|
||||
|
||||
<H2><a name="Varargs_nn10"></a>32.9 Discussion</H2>
|
||||
<H2><a name="Varargs_nn10"></a>13.9 Discussion</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Warnings"></a>33 Warning Messages</H1>
|
||||
<H1><a name="Warnings"></a>14 Warning Messages</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="Warnings_nn2"></a>33.1 Introduction</H2>
|
||||
<H2><a name="Warnings_nn2"></a>14.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -55,7 +55,7 @@ where the generated wrapper code will probably compile, but it may not
|
|||
work like you expect.
|
||||
</p>
|
||||
|
||||
<H2><a name="Warnings_suppression"></a>33.2 Warning message suppression</H2>
|
||||
<H2><a name="Warnings_suppression"></a>14.2 Warning message suppression</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -147,7 +147,7 @@ your interface. Ignore the warning messages at your own peril.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Warnings_nn4"></a>33.3 Enabling extra warnings</H2>
|
||||
<H2><a name="Warnings_nn4"></a>14.3 Enabling extra warnings</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -220,7 +220,7 @@ that is, any warnings suppressed or added in <tt>%warnfilter</tt>, <tt>#pragma S
|
|||
or the <tt>-w</tt> option.
|
||||
</p>
|
||||
|
||||
<H2><a name="Warnings_nn5"></a>33.4 Issuing a warning message</H2>
|
||||
<H2><a name="Warnings_nn5"></a>14.4 Issuing a warning message</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -267,7 +267,7 @@ Warning messages can be associated with typemaps using the
|
|||
In this case, the warning message will be printed whenever the typemap is actually used.
|
||||
</p>
|
||||
|
||||
<H2><a name="Warnings_symbolic_symbols"></a>33.5 Symbolic symbols</H2>
|
||||
<H2><a name="Warnings_symbolic_symbols"></a>14.5 Symbolic symbols</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -302,7 +302,7 @@ or
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="Warnings_nn6"></a>33.6 Commentary</H2>
|
||||
<H2><a name="Warnings_nn6"></a>14.6 Commentary</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -319,7 +319,7 @@ no obvious recovery. There is no mechanism for suppressing error
|
|||
messages.
|
||||
</p>
|
||||
|
||||
<H2><a name="Warnings_nn7"></a>33.7 Warnings as errors</H2>
|
||||
<H2><a name="Warnings_nn7"></a>14.7 Warnings as errors</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -328,7 +328,7 @@ option. This will cause SWIG to exit with a non successful exit code if a
|
|||
warning is encountered.
|
||||
</p>
|
||||
|
||||
<H2><a name="Warnings_nn8"></a>33.8 Message output format</H2>
|
||||
<H2><a name="Warnings_nn8"></a>14.8 Message output format</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -347,10 +347,10 @@ $ swig -python -Fmicrosoft example.i
|
|||
example.i(4): Syntax error in input.
|
||||
</pre></div>
|
||||
|
||||
<H2><a name="Warnings_nn9"></a>33.9 Warning number reference</H2>
|
||||
<H2><a name="Warnings_nn9"></a>14.9 Warning number reference</H2>
|
||||
|
||||
|
||||
<H3><a name="Warnings_nn10"></a>33.9.1 Deprecated features (100-199)</H3>
|
||||
<H3><a name="Warnings_nn10"></a>14.9.1 Deprecated features (100-199)</H3>
|
||||
|
||||
|
||||
<ul>
|
||||
|
@ -377,7 +377,7 @@ example.i(4): Syntax error in input.
|
|||
<li>121. Deprecated <tt>%name</tt> directive.
|
||||
</ul>
|
||||
|
||||
<H3><a name="Warnings_nn11"></a>33.9.2 Preprocessor (200-299)</H3>
|
||||
<H3><a name="Warnings_nn11"></a>14.9.2 Preprocessor (200-299)</H3>
|
||||
|
||||
|
||||
<ul>
|
||||
|
@ -385,7 +385,7 @@ example.i(4): Syntax error in input.
|
|||
<li>202. Could not evaluate 'expr'.
|
||||
</ul>
|
||||
|
||||
<H3><a name="Warnings_nn12"></a>33.9.3 C/C++ Parser (300-399)</H3>
|
||||
<H3><a name="Warnings_nn12"></a>14.9.3 C/C++ Parser (300-399)</H3>
|
||||
|
||||
|
||||
<ul>
|
||||
|
@ -459,7 +459,7 @@ example.i(4): Syntax error in input.
|
|||
<li>395. operator delete[] ignored.
|
||||
</ul>
|
||||
|
||||
<H3><a name="Warnings_nn13"></a>33.9.4 Types and typemaps (400-499) </H3>
|
||||
<H3><a name="Warnings_nn13"></a>14.9.4 Types and typemaps (400-499) </H3>
|
||||
|
||||
|
||||
<ul>
|
||||
|
@ -484,7 +484,7 @@ example.i(4): Syntax error in input.
|
|||
<li>471. Unable to use return type <em>type</em> in director method
|
||||
</ul>
|
||||
|
||||
<H3><a name="Warnings_nn14"></a>33.9.5 Code generation (500-599)</H3>
|
||||
<H3><a name="Warnings_nn14"></a>14.9.5 Code generation (500-599)</H3>
|
||||
|
||||
|
||||
<ul>
|
||||
|
@ -509,7 +509,7 @@ example.i(4): Syntax error in input.
|
|||
<li>519. %template() contains no name. Template method ignored: <em>declaration</em>
|
||||
</ul>
|
||||
|
||||
<H3><a name="Warnings_nn15"></a>33.9.6 Language module specific (800-899) </H3>
|
||||
<H3><a name="Warnings_nn15"></a>14.9.6 Language module specific (800-899) </H3>
|
||||
|
||||
|
||||
<ul>
|
||||
|
@ -558,14 +558,14 @@ example.i(4): Syntax error in input.
|
|||
<li>871. Unrecognized pragma <em>pragma</em>. (Php).
|
||||
</ul>
|
||||
|
||||
<H3><a name="Warnings_nn16"></a>33.9.7 User defined (900-999)</H3>
|
||||
<H3><a name="Warnings_nn16"></a>14.9.7 User defined (900-999)</H3>
|
||||
|
||||
|
||||
<p>
|
||||
These numbers can be used by your own application.
|
||||
</p>
|
||||
|
||||
<H2><a name="Warnings_nn17"></a>33.10 History</H2>
|
||||
<H2><a name="Warnings_nn17"></a>14.10 History</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Windows"></a>34 Getting started on Windows </H1>
|
||||
<H1><a name="Windows"></a>3 Getting started on Windows </H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
@ -52,7 +52,7 @@ Usage within the Unix like environments MinGW and Cygwin is also detailed.
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Windows_installation"></a>34.1 Installation on Windows</H2>
|
||||
<H2><a name="Windows_installation"></a>3.1 Installation on Windows</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -63,7 +63,7 @@ SWIG does not come with the usual Windows type installation program, however it
|
|||
<li>Set environment variables as described in the <a href="#Windows_examples">SWIG Windows Examples</a> section in order to run examples using Visual C++.
|
||||
</ul>
|
||||
|
||||
<H3><a name="Windows_executable"></a>34.1.1 Windows Executable</H3>
|
||||
<H3><a name="Windows_executable"></a>3.1.1 Windows Executable</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -72,7 +72,7 @@ If you want to build your own swig.exe have a look at <a href="#Windows_swig_exe
|
|||
</p>
|
||||
|
||||
|
||||
<H2><a name="Windows_examples"></a>34.2 SWIG Windows Examples</H2>
|
||||
<H2><a name="Windows_examples"></a>3.2 SWIG Windows Examples</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -87,7 +87,7 @@ Alternatively run the <a href="#Windows_examples_cygwin">examples using Cygwin</
|
|||
<p>
|
||||
More information on each of the examples is available with the examples distributed with SWIG (Examples/index.html).
|
||||
|
||||
<H3><a name="Windows_visual_studio"></a>34.2.1 Instructions for using the Examples with Visual Studio</H3>
|
||||
<H3><a name="Windows_visual_studio"></a>3.2.1 Instructions for using the Examples with Visual Studio</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -105,7 +105,7 @@ If you don't want to use environment variables then change all occurrences of th
|
|||
If you are interested in how the project files are set up there is explanatory information in some of the language module's documentation.
|
||||
</p>
|
||||
|
||||
<H4><a name="Windows_csharp"></a>34.2.1.1 C#</H4>
|
||||
<H4><a name="Windows_csharp"></a>3.2.1.1 C#</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -115,7 +115,7 @@ The accompanying C# and C++ project files are automatically used by the solution
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="Windows_java"></a>34.2.1.2 Java</H4>
|
||||
<H4><a name="Windows_java"></a>3.2.1.2 Java</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -129,7 +129,7 @@ JAVA_BIN: D:\jdk1.3\bin<br>
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="Windows_perl"></a>34.2.1.3 Perl</H4>
|
||||
<H4><a name="Windows_perl"></a>3.2.1.3 Perl</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -143,7 +143,7 @@ PERL5_LIB: D:\nsPerl5.004_04\lib\CORE\perl.lib<br>
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="Windows_python"></a>34.2.1.4 Python</H4>
|
||||
<H4><a name="Windows_python"></a>3.2.1.4 Python</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -157,7 +157,7 @@ PYTHON_LIB: D:\python21\libs\python21.lib<br>
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="Windows_tcl"></a>34.2.1.5 TCL</H4>
|
||||
<H4><a name="Windows_tcl"></a>3.2.1.5 TCL</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -171,7 +171,7 @@ TCL_LIB: D:\tcl\lib\tcl83.lib<br>
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="Windows_r"></a>34.2.1.6 R</H4>
|
||||
<H4><a name="Windows_r"></a>3.2.1.6 R</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -185,7 +185,7 @@ R_LIB: C:\Program Files\R\R-2.5.1\bin\Rdll.lib<br>
|
|||
</p>
|
||||
|
||||
|
||||
<H4><a name="Windows_ruby"></a>34.2.1.7 Ruby</H4>
|
||||
<H4><a name="Windows_ruby"></a>3.2.1.7 Ruby</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -199,21 +199,21 @@ RUBY_LIB: D:\ruby\lib\mswin32-ruby16.lib<br>
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Windows_other_compilers"></a>34.2.2 Instructions for using the Examples with other compilers</H3>
|
||||
<H3><a name="Windows_other_compilers"></a>3.2.2 Instructions for using the Examples with other compilers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
If you do not have access to Visual C++ you will have to set up project files / Makefiles for your chosen compiler. There is a section in each of the language modules detailing what needs setting up using Visual C++ which may be of some guidance. Alternatively you may want to use Cygwin as described in the following section.
|
||||
</p>
|
||||
|
||||
<H2><a name="Windows_cygwin_mingw"></a>34.3 SWIG on Cygwin and MinGW</H2>
|
||||
<H2><a name="Windows_cygwin_mingw"></a>3.3 SWIG on Cygwin and MinGW</H2>
|
||||
|
||||
|
||||
<p>
|
||||
SWIG can also be compiled and run using <a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> which provides a Unix like front end to Windows and comes free with gcc, an ANSI C/C++ compiler. However, this is not a recommended approach as the prebuilt executable is supplied.
|
||||
</p>
|
||||
|
||||
<H3><a name="Windows_swig_exe"></a>34.3.1 Building swig.exe on Windows</H3>
|
||||
<H3><a name="Windows_swig_exe"></a>3.3.1 Building swig.exe on Windows</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -223,7 +223,7 @@ This information is provided for those that want to modify the SWIG source code
|
|||
Normally this is not needed, so most people will want to ignore this section.
|
||||
</p>
|
||||
|
||||
<H4><a name="Windows_mingw_msys"></a>34.3.1.1 Building swig.exe using MinGW and MSYS</H4>
|
||||
<H4><a name="Windows_mingw_msys"></a>3.3.1.1 Building swig.exe using MinGW and MSYS</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -325,7 +325,7 @@ make
|
|||
</ol>
|
||||
|
||||
|
||||
<H4><a name="Windows_cygwin"></a>34.3.1.2 Building swig.exe using Cygwin</H4>
|
||||
<H4><a name="Windows_cygwin"></a>3.3.1.2 Building swig.exe using Cygwin</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -336,7 +336,7 @@ Note that the Cygwin environment will also allow one to regenerate the autotool
|
|||
These files are generated using the <tt>autogen.sh</tt> script and will only need regenerating in circumstances such as changing the build system.
|
||||
</p>
|
||||
|
||||
<H4><a name="Windows_building_alternatives"></a>34.3.1.3 Building swig.exe alternatives</H4>
|
||||
<H4><a name="Windows_building_alternatives"></a>3.3.1.3 Building swig.exe alternatives</H4>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -346,7 +346,7 @@ file in order to build swig.exe from the Visual C++ IDE.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Windows_examples_cygwin"></a>34.3.2 Running the examples on Windows using Cygwin</H3>
|
||||
<H3><a name="Windows_examples_cygwin"></a>3.3.2 Running the examples on Windows using Cygwin</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
@ -355,7 +355,7 @@ The modules which are known to work are Python, Tcl, Perl, Ruby, Java and C#.
|
|||
Follow the Unix instructions in the README file in the SWIG root directory to build the examples.
|
||||
</p>
|
||||
|
||||
<H2><a name="Windows_interface_file"></a>34.4 Microsoft extensions and other Windows quirks</H2>
|
||||
<H2><a name="Windows_interface_file"></a>3.4 Microsoft extensions and other Windows quirks</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -1,34 +1,35 @@
|
|||
Allegrocl.html
|
||||
Arguments.html
|
||||
Chicken.html
|
||||
Contract.html
|
||||
CSharp.html
|
||||
Customization.html
|
||||
Extending.html
|
||||
Guile.html
|
||||
Preface.html
|
||||
Introduction.html
|
||||
Java.html
|
||||
Windows.html
|
||||
Scripting.html
|
||||
SWIG.html
|
||||
SWIGPlus.html
|
||||
Preprocessor.html
|
||||
Library.html
|
||||
Arguments.html
|
||||
Typemaps.html
|
||||
Customization.html
|
||||
Contract.html
|
||||
Varargs.html
|
||||
Warnings.html
|
||||
Modules.html
|
||||
Allegrocl.html
|
||||
CSharp.html
|
||||
Chicken.html
|
||||
Guile.html
|
||||
Java.html
|
||||
Lisp.html
|
||||
Lua.html
|
||||
Modula3.html
|
||||
Modules.html
|
||||
Mzscheme.html
|
||||
Ocaml.html
|
||||
Octave.html
|
||||
Perl5.html
|
||||
Php.html
|
||||
Pike.html
|
||||
Preface.html
|
||||
Preprocessor.html
|
||||
Python.html
|
||||
R.html
|
||||
Ruby.html
|
||||
Scripting.html
|
||||
SWIG.html
|
||||
SWIGPlus.html
|
||||
Tcl.html
|
||||
Typemaps.html
|
||||
Varargs.html
|
||||
Warnings.html
|
||||
Windows.html
|
||||
R.html
|
||||
Extending.html
|
||||
|
||||
|
|
Loading…
Reference in New Issue