Merge branch 'vadz-doxygen'

This is the Doxygen work begun in Google Summer of Code projects 2008
and 2012 and subsequently improved by numerous contributors.

* vadz-doxygen: (314 commits)
  Add changes entry for Doxygen support
  Add some missing doctype tyemaps
  Doxygen warnings cleanup
  Move doxygen warning numbers
  Add Python doxygen example
  Doxygen example
  Add Doxygen to include paths
  Doxygen source rename
  More merge fixes from doxygen branches
  Correct python example headers
  Correct source code headers
  Another merge fix from doxygen branches
  Java enums output format fixes
  Add omitted doxygen_parsing_enums testcase
  PEP8 conformance for comment verifier module
  Clean up merge problem
  Doxygen html tweaks
  Update html chapter numbering for added Doxygen chapter
  Fixes to makechap.py to detect ill-formed headers
  html fixes for Doxygen
  Add missing CPlusPlus17.html file
  Format files to unix format
  Doxygen testcase tweak to match that in the html docs
  Doxygen html documentation updates and corrections
  Remove doxygen Examples subdirectory
  Beautify doxygen source code
  Code formatting fixes in doxygen code
  Remove unused doxygen code
  new_node refactor
  Various merge fixes in doxygen branches
  Unused variable warning fix
  Fix wrongly resetting indent after formulae in Doxygen comments
  Add support for doxygen:alias feature
  Get rid of meaningless return type of DoxygenParser methods
  Return enum, not untyped int, when classifying Doxygen commands
  Get rid of unnecessary "typedef enum" in C++ code
  Use slash, not backslash, in "C/C++" in the documentation
  Replace literal "<" with "&lt;" in HTML documentation
  Fix broken link to java.sun.com in Doxygen documentation
  Fix using com.sun.tools.javadoc package under macOS
  Fix error reporting for special characters in Doxygen parsing code
  Switch Python Doxygen unit tests to use inspect.getdoc()
  Use correct separator in Java class path under Windows.
  Remove executable permission from appveyor.yml.
  Use JAVA_HOME value in configure to detect Java.
  Display JAVA_HOME value in "make java_version".
  Fix harmless MSVC warning in DoxygenTranslator code.
  Reset "_last" for all but first enum elements.
  Don't duplicate Javadoc from global enum Doxygen comments twice.
  Move Doxygen comments concatenation from the parser to the lexer.
  Fix shift/reduce conflicts in Doxygen pre/post comment parsing.
  Rewrote part of the grammar dealing with Doxygen comments for enums.
  No changes, just remove spurious white space only differences.
  Move Doxygen comment mangling from the parser to the lexer.
  Merge "-builtin" autodoc bugs workarounds from master into test.
  Quote JAVA_HOME variable value in Java test suite makefile.
  Remove unused C_COMMENT_STRING terminal from the grammar.
  Fix missing returns in the Doxygen test suite code.
  Fix trimming whitespace from Doxygen comments.
  Remove code not doing anything from PyDocConverter.
  Remove unused <sstream> header.
  Remove unreferenced struct declaration.
  Remove unused Swig_warn() function.
  Remove any whitespace before ignored Doxygen commands.
  Remove trailing space from one of Doxygen tests.
  Fix autodoc strings generated in Python builtin case and the test.
  Fix Doxygen unit test in Python "-builtin" case.
  Use class docstrings in "-builtin" Python case.
  Don't indent Doxygen doc strings in generated Python code.
  Add a possibility to flexibly ignore custom Doxygen tags.
  Stop completely ignoring many Doxygen comments.
  Fix structural Doxygen comment recognition in the parser.
  No changes, just make checking for Doxygen structural tags more sane.
  Use "//", not "#", for comments in SWIG input.
  Allow upper case letters and digits in Doxygen words.
  Pass the node the Doxygen comment is attached to to DoxygenParser.
  Get rid of findCommand() which duplicaed commandBelongs().
  Recognize unknown Doxygen tags correctly.
  No real changes, just pass original command to commandBelongs().
  Describe Doxygen-specific %features in a single place.
  Give warnings for unknown Doxygen commands in Doxygen parser.
  Document the return type when translating Doxygen @return to Python.
  Fix translated Doxygen comments for overloaded functions in Python.
  Also merge Doxygen comments for overloaded constructors in Python.
  Allow using enum elements as default values for Python functions.
  Don't always use "*args" for all Python wrapper functions.
  No real changes, just make PYTHON::check_kwargs() const.
  Refactor: move makeParameterName() to common Language base class.
  Remove long line wrapping from Python parameter list generation code.
  Simplify and make more efficient building Python docstrings.
  Translate Doxygen code blocks to Sphinx code blocks.
  Add a simple test of multiple parameters to Doxygen test suite.
  Make Python parameters types hyperlinks in the doc strings.
  Make Language::classLookup() and enumLookup() static.
  Fix arguments of @param, @return etc translations to Python.
  Remove unused method from PyDocConverter.
  No real changes, just remove an unnecessary variable.
  Preserve relative indentation when parsing Doxygen comments.
  Use Sphinx-friendly formatting for overloaded functions documentation.
  Add poor man trailing white space detection to Doxygen Python tests.
  ...
This commit is contained in:
William S Fulton 2018-06-07 08:13:10 +01:00
commit 33921666a1
123 changed files with 12955 additions and 1335 deletions

View file

@ -7,6 +7,11 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.0.0 (in progress)
===========================
2018-06-07: cmfoil, kabbi, Jamie Kirkpatrick, markok314, vadz, wsfulton, Yann Diorcet
#170 Doxygen documentation support added. This allows translation of Doxygen comments
into JavaDoc and PyDoc documentation. It is enabled via the -doxygen command line
option. See the Doxygen.html chapter in the documentation for further information.
2018-06-07: olly
[PHP] We've finally removed support for %pragma(php4) which was
deprecated back in 2008. Use %pragma(php) instead, which has been

View file

@ -62,7 +62,8 @@ Past SWIG developers and major contributors include:
John Lenz (Guile, MzScheme updates, Chicken module, runtime system)
Baozeng Ding <sploving1@163.com> (Scilab)
Ian Lance Taylor (Go)
Vadim Zeitlin (PCRE, Python)
Dmitry Kabak (userdima@gmail.com) (Doxygen)
Vadim Zeitlin (PCRE, Python, Doxygen)
Stefan Zager (szager@gmail.com) (Python)
Vincent Couvert (Scilab)
Sylvestre Ledru (Scilab)

View file

@ -0,0 +1,341 @@
Project Plan
============
SWIG Code Comments
Google Summer of Code 2012
This document describes goals for the Google Summer of Code 2012,
SWIG code documentation project.
Author: Marko Klopcic, Dmitry Kabak
Introduction
============
The goal of this project is _not_ to translate _any_ possible Doxygen
formatted comment to JavaDoc or PyDoc, but to make it possible to
translate a subset of comment types in C/C++ code to
JavaDoc and PyDoc. Covering all the Doxygen functionality would be to
complex for the limited time. However, the code must be flexible so
that implementing missing features would not require redesign of the
comment handling code in SWIG.
There will also be a possibility to add untranslated comments to Java
and Python code (## comments, see Doxygen manual), if the user will
prefer to use Doxygen on the generated code.
Note:
'-OK-' tick below means that the item is implemented, committed and
working.
Abbreviations:
JD - JavaDoc
PD - PyDoc
Functionality
=============
Types of comments
-----------------
Note:
See 'http://www.stack.nl/~dimitri/doxygen/docblocks.html' for
the detailed description of Doxygen syntax and terms used in this
section.
1. -OK- Only JavaDoc (/** */) and Qt (/*! */) styles of comment blocks
will be supported by SWIG translator.
2. -OK- The following doc after members will be supported:
int var; ///< Detailed description after the member
//!<
int var; //!< Brief description after the member
int var; ///< Brief description after the member
3. -OK- Only comments before or after declaration/definition will be
supported. Comments with structural commands will be ignored
(warning will be written). (What about writing them to
'package.info.java' for JD?)
Tags
----
This section contains all doxygen tags taken from
http://www.stack.nl/~dimitri/doxygen/commands.html. If a tag is
marked as 'ignored', then the tag is ignored, but the text is copied
to the destination documentation. 'Not implemented' means that the
tag with it's contents is stripped out of the output.
Doxygen tags:
All tags: -OK-
\a - translated to <i></i> in JD, surrounded with _ in PD
\addindex - ignored
\addtogroup - ignored
\anchor - ignored, not supported by JD and PD
\arg - equivalent to \li
\attention - ignored
\authors, \author - translated to @author in JD, 'Author:' in PD
\b - <b></b> in JD, surrounded with __ in PD
\brief - ignored
\bug - ignored
\c - translated to <code></code> in JD, ignored in PD
\callgraph - ignored, not supported by JD and PD
\callergraph - ignored, not supported by JD and PD
\category - ignored, used only in Objective C
\cite - translated to <i></i> in JD, single quotes in PD
\class - ignored (structural command)
\code - translated to {@code ...} in JD, ignored in PD
\cond - translated to 'Conditional comment: <condition>'. Later
SWIG may support definitions of conditions in config file.
\copybrief - ignored. Later SWIG may support this command by
performing copy
\copydetails - ignored. Later SWIG may support this command by
performing copy
\copydoc - ignored. Later SWIG may support this command by
performing copy
\copyright - replaced with text 'Copyright' in PD and PD
\date - ignored
\def - ignored (structural command)
\defgroup - not supported
\deprecated - translated to @deprecated in JD, 'Deprecated:' in PD
\details - ignored
\dir - not supported
\dontinclude - not supported
\dot - not supported. Later SWIG may call dot and produce the graph image
to include in JD and PD
\dotfile - see note for \dot
\e - equivalent \a
\else - see note for \cond
\elseif - see note for \cond
\em - equivalent to \a
\endcode - see note for \code
\endcond - translated to 'End of conditional comment: <condition>'. Later
SWIG may support definitions of conditions in config file.
\enddot - see note for \dot
\endhtmlonly - ignored
\endif - see note for \cond
\endinternal - ignored
\endlatexonly - ignored
\endlink - see note for \link
\endmanonly - ignored
\endmsc - see note for \msc
\endrtfonly - ignored
\endverbatim - see note for \verbatim
\endxmlonly - ignored
\enum - ignored (structural command)
\example - translated to 'Example:' in JD and PD
\exception - equivalent to throws, but translates to @exception in JD
\extends - not supported
\f$ - ignored. Later swig may call LATeX to produce bitmaps with formulas
to include in JD and PD
\f[ - see note for \f$
\f] - see note for \f$
\f{ - see note for \f$
\f} - see note for \f$
\file - ignored (structural command)
\fn - ignored (structural command)
\headerfile - not supported
\hideinitializer - not supported
\htmlinclude - not supported
\htmlonly - ignored
\if - see note for \cond
\ifnot - see note for \cond
\image - translated to <img/> in JD only when target=HTML, translated to
'Image: filename(Title)'
\implements - not supported
\include - not supported
\includelineno - not supported
\ingroup - not supported. Later swig may print group names as plain text
in comments like 'Code group: something' in both JD and PD
\internal - ignored
\invariant - ignored
\interface - ignored (structural command)
\latexonly - ignored
\li - trabslated to <li></li> in JD, ignored in PD
\line - not supported
\link - translated to {@link ...} in JD, ignored in PD
\mainpage - ignored
\manonly - ignored
\memberof - not supported
\msc - not supported. Later SWIG may call dot and produce the graph image
to include in JD and PD
\mscfile - see note for \msc
\n - prints the new line
\name - ignored
\namespace - included in package-info.java if nspace feature is enabled,
otherwise ignored, ignored in PD
\nosubgrouping - ignored
\note - translated to 'Note:' in both JD and PD
\overload - prints 'This is an overloaded member function, provided for
convenience. It differs from the above function only in what
argument(s) it accepts.' to the output in both JD and PD
\p - equivalent to \c
\package - is kept same in JD (it is already a JD tag), ignored in PD
\page - ignored
\par - translated to <p alt='title'></p> in JD, 'Title: ...' in PD
\paragraph - ignored
\param - translated to @param in JD, special formatting in PD
\post - ignored
\pre - ignored
\private - ignored
\privatesection - ignored
\property - ignored
\protected - ignored
\protectedsection - ignored
\protocol - ignored (Objective-C tag)
\public - ignored
\publicsection - ignored
\ref - ignored, not supported by JD and PD
\related - ignored
\relates - ignored
\relatedalso - ignored
\relatesalso - ignored
\remark - translated to 'Remarks:' in both JD and PD
\remarks - equivalent to remark
\result - translated to @return in JD, 'Return:' in PD
\return - equivalent to result
\returns - equivalent to result
\retval - ignored
\rtfonly - ignored
\sa - translated to @see in JD, 'See also:' in PD
\section - not supported
\see - equivalent to \sa
\short - equivalent to \brief
\showinitializer - not supported
\since - translated to @since in JD, 'Since:' in PD
\skip - not supported
\skipline - not supported
\snippet - not supported
\struct - ignored (structural command)
\subpage - not supported
\subsection - not supported
\subsubsection - not supported
\tableofcontents - not supported
\test - ignored
\throw - translated to @throws in JD, 'Throws:' in PD
\throws - equivalent to \throw
\todo - translated to 'TODO:' in both JD and PD
\tparam - similar to \arg
\typedef - ignored (structural command)
\union - ignored (structural command)
\until - not supported
\var - ignored (structural command)
\verbatim - translated to {@literal ...} in JD, ignored in PD
\verbinclude - ignored
\version - translated to @version in JD, 'Version:' in PD
\warning - translated to 'Warning:' in both JD and PD
\weakgroup - not supported
\xmlonly - ignored
\xrefitem - ignored
\$ - this and all the others below: these commands insert single char,
it is escaped as HTML char in JD, kept as-is in PD
\@
\\
\&
\~
\<
\>
\#
\%
\"
\.
\::
Optional functionality
======================
That section describes some complex cases where the current code
does not behave really well. Like a short to-do list of special cases.
-OK- When translating functions with default parameters in swig to
java, it creates overloaded functions with all the parameters
except the default ones. We need to copy the doxygen comment to
such functions and correct the list of @param tags.
-OK- In doxygen there is a special tags (and even a special option)
to create links to some code members from the current comment.
Sometimes it needs a type of parameters specified because of the
overloaded functions. And the same linking tags are supported in JD,
but it has a completely different typesystem, so we need to translate
the types of function parameters in comments also. For example:
{@link MyClass#doSomething(const std::string &)}
does not make sense in Java, so the type should be converted.
{@link MyClass#doSomething(String)}
Tests
=====
The following test cases will be implemented:
-OK- Class comments.
-OK- Struct comments.
-OK- Enum comments.
-OK- Function comments.
-OK- Var comments.
-OK- Class attributes, comment before and after declaration.
-OK- Class methods, comment of parameters in function
comment.
-OK- Class methods, comment of parameters
after parameter declaration.
-OK- Struct attributes, comment before and after declaration.
-OK- Struct methods, comment of parameters in function
comment.
-OK- Struct methods, comment of parameters
after parameter declaration.
-OK- Enum items JD and Qt style, comment before items
-OK- Enum items JD and Qt style, comment after items
-OK- Class comment, with all supported tags.
-OK- Class comment, with all doxygen tags, including
ignored ones.
The list of all tests, in form of shell commands to make it simple
to test project by copying the text below into terminal program.
make doxygen_parsing.cpptest -s
make doxygen_translate.cpptest -s
make doxygen_translate_all_tags.cpptest -s
make doxygen_basic_translate.cpptest -s
make doxygen_basic_notranslate.cpptest -s
make doxygen_translate_links.cpptest -s
make doxygen_tricky_constructs.cpptest -s
Refactoring
===========
All the code in directory _Doxygen_ should be refactored:
-OK- all methods should be class members
-OK- most static methods should be normal members
-OK- replace C arrays of strings and sequential searches with STL data
structures and algorithms.
-OK- use singletons instead of class instantiaion for each comment found.
Documentation
=============
SWIG documentation will contain:
-OK- command line options
-OK- list of implemented features (types and placements of comments)
-OK- list of unimplemented features (types and placements of comments)
-OK- list of tags and their translations (all Doxygen tags).
-OK- some amount of debugging and development information

View file

@ -8,7 +8,7 @@
<body bgcolor="#ffffff">
<H1><a name="Allegrocl">19 SWIG and Allegro Common Lisp</a></H1>
<H1><a name="Allegrocl">20 SWIG and Allegro Common Lisp</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -135,10 +135,10 @@ be unhappy to see some enterprising folk use this work to add
to it.
</p>
<H2><a name="Allegrocl_nn2">19.1 Basics</a></H2>
<H2><a name="Allegrocl_nn2">20.1 Basics</a></H2>
<H3><a name="Allegrocl_nn3">19.1.1 Running SWIG</a></H3>
<H3><a name="Allegrocl_nn3">20.1.1 Running SWIG</a></H3>
<p>
@ -360,7 +360,7 @@ need to link in the Allegro shared library. The library you create from
the C++ wrapper will be what you then load into Allegro CL.
</p>
<H3><a name="Allegrocl_nn4">19.1.2 Command Line Options</a></H3>
<H3><a name="Allegrocl_nn4">20.1.2 Command Line Options</a></H3>
<p>
@ -396,7 +396,7 @@ See <a href="#Allegrocl_nn47">Section 17.5 Identifier converter
functions</a> for more details.
</p>
<H3><a name="Allegrocl_nn5">19.1.3 Inserting user code into generated files</a></H3>
<H3><a name="Allegrocl_nn5">20.1.3 Inserting user code into generated files</a></H3>
<p>
@ -436,7 +436,7 @@ Note that the block <tt>%{ ... %}</tt> is effectively a shortcut for
</p>
<H2><a name="Allegrocl_nn6">19.2 Wrapping Overview</a></H2>
<H2><a name="Allegrocl_nn6">20.2 Wrapping Overview</a></H2>
<p>
@ -446,7 +446,7 @@ New users to SWIG are encouraged to read
interested in generating an interface to C++.
</p>
<H3><a name="Allegrocl_nn7">19.2.1 Function Wrapping</a></H3>
<H3><a name="Allegrocl_nn7">20.2.1 Function Wrapping</a></H3>
<p>
@ -499,7 +499,7 @@ interested in generating an interface to C++.
</pre>
</div>
<H3><a name="Allegrocl_nn8">19.2.2 Foreign Wrappers</a></H3>
<H3><a name="Allegrocl_nn8">20.2.2 Foreign Wrappers</a></H3>
<p>
@ -512,7 +512,7 @@ interested in generating an interface to C++.
typemap.
</p>
<H3><a name="Allegrocl_nn9">19.2.3 FFI Wrappers</a></H3>
<H3><a name="Allegrocl_nn9">20.2.3 FFI Wrappers</a></H3>
<p>
@ -593,7 +593,7 @@ char *xxx();
ff:def-foreign-call's.
</p>
<H3><a name="Allegrocl_nn10">19.2.4 Non-overloaded Defuns</a></H3>
<H3><a name="Allegrocl_nn10">20.2.4 Non-overloaded Defuns</a></H3>
<p>
@ -606,7 +606,7 @@ char *xxx();
this function can be manipulated via the <tt>lout</tt> typemap.
</p>
<H3><a name="Allegrocl_nn11">19.2.5 Overloaded Defuns</a></H3>
<H3><a name="Allegrocl_nn11">20.2.5 Overloaded Defuns</a></H3>
<p>
@ -622,7 +622,7 @@ char *xxx();
can be manipulated via the <tt>lout</tt> typemap.
</p>
<H3><a name="Allegrocl_nn12">19.2.6 What about constant and variable access?</a></H3>
<H3><a name="Allegrocl_nn12">20.2.6 What about constant and variable access?</a></H3>
<p>
@ -635,7 +635,7 @@ char *xxx();
into the foreign module.
</p>
<H3><a name="Allegrocl_nn13">19.2.7 Object Wrapping</a></H3>
<H3><a name="Allegrocl_nn13">20.2.7 Object Wrapping</a></H3>
<p>
@ -657,7 +657,7 @@ char *xxx();
foreign function interface.
</p>
<H2><a name="Allegrocl_nn14">19.3 Wrapping Details</a></H2>
<H2><a name="Allegrocl_nn14">20.3 Wrapping Details</a></H2>
<p>
@ -665,7 +665,7 @@ char *xxx();
translated into lisp.
</p>
<H3><a name="Allegrocl_nn15">19.3.1 Namespaces</a></H3>
<H3><a name="Allegrocl_nn15">20.3.1 Namespaces</a></H3>
<p>
@ -742,7 +742,7 @@ namespace car {
function such as <tt>(car '(1 2 3)</tt>.
</p>
<H3><a name="Allegrocl_nn16">19.3.2 Constants</a></H3>
<H3><a name="Allegrocl_nn16">20.3.2 Constants</a></H3>
@ -803,7 +803,7 @@ namespace car {
not use the <tt>-nocwrap</tt> command-line option.
</p>
<H3><a name="Allegrocl_nn17">19.3.3 Variables</a></H3>
<H3><a name="Allegrocl_nn17">20.3.3 Variables</a></H3>
<p>
@ -881,7 +881,7 @@ globalvar&gt; (globalvar.nnn::glob_float)
</pre>
</div>
<H3><a name="Allegrocl_nn18">19.3.4 Enumerations</a></H3>
<H3><a name="Allegrocl_nn18">20.3.4 Enumerations</a></H3>
<p>
@ -957,7 +957,7 @@ EXPORT const int ACL_ENUM___FOO3__SWIG_0 = FOO3;
</pre>
</div>
<H3><a name="Allegrocl_nn19">19.3.5 Arrays</a></H3>
<H3><a name="Allegrocl_nn19">20.3.5 Arrays</a></H3>
<p>
@ -1105,10 +1105,10 @@ namespace BAR {
</pre>
</div>
<H3><a name="Allegrocl_nn20">19.3.6 Classes and Structs and Unions (oh my!)</a></H3>
<H3><a name="Allegrocl_nn20">20.3.6 Classes and Structs and Unions (oh my!)</a></H3>
<H4><a name="Allegrocl_nn21">19.3.6.1 CLOS wrapping of</a></H4>
<H4><a name="Allegrocl_nn21">20.3.6.1 CLOS wrapping of</a></H4>
<p>
@ -1123,7 +1123,7 @@ namespace BAR {
integer values.
</p>
<H4><a name="Allegrocl_nn22">19.3.6.2 CLOS Inheritance</a></H4>
<H4><a name="Allegrocl_nn22">20.3.6.2 CLOS Inheritance</a></H4>
<p>
@ -1136,7 +1136,7 @@ namespace BAR {
parameter.
</p>
<H4><a name="Allegrocl_nn23">19.3.6.3 Member fields and functions</a></H4>
<H4><a name="Allegrocl_nn23">20.3.6.3 Member fields and functions</a></H4>
<p>
@ -1152,7 +1152,7 @@ namespace BAR {
the interface does nothing for <tt>friend</tt> directives,
</p>
<H4><a name="Allegrocl_nn24">19.3.6.4 Why not directly access C++ classes using foreign types?</a></H4>
<H4><a name="Allegrocl_nn24">20.3.6.4 Why not directly access C++ classes using foreign types?</a></H4>
<p>
@ -1170,11 +1170,11 @@ namespace BAR {
use the more robust wrapper functions.
</p>
<H3><a name="Allegrocl_nn25">19.3.7 Templates</a></H3>
<H3><a name="Allegrocl_nn25">20.3.7 Templates</a></H3>
<H4><a name="Allegrocl_nn26">19.3.7.1 Generating wrapper code for templates</a></H4>
<H4><a name="Allegrocl_nn26">20.3.7.1 Generating wrapper code for templates</a></H4>
<p>
@ -1187,7 +1187,7 @@ them. This is done via the
directive.
</p>
<H4><a name="Allegrocl_nn27">19.3.7.2 Implicit Template instantiation</a></H4>
<H4><a name="Allegrocl_nn27">20.3.7.2 Implicit Template instantiation</a></H4>
<p>
@ -1197,7 +1197,7 @@ to include these templated classes in the foreign-type and CLOS
class schema.
</p>
<H3><a name="Allegrocl_nn28">19.3.8 Typedef, Templates, and Synonym Types</a></H3>
<H3><a name="Allegrocl_nn28">20.3.8 Typedef, Templates, and Synonym Types</a></H3>
<p>
@ -1277,7 +1277,7 @@ synonym&gt;
</pre>
</div>
<H4><a name="Allegrocl_nn29">19.3.8.1 Choosing a primary type</a></H4>
<H4><a name="Allegrocl_nn29">20.3.8.1 Choosing a primary type</a></H4>
<p>
@ -1298,7 +1298,7 @@ synonym&gt;
</li>
</ul>
<H3><a name="Allegrocl_nn30">19.3.9 Function overloading/Parameter defaulting</a></H3>
<H3><a name="Allegrocl_nn30">20.3.9 Function overloading/Parameter defaulting</a></H3>
<p>
@ -1461,7 +1461,7 @@ overload&gt;
</pre>
</div>
<H3><a name="Allegrocl_nn31">19.3.10 Operator wrapping and Operator overloading</a></H3>
<H3><a name="Allegrocl_nn31">20.3.10 Operator wrapping and Operator overloading</a></H3>
<p>
@ -1607,7 +1607,7 @@ opoverload&gt;
</pre>
</div>
<H3><a name="Allegrocl_nn32">19.3.11 Varargs</a></H3>
<H3><a name="Allegrocl_nn32">20.3.11 Varargs</a></H3>
<p>
@ -1628,7 +1628,7 @@ opoverload&gt;
with other ways such functions can be wrapped.
</p>
<H3><a name="Allegrocl_nn33">19.3.12 C++ Exceptions</a></H3>
<H3><a name="Allegrocl_nn33">20.3.12 C++ Exceptions</a></H3>
<p>
@ -1640,7 +1640,7 @@ opoverload&gt;
implemented.
</p>
<H3><a name="Allegrocl_nn34">19.3.13 Pass by value, pass by reference</a></H3>
<H3><a name="Allegrocl_nn34">20.3.13 Pass by value, pass by reference</a></H3>
<p>
@ -1652,7 +1652,7 @@ opoverload&gt;
newly defined types.
</p>
<H2><a name="Allegrocl_nn35">19.4 Typemaps</a></H2>
<H2><a name="Allegrocl_nn35">20.4 Typemaps</a></H2>
<p>
@ -1663,7 +1663,7 @@ opoverload&gt;
on <a href="Typemaps.html#Typemaps">Typemaps</a> for more information.
</p>
<H3><a name="Allegrocl_nn36">19.4.1 Code Generation in the C++ Wrapper</a></H3>
<H3><a name="Allegrocl_nn36">20.4.1 Code Generation in the C++ Wrapper</a></H3>
@ -1693,7 +1693,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H4><a name="Allegrocl_nn37">19.4.1.1 IN Typemap</a></H4>
<H4><a name="Allegrocl_nn37">20.4.1.1 IN Typemap</a></H4>
<p>
@ -1728,7 +1728,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H4><a name="Allegrocl_nn38">19.4.1.2 OUT Typemap</a></H4>
<H4><a name="Allegrocl_nn38">20.4.1.2 OUT Typemap</a></H4>
<p>
@ -1752,7 +1752,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H4><a name="Allegrocl_nn39">19.4.1.3 CTYPE Typemap</a></H4>
<H4><a name="Allegrocl_nn39">20.4.1.3 CTYPE Typemap</a></H4>
<p>
@ -1784,7 +1784,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
these <a href="Typemaps.html#Typemaps_nn25">common typemaps</a> here.
</p>
<H3><a name="Allegrocl_nn40">19.4.2 Code generation in Lisp wrappers</a></H3>
<H3><a name="Allegrocl_nn40">20.4.2 Code generation in Lisp wrappers</a></H3>
<p>
@ -1803,7 +1803,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
<a href="#Allegrocl_nn15">16.3.1 Namespaces</a> for details.
</p>
<H4><a name="Allegrocl_nn41">19.4.2.1 LIN Typemap</a></H4>
<H4><a name="Allegrocl_nn41">20.4.2.1 LIN Typemap</a></H4>
<p>
@ -1846,7 +1846,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H4><a name="Allegrocl_nn42">19.4.2.2 LOUT Typemap</a></H4>
<H4><a name="Allegrocl_nn42">20.4.2.2 LOUT Typemap</a></H4>
<p>
@ -1889,7 +1889,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H4><a name="Allegrocl_nn43">19.4.2.3 FFITYPE Typemap</a></H4>
<H4><a name="Allegrocl_nn43">20.4.2.3 FFITYPE Typemap</a></H4>
@ -1939,7 +1939,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H4><a name="Allegrocl_nn44">19.4.2.4 LISPTYPE Typemap</a></H4>
<H4><a name="Allegrocl_nn44">20.4.2.4 LISPTYPE Typemap</a></H4>
<p>
@ -1959,7 +1959,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H4><a name="Allegrocl_nn45">19.4.2.5 LISPCLASS Typemap</a></H4>
<H4><a name="Allegrocl_nn45">20.4.2.5 LISPCLASS Typemap</a></H4>
<p>
@ -1983,7 +1983,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H3><a name="Allegrocl_nn46">19.4.3 Modifying SWIG behavior using typemaps</a></H3>
<H3><a name="Allegrocl_nn46">20.4.3 Modifying SWIG behavior using typemaps</a></H3>
<p>
@ -2017,10 +2017,10 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
</pre>
</div>
<H2><a name="Allegrocl_nn47">19.5 Identifier Converter functions</a></H2>
<H2><a name="Allegrocl_nn47">20.5 Identifier Converter functions</a></H2>
<H3><a name="Allegrocl_nn48">19.5.1 Creating symbols in the lisp environment</a></H3>
<H3><a name="Allegrocl_nn48">20.5.1 Creating symbols in the lisp environment</a></H3>
<p>
@ -2041,11 +2041,11 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
of arguments.
</p>
<H3><a name="Allegrocl_nn49">19.5.2 Existing identifier-converter functions</a></H3>
<H3><a name="Allegrocl_nn49">20.5.2 Existing identifier-converter functions</a></H3>
<p>Two basic identifier routines have been defined.
<H4><a name="Allegrocl_nn50">19.5.2.1 identifier-convert-null</a></H4>
<H4><a name="Allegrocl_nn50">20.5.2.1 identifier-convert-null</a></H4>
<p>
@ -2054,7 +2054,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
strings, from which a symbol will be created.
</p>
<H4><a name="Allegrocl_nn51">19.5.2.2 identifier-convert-lispify</a></H4>
<H4><a name="Allegrocl_nn51">20.5.2.2 identifier-convert-lispify</a></H4>
<p>
@ -2063,7 +2063,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
same symbol transformations.
</p>
<H4><a name="Allegrocl_nn52">19.5.2.3 Default identifier to symbol conversions</a></H4>
<H4><a name="Allegrocl_nn52">20.5.2.3 Default identifier to symbol conversions</a></H4>
<p>
@ -2072,7 +2072,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
default naming conventions.
</p>
<H3><a name="Allegrocl_nn53">19.5.3 Defining your own identifier-converter</a></H3>
<H3><a name="Allegrocl_nn53">20.5.3 Defining your own identifier-converter</a></H3>
<p>
@ -2128,7 +2128,7 @@ indicating the number of arguments passed to the routine indicated by
this identifier.
</p>
<H3><a name="Allegrocl_nn54">19.5.4 Instructing SWIG to use a particular identifier-converter</a></H3>
<H3><a name="Allegrocl_nn54">20.5.4 Instructing SWIG to use a particular identifier-converter</a></H3>
<p>

View file

@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF">
<H1><a name="Android">20 SWIG and Android</a></H1>
<H1><a name="Android">21 SWIG and Android</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -31,7 +31,7 @@ This chapter describes SWIG's support of Android.
<H2><a name="Android_overview">20.1 Overview</a></H2>
<H2><a name="Android_overview">21.1 Overview</a></H2>
<p>
@ -41,10 +41,10 @@ Everything in the <a href="Java.html#Java">Java chapter</a> applies to generatin
This chapter contains a few Android specific notes and examples.
</p>
<H2><a name="Android_examples">20.2 Android examples</a></H2>
<H2><a name="Android_examples">21.2 Android examples</a></H2>
<H3><a name="Android_examples_intro">20.2.1 Examples introduction</a></H3>
<H3><a name="Android_examples_intro">21.2.1 Examples introduction</a></H3>
<p>
@ -77,7 +77,7 @@ $ android list targets
The following examples are shipped with SWIG under the Examples/android directory and include a Makefile to build and install each example.
</p>
<H3><a name="Android_example_simple">20.2.2 Simple C example</a></H3>
<H3><a name="Android_example_simple">21.2.2 Simple C example</a></H3>
<p>
@ -399,7 +399,7 @@ Run the app again and this time you will see the output pictured below, showing
<center><img src="android-simple.png" alt="Android screenshot of SwigSimple example"></center>
<H3><a name="Android_example_class">20.2.3 C++ class example</a></H3>
<H3><a name="Android_example_class">21.2.3 C++ class example</a></H3>
<p>
@ -747,7 +747,7 @@ Run the app to see the result of calling the C++ code from Java:
<center><img src="android-class.png" alt="Android screenshot of SwigClass example"></center>
<H3><a name="Android_examples_other">20.2.4 Other examples</a></H3>
<H3><a name="Android_examples_other">21.2.4 Other examples</a></H3>
<p>
@ -759,7 +759,7 @@ Note that the 'extend' example is demonstrates the directors feature.
Normally C++ exception handling and the STL is not available by default in the version of g++ shipped with Android, but this example turns these features on as described in the next section.
</p>
<H2><a name="Android_stl">20.3 C++ STL</a></H2>
<H2><a name="Android_stl">21.3 C++ STL</a></H2>
<p>

View file

@ -7,7 +7,7 @@
</head>
<body bgcolor="#ffffff">
<H1><a name="CCache">18 Using SWIG with ccache - ccache-swig(1) manpage</a></H1>
<H1><a name="CCache">19 Using SWIG with ccache - ccache-swig(1) manpage</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -35,7 +35,7 @@
<p>
<H2><a name="CCache_nn2">18.1 NAME</a></H2>
<H2><a name="CCache_nn2">19.1 NAME</a></H2>
<p>
@ -43,7 +43,7 @@
ccache-swig - a fast compiler cache
<p>
<H2><a name="CCache_nn3">18.2 SYNOPSIS</a></H2>
<H2><a name="CCache_nn3">19.2 SYNOPSIS</a></H2>
<p>
@ -53,7 +53,7 @@ ccache-swig &lt;compiler&gt; [COMPILER OPTIONS]
<p>
&lt;compiler&gt; [COMPILER OPTIONS]
<p>
<H2><a name="CCache_nn4">18.3 DESCRIPTION</a></H2>
<H2><a name="CCache_nn4">19.3 DESCRIPTION</a></H2>
<p>
@ -62,7 +62,7 @@ by caching previous compiles and detecting when the same compile is
being done again. ccache-swig is ccache plus support for SWIG. ccache
and ccache-swig are used interchangeably in this document.
<p>
<H2><a name="CCache_nn5">18.4 OPTIONS SUMMARY</a></H2>
<H2><a name="CCache_nn5">19.4 OPTIONS SUMMARY</a></H2>
<p>
@ -82,7 +82,7 @@ Here is a summary of the options to ccache-swig.
</pre>
<p>
<H2><a name="CCache_nn6">18.5 OPTIONS</a></H2>
<H2><a name="CCache_nn6">19.5 OPTIONS</a></H2>
<p>
@ -124,7 +124,7 @@ rounded down to the nearest multiple of 16 kilobytes.
<p>
</dl>
<p>
<H2><a name="CCache_nn7">18.6 INSTALLATION</a></H2>
<H2><a name="CCache_nn7">19.6 INSTALLATION</a></H2>
<p>
@ -156,7 +156,7 @@ This will work as long as /usr/local/bin comes before the path to gcc
Note! Do not use a hard link, use a symbolic link. A hardlink will
cause "interesting" problems.
<p>
<H2><a name="CCache_nn8">18.7 EXTRA OPTIONS</a></H2>
<H2><a name="CCache_nn8">19.7 EXTRA OPTIONS</a></H2>
<p>
@ -176,7 +176,7 @@ file). By using --ccache-skip you can force an option to not be
treated as an input file name and instead be passed along to the
compiler as a command line option.
<p>
<H2><a name="CCache_nn9">18.8 ENVIRONMENT VARIABLES</a></H2>
<H2><a name="CCache_nn9">19.8 ENVIRONMENT VARIABLES</a></H2>
<p>
@ -315,7 +315,7 @@ the use of '#pragma SWIG'.
<p>
</dl>
<p>
<H2><a name="CCache_nn10">18.9 CACHE SIZE MANAGEMENT</a></H2>
<H2><a name="CCache_nn10">19.9 CACHE SIZE MANAGEMENT</a></H2>
<p>
@ -328,7 +328,7 @@ When these limits are reached ccache will reduce the cache to 20%
below the numbers you specified in order to avoid doing the cache
clean operation too often.
<p>
<H2><a name="CCache_nn11">18.10 CACHE COMPRESSION</a></H2>
<H2><a name="CCache_nn11">19.10 CACHE COMPRESSION</a></H2>
<p>
@ -339,7 +339,7 @@ performance slowdown, it significantly increases the number of files
that fit in the cache. You can turn off compression setting the
CCACHE_NOCOMPRESS environment variable.
<p>
<H2><a name="CCache_nn12">18.11 HOW IT WORKS</a></H2>
<H2><a name="CCache_nn12">19.11 HOW IT WORKS</a></H2>
<p>
@ -364,7 +364,7 @@ compiler output that you would get without the cache. If you ever
discover a case where ccache changes the output of your compiler then
please let me know.
<p>
<H2><a name="CCache_nn13">18.12 USING CCACHE WITH DISTCC</a></H2>
<H2><a name="CCache_nn13">19.12 USING CCACHE WITH DISTCC</a></H2>
<p>
@ -378,7 +378,7 @@ option. You just need to set the environment variable CCACHE_PREFIX to
'distcc' and ccache will prefix the command line used with the
compiler with the command 'distcc'.
<p>
<H2><a name="CCache_nn14">18.13 SHARING A CACHE</a></H2>
<H2><a name="CCache_nn14">19.13 SHARING A CACHE</a></H2>
<p>
@ -407,7 +407,7 @@ following conditions need to be met:
versions of ccache that do not support compression.
</ul>
<p>
<H2><a name="CCache_nn15">18.14 HISTORY</a></H2>
<H2><a name="CCache_nn15">19.14 HISTORY</a></H2>
<p>
@ -423,7 +423,7 @@ I wrote ccache because I wanted to get a bit more speed out of a
compiler cache and I wanted to remove some of the limitations of the
shell-script version.
<p>
<H2><a name="CCache_nn16">18.15 DIFFERENCES FROM COMPILERCACHE</a></H2>
<H2><a name="CCache_nn16">19.15 DIFFERENCES FROM COMPILERCACHE</a></H2>
<p>
@ -441,7 +441,7 @@ are:
<li> ccache avoids a double call to cpp on a cache miss
</ul>
<p>
<H2><a name="CCache_nn17">18.16 CREDITS</a></H2>
<H2><a name="CCache_nn17">19.16 CREDITS</a></H2>
<p>
@ -453,7 +453,7 @@ Thanks to the following people for their contributions to ccache
<li> Paul Russell for many suggestions and the debian packaging
</ul>
<p>
<H2><a name="CCache_nn18">18.17 AUTHOR</a></H2>
<H2><a name="CCache_nn18">19.17 AUTHOR</a></H2>
<p>

View file

@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF">
<H1><a name="CSharp">21 SWIG and C#</a></H1>
<H1><a name="CSharp">22 SWIG and C#</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -55,7 +55,7 @@
<H2><a name="CSharp_introduction">21.1 Introduction</a></H2>
<H2><a name="CSharp_introduction">22.1 Introduction</a></H2>
<p>
@ -75,7 +75,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/docs/advanced/pinvoke/">Interop with native libraries</a>.
</p>
<H3><a name="CSharp_introduction_swig2_compatibility">21.1.1 SWIG 2 Compatibility</a></H3>
<H3><a name="CSharp_introduction_swig2_compatibility">22.1.1 SWIG 2 Compatibility</a></H3>
<p>
@ -83,7 +83,7 @@ In order to minimize name collisions between names generated based on input to S
</p>
<H3><a name="CSharp_commandline">21.1.2 Additional command line options</a></H3>
<H3><a name="CSharp_commandline">22.1.2 Additional command line options</a></H3>
<p>
@ -135,7 +135,7 @@ Note that the file extension (.cs) will not be automatically added and needs to
Due to possible compiler limits it is not advisable to use <tt>-outfile</tt> for large projects.
</p>
<H2><a name="CSharp_differences_java">21.2 Differences to the Java module</a></H2>
<H2><a name="CSharp_differences_java">22.2 Differences to the Java module</a></H2>
<p>
@ -556,7 +556,7 @@ Windows users can also get the examples working using a
<a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> environment for automatic configuration of the example makefiles.
Any one of the C# compilers (Mono or Microsoft) can be detected from within a Cygwin or Mingw environment if installed in your path.
<H2><a name="CSharp_void_pointers">21.3 Void pointers</a></H2>
<H2><a name="CSharp_void_pointers">22.3 Void pointers</a></H2>
<p>
@ -574,7 +574,7 @@ void * f(void *v);
</pre>
</div>
<H2><a name="CSharp_arrays">21.4 C# Arrays</a></H2>
<H2><a name="CSharp_arrays">22.4 C# Arrays</a></H2>
<p>
@ -586,7 +586,7 @@ with one of the following three approaches; namely the SWIG C arrays library, P/
pinned arrays.
</p>
<H3><a name="CSharp_arrays_swig_library">21.4.1 The SWIG C arrays library</a></H3>
<H3><a name="CSharp_arrays_swig_library">22.4.1 The SWIG C arrays library</a></H3>
<p>
@ -623,7 +623,7 @@ example.print_array(c.cast()); // Pass to C
</div>
<H3><a name="CSharp_arrays_pinvoke_default_array_marshalling">21.4.2 Managed arrays using P/Invoke default array marshalling</a></H3>
<H3><a name="CSharp_arrays_pinvoke_default_array_marshalling">22.4.2 Managed arrays using P/Invoke default array marshalling</a></H3>
<p>
@ -750,7 +750,7 @@ and intermediary class method
</div>
<H3><a name="CSharp_arrays_pinning">21.4.3 Managed arrays using pinning</a></H3>
<H3><a name="CSharp_arrays_pinning">22.4.3 Managed arrays using pinning</a></H3>
<p>
@ -845,7 +845,7 @@ public static extern void myArrayCopy(global::System.IntPtr jarg1, global::Syste
<H2><a name="CSharp_exceptions">21.5 C# Exceptions</a></H2>
<H2><a name="CSharp_exceptions">22.5 C# Exceptions</a></H2>
<p>
@ -942,7 +942,7 @@ set so should only be used when a C# exception is not created.
</p>
<H3><a name="CSharp_exception_example_check_typemap">21.5.1 C# exception example using "check" typemap</a></H3>
<H3><a name="CSharp_exception_example_check_typemap">22.5.1 C# exception example using "check" typemap</a></H3>
<p>
@ -1124,7 +1124,7 @@ method and C# code does not handle pending exceptions via the canthrow attribute
Actually it will issue this warning for any function beginning with <tt>SWIG_CSharpSetPendingException</tt>.
</P>
<H3><a name="CSharp_exception_example_percent_exception">21.5.2 C# exception example using %exception</a></H3>
<H3><a name="CSharp_exception_example_percent_exception">22.5.2 C# exception example using %exception</a></H3>
<p>
@ -1189,7 +1189,7 @@ The managed code generated does check for the pending exception as mentioned ear
</pre>
</div>
<H3><a name="CSharp_exception_example_exception_specifications">21.5.3 C# exception example using exception specifications</a></H3>
<H3><a name="CSharp_exception_example_exception_specifications">22.5.3 C# exception example using exception specifications</a></H3>
<p>
@ -1245,7 +1245,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">21.5.4 Custom C# ApplicationException example</a></H3>
<H3><a name="CSharp_custom_application_exception">22.5.4 Custom C# ApplicationException example</a></H3>
<p>
@ -1379,7 +1379,7 @@ try {
</pre>
</div>
<H2><a name="CSharp_directors">21.6 C# Directors</a></H2>
<H2><a name="CSharp_directors">22.6 C# Directors</a></H2>
<p>
@ -1392,7 +1392,7 @@ The following sections provide information on the C# director implementation and
However, the <a href="Java.html#Java_directors">Java directors</a> section should also be read in order to gain more insight into directors.
</p>
<H3><a name="CSharp_directors_example">21.6.1 Directors example</a></H3>
<H3><a name="CSharp_directors_example">22.6.1 Directors example</a></H3>
<p>
@ -1513,7 +1513,7 @@ CSharpDerived - UIntMethod(123)
</pre>
</div>
<H3><a name="CSharp_directors_implementation">21.6.2 Directors implementation</a></H3>
<H3><a name="CSharp_directors_implementation">22.6.2 Directors implementation</a></H3>
<p>
@ -1721,7 +1721,7 @@ before SWIG parses the Base class will change all the delegates to <tt>internal<
</pre>
</div>
<H3><a name="CSharp_director_caveats">21.6.3 Director caveats</a></H3>
<H3><a name="CSharp_director_caveats">22.6.3 Director caveats</a></H3>
<p>
@ -1769,7 +1769,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_multiple_modules">21.7 Multiple modules</a></H2>
<H2><a name="CSharp_multiple_modules">22.7 Multiple modules</a></H2>
<p>
@ -1804,7 +1804,7 @@ the <tt>[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrows
if you don't want users to easily stumble upon these so called 'internal workings' of the wrappers.
</p>
<H2><a name="CSharp_typemap_examples">21.8 C# Typemap examples</a></H2>
<H2><a name="CSharp_typemap_examples">22.8 C# Typemap examples</a></H2>
This section includes a few examples of typemaps. For more examples, you
@ -1812,7 +1812,7 @@ might look at the files "<tt>csharp.swg</tt>" and "<tt>typemaps.i</tt>" in
the SWIG library.
<H3><a name="CSharp_memory_management_member_variables">21.8.1 Memory management when returning references to member variables</a></H3>
<H3><a name="CSharp_memory_management_member_variables">22.8.1 Memory management when returning references to member variables</a></H3>
<p>
@ -1936,7 +1936,7 @@ public class Bike : global::System.IDisposable {
Note the <tt>addReference</tt> call.
</p>
<H3><a name="CSharp_memory_management_objects">21.8.2 Memory management for objects passed to the C++ layer</a></H3>
<H3><a name="CSharp_memory_management_objects">22.8.2 Memory management for objects passed to the C++ layer</a></H3>
<p>
@ -2068,7 +2068,7 @@ as mentioned earlier, <tt>setElement</tt> is actually:
</div>
<H3><a name="CSharp_date_marshalling">21.8.3 Date marshalling using the csin typemap and associated attributes</a></H3>
<H3><a name="CSharp_date_marshalling">22.8.3 Date marshalling using the csin typemap and associated attributes</a></H3>
<p>
@ -2354,7 +2354,7 @@ public class example {
</pre>
</div>
<H3><a name="CSharp_date_properties">21.8.4 A date example demonstrating marshalling of C# properties</a></H3>
<H3><a name="CSharp_date_properties">22.8.4 A date example demonstrating marshalling of C# properties</a></H3>
<p>
@ -2454,7 +2454,7 @@ Some points to note:
<li>The 'csin' typemap has 'pre', 'post' and 'cshin' attributes, and these are all ignored in the property set. The code in these attributes must instead be replicated within the 'csvarin' typemap. The line creating the <tt>temp$csinput</tt> variable is such an example; it is identical to what is in the 'pre' attribute.
</ul>
<H3><a name="CSharp_date_pre_post_directors">21.8.5 Date example demonstrating the 'pre' and 'post' typemap attributes for directors</a></H3>
<H3><a name="CSharp_date_pre_post_directors">22.8.5 Date example demonstrating the 'pre' and 'post' typemap attributes for directors</a></H3>
<p>
@ -2516,7 +2516,7 @@ Pay special attention to the memory management issues, using these attributes.
</p>
<H3><a name="CSharp_partial_classes">21.8.6 Turning proxy classes into partial classes</a></H3>
<H3><a name="CSharp_partial_classes">22.8.6 Turning proxy classes into partial classes</a></H3>
<p>
@ -2616,7 +2616,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_sealed_proxy_class">21.8.7 Turning proxy classes into sealed classes</a></H3>
<H3><a name="CSharp_sealed_proxy_class">22.8.7 Turning proxy classes into sealed classes</a></H3>
<p>
@ -2706,7 +2706,7 @@ Either suppress the warning or modify the generated code by copying and tweaking
'csbody' typemap code in csharp.swg by modifying swigCMemOwn to not be protected.
</p>
<H3><a name="CSharp_extending_proxy_class">21.8.8 Extending proxy classes with additional C# code</a></H3>
<H3><a name="CSharp_extending_proxy_class">22.8.8 Extending proxy classes with additional C# code</a></H3>
<p>
@ -2745,7 +2745,7 @@ public class ExtendMe : global::System.IDisposable {
</pre>
</div>
<H3><a name="CSharp_enum_underlying_type">21.8.9 Underlying type for enums</a></H3>
<H3><a name="CSharp_enum_underlying_type">22.8.9 Underlying type for enums</a></H3>
<P>

View file

@ -8,7 +8,7 @@
<body bgcolor="#ffffff">
<H1><a name="Chicken">22 SWIG and Chicken</a></H1>
<H1><a name="Chicken">23 SWIG and Chicken</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -72,7 +72,7 @@
</p>
<H2><a name="Chicken_nn2">22.1 Preliminaries</a></H2>
<H2><a name="Chicken_nn2">23.1 Preliminaries</a></H2>
<p>
@ -89,7 +89,7 @@
directory for the basic steps to run SWIG CHICKEN.
</p>
<H3><a name="Chicken_nn3">22.1.1 Running SWIG in C mode</a></H3>
<H3><a name="Chicken_nn3">23.1.1 Running SWIG in C mode</a></H3>
<p>
@ -122,7 +122,7 @@
object files and linked into your project.
</p>
<H3><a name="Chicken_nn4">22.1.2 Running SWIG in C++ mode</a></H3>
<H3><a name="Chicken_nn4">23.1.2 Running SWIG in C++ mode</a></H3>
<p>
@ -151,10 +151,10 @@
object files and linked into your project.
</p>
<H2><a name="Chicken_nn5">22.2 Code Generation</a></H2>
<H2><a name="Chicken_nn5">23.2 Code Generation</a></H2>
<H3><a name="Chicken_nn6">22.2.1 Naming Conventions</a></H3>
<H3><a name="Chicken_nn6">23.2.1 Naming Conventions</a></H3>
<p>
@ -170,7 +170,7 @@
<tt>%rename</tt> SWIG directive in the SWIG interface file.
</p>
<H3><a name="Chicken_nn7">22.2.2 Modules</a></H3>
<H3><a name="Chicken_nn7">23.2.2 Modules</a></H3>
<p>
@ -192,7 +192,7 @@
(uses <i>modulename</i>))</code> CHICKEN Scheme form.
</p>
<H3><a name="Chicken_nn8">22.2.3 Constants and Variables</a></H3>
<H3><a name="Chicken_nn8">23.2.3 Constants and Variables</a></H3>
<p>
@ -229,7 +229,7 @@
for info on how to apply the %feature.
</p>
<H3><a name="Chicken_nn9">22.2.4 Functions</a></H3>
<H3><a name="Chicken_nn9">23.2.4 Functions</a></H3>
<p>
@ -248,7 +248,7 @@
parameters). The return values can then be accessed with <code>(call-with-values)</code>.
</p>
<H3><a name="Chicken_nn10">22.2.5 Exceptions</a></H3>
<H3><a name="Chicken_nn10">23.2.5 Exceptions</a></H3>
<p>The SWIG chicken module has support for exceptions thrown from
@ -290,7 +290,7 @@
</pre></div>
<H2><a name="Chicken_nn11">22.3 TinyCLOS</a></H2>
<H2><a name="Chicken_nn11">23.3 TinyCLOS</a></H2>
<p>
@ -333,7 +333,7 @@
</p>
<H2><a name="Chicken_nn12">22.4 Linkage</a></H2>
<H2><a name="Chicken_nn12">23.4 Linkage</a></H2>
<p>
@ -354,7 +354,7 @@
</p>
<H3><a name="Chicken_nn13">22.4.1 Static binary or shared library linked at compile time</a></H3>
<H3><a name="Chicken_nn13">23.4.1 Static binary or shared library linked at compile time</a></H3>
<p>We can easily use csc to build a static binary.</p>
@ -395,7 +395,7 @@ in which case the test script does not need to be linked with example.so. The t
be run with <tt>csi</tt>.
</p>
<H3><a name="Chicken_nn14">22.4.2 Building chicken extension libraries</a></H3>
<H3><a name="Chicken_nn14">23.4.2 Building chicken extension libraries</a></H3>
<p>Building a shared library like in the above section only works if the library
@ -453,7 +453,7 @@ distributed and used by anyone, even if SWIG is not installed.</p>
<p>See the <tt>Examples/chicken/egg</tt> directory in the SWIG source for an example that builds
two eggs, one using the first method and one using the second method.</p>
<H3><a name="Chicken_nn15">22.4.3 Linking multiple SWIG modules with TinyCLOS</a></H3>
<H3><a name="Chicken_nn15">23.4.3 Linking multiple SWIG modules with TinyCLOS</a></H3>
<p>Linking together multiple modules that share type information using the <code>%import</code>
@ -477,7 +477,7 @@ with <code>(declare (uses ...))</code>.
To create an extension library or an egg, just create a <tt>module_load.scm</tt> file that <code>(declare (uses ...))</code>
all the modules.</p>
<H2><a name="Chicken_nn16">22.5 Typemaps</a></H2>
<H2><a name="Chicken_nn16">23.5 Typemaps</a></H2>
<p>
@ -486,7 +486,7 @@ all the modules.</p>
<code>Lib/chicken/chicken.swg</code>.
</p>
<H2><a name="Chicken_nn17">22.6 Pointers</a></H2>
<H2><a name="Chicken_nn17">23.6 Pointers</a></H2>
<p>
@ -519,7 +519,7 @@ all the modules.</p>
type. flags is either zero or SWIG_POINTER_DISOWN (see below).
</p>
<H3><a name="Chicken_collection">22.6.1 Garbage collection</a></H3>
<H3><a name="Chicken_collection">23.6.1 Garbage collection</a></H3>
<p>If the owner flag passed to <code>SWIG_NewPointerObj</code> is 1, <code>NewPointerObj</code> will add a
@ -550,7 +550,7 @@ all the modules.</p>
must be called manually.
</p>
<H2><a name="Chicken_nn18">22.7 Unsupported features and known problems</a></H2>
<H2><a name="Chicken_nn18">23.7 Unsupported features and known problems</a></H2>
<ul>
@ -560,7 +560,7 @@ all the modules.</p>
<a href="SWIGPlus.html#SWIGPlus_default_args">%feature(compactdefaultargs)</a>.</li>
</ul>
<H3><a name="Chicken_nn19">22.7.1 TinyCLOS problems with Chicken version &lt;= 1.92</a></H3>
<H3><a name="Chicken_nn19">23.7.1 TinyCLOS problems with Chicken version &lt;= 1.92</a></H3>
<p>In Chicken versions equal to or below 1.92, TinyCLOS has a limitation such that generic methods do not properly work on methods

View file

@ -591,7 +591,51 @@
</div>
<!-- INDEX -->
<h3><a href="Warnings.html#Warnings">16 Warning Messages</a></h3>
<h3><a href="Doxygen.html#Doxygen">16 SWIG and Doxygen Translation</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
<li><a href="Doxygen.html#Doxygen_translation_overview">Doxygen translation overview</a>
<li><a href="Doxygen.html#Doxygen_file_preparation">Preparations</a>
<ul>
<li><a href="Doxygen.html#Doxygen_running_swig">Enabling Doxygen translation</a>
<li><a href="Doxygen.html#Doxygen_features">Doxygen-specific %feature directives</a>
<ul>
<li><a href="Doxygen.html#Doxygen_notranslate">doxygen:notranslate</a>
<li><a href="Doxygen.html#Doxygen_alias">doxygen:alias:&lt;command-name&gt;</a>
<li><a href="Doxygen.html#Doxygen_ignore">doxygen:ignore:&lt;command-name&gt;</a>
<li><a href="Doxygen.html#Doxygen_nolinktranslate">doxygen:nolinktranslate</a>
<li><a href="Doxygen.html#Doxygen_nostripparams">doxygen:nostripparams</a>
</ul>
<li><a href="Doxygen.html#Doxygen_additional_options">Additional command line options</a>
</ul>
<li><a href="Doxygen.html#Doxygen_to_javadoc">Doxygen to Javadoc</a>
<ul>
<li><a href="Doxygen.html#Doxygen_basic_example">Basic example</a>
<li><a href="Doxygen.html#Doxygen_javadoc_tags">Javadoc tags</a>
<li><a href="Doxygen.html#Doxygen_unsupported_tags">Unsupported tags</a>
<li><a href="Doxygen.html#Doxygen_further_details">Further details</a>
</ul>
<li><a href="Doxygen.html#Doxygen_to_pydoc">Doxygen to Pydoc</a>
<ul>
<li><a href="Doxygen.html#Doxygen_python_basic_example">Basic example</a>
<li><a href="Doxygen.html#Doxygen_pydoc_tags">Pydoc translator</a>
<li><a href="Doxygen.html#Doxygen_python_unsupported_tags">Unsupported tags</a>
<li><a href="Doxygen.html#Doxygen_python_further_details">Further details</a>
</ul>
<li><a href="Doxygen.html#Doxygen_developer_details">Developer information</a>
<ul>
<li><a href="Doxygen.html#Doxygen_translator_design">Doxygen translator design</a>
<li><a href="Doxygen.html#Doxygen_debugging_commands">Debugging the Doxygen parser and translator</a>
<li><a href="Doxygen.html#Doxygen_tests">Tests</a>
</ul>
<li><a href="Doxygen.html#Doxygen_language_extension">Extending to other languages</a>
</ul>
</div>
<!-- INDEX -->
<h3><a href="Warnings.html#Warnings">17 Warning Messages</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -619,7 +663,7 @@
</div>
<!-- INDEX -->
<h3><a href="Modules.html#Modules">17 Working with Modules</a></h3>
<h3><a href="Modules.html#Modules">18 Working with Modules</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -635,7 +679,7 @@
</div>
<!-- INDEX -->
<h3><a href="CCache.html#CCache">18 Using SWIG with ccache - ccache-swig(1) manpage</a></h3>
<h3><a href="CCache.html#CCache">19 Using SWIG with ccache - ccache-swig(1) manpage</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -661,7 +705,7 @@
</div>
<!-- INDEX -->
<h3><a href="Allegrocl.html#Allegrocl">19 SWIG and Allegro Common Lisp</a></h3>
<h3><a href="Allegrocl.html#Allegrocl">20 SWIG and Allegro Common Lisp</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -745,7 +789,7 @@
</div>
<!-- INDEX -->
<h3><a href="Android.html#Android">20 SWIG and Android</a></h3>
<h3><a href="Android.html#Android">21 SWIG and Android</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -763,7 +807,7 @@
</div>
<!-- INDEX -->
<h3><a href="CSharp.html#CSharp">21 SWIG and C#</a></h3>
<h3><a href="CSharp.html#CSharp">22 SWIG and C#</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -811,7 +855,7 @@
</div>
<!-- INDEX -->
<h3><a href="Chicken.html#Chicken">22 SWIG and Chicken</a></h3>
<h3><a href="Chicken.html#Chicken">23 SWIG and Chicken</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -849,7 +893,7 @@
</div>
<!-- INDEX -->
<h3><a href="D.html#D">23 SWIG and D</a></h3>
<h3><a href="D.html#D">24 SWIG and D</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -883,7 +927,7 @@
</div>
<!-- INDEX -->
<h3><a href="Go.html#Go">24 SWIG and Go</a></h3>
<h3><a href="Go.html#Go">25 SWIG and Go</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -927,7 +971,7 @@
</div>
<!-- INDEX -->
<h3><a href="Guile.html#Guile">25 SWIG and Guile</a></h3>
<h3><a href="Guile.html#Guile">26 SWIG and Guile</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -963,7 +1007,7 @@
</div>
<!-- INDEX -->
<h3><a href="Java.html#Java">26 SWIG and Java</a></h3>
<h3><a href="Java.html#Java">27 SWIG and Java</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1117,7 +1161,7 @@
</div>
<!-- INDEX -->
<h3><a href="Javascript.html#Javascript">27 SWIG and Javascript</a></h3>
<h3><a href="Javascript.html#Javascript">28 SWIG and Javascript</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1159,7 +1203,7 @@
</div>
<!-- INDEX -->
<h3><a href="Lisp.html#Lisp">28 SWIG and Common Lisp</a></h3>
<h3><a href="Lisp.html#Lisp">29 SWIG and Common Lisp</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1182,7 +1226,7 @@
</div>
<!-- INDEX -->
<h3><a href="Lua.html#Lua">29 SWIG and Lua</a></h3>
<h3><a href="Lua.html#Lua">30 SWIG and Lua</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1250,7 +1294,7 @@
</div>
<!-- INDEX -->
<h3><a href="Modula3.html#Modula3">30 SWIG and Modula-3</a></h3>
<h3><a href="Modula3.html#Modula3">31 SWIG and Modula-3</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1288,7 +1332,7 @@
</div>
<!-- INDEX -->
<h3><a href="Mzscheme.html#Mzscheme">31 SWIG and MzScheme/Racket</a></h3>
<h3><a href="Mzscheme.html#Mzscheme">32 SWIG and MzScheme/Racket</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1300,7 +1344,7 @@
</div>
<!-- INDEX -->
<h3><a href="Ocaml.html#Ocaml">32 SWIG and Ocaml</a></h3>
<h3><a href="Ocaml.html#Ocaml">33 SWIG and Ocaml</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1351,7 +1395,7 @@
</div>
<!-- INDEX -->
<h3><a href="Octave.html#Octave">33 SWIG and Octave</a></h3>
<h3><a href="Octave.html#Octave">34 SWIG and Octave</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1391,7 +1435,7 @@
</div>
<!-- INDEX -->
<h3><a href="Perl5.html#Perl5">34 SWIG and Perl5</a></h3>
<h3><a href="Perl5.html#Perl5">35 SWIG and Perl5</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1467,7 +1511,7 @@
</div>
<!-- INDEX -->
<h3><a href="Php.html#Php">35 SWIG and PHP</a></h3>
<h3><a href="Php.html#Php">36 SWIG and PHP</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1508,7 +1552,7 @@
</div>
<!-- INDEX -->
<h3><a href="Pike.html#Pike">36 SWIG and Pike</a></h3>
<h3><a href="Pike.html#Pike">37 SWIG and Pike</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1532,7 +1576,7 @@
</div>
<!-- INDEX -->
<h3><a href="Python.html#Python">37 SWIG and Python</a></h3>
<h3><a href="Python.html#Python">38 SWIG and Python</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1668,7 +1712,7 @@
</div>
<!-- INDEX -->
<h3><a href="R.html#R">38 SWIG and R</a></h3>
<h3><a href="R.html#R">39 SWIG and R</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1684,7 +1728,7 @@
</div>
<!-- INDEX -->
<h3><a href="Ruby.html#Ruby">39 SWIG and Ruby</a></h3>
<h3><a href="Ruby.html#Ruby">40 SWIG and Ruby</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1822,7 +1866,7 @@
</div>
<!-- INDEX -->
<h3><a href="Scilab.html#Scilab">40 SWIG and Scilab</a></h3>
<h3><a href="Scilab.html#Scilab">41 SWIG and Scilab</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1891,7 +1935,7 @@
</div>
<!-- INDEX -->
<h3><a href="Tcl.html#Tcl">41 SWIG and Tcl</a></h3>
<h3><a href="Tcl.html#Tcl">42 SWIG and Tcl</a></h3>
<!-- INDEX -->
<div class="sectiontoc">
@ -1957,7 +2001,7 @@
</div>
<!-- INDEX -->
<h3><a href="Extending.html#Extending">42 Extending SWIG to support new languages</a></h3>
<h3><a href="Extending.html#Extending">43 Extending SWIG to support new languages</a></h3>
<!-- INDEX -->
<div class="sectiontoc">

View file

@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF">
<H1><a name="D">23 SWIG and D</a></H1>
<H1><a name="D">24 SWIG and D</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -41,7 +41,7 @@
<H2><a name="D_introduction">23.1 Introduction</a></H2>
<H2><a name="D_introduction">24.1 Introduction</a></H2>
<p>From the <a href="http://www.digitalmars.com/d/">D Programming Language</a> web site: <em>D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. [...] The D language is statically typed and compiles directly to machine code.</em> As such, it is not very surprising that D is able to directly <a href="http://www.digitalmars.com/d/1.0/interfaceToC.html">interface with C libraries</a>. Why would a SWIG module for D be needed then in the first place?</p>
@ -53,7 +53,7 @@
<p>To help addressing these issues, the SWIG C# module has been forked to support D. Is has evolved quite a lot since then, but there are still many similarities, so if you do not find what you are looking for on this page, it might be worth having a look at the chapter on <a href="CSharp.html#CSharp">C#</a> (and also on <a href="Java.html#Java">Java</a>, since the C# module was in turn forked from it).</p>
<H2><a name="D_command_line_invocation">23.2 Command line invocation</a></H2>
<H2><a name="D_command_line_invocation">24.2 Command line invocation</a></H2>
<p>To activate the D module, pass the <tt>-d</tt> option to SWIG at the command line. The same standard command line switches as with any other language module are available, plus the following D specific ones:</p>
@ -83,10 +83,10 @@
</dl>
<H2><a name="D_typemaps">23.3 Typemaps</a></H2>
<H2><a name="D_typemaps">24.3 Typemaps</a></H2>
<H3><a name="D_typemap_name_comparison">23.3.1 C# &lt;-&gt; D name comparison</a></H3>
<H3><a name="D_typemap_name_comparison">24.3.1 C# &lt;-&gt; D name comparison</a></H3>
<p>If you already know the SWIG C# module, you might find the following name comparison table useful:</p>
@ -112,7 +112,7 @@
</pre></div>
<H3><a name="D_ctype_imtype_dtype">23.3.2 ctype, imtype, dtype</a></H3>
<H3><a name="D_ctype_imtype_dtype">24.3.2 ctype, imtype, dtype</a></H3>
<p>Mapping of types between the C/C++ library, the C/C++ library wrapper exposing the C functions, the D wrapper module importing these functions and the D proxy code.</p>
@ -120,7 +120,7 @@
<p>The <tt>ctype</tt> typemap is used to determine the types to use in the C wrapper functions. The types from the <tt>imtype</tt> typemap are used in the extern(C) declarations of these functions in the intermediary D module. The <tt>dtype</tt> typemap contains the D types used in the D proxy module/class.</p>
<H3><a name="D_in_out_directorin_direcetorout">23.3.3 in, out, directorin, directorout</a></H3>
<H3><a name="D_in_out_directorin_direcetorout">24.3.3 in, out, directorin, directorout</a></H3>
<p>Used for converting between the types for C/C++ and D when generating the code for the wrapper functions (on the C++ side).</p>
@ -130,7 +130,7 @@
<p>The <tt>directorin</tt> typemap is used to convert parameters to the type used in the D director callback function, its return value is processed by <tt>directorout</tt> (see below).</p>
<H3><a name="D_din_dout_ddirectorin_ddirectorout">23.3.4 din, dout, ddirectorin, ddirectorout</a></H3>
<H3><a name="D_din_dout_ddirectorin_ddirectorout">24.3.4 din, dout, ddirectorin, ddirectorout</a></H3>
<p>Typemaps for code generation in D proxy and type wrapper classes.</p>
@ -157,13 +157,13 @@
dtype DClass.method(dtype a)</pre></div>
<H3><a name="D_typecheck_typemaps">23.3.5 typecheck typemaps</a></H3>
<H3><a name="D_typecheck_typemaps">24.3.5 typecheck typemaps</a></H3>
<p>Because, unlike many scripting languages supported by SWIG, D does not need any dynamic dispatch helper to access an overloaded function, the purpose of these is merely to issue a warning for overloaded C++ functions that cannot be overloaded in D (as more than one C++ type maps to a single D type).</p>
<H3><a name="D_code_injection_typemaps">23.3.6 Code injection typemaps</a></H3>
<H3><a name="D_code_injection_typemaps">24.3.6 Code injection typemaps</a></H3>
<p>These typemaps are used for generating the skeleton of proxy classes for C++ types.</p>
@ -178,7 +178,7 @@
Code can also be injected into the D proxy class using <tt>%proxycode</tt>.
</p>
<H3><a name="D_special_variables">23.3.7 Special variable macros</a></H3>
<H3><a name="D_special_variables">24.3.7 Special variable macros</a></H3>
<p>The standard SWIG special variables are available for use within typemaps as described in the <a href="Typemaps.html#Typemaps">Typemaps documentation</a>, for example <tt>$1</tt>, <tt>$input</tt>, <tt>$result</tt> etc.</p>
@ -299,7 +299,7 @@ $importtype(AnotherInterface)
</dl>
<H2><a name="D_features">23.4 D and %feature</a></H2>
<H2><a name="D_features">24.4 D and %feature</a></H2>
<p>The D module defines a number of directives which modify the <a href="Customization.html#Customization_features">SWIG features</a> set globally or for a specific declaration:</p>
@ -329,7 +329,7 @@ struct A {
</dl>
<H2><a name="D_pragmas">23.5 Pragmas</a></H2>
<H2><a name="D_pragmas">24.5 Pragmas</a></H2>
<p>There are a few SWIG pragmas specific to the D module, which you can use to influence the D code SWIG generates:</p>
@ -368,7 +368,7 @@ struct A {
</dl>
<H2><a name="D_exceptions">23.6 D Exceptions</a></H2>
<H2><a name="D_exceptions">24.6 D Exceptions</a></H2>
<p>Out of the box, C++ exceptions are fundamentally incompatible to their equivalent in the D world and cannot simply be propagated to a calling D method. There is, however, an easy way to solve this problem: Just catch the exception in the C/C++ wrapper layer, pass the contents to D, and make the wrapper code rethrow the exception in the D world.</p>
@ -378,7 +378,7 @@ struct A {
<p>As this feature is implemented in exactly the same way it is for C#, please see the <a href="CSharp.html#CSharp_exceptions">C# documentation</a> for a more detailed explanation.</p>
<H2><a name="D_directors">23.7 D Directors</a></H2>
<H2><a name="D_directors">24.7 D Directors</a></H2>
<p>When the directors feature is activated, SWIG generates extra code on both the C++ and the D side to enable cross-language polymorphism. Essentially, this means that if you subclass a proxy class in D, C++ code can access any overridden virtual methods just as if you created a derived class in C++.</p>
@ -387,16 +387,16 @@ struct A {
</p>
<H2><a name="D_other_features">23.8 Other features</a></H2>
<H2><a name="D_other_features">24.8 Other features</a></H2>
<H3><a name="D_nspace">23.8.1 Extended namespace support (nspace)</a></H3>
<H3><a name="D_nspace">24.8.1 Extended namespace support (nspace)</a></H3>
<p>By default, SWIG flattens all C++ namespaces into a single target language namespace, but as for Java and C#, the <a href="SWIGPlus.html#SWIGPlus_nspace"><tt>nspace</tt></a> feature is supported for D. If it is active, C++ namespaces are mapped to D packages/modules. Note, however, that like for the other languages, <em>free</em> variables and functions are not supported yet; currently, they are all allows written to the main proxy D module.</p>
<H3><a name="D_native_pointer_support">23.8.2 Native pointer support</a></H3>
<H3><a name="D_native_pointer_support">24.8.2 Native pointer support</a></H3>
<p>Contrary to many of the scripting languages supported by SWIG, D fully supports C-style pointers. The D module thus includes a custom mechanism to wrap C pointers directly as D pointers where applicable, that is, if the type that is pointed to is represented the same in C and D (on the bit-level), dubbed a <em>primitive type</em> below.</p>
@ -408,7 +408,7 @@ struct A {
<p>To determine if a type should be considered primitive, the <tt>cprimitive</tt> attribute on its <tt>dtype</tt> attribute is used. For example, the <tt>dtype</tt> typemap for <tt>float</tt> has <tt>cprimitive="1"</tt>, so the code from the <tt>nativepointer</tt> attribute is taken into account e.g. for <tt>float **</tt> or the function pointer <tt>float (*)(float *)</tt>.</p>
<H3><a name="D_operator_overloading">23.8.3 Operator overloading</a></H3>
<H3><a name="D_operator_overloading">24.8.3 Operator overloading</a></H3>
<p>The D module comes with basic operator overloading support for both D1 and D2. There are, however, a few limitations arising from conceptual differences between C++ and D:</p>
@ -420,7 +420,7 @@ struct A {
<p>There are also some cases where the operators can be translated to D, but the differences in the implementation details are big enough that a rather involved scheme would be required for automatic wrapping them, which has not been implemented yet. This affects, for example, the array subscript operator, <tt>[]</tt>, in combination with assignments - while <tt>operator []</tt> in C++ simply returns a reference which is then written to, D resorts to a separate <tt>opIndexAssign</tt> method -, or implicit casting (which was introduced in D2 via <tt>alias this</tt>). Despite the lack of automatic support, manually handling these cases should be perfectly possible.</p>
<H3><a name="D_test_suite">23.8.4 Running the test-suite</a></H3>
<H3><a name="D_test_suite">24.8.4 Running the test-suite</a></H3>
<p>As with any other language, the SWIG test-suite can be built for D using the <tt>*-d-test-suite</tt> targets of the top-level Makefile. By default, D1 is targeted, to build it with D2, use the optional <tt>D_VERSION</tt> variable, e.g. <tt>make check-d-test-suite D_VERSION=2</tt>.</p>
@ -428,14 +428,14 @@ struct A {
<p>Note: If you want to use GDC on Linux or another platform which requires you to link <tt>libdl</tt> for dynamically loading the shared library, you might have to add <tt>-ldl</tt> manually to the <tt>d_compile</tt> target in <tt>Examples/Makefile</tt>, because GDC does not currently honor the <tt>pragma(lib, ...)</tt> statement.</p>
<H2><a name="D_typemap_examples">23.9 D Typemap examples</a></H2>
<H2><a name="D_typemap_examples">24.9 D Typemap examples</a></H2>
<p>There are no D-specific typemap examples yet. However, with the above <a href="D.html#D_typemap_name_comparison">name comparison table</a>, you should be able to get an idea what can be done by looking at the <a href="CSharp.html#CSharp_typemap_examples">corresponding C# section</a>.</p>
<H2><a name="D_planned_features">23.10 Work in progress and planned features</a></H2>
<H2><a name="D_planned_features">24.10 Work in progress and planned features</a></H2>
<p>There are a couple of features which are not implemented yet, but would be very useful and might be added in the near future:</p>

1772
Doc/Manual/Doxygen.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@
</head>
<body bgcolor="#ffffff">
<H1><a name="Extending">42 Extending SWIG to support new languages</a></H1>
<H1><a name="Extending">43 Extending SWIG to support new languages</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -76,7 +76,7 @@
<H2><a name="Extending_nn2">42.1 Introduction</a></H2>
<H2><a name="Extending_nn2">43.1 Introduction</a></H2>
<p>
@ -92,7 +92,7 @@ Also, this chapter is not meant to be a hand-holding tutorial. As a starting po
you should probably look at one of SWIG's existing modules.
</p>
<H2><a name="Extending_nn3">42.2 Prerequisites</a></H2>
<H2><a name="Extending_nn3">43.2 Prerequisites</a></H2>
<p>
@ -122,7 +122,7 @@ obvious, but almost all SWIG directives as well as the low-level generation of
wrapper code are driven by C++ datatypes.
</p>
<H2><a name="Extending_nn4">42.3 The Big Picture</a></H2>
<H2><a name="Extending_nn4">43.3 The Big Picture</a></H2>
<p>
@ -159,7 +159,7 @@ role in making the system work. For example, both typemaps and declaration anno
based on pattern matching and interact heavily with the underlying type system.
</p>
<H2><a name="Extending_nn5">42.4 Execution Model</a></H2>
<H2><a name="Extending_nn5">43.4 Execution Model</a></H2>
<p>
@ -204,7 +204,7 @@ latter stage of compilation.
The next few sections briefly describe some of these stages.
</p>
<H3><a name="Extending_nn6">42.4.1 Preprocessing</a></H3>
<H3><a name="Extending_nn6">43.4.1 Preprocessing</a></H3>
<p>
@ -285,7 +285,7 @@ been expanded as well as everything else that goes into the low-level
construction of the wrapper code.
</p>
<H3><a name="Extending_nn7">42.4.2 Parsing</a></H3>
<H3><a name="Extending_nn7">43.4.2 Parsing</a></H3>
<p>
@ -386,7 +386,7 @@ returning a <tt>foo</tt> and taking types <tt>a</tt> and <tt>b</tt> as
arguments).
</p>
<H3><a name="Extending_nn8">42.4.3 Parse Trees</a></H3>
<H3><a name="Extending_nn8">43.4.3 Parse Trees</a></H3>
<p>
@ -641,7 +641,7 @@ $ swig -c++ -python -debug-module 4 example.i
</pre>
</div>
<H3><a name="Extending_nn9">42.4.4 Attribute namespaces</a></H3>
<H3><a name="Extending_nn9">43.4.4 Attribute namespaces</a></H3>
<p>
@ -660,7 +660,7 @@ that matches the name of the target language. For example, <tt>python:foo</tt>
<tt>perl:foo</tt>.
</p>
<H3><a name="Extending_nn10">42.4.5 Symbol Tables</a></H3>
<H3><a name="Extending_nn10">43.4.5 Symbol Tables</a></H3>
<p>
@ -751,7 +751,7 @@ example.i:5. Previous declaration is foo_i(int )
</pre>
</div>
<H3><a name="Extending_nn11">42.4.6 The %feature directive</a></H3>
<H3><a name="Extending_nn11">43.4.6 The %feature directive</a></H3>
<p>
@ -807,7 +807,7 @@ For example, the exception code above is simply
stored without any modifications.
</p>
<H3><a name="Extending_nn12">42.4.7 Code Generation</a></H3>
<H3><a name="Extending_nn12">43.4.7 Code Generation</a></H3>
<p>
@ -929,7 +929,7 @@ public :
The role of these functions is described shortly.
</p>
<H3><a name="Extending_nn13">42.4.8 SWIG and XML</a></H3>
<H3><a name="Extending_nn13">43.4.8 SWIG and XML</a></H3>
<p>
@ -942,7 +942,7 @@ internal data structures, it may be useful to keep XML in the back of
your mind as a model.
</p>
<H2><a name="Extending_nn14">42.5 Primitive Data Structures</a></H2>
<H2><a name="Extending_nn14">43.5 Primitive Data Structures</a></H2>
<p>
@ -988,7 +988,7 @@ typedef Hash Typetab;
</pre>
</div>
<H3><a name="Extending_nn15">42.5.1 Strings</a></H3>
<H3><a name="Extending_nn15">43.5.1 Strings</a></H3>
<p>
@ -1129,7 +1129,7 @@ Returns the number of replacements made (if any).
</div>
<H3><a name="Extending_nn16">42.5.2 Hashes</a></H3>
<H3><a name="Extending_nn16">43.5.2 Hashes</a></H3>
<p>
@ -1206,7 +1206,7 @@ Returns the list of hash table keys.
</div>
<H3><a name="Extending_nn17">42.5.3 Lists</a></H3>
<H3><a name="Extending_nn17">43.5.3 Lists</a></H3>
<p>
@ -1295,7 +1295,7 @@ If <tt>t</tt> is not a standard object, it is assumed to be a <tt>char *</tt>
and is used to create a String object.
</div>
<H3><a name="Extending_nn18">42.5.4 Common operations</a></H3>
<H3><a name="Extending_nn18">43.5.4 Common operations</a></H3>
The following operations are applicable to all datatypes.
@ -1350,7 +1350,7 @@ objects and report errors.
Gets the line number associated with <tt>x</tt>.
</div>
<H3><a name="Extending_nn19">42.5.5 Iterating over Lists and Hashes</a></H3>
<H3><a name="Extending_nn19">43.5.5 Iterating over Lists and Hashes</a></H3>
To iterate over the elements of a list or a hash table, the following functions are used:
@ -1395,7 +1395,7 @@ for (j = First(j); j.item; j= Next(j)) {
</div>
<H3><a name="Extending_nn20">42.5.6 I/O</a></H3>
<H3><a name="Extending_nn20">43.5.6 I/O</a></H3>
Special I/O functions are used for all internal I/O. These operations
@ -1529,7 +1529,7 @@ Printf(f, "%s\n", s);
Similarly, the preprocessor and parser all operate on string-files.
</p>
<H2><a name="Extending_nn21">42.6 Navigating and manipulating parse trees</a></H2>
<H2><a name="Extending_nn21">43.6 Navigating and manipulating parse trees</a></H2>
Parse trees are built as collections of hash tables. Each node is a hash table in which
@ -1663,7 +1663,7 @@ Deletes a node from the parse tree. Deletion reconnects siblings and properly u
the parent so that sibling nodes are unaffected.
</div>
<H2><a name="Extending_nn22">42.7 Working with attributes</a></H2>
<H2><a name="Extending_nn22">43.7 Working with attributes</a></H2>
<p>
@ -1780,7 +1780,7 @@ the attribute is optional. <tt>Swig_restore()</tt> must always be called after
function.
</div>
<H2><a name="Extending_nn23">42.8 Type system</a></H2>
<H2><a name="Extending_nn23">43.8 Type system</a></H2>
<p>
@ -1789,7 +1789,7 @@ pointers, references, and pointers to members. A detailed discussion of
type theory is impossible here. However, let's cover the highlights.
</p>
<H3><a name="Extending_nn24">42.8.1 String encoding of types</a></H3>
<H3><a name="Extending_nn24">43.8.1 String encoding of types</a></H3>
<p>
@ -1890,7 +1890,7 @@ make the final type, the two parts are just joined together using
string concatenation.
</p>
<H3><a name="Extending_nn25">42.8.2 Type construction</a></H3>
<H3><a name="Extending_nn25">43.8.2 Type construction</a></H3>
<p>
@ -2059,7 +2059,7 @@ Returns the prefix of a type. For example, if <tt>ty</tt> is
<tt>ty</tt> is unmodified.
</div>
<H3><a name="Extending_nn26">42.8.3 Type tests</a></H3>
<H3><a name="Extending_nn26">43.8.3 Type tests</a></H3>
<p>
@ -2146,7 +2146,7 @@ Checks if <tt>ty</tt> is a varargs type.
Checks if <tt>ty</tt> is a templatized type.
</div>
<H3><a name="Extending_nn27">42.8.4 Typedef and inheritance</a></H3>
<H3><a name="Extending_nn27">43.8.4 Typedef and inheritance</a></H3>
<p>
@ -2248,7 +2248,7 @@ Fully reduces <tt>ty</tt> according to typedef rules. Resulting datatype
will consist only of primitive typenames.
</div>
<H3><a name="Extending_nn28">42.8.5 Lvalues</a></H3>
<H3><a name="Extending_nn28">43.8.5 Lvalues</a></H3>
<p>
@ -2285,7 +2285,7 @@ Literal y; // type = 'Literal', ltype='p.char'
</pre>
</div>
<H3><a name="Extending_nn29">42.8.6 Output functions</a></H3>
<H3><a name="Extending_nn29">43.8.6 Output functions</a></H3>
<p>
@ -2347,7 +2347,7 @@ SWIG, but is most commonly associated with type-descriptor objects
that appear in wrappers (e.g., <tt>SWIGTYPE_p_double</tt>).
</div>
<H2><a name="Extending_nn30">42.9 Parameters</a></H2>
<H2><a name="Extending_nn30">43.9 Parameters</a></H2>
<p>
@ -2446,7 +2446,7 @@ included. Used to emit prototypes.
Returns the number of required (non-optional) arguments in <tt>p</tt>.
</div>
<H2><a name="Extending_nn31">42.10 Writing a Language Module</a></H2>
<H2><a name="Extending_nn31">43.10 Writing a Language Module</a></H2>
<p>
@ -2461,7 +2461,7 @@ describes the creation of a minimal Python module. You should be able to extra
this to other languages.
</p>
<H3><a name="Extending_nn32">42.10.1 Execution model</a></H3>
<H3><a name="Extending_nn32">43.10.1 Execution model</a></H3>
<p>
@ -2471,7 +2471,7 @@ the parsing of command line options, all aspects of code generation are controll
different methods of the <tt>Language</tt> that must be defined by your module.
</p>
<H3><a name="Extending_starting_out">42.10.2 Starting out</a></H3>
<H3><a name="Extending_starting_out">43.10.2 Starting out</a></H3>
<p>
@ -2579,7 +2579,7 @@ that activates your module. For example, <tt>swig -python foo.i</tt>. The
messages from your new module should appear.
</p>
<H3><a name="Extending_nn34">42.10.3 Command line options</a></H3>
<H3><a name="Extending_nn34">43.10.3 Command line options</a></H3>
<p>
@ -2638,7 +2638,7 @@ to mark the option as valid. If you forget to do this, SWIG will terminate wit
unrecognized command line option error.
</p>
<H3><a name="Extending_nn35">42.10.4 Configuration and preprocessing</a></H3>
<H3><a name="Extending_nn35">43.10.4 Configuration and preprocessing</a></H3>
<p>
@ -2687,7 +2687,7 @@ an implementation file <tt>python.cxx</tt> and a configuration file
<tt>python.swg</tt>.
</p>
<H3><a name="Extending_nn36">42.10.5 Entry point to code generation</a></H3>
<H3><a name="Extending_nn36">43.10.5 Entry point to code generation</a></H3>
<p>
@ -2745,7 +2745,7 @@ int Python::top(Node *n) {
</pre>
</div>
<H3><a name="Extending_nn37">42.10.6 Module I/O and wrapper skeleton</a></H3>
<H3><a name="Extending_nn37">43.10.6 Module I/O and wrapper skeleton</a></H3>
<!-- please report bugs in this section to mgossage -->
@ -2893,7 +2893,7 @@ functionWrapper : void Shape_y_set(Shape *self, double y)
</pre>
</div>
<H3><a name="Extending_nn38">42.10.7 Low-level code generators</a></H3>
<H3><a name="Extending_nn38">43.10.7 Low-level code generators</a></H3>
<!-- please report bugs in this section to mgossage -->
@ -3047,7 +3047,7 @@ but without the typemaps, there is still work to do.
</p>
<H3><a name="Extending_configuration_files">42.10.8 Configuration files</a></H3>
<H3><a name="Extending_configuration_files">43.10.8 Configuration files</a></H3>
<!-- please report bugs in this section to ttn -->
@ -3191,7 +3191,7 @@ politely displays the ignoring language message.
</dl>
<H3><a name="Extending_nn40">42.10.9 Runtime support</a></H3>
<H3><a name="Extending_nn40">43.10.9 Runtime support</a></H3>
<p>
@ -3200,7 +3200,7 @@ Discuss the kinds of functions typically needed for SWIG runtime support (e.g.
the SWIG files that implement those functions.
</p>
<H3><a name="Extending_nn41">42.10.10 Standard library files</a></H3>
<H3><a name="Extending_nn41">43.10.10 Standard library files</a></H3>
<p>
@ -3219,7 +3219,7 @@ The following are the minimum that are usually supported:
Please copy these and modify for any new language.
</p>
<H3><a name="Extending_nn42">42.10.11 User examples</a></H3>
<H3><a name="Extending_nn42">43.10.11 User examples</a></H3>
<p>
@ -3248,7 +3248,7 @@ during this process, see the section on <a href="#Extending_configuration_files"
files</a>.
</p>
<H3><a name="Extending_test_suite">42.10.12 Test driven development and the test-suite</a></H3>
<H3><a name="Extending_test_suite">43.10.12 Test driven development and the test-suite</a></H3>
<p>
@ -3307,7 +3307,7 @@ It is therefore essential that the runtime tests are written in a manner that di
but error/exception out with an error message on stderr on failure.
</p>
<H4><a name="Extending_running_test_suite">42.10.12.1 Running the test-suite</a></H4>
<H4><a name="Extending_running_test_suite">43.10.12.1 Running the test-suite</a></H4>
<p>
@ -3499,7 +3499,7 @@ It can be run in the same way as the other language test-suites, replacing [lang
The test cases used and the way it works is described in <tt>Examples/test-suite/errors/Makefile.in</tt>.
</p>
<H3><a name="Extending_nn43">42.10.13 Documentation</a></H3>
<H3><a name="Extending_nn43">43.10.13 Documentation</a></H3>
<p>
@ -3531,7 +3531,7 @@ Some topics that you'll want to be sure to address include:
if available.
</ul>
<H3><a name="Extending_prerequisites">42.10.14 Prerequisites for adding a new language module to the SWIG distribution</a></H3>
<H3><a name="Extending_prerequisites">43.10.14 Prerequisites for adding a new language module to the SWIG distribution</a></H3>
<p>
@ -3588,7 +3588,7 @@ should be added should there be an area not already covered by
the existing tests.
</p>
<H3><a name="Extending_coding_style_guidelines">42.10.15 Coding style guidelines</a></H3>
<H3><a name="Extending_coding_style_guidelines">43.10.15 Coding style guidelines</a></H3>
<p>
@ -3612,7 +3612,7 @@ The generated C/C++ code should also follow this style as close as possible. How
should be avoided as unlike the SWIG developers, users will never have consistent tab settings.
</p>
<H2><a name="Extending_debugging_options">42.11 Debugging Options</a></H2>
<H2><a name="Extending_debugging_options">43.11 Debugging Options</a></H2>
<p>
@ -3639,7 +3639,7 @@ There are various command line options which can aid debugging a SWIG interface
The complete list of command line options for SWIG are available by running <tt>swig -help</tt>.
</p>
<H2><a name="Extending_nn46">42.12 Guide to parse tree nodes</a></H2>
<H2><a name="Extending_nn46">43.12 Guide to parse tree nodes</a></H2>
<p>
@ -4047,7 +4047,7 @@ extern "X" { ... } declaration.
</pre>
</div>
<H2><a name="Extending_further_info">42.13 Further Development Information</a></H2>
<H2><a name="Extending_further_info">43.13 Further Development Information</a></H2>
<p>

View file

@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF">
<H1><a name="Go">24 SWIG and Go</a></H1>
<H1><a name="Go">25 SWIG and Go</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -57,7 +57,7 @@ the Go programming language
see <a href="http://golang.org/">golang.org</a>.
</p>
<H2><a name="Go_overview">24.1 Overview</a></H2>
<H2><a name="Go_overview">25.1 Overview</a></H2>
<p>
@ -86,7 +86,7 @@ type-safe as well. In case of type issues the build will fail and hence SWIG's
are not used.
</p>
<H2><a name="Go_examples">24.2 Examples</a></H2>
<H2><a name="Go_examples">25.2 Examples</a></H2>
<p>
@ -101,7 +101,7 @@ SWIG interface file extension for backwards compatibility with Go 1.
</p>
<H2><a name="Go_running_swig">24.3 Running SWIG with Go</a></H2>
<H2><a name="Go_running_swig">25.3 Running SWIG with Go</a></H2>
<p>
@ -181,7 +181,7 @@ sequence for this approach would look like this:
</pre></div>
<H3><a name="Go_commandline">24.3.1 Go-specific Commandline Options</a></H3>
<H3><a name="Go_commandline">25.3.1 Go-specific Commandline Options</a></H3>
<p>
@ -264,7 +264,7 @@ swig -go -help
</table>
<H3><a name="Go_outputs">24.3.2 Generated Wrapper Files</a></H3>
<H3><a name="Go_outputs">25.3.2 Generated Wrapper Files</a></H3>
<p>There are two different approaches to generating wrapper files,
@ -308,7 +308,7 @@ combined with the compiled MODULE.go using go tool pack.
</ul>
<H2><a name="Go_basic_tour">24.4 A tour of basic C/C++ wrapping</a></H2>
<H2><a name="Go_basic_tour">25.4 A tour of basic C/C++ wrapping</a></H2>
<p>
@ -318,7 +318,7 @@ modifications have to occur. This section briefly covers the
essential aspects of this wrapping.
</p>
<H3><a name="Go_package">24.4.1 Go Package Name</a></H3>
<H3><a name="Go_package">25.4.1 Go Package Name</a></H3>
<p>
@ -328,7 +328,7 @@ directive. You may override this by using SWIG's <tt>-package</tt>
command line option.
</p>
<H3><a name="Go_names">24.4.2 Go Names</a></H3>
<H3><a name="Go_names">25.4.2 Go Names</a></H3>
<p>
@ -360,7 +360,7 @@ followed by that name, and the destructor will be
named <tt>Delete</tt> followed by that name.
</p>
<H3><a name="Go_constants">24.4.3 Go Constants</a></H3>
<H3><a name="Go_constants">25.4.3 Go Constants</a></H3>
<p>
@ -368,7 +368,7 @@ C/C++ constants created via <tt>#define</tt> or the <tt>%constant</tt>
directive become Go constants, declared with a <tt>const</tt>
declaration.
<H3><a name="Go_enumerations">24.4.4 Go Enumerations</a></H3>
<H3><a name="Go_enumerations">25.4.4 Go Enumerations</a></H3>
<p>
@ -378,7 +378,7 @@ usual). The values of the enumeration will become variables in Go;
code should avoid modifying those variables.
</p>
<H3><a name="Go_classes">24.4.5 Go Classes</a></H3>
<H3><a name="Go_classes">25.4.5 Go Classes</a></H3>
<p>
@ -456,7 +456,7 @@ returns a go interface. If the returned pointer can be null, you can check
for this by calling the Swigcptr() method.
</p>
<H4><a name="Go_class_memory">24.4.5.1 Go Class Memory Management</a></H4>
<H4><a name="Go_class_memory">25.4.5.1 Go Class Memory Management</a></H4>
<p>
@ -578,7 +578,7 @@ func (o *GoClassName) Close() {
</pre>
</div>
<H4><a name="Go_class_inheritance">24.4.5.2 Go Class Inheritance</a></H4>
<H4><a name="Go_class_inheritance">25.4.5.2 Go Class Inheritance</a></H4>
<p>
@ -590,7 +590,7 @@ Doing the reverse will require an explicit type assertion, which will
be checked dynamically.
</p>
<H3><a name="Go_templates">24.4.6 Go Templates</a></H3>
<H3><a name="Go_templates">25.4.6 Go Templates</a></H3>
<p>
@ -599,7 +599,7 @@ wrappers for a particular template instantation. To do this, use
the <tt>%template</tt> directive.
<H3><a name="Go_director_classes">24.4.7 Go Director Classes</a></H3>
<H3><a name="Go_director_classes">25.4.7 Go Director Classes</a></H3>
<p>
@ -617,7 +617,7 @@ completely to avoid common pitfalls with directors in Go.
</p>
<H4><a name="Go_director_example_cpp_code">24.4.7.1 Example C++ code</a></H4>
<H4><a name="Go_director_example_cpp_code">25.4.7.1 Example C++ code</a></H4>
<p>
@ -689,7 +689,7 @@ be found in <a href="#Go_director_foobargo_class">the end of the guide</a>.
</p>
<H4><a name="Go_director_enable">24.4.7.2 Enable director feature</a></H4>
<H4><a name="Go_director_enable">25.4.7.2 Enable director feature</a></H4>
<p>
@ -724,7 +724,7 @@ documentation on directors.
</p>
<H4><a name="Go_director_ctor_dtor">24.4.7.3 Constructor and destructor</a></H4>
<H4><a name="Go_director_ctor_dtor">25.4.7.3 Constructor and destructor</a></H4>
<p>
@ -777,7 +777,7 @@ embedding</a>.
</p>
<H4><a name="Go_director_overriding">24.4.7.4 Override virtual methods</a></H4>
<H4><a name="Go_director_overriding">25.4.7.4 Override virtual methods</a></H4>
<p>
@ -843,7 +843,7 @@ the Go methods.
</p>
<H4><a name="Go_director_base_methods">24.4.7.5 Call base methods</a></H4>
<H4><a name="Go_director_base_methods">25.4.7.5 Call base methods</a></H4>
<p>
@ -880,7 +880,7 @@ be found in <a href="#Go_director_foobargo_class">the end of the guide</a>.
</p>
<H4><a name="Go_director_subclass">24.4.7.6 Subclass via embedding</a></H4>
<H4><a name="Go_director_subclass">25.4.7.6 Subclass via embedding</a></H4>
<p>
@ -948,7 +948,7 @@ class.
</p>
<H4><a name="Go_director_finalizer">24.4.7.7 Memory management with runtime.SetFinalizer</a></H4>
<H4><a name="Go_director_finalizer">25.4.7.7 Memory management with runtime.SetFinalizer</a></H4>
<p>
@ -1013,7 +1013,7 @@ before using <tt>runtime.SetFinalizer</tt> to know all of its gotchas.
</p>
<H4><a name="Go_director_foobargo_class">24.4.7.8 Complete FooBarGo example class</a></H4>
<H4><a name="Go_director_foobargo_class">25.4.7.8 Complete FooBarGo example class</a></H4>
<p>
@ -1142,7 +1142,7 @@ SWIG/Examples/go/director/</a>.
</p>
<H3><a name="Go_primitive_type_mappings">24.4.8 Default Go primitive type mappings</a></H3>
<H3><a name="Go_primitive_type_mappings">25.4.8 Default Go primitive type mappings</a></H3>
<p>
@ -1249,7 +1249,7 @@ that typemap, or add new values, to control how C/C++ types are mapped
into Go types.
</p>
<H3><a name="Go_output_arguments">24.4.9 Output arguments</a></H3>
<H3><a name="Go_output_arguments">25.4.9 Output arguments</a></H3>
<p>Because of limitations in the way output arguments are processed in swig,
@ -1302,7 +1302,7 @@ void f(char *output);
</pre>
</div>
<H3><a name="Go_adding_additional_code">24.4.10 Adding additional go code</a></H3>
<H3><a name="Go_adding_additional_code">25.4.10 Adding additional go code</a></H3>
<p>Often the APIs generated by swig are not very natural in go, especially if
@ -1397,7 +1397,7 @@ func bar() {
</pre>
</div>
<H3><a name="Go_typemaps">24.4.11 Go typemaps</a></H3>
<H3><a name="Go_typemaps">25.4.11 Go typemaps</a></H3>
<p>

View file

@ -8,7 +8,7 @@
<body bgcolor="#ffffff">
<H1><a name="Guile">25 SWIG and Guile</a></H1>
<H1><a name="Guile">26 SWIG and Guile</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -48,7 +48,7 @@
<p>
This section details guile-specific support in SWIG.
<H2><a name="Guile_nn1">25.1 Supported Guile Versions</a></H2>
<H2><a name="Guile_nn1">26.1 Supported Guile Versions</a></H2>
<p>
@ -62,7 +62,7 @@ improved performance. This is currently not tested with swig
so your mileage may vary. To be safe set environment variable
GUILE_AUTO_COMPILE to 0 when using swig generated guile code.
<H2><a name="Guile_nn2">25.2 Meaning of "Module"</a></H2>
<H2><a name="Guile_nn2">26.2 Meaning of "Module"</a></H2>
<p>
@ -70,7 +70,7 @@ There are three different concepts of "module" involved, defined
separately for SWIG, Guile, and Libtool. To avoid horrible confusion,
we explicitly prefix the context, e.g., "guile-module".
<H2><a name="Guile_nn3">25.3 Old GH Guile API</a></H2>
<H2><a name="Guile_nn3">26.3 Old GH Guile API</a></H2>
<p>Guile 1.8 and older could be interfaced using two different api's, the SCM
@ -81,7 +81,7 @@ or the GH API. The GH interface to guile is deprecated. Read more about why in
version of SWIG that can still generate guile GH wrapper code is 2.0.9. Please
use that version if you really need the GH wrapper code.
<H2><a name="Guile_nn4">25.4 Linkage</a></H2>
<H2><a name="Guile_nn4">26.4 Linkage</a></H2>
<p>
@ -89,7 +89,7 @@ Guile support is complicated by a lack of user community cohesiveness,
which manifests in multiple shared-library usage conventions. A set of
policies implementing a usage convention is called a <b>linkage</b>.
<H3><a name="Guile_nn5">25.4.1 Simple Linkage</a></H3>
<H3><a name="Guile_nn5">26.4.1 Simple Linkage</a></H3>
<p>
@ -194,7 +194,7 @@ placed between the <code>define-module</code> form and the
<code>SWIG_init</code> via a preprocessor define to avoid symbol
clashes. For this case, however, passive linkage is available.
<H3><a name="Guile_nn6">25.4.2 Passive Linkage</a></H3>
<H3><a name="Guile_nn6">26.4.2 Passive Linkage</a></H3>
<p>Passive linkage is just like simple linkage, but it generates an
@ -204,7 +204,7 @@ package name (see below).
<p>You should use passive linkage rather than simple linkage when you
are using multiple modules.
<H3><a name="Guile_nn7">25.4.3 Native Guile Module Linkage</a></H3>
<H3><a name="Guile_nn7">26.4.3 Native Guile Module Linkage</a></H3>
<p>SWIG can also generate wrapper code that does all the Guile module
@ -245,7 +245,7 @@ Newer Guile versions have a shorthand procedure for this:
</div>
</ul>
<H3><a name="Guile_nn8">25.4.4 Old Auto-Loading Guile Module Linkage</a></H3>
<H3><a name="Guile_nn8">26.4.4 Old Auto-Loading Guile Module Linkage</a></H3>
<p>Guile used to support an autoloading facility for object-code
@ -271,7 +271,7 @@ option, SWIG generates an exported module initialization function with
an appropriate name.
<H3><a name="Guile_nn9">25.4.5 Hobbit4D Linkage</a></H3>
<H3><a name="Guile_nn9">26.4.5 Hobbit4D Linkage</a></H3>
<p>
@ -296,7 +296,7 @@ my/lib/libfoo.so.X.Y.Z and friends. This scheme is still very
experimental; the (hobbit4d link) conventions are not well understood.
</p>
<H2><a name="Guile_nn10">25.5 Underscore Folding</a></H2>
<H2><a name="Guile_nn10">26.5 Underscore Folding</a></H2>
<p>
@ -308,7 +308,7 @@ complained so far.
<code>%rename</code> to specify the Guile name of the wrapped
functions and variables (see CHANGES).
<H2><a name="Guile_nn11">25.6 Typemaps</a></H2>
<H2><a name="Guile_nn11">26.6 Typemaps</a></H2>
<p>
@ -400,7 +400,7 @@ constant will appear as a scheme variable. See
<a href="Customization.html#Customization_features">Features and the %feature directive</a>
for info on how to apply the %feature.</p>
<H2><a name="Guile_nn12">25.7 Representation of pointers as smobs</a></H2>
<H2><a name="Guile_nn12">26.7 Representation of pointers as smobs</a></H2>
<p>
@ -421,7 +421,7 @@ representing the expected pointer type. See also
If the Scheme object passed was not a SWIG smob representing a compatible
pointer, a <code>wrong-type-arg</code> exception is raised.
<H3><a name="Guile_nn14">25.7.1 Smobs</a></H3>
<H3><a name="Guile_nn14">26.7.1 Smobs</a></H3>
<p>
@ -440,7 +440,7 @@ structure describing this type. If a generated GOOPS module has been loaded, sm
the corresponding GOOPS class.</p>
<H3><a name="Guile_nn15">25.7.2 Garbage Collection</a></H3>
<H3><a name="Guile_nn15">26.7.2 Garbage Collection</a></H3>
<p>Garbage collection is a feature of Guile since version 1.6. As SWIG now requires Guile &gt; 1.8,
@ -454,14 +454,14 @@ is exactly like described in <a href="Customization.html#Customization_ownership
Object ownership and %newobject</a> in the SWIG manual. All typemaps use an $owner var, and
the guile module replaces $owner with 0 or 1 depending on feature:new.</p>
<H2><a name="Guile_nn16">25.8 Native Guile pointers</a></H2>
<H2><a name="Guile_nn16">26.8 Native Guile pointers</a></H2>
<p>
In addition to SWIG smob pointers, <a href="https://www.gnu.org/software/guile/manual/html_node/Foreign-Pointers.html">Guile's native pointer type</a> are accepted as arguments to wrapped SWIG functions. This can be useful for passing <a href="https://www.gnu.org/software/guile/manual/html_node/Void-Pointers-and-Byte-Access.html#">pointers to bytevector data</a> to wrapped functions.
</p>
<H2><a name="Guile_nn17">25.9 Exception Handling</a></H2>
<H2><a name="Guile_nn17">26.9 Exception Handling</a></H2>
<p>
@ -487,7 +487,7 @@ mapping:
The default when not specified here is to use "swig-error".
See Lib/exception.i for details.
<H2><a name="Guile_nn18">25.10 Procedure documentation</a></H2>
<H2><a name="Guile_nn18">26.10 Procedure documentation</a></H2>
<p>If invoked with the command-line option <code>-procdoc
@ -522,7 +522,7 @@ like this:
typemap argument <code>doc</code>. See <code>Lib/guile/typemaps.i</code> for
details.
<H2><a name="Guile_nn19">25.11 Procedures with setters</a></H2>
<H2><a name="Guile_nn19">26.11 Procedures with setters</a></H2>
<p>For global variables, SWIG creates a single wrapper procedure
@ -550,7 +550,7 @@ struct members, the procedures <code>(<var>struct</var>-<var>member</var>-get
pointer)</code> and <code>(<var>struct-member</var>-set pointer
value)</code> are <em>not</em> generated.
<H2><a name="Guile_nn20">25.12 GOOPS Proxy Classes</a></H2>
<H2><a name="Guile_nn20">26.12 GOOPS Proxy Classes</a></H2>
<p>SWIG can also generate classes and generic functions for use with
@ -696,7 +696,7 @@ Notice that &lt;Foo&gt; is used before it is defined. The fix is to just put th
<code>%import "foo.h"</code> before the <code>%inline</code> block.
</p>
<H3><a name="Guile_nn21">25.12.1 Naming Issues</a></H3>
<H3><a name="Guile_nn21">26.12.1 Naming Issues</a></H3>
<p>As you can see in the example above, there are potential naming conflicts. The default exported
@ -733,7 +733,7 @@ guile-modules. For example,</p>
(use-modules ((Test) #:renamer (symbol-prefix-proc 'goops:)))
</pre></div>
<H3><a name="Guile_nn22">25.12.2 Linking</a></H3>
<H3><a name="Guile_nn22">26.12.2 Linking</a></H3>
<p>The guile-modules generated above all need to be linked together. GOOPS support requires

View file

@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF">
<H1><a name="Java">26 SWIG and Java</a></H1>
<H1><a name="Java">27 SWIG and Java</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -167,7 +167,7 @@ It covers most SWIG features, but certain low-level details are covered in less
</p>
<H2><a name="Java_overview">26.1 Overview</a></H2>
<H2><a name="Java_overview">27.1 Overview</a></H2>
<p>
@ -202,7 +202,7 @@ Various customisation tips and techniques using SWIG directives are covered.
The latter sections cover the advanced techniques of using typemaps for complete control of the wrapping process.
</p>
<H2><a name="Java_preliminaries">26.2 Preliminaries</a></H2>
<H2><a name="Java_preliminaries">27.2 Preliminaries</a></H2>
<p>
@ -222,7 +222,7 @@ This is the commonly used method to load JNI code so your system will more than
Android uses Java JNI and also works with SWIG. Please read the <a href="Android.html#Android">Android chapter</a> in conjunction with this one if you are targeting Android.
</p>
<H3><a name="Java_running_swig">26.2.1 Running SWIG</a></H3>
<H3><a name="Java_running_swig">27.2.1 Running SWIG</a></H3>
<p>
@ -281,7 +281,7 @@ The following sections have further practical examples and details on how you mi
compiling and using the generated files.
</p>
<H3><a name="Java_commandline">26.2.2 Additional Commandline Options</a></H3>
<H3><a name="Java_commandline">27.2.2 Additional Commandline Options</a></H3>
<p>
@ -318,7 +318,7 @@ swig -java -help
Their use will become clearer by the time you have finished reading this section on SWIG and Java.
</p>
<H3><a name="Java_getting_right_headers">26.2.3 Getting the right header files</a></H3>
<H3><a name="Java_getting_right_headers">27.2.3 Getting the right header files</a></H3>
<p>
@ -333,7 +333,7 @@ They are usually in directories like this:</p>
<p>
The exact location may vary on your machine, but the above locations are typical. </p>
<H3><a name="Java_compiling_dynamic">26.2.4 Compiling a dynamic module</a></H3>
<H3><a name="Java_compiling_dynamic">27.2.4 Compiling a dynamic module</a></H3>
<p>
@ -368,7 +368,7 @@ The name of the shared library output file is important.
If the name of your SWIG module is "<tt>example</tt>", the name of the corresponding shared library file should be "<tt>libexample.so</tt>" (or equivalent depending on your machine, see <a href="#Java_dynamic_linking_problems">Dynamic linking problems</a> for more information).
The name of the module is specified using the <tt>%module</tt> directive or <tt>-module</tt> command line option.</p>
<H3><a name="Java_using_module">26.2.5 Using your module</a></H3>
<H3><a name="Java_using_module">27.2.5 Using your module</a></H3>
<p>
@ -403,7 +403,7 @@ $
If it doesn't work have a look at the following section which discusses problems loading the shared library.
</p>
<H3><a name="Java_dynamic_linking_problems">26.2.6 Dynamic linking problems</a></H3>
<H3><a name="Java_dynamic_linking_problems">27.2.6 Dynamic linking problems</a></H3>
<p>
@ -490,7 +490,7 @@ The following section also contains some C++ specific linking problems and solut
</p>
<H3><a name="Java_compilation_problems_cpp">26.2.7 Compilation problems and compiling with C++</a></H3>
<H3><a name="Java_compilation_problems_cpp">27.2.7 Compilation problems and compiling with C++</a></H3>
<p>
@ -542,7 +542,7 @@ Finally make sure the version of JDK header files matches the version of Java th
</p>
<H3><a name="Java_building_windows">26.2.8 Building on Windows</a></H3>
<H3><a name="Java_building_windows">27.2.8 Building on Windows</a></H3>
<p>
@ -551,7 +551,7 @@ You will want to produce a DLL that can be loaded by the Java Virtual Machine.
This section covers the process of using SWIG with Microsoft Visual C++ 6 although the procedure may be similar with other compilers.
In order for everything to work, you will need to have a JDK installed on your machine in order to read the JNI header files.</p>
<H4><a name="Java_visual_studio">26.2.8.1 Running SWIG from Visual Studio</a></H4>
<H4><a name="Java_visual_studio">27.2.8.1 Running SWIG from Visual Studio</a></H4>
<p>
@ -590,7 +590,7 @@ To run the native code in the DLL (example.dll), make sure that it is in your pa
If the library fails to load have a look at <a href="#Java_dynamic_linking_problems">Dynamic linking problems</a>.
</p>
<H4><a name="Java_nmake">26.2.8.2 Using NMAKE</a></H4>
<H4><a name="Java_nmake">27.2.8.2 Using NMAKE</a></H4>
<p>
@ -649,7 +649,7 @@ Of course you may want to make changes for it to work for C++ by adding in the -
</p>
<H2><a name="Java_basic_tour">26.3 A tour of basic C/C++ wrapping</a></H2>
<H2><a name="Java_basic_tour">27.3 A tour of basic C/C++ wrapping</a></H2>
<p>
@ -659,7 +659,7 @@ variables are wrapped with JavaBean type getters and setters and so forth.
This section briefly covers the essential aspects of this wrapping.
</p>
<H3><a name="Java_module_packages_classes">26.3.1 Modules, packages and generated Java classes</a></H3>
<H3><a name="Java_module_packages_classes">27.3.1 Modules, packages and generated Java classes</a></H3>
<p>
@ -695,7 +695,7 @@ swig -java -package com.bloggs.swig -outdir com/bloggs/swig example.i
SWIG won't create the directory, so make sure it exists beforehand.
</p>
<H3><a name="Java_functions">26.3.2 Functions</a></H3>
<H3><a name="Java_functions">27.3.2 Functions</a></H3>
<p>
@ -729,7 +729,7 @@ System.out.println(example.fact(4));
</pre></div>
<H3><a name="Java_global_variables">26.3.3 Global variables</a></H3>
<H3><a name="Java_global_variables">27.3.3 Global variables</a></H3>
<p>
@ -816,7 +816,7 @@ extern char *path; // Read-only (due to %immutable)
</div>
<H3><a name="Java_constants">26.3.4 Constants</a></H3>
<H3><a name="Java_constants">27.3.4 Constants</a></H3>
<p>
@ -956,7 +956,7 @@ Or if you decide this practice isn't so bad and your own class implements <tt>ex
</p>
<H3><a name="Java_enumerations">26.3.5 Enumerations</a></H3>
<H3><a name="Java_enumerations">27.3.5 Enumerations</a></H3>
<p>
@ -970,7 +970,7 @@ The final two approaches use simple integers for each enum item.
Before looking at the various approaches for wrapping named C/C++ enums, anonymous enums are considered.
</p>
<H4><a name="Java_anonymous_enums">26.3.5.1 Anonymous enums</a></H4>
<H4><a name="Java_anonymous_enums">27.3.5.1 Anonymous enums</a></H4>
<p>
@ -1033,7 +1033,7 @@ As in the case of constants, you can access them through either the module class
</p>
<H4><a name="Java_typesafe_enums">26.3.5.2 Typesafe enums</a></H4>
<H4><a name="Java_typesafe_enums">27.3.5.2 Typesafe enums</a></H4>
<p>
@ -1127,7 +1127,7 @@ When upgrading to JDK 1.5 or later, proper Java enums could be used instead, wit
The following section details proper Java enum generation.
</p>
<H4><a name="Java_proper_enums">26.3.5.3 Proper Java enums</a></H4>
<H4><a name="Java_proper_enums">27.3.5.3 Proper Java enums</a></H4>
<p>
@ -1180,7 +1180,7 @@ The additional support methods need not be generated if none of the enum items h
<a href="#Java_simpler_enum_classes">Simpler Java enums for enums without initializers</a> section.
</p>
<H4><a name="Java_typeunsafe_enums">26.3.5.4 Type unsafe enums</a></H4>
<H4><a name="Java_typeunsafe_enums">27.3.5.4 Type unsafe enums</a></H4>
<p>
@ -1228,7 +1228,7 @@ Note that unlike typesafe enums, this approach requires users to mostly use diff
Thus the upgrade path to proper enums provided in JDK 1.5 is more painful.
</p>
<H4><a name="Java_simple_enums">26.3.5.5 Simple enums</a></H4>
<H4><a name="Java_simple_enums">27.3.5.5 Simple enums</a></H4>
<p>
@ -1247,7 +1247,7 @@ SWIG-1.3.21 and earlier versions wrapped all enums using this approach.
The type unsafe approach is preferable to this one and this simple approach is only included for backwards compatibility with these earlier versions of SWIG.
</p>
<H3><a name="Java_pointers">26.3.6 Pointers</a></H3>
<H3><a name="Java_pointers">27.3.6 Pointers</a></H3>
<p>
@ -1335,7 +1335,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return
a NULL pointer if the conversion can't be performed.
</p>
<H3><a name="Java_structures">26.3.7 Structures</a></H3>
<H3><a name="Java_structures">27.3.7 Structures</a></H3>
<p>
@ -1503,7 +1503,7 @@ x.setA(3); // Modify x.a - this is the same as b.f.a
</div>
<H3><a name="Java_classes">26.3.8 C++ classes</a></H3>
<H3><a name="Java_classes">27.3.8 C++ classes</a></H3>
<p>
@ -1566,7 +1566,7 @@ int bar = Spam.getBar();
</div>
<H3><a name="Java_inheritance">26.3.9 C++ inheritance</a></H3>
<H3><a name="Java_inheritance">27.3.9 C++ inheritance</a></H3>
<p>
@ -1627,7 +1627,7 @@ Note that Java does not support multiple inheritance so any multiple inheritance
A warning is given when multiple inheritance is detected and only the first base class is used.
</p>
<H3><a name="Java_pointers_refs_arrays">26.3.10 Pointers, references, arrays and pass by value</a></H3>
<H3><a name="Java_pointers_refs_arrays">27.3.10 Pointers, references, arrays and pass by value</a></H3>
<p>
@ -1682,7 +1682,7 @@ to hold the result and a pointer is returned (Java will release this memory
when the returned object's finalizer is run by the garbage collector).
</p>
<H4><a name="Java_null_pointers">26.3.10.1 Null pointers</a></H4>
<H4><a name="Java_null_pointers">27.3.10.1 Null pointers</a></H4>
<p>
@ -1706,7 +1706,7 @@ For <tt>spam1</tt> and <tt>spam4</tt> above the Java <tt>null</tt> gets translat
The converse also occurs, that is, NULL pointers are translated into <tt>null</tt> Java objects when returned from a C/C++ function.
</p>
<H3><a name="Java_overloaded_functions">26.3.11 C++ overloaded functions</a></H3>
<H3><a name="Java_overloaded_functions">27.3.11 C++ overloaded functions</a></H3>
<p>
@ -1821,7 +1821,7 @@ void spam(unsigned short); // Ignored
</pre>
</div>
<H3><a name="Java_default_arguments">26.3.12 C++ default arguments</a></H3>
<H3><a name="Java_default_arguments">27.3.12 C++ default arguments</a></H3>
<p>
@ -1864,7 +1864,7 @@ Further details on default arguments and how to restore this approach are given
</p>
<H3><a name="Java_namespaces">26.3.13 C++ namespaces</a></H3>
<H3><a name="Java_namespaces">27.3.13 C++ namespaces</a></H3>
<p>
@ -1954,7 +1954,7 @@ If the resulting use of the nspace feature and hence packages results in a proxy
you will need to open up the visibility for the pointer constructor and <tt>getCPtr</tt> method from the default 'protected' to 'public' with the <tt>SWIG_JAVABODY_PROXY</tt> macro. See <a href="#Java_code_typemaps">Java code typemaps</a>.
</p>
<H3><a name="Java_templates">26.3.14 C++ templates</a></H3>
<H3><a name="Java_templates">27.3.14 C++ templates</a></H3>
<p>
@ -2003,10 +2003,10 @@ Obviously, there is more to template wrapping than shown in this example.
More details can be found in the <a href="SWIGPlus.html#SWIGPlus">SWIG and C++</a> chapter.
</p>
<H3><a name="Java_smart_pointers">26.3.15 C++ Smart Pointers</a></H3>
<H3><a name="Java_smart_pointers">27.3.15 C++ Smart Pointers</a></H3>
<H4><a name="Java_smart_pointers_shared_ptr">26.3.15.1 The shared_ptr Smart Pointer</a></H4>
<H4><a name="Java_smart_pointers_shared_ptr">27.3.15.1 The shared_ptr Smart Pointer</a></H4>
<p>
@ -2017,7 +2017,7 @@ in the <a href="Library.html#Library_std_shared_ptr">shared_ptr smart pointer</a
</p>
<H4><a name="Java_smart_pointers_generic">26.3.15.2 Generic Smart Pointers</a></H4>
<H4><a name="Java_smart_pointers_generic">27.3.15.2 Generic Smart Pointers</a></H4>
<p>
@ -2101,7 +2101,7 @@ Foo f = p.__deref__(); // Returns underlying Foo *
</pre>
</div>
<H2><a name="Java_further_details">26.4 Further details on the generated Java classes</a></H2>
<H2><a name="Java_further_details">27.4 Further details on the generated Java classes</a></H2>
<p>
@ -2116,7 +2116,7 @@ Finally enum classes are covered.
First, the crucial intermediary JNI class is considered.
</p>
<H3><a name="Java_imclass">26.4.1 The intermediary JNI class</a></H3>
<H3><a name="Java_imclass">27.4.1 The intermediary JNI class</a></H3>
<p>
@ -2236,7 +2236,7 @@ If <tt>name</tt> is the same as <tt>modulename</tt> then the module class name g
from <tt>modulename</tt> to <tt>modulenameModule</tt>.
</p>
<H4><a name="Java_imclass_pragmas">26.4.1.1 The intermediary JNI class pragmas</a></H4>
<H4><a name="Java_imclass_pragmas">27.4.1.1 The intermediary JNI class pragmas</a></H4>
<p>
@ -2318,7 +2318,7 @@ For example, let's change the intermediary JNI class access to just the default
All the methods in the intermediary JNI class will then not be callable outside of the package as the method modifiers have been changed from public access to default access. This is useful if you want to prevent users calling these low level functions.
</p>
<H3><a name="Java_module_class">26.4.2 The Java module class</a></H3>
<H3><a name="Java_module_class">27.4.2 The Java module class</a></H3>
<p>
@ -2349,7 +2349,7 @@ example.egg(new Foo());
The primary reason for having the module class wrapping the calls in the intermediary JNI class is to implement static type checking. In this case only a <tt>Foo</tt> can be passed to the <tt>egg</tt> function, whereas any <tt>long</tt> can be passed to the <tt>egg</tt> function in the intermediary JNI class.
</p>
<H4><a name="Java_module_class_pragmas">26.4.2.1 The Java module class pragmas</a></H4>
<H4><a name="Java_module_class_pragmas">27.4.2.1 The Java module class pragmas</a></H4>
<p>
@ -2400,7 +2400,7 @@ See <a href="#Java_imclass_pragmas">The intermediary JNI class pragmas</a> secti
</p>
<H3><a name="Java_proxy_classes">26.4.3 Java proxy classes</a></H3>
<H3><a name="Java_proxy_classes">27.4.3 Java proxy classes</a></H3>
<p>
@ -2476,7 +2476,7 @@ int y = f.spam(5, new Foo());
</pre>
</div>
<H4><a name="Java_memory_management">26.4.3.1 Memory management</a></H4>
<H4><a name="Java_memory_management">27.4.3.1 Memory management</a></H4>
<p>
@ -2638,7 +2638,7 @@ and
</p>
<H4><a name="Java_inheritance_mirroring">26.4.3.2 Inheritance</a></H4>
<H4><a name="Java_inheritance_mirroring">27.4.3.2 Inheritance</a></H4>
<p>
@ -2754,7 +2754,7 @@ However, true cross language polymorphism can be achieved using the <a href="#Ja
</p>
<H4><a name="Java_proxy_classes_gc">26.4.3.3 Proxy classes and garbage collection</a></H4>
<H4><a name="Java_proxy_classes_gc">27.4.3.3 Proxy classes and garbage collection</a></H4>
<p>
@ -2837,7 +2837,7 @@ The section on <a href="#Java_typemaps">Java typemaps</a> details how to specify
See the <a href="http://www.devx.com/Java/Article/30192">How to Handle Java Finalization's Memory-Retention Issues</a> article for alternative approaches to managing memory by avoiding finalizers altogether.
</p>
<H4><a name="Java_pgcpp">26.4.3.4 The premature garbage collection prevention parameter for proxy class marshalling</a></H4>
<H4><a name="Java_pgcpp">27.4.3.4 The premature garbage collection prevention parameter for proxy class marshalling</a></H4>
<p>
@ -2959,7 +2959,7 @@ For example:
<b>Compatibility note:</b> The generation of this additional parameter did not occur in versions prior to SWIG-1.3.30.
</p>
<H4><a name="Java_multithread_libraries">26.4.3.5 Single threaded applications and thread safety</a></H4>
<H4><a name="Java_multithread_libraries">27.4.3.5 Single threaded applications and thread safety</a></H4>
<p>
@ -3047,7 +3047,7 @@ for (int i=0; i&lt;100000; i++) {
</pre></div>
<H3><a name="Java_type_wrapper_classes">26.4.4 Type wrapper classes</a></H3>
<H3><a name="Java_type_wrapper_classes">27.4.4 Type wrapper classes</a></H3>
<p>
@ -3134,7 +3134,7 @@ public static void spam(SWIGTYPE_p_int x, SWIGTYPE_p_int y, int z) { ... }
</div>
<H3><a name="Java_enum_classes">26.4.5 Enum classes</a></H3>
<H3><a name="Java_enum_classes">27.4.5 Enum classes</a></H3>
<p>
@ -3143,7 +3143,7 @@ The <a href="#Java_enumerations">Enumerations</a> section discussed these but om
The following sub-sections detail the various types of enum classes that can be generated.
</p>
<H4><a name="Java_typesafe_enums_classes">26.4.5.1 Typesafe enum classes</a></H4>
<H4><a name="Java_typesafe_enums_classes">27.4.5.1 Typesafe enum classes</a></H4>
<p>
@ -3227,7 +3227,7 @@ The <tt>swigValue</tt> method is used for marshalling in the other direction.
The <tt>toString</tt> method is overridden so that the enum name is available.
</p>
<H4><a name="Java_proper_enums_classes">26.4.5.2 Proper Java enum classes</a></H4>
<H4><a name="Java_proper_enums_classes">27.4.5.2 Proper Java enum classes</a></H4>
<p>
@ -3305,7 +3305,7 @@ These needn't be generated if the enum being wrapped does not have any initializ
<a href="#Java_simpler_enum_classes">Simpler Java enums for enums without initializers</a> section describes how typemaps can be used to achieve this.
</p>
<H4><a name="Java_typeunsafe_enums_classes">26.4.5.3 Type unsafe enum classes</a></H4>
<H4><a name="Java_typeunsafe_enums_classes">27.4.5.3 Type unsafe enum classes</a></H4>
<p>
@ -3336,7 +3336,7 @@ public final class Beverage {
</pre>
</div>
<H3><a name="Java_interfaces">26.4.6 Interfaces</a></H3>
<H3><a name="Java_interfaces">27.4.6 Interfaces</a></H3>
<p>
@ -3581,7 +3581,7 @@ typemap which is only used when a class is marked with the <tt>interface</tt> fe
See <a href="Java.html#Java_code_typemaps">Java code typemaps</a> for details.
</p>
<H2><a name="Java_directors">26.5 Cross language polymorphism using directors</a></H2>
<H2><a name="Java_directors">27.5 Cross language polymorphism using directors</a></H2>
<p>
@ -3603,7 +3603,7 @@ The upshot is that C++ classes can be extended in Java and from C++ these extens
Neither C++ code nor Java code needs to know where a particular method is implemented: the combination of proxy classes, director classes, and C wrapper functions transparently takes care of all the cross-language method routing.
</p>
<H3><a name="Java_enabling_directors">26.5.1 Enabling directors</a></H3>
<H3><a name="Java_enabling_directors">27.5.1 Enabling directors</a></H3>
<p>
@ -3671,7 +3671,7 @@ public:
</pre>
</div>
<H3><a name="Java_directors_classes">26.5.2 Director classes</a></H3>
<H3><a name="Java_directors_classes">27.5.2 Director classes</a></H3>
<p>
@ -3698,7 +3698,7 @@ If the correct implementation is in Java, the Java API is used to call the metho
</p>
<H3><a name="Java_directors_overhead">26.5.3 Overhead and code bloat</a></H3>
<H3><a name="Java_directors_overhead">27.5.3 Overhead and code bloat</a></H3>
<p>
@ -3716,7 +3716,7 @@ This situation can be optimized by selectively enabling director methods (using
</p>
<H3><a name="Java_directors_example">26.5.4 Simple directors example</a></H3>
<H3><a name="Java_directors_example">27.5.4 Simple directors example</a></H3>
<p>
@ -3779,7 +3779,7 @@ DirectorDerived.upcall_method() invoked.
</pre>
</div>
<H3><a name="Java_directors_threading">26.5.5 Director threading issues</a></H3>
<H3><a name="Java_directors_threading">27.5.5 Director threading issues</a></H3>
<p>
@ -3799,7 +3799,7 @@ Macros can be defined on the commandline when compiling your C++ code, or altern
</pre>
</div>
<H3><a name="Java_directors_performance">26.5.6 Director performance tuning</a></H3>
<H3><a name="Java_directors_performance">27.5.6 Director performance tuning</a></H3>
<p>
@ -3820,7 +3820,7 @@ However, if all director methods are expected to usually be overridden by Java s
The disadvantage is that invocation of director methods from C++ when Java doesn't actually override the method will require an additional call up into Java and back to C++. As such, this option is only useful when overrides are extremely common and instantiation is frequent enough that its performance is critical.
</p>
<H3><a name="Java_exceptions_from_directors">26.5.7 Java exceptions from directors</a></H3>
<H3><a name="Java_exceptions_from_directors">27.5.7 Java exceptions from directors</a></H3>
<p>
@ -3896,7 +3896,7 @@ Exception in thread "main" java.lang.RuntimeException: There was a problem!
More on the <tt>Swig::DirectorException</tt> class can be found in the next section which details how to customize the handling of director exceptions.
</p>
<H4><a name="Java_customizing_director_exceptions">26.5.7.1 Customizing director exceptions</a></H4>
<H4><a name="Java_customizing_director_exceptions">27.5.7.1 Customizing director exceptions</a></H4>
<p>
@ -4454,7 +4454,7 @@ Exception in thread "main" java.lang.IndexOutOfBoundsException: Index is negativ
</pre>
</div>
<H2><a name="Java_allprotected">26.6 Accessing protected members</a></H2>
<H2><a name="Java_allprotected">27.6 Accessing protected members</a></H2>
<p>
@ -4550,7 +4550,7 @@ class MyProtectedBase extends ProtectedBase
<H2><a name="Java_common_customization">26.7 Common customization features</a></H2>
<H2><a name="Java_common_customization">27.7 Common customization features</a></H2>
<p>
@ -4562,7 +4562,7 @@ be awkward. This section describes some common SWIG features that are used
to improve the interface to existing C/C++ code.
</p>
<H3><a name="Java_helper_functions">26.7.1 C/C++ helper functions</a></H3>
<H3><a name="Java_helper_functions">27.7.1 C/C++ helper functions</a></H3>
<p>
@ -4628,7 +4628,7 @@ hard to implement. It is possible to improve on this using Java code, typemaps,
customization features as covered in later sections, but sometimes helper functions are a quick and easy solution to difficult cases.
</p>
<H3><a name="Java_class_extension">26.7.2 Class extension with %extend</a></H3>
<H3><a name="Java_class_extension">27.7.2 Class extension with %extend</a></H3>
<p>
@ -4691,7 +4691,7 @@ Vector(2, 3, 4)
in any way---the extensions only show up in the Java interface.
</p>
<H3><a name="Java_proxycode">26.7.3 Class extension with %proxycode</a></H3>
<H3><a name="Java_proxycode">27.7.3 Class extension with %proxycode</a></H3>
<p>
@ -4828,7 +4828,7 @@ public class ValueUnsignedInt {
</pre>
</div>
<H3><a name="Java_exception_handling">26.7.4 Exception handling with %exception and %javaexception</a></H3>
<H3><a name="Java_exception_handling">27.7.4 Exception handling with %exception and %javaexception</a></H3>
<p>
@ -4987,7 +4987,7 @@ to raise exceptions. See the <a href="Library.html#Library">SWIG Library</a> ch
The typemap example <a href="#Java_exception_typemap">Handling C++ exception specifications as Java exceptions</a> provides further exception handling capabilities.
</p>
<H3><a name="Java_method_access">26.7.5 Method access with %javamethodmodifiers</a></H3>
<H3><a name="Java_method_access">27.7.5 Method access with %javamethodmodifiers</a></H3>
<p>
@ -5013,7 +5013,7 @@ protected static void protect_me() {
</pre>
</div>
<H2><a name="Java_tips_techniques">26.8 Tips and techniques</a></H2>
<H2><a name="Java_tips_techniques">27.8 Tips and techniques</a></H2>
<p>
@ -5023,7 +5023,7 @@ strings and arrays. This chapter discusses the common techniques for
solving these problems.
</p>
<H3><a name="Java_input_output_parameters">26.8.1 Input and output parameters using primitive pointers and references</a></H3>
<H3><a name="Java_input_output_parameters">27.8.1 Input and output parameters using primitive pointers and references</a></H3>
<p>
@ -5197,7 +5197,7 @@ void foo(Bar *OUTPUT);
will not have the intended effect since <tt>typemaps.i</tt> does not define an OUTPUT rule for <tt>Bar</tt>.
</p>
<H3><a name="Java_simple_pointers">26.8.2 Simple pointers</a></H3>
<H3><a name="Java_simple_pointers">27.8.2 Simple pointers</a></H3>
<p>
@ -5263,7 +5263,7 @@ System.out.println("3 + 4 = " + result);
See the <a href="Library.html#Library">SWIG Library</a> chapter for further details.
</p>
<H3><a name="Java_c_arrays">26.8.3 Wrapping C arrays with Java arrays</a></H3>
<H3><a name="Java_c_arrays">27.8.3 Wrapping C arrays with Java arrays</a></H3>
<p>
@ -5330,7 +5330,7 @@ Please be aware that the typemaps in this library are not efficient as all the e
There is an alternative approach using the SWIG array library and this is covered in the next section.
</p>
<H3><a name="Java_unbounded_c_arrays">26.8.4 Unbounded C Arrays</a></H3>
<H3><a name="Java_unbounded_c_arrays">27.8.4 Unbounded C Arrays</a></H3>
<p>
@ -5475,7 +5475,7 @@ well suited for applications in which you need to create buffers,
package binary data, etc.
</p>
<H3><a name="Java_binary_char">26.8.5 Binary data vs Strings</a></H3>
<H3><a name="Java_binary_char">27.8.5 Binary data vs Strings</a></H3>
<p>
@ -5519,7 +5519,7 @@ len: 5 data: 68 69 0 6a 6b
</pre></div>
<H3><a name="Java_heap_allocations">26.8.6 Overriding new and delete to allocate from Java heap</a></H3>
<H3><a name="Java_heap_allocations">27.8.6 Overriding new and delete to allocate from Java heap</a></H3>
<p>
@ -5636,7 +5636,7 @@ model and use these functions in place of malloc and free in your own
code.
</p>
<H2><a name="Java_typemaps">26.9 Java typemaps</a></H2>
<H2><a name="Java_typemaps">27.9 Java typemaps</a></H2>
<p>
@ -5657,7 +5657,7 @@ Before proceeding, it should be stressed that typemaps are not a required
part of using SWIG---the default wrapping behavior is enough in most cases.
Typemaps are only used if you want to change some aspect of the generated code.
<H3><a name="Java_default_primitive_type_mappings">26.9.1 Default primitive type mappings</a></H3>
<H3><a name="Java_default_primitive_type_mappings">27.9.1 Default primitive type mappings</a></H3>
<p>
@ -5809,7 +5809,7 @@ However, the mappings allow the full range of values for each C type from Java.
</p>
<H3><a name="Java_default_non_primitive_typemaps">26.9.2 Default typemaps for non-primitive types</a></H3>
<H3><a name="Java_default_non_primitive_typemaps">27.9.2 Default typemaps for non-primitive types</a></H3>
<p>
@ -5824,7 +5824,7 @@ So in summary, the C/C++ pointer to non-primitive types is cast into the 64 bit
The Java type is either the proxy class or type wrapper class.
</p>
<H3><a name="Java_jvm64">26.9.3 Sixty four bit JVMs</a></H3>
<H3><a name="Java_jvm64">27.9.3 Sixty four bit JVMs</a></H3>
<p>
@ -5837,7 +5837,7 @@ Unfortunately it won't of course hold true for JNI code.
</p>
<H3><a name="Java_what_is_typemap">26.9.4 What is a typemap?</a></H3>
<H3><a name="Java_what_is_typemap">27.9.4 What is a typemap?</a></H3>
<p>
@ -5960,7 +5960,7 @@ int c = example.count('e', "Hello World");
</pre>
</div>
<H3><a name="Java_typemaps_c_to_java_types">26.9.5 Typemaps for mapping C/C++ types to Java types</a></H3>
<H3><a name="Java_typemaps_c_to_java_types">27.9.5 Typemaps for mapping C/C++ types to Java types</a></H3>
<p>
@ -6240,7 +6240,7 @@ These are listed below:
</table>
<H3><a name="Java_typemap_attributes">26.9.6 Java typemap attributes</a></H3>
<H3><a name="Java_typemap_attributes">27.9.6 Java typemap attributes</a></H3>
<p>
@ -6286,7 +6286,7 @@ The "javain" typemap has the optional 'pre', 'post' and 'pgcppname' attributes.
Note that when the 'pre' or 'post' attributes are specified and the associated type is used in a constructor, a constructor helper function is generated. This is necessary as the Java proxy constructor wrapper makes a call to a support constructor using a <i>this</i> call. In Java the <i>this</i> call must be the first statement in the constructor body. The constructor body thus calls the helper function and the helper function instead makes the JNI call, ensuring the 'pre' code is called before the JNI call is made. There is a <a href="#Java_date_marshalling">Date marshalling</a> example showing 'pre', 'post' and 'pgcppname' attributes in action.
</p>
<H3><a name="Java_special_variables">26.9.7 Java special variables</a></H3>
<H3><a name="Java_special_variables">27.9.7 Java special variables</a></H3>
<p>
@ -6468,7 +6468,7 @@ in that it is not fully qualified with the package name when using the
<a href="SWIGPlus.html#SWIGPlus_nspace">nspace feature</a>.
</p>
<H3><a name="Java_typemaps_for_c_and_cpp">26.9.8 Typemaps for both C and C++ compilation</a></H3>
<H3><a name="Java_typemaps_for_c_and_cpp">27.9.8 Typemaps for both C and C++ compilation</a></H3>
<p>
@ -6505,7 +6505,7 @@ If you do not intend your code to be targeting both C and C++ then your typemaps
</p>
<H3><a name="Java_code_typemaps">26.9.9 Java code typemaps</a></H3>
<H3><a name="Java_code_typemaps">27.9.9 Java code typemaps</a></H3>
<p>
@ -6801,7 +6801,7 @@ to make the method and constructor public:
</pre>
</div>
<H3><a name="Java_directors_typemaps">26.9.10 Director specific typemaps</a></H3>
<H3><a name="Java_directors_typemaps">27.9.10 Director specific typemaps</a></H3>
<p>
@ -7078,7 +7078,7 @@ The basic strategy here is to provide a default package typemap for the majority
</div>
<H2><a name="Java_typemap_examples">26.10 Typemap Examples</a></H2>
<H2><a name="Java_typemap_examples">27.10 Typemap Examples</a></H2>
<p>
@ -7088,7 +7088,7 @@ the SWIG library.
</p>
<H3><a name="Java_simpler_enum_classes">26.10.1 Simpler Java enums for enums without initializers</a></H3>
<H3><a name="Java_simpler_enum_classes">27.10.1 Simpler Java enums for enums without initializers</a></H3>
<p>
@ -7167,7 +7167,7 @@ This would be done by using the original versions of these typemaps in "enums.sw
</p>
<H3><a name="Java_exception_typemap">26.10.2 Handling C++ exception specifications as Java exceptions</a></H3>
<H3><a name="Java_exception_typemap">27.10.2 Handling C++ exception specifications as Java exceptions</a></H3>
<p>
@ -7292,7 +7292,7 @@ We could alternatively have used <tt>%rename</tt> to rename <tt>what()</tt> into
</p>
<H3><a name="Java_nan_exception_typemap">26.10.3 NaN Exception - exception handling for a particular type</a></H3>
<H3><a name="Java_nan_exception_typemap">27.10.3 NaN Exception - exception handling for a particular type</a></H3>
<p>
@ -7447,7 +7447,7 @@ If we were a martyr to the JNI cause, we could replace the succinct code within
If we had, we would have put it in the "in" typemap which, like all JNI and Java typemaps, also supports the 'throws' attribute.
</p>
<H3><a name="Java_converting_java_string_arrays">26.10.4 Converting Java String arrays to char ** </a></H3>
<H3><a name="Java_converting_java_string_arrays">27.10.4 Converting Java String arrays to char ** </a></H3>
<p>
@ -7591,7 +7591,7 @@ Lastly the "jni", "jtype" and "jstype" typemaps are also required to specify
what Java types to use.
</p>
<H3><a name="Java_expanding_java_object">26.10.5 Expanding a Java object to multiple arguments</a></H3>
<H3><a name="Java_expanding_java_object">27.10.5 Expanding a Java object to multiple arguments</a></H3>
<p>
@ -7673,7 +7673,7 @@ example.foo(new String[]{"red", "green", "blue", "white"});
</div>
<H3><a name="Java_using_typemaps_return_arguments">26.10.6 Using typemaps to return arguments</a></H3>
<H3><a name="Java_using_typemaps_return_arguments">27.10.6 Using typemaps to return arguments</a></H3>
<p>
@ -7791,7 +7791,7 @@ $ java runme
1 12.0 340.0
</pre></div>
<H3><a name="Java_adding_downcasts">26.10.7 Adding Java downcasts to polymorphic return types</a></H3>
<H3><a name="Java_adding_downcasts">27.10.7 Adding Java downcasts to polymorphic return types</a></H3>
<p>
@ -7997,7 +7997,7 @@ SWIG usually generates code which constructs the proxy classes using Java code a
Note that the JNI code above uses a number of string lookups to call a constructor, whereas this would not occur using byte compiled Java code.
</p>
<H3><a name="Java_adding_equals_method">26.10.8 Adding an equals method to the Java classes</a></H3>
<H3><a name="Java_adding_equals_method">27.10.8 Adding an equals method to the Java classes</a></H3>
<p>
@ -8041,7 +8041,7 @@ System.out.println("foo1? " + foo1.equals(foo2));
</div>
<H3><a name="Java_void_pointers">26.10.9 Void pointers and a common Java base class</a></H3>
<H3><a name="Java_void_pointers">27.10.9 Void pointers and a common Java base class</a></H3>
<p>
@ -8100,7 +8100,7 @@ This example contains some useful functionality which you may want in your code.
<li> It also has a function which effectively implements a cast from the type of the proxy/type wrapper class to a void pointer. This is necessary for passing a proxy class or a type wrapper class to a function that takes a void pointer.
</ul>
<H3><a name="Java_struct_pointer_pointer">26.10.10 Struct pointer to pointer</a></H3>
<H3><a name="Java_struct_pointer_pointer">27.10.10 Struct pointer to pointer</a></H3>
<p>
@ -8280,7 +8280,7 @@ The C functional interface has been completely morphed into an object-oriented i
the Butler class would behave much like any pure Java class and feel more natural to Java users.
</p>
<H3><a name="Java_memory_management_member_variables">26.10.11 Memory management when returning references to member variables</a></H3>
<H3><a name="Java_memory_management_member_variables">27.10.11 Memory management when returning references to member variables</a></H3>
<p>
@ -8403,7 +8403,7 @@ public class Bike {
Note the <tt>addReference</tt> call.
</p>
<H3><a name="Java_memory_management_objects">26.10.12 Memory management for objects passed to the C++ layer</a></H3>
<H3><a name="Java_memory_management_objects">27.10.12 Memory management for objects passed to the C++ layer</a></H3>
<p>
@ -8531,7 +8531,7 @@ as mentioned earlier, <tt>setElement</tt> is actually:
</pre>
</div>
<H3><a name="Java_date_marshalling">26.10.13 Date marshalling using the javain typemap and associated attributes</a></H3>
<H3><a name="Java_date_marshalling">27.10.13 Date marshalling using the javain typemap and associated attributes</a></H3>
<p>
@ -8708,7 +8708,7 @@ A few things to note:
<H2><a name="Java_directors_faq">26.11 Living with Java Directors</a></H2>
<H2><a name="Java_directors_faq">27.11 Living with Java Directors</a></H2>
<p>
@ -8887,10 +8887,10 @@ public abstract class UserVisibleFoo extends Foo {
</li>
</ol>
<H2><a name="Java_odds_ends">26.12 Odds and ends</a></H2>
<H2><a name="Java_odds_ends">27.12 Odds and ends</a></H2>
<H3><a name="Java_javadoc_comments">26.12.1 JavaDoc comments</a></H3>
<H3><a name="Java_javadoc_comments">27.12.1 JavaDoc comments</a></H3>
<p>
@ -8946,7 +8946,7 @@ public class Barmy {
<H3><a name="Java_functional_interface">26.12.2 Functional interface without proxy classes</a></H3>
<H3><a name="Java_functional_interface">27.12.2 Functional interface without proxy classes</a></H3>
<p>
@ -9007,7 +9007,7 @@ All destructors have to be called manually for example the <tt>delete_Foo(foo)</
</p>
<H3><a name="Java_using_own_jni_functions">26.12.3 Using your own JNI functions</a></H3>
<H3><a name="Java_using_own_jni_functions">27.12.3 Using your own JNI functions</a></H3>
<p>
@ -9057,7 +9057,7 @@ This directive is only really useful if you want to mix your own hand crafted JN
</p>
<H3><a name="Java_performance">26.12.4 Performance concerns and hints</a></H3>
<H3><a name="Java_performance">27.12.4 Performance concerns and hints</a></H3>
<p>
@ -9078,7 +9078,7 @@ However, you will have to be careful about memory management and make sure that
This method normally calls the C++ destructor or <tt>free()</tt> for C code.
</p>
<H3><a name="Java_debugging">26.12.5 Debugging</a></H3>
<H3><a name="Java_debugging">27.12.5 Debugging</a></H3>
<p>
@ -9100,7 +9100,7 @@ The -verbose:jni and -verbose:gc are also useful options for monitoring code beh
</p>
<H2><a name="Java_examples">26.13 Java Examples</a></H2>
<H2><a name="Java_examples">27.13 Java Examples</a></H2>
<p>

View file

@ -7,7 +7,7 @@
</head>
<body>
<H1><a name="Javascript">27 SWIG and Javascript</a></H1>
<H1><a name="Javascript">28 SWIG and Javascript</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -52,7 +52,7 @@
<p>This chapter describes SWIG's support of Javascript. It does not cover SWIG basics, but only information that is specific to this module.</p>
<H2><a name="Javascript_overview">27.1 Overview</a></H2>
<H2><a name="Javascript_overview">28.1 Overview</a></H2>
<p>Javascript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. Its arguably the most popular language for web development.
@ -63,10 +63,10 @@ Javascript has gone beyond being a browser-based scripting language and with <a
With <a href="https://github.com/rogerwang/node-webkit">node-webkit</a> there is a platform which uses Google's <code>Chromium</code> as Web-Browser widget and <code>node.js</code> for javascript extensions.
</p>
<H2><a name="Javascript_preliminaries">27.2 Preliminaries</a></H2>
<H2><a name="Javascript_preliminaries">28.2 Preliminaries</a></H2>
<H3><a name="Javascript_running_swig">27.2.1 Running SWIG</a></H3>
<H3><a name="Javascript_running_swig">28.2.1 Running SWIG</a></H3>
<p>Suppose that you defined a SWIG module such as the following:</p>
@ -121,7 +121,7 @@ void example_initialize(v8::Handle&lt;v8::Object&gt; exports)</pre>
<b>Note</b>: be aware that <code>v8</code> has a C++ API, and thus, the generated modules must be compiled as C++.
</p>
<H3><a name="Javascript_running_tests_examples">27.2.2 Running Tests and Examples</a></H3>
<H3><a name="Javascript_running_tests_examples">28.2.2 Running Tests and Examples</a></H3>
<p>The configuration for tests and examples currently supports Linux and Mac only and not MinGW (Windows) yet.</p>
@ -153,7 +153,7 @@ $ make check-javascript-test-suite ENGINE=jsc</pre>
$ make check-javascript-examples V8_VERSION=0x032530 ENGINE=v8</pre>
</div>
<H3><a name="Javascript_known_issues">27.2.3 Known Issues</a></H3>
<H3><a name="Javascript_known_issues">28.2.3 Known Issues</a></H3>
<p>At the moment, the Javascript generators pass all tests syntactically, i.e., the generated source code compiles. However, there are still remaining runtime issues.</p>
@ -170,12 +170,12 @@ $ make check-javascript-examples V8_VERSION=0x032530 ENGINE=v8</pre>
<p>The primary development environment has been Linux (Ubuntu 12.04). Windows and Mac OS X have been tested sporadically. Therefore, the generators might have more issues on those platforms. Please report back any problem you observe to help us improving this module quickly.</p>
<H2><a name="Javascript_integration">27.3 Integration</a></H2>
<H2><a name="Javascript_integration">28.3 Integration</a></H2>
<p>This chapter gives a short introduction how to use a native Javascript extension: as a <code>node.js</code> module, and as an extension for an embedded Webkit.</p>
<H3><a name="Javascript_node_extensions">27.3.1 Creating node.js Extensions</a></H3>
<H3><a name="Javascript_node_extensions">28.3.1 Creating node.js Extensions</a></H3>
<p>To install <code>node.js</code> you can download an installer from their <a href="https://launchpad.net/~chris-lea/+archive/node.js">web-site</a> for Mac OS X and Windows. For Linux you can either build the source yourself and run <code>sudo checkinstall</code> or keep to the (probably stone-age) packaged version. For Ubuntu there is a <a href="https://launchpad.net/~chris-lea/+archive/ubuntu/node.js/">PPA</a> available.</p>
@ -221,7 +221,7 @@ require("./build/Release/example")</pre>
</div>
<p>A more detailed explanation is given in the <a href="#Javascript_examples">Examples</a> section.</p>
<H4><a name="Javascript_troubleshooting">27.3.1.1 Troubleshooting</a></H4>
<H4><a name="Javascript_troubleshooting">28.3.1.1 Troubleshooting</a></H4>
<ul>
@ -233,12 +233,12 @@ require("./build/Release/example")</pre>
$ sudo apt-get remove gyp</pre>
</div>
<H3><a name="Javascript_embedded_webkit">27.3.2 Embedded Webkit</a></H3>
<H3><a name="Javascript_embedded_webkit">28.3.2 Embedded Webkit</a></H3>
<p>Webkit is pre-installed on Mac OS X and available as a library for GTK.</p>
<H4><a name="Javascript_osx">27.3.2.1 Mac OS X</a></H4>
<H4><a name="Javascript_osx">28.3.2.1 Mac OS X</a></H4>
<p>There is general information about programming with WebKit on <a href="https://developer.apple.com/library/mac/documentation/cocoa/conceptual/DisplayWebContent/DisplayWebContent.html">Apple Developer Documentation</a>. Details about <code>Cocoa</code> programming are not covered here.</p>
@ -286,7 +286,7 @@ extern bool example_initialize(JSGlobalContextRef context, JSObjectRef* exports)
@end</pre>
</div>
<H4><a name="Javascript_gtk">27.3.2.2 GTK</a></H4>
<H4><a name="Javascript_gtk">28.3.2.2 GTK</a></H4>
<p>There is general information about programming GTK at <a href="https://developer.gnome.org/gtk2/">GTK documentation</a> and in the <a href="https://developer.gnome.org/gtk-tutorial">GTK tutorial</a>, and for Webkit there is a <a href="http://webkitgtk.org/reference/webkitgtk/stable/index.html">Webkit GTK+ API Reference</a>.</p>
@ -331,7 +331,7 @@ int main(int argc, char* argv[])
}</pre>
</div>
<H3><a name="Javascript_applications_webkit">27.3.3 Creating Applications with node-webkit</a></H3>
<H3><a name="Javascript_applications_webkit">28.3.3 Creating Applications with node-webkit</a></H3>
<p>To get started with <code>node-webkit</code> there is a very informative set of <a href="https://github.com/rogerwang/node-webkit/wiki">wiki pages</a>.</p>
@ -422,12 +422,12 @@ open new windows, and many more things.
};</pre>
</div>
<H2><a name="Javascript_examples">27.4 Examples</a></H2>
<H2><a name="Javascript_examples">28.4 Examples</a></H2>
<p>Some basic examples are shown here in more detail.</p>
<H3><a name="Javascript_simple_example">27.4.1 Simple</a></H3>
<H3><a name="Javascript_simple_example">28.4.1 Simple</a></H3>
<p>The common example <code>simple</code> looks like this:</p>
@ -477,7 +477,7 @@ example.Foo = 3.1415926;</pre>
<p><b>Note</b>: ECMAScript 5, the currently implemented Javascript standard, does not have modules. <code>node.js</code> and other implementations provide this mechanism defined by the <a href="http://wiki.commonjs.org/wiki/CommonJS">CommonJS</a> group. For browsers this is provided by <a href="http://browserify.org">Browserify</a>, for instance.</p>
<H3><a name="Javascript_class_example">27.4.2 Class</a></H3>
<H3><a name="Javascript_class_example">28.4.2 Class</a></H3>
<p>The common example <code>class</code> defines three classes, <code>Shape</code>, <code>Circle</code>, and <code>Square</code>:</p>
@ -607,12 +607,12 @@ at emitKey (readline.js:1095:12)</pre>
<b>Note</b>: In ECMAScript 5 there is no concept for classes. Instead each function can be used as a constructor function which is executed by the 'new' operator. Furthermore, during construction the key property <code>prototype</code> of the constructor function is used to attach a prototype instance to the created object. A prototype is essentially an object itself that is the first-class delegate of a class used whenever the access to a property of an object fails. The very same prototype instance is shared among all instances of one type. Prototypal inheritance is explained in more detail on in <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain">Inheritance and the prototype chain</a>, for instance.
</p>
<H2><a name="Javascript_implementation">27.5 Implementation</a></H2>
<H2><a name="Javascript_implementation">28.5 Implementation</a></H2>
<p>The Javascript Module implementation has taken a very different approach compared to other language modules in order to support different Javascript interpreters.</p>
<H3><a name="Javascript_source_code">27.5.1 Source Code</a></H3>
<H3><a name="Javascript_source_code">28.5.1 Source Code</a></H3>
<p>The Javascript module is implemented in <code>Source/Modules/javascript.cxx</code>. It dispatches the code generation to a <code>JSEmitter</code> instance, <code>V8Emitter</code> or <code>JSCEmitter</code>. Additionally there are some helpers: <code>Template</code>, for templated code generation, and <code>JSEmitterState</code>, which is used to manage state information during AST traversal. This rough map shall make it easier to find a way through this huge source file:</p>
@ -713,7 +713,7 @@ Template::Template(const String *code_) { ... }
...</pre>
</div>
<H3><a name="Javascript_code_templates">27.5.2 Code Templates</a></H3>
<H3><a name="Javascript_code_templates">28.5.2 Code Templates</a></H3>
<p>All generated code is created on the basis of code templates. The templates for <em>JavascriptCore</em> can be found in <code>Lib/javascript/jsc/javascriptcode.swg</code>, for <em>v8</em> in <code>Lib/javascript/v8/javascriptcode.swg</code>.</p>
@ -752,7 +752,7 @@ t_register.replace("$jsparent", state.clazz(NAME_MANGLED))
</div>
<p><code>Template</code> creates a copy of that string and <code>Template::replace</code> uses Swig's <code>Replaceall</code> to replace variables in the template. <code>Template::trim</code> can be used to eliminate leading and trailing whitespaces. <code>Template::print</code> is used to write the final template string to a Swig <code>DOH</code> (based on <code>Printv</code>). All methods allow chaining.</p>
<H3><a name="Javascript_emitter">27.5.3 Emitter</a></H3>
<H3><a name="Javascript_emitter">28.5.3 Emitter</a></H3>
<p>The Javascript module delegates code generation to a <code>JSEmitter</code> instance. The following extract shows the essential interface:</p>
@ -871,7 +871,7 @@ int JAVASCRIPT::classHandler(Node *n) {
</div>
<p>In <code>enterClass</code> the emitter stores state information that is necessary when processing class members. In <code>exitClass</code> the wrapper code for the whole class is generated.</p>
<H3><a name="Javascript_emitter_states">27.5.4 Emitter states</a></H3>
<H3><a name="Javascript_emitter_states">28.5.4 Emitter states</a></H3>
<p>For storing information during the AST traversal the emitter provides a <code>JSEmitterState</code> with different slots to store data representing the scopes global, class, function, and variable.</p>
@ -915,7 +915,7 @@ state.clazz(NAME, Getattr(n, "sym:name"));</pre>
<p>State information can be retrieved using <code>state.clazz(NAME)</code> or with <code>Getattr</code> on <code>state.clazz()</code> which actually returns a <code>Hash</code> instance.</p>
<H3><a name="Javascript_jsc_exceptions">27.5.5 Handling Exceptions in JavascriptCore</a></H3>
<H3><a name="Javascript_jsc_exceptions">28.5.5 Handling Exceptions in JavascriptCore</a></H3>
<p>Applications with an embedded JavascriptCore should be able to present detailed exception messages that occur in the Javascript engine. Below is an example derived from code provided by Brian Barnes on how these exception details can be extracted.</p>

View file

@ -7,7 +7,7 @@
</head>
<body bgcolor="#ffffff">
<H1><a name="Lisp">28 SWIG and Common Lisp</a></H1>
<H1><a name="Lisp">29 SWIG and Common Lisp</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -42,7 +42,7 @@
Lisp, Common Foreign Function Interface(CFFI), CLisp and UFFI
foreign function interfaces.
</p>
<H2><a name="Lisp_nn2">28.1 Allegro Common Lisp</a></H2>
<H2><a name="Lisp_nn2">29.1 Allegro Common Lisp</a></H2>
<p>
@ -51,7 +51,7 @@
<a href="Allegrocl.html#Allegrocl">here</a>
</p>
<H2><a name="Lisp_nn3">28.2 Common Foreign Function Interface(CFFI)</a></H2>
<H2><a name="Lisp_nn3">29.2 Common Foreign Function Interface(CFFI)</a></H2>
<p>
@ -78,7 +78,7 @@ swig -cffi -module <i>module-name</i> <i>file-name</i>
files and the various things which you can do with them.
</p>
<H3><a name="Lisp_nn4">28.2.1 Additional Commandline Options </a></H3>
<H3><a name="Lisp_nn4">29.2.1 Additional Commandline Options </a></H3>
<p>
@ -119,7 +119,7 @@ swig -cffi -help
</table>
<H3><a name="Lisp_nn5">28.2.2 Generating CFFI bindings</a></H3>
<H3><a name="Lisp_nn5">29.2.2 Generating CFFI bindings</a></H3>
<p>
@ -403,7 +403,7 @@ The feature <i>intern_function</i> ensures that all C names are
</pre></div>
<H3><a name="Lisp_nn6">28.2.3 Generating CFFI bindings for C++ code</a></H3>
<H3><a name="Lisp_nn6">29.2.3 Generating CFFI bindings for C++ code</a></H3>
<p>This feature to SWIG (for CFFI) is very new and still far from
@ -582,7 +582,7 @@ If you have any questions, suggestions, patches, etc., related to CFFI
module feel free to contact us on the SWIG mailing list, and
also please add a "[CFFI]" tag in the subject line.
<H3><a name="Lisp_nn7">28.2.4 Inserting user code into generated files</a></H3>
<H3><a name="Lisp_nn7">29.2.4 Inserting user code into generated files</a></H3>
<p>
@ -622,7 +622,7 @@ Note that the block <tt>%{ ... %}</tt> is effectively a shortcut for
</p>
<H2><a name="Lisp_nn8">28.3 CLISP</a></H2>
<H2><a name="Lisp_nn8">29.3 CLISP</a></H2>
<p>
@ -652,7 +652,7 @@ swig -clisp -module <i>module-name</i> <i>file-name</i>
interface file for the CLISP module. The CLISP module tries to
produce code which is both human readable and easily modifiable.
</p>
<H3><a name="Lisp_nn9">28.3.1 Additional Commandline Options </a></H3>
<H3><a name="Lisp_nn9">29.3.1 Additional Commandline Options </a></H3>
<p>
@ -685,7 +685,7 @@ shortcuts according to the typedefs in the input.
</table>
<H3><a name="Lisp_nn10">28.3.2 Details on CLISP bindings</a></H3>
<H3><a name="Lisp_nn10">29.3.2 Details on CLISP bindings</a></H3>
<p>
@ -809,7 +809,7 @@ struct bar {
</pre></div>
<H2><a name="Lisp_nn11">28.4 UFFI </a></H2>
<H2><a name="Lisp_nn11">29.4 UFFI </a></H2>
</body>

View file

@ -7,7 +7,7 @@
</head>
<body bgcolor="#ffffff">
<H1><a name="Lua">29 SWIG and Lua</a></H1>
<H1><a name="Lua">30 SWIG and Lua</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -83,14 +83,14 @@ Lua is an extension programming language designed to support general procedural
eLua stands for Embedded Lua (can be thought of as a flavor of Lua) and offers the full implementation of the Lua programming language to the embedded world, extending it with specific features for efficient and portable software embedded development. eLua runs on smaller devices like microcontrollers and provides the full features of the regular Lua desktop version. More information on eLua can be found here: <a href="http://www.eluaproject.net">http://www.eluaproject.net</a>
</p>
<H2><a name="Lua_nn2">29.1 Preliminaries</a></H2>
<H2><a name="Lua_nn2">30.1 Preliminaries</a></H2>
<p>
The current SWIG implementation is designed to work with Lua 5.0.x, 5.1.x and 5.2.x. It should work with later versions of Lua, but certainly not with Lua 4.0 due to substantial API changes. It is possible to either static link or dynamic link a Lua module into the interpreter (normally Lua static links its libraries, as dynamic linking is not available on all platforms). SWIG also has support for eLua starting from eLua 0.8. Due to substantial changes between SWIG 2.x and SWIG 3.0 and unavailability of testing platform, eLua status was downgraded to 'experimental'.
</p>
<H2><a name="Lua_nn3">29.2 Running SWIG</a></H2>
<H2><a name="Lua_nn3">30.2 Running SWIG</a></H2>
<p>
@ -138,7 +138,7 @@ $ swig -lua -eluac example.i
The <tt>-elua</tt> option puts all the C function wrappers and variable get/set wrappers in rotables. It also generates a metatable which will control the access to these variables from eLua. It also offers a significant amount of module size compression. On the other hand, the <tt>-eluac</tt> option puts all the wrappers in a single rotable. With this option, no matter how huge the module, it will consume no additional microcontroller SRAM (crass compression). There is a catch though: Metatables are not generated with <tt>-eluac</tt>. To access any value from eLua, one must directly call the wrapper function associated with that value.
</p>
<H3><a name="Lua_commandline">29.2.1 Additional command line options</a></H3>
<H3><a name="Lua_commandline">30.2.1 Additional command line options</a></H3>
<p>
@ -179,7 +179,7 @@ swig -lua -help
</tr>
</table>
<H3><a name="Lua_nn4">29.2.2 Compiling and Linking and Interpreter</a></H3>
<H3><a name="Lua_nn4">30.2.2 Compiling and Linking and Interpreter</a></H3>
<p>
@ -250,7 +250,7 @@ LUALIB_API int ( luaopen_mod )(lua_State *L );
More information on building and configuring eLua can be found here: <a href="http://www.eluaproject.net/doc/v0.8/en_building.html">http://www.eluaproject.net/doc/v0.8/en_building.html</a>
</p>
<H3><a name="Lua_nn5">29.2.3 Compiling a dynamic module</a></H3>
<H3><a name="Lua_nn5">30.2.3 Compiling a dynamic module</a></H3>
<p>
@ -318,7 +318,7 @@ Is quite obvious (Go back and consult the Lua documents on how to enable loadlib
<H3><a name="Lua_nn6">29.2.4 Using your module</a></H3>
<H3><a name="Lua_nn6">30.2.4 Using your module</a></H3>
<p>
@ -336,19 +336,19 @@ $ ./my_lua
&gt;
</pre></div>
<H2><a name="Lua_nn7">29.3 A tour of basic C/C++ wrapping</a></H2>
<H2><a name="Lua_nn7">30.3 A tour of basic C/C++ wrapping</a></H2>
<p>
By default, SWIG tries to build a very natural Lua interface to your C/C++ code. This section briefly covers the essential aspects of this wrapping.
</p>
<H3><a name="Lua_nn8">29.3.1 Modules</a></H3>
<H3><a name="Lua_nn8">30.3.1 Modules</a></H3>
<p>
The SWIG module directive specifies the name of the Lua module. If you specify `module example', then everything is wrapped into a Lua table 'example' containing all the functions and variables. When choosing a module name, make sure you don't use the same name as a built-in Lua command or standard module name.
</p>
<H3><a name="Lua_nn9">29.3.2 Functions</a></H3>
<H3><a name="Lua_nn9">30.3.2 Functions</a></H3>
<p>
@ -389,7 +389,7 @@ It is also possible to rename the module with an assignment.
24
</pre></div>
<H3><a name="Lua_nn10">29.3.3 Global variables</a></H3>
<H3><a name="Lua_nn10">30.3.3 Global variables</a></H3>
<p>
@ -477,7 +477,7 @@ If you have used the <tt>-eluac</tt> option for your eLua module, you will have
In general, functions of the form <tt>"variable_get()"</tt> and <tt>"variable_set()"</tt> are automatically generated by SWIG for use with <tt>-eluac</tt>.
</p>
<H3><a name="Lua_nn11">29.3.4 Constants and enums</a></H3>
<H3><a name="Lua_nn11">30.3.4 Constants and enums</a></H3>
<p>
@ -512,7 +512,7 @@ If you're using eLua and have used <tt>-elua</tt> or <tt>-eluac</tt> to generate
Hello World
</pre></div>
<H4><a name="Lua_nn13">29.3.4.1 Constants/enums and classes/structures</a></H4>
<H4><a name="Lua_nn13">30.3.4.1 Constants/enums and classes/structures</a></H4>
<p>
@ -568,7 +568,7 @@ If the <tt>-no-old-metatable-bindings</tt> option is used, then these old-style
It is worth mentioning, that <tt>example.Test.TEST1</tt> and <tt>example.Test_TEST1</tt> are different entities and changing one does not change the other.
Given the fact that these are constantes and they are not supposed to be changed, it is up to you to avoid such issues.
</p>
<H3><a name="Lua_nn12">29.3.5 Pointers</a></H3>
<H3><a name="Lua_nn12">30.3.5 Pointers</a></H3>
<p>
@ -606,7 +606,7 @@ Lua enforces the integrity of its userdata, so it is virtually impossible to cor
nil
</pre></div>
<H3><a name="Lua_structures">29.3.6 Structures</a></H3>
<H3><a name="Lua_structures">30.3.6 Structures</a></H3>
<p>
@ -710,7 +710,7 @@ For eLua with the <tt>-eluac</tt> option, structure manipulation has to be perfo
In general, functions of the form <tt>"new_struct()"</tt>, <tt>"struct_member_get()"</tt>, <tt>"struct_member_set()"</tt> and <tt>"free_struct()"</tt> are automatically generated by SWIG for each structure defined in C. (Please note: This doesn't apply for modules generated with the <tt>-elua</tt> option)
</p>
<H3><a name="Lua_nn14">29.3.7 C++ classes</a></H3>
<H3><a name="Lua_nn14">30.3.7 C++ classes</a></H3>
<p>
@ -785,7 +785,7 @@ Both style names are generated by default now.
However, if the <tt>-no-old-metatable-bindings</tt> option is used, then the backward compatible names are not generated in addition to ordinary ones.
</p>
<H3><a name="Lua_nn15">29.3.8 C++ inheritance</a></H3>
<H3><a name="Lua_nn15">30.3.8 C++ inheritance</a></H3>
<p>
@ -810,7 +810,7 @@ then the function <tt>spam()</tt> accepts a Foo pointer or a pointer to any clas
<p>
It is safe to use multiple inheritance with SWIG.
</p>
<H3><a name="Lua_nn16">29.3.9 Pointers, references, values, and arrays</a></H3>
<H3><a name="Lua_nn16">30.3.9 Pointers, references, values, and arrays</a></H3>
<p>
@ -841,7 +841,7 @@ Foo spam7();
<p>
then all three functions will return a pointer to some Foo object. Since the third function (spam7) returns a value, newly allocated memory is used to hold the result and a pointer is returned (Lua will release this memory when the return value is garbage collected). The other two are pointers which are assumed to be managed by the C code and so will not be garbage collected.
</p>
<H3><a name="Lua_nn17">29.3.10 C++ overloaded functions</a></H3>
<H3><a name="Lua_nn17">30.3.10 C++ overloaded functions</a></H3>
<p>
@ -927,7 +927,7 @@ Please refer to the "SWIG and C++" chapter for more information about overloadin
<p>
Dealing with the Lua coercion mechanism, the priority is roughly (integers, floats, strings, userdata). But it is better to rename the functions rather than rely upon the ordering.
</p>
<H3><a name="Lua_nn18">29.3.11 C++ operators</a></H3>
<H3><a name="Lua_nn18">30.3.11 C++ operators</a></H3>
<p>
@ -1059,7 +1059,7 @@ operators and pseudo-operators):</p>
</ul>
<p>No other lua metafunction is inherited. For example, __gc is not inherited and must be redefined in every class. <tt>__tostring</tt> is subject to a special handling. If absent in class and in class bases, a default one will be provided by SWIG.
</p>
<H3><a name="Lua_nn19">29.3.12 Class extension with %extend</a></H3>
<H3><a name="Lua_nn19">30.3.12 Class extension with %extend</a></H3>
<p>
@ -1116,7 +1116,7 @@ true
Extend works with both C and C++ code, on classes and structs. It does not modify the underlying object in any way---the extensions only show up in the Lua interface. The only item to take note of is the code has to use the '$self' instead of 'this', and that you cannot access protected/private members of the code (as you are not officially part of the class).
</p>
<H3><a name="Lua_nn20">29.3.13 Using %newobject to release memory</a></H3>
<H3><a name="Lua_nn20">30.3.13 Using %newobject to release memory</a></H3>
<p> If you have a function that allocates memory like this,</p>
@ -1140,7 +1140,7 @@ char *foo();
</div>
<p> This will release the allocated memory.</p>
<H3><a name="Lua_nn21">29.3.14 C++ templates</a></H3>
<H3><a name="Lua_nn21">30.3.14 C++ templates</a></H3>
<p>
@ -1175,7 +1175,7 @@ In Lua:
<p>
Obviously, there is more to template wrapping than shown in this example. More details can be found in the SWIG and C++ chapter. Some more complicated examples will appear later.
</p>
<H3><a name="Lua_nn22">29.3.15 C++ Smart Pointers</a></H3>
<H3><a name="Lua_nn22">30.3.15 C++ Smart Pointers</a></H3>
<p>
@ -1227,7 +1227,7 @@ If you ever need to access the underlying pointer returned by <tt>operator-&gt;(
&gt; f = p:__deref__() -- Returns underlying Foo *
</pre></div>
<H3><a name="Lua_nn23">29.3.16 C++ Exceptions</a></H3>
<H3><a name="Lua_nn23">30.3.16 C++ Exceptions</a></H3>
<p>
@ -1370,7 +1370,7 @@ and the "<a href="Customization.html#Customization_exception">Exception handling
add exception specification to functions or globally (respectively).
</p>
<H3><a name="Lua_namespaces">29.3.17 Namespaces </a></H3>
<H3><a name="Lua_namespaces">30.3.17 Namespaces </a></H3>
<p>
@ -1421,7 +1421,7 @@ Now, from Lua usage is as follows:
19
&gt;
</pre></div>
<H4><a name="Lua_nn27">29.3.17.1 Compatibility Note </a></H4>
<H4><a name="Lua_nn27">30.3.17.1 Compatibility Note </a></H4>
<p>
@ -1437,7 +1437,7 @@ If SWIG is running in a backwards compatible way, i.e. without the <tt>-no-old-m
</pre></div>
<H4><a name="Lua_nn29">29.3.17.2 Names </a></H4>
<H4><a name="Lua_nn29">30.3.17.2 Names </a></H4>
<p> If SWIG is launched without <tt>-no-old-metatable-bindings</tt> option, then it enters backward-compatible mode. While in this mode, it tries
@ -1481,7 +1481,7 @@ surrounding scope without any prefixing. Pretending that Test2 is a struct, not
&gt;
</pre></div>
<H4><a name="Lua_nn30">29.3.17.3 Inheritance </a></H4>
<H4><a name="Lua_nn30">30.3.17.3 Inheritance </a></H4>
<p> The internal organization of inheritance has changed.
@ -1522,12 +1522,12 @@ function
&gt;
</pre></div>
<H2><a name="Lua_nn24">29.4 Typemaps</a></H2>
<H2><a name="Lua_nn24">30.4 Typemaps</a></H2>
<p>This section explains what typemaps are and how to use them. The default wrapping behaviour of SWIG is enough in most cases. However sometimes SWIG may need a little additional assistance to know which typemap to apply to provide the best wrapping. This section will be explaining how to use typemaps to best effect</p>
<H3><a name="Lua_nn25">29.4.1 What is a typemap?</a></H3>
<H3><a name="Lua_nn25">30.4.1 What is a typemap?</a></H3>
<p>A typemap is nothing more than a code generation rule that is attached to a specific C datatype. For example, to convert integers from Lua to C, you might define a typemap like this:</p>
@ -1555,7 +1555,7 @@ Received an integer : 6
720
</pre></div>
<H3><a name="Lua_nn26">29.4.2 Using typemaps</a></H3>
<H3><a name="Lua_nn26">30.4.2 Using typemaps</a></H3>
<p>There are many ready written typemaps built into SWIG for all common types (int, float, short, long, char*, enum and more), which SWIG uses automatically, with no effort required on your part.</p>
@ -1608,7 +1608,7 @@ void swap(int *sx, int *sy);
<p>Note: C++ references must be handled exactly the same way. However SWIG will automatically wrap a <tt>const int&amp;</tt> as an input parameter (since that it obviously input).</p>
<H3><a name="Lua_typemap_arrays">29.4.3 Typemaps and arrays</a></H3>
<H3><a name="Lua_typemap_arrays">30.4.3 Typemaps and arrays</a></H3>
<p>Arrays present a challenge for SWIG, because like pointers SWIG does not know whether these are input or output values, nor
@ -1672,7 +1672,7 @@ and Lua tables to be 1..N, (the indexing follows the norm for the language). In
<p>Note: SWIG also can support arrays of pointers in a similar manner.</p>
<H3><a name="Lua_typemaps_ptr_ptr_functions">29.4.4 Typemaps and pointer-pointer functions</a></H3>
<H3><a name="Lua_typemaps_ptr_ptr_functions">30.4.4 Typemaps and pointer-pointer functions</a></H3>
<p>Several C++ libraries use a pointer-pointer functions to create its objects. These functions require a pointer to a pointer which is then filled with the pointer to the new object. Microsoft's COM and DirectX as well as many other libraries have this kind of function. An example is given below:</p>
@ -1706,7 +1706,7 @@ int Create_Math(iMath** pptr); // its creator (assume it mallocs)
ptr=nil -- the iMath* will be GC'ed as normal
</pre></div>
<H2><a name="Lua_writing_typemaps">29.5 Writing typemaps</a></H2>
<H2><a name="Lua_writing_typemaps">30.5 Writing typemaps</a></H2>
<p>This section describes how you can modify SWIG's default wrapping behavior for various C/C++ datatypes using the <tt>%typemap</tt> directive. This is an advanced topic that assumes familiarity with the Lua C API as well as the material in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter.</p>
@ -1715,7 +1715,7 @@ ptr=nil -- the iMath* will be GC'ed as normal
<p>Before proceeding, you should read the previous section on using typemaps, and look at the existing typemaps found in luatypemaps.swg and typemaps.i. These are both well documented and fairly easy to read. You should not attempt to write your own typemaps until you have read and can understand both of these files (they may well also give you an idea to base your work on).</p>
<H3><a name="Lua_typemaps_write">29.5.1 Typemaps you can write</a></H3>
<H3><a name="Lua_typemaps_write">30.5.1 Typemaps you can write</a></H3>
<p>There are many different types of typemap that can be written, the full list can be found in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter. However the following are the most commonly used ones.</p>
@ -1728,7 +1728,7 @@ ptr=nil -- the iMath* will be GC'ed as normal
(the syntax for the typecheck is different from the typemap, see typemaps for details).</li>
</ul>
<H3><a name="Lua_nn31">29.5.2 SWIG's Lua-C API</a></H3>
<H3><a name="Lua_nn31">30.5.2 SWIG's Lua-C API</a></H3>
<p>This section explains the SWIG specific Lua-C API. It does not cover the main Lua-C api, as this is well documented and not worth covering.</p>
@ -1777,7 +1777,7 @@ This macro, when called within the context of a SWIG wrapped function, will disp
<div class="indent">
Similar to SWIG_fail_arg, except that it will display the swig_type_info information instead.</div>
<H2><a name="Lua_nn32">29.6 Customization of your Bindings</a></H2>
<H2><a name="Lua_nn32">30.6 Customization of your Bindings</a></H2>
<p>
@ -1786,7 +1786,7 @@ This section covers adding of some small extra bits to your module to add the la
<H3><a name="Lua_nn33">29.6.1 Writing your own custom wrappers</a></H3>
<H3><a name="Lua_nn33">30.6.1 Writing your own custom wrappers</a></H3>
<p>
@ -1805,7 +1805,7 @@ int native_function(lua_State*L) // my native code
The <tt>%native</tt> directive in the above example, tells SWIG that there is a function <tt>int native_function(lua_State*L);</tt> which is to be added into the module under the name '<tt>my_func</tt>'. SWIG will not add any wrapper for this function, beyond adding it into the function table. How you write your code is entirely up to you.
</p>
<H3><a name="Lua_nn34">29.6.2 Adding additional Lua code</a></H3>
<H3><a name="Lua_nn34">30.6.2 Adding additional Lua code</a></H3>
<p>
@ -1843,7 +1843,7 @@ Good uses for this feature is adding of new code, or writing helper functions to
See Examples/lua/arrays for an example of this code.
</p>
<H2><a name="Lua_nn35">29.7 Details on the Lua binding</a></H2>
<H2><a name="Lua_nn35">30.7 Details on the Lua binding</a></H2>
<p>
@ -1854,7 +1854,7 @@ See Examples/lua/arrays for an example of this code.
</i>
</p>
<H3><a name="Lua_nn36">29.7.1 Binding global data into the module.</a></H3>
<H3><a name="Lua_nn36">30.7.1 Binding global data into the module.</a></H3>
<p>
@ -1914,7 +1914,7 @@ end
<p>
That way when you call '<tt>a=example.Foo</tt>', the interpreter looks at the table 'example' sees that there is no field 'Foo' and calls __index. This will in turn check in '.get' table and find the existence of 'Foo' and then return the value of the C function call 'Foo_get()'. Similarly for the code '<tt>example.Foo=10</tt>', the interpreter will check the table, then call the __newindex which will then check the '.set' table and call the C function 'Foo_set(10)'.
</p>
<H3><a name="Lua_nn37">29.7.2 Userdata and Metatables</a></H3>
<H3><a name="Lua_nn37">30.7.2 Userdata and Metatables</a></H3>
<p>
@ -1994,7 +1994,7 @@ Note: Both the opaque structures (like the FILE*) and normal wrapped classes/str
<p>
Note: Operator overloads are basically done in the same way, by adding functions such as '__add' &amp; '__call' to the class' metatable. The current implementation is a bit rough as it will add any member function beginning with '__' into the metatable too, assuming its an operator overload.
</p>
<H3><a name="Lua_nn38">29.7.3 Memory management</a></H3>
<H3><a name="Lua_nn38">30.7.3 Memory management</a></H3>
<p>

View file

@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF">
<H1><a name="Modula3">30 SWIG and Modula-3</a></H1>
<H1><a name="Modula3">31 SWIG and Modula-3</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -55,7 +55,7 @@ especially
<a href="Typemaps.html#Typemaps">typemaps</a>.
</p>
<H2><a name="Modula3_modula3_overview">30.1 Overview</a></H2>
<H2><a name="Modula3_modula3_overview">31.1 Overview</a></H2>
<p>
@ -85,7 +85,7 @@ FFTW
</li>
</ol>
<H3><a name="Modula3_motivation">30.1.1 Motivation</a></H3>
<H3><a name="Modula3_motivation">31.1.1 Motivation</a></H3>
<p>
@ -132,10 +132,10 @@ functions), but it doesn't allow you to easily integrate a Modula-3 module into
a C/C++ project.
</p>
<H2><a name="Modula3_conception">30.2 Conception</a></H2>
<H2><a name="Modula3_conception">31.2 Conception</a></H2>
<H3><a name="Modula3_cinterface">30.2.1 Interfaces to C libraries</a></H3>
<H3><a name="Modula3_cinterface">31.2.1 Interfaces to C libraries</a></H3>
<p>
@ -284,7 +284,7 @@ and the principal type must be renamed (<tt>%typemap</tt>).
</p>
<H3><a name="Modula3_cppinterface">30.2.2 Interfaces to C++ libraries</a></H3>
<H3><a name="Modula3_cppinterface">31.2.2 Interfaces to C++ libraries</a></H3>
<p>
@ -385,10 +385,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="Modula3_preliminaries">30.3 Preliminaries</a></H2>
<H2><a name="Modula3_preliminaries">31.3 Preliminaries</a></H2>
<H3><a name="Modula3_compilers">30.3.1 Compilers</a></H3>
<H3><a name="Modula3_compilers">31.3.1 Compilers</a></H3>
<p>
@ -401,7 +401,7 @@ For testing examples I use Critical Mass cm3.
</p>
<H3><a name="Modula3_commandline">30.3.2 Additional Commandline Options</a></H3>
<H3><a name="Modula3_commandline">31.3.2 Additional Commandline Options</a></H3>
<p>
@ -478,10 +478,10 @@ Instead generate templates for some basic typemaps.
</tr>
</table>
<H2><a name="Modula3_typemaps">30.4 Modula-3 typemaps</a></H2>
<H2><a name="Modula3_typemaps">31.4 Modula-3 typemaps</a></H2>
<H3><a name="Modula3_inoutparam">30.4.1 Inputs and outputs</a></H3>
<H3><a name="Modula3_inoutparam">31.4.1 Inputs and outputs</a></H3>
<p>
@ -695,7 +695,7 @@ consist of the following parts:
</table>
<H3><a name="Modula3_ordinals">30.4.2 Subranges, Enumerations, Sets</a></H3>
<H3><a name="Modula3_ordinals">31.4.2 Subranges, Enumerations, Sets</a></H3>
<p>
@ -747,7 +747,7 @@ that I'd like to automate.
</p>
<H3><a name="Modula3_class">30.4.3 Objects</a></H3>
<H3><a name="Modula3_class">31.4.3 Objects</a></H3>
<p>
@ -760,7 +760,7 @@ is not really useful, yet.
</p>
<H3><a name="Modula3_imports">30.4.4 Imports</a></H3>
<H3><a name="Modula3_imports">31.4.4 Imports</a></H3>
<p>
@ -793,7 +793,7 @@ IMPORT M3toC;
</pre></div>
<H3><a name="Modula3_exceptions">30.4.5 Exceptions</a></H3>
<H3><a name="Modula3_exceptions">31.4.5 Exceptions</a></H3>
<p>
@ -817,7 +817,7 @@ you should declare
<tt>%typemap("m3wrapinconv:throws") blah * %{OSError.E%}</tt>.
</p>
<H3><a name="Modula3_typemap_example">30.4.6 Example</a></H3>
<H3><a name="Modula3_typemap_example">31.4.6 Example</a></H3>
<p>
@ -864,10 +864,10 @@ where almost everything is generated by a typemap:
</pre></div>
<H2><a name="Modula3_hints">30.5 More hints to the generator</a></H2>
<H2><a name="Modula3_hints">31.5 More hints to the generator</a></H2>
<H3><a name="Modula3_features">30.5.1 Features</a></H3>
<H3><a name="Modula3_features">31.5.1 Features</a></H3>
<table border summary="Modula-3 features">
@ -904,7 +904,7 @@ where almost everything is generated by a typemap:
</tr>
</table>
<H3><a name="Modula3_pragmas">30.5.2 Pragmas</a></H3>
<H3><a name="Modula3_pragmas">31.5.2 Pragmas</a></H3>
<table border summary="Modula-3 pragmas">
@ -927,7 +927,7 @@ where almost everything is generated by a typemap:
</tr>
</table>
<H2><a name="Modula3_remarks">30.6 Remarks</a></H2>
<H2><a name="Modula3_remarks">31.6 Remarks</a></H2>
<ul>

View file

@ -7,7 +7,7 @@
</head>
<body bgcolor="#ffffff">
<H1><a name="Modules">17 Working with Modules</a></H1>
<H1><a name="Modules">18 Working with Modules</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -24,7 +24,7 @@
<H2><a name="Modules_introduction">17.1 Modules Introduction</a></H2>
<H2><a name="Modules_introduction">18.1 Modules Introduction</a></H2>
<p>
@ -78,7 +78,7 @@ where you want to create a collection of modules.
Each module in the collection is created via separate invocations of SWIG.
</p>
<H2><a name="Modules_nn1">17.2 Basics</a></H2>
<H2><a name="Modules_nn1">18.2 Basics</a></H2>
<p>
@ -177,7 +177,7 @@ in parallel from multiple threads as SWIG provides no locking - for more on that
issue, read on.
</p>
<H2><a name="Modules_nn2">17.3 The SWIG runtime code</a></H2>
<H2><a name="Modules_nn2">18.3 The SWIG runtime code</a></H2>
<p>
@ -243,7 +243,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="Modules_external_run_time">17.4 External access to the runtime</a></H2>
<H2><a name="Modules_external_run_time">18.4 External access to the runtime</a></H2>
<p>As described in <a href="Typemaps.html#Typemaps_runtime_type_checker">The run-time type checker</a>,
@ -282,7 +282,7 @@ SWIG_TYPE_TABLE to be the same as the module whose types you are trying to
access.
</p>
<H2><a name="Modules_nn4">17.5 A word of caution about static libraries</a></H2>
<H2><a name="Modules_nn4">18.5 A word of caution about static libraries</a></H2>
<p>
@ -293,7 +293,7 @@ into it. This is very often <b>NOT</b> what you want and it can lead to unexpect
behavior. When working with dynamically loadable modules, you should try to work exclusively with shared libraries.
</p>
<H2><a name="Modules_nn5">17.6 References</a></H2>
<H2><a name="Modules_nn5">18.6 References</a></H2>
<p>
@ -301,7 +301,7 @@ Due to the complexity of working with shared libraries and multiple modules, it
an outside reference. John Levine's "Linkers and Loaders" is highly recommended.
</p>
<H2><a name="Modules_nn6">17.7 Reducing the wrapper file size</a></H2>
<H2><a name="Modules_nn6">18.7 Reducing the wrapper file size</a></H2>
<p>

Some files were not shown because too many files have changed in this diff Show more