merge from trunk
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12002 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
commit
07cb6351f1
181 changed files with 4467 additions and 6779 deletions
|
|
@ -119,22 +119,25 @@ are case-insensitive on Windows so this convention will prevent you from inadver
|
|||
creating two files that differ in case-only.
|
||||
|
||||
<p>
|
||||
Each file should include a short abstract, author information, copyright information, and
|
||||
Each file should include a short abstract, license information and
|
||||
a SVN revision tag like this:
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
/* -----------------------------------------------------------------------------
|
||||
* See the LICENSE file for information on copyright, usage and redistribution
|
||||
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
|
||||
* This file is part of SWIG, which is licensed as a whole under version 3
|
||||
* (or any later version) of the GNU General Public License. Some additional
|
||||
* terms also apply to certain portions of SWIG. The full details of the SWIG
|
||||
* license and copyrights can be found in the LICENSE and COPYRIGHT files
|
||||
* included with the SWIG source code as distributed by the SWIG developers
|
||||
* and at http://www.swig.org/legal.html.
|
||||
*
|
||||
* cwrap.c
|
||||
* xxx.c
|
||||
*
|
||||
* This file defines a variety of wrapping rules for C/C++ handling including
|
||||
* the naming of local variables, calling conventions, and so forth.
|
||||
* This file defines ...
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
char cvsroot_cwrap_c[] = "$Id$";
|
||||
static char cvs[] = "$Id$";
|
||||
|
||||
#include "swig.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -76,9 +76,8 @@ to code).
|
|||
<tr><td>Examples</td>
|
||||
<td>This subdir tree contains examples of using SWIG w/ different
|
||||
scripting languages, including makefiles. Typically, there are the
|
||||
"simple" and "matrix" examples, w/ some languages offering additional
|
||||
examples. The GIFPlot example has its own set of per-language
|
||||
subdirectories. See the README more index.html file in each directory
|
||||
"simple" and "class" examples, w/ some languages offering additional
|
||||
examples. See the README more index.html file in each directory
|
||||
for more info. [FIXME: Ref SWIG user manual.]</td>
|
||||
</tr>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<H1><a name="Allegrocl_nn1"></a>17 SWIG and Allegro Common Lisp</H1>
|
||||
<H1><a name="Allegrocl"></a>17 SWIG and Allegro Common Lisp</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -9,35 +9,35 @@
|
|||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="#csharp_introduction">Introduction</a>
|
||||
<li><a href="#csharp_differences_java">Differences to the Java module</a>
|
||||
<li><a href="#CSharp_introduction">Introduction</a>
|
||||
<li><a href="#CSharp_differences_java">Differences to the Java module</a>
|
||||
<li><a href="#CSharp_arrays">C# Arrays</a>
|
||||
<ul>
|
||||
<li><a href="#CSharp_arrays_swig_library">The SWIG C arrays library</a>
|
||||
<li><a href="#CSharp_arrays_pinvoke_default_array_marshalling">Managed arrays using P/Invoke default array marshalling</a>
|
||||
<li><a href="#CSharp_arrays_pinning">Managed arrays using pinning</a>
|
||||
</ul>
|
||||
<li><a href="#csharp_exceptions">C# Exceptions</a>
|
||||
<li><a href="#CSharp_exceptions">C# Exceptions</a>
|
||||
<ul>
|
||||
<li><a href="#csharp_exception_example_check_typemap">C# exception example using "check" typemap</a>
|
||||
<li><a href="#csharp_exception_example_percent_exception">C# exception example using %exception</a>
|
||||
<li><a href="#csharp_exception_example_exception_specifications">C# exception example using exception specifications</a>
|
||||
<li><a href="#csharp_custom_application_exception">Custom C# ApplicationException example</a>
|
||||
<li><a href="#CSharp_exception_example_check_typemap">C# exception example using "check" typemap</a>
|
||||
<li><a href="#CSharp_exception_example_percent_exception">C# exception example using %exception</a>
|
||||
<li><a href="#CSharp_exception_example_exception_specifications">C# exception example using exception specifications</a>
|
||||
<li><a href="#CSharp_custom_application_exception">Custom C# ApplicationException example</a>
|
||||
</ul>
|
||||
<li><a href="#csharp_directors">C# Directors</a>
|
||||
<li><a href="#CSharp_directors">C# Directors</a>
|
||||
<ul>
|
||||
<li><a href="#csharp_directors_example">Directors example</a>
|
||||
<li><a href="#csharp_directors_implementation">Directors implementation</a>
|
||||
<li><a href="#csharp_director_caveats">Director caveats</a>
|
||||
<li><a href="#CSharp_directors_example">Directors example</a>
|
||||
<li><a href="#CSharp_directors_implementation">Directors implementation</a>
|
||||
<li><a href="#CSharp_director_caveats">Director caveats</a>
|
||||
</ul>
|
||||
<li><a href="#csharp_typemap_examples">C# Typemap examples</a>
|
||||
<li><a href="#CSharp_typemap_examples">C# Typemap examples</a>
|
||||
<ul>
|
||||
<li><a href="#csharp_memory_management_member_variables">Memory management when returning references to member variables</a>
|
||||
<li><a href="#csharp_memory_management_objects">Memory management for objects passed to the C++ layer</a>
|
||||
<li><a href="#csharp_date_marshalling">Date marshalling using the csin typemap and associated attributes</a>
|
||||
<li><a href="#csharp_date_properties">A date example demonstrating marshalling of C# properties</a>
|
||||
<li><a href="#csharp_partial_classes">Turning wrapped classes into partial classes</a>
|
||||
<li><a href="#csharp_extending_proxy_class">Extending proxy classes with additional C# code</a>
|
||||
<li><a href="#CSharp_memory_management_member_variables">Memory management when returning references to member variables</a>
|
||||
<li><a href="#CSharp_memory_management_objects">Memory management for objects passed to the C++ layer</a>
|
||||
<li><a href="#CSharp_date_marshalling">Date marshalling using the csin typemap and associated attributes</a>
|
||||
<li><a href="#CSharp_date_properties">A date example demonstrating marshalling of C# properties</a>
|
||||
<li><a href="#CSharp_partial_classes">Turning wrapped classes into partial classes</a>
|
||||
<li><a href="#CSharp_extending_proxy_class">Extending proxy classes with additional C# code</a>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="csharp_introduction"></a>18.1 Introduction</H2>
|
||||
<H2><a name="CSharp_introduction"></a>18.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -54,7 +54,7 @@ The wrapper code implementation uses C# and the Platform Invoke (PInvoke) interf
|
|||
The PInvoke interface has been chosen over Microsoft's Managed C++ interface as it is portable to both Microsoft Windows and non-Microsoft platforms.
|
||||
PInvoke is part of the ECMA/ISO C# specification.
|
||||
It is also better suited for robust production environments due to the Managed C++ flaw called the
|
||||
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vcconMixedDLLLoadingProblem.asp">Mixed DLL Loading Problem</a>.
|
||||
<a href="http://msdn.microsoft.com/en-us/library/aa290048(VS.71).aspx">Mixed DLL Loading Problem</a>.
|
||||
SWIG C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using
|
||||
<a href="http://www.mono-project.com/">Mono</a> and <a href="http://www.dotgnu.org/pnet.html">Portable.NET</a>.
|
||||
</p>
|
||||
|
|
@ -65,7 +65,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>18.2 Differences to the Java module</H2>
|
||||
<H2><a name="CSharp_differences_java"></a>18.2 Differences to the Java module</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -102,6 +102,11 @@ namespace com.bloggs.widget {
|
|||
Note that by default, the generated C# classes have no namespace and the module name is unrelated to namespaces. The module name is just like in Java and is merely used to name some of the generated classes.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
The <a href="SWIGPlus.html#SWIGPlus_nspace">nspace feature</a> is also supported as described in this general section with a C# example.
|
||||
Unlike Java which requires the use of the -package option when using the <tt>nspace</tt> feature, the -namespace option is not mandatory for C#.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
The <tt>-dllimport <name></tt> commandline option specifies the name of the DLL for the <tt>DllImport</tt> attribute for every PInvoke method. If this commandline option is not given, the <tt>DllImport</tt> DLL name is the same as the module name. This option is useful for when one wants to invoke SWIG multiple times on different modules, yet compile all the resulting code into a single DLL.
|
||||
</li>
|
||||
|
|
@ -132,7 +137,7 @@ If it was used, it would generate an illegal runtime initialisation via a PInvok
|
|||
C# doesn't support the notion of throws clauses.
|
||||
Therefore there is no 'throws' typemap attribute support for adding exception classes to a throws clause.
|
||||
Likewise there is no need for an equivalent to <tt>%javaexception</tt>.
|
||||
In fact, throwing C# exceptions works quite differently, see <a href="CSharp.html#csharp_exceptions">C# Exceptions</a> below.
|
||||
In fact, throwing C# exceptions works quite differently, see <a href="CSharp.html#CSharp_exceptions">C# Exceptions</a> below.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
|
@ -201,6 +206,7 @@ jniclassinterfaces -> imclassinterfaces
|
|||
$javaclassname -> $csclassname
|
||||
$&javaclassname -> $&csclassname
|
||||
$*javaclassname -> $*csclassname
|
||||
$javaclazzname -> $csclazzname
|
||||
$javainput -> $csinput
|
||||
$jnicall -> $imcall
|
||||
</pre></div>
|
||||
|
|
@ -210,10 +216,10 @@ $jnicall -> $imcall
|
|||
<p>
|
||||
Unlike the "javain" typemap, the "csin" typemap does not support the 'pgcpp' attribute as the C# module does not have a premature garbage collection prevention parameter.
|
||||
The "csin" typemap supports additional optional attributes called 'cshin' and 'terminator'.
|
||||
The 'cshin' attribute should contain the parameter type and name whenever a <a href="Java.html#java_constructor_helper_function">constructor helper function</a> is generated due to the 'pre' or 'post' attributes.
|
||||
The 'cshin' attribute should contain the parameter type and name whenever a <a href="Java.html#Java_constructor_helper_function">constructor helper function</a> is generated due to the 'pre' or 'post' attributes.
|
||||
The 'terminator' attribute normally just contains a closing brace for when the 'pre' attribute contains an opening brace, such as when a C# <tt>using</tt> or <tt>fixed</tt> block is started.
|
||||
Note that 'pre', 'post', 'terminator' and 'cshin' attributes are not used for marshalling the property set.
|
||||
Please see the <a href="#csharp_date_marshalling">Date marshalling example</a> and <a href="#csharp_date_properties">Date marshalling of properties example</a> for further understanding of these "csin" applicable attributes.
|
||||
Please see the <a href="#CSharp_date_marshalling">Date marshalling example</a> and <a href="#CSharp_date_properties">Date marshalling of properties example</a> for further understanding of these "csin" applicable attributes.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
|
|
@ -250,7 +256,7 @@ public static extern IntPtr function(string jarg1);
|
|||
Support for type attributes.
|
||||
The 'imtype' and 'cstype' typemaps can have an optional <tt>inattributes</tt> and <tt>outattributes</tt> typemap attribute.
|
||||
The 'imtype' typemap can also have an optional <tt>directorinattributes</tt> and <tt>directoroutattributes</tt>
|
||||
typemap attribute which attaches to director delegates, an implementation detail of directors, see <a href="#csharp_directors_implementation">directors implementation</a>.
|
||||
typemap attribute which attaches to director delegates, an implementation detail of directors, see <a href="#CSharp_directors_implementation">directors implementation</a>.
|
||||
Note that there are C# attributes and typemap attributes, don't get confused between the two!!
|
||||
The C# attributes specified in these typemap attributes are generated wherever the type is used in the C# wrappers.
|
||||
These can be used to specify any C# attribute associated with a C/C++ type, but are more typically used for the C# <tt>MarshalAs</tt> attribute.
|
||||
|
|
@ -305,7 +311,7 @@ The <tt>directorinattributes</tt> and <tt>directoroutattributes</tt> typemap att
|
|||
<li>
|
||||
<p>
|
||||
Support for attaching C# attributes to wrapped methods, variables and enum values.
|
||||
This is done using the <tt>%csattributes</tt> feature, see <a href="Customization.html#features">%feature directives</a>.
|
||||
This is done using the <tt>%csattributes</tt> feature, see <a href="Customization.html#Customization_features">%feature directives</a>.
|
||||
Note that C# attributes are attached to proxy classes and enums using the <tt>csattributes</tt> typemap.
|
||||
For example, imagine we have a custom attribute class, <tt>ThreadSafeAttribute</tt>, for labelling thread safety.
|
||||
The following SWIG code shows how to attach this C# attribute to some methods and the class declaration itself:
|
||||
|
|
@ -401,7 +407,7 @@ This feature is useful for some obscure cases where SWIG might get the <tt>virtu
|
|||
</li>
|
||||
|
||||
<li>
|
||||
<a name="csharp_module_directive"></a>
|
||||
<a name="CSharp_module_directive"></a>
|
||||
<p>
|
||||
The name of the intermediary class can be changed from its default, that is, the module name with PINVOKE appended after it.
|
||||
The module directive attribute <tt>imclassname</tt> is used to achieve this:
|
||||
|
|
@ -436,7 +442,7 @@ if specified, otherwise it is equivalent to the <b>$module</b> special variable.
|
|||
<p>
|
||||
<b><tt>$imclassname</tt></b><br>
|
||||
This special variable expands to the intermediary class name. For C# this is usually the same as '$modulePINVOKE' ('$moduleJNI' for Java),
|
||||
unless the imclassname attribute is specified in the <a href="CSharp.html#csharp_module_directive">%module directive</a>.
|
||||
unless the imclassname attribute is specified in the <a href="CSharp.html#CSharp_module_directive">%module directive</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
@ -716,7 +722,7 @@ public static extern void myArrayCopy(IntPtr jarg1, IntPtr jarg2, int jarg3);
|
|||
|
||||
|
||||
|
||||
<H2><a name="csharp_exceptions"></a>18.4 C# Exceptions</H2>
|
||||
<H2><a name="CSharp_exceptions"></a>18.4 C# Exceptions</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -724,7 +730,7 @@ It is possible to throw a C# Exception from C/C++ code.
|
|||
SWIG already provides the framework for throwing C# exceptions if it is able to detect that a C++ exception could be thrown.
|
||||
Automatically detecting that a C++ exception could be thrown is only possible when a C++ exception specification is used,
|
||||
see <a href="SWIGPlus.html#SWIGPlus_exception_specifications">Exception specifications</a>.
|
||||
The <a href="Customization.html#exception">Exception handling with %exception</a> section details the <tt>%exception</tt> feature.
|
||||
The <a href="Customization.html#Customization_exception">Exception handling with %exception</a> section details the <tt>%exception</tt> feature.
|
||||
Customised code for handling exceptions with or without a C++ exception specification is possible and the details follow.
|
||||
However anyone wishing to do this should be familiar with the contents of the sections referred to above.
|
||||
</p>
|
||||
|
|
@ -813,7 +819,7 @@ set so should only be used when a C# exception is not created.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="csharp_exception_example_check_typemap"></a>18.4.1 C# exception example using "check" typemap</H3>
|
||||
<H3><a name="CSharp_exception_example_check_typemap"></a>18.4.1 C# exception example using "check" typemap</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -995,12 +1001,12 @@ 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>18.4.2 C# exception example using %exception</H3>
|
||||
<H3><a name="CSharp_exception_example_percent_exception"></a>18.4.2 C# exception example using %exception</H3>
|
||||
|
||||
|
||||
<p>
|
||||
Let's consider a similar, but more common example that throws a C++ exception from within a wrapped function.
|
||||
We can use <tt>%exception</tt> as mentioned in <a href="Customization.html#exception">Exception handling with %exception</a>.
|
||||
We can use <tt>%exception</tt> as mentioned in <a href="Customization.html#Customization_exception">Exception handling with %exception</a>.
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
|
|
@ -1060,7 +1066,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>18.4.3 C# exception example using exception specifications</H3>
|
||||
<H3><a name="CSharp_exception_example_exception_specifications"></a>18.4.3 C# exception example using exception specifications</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1117,7 +1123,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>18.4.4 Custom C# ApplicationException example</H3>
|
||||
<H3><a name="CSharp_custom_application_exception"></a>18.4.4 Custom C# ApplicationException example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1251,7 +1257,7 @@ try {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="csharp_directors"></a>18.5 C# Directors</H2>
|
||||
<H2><a name="CSharp_directors"></a>18.5 C# Directors</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1261,10 +1267,10 @@ Essentially, it enables unmanaged C++ code to call back into managed code for vi
|
|||
|
||||
<p>
|
||||
The following sections provide information on the C# director implementation and contain most of the information required to use the C# directors.
|
||||
However, the <a href="Java.html#java_directors">Java directors</a> section should also be read in order to gain more insight into directors.
|
||||
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>18.5.1 Directors example</H3>
|
||||
<H3><a name="CSharp_directors_example"></a>18.5.1 Directors example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1385,7 +1391,7 @@ CSharpDerived - UIntMethod(123)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="csharp_directors_implementation"></a>18.5.2 Directors implementation</H3>
|
||||
<H3><a name="CSharp_directors_implementation"></a>18.5.2 Directors implementation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1571,7 +1577,7 @@ void SwigDirector_Base::BaseBoolMethod(Base const &b, bool flag) {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="csharp_director_caveats"></a>18.5.3 Director caveats</H3>
|
||||
<H3><a name="CSharp_director_caveats"></a>18.5.3 Director caveats</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1619,7 +1625,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>18.6 C# Typemap examples</H2>
|
||||
<H2><a name="CSharp_typemap_examples"></a>18.6 C# Typemap examples</H2>
|
||||
|
||||
|
||||
This section includes a few examples of typemaps. For more examples, you
|
||||
|
|
@ -1627,12 +1633,12 @@ 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>18.6.1 Memory management when returning references to member variables</H3>
|
||||
<H3><a name="CSharp_memory_management_member_variables"></a>18.6.1 Memory management when returning references to member variables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
This example shows how to prevent premature garbage collection of objects when the underlying C++ class returns a pointer or reference to a member variable.
|
||||
The example is a direct equivalent to this <a href="Java.html#java_memory_management_objects">Java equivalent</a>.
|
||||
The example is a direct equivalent to this <a href="Java.html#Java_memory_management_objects">Java equivalent</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
@ -1751,11 +1757,11 @@ public class Bike : IDisposable {
|
|||
Note the <tt>addReference</tt> call.
|
||||
</p>
|
||||
|
||||
<H3><a name="csharp_memory_management_objects"></a>18.6.2 Memory management for objects passed to the C++ layer</H3>
|
||||
<H3><a name="CSharp_memory_management_objects"></a>18.6.2 Memory management for objects passed to the C++ layer</H3>
|
||||
|
||||
|
||||
<p>
|
||||
The example is a direct equivalent to this <a href="Java.html#java_memory_management_objects">Java equivalent</a>.
|
||||
The example is a direct equivalent to this <a href="Java.html#Java_memory_management_objects">Java equivalent</a>.
|
||||
Managing memory can be tricky when using C++ and C# proxy classes.
|
||||
The previous example shows one such case and this example looks at memory management for a class passed to a C++ method which expects the object to remain in scope
|
||||
after the function has returned. Consider the following two C++ classes:
|
||||
|
|
@ -1870,14 +1876,14 @@ The 'cscode' typemap simply adds in the specified code into the C# proxy class.
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="csharp_date_marshalling"></a>18.6.3 Date marshalling using the csin typemap and associated attributes</H3>
|
||||
<H3><a name="CSharp_date_marshalling"></a>18.6.3 Date marshalling using the csin typemap and associated attributes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
The <a href="Java.html#nan_exception_typemap">NaN Exception example</a> is a simple example of the "javain" typemap and its 'pre' attribute.
|
||||
The <a href="Java.html#Java_nan_exception_typemap">NaN Exception example</a> is a simple example of the "javain" typemap and its 'pre' attribute.
|
||||
This example demonstrates how a C++ date class, say <tt>CDate</tt>, can be mapped onto the standard .NET date class,
|
||||
<tt>System.DateTime</tt> by using the 'pre', 'post' and 'pgcppname' attributes of the "csin" typemap (the C# equivalent to the "javain" typemap).
|
||||
The example is an equivalent to the <a href="Java.html#java_date_marshalling">Java Date marshalling example</a>.
|
||||
The example is an equivalent to the <a href="Java.html#Java_date_marshalling">Java Date marshalling example</a>.
|
||||
The idea is that the <tt>System.DateTime</tt> is used wherever the C++ API uses a <tt>CDate</tt>.
|
||||
Let's assume the code being wrapped is as follows:
|
||||
</p>
|
||||
|
|
@ -2154,7 +2160,7 @@ public class example {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="csharp_date_properties"></a>18.6.4 A date example demonstrating marshalling of C# properties</H3>
|
||||
<H3><a name="CSharp_date_properties"></a>18.6.4 A date example demonstrating marshalling of C# properties</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2255,7 +2261,7 @@ Some points to note:
|
|||
</ul>
|
||||
|
||||
|
||||
<H3><a name="csharp_partial_classes"></a>18.6.5 Turning wrapped classes into partial classes</H3>
|
||||
<H3><a name="CSharp_partial_classes"></a>18.6.5 Turning wrapped classes into partial classes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2355,7 +2361,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>18.6.6 Extending proxy classes with additional C# code</H3>
|
||||
<H3><a name="CSharp_extending_proxy_class"></a>18.6.6 Extending proxy classes with additional C# code</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
<li><a href="#Chicken_nn16">Typemaps</a>
|
||||
<li><a href="#Chicken_nn17">Pointers</a>
|
||||
<ul>
|
||||
<li><a href="#collection">Garbage collection</a>
|
||||
<li><a href="#Chicken_collection">Garbage collection</a>
|
||||
</ul>
|
||||
<li><a href="#Chicken_nn18">Unsupported features and known problems</a>
|
||||
<ul>
|
||||
|
|
@ -80,14 +80,13 @@
|
|||
relies on some recent additions to CHICKEN, which are only
|
||||
present in releases of CHICKEN with version number
|
||||
<strong>greater than or equal to 1.89</strong>.
|
||||
To use a chicken version between 1.40 and 1.89, see the <a href="#collection">Garbage collection</a>
|
||||
To use a chicken version between 1.40 and 1.89, see the <a href="#Chicken_collection">Garbage collection</a>
|
||||
section below.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You may want to look at any of the examples in Examples/chicken/
|
||||
or Examples/GIFPlot/Chicken for the basic steps to run SWIG
|
||||
CHICKEN.
|
||||
directory for the basic steps to run SWIG CHICKEN.
|
||||
</p>
|
||||
|
||||
<H3><a name="Chicken_nn3"></a>19.1.1 Running SWIG in C mode</H3>
|
||||
|
|
@ -226,7 +225,7 @@
|
|||
a function that must be called, the constant will appear as a
|
||||
scheme variable. This causes the generated .scm file to just contain the code
|
||||
<tt>(set! MYCONSTANT1 (MYCONSTANT1))</tt>. See
|
||||
<a href="Customization.html#features">Features and the %feature directive</a>
|
||||
<a href="Customization.html#Customization_features">Features and the %feature directive</a>
|
||||
for info on how to apply the %feature.
|
||||
</p>
|
||||
|
||||
|
|
@ -254,7 +253,7 @@
|
|||
|
||||
<p>The SWIG chicken module has support for exceptions thrown from
|
||||
C or C++ code to be caught in scheme.
|
||||
See <a href="Customization.html#exception">Exception handling with %exception</a>
|
||||
See <a href="Customization.html#Customization_exception">Exception handling with %exception</a>
|
||||
for more information about declaring exceptions in the interface file.
|
||||
</p>
|
||||
|
||||
|
|
@ -263,7 +262,7 @@
|
|||
inside the %exception blocks. <code>SWIG_exception</code> will throw a list consisting of the code
|
||||
(as an integer) and the message. Both of these will throw an exception using <code>(abort)</code>,
|
||||
which can be handled by <code>(handle-exceptions)</code>. See
|
||||
<a href="http://www.call-with-current-continuation.org/manual/Exceptions.html#Exceptions">Chicken manual on Exceptions</a>
|
||||
the Chicken manual on Exceptions
|
||||
and <a href="http://srfi.schemers.org/srfi-12/srfi-12.html">SFRI-12</a>. Since the exception values are thrown
|
||||
directly, if <code>(condition-case)</code> is used to catch an exception the exception will come through in the <code>val ()</code> case.
|
||||
</p>
|
||||
|
|
@ -417,8 +416,8 @@ $ csc -sv modname.scm modname_wrap.c modname_impl.c -o modname.so
|
|||
</div>
|
||||
|
||||
<p>This library can then be loaded by scheme code with the <code>(require 'modname)</code> function.
|
||||
See <a href="http://www.call-with-current-continuation.org/manual/Loading-extension-libraries.html">
|
||||
Loading-extension-libraries</a> in the eval unit inside the CHICKEN manual for more information.</p>
|
||||
See the
|
||||
Loading-extension-libraries in the eval unit inside the CHICKEN manual for more information.</p>
|
||||
|
||||
<p>Another alternative is to run SWIG normally and create a scheme file that contains <code>(declare (uses <i>modname</i>))</code>
|
||||
and then compile that file into the shared library as well. For example, inside the <tt>mod_load.scm</tt> file,</p>
|
||||
|
|
@ -520,7 +519,7 @@ all the modules.</p>
|
|||
type. flags is either zero or SWIG_POINTER_DISOWN (see below).
|
||||
</p>
|
||||
|
||||
<H3><a name="collection"></a>19.6.1 Garbage collection</H3>
|
||||
<H3><a name="Chicken_collection"></a>19.6.1 Garbage collection</H3>
|
||||
|
||||
|
||||
<p>If the owner flag passed to <code>SWIG_NewPointerObj</code> is 1, <code>NewPointerObj</code> will add a
|
||||
|
|
@ -531,12 +530,12 @@ all the modules.</p>
|
|||
be garbage collected, SWIG will automatically set the owner flag to 1. For other functions,
|
||||
the <code>%newobject</code> directive must be specified for functions whose return values
|
||||
should be garbage collected. See
|
||||
<a href="Customization.html#ownership">Object ownership and %newobject</a> for more information.
|
||||
<a href="Customization.html#Customization_ownership">Object ownership and %newobject</a> for more information.
|
||||
</p>
|
||||
|
||||
<p>In situations where a C or C++ function will assume ownership of a pointer, and thus
|
||||
chicken should no longer garbage collect it, SWIG provides the <code>DISOWN</code> input typemap.
|
||||
After applying this typemap (see the <a href="Typemaps.html">Typemaps chapter</a> for more information on how to apply typemaps),
|
||||
After applying this typemap (see the <a href="Typemaps.html#Typemaps">Typemaps chapter</a> for more information on how to apply typemaps),
|
||||
any pointer that gets passed in will no longer be garbage collected.
|
||||
An object is disowned by passing the <code>SWIG_POINTER_DISOWN</code> flag to <code>SWIG_ConvertPtr</code>.
|
||||
<b>Warning:</b> Since the lifetime of the object is now controlled by the underlying code, the object might
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@
|
|||
<li><a href="SWIG.html#SWIG_nn2">Running SWIG</a>
|
||||
<ul>
|
||||
<li><a href="SWIG.html#SWIG_nn3">Input format</a>
|
||||
<li><a href="SWIG.html#output">SWIG Output</a>
|
||||
<li><a href="SWIG.html#SWIG_output">SWIG Output</a>
|
||||
<li><a href="SWIG.html#SWIG_nn5">Comments</a>
|
||||
<li><a href="SWIG.html#SWIG_nn6">C Preprocessor</a>
|
||||
<li><a href="SWIG.html#SWIG_nn7">SWIG Directives</a>
|
||||
|
|
@ -223,13 +223,16 @@
|
|||
<ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn24">Dispatch function generation</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn25">Ambiguity in Overloading</a>
|
||||
<li><a href="SWIGPlus.html#ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn27">Comments on overloading</a>
|
||||
</ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn28">Wrapping overloaded operators</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_class_extension">Class extension</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn30">Templates</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn31">Namespaces</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_namespaces">Namespaces</a>
|
||||
<ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nspace">The nspace feature for namespaces</a>
|
||||
</ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_renaming_templated_types_namespaces">Renaming templated types in namespaces</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_exception_specifications">Exception specifications</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_catches">Exception handling with %catches</a>
|
||||
|
|
@ -237,7 +240,7 @@
|
|||
<li><a href="SWIGPlus.html#SWIGPlus_nn34">Smart pointers and operator->()</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn35">Using declarations and inheritance</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nested_classes">Nested classes</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn37">A brief rant about const-correctness</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_const">A brief rant about const-correctness</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn42">Where to go for more information</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -346,10 +349,9 @@
|
|||
<li><a href="Typemaps.html#Typemaps_pattern_matching">Pattern matching rules</a>
|
||||
<ul>
|
||||
<li><a href="Typemaps.html#Typemaps_nn17">Basic matching rules</a>
|
||||
<li><a href="Typemaps.html#Typemaps_typedef_reductions">Typedef reductions</a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn19">Default typemaps</a>
|
||||
<li><a href="Typemaps.html#Typemaps_mixed_default">Mixed default typemaps</a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn20">Multi-arguments typemaps</a>
|
||||
<li><a href="Typemaps.html#Typemaps_typedef_reductions">Typedef reductions matching</a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn19">Default typemap matching rules</a>
|
||||
<li><a href="Typemaps.html#Typemaps_multi_argument_typemaps_patterns">Multi-arguments typemaps</a>
|
||||
<li><a href="Typemaps.html#Typemaps_debugging_search">Debugging typemap pattern matching</a>
|
||||
</ul>
|
||||
<li><a href="Typemaps.html#Typemaps_nn21">Code generation rules</a>
|
||||
|
|
@ -387,14 +389,18 @@
|
|||
<li><a href="Typemaps.html#Typemaps_nn43">Typemaps for multiple target languages</a>
|
||||
<li><a href="Typemaps.html#Typemaps_optimal">Optimal code generation when returning by value</a>
|
||||
<li><a href="Typemaps.html#Typemaps_multi_argument_typemaps">Multi-argument typemaps</a>
|
||||
<li><a href="Typemaps.html#runtime_type_checker">The run-time type checker</a>
|
||||
<li><a href="Typemaps.html#Typemaps_fragments">Typemap fragments</a>
|
||||
<ul>
|
||||
<li><a href="Typemaps.html#Typemaps_fragment_type_specialization">Fragment type specialization</a>
|
||||
<li><a href="Typemaps.html#Typemaps_automatic_specialization">Fragments and automatic typemap specialization</a>
|
||||
</ul>
|
||||
<li><a href="Typemaps.html#Typemaps_runtime_type_checker">The run-time type checker</a>
|
||||
<ul>
|
||||
<li><a href="Typemaps.html#Typemaps_nn45">Implementation</a>
|
||||
<li><a href="Typemaps.html#Typemaps_runtime_type_checker_usage">Usage</a>
|
||||
</ul>
|
||||
<li><a href="Typemaps.html#Typemaps_overloading">Typemaps and overloading</a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn48">More about <tt>%apply</tt> and <tt>%clear</tt></a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn49">Reducing wrapper code size</a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn47">Passing data between typemaps</a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn52">C++ "this" pointer</a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn51">Where to go for more information?</a>
|
||||
|
|
@ -407,7 +413,7 @@
|
|||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="Customization.html#exception">Exception handling with %exception</a>
|
||||
<li><a href="Customization.html#Customization_exception">Exception handling with %exception</a>
|
||||
<ul>
|
||||
<li><a href="Customization.html#Customization_nn3">Handling exceptions in C code</a>
|
||||
<li><a href="Customization.html#Customization_nn4">Exception handling with longjmp()</a>
|
||||
|
|
@ -417,14 +423,14 @@
|
|||
<li><a href="Customization.html#Customization_exception_special_variables">Special variables for %exception</a>
|
||||
<li><a href="Customization.html#Customization_nn7">Using The SWIG exception library</a>
|
||||
</ul>
|
||||
<li><a href="Customization.html#ownership">Object ownership and %newobject</a>
|
||||
<li><a href="Customization.html#features">Features and the %feature directive</a>
|
||||
<li><a href="Customization.html#Customization_ownership">Object ownership and %newobject</a>
|
||||
<li><a href="Customization.html#Customization_features">Features and the %feature directive</a>
|
||||
<ul>
|
||||
<li><a href="Customization.html#Customization_feature_attributes">Feature attributes</a>
|
||||
<li><a href="Customization.html#Customization_feature_flags">Feature flags</a>
|
||||
<li><a href="Customization.html#Customization_clearing_features">Clearing features</a>
|
||||
<li><a href="Customization.html#Customization_features_default_args">Features and default arguments</a>
|
||||
<li><a href="Customization.html#features_example">Feature example</a>
|
||||
<li><a href="Customization.html#Customization_features_example">Feature example</a>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -497,7 +503,7 @@
|
|||
<li><a href="Modules.html#Modules_introduction">Modules Introduction</a>
|
||||
<li><a href="Modules.html#Modules_nn1">Basics</a>
|
||||
<li><a href="Modules.html#Modules_nn2">The SWIG runtime code</a>
|
||||
<li><a href="Modules.html#external_run_time">External access to the runtime</a>
|
||||
<li><a href="Modules.html#Modules_external_run_time">External access to the runtime</a>
|
||||
<li><a href="Modules.html#Modules_nn4">A word of caution about static libraries</a>
|
||||
<li><a href="Modules.html#Modules_nn5">References</a>
|
||||
<li><a href="Modules.html#Modules_nn6">Reducing the wrapper file size</a>
|
||||
|
|
@ -620,35 +626,35 @@
|
|||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="CSharp.html#csharp_introduction">Introduction</a>
|
||||
<li><a href="CSharp.html#csharp_differences_java">Differences to the Java module</a>
|
||||
<li><a href="CSharp.html#CSharp_introduction">Introduction</a>
|
||||
<li><a href="CSharp.html#CSharp_differences_java">Differences to the Java module</a>
|
||||
<li><a href="CSharp.html#CSharp_arrays">C# Arrays</a>
|
||||
<ul>
|
||||
<li><a href="CSharp.html#CSharp_arrays_swig_library">The SWIG C arrays library</a>
|
||||
<li><a href="CSharp.html#CSharp_arrays_pinvoke_default_array_marshalling">Managed arrays using P/Invoke default array marshalling</a>
|
||||
<li><a href="CSharp.html#CSharp_arrays_pinning">Managed arrays using pinning</a>
|
||||
</ul>
|
||||
<li><a href="CSharp.html#csharp_exceptions">C# Exceptions</a>
|
||||
<li><a href="CSharp.html#CSharp_exceptions">C# Exceptions</a>
|
||||
<ul>
|
||||
<li><a href="CSharp.html#csharp_exception_example_check_typemap">C# exception example using "check" typemap</a>
|
||||
<li><a href="CSharp.html#csharp_exception_example_percent_exception">C# exception example using %exception</a>
|
||||
<li><a href="CSharp.html#csharp_exception_example_exception_specifications">C# exception example using exception specifications</a>
|
||||
<li><a href="CSharp.html#csharp_custom_application_exception">Custom C# ApplicationException example</a>
|
||||
<li><a href="CSharp.html#CSharp_exception_example_check_typemap">C# exception example using "check" typemap</a>
|
||||
<li><a href="CSharp.html#CSharp_exception_example_percent_exception">C# exception example using %exception</a>
|
||||
<li><a href="CSharp.html#CSharp_exception_example_exception_specifications">C# exception example using exception specifications</a>
|
||||
<li><a href="CSharp.html#CSharp_custom_application_exception">Custom C# ApplicationException example</a>
|
||||
</ul>
|
||||
<li><a href="CSharp.html#csharp_directors">C# Directors</a>
|
||||
<li><a href="CSharp.html#CSharp_directors">C# Directors</a>
|
||||
<ul>
|
||||
<li><a href="CSharp.html#csharp_directors_example">Directors example</a>
|
||||
<li><a href="CSharp.html#csharp_directors_implementation">Directors implementation</a>
|
||||
<li><a href="CSharp.html#csharp_director_caveats">Director caveats</a>
|
||||
<li><a href="CSharp.html#CSharp_directors_example">Directors example</a>
|
||||
<li><a href="CSharp.html#CSharp_directors_implementation">Directors implementation</a>
|
||||
<li><a href="CSharp.html#CSharp_director_caveats">Director caveats</a>
|
||||
</ul>
|
||||
<li><a href="CSharp.html#csharp_typemap_examples">C# Typemap examples</a>
|
||||
<li><a href="CSharp.html#CSharp_typemap_examples">C# Typemap examples</a>
|
||||
<ul>
|
||||
<li><a href="CSharp.html#csharp_memory_management_member_variables">Memory management when returning references to member variables</a>
|
||||
<li><a href="CSharp.html#csharp_memory_management_objects">Memory management for objects passed to the C++ layer</a>
|
||||
<li><a href="CSharp.html#csharp_date_marshalling">Date marshalling using the csin typemap and associated attributes</a>
|
||||
<li><a href="CSharp.html#csharp_date_properties">A date example demonstrating marshalling of C# properties</a>
|
||||
<li><a href="CSharp.html#csharp_partial_classes">Turning wrapped classes into partial classes</a>
|
||||
<li><a href="CSharp.html#csharp_extending_proxy_class">Extending proxy classes with additional C# code</a>
|
||||
<li><a href="CSharp.html#CSharp_memory_management_member_variables">Memory management when returning references to member variables</a>
|
||||
<li><a href="CSharp.html#CSharp_memory_management_objects">Memory management for objects passed to the C++ layer</a>
|
||||
<li><a href="CSharp.html#CSharp_date_marshalling">Date marshalling using the csin typemap and associated attributes</a>
|
||||
<li><a href="CSharp.html#CSharp_date_properties">A date example demonstrating marshalling of C# properties</a>
|
||||
<li><a href="CSharp.html#CSharp_partial_classes">Turning wrapped classes into partial classes</a>
|
||||
<li><a href="CSharp.html#CSharp_extending_proxy_class">Extending proxy classes with additional C# code</a>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -682,7 +688,7 @@
|
|||
<li><a href="Chicken.html#Chicken_nn16">Typemaps</a>
|
||||
<li><a href="Chicken.html#Chicken_nn17">Pointers</a>
|
||||
<ul>
|
||||
<li><a href="Chicken.html#collection">Garbage collection</a>
|
||||
<li><a href="Chicken.html#Chicken_collection">Garbage collection</a>
|
||||
</ul>
|
||||
<li><a href="Chicken.html#Chicken_nn18">Unsupported features and known problems</a>
|
||||
<ul>
|
||||
|
|
@ -732,139 +738,139 @@
|
|||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="Java.html#java_overview">Overview</a>
|
||||
<li><a href="Java.html#java_preliminaries">Preliminaries</a>
|
||||
<li><a href="Java.html#Java_overview">Overview</a>
|
||||
<li><a href="Java.html#Java_preliminaries">Preliminaries</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#running_swig">Running SWIG</a>
|
||||
<li><a href="Java.html#java_commandline">Additional Commandline Options</a>
|
||||
<li><a href="Java.html#getting_right_headers">Getting the right header files</a>
|
||||
<li><a href="Java.html#compiling_dynamic">Compiling a dynamic module</a>
|
||||
<li><a href="Java.html#using_module">Using your module</a>
|
||||
<li><a href="Java.html#dynamic_linking_problems">Dynamic linking problems</a>
|
||||
<li><a href="Java.html#compilation_problems_cpp">Compilation problems and compiling with C++</a>
|
||||
<li><a href="Java.html#building_windows">Building on Windows</a>
|
||||
<li><a href="Java.html#Java_running_swig">Running SWIG</a>
|
||||
<li><a href="Java.html#Java_commandline">Additional Commandline Options</a>
|
||||
<li><a href="Java.html#Java_getting_right_headers">Getting the right header files</a>
|
||||
<li><a href="Java.html#Java_compiling_dynamic">Compiling a dynamic module</a>
|
||||
<li><a href="Java.html#Java_using_module">Using your module</a>
|
||||
<li><a href="Java.html#Java_dynamic_linking_problems">Dynamic linking problems</a>
|
||||
<li><a href="Java.html#Java_compilation_problems_cpp">Compilation problems and compiling with C++</a>
|
||||
<li><a href="Java.html#Java_building_windows">Building on Windows</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#visual_studio">Running SWIG from Visual Studio</a>
|
||||
<li><a href="Java.html#nmake">Using NMAKE</a>
|
||||
<li><a href="Java.html#Java_visual_studio">Running SWIG from Visual Studio</a>
|
||||
<li><a href="Java.html#Java_nmake">Using NMAKE</a>
|
||||
</ul>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_basic_tour">A tour of basic C/C++ wrapping</a>
|
||||
<li><a href="Java.html#Java_basic_tour">A tour of basic C/C++ wrapping</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#module_packages_classes">Modules, packages and generated Java classes</a>
|
||||
<li><a href="Java.html#functions">Functions</a>
|
||||
<li><a href="Java.html#global_variables">Global variables</a>
|
||||
<li><a href="Java.html#constants">Constants</a>
|
||||
<li><a href="Java.html#enumerations">Enumerations</a>
|
||||
<li><a href="Java.html#Java_module_packages_classes">Modules, packages and generated Java classes</a>
|
||||
<li><a href="Java.html#Java_functions">Functions</a>
|
||||
<li><a href="Java.html#Java_global_variables">Global variables</a>
|
||||
<li><a href="Java.html#Java_constants">Constants</a>
|
||||
<li><a href="Java.html#Java_enumerations">Enumerations</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#anonymous_enums">Anonymous enums</a>
|
||||
<li><a href="Java.html#typesafe_enums">Typesafe enums</a>
|
||||
<li><a href="Java.html#proper_enums">Proper Java enums</a>
|
||||
<li><a href="Java.html#typeunsafe_enums">Type unsafe enums</a>
|
||||
<li><a href="Java.html#simple_enums">Simple enums</a>
|
||||
<li><a href="Java.html#Java_anonymous_enums">Anonymous enums</a>
|
||||
<li><a href="Java.html#Java_typesafe_enums">Typesafe enums</a>
|
||||
<li><a href="Java.html#Java_proper_enums">Proper Java enums</a>
|
||||
<li><a href="Java.html#Java_typeunsafe_enums">Type unsafe enums</a>
|
||||
<li><a href="Java.html#Java_simple_enums">Simple enums</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#pointers">Pointers</a>
|
||||
<li><a href="Java.html#structures">Structures</a>
|
||||
<li><a href="Java.html#classes">C++ classes</a>
|
||||
<li><a href="Java.html#inheritance">C++ inheritance</a>
|
||||
<li><a href="Java.html#pointers_refs_arrays">Pointers, references, arrays and pass by value</a>
|
||||
<li><a href="Java.html#Java_pointers">Pointers</a>
|
||||
<li><a href="Java.html#Java_structures">Structures</a>
|
||||
<li><a href="Java.html#Java_classes">C++ classes</a>
|
||||
<li><a href="Java.html#Java_inheritance">C++ inheritance</a>
|
||||
<li><a href="Java.html#Java_pointers_refs_arrays">Pointers, references, arrays and pass by value</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#null_pointers">Null pointers</a>
|
||||
<li><a href="Java.html#Java_null_pointers">Null pointers</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#overloaded_functions">C++ overloaded functions</a>
|
||||
<li><a href="Java.html#java_default_arguments">C++ default arguments</a>
|
||||
<li><a href="Java.html#namespaces">C++ namespaces</a>
|
||||
<li><a href="Java.html#templates">C++ templates</a>
|
||||
<li><a href="Java.html#smart_pointers">C++ Smart Pointers</a>
|
||||
<li><a href="Java.html#Java_overloaded_functions">C++ overloaded functions</a>
|
||||
<li><a href="Java.html#Java_default_arguments">C++ default arguments</a>
|
||||
<li><a href="Java.html#Java_namespaces">C++ namespaces</a>
|
||||
<li><a href="Java.html#Java_templates">C++ templates</a>
|
||||
<li><a href="Java.html#Java_smart_pointers">C++ Smart Pointers</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#further_details">Further details on the generated Java classes</a>
|
||||
<li><a href="Java.html#Java_further_details">Further details on the generated Java classes</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#imclass">The intermediary JNI class</a>
|
||||
<li><a href="Java.html#Java_imclass">The intermediary JNI class</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#imclass_pragmas">The intermediary JNI class pragmas</a>
|
||||
<li><a href="Java.html#Java_imclass_pragmas">The intermediary JNI class pragmas</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_module_class">The Java module class</a>
|
||||
<li><a href="Java.html#Java_module_class">The Java module class</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#module_class_pragmas">The Java module class pragmas</a>
|
||||
<li><a href="Java.html#Java_module_class_pragmas">The Java module class pragmas</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_proxy_classes">Java proxy classes</a>
|
||||
<li><a href="Java.html#Java_proxy_classes">Java proxy classes</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#memory_management">Memory management</a>
|
||||
<li><a href="Java.html#inheritance_mirroring">Inheritance</a>
|
||||
<li><a href="Java.html#proxy_classes_gc">Proxy classes and garbage collection</a>
|
||||
<li><a href="Java.html#java_pgcpp">The premature garbage collection prevention parameter for proxy class marshalling</a>
|
||||
<li><a href="Java.html#java_multithread_libraries">Single threaded applications and thread safety</a>
|
||||
<li><a href="Java.html#Java_memory_management">Memory management</a>
|
||||
<li><a href="Java.html#Java_inheritance_mirroring">Inheritance</a>
|
||||
<li><a href="Java.html#Java_proxy_classes_gc">Proxy classes and garbage collection</a>
|
||||
<li><a href="Java.html#Java_pgcpp">The premature garbage collection prevention parameter for proxy class marshalling</a>
|
||||
<li><a href="Java.html#Java_multithread_libraries">Single threaded applications and thread safety</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#type_wrapper_classes">Type wrapper classes</a>
|
||||
<li><a href="Java.html#enum_classes">Enum classes</a>
|
||||
<li><a href="Java.html#Java_type_wrapper_classes">Type wrapper classes</a>
|
||||
<li><a href="Java.html#Java_enum_classes">Enum classes</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#typesafe_enums_classes">Typesafe enum classes</a>
|
||||
<li><a href="Java.html#proper_enums_classes">Proper Java enum classes</a>
|
||||
<li><a href="Java.html#typeunsafe_enums_classes">Type unsafe enum classes</a>
|
||||
<li><a href="Java.html#Java_typesafe_enums_classes">Typesafe enum classes</a>
|
||||
<li><a href="Java.html#Java_proper_enums_classes">Proper Java enum classes</a>
|
||||
<li><a href="Java.html#Java_typeunsafe_enums_classes">Type unsafe enum classes</a>
|
||||
</ul>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_directors">Cross language polymorphism using directors</a>
|
||||
<li><a href="Java.html#Java_directors">Cross language polymorphism using directors</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#java_enabling_directors">Enabling directors</a>
|
||||
<li><a href="Java.html#java_directors_classes">Director classes</a>
|
||||
<li><a href="Java.html#java_directors_overhead">Overhead and code bloat</a>
|
||||
<li><a href="Java.html#java_directors_example">Simple directors example</a>
|
||||
<li><a href="Java.html#java_directors_threading">Director threading issues</a>
|
||||
<li><a href="Java.html#Java_enabling_directors">Enabling directors</a>
|
||||
<li><a href="Java.html#Java_directors_classes">Director classes</a>
|
||||
<li><a href="Java.html#Java_directors_overhead">Overhead and code bloat</a>
|
||||
<li><a href="Java.html#Java_directors_example">Simple directors example</a>
|
||||
<li><a href="Java.html#Java_directors_threading">Director threading issues</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_allprotected">Accessing protected members</a>
|
||||
<li><a href="Java.html#common_customization">Common customization features</a>
|
||||
<li><a href="Java.html#Java_allprotected">Accessing protected members</a>
|
||||
<li><a href="Java.html#Java_common_customization">Common customization features</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#helper_functions">C/C++ helper functions</a>
|
||||
<li><a href="Java.html#class_extension">Class extension with %extend</a>
|
||||
<li><a href="Java.html#exception_handling">Exception handling with %exception and %javaexception</a>
|
||||
<li><a href="Java.html#method_access">Method access with %javamethodmodifiers</a>
|
||||
<li><a href="Java.html#Java_helper_functions">C/C++ helper functions</a>
|
||||
<li><a href="Java.html#Java_class_extension">Class extension with %extend</a>
|
||||
<li><a href="Java.html#Java_exception_handling">Exception handling with %exception and %javaexception</a>
|
||||
<li><a href="Java.html#Java_method_access">Method access with %javamethodmodifiers</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#tips_techniques">Tips and techniques</a>
|
||||
<li><a href="Java.html#Java_tips_techniques">Tips and techniques</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#input_output_parameters">Input and output parameters using primitive pointers and references</a>
|
||||
<li><a href="Java.html#simple_pointers">Simple pointers</a>
|
||||
<li><a href="Java.html#c_arrays">Wrapping C arrays with Java arrays</a>
|
||||
<li><a href="Java.html#unbounded_c_arrays">Unbounded C Arrays</a>
|
||||
<li><a href="Java.html#java_heap_allocations">Overriding new and delete to allocate from Java heap</a>
|
||||
<li><a href="Java.html#Java_input_output_parameters">Input and output parameters using primitive pointers and references</a>
|
||||
<li><a href="Java.html#Java_simple_pointers">Simple pointers</a>
|
||||
<li><a href="Java.html#Java_c_arrays">Wrapping C arrays with Java arrays</a>
|
||||
<li><a href="Java.html#Java_unbounded_c_arrays">Unbounded C Arrays</a>
|
||||
<li><a href="Java.html#Java_heap_allocations">Overriding new and delete to allocate from Java heap</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_typemaps">Java typemaps</a>
|
||||
<li><a href="Java.html#Java_typemaps">Java typemaps</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#default_primitive_type_mappings">Default primitive type mappings</a>
|
||||
<li><a href="Java.html#Java_default_primitive_type_mappings">Default primitive type mappings</a>
|
||||
<li><a href="Java.html#Java_default_non_primitive_typemaps">Default typemaps for non-primitive types</a>
|
||||
<li><a href="Java.html#jvm64">Sixty four bit JVMs</a>
|
||||
<li><a href="Java.html#what_is_typemap">What is a typemap?</a>
|
||||
<li><a href="Java.html#typemaps_c_to_java_types">Typemaps for mapping C/C++ types to Java types</a>
|
||||
<li><a href="Java.html#typemap_attributes">Java typemap attributes</a>
|
||||
<li><a href="Java.html#special_variables">Java special variables</a>
|
||||
<li><a href="Java.html#typemaps_for_c_and_cpp">Typemaps for both C and C++ compilation</a>
|
||||
<li><a href="Java.html#java_code_typemaps">Java code typemaps</a>
|
||||
<li><a href="Java.html#java_directors_typemaps">Director specific typemaps</a>
|
||||
<li><a href="Java.html#Java_jvm64">Sixty four bit JVMs</a>
|
||||
<li><a href="Java.html#Java_what_is_typemap">What is a typemap?</a>
|
||||
<li><a href="Java.html#Java_typemaps_c_to_java_types">Typemaps for mapping C/C++ types to Java types</a>
|
||||
<li><a href="Java.html#Java_typemap_attributes">Java typemap attributes</a>
|
||||
<li><a href="Java.html#Java_special_variables">Java special variables</a>
|
||||
<li><a href="Java.html#Java_typemaps_for_c_and_cpp">Typemaps for both C and C++ compilation</a>
|
||||
<li><a href="Java.html#Java_code_typemaps">Java code typemaps</a>
|
||||
<li><a href="Java.html#Java_directors_typemaps">Director specific typemaps</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#typemap_examples">Typemap Examples</a>
|
||||
<li><a href="Java.html#Java_typemap_examples">Typemap Examples</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#simpler_enum_classes">Simpler Java enums for enums without initializers</a>
|
||||
<li><a href="Java.html#exception_typemap">Handling C++ exception specifications as Java exceptions</a>
|
||||
<li><a href="Java.html#nan_exception_typemap">NaN Exception - exception handling for a particular type</a>
|
||||
<li><a href="Java.html#converting_java_string_arrays">Converting Java String arrays to char ** </a>
|
||||
<li><a href="Java.html#expanding_java_object">Expanding a Java object to multiple arguments</a>
|
||||
<li><a href="Java.html#using_typemaps_return_arguments">Using typemaps to return arguments</a>
|
||||
<li><a href="Java.html#adding_downcasts">Adding Java downcasts to polymorphic return types</a>
|
||||
<li><a href="Java.html#adding_equals_method">Adding an equals method to the Java classes</a>
|
||||
<li><a href="Java.html#void_pointers">Void pointers and a common Java base class</a>
|
||||
<li><a href="Java.html#struct_pointer_pointer">Struct pointer to pointer</a>
|
||||
<li><a href="Java.html#java_memory_management_member_variables">Memory management when returning references to member variables</a>
|
||||
<li><a href="Java.html#java_memory_management_objects">Memory management for objects passed to the C++ layer</a>
|
||||
<li><a href="Java.html#java_date_marshalling">Date marshalling using the javain typemap and associated attributes</a>
|
||||
<li><a href="Java.html#Java_simpler_enum_classes">Simpler Java enums for enums without initializers</a>
|
||||
<li><a href="Java.html#Java_exception_typemap">Handling C++ exception specifications as Java exceptions</a>
|
||||
<li><a href="Java.html#Java_nan_exception_typemap">NaN Exception - exception handling for a particular type</a>
|
||||
<li><a href="Java.html#Java_converting_java_string_arrays">Converting Java String arrays to char ** </a>
|
||||
<li><a href="Java.html#Java_expanding_java_object">Expanding a Java object to multiple arguments</a>
|
||||
<li><a href="Java.html#Java_using_typemaps_return_arguments">Using typemaps to return arguments</a>
|
||||
<li><a href="Java.html#Java_adding_downcasts">Adding Java downcasts to polymorphic return types</a>
|
||||
<li><a href="Java.html#Java_adding_equals_method">Adding an equals method to the Java classes</a>
|
||||
<li><a href="Java.html#Java_void_pointers">Void pointers and a common Java base class</a>
|
||||
<li><a href="Java.html#Java_struct_pointer_pointer">Struct pointer to pointer</a>
|
||||
<li><a href="Java.html#Java_memory_management_member_variables">Memory management when returning references to member variables</a>
|
||||
<li><a href="Java.html#Java_memory_management_objects">Memory management for objects passed to the C++ layer</a>
|
||||
<li><a href="Java.html#Java_date_marshalling">Date marshalling using the javain typemap and associated attributes</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_directors_faq">Living with Java Directors</a>
|
||||
<li><a href="Java.html#odds_ends">Odds and ends</a>
|
||||
<li><a href="Java.html#Java_directors_faq">Living with Java Directors</a>
|
||||
<li><a href="Java.html#Java_odds_ends">Odds and ends</a>
|
||||
<ul>
|
||||
<li><a href="Java.html#javadoc_comments">JavaDoc comments</a>
|
||||
<li><a href="Java.html#functional_interface">Functional interface without proxy classes</a>
|
||||
<li><a href="Java.html#using_own_jni_functions">Using your own JNI functions</a>
|
||||
<li><a href="Java.html#performance">Performance concerns and hints</a>
|
||||
<li><a href="Java.html#java_debugging">Debugging</a>
|
||||
<li><a href="Java.html#Java_javadoc_comments">JavaDoc comments</a>
|
||||
<li><a href="Java.html#Java_functional_interface">Functional interface without proxy classes</a>
|
||||
<li><a href="Java.html#Java_using_own_jni_functions">Using your own JNI functions</a>
|
||||
<li><a href="Java.html#Java_performance">Performance concerns and hints</a>
|
||||
<li><a href="Java.html#Java_debugging">Debugging</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_examples">Examples</a>
|
||||
<li><a href="Java.html#Java_examples">Examples</a>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- INDEX -->
|
||||
|
|
@ -954,38 +960,38 @@
|
|||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="Modula3.html#modula3_overview">Overview</a>
|
||||
<li><a href="Modula3.html#Modula3_modula3_overview">Overview</a>
|
||||
<ul>
|
||||
<li><a href="Modula3.html#whyscripting">Why not scripting ?</a>
|
||||
<li><a href="Modula3.html#whymodula3">Why Modula-3 ?</a>
|
||||
<li><a href="Modula3.html#whycpp">Why C / C++ ?</a>
|
||||
<li><a href="Modula3.html#whyswig">Why SWIG ?</a>
|
||||
<li><a href="Modula3.html#Modula3_whyscripting">Why not scripting ?</a>
|
||||
<li><a href="Modula3.html#Modula3_whymodula3">Why Modula-3 ?</a>
|
||||
<li><a href="Modula3.html#Modula3_whycpp">Why C / C++ ?</a>
|
||||
<li><a href="Modula3.html#Modula3_whyswig">Why SWIG ?</a>
|
||||
</ul>
|
||||
<li><a href="Modula3.html#conception">Conception</a>
|
||||
<li><a href="Modula3.html#Modula3_conception">Conception</a>
|
||||
<ul>
|
||||
<li><a href="Modula3.html#cinterface">Interfaces to C libraries</a>
|
||||
<li><a href="Modula3.html#cppinterface">Interfaces to C++ libraries</a>
|
||||
<li><a href="Modula3.html#Modula3_cinterface">Interfaces to C libraries</a>
|
||||
<li><a href="Modula3.html#Modula3_cppinterface">Interfaces to C++ libraries</a>
|
||||
</ul>
|
||||
<li><a href="Modula3.html#preliminaries">Preliminaries</a>
|
||||
<li><a href="Modula3.html#Modula3_preliminaries">Preliminaries</a>
|
||||
<ul>
|
||||
<li><a href="Modula3.html#compilers">Compilers</a>
|
||||
<li><a href="Modula3.html#commandline">Additional Commandline Options</a>
|
||||
<li><a href="Modula3.html#Modula3_compilers">Compilers</a>
|
||||
<li><a href="Modula3.html#Modula3_commandline">Additional Commandline Options</a>
|
||||
</ul>
|
||||
<li><a href="Modula3.html#modula3_typemaps">Modula-3 typemaps</a>
|
||||
<li><a href="Modula3.html#Modula3_typemaps">Modula-3 typemaps</a>
|
||||
<ul>
|
||||
<li><a href="Modula3.html#inoutparam">Inputs and outputs</a>
|
||||
<li><a href="Modula3.html#ordinals">Subranges, Enumerations, Sets</a>
|
||||
<li><a href="Modula3.html#class">Objects</a>
|
||||
<li><a href="Modula3.html#imports">Imports</a>
|
||||
<li><a href="Modula3.html#exceptions">Exceptions</a>
|
||||
<li><a href="Modula3.html#typemap_example">Example</a>
|
||||
<li><a href="Modula3.html#Modula3_inoutparam">Inputs and outputs</a>
|
||||
<li><a href="Modula3.html#Modula3_ordinals">Subranges, Enumerations, Sets</a>
|
||||
<li><a href="Modula3.html#Modula3_class">Objects</a>
|
||||
<li><a href="Modula3.html#Modula3_imports">Imports</a>
|
||||
<li><a href="Modula3.html#Modula3_exceptions">Exceptions</a>
|
||||
<li><a href="Modula3.html#Modula3_typemap_example">Example</a>
|
||||
</ul>
|
||||
<li><a href="Modula3.html#hints">More hints to the generator</a>
|
||||
<li><a href="Modula3.html#Modula3_hints">More hints to the generator</a>
|
||||
<ul>
|
||||
<li><a href="Modula3.html#features">Features</a>
|
||||
<li><a href="Modula3.html#pragmas">Pragmas</a>
|
||||
<li><a href="Modula3.html#Modula3_features">Features</a>
|
||||
<li><a href="Modula3.html#Modula3_pragmas">Pragmas</a>
|
||||
</ul>
|
||||
<li><a href="Modula3.html#remarks">Remarks</a>
|
||||
<li><a href="Modula3.html#Modula3_remarks">Remarks</a>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- INDEX -->
|
||||
|
|
@ -1353,7 +1359,7 @@
|
|||
<li><a href="Ruby.html#Ruby_nn22">C++ namespaces</a>
|
||||
<li><a href="Ruby.html#Ruby_nn23">C++ templates</a>
|
||||
<li><a href="Ruby.html#Ruby_nn23_1">C++ Standard Template Library (STL)</a>
|
||||
<li><a href="Ruby.html#C_STL_Functors">C++ STL Functors</a>
|
||||
<li><a href="Ruby.html#Ruby_C_STL_Functors">C++ STL Functors</a>
|
||||
<li><a href="Ruby.html#Ruby_C_Iterators">C++ STL Iterators</a>
|
||||
<li><a href="Ruby.html#Ruby_nn24">C++ Smart Pointers</a>
|
||||
<li><a href="Ruby.html#Ruby_nn25">Cross-Language Polymorphism</a>
|
||||
|
|
@ -1437,7 +1443,7 @@
|
|||
</ul>
|
||||
<li><a href="Ruby.html#Ruby_nn53">Advanced Topics</a>
|
||||
<ul>
|
||||
<li><a href="Ruby.html#Ruby_nn54">Operator overloading</a>
|
||||
<li><a href="Ruby.html#Ruby_operator_overloading">Operator overloading</a>
|
||||
<li><a href="Ruby.html#Ruby_nn55">Creating Multi-Module Packages</a>
|
||||
<li><a href="Ruby.html#Ruby_nn56">Specifying Mixin Modules</a>
|
||||
</ul>
|
||||
|
|
@ -1585,7 +1591,7 @@
|
|||
<li><a href="Extending.html#Extending_nn36">Entry point to code generation</a>
|
||||
<li><a href="Extending.html#Extending_nn37">Module I/O and wrapper skeleton</a>
|
||||
<li><a href="Extending.html#Extending_nn38">Low-level code generators</a>
|
||||
<li><a href="Extending.html#Extending_nn39">Configuration files</a>
|
||||
<li><a href="Extending.html#Extending_configuration_files">Configuration files</a>
|
||||
<li><a href="Extending.html#Extending_nn40">Runtime support</a>
|
||||
<li><a href="Extending.html#Extending_nn41">Standard library files</a>
|
||||
<li><a href="Extending.html#Extending_nn42">User examples</a>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="#exception">Exception handling with %exception</a>
|
||||
<li><a href="#Customization_exception">Exception handling with %exception</a>
|
||||
<ul>
|
||||
<li><a href="#Customization_nn3">Handling exceptions in C code</a>
|
||||
<li><a href="#Customization_nn4">Exception handling with longjmp()</a>
|
||||
|
|
@ -20,14 +20,14 @@
|
|||
<li><a href="#Customization_exception_special_variables">Special variables for %exception</a>
|
||||
<li><a href="#Customization_nn7">Using The SWIG exception library</a>
|
||||
</ul>
|
||||
<li><a href="#ownership">Object ownership and %newobject</a>
|
||||
<li><a href="#features">Features and the %feature directive</a>
|
||||
<li><a href="#Customization_ownership">Object ownership and %newobject</a>
|
||||
<li><a href="#Customization_features">Features and the %feature directive</a>
|
||||
<ul>
|
||||
<li><a href="#Customization_feature_attributes">Feature attributes</a>
|
||||
<li><a href="#Customization_feature_flags">Feature flags</a>
|
||||
<li><a href="#Customization_clearing_features">Clearing features</a>
|
||||
<li><a href="#Customization_features_default_args">Features and default arguments</a>
|
||||
<li><a href="#features_example">Feature example</a>
|
||||
<li><a href="#Customization_features_example">Feature example</a>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -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>11.1 Exception handling with %exception</H2>
|
||||
<H2><a name="Customization_exception"></a>11.1 Exception handling with %exception</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -351,7 +351,7 @@ In this case, the exception handler is only attached to declarations
|
|||
named "allocate". This would include both global and member
|
||||
functions. The names supplied to <tt>%exception</tt> follow the same
|
||||
rules as for <tt>%rename</tt> described in the section on
|
||||
<a href="SWIGPlus.html#ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>.
|
||||
<a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>.
|
||||
For example, if you wanted to define
|
||||
an exception handler for a specific class, you might write this:
|
||||
</p>
|
||||
|
|
@ -582,7 +582,7 @@ it can be used elsewhere in SWIG. This includes typemaps and helper
|
|||
functions.
|
||||
</p>
|
||||
|
||||
<H2><a name="ownership"></a>11.2 Object ownership and %newobject</H2>
|
||||
<H2><a name="Customization_ownership"></a>11.2 Object ownership and %newobject</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -734,7 +734,7 @@ char *strdup(const char *s);
|
|||
The results might not be what you expect.
|
||||
</p>
|
||||
|
||||
<H2><a name="features"></a>11.3 Features and the %feature directive</H2>
|
||||
<H2><a name="Customization_features"></a>11.3 Features and the %feature directive</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -773,7 +773,7 @@ involving <tt>%feature</tt>:
|
|||
</div>
|
||||
|
||||
<p>
|
||||
The name matching rules outlined in the <a href="SWIGPlus.html#ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>
|
||||
The name matching rules outlined in the <a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>
|
||||
section applies to all <tt>%feature</tt> directives.
|
||||
In fact the the <tt>%rename</tt> directive is just a special form of <tt>%feature</tt>.
|
||||
The matching rules mean that features are very flexible and can be applied with
|
||||
|
|
@ -854,7 +854,7 @@ In the following example, <tt>MyExceptionClass</tt> is the name of the Java clas
|
|||
</div>
|
||||
|
||||
<p>
|
||||
Further details can be obtained from the <a href="Java.html#exception_handling">Java exception handling</a> section.
|
||||
Further details can be obtained from the <a href="Java.html#Java_exception_handling">Java exception handling</a> section.
|
||||
</p>
|
||||
|
||||
<H3><a name="Customization_feature_flags"></a>11.3.2 Feature flags</H3>
|
||||
|
|
@ -1123,7 +1123,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>11.3.5 Feature example</H3>
|
||||
<H3><a name="Customization_features_example"></a>11.3.5 Feature example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
<li><a href="#Extending_nn36">Entry point to code generation</a>
|
||||
<li><a href="#Extending_nn37">Module I/O and wrapper skeleton</a>
|
||||
<li><a href="#Extending_nn38">Low-level code generators</a>
|
||||
<li><a href="#Extending_nn39">Configuration files</a>
|
||||
<li><a href="#Extending_configuration_files">Configuration files</a>
|
||||
<li><a href="#Extending_nn40">Runtime support</a>
|
||||
<li><a href="#Extending_nn41">Standard library files</a>
|
||||
<li><a href="#Extending_nn42">User examples</a>
|
||||
|
|
@ -3049,7 +3049,7 @@ but without the typemaps, there is still work to do.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn39"></a>35.10.8 Configuration files</H3>
|
||||
<H3><a name="Extending_configuration_files"></a>35.10.8 Configuration files</H3>
|
||||
|
||||
|
||||
<!-- please report bugs in this section to ttn -->
|
||||
|
|
@ -3090,8 +3090,6 @@ The nickname is used in four places:
|
|||
<TR><TD><B>usage</B></TD><TD><B>transform</B></TD></TR>
|
||||
<TR><TD>"skip" tag</TD><TD>(none)</TD></TR>
|
||||
<TR><TD>Examples/ subdir name</TD><TD>(none)</TD></TR>
|
||||
<TR><TD>Examples/GIFPlot/ subdir name</TD>
|
||||
<TD>capitalize (upcase first letter)</TD></TR>
|
||||
<TR><TD>Examples/test-suite/ subdir name</TD><TD>(none)</TD></TR>
|
||||
<!-- add more uses here (remember to adjust header) -->
|
||||
</TABLE>
|
||||
|
|
@ -3159,8 +3157,8 @@ skip-qux = $(skip-qux99)
|
|||
|
||||
<p>
|
||||
Lastly, you need to modify each of <TT>check-aliveness</TT>,
|
||||
<TT>check-examples</TT>, <TT>check-test-suite</TT>,
|
||||
<TT>check-gifplot</TT> (all targets) and <TT>lib-languages</TT> (var).
|
||||
<TT>check-examples</TT>, <TT>check-test-suite</TT>
|
||||
and <TT>lib-languages</TT> (var).
|
||||
Use the nickname for these, not the alias.
|
||||
Note that you can do this even before you have any tests or examples
|
||||
set up; the Makefile rules do some sanity checking and skip around
|
||||
|
|
@ -3175,10 +3173,6 @@ and look to the existing languages for examples.
|
|||
<dd> Do <TT>cp ../python/check.list .</TT> and modify to taste.
|
||||
One subdir per line.
|
||||
|
||||
<dt> <b>Examples/GIFPlot/Qux99/check.list</b>
|
||||
<dd> Do <TT>cp ../Python/check.list .</TT> and modify to taste.
|
||||
One subdir per line.
|
||||
|
||||
<dt> <b>Lib/qux99/extra-install.list</b>
|
||||
<dd> If you add your language to the top-level Makefile.in var
|
||||
<TT>lib-languages</TT>, then <TT>make install</TT> will install
|
||||
|
|
@ -3252,7 +3246,7 @@ These can be found, for example for Python, in
|
|||
<p>
|
||||
By default, all of the examples are built and run when the user types
|
||||
<tt>make check</tt>. To ensure that your examples are automatically run
|
||||
during this process, see the section on <a href="#n37a">configuration
|
||||
during this process, see the section on <a href="#Extending_configuration_files">configuration
|
||||
files</a>.
|
||||
</p>
|
||||
|
||||
|
|
@ -3601,6 +3595,7 @@ There are various command line options which can aid debugging a SWIG interface
|
|||
-debug-symtabs - Display symbol tables information
|
||||
-debug-symbols - Display target language symbols in the symbol tables
|
||||
-debug-csymbols - Display C symbols in the symbol tables
|
||||
-debug-lsymbols - Display target language layer symbols
|
||||
-debug-tags - Display information about the tags found in the interface
|
||||
-debug-template - Display information for debugging templates
|
||||
-debug-top <n> - Display entire parse tree at stages 1-4, <n> is a csv list of stages
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ SCM interface is the default. The SCM and GH interface differ greatly in how th
|
|||
pointers and have completely different run-time code. See below for more info.
|
||||
|
||||
<p>The GH interface to guile is deprecated. Read more about why in the
|
||||
<a href="http://www.gnu.org/software/guile/docs/guile-ref/GH-deprecation.html">Guile manual</a>.
|
||||
<a href="http://www.gnu.org/software/guile/docs/docs-1.6/guile-ref/GH.html#GH">Guile manual</a>.
|
||||
The idea of the GH interface was to provide a high level API that other languages and projects
|
||||
could adopt. This was a good idea, but didn't pan out well for general development. But for the
|
||||
specific, minimal uses that the SWIG typemaps put the GH interface to use is ideal for
|
||||
|
|
@ -409,7 +409,7 @@ See also the "multivalue" example.
|
|||
%feature("constasvar") can be applied to any constant, immutable variable, or enum.
|
||||
Instead of exporting the constant as a function that must be called, the
|
||||
constant will appear as a scheme variable. See
|
||||
<a href="Customization.html#features">Features and the %feature directive</a>
|
||||
<a href="Customization.html#Customization_features">Features and the %feature directive</a>
|
||||
for info on how to apply the %feature.</p>
|
||||
|
||||
<H2><a name="Guile_nn12"></a>20.6 Representation of pointers as smobs</H2>
|
||||
|
|
@ -487,7 +487,7 @@ to the destructor for this type. The destructor is the generated wrapper around
|
|||
So swig still exports a wrapper for the destructor, it just does not call scm_c_define_gsubr() for
|
||||
the wrapped delete function. So the only way to delete an object is from the garbage collector, since the
|
||||
delete function is not available to scripts. How swig determines if a type should be garbage collected
|
||||
is exactly like described in <a href="Customization.html#ownership">
|
||||
is exactly like described in <a href="Customization.html#Customization_ownership">
|
||||
Object ownership and %newobject</a> in the SWIG manual. All typemaps use an $owner var, and
|
||||
the guile module replaces $owner with 0 or 1 depending on feature:new.</p>
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -893,7 +893,7 @@ char *foo();
|
|||
This will release the result if the appropriate target language support is available.
|
||||
SWIG provides the appropriate "newfree" typemap for <tt>char *</tt> so that the memory is released,
|
||||
however, you may need to provide your own "newfree" typemap for other types.
|
||||
See <a href="Customization.html#ownership">Object ownership and %newobject</a> for more details.
|
||||
See <a href="Customization.html#Customization_ownership">Object ownership and %newobject</a> for more details.
|
||||
</p>
|
||||
|
||||
<H3><a name="Library_nn12"></a>8.3.4 cstring.i</H3>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Lisp_nn1"></a>22 SWIG and Common Lisp</H1>
|
||||
<H1><a name="Lisp"></a>22 SWIG and Common Lisp</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
<p>
|
||||
Allegro Common Lisp support in SWIG has been updated to include
|
||||
support for both C and C++. You can read about the interface
|
||||
<a href="Allegrocl.html#Allegrocl_nn1">here</a>
|
||||
<a href="Allegrocl.html#Allegrocl">here</a>
|
||||
</p>
|
||||
|
||||
<H2><a name="Lisp_nn3"></a>22.2 Common Foreign Function Interface(CFFI)</H2>
|
||||
|
|
@ -96,14 +96,14 @@ swig -cffi -help
|
|||
|
||||
<tr>
|
||||
<td>-generate-typedef</td>
|
||||
<td>If this option is given then defctype will be used to generate<br\>
|
||||
<td>If this option is given then defctype will be used to generate<br/>
|
||||
shortcuts according to the typedefs in the input.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>-[no]cwrap</td>
|
||||
<td>Turn on or turn off generation of an intermediate C file when<br\>
|
||||
<td>Turn on or turn off generation of an intermediate C file when<br/>
|
||||
creating a C interface. By default this is only done for C++ code.
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -269,7 +269,7 @@ The generated SWIG Code will be:
|
|||
want to lispify the names, also, before we forget you want to
|
||||
export the generated lisp names. To do this, we will use the
|
||||
SWIG <a
|
||||
href="Customization.html#features">feature directive</a>.
|
||||
href="Customization.html#Customization_features">feature directive</a>.
|
||||
Let's edit the interface file such that the C type "div_t*" is changed
|
||||
to Lisp type ":my-pointer", we lispify all names,
|
||||
export everything, and do some more stuff.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Lua_nn1"></a>23 SWIG and Lua</H1>
|
||||
<H1><a name="Lua"></a>23 SWIG and Lua</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
|
@ -1105,7 +1105,7 @@ will require a pcall, followed by a set of if statements checking the type of th
|
|||
<p>
|
||||
All of this code assumes that your C++ code uses exception specification (which a lot doesn't).
|
||||
If it doesn't consult the "<a href="SWIGPlus.html#SWIGPlus_catches">Exception handling with %catches</a>" section
|
||||
and the "<a href="Customization.html#exception">Exception handling with %exception</a>" section, for more details on how to
|
||||
and the "<a href="Customization.html#Customization_exception">Exception handling with %exception</a>" section, for more details on how to
|
||||
add exception specification to functions or globally (respectively).
|
||||
</p>
|
||||
|
||||
|
|
@ -1210,7 +1210,7 @@ extern void sort_double(double* arr, int len);
|
|||
|
||||
<p>There are basically two ways that SWIG can deal with this. The first way, uses the <tt><carrays.i></tt> library
|
||||
to create an array in C/C++ then this can be filled within Lua and passed into the function. It works, but its a bit tedious.
|
||||
More details can be found in the <a href="Library.html#Library_nn5">carrays.i</a> documention.</p>
|
||||
More details can be found in the <a href="Library.html#Library_carrays">carrays.i</a> documention.</p>
|
||||
|
||||
<p>The second and more intuitive way, would be to pass a Lua table directly into the function, and have SWIG automatically convert between Lua-table and C-array. Within the <tt><typemaps.i></tt> file there are typemaps ready written to perform this task. To use them is again a matter of using %appy in the correct manner.</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
# validation.
|
||||
#
|
||||
# Additional html validation can be done using the validate target.
|
||||
# Additional link checking can be done using the linkchecker target.
|
||||
#
|
||||
|
||||
# Note the # and " are escaped
|
||||
|
|
@ -28,9 +29,9 @@ CCache.html: ../../CCache/ccache.yo
|
|||
# it is just used as a primitive HTML checker.
|
||||
# CCache.html is generated by yodl2html and has a few insignificant problems, so we don't put it through tidy
|
||||
check:
|
||||
tidy -errors --gnu-emacs yes -quiet index.html
|
||||
tidy -errors --gnu-emacs yes -quiet Sections.html
|
||||
all=`sed '/^#/d' chapters | grep -v CCache.html`; for a in $$all; do tidy -errors --gnu-emacs yes -quiet $$a; done;
|
||||
tidy -errors --gnu-emacs yes -quiet index.html
|
||||
tidy -errors --gnu-emacs yes -quiet Sections.html
|
||||
all=`sed '/^#/d' chapters | grep -v CCache.html`; for a in $$all; do tidy -errors --gnu-emacs yes -quiet $$a; done;
|
||||
|
||||
generate: swightml.book swigpdf.book
|
||||
htmldoc --batch swightml.book || true
|
||||
|
|
@ -49,7 +50,7 @@ swightml.book:
|
|||
echo "Sections.html" >> swightml.book
|
||||
cat chapters >> swightml.book
|
||||
|
||||
clean: clean-baks
|
||||
maintainer-clean: clean-baks
|
||||
rm -f swightml.book
|
||||
rm -f swigpdf.book
|
||||
rm -f CCache.html
|
||||
|
|
@ -60,11 +61,15 @@ clean-baks:
|
|||
rm -f *.bak
|
||||
|
||||
test:
|
||||
grep "href=\".*\.html\"" index.html
|
||||
grep "href=\".*\.html\"" Sections.html
|
||||
all=`sed '/^#/d' chapters`; for a in $$all; do grep -l "href=\".*\.html\"" $$a; done;
|
||||
grep "href=\".*\.html\"" index.html
|
||||
grep "href=\".*\.html\"" Sections.html
|
||||
all=`sed '/^#/d' chapters`; for a in $$all; do grep -l "href=\".*\.html\"" $$a; done;
|
||||
|
||||
# Validating using the WDG offline validator - http://www.htmlhelp.com/tools/validator/offline/
|
||||
validate:
|
||||
all=`sed '/^#/d' chapters`; for a in $$all; do validate --emacs $$a; done;
|
||||
all=`sed '/^#/d' chapters`; for a in $$all; do validate --emacs $$a; done;
|
||||
|
||||
# Link checking using linkchecker (can take a while - 30 mins)
|
||||
linkchecker:
|
||||
linkchecker --anchors Contents.html
|
||||
|
||||
|
|
|
|||
|
|
@ -9,38 +9,38 @@
|
|||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="#modula3_overview">Overview</a>
|
||||
<li><a href="#Modula3_modula3_overview">Overview</a>
|
||||
<ul>
|
||||
<li><a href="#whyscripting">Why not scripting ?</a>
|
||||
<li><a href="#whymodula3">Why Modula-3 ?</a>
|
||||
<li><a href="#whycpp">Why C / C++ ?</a>
|
||||
<li><a href="#whyswig">Why SWIG ?</a>
|
||||
<li><a href="#Modula3_whyscripting">Why not scripting ?</a>
|
||||
<li><a href="#Modula3_whymodula3">Why Modula-3 ?</a>
|
||||
<li><a href="#Modula3_whycpp">Why C / C++ ?</a>
|
||||
<li><a href="#Modula3_whyswig">Why SWIG ?</a>
|
||||
</ul>
|
||||
<li><a href="#conception">Conception</a>
|
||||
<li><a href="#Modula3_conception">Conception</a>
|
||||
<ul>
|
||||
<li><a href="#cinterface">Interfaces to C libraries</a>
|
||||
<li><a href="#cppinterface">Interfaces to C++ libraries</a>
|
||||
<li><a href="#Modula3_cinterface">Interfaces to C libraries</a>
|
||||
<li><a href="#Modula3_cppinterface">Interfaces to C++ libraries</a>
|
||||
</ul>
|
||||
<li><a href="#preliminaries">Preliminaries</a>
|
||||
<li><a href="#Modula3_preliminaries">Preliminaries</a>
|
||||
<ul>
|
||||
<li><a href="#compilers">Compilers</a>
|
||||
<li><a href="#commandline">Additional Commandline Options</a>
|
||||
<li><a href="#Modula3_compilers">Compilers</a>
|
||||
<li><a href="#Modula3_commandline">Additional Commandline Options</a>
|
||||
</ul>
|
||||
<li><a href="#modula3_typemaps">Modula-3 typemaps</a>
|
||||
<li><a href="#Modula3_typemaps">Modula-3 typemaps</a>
|
||||
<ul>
|
||||
<li><a href="#inoutparam">Inputs and outputs</a>
|
||||
<li><a href="#ordinals">Subranges, Enumerations, Sets</a>
|
||||
<li><a href="#class">Objects</a>
|
||||
<li><a href="#imports">Imports</a>
|
||||
<li><a href="#exceptions">Exceptions</a>
|
||||
<li><a href="#typemap_example">Example</a>
|
||||
<li><a href="#Modula3_inoutparam">Inputs and outputs</a>
|
||||
<li><a href="#Modula3_ordinals">Subranges, Enumerations, Sets</a>
|
||||
<li><a href="#Modula3_class">Objects</a>
|
||||
<li><a href="#Modula3_imports">Imports</a>
|
||||
<li><a href="#Modula3_exceptions">Exceptions</a>
|
||||
<li><a href="#Modula3_typemap_example">Example</a>
|
||||
</ul>
|
||||
<li><a href="#hints">More hints to the generator</a>
|
||||
<li><a href="#Modula3_hints">More hints to the generator</a>
|
||||
<ul>
|
||||
<li><a href="#features">Features</a>
|
||||
<li><a href="#pragmas">Pragmas</a>
|
||||
<li><a href="#Modula3_features">Features</a>
|
||||
<li><a href="#Modula3_pragmas">Pragmas</a>
|
||||
</ul>
|
||||
<li><a href="#remarks">Remarks</a>
|
||||
<li><a href="#Modula3_remarks">Remarks</a>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- INDEX -->
|
||||
|
|
@ -54,10 +54,10 @@ You should be familiar with the
|
|||
<a href="SWIG.html#SWIG">basics</a>
|
||||
of SWIG,
|
||||
especially
|
||||
<a href="Typemaps.html">typemaps</a>.
|
||||
<a href="Typemaps.html#Typemaps">typemaps</a>.
|
||||
</p>
|
||||
|
||||
<H2><a name="modula3_overview"></a>24.1 Overview</H2>
|
||||
<H2><a name="Modula3_modula3_overview"></a>24.1 Overview</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -90,7 +90,7 @@ So the introduction got a bit longer than it should ... ;-)
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="whyscripting"></a>24.1.1 Why not scripting ?</H3>
|
||||
<H3><a name="Modula3_whyscripting"></a>24.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>24.1.2 Why Modula-3 ?</H3>
|
||||
<H3><a name="Modula3_whymodula3"></a>24.1.2 Why Modula-3 ?</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -166,7 +166,7 @@ it's statically typed, too.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="whycpp"></a>24.1.3 Why C / C++ ?</H3>
|
||||
<H3><a name="Modula3_whycpp"></a>24.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>24.1.4 Why SWIG ?</H3>
|
||||
<H3><a name="Modula3_whyswig"></a>24.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>24.2 Conception</H2>
|
||||
<H2><a name="Modula3_conception"></a>24.2 Conception</H2>
|
||||
|
||||
|
||||
<H3><a name="cinterface"></a>24.2.1 Interfaces to C libraries</H3>
|
||||
<H3><a name="Modula3_cinterface"></a>24.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>24.2.2 Interfaces to C++ libraries</H3>
|
||||
<H3><a name="Modula3_cppinterface"></a>24.2.2 Interfaces to C++ libraries</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -477,13 +477,13 @@ Is it possible to sub-class C++ classes with Modula-3 code?
|
|||
This issue is addressed by directors,
|
||||
a feature that was experimentally added to some Language modules
|
||||
like
|
||||
<a href="Java.html#java_directors">Java</a> and
|
||||
<a href="Python.html#directors">Python</a>.
|
||||
<a href="Java.html#Java_directors">Java</a> and
|
||||
<a href="Python.html#Python_directors">Python</a>.
|
||||
</li>
|
||||
<li>
|
||||
How to manage storage with the garbage collector of Modula-3?
|
||||
Support for
|
||||
<a href="Customization.html#ownership">
|
||||
<a href="Customization.html#Customization_ownership">
|
||||
<tt>%newobject</tt> and <tt>%typemap(newfree)</tt></a>
|
||||
isn't implemented, yet.
|
||||
What's about resources that are managed by the garbage collector
|
||||
|
|
@ -494,7 +494,7 @@ as far as I know.
|
|||
<li>
|
||||
How to turn C++ exceptions into Modula-3 exceptions?
|
||||
There's also no support for
|
||||
<a href="Customization.html#exception">
|
||||
<a href="Customization.html#Customization_exception">
|
||||
<tt>%exception</tt></a>, yet.
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -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>24.3 Preliminaries</H2>
|
||||
<H2><a name="Modula3_preliminaries"></a>24.3 Preliminaries</H2>
|
||||
|
||||
|
||||
<H3><a name="compilers"></a>24.3.1 Compilers</H3>
|
||||
<H3><a name="Modula3_compilers"></a>24.3.1 Compilers</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -522,7 +522,7 @@ For testing examples I use Critical Mass cm3.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="commandline"></a>24.3.2 Additional Commandline Options</H3>
|
||||
<H3><a name="Modula3_commandline"></a>24.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>24.4 Modula-3 typemaps</H2>
|
||||
<H2><a name="Modula3_typemaps"></a>24.4 Modula-3 typemaps</H2>
|
||||
|
||||
|
||||
<H3><a name="inoutparam"></a>24.4.1 Inputs and outputs</H3>
|
||||
<H3><a name="Modula3_inoutparam"></a>24.4.1 Inputs and outputs</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -818,7 +818,7 @@ consist of the following parts:
|
|||
</table>
|
||||
|
||||
|
||||
<H3><a name="ordinals"></a>24.4.2 Subranges, Enumerations, Sets</H3>
|
||||
<H3><a name="Modula3_ordinals"></a>24.4.2 Subranges, Enumerations, Sets</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -870,7 +870,7 @@ that I'd like to automate.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="class"></a>24.4.3 Objects</H3>
|
||||
<H3><a name="Modula3_class"></a>24.4.3 Objects</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -883,7 +883,7 @@ is not really useful, yet.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="imports"></a>24.4.4 Imports</H3>
|
||||
<H3><a name="Modula3_imports"></a>24.4.4 Imports</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -918,7 +918,7 @@ IMPORT M3toC;
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="exceptions"></a>24.4.5 Exceptions</H3>
|
||||
<H3><a name="Modula3_exceptions"></a>24.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>24.4.6 Example</H3>
|
||||
<H3><a name="Modula3_typemap_example"></a>24.4.6 Example</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -989,10 +989,10 @@ where almost everything is generated by a typemap:
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H2><a name="hints"></a>24.5 More hints to the generator</H2>
|
||||
<H2><a name="Modula3_hints"></a>24.5 More hints to the generator</H2>
|
||||
|
||||
|
||||
<H3><a name="features"></a>24.5.1 Features</H3>
|
||||
<H3><a name="Modula3_features"></a>24.5.1 Features</H3>
|
||||
|
||||
|
||||
<table border summary="Modula-3 features">
|
||||
|
|
@ -1022,14 +1022,14 @@ where almost everything is generated by a typemap:
|
|||
This is necessary in the cases
|
||||
where it was defined by a non-trivial C expression.
|
||||
This feature is used by the
|
||||
<tt>-generateconst</tt> <a href="#options">option</a>.
|
||||
<tt>-generateconst</tt> <a href="#Modula3_commandline">option</a>.
|
||||
In future it may be generalized to other kind of values
|
||||
such as strings.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<H3><a name="pragmas"></a>24.5.2 Pragmas</H3>
|
||||
<H3><a name="Modula3_pragmas"></a>24.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>24.6 Remarks</H2>
|
||||
<H2><a name="Modula3_remarks"></a>24.6 Remarks</H2>
|
||||
|
||||
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<li><a href="#Modules_introduction">Modules Introduction</a>
|
||||
<li><a href="#Modules_nn1">Basics</a>
|
||||
<li><a href="#Modules_nn2">The SWIG runtime code</a>
|
||||
<li><a href="#external_run_time">External access to the runtime</a>
|
||||
<li><a href="#Modules_external_run_time">External access to the runtime</a>
|
||||
<li><a href="#Modules_nn4">A word of caution about static libraries</a>
|
||||
<li><a href="#Modules_nn5">References</a>
|
||||
<li><a href="#Modules_nn6">Reducing the wrapper file size</a>
|
||||
|
|
@ -241,7 +241,7 @@ can peacefully coexist. So the type structures are separated by the
|
|||
is empty. Only modules compiled with the same pair will share type information.
|
||||
</p>
|
||||
|
||||
<H2><a name="external_run_time"></a>15.4 External access to the runtime</H2>
|
||||
<H2><a name="Modules_external_run_time"></a>15.4 External access to the runtime</H2>
|
||||
|
||||
|
||||
<p>As described in <a href="Typemaps.html#runtime_type_checker">The run-time type checker</a>,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<H1><a name="MzScheme"></a>25 SWIG and MzScheme</H1>
|
||||
<H1><a name="Mzscheme"></a>25 SWIG and MzScheme</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -2921,7 +2921,7 @@ not even sure if it really works).
|
|||
|
||||
<p>
|
||||
It is possible to override the SWIG generated proxy/shadow methods, using <tt>%feature("shadow")</tt>.
|
||||
It works like all the other <a href="Customization.html#features">%feature directives</a>.
|
||||
It works like all the other <a href="Customization.html#Customization_features">%feature directives</a>.
|
||||
Here is a simple example showing how to add some Perl debug code to the constructor:
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ Although PHP does not support overloading functions natively, swig
|
|||
will generate dispatch functions which will use <tt>%typecheck</tt>
|
||||
typemaps to allow overloading. This dispatch function's operation and
|
||||
precedence is described in <a
|
||||
href="TypemapsSWIGPlus.html#SWIGPlus_overloaded_methods">Wrapping
|
||||
href="SWIGPlus.html#SWIGPlus_overloaded_methods">Wrapping
|
||||
Overloaded Functions and Methods</a>.
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ Such information generally includes type declarations (e.g., <tt>typedef</tt>) a
|
|||
C++ classes that might be used as base-classes for class declarations in the interface.
|
||||
The use of <tt>%import</tt> is also important when SWIG is used to generate
|
||||
extensions as a collection of related modules. This is an advanced topic and is described
|
||||
in later in the <a href="Modules.html">Working with Modules</a> chapter.
|
||||
in later in the <a href="Modules.html#Modules">Working with Modules</a> chapter.
|
||||
</p>
|
||||
|
||||
<P>
|
||||
|
|
@ -377,7 +377,7 @@ SWIG will strip the extra <tt>%</tt> and leave the preprocessor directive in the
|
|||
|
||||
|
||||
<p>
|
||||
<a href="Typemaps.html">Typemaps</a> support a special attribute called <tt>noblock</tt> where the { ... } delimiters can be used,
|
||||
<a href="Typemaps.html#Typemaps">Typemaps</a> support a special attribute called <tt>noblock</tt> where the { ... } delimiters can be used,
|
||||
but the delimiters are not actually generated into the code.
|
||||
The effect is then similar to using "" or %{ %} delimiters but the code <b>is</b> run through the preprocessor. For example:
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -2513,7 +2513,7 @@ in Python-2.2, an entirely new type of class system was introduced.
|
|||
This new-style class system offers many enhancements including static
|
||||
member functions, properties (managed attributes), and class methods.
|
||||
Details about all of these changes can be found on <a
|
||||
href="//www.python.org">www.python.org</a> and is not repeated here.
|
||||
href="http://www.python.org">www.python.org</a> and is not repeated here.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
<li><a href="#Ruby_nn22">C++ namespaces</a>
|
||||
<li><a href="#Ruby_nn23">C++ templates</a>
|
||||
<li><a href="#Ruby_nn23_1">C++ Standard Template Library (STL)</a>
|
||||
<li><a href="#C_STL_Functors">C++ STL Functors</a>
|
||||
<li><a href="#Ruby_C_STL_Functors">C++ STL Functors</a>
|
||||
<li><a href="#Ruby_C_Iterators">C++ STL Iterators</a>
|
||||
<li><a href="#Ruby_nn24">C++ Smart Pointers</a>
|
||||
<li><a href="#Ruby_nn25">Cross-Language Polymorphism</a>
|
||||
|
|
@ -142,7 +142,7 @@
|
|||
</ul>
|
||||
<li><a href="#Ruby_nn53">Advanced Topics</a>
|
||||
<ul>
|
||||
<li><a href="#Ruby_nn54">Operator overloading</a>
|
||||
<li><a href="#Ruby_operator_overloading">Operator overloading</a>
|
||||
<li><a href="#Ruby_nn55">Creating Multi-Module Packages</a>
|
||||
<li><a href="#Ruby_nn56">Specifying Mixin Modules</a>
|
||||
</ul>
|
||||
|
|
@ -1317,7 +1317,7 @@ this code: </p>
|
|||
|
||||
|
||||
<p> If you want to set an array member, you will need to supply a
|
||||
"memberin" typemap described in the <a href="#ruby_cpp_smart_pointers">section on typemaps</a>.
|
||||
"memberin" typemap described in the <a href="#Ruby_memberin_typemap">section on typemaps</a>.
|
||||
As a special case, SWIG does generate code to set array members of type
|
||||
<tt>char</tt> (allowing you to store a Ruby string in the
|
||||
structure). </p>
|
||||
|
|
@ -1956,7 +1956,7 @@ example: </p>
|
|||
|
||||
|
||||
<p> More details about wrapping C++ operators into Ruby operators
|
||||
is discussed in the <a href="#ruby_operator_overloading">section
|
||||
is discussed in the <a href="#Ruby_operator_overloading">section
|
||||
on operator overloading</a>. </p>
|
||||
|
||||
|
||||
|
|
@ -2336,7 +2336,7 @@ chapter.</p>
|
|||
|
||||
|
||||
|
||||
<H3><a name="C_STL_Functors"></a>32.3.14 C++ STL Functors</H3>
|
||||
<H3><a name="Ruby_C_STL_Functors"></a>32.3.14 C++ STL Functors</H3>
|
||||
|
||||
|
||||
<p>Some containers in the STL allow you to modify their default
|
||||
|
|
@ -2877,7 +2877,7 @@ method. For example: </p>
|
|||
|
||||
<p> SWIG's Ruby module supports cross-language polymorphism
|
||||
(a.k.a. the "directors" feature) similar to that for SWIG's Python
|
||||
module. Rather than duplicate the information presented in the <a href="Ruby">Python</a> chapter, this
|
||||
module. Rather than duplicate the information presented in the <a href="Python.html#Python">Python</a> chapter, this
|
||||
section just notes the differences that you need to be aware of when
|
||||
using this feature with Ruby. </p>
|
||||
|
||||
|
|
@ -6089,7 +6089,7 @@ a function. For example:</p>
|
|||
|
||||
|
||||
|
||||
<p> See <a href="http://www.swig.org/Doc1.3/SWIGDocumentation.html#ownership">Object
|
||||
<p> See <a href="Customization.html#Customization_ownership">Object
|
||||
ownership and %newobject</a> for further details.</p>
|
||||
|
||||
|
||||
|
|
@ -7099,8 +7099,8 @@ being created. </div>
|
|||
|
||||
<p> When you write a typemap, you usually have to work directly
|
||||
with Ruby objects. The following functions may prove to be useful.
|
||||
(These functions plus many more can be found in <a href="http://www.rubycentral.com/book"><em>Programming
|
||||
Ruby</em></a>, by David Thomas and Andrew Hunt.) </p>
|
||||
(These functions plus many more can be found in <em>Programming
|
||||
Ruby</em> book, by David Thomas and Andrew Hunt.) </p>
|
||||
<p>In addition, we list equivalent functions that SWIG defines, which
|
||||
provide a language neutral conversion (these functions are defined for
|
||||
each swig language supported). If you are trying to create a swig
|
||||
|
|
@ -8510,7 +8510,7 @@ docstring and they are output together. </p>
|
|||
<H2><a name="Ruby_nn53"></a>32.9 Advanced Topics</H2>
|
||||
|
||||
|
||||
<H3><a name="Ruby_nn54"></a>32.9.1 Operator overloading</H3>
|
||||
<H3><a name="Ruby_operator_overloading"></a>32.9.1 Operator overloading</H3>
|
||||
|
||||
|
||||
<p> SWIG allows operator overloading with, by using the <tt>%extend</tt>
|
||||
|
|
@ -9530,7 +9530,7 @@ parses the expression <i>a != b</i> as <i>!(a == b)</i>.
|
|||
<H3><a name="Ruby_nn55"></a>32.9.2 Creating Multi-Module Packages</H3>
|
||||
|
||||
|
||||
<p> The chapter on <a href="Modules.html">Working
|
||||
<p> The chapter on <a href="Modules.html#Modules">Working
|
||||
with Modules</a> discusses the basics of creating multi-module
|
||||
extensions with SWIG, and in particular the considerations for sharing
|
||||
runtime type information among the different modules. </p>
|
||||
|
|
@ -10050,7 +10050,7 @@ above. For example:</p>
|
|||
<p>In this case, the default SWIG behavior for calling member
|
||||
functions is incorrect. The Ruby object should assume ownership of the
|
||||
returned object. This can be done by using the %newobject directive.
|
||||
See <a href="file:///d:/msys/1.0/src/SWIG/Doc/Manual/Customization.html#ownership">
|
||||
See <a href="Customization.html#Customization_ownership">
|
||||
Object ownership and %newobject</a> for more information. </p>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<li><a href="#SWIG_nn2">Running SWIG</a>
|
||||
<ul>
|
||||
<li><a href="#SWIG_nn3">Input format</a>
|
||||
<li><a href="#output">SWIG Output</a>
|
||||
<li><a href="#SWIG_output">SWIG Output</a>
|
||||
<li><a href="#SWIG_nn5">Comments</a>
|
||||
<li><a href="#SWIG_nn6">C Preprocessor</a>
|
||||
<li><a href="#SWIG_nn7">SWIG Directives</a>
|
||||
|
|
@ -193,7 +193,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>5.1.2 SWIG Output</H3>
|
||||
<H3><a name="SWIG_output"></a>5.1.2 SWIG Output</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1618,7 +1618,7 @@ double y; // Read-write
|
|||
|
||||
<p>
|
||||
The <tt>%mutable</tt> and <tt>%immutable</tt> directives are actually
|
||||
<a href="Customization.html#features">%feature directives</a> defined like this:
|
||||
<a href="Customization.html#Customization_features">%feature directives</a> defined like this:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
|
|
@ -1672,7 +1672,7 @@ directive as shown :</p>
|
|||
// interface.i
|
||||
|
||||
%rename(my_print) print;
|
||||
extern void print(char *);
|
||||
extern void print(const char *);
|
||||
|
||||
%rename(foo) a_really_long_and_annoying_name;
|
||||
extern int a_really_long_and_annoying_name;
|
||||
|
|
@ -1725,9 +1725,10 @@ to ignore declarations that match a given identifier. For example:
|
|||
<div class="code">
|
||||
<pre>
|
||||
%ignore print; // Ignore all declarations named print
|
||||
%ignore _HAVE_FOO_H; // Ignore an include guard constant
|
||||
%ignore MYMACRO; // Ignore a macro
|
||||
...
|
||||
%include "foo.h" // Grab a header file
|
||||
#define MYMACRO 123
|
||||
void print(const char *);
|
||||
...
|
||||
</pre>
|
||||
</div>
|
||||
|
|
@ -1742,7 +1743,7 @@ declarations. If you need to remove a whole section of problematic code, the SW
|
|||
<p>
|
||||
More powerful variants of <tt>%rename</tt> and <tt>%ignore</tt> directives can be used to help
|
||||
wrap C++ overloaded functions and methods or C++ methods which use default arguments. This is described in the
|
||||
<a href="SWIGPlus.html#ambiguity_resolution_renaming">Ambiguity resolution and renaming</a> section in the C++ chapter.
|
||||
<a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a> section in the C++ chapter.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
@ -1752,7 +1753,7 @@ For example:
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
%name(output) extern void print(char *);
|
||||
%name(output) extern void print(const char *);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -42,13 +42,16 @@
|
|||
<ul>
|
||||
<li><a href="#SWIGPlus_nn24">Dispatch function generation</a>
|
||||
<li><a href="#SWIGPlus_nn25">Ambiguity in Overloading</a>
|
||||
<li><a href="#ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>
|
||||
<li><a href="#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>
|
||||
<li><a href="#SWIGPlus_nn27">Comments on overloading</a>
|
||||
</ul>
|
||||
<li><a href="#SWIGPlus_nn28">Wrapping overloaded operators</a>
|
||||
<li><a href="#SWIGPlus_class_extension">Class extension</a>
|
||||
<li><a href="#SWIGPlus_nn30">Templates</a>
|
||||
<li><a href="#SWIGPlus_nn31">Namespaces</a>
|
||||
<li><a href="#SWIGPlus_namespaces">Namespaces</a>
|
||||
<ul>
|
||||
<li><a href="#SWIGPlus_nspace">The nspace feature for namespaces</a>
|
||||
</ul>
|
||||
<li><a href="#SWIGPlus_renaming_templated_types_namespaces">Renaming templated types in namespaces</a>
|
||||
<li><a href="#SWIGPlus_exception_specifications">Exception specifications</a>
|
||||
<li><a href="#SWIGPlus_catches">Exception handling with %catches</a>
|
||||
|
|
@ -1125,7 +1128,7 @@ For example if a method has ten default arguments, then eleven wrapper methods a
|
|||
<p>
|
||||
Please see the <a href="Customization.html#Customization_features_default_args">Features and default arguments</a>
|
||||
section for more information on using <tt>%feature</tt> with functions with default arguments.
|
||||
The <a href="#ambiguity_resolution_renaming">Ambiguity resolution and renaming</a> section
|
||||
The <a href="#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a> section
|
||||
also deals with using <tt>%rename</tt> and <tt>%ignore</tt> on methods with default arguments.
|
||||
If you are writing your own typemaps for types used in methods with default arguments, you may also need to write a <tt>typecheck</tt> typemap.
|
||||
See the <a href="Typemaps.html#Typemaps_overloading">Typemaps and overloading</a> section for details or otherwise
|
||||
|
|
@ -2124,7 +2127,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>6.15.3 Ambiguity resolution and renaming</H3>
|
||||
<H3><a name="SWIGPlus_ambiguity_resolution_renaming"></a>6.15.3 Ambiguity resolution and renaming</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -3647,12 +3650,16 @@ as the class name. For example:
|
|||
Similar changes apply to typemaps and other customization features.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_nn31"></a>6.19 Namespaces</H2>
|
||||
<H2><a name="SWIGPlus_namespaces"></a>6.19 Namespaces</H2>
|
||||
|
||||
|
||||
<p>
|
||||
Support for C++ namespaces is a relatively late addition to SWIG,
|
||||
first appearing in SWIG-1.3.12. Before describing the implementation,
|
||||
Support for C++ namespaces is comprehensive, but by default simple, however,
|
||||
some target languages can turn on more advanced namespace support via the
|
||||
<a href="#SWIGPlus_nspace">nspace feature</a>, described later.
|
||||
Code within unnamed namespaces is ignored as there is no external
|
||||
access to symbols declared within the unnamed namespace.
|
||||
Before detailing the default implementation for named namespaces,
|
||||
it is worth noting that the semantics of C++ namespaces is extremely
|
||||
non-trivial--especially with regard to the C++ type system and class
|
||||
machinery. At a most basic level, namespaces are sometimes used to
|
||||
|
|
@ -3836,7 +3843,7 @@ When this conflict occurs, you will get an error message that resembles this:
|
|||
|
||||
<div class="shell">
|
||||
<pre>
|
||||
example.i:26. Error. 'foo' is multiply defined in the generated module.
|
||||
example.i:26. Error. 'foo' is multiply defined in the generated target language module.
|
||||
example.i:23. Previous declaration of 'foo'
|
||||
</pre>
|
||||
</div>
|
||||
|
|
@ -4092,6 +4099,87 @@ with any namespace awareness. In the future, language modules may or may not p
|
|||
more advanced namespace support.
|
||||
</p>
|
||||
|
||||
<H3><a name="SWIGPlus_nspace"></a>6.19.1 The nspace feature for namespaces</H3>
|
||||
|
||||
|
||||
<p>
|
||||
Some target languages provide support for the <tt>nspace</tt> <a href="Customization.html#Customization_features">feature</a>.
|
||||
The feature can be applied to any class, struct, union or enum declared within a named namespace.
|
||||
The feature wraps the type within the target language specific concept of a namespace,
|
||||
for example, a Java package or C# namespace.
|
||||
Please see the language specific sections to see if the target language you are interested in supports the nspace feature.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The feature is demonstrated below for C# using the following example:
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
<pre>
|
||||
%feature("nspace") MyWorld::Material::Color;
|
||||
%nspace MyWorld::Wrapping::Color; // %nspace is a macro for %feature("nspace")
|
||||
|
||||
namespace MyWorld {
|
||||
namespace Material {
|
||||
class Color {
|
||||
...
|
||||
};
|
||||
}
|
||||
namespace Wrapping {
|
||||
class Color {
|
||||
...
|
||||
};
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Without the <tt>nspace</tt> feature directives above or <tt>%rename</tt>, you would get the following warning resulting in just one of the <tt>Color</tt> classes being available for use from the target language:
|
||||
</p>
|
||||
|
||||
<div class="shell">
|
||||
<pre>
|
||||
example.i:9: Error: 'Color' is multiply defined in the generated target language module.
|
||||
example.i:5: Error: Previous declaration of 'Color'
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
With the <tt>nspace</tt> feature the two <tt>Color</tt> classes are wrapped into the equivalent C# namespaces.
|
||||
A fully qualified constructor call of each these two types in C# is then:
|
||||
</p>
|
||||
|
||||
<div class="targetlang">
|
||||
<pre>
|
||||
MyWorld.Material.Color materialColor = new MyWorld.Material.Color();
|
||||
MyWorld.Wrapping.Color wrappingColor = new MyWorld.Wrapping.Color();
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Note that the <tt>nspace</tt> feature does not apply to variables and functions simply declared in a namespace. For example, the following symbols cannot co-exist in the target language without renaming. This may change in a future version.
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
<pre>
|
||||
namespace MyWorld {
|
||||
namespace Material {
|
||||
int quantity;
|
||||
void dispatch();
|
||||
}
|
||||
namespace Wrapping {
|
||||
int quantity;
|
||||
void dispatch();
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<b>Compatibility Note:</b> The nspace feature was first introduced in SWIG-2.0.0.
|
||||
</p>
|
||||
|
||||
<H2><a name="SWIGPlus_renaming_templated_types_namespaces"></a>6.20 Renaming templated types in namespaces</H2>
|
||||
|
||||
|
||||
|
|
@ -4216,7 +4304,7 @@ is outlined in the <a href="Typemaps.html#throws_typemap">"throws" typemap</a> s
|
|||
<p>
|
||||
Since exception specifications are sometimes only used sparingly, this alone may not be enough to
|
||||
properly handle C++ exceptions. To do that, a different set of special SWIG directives are used.
|
||||
Consult the "<a href="Customization.html#exception">Exception handling with %exception</a>" section for details.
|
||||
Consult the "<a href="Customization.html#Customization_exception">Exception handling with %exception</a>" section for details.
|
||||
The next section details a way of simulating an exception specification or replacing an existing one.
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -41,13 +41,13 @@ to help!).
|
|||
<H3>Language Module Documentation</H3>
|
||||
|
||||
<ul>
|
||||
<li><a href="Allegrocl.html#Allegrocl_nn1">Allegro CL support</a></li>
|
||||
<li><a href="Allegrocl.html#Allegrocl">Allegro CL support</a></li>
|
||||
<li><a href="CSharp.html#CSharp">C# support</a></li>
|
||||
<li><a href="Chicken.html#Chicken">Chicken support</a></li>
|
||||
<li><a href="Guile.html#Guile">Guile support</a></li>
|
||||
<li><a href="Java.html#Java">Java support</a></li>
|
||||
<li><a href="Lua.html#Lua_nn1">Lua support</a></li>
|
||||
<li><a href="Lisp.html#Lisp_nn1">Common Lisp support</a></li>
|
||||
<li><a href="Lua.html#Lua">Lua support</a></li>
|
||||
<li><a href="Lisp.html#Lisp">Common Lisp support</a></li>
|
||||
<li><a href="Modula3.html#Modula3">Modula3 support</a></li>
|
||||
<li><a href="Mzscheme.html#MzScheme">MzScheme support</a></li>
|
||||
<li><a href="Ocaml.html#Ocaml">Ocaml support</a></li>
|
||||
|
|
@ -78,9 +78,5 @@ implementation of typemaps. Make sure you read the <a href="Typemaps.html#Type
|
|||
chapter above if you are using this feature.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="Advanced.html#Advanced">Advanced topics</a> (see <a href="Modules.html#Modules">Modules</a> for updated information).</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -102,7 +102,7 @@ int foo(double); // Silently ignored.
|
|||
<p>
|
||||
The <tt>%warnfilter</tt> directive has the same semantics as other declaration modifiers like
|
||||
<tt>%rename</tt>, <tt>%ignore</tt> and <tt>%feature</tt>, see the
|
||||
<a href="Customization.html#features">%feature directive</a> section. For example, if you wanted to
|
||||
<a href="Customization.html#Customization_features">%feature directive</a> section. For example, if you wanted to
|
||||
suppress a warning for a method in a class hierarchy, you could do this:
|
||||
</p>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue