Update section numbering

This commit is contained in:
William S Fulton 2019-02-10 01:03:06 +00:00
commit 940e32477d
20 changed files with 810 additions and 1017 deletions

View file

@ -7,7 +7,7 @@
</head>
<body bgcolor="#ffffff">
<H1><a name="Perl5">35 SWIG and Perl5</a></H1>
<H1><a name="Perl5">30 SWIG and Perl5</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -97,7 +97,7 @@ later. We're no longer testing regularly with older versions, but
Perl 5.6 seems to mostly work, while older versions don't.
</p>
<H2><a name="Perl5_nn2">35.1 Overview</a></H2>
<H2><a name="Perl5_nn2">30.1 Overview</a></H2>
<p>
@ -118,7 +118,7 @@ described. Advanced customization features, typemaps, and other
options are found near the end of the chapter.
</p>
<H2><a name="Perl5_nn3">35.2 Preliminaries</a></H2>
<H2><a name="Perl5_nn3">30.2 Preliminaries</a></H2>
<p>
@ -143,7 +143,7 @@ To build the module, you will need to compile the file
<tt>example_wrap.c</tt> and link it with the rest of your program.
</p>
<H3><a name="Perl5_nn4">35.2.1 Getting the right header files</a></H3>
<H3><a name="Perl5_nn4">30.2.1 Getting the right header files</a></H3>
<p>
@ -175,7 +175,7 @@ $ perl -e 'use Config; print "$Config{archlib}\n";'
</pre>
</div>
<H3><a name="Perl5_nn5">35.2.2 Compiling a dynamic module</a></H3>
<H3><a name="Perl5_nn5">30.2.2 Compiling a dynamic module</a></H3>
<p>
@ -208,7 +208,7 @@ the target should be named `<tt>example.so</tt>',
`<tt>example.sl</tt>', or the appropriate dynamic module name on your system.
</p>
<H3><a name="Perl5_nn6">35.2.3 Building a dynamic module with MakeMaker</a></H3>
<H3><a name="Perl5_nn6">30.2.3 Building a dynamic module with MakeMaker</a></H3>
<p>
@ -242,7 +242,7 @@ the preferred approach to compilation. More information about MakeMaker can be
found in "Programming Perl, 2nd ed." by Larry Wall, Tom Christiansen,
and Randal Schwartz.</p>
<H3><a name="Perl5_nn7">35.2.4 Building a static version of Perl</a></H3>
<H3><a name="Perl5_nn7">30.2.4 Building a static version of Perl</a></H3>
<p>
@ -311,7 +311,7 @@ added to it. Depending on your machine, you may need to link with
additional libraries such as <tt>-lsocket, -lnsl, -ldl</tt>, etc.
</p>
<H3><a name="Perl5_nn8">35.2.5 Using the module</a></H3>
<H3><a name="Perl5_nn8">30.2.5 Using the module</a></H3>
<p>
@ -464,7 +464,7 @@ system configuration (this requires root access and you will need to
read the man pages).
</p>
<H3><a name="Perl5_nn9">35.2.6 Compilation problems and compiling with C++</a></H3>
<H3><a name="Perl5_nn9">30.2.6 Compilation problems and compiling with C++</a></H3>
<p>
@ -607,7 +607,7 @@ have to find the macro that conflicts and add an #undef into the .i file. Pleas
any conflicting macros you find to <a href="http://www.swig.org/mail.html">swig-user mailing list</a>.
</p>
<H3><a name="Perl5_nn10">35.2.7 Compiling for 64-bit platforms</a></H3>
<H3><a name="Perl5_nn10">30.2.7 Compiling for 64-bit platforms</a></H3>
<p>
@ -634,7 +634,7 @@ also introduce problems on platforms that support more than one
linking standard (e.g., -o32 and -n32 on Irix).
</p>
<H2><a name="Perl5_nn11">35.3 Building Perl Extensions under Windows</a></H2>
<H2><a name="Perl5_nn11">30.3 Building Perl Extensions under Windows</a></H2>
<p>
@ -645,7 +645,7 @@ section assumes you are using SWIG with Microsoft Visual C++
although the procedure may be similar with other compilers.
</p>
<H3><a name="Perl5_nn12">35.3.1 Running SWIG from Developer Studio</a></H3>
<H3><a name="Perl5_nn12">30.3.1 Running SWIG from Developer Studio</a></H3>
<p>
@ -708,7 +708,7 @@ print "$a\n";
</pre></div>
<H3><a name="Perl5_nn13">35.3.2 Using other compilers</a></H3>
<H3><a name="Perl5_nn13">30.3.2 Using other compilers</a></H3>
<p>
@ -716,7 +716,7 @@ SWIG is known to work with Cygwin and may work with other compilers on Windows.
For general hints and suggestions refer to the <a href="Windows.html#Windows">Windows</a> chapter.
</p>
<H2><a name="Perl5_nn14">35.4 The low-level interface</a></H2>
<H2><a name="Perl5_nn14">30.4 The low-level interface</a></H2>
<p>
@ -726,7 +726,7 @@ can be used to control your application. However, it is also used to
construct more user-friendly proxy classes as described in the next section.
</p>
<H3><a name="Perl5_nn15">35.4.1 Functions</a></H3>
<H3><a name="Perl5_nn15">30.4.1 Functions</a></H3>
<p>
@ -749,7 +749,7 @@ use example;
$a = &amp;example::fact(2);
</pre></div>
<H3><a name="Perl5_nn16">35.4.2 Global variables</a></H3>
<H3><a name="Perl5_nn16">30.4.2 Global variables</a></H3>
<p>
@ -819,7 +819,7 @@ extern char *path; // Declared later in the input
</pre>
</div>
<H3><a name="Perl5_nn17">35.4.3 Constants</a></H3>
<H3><a name="Perl5_nn17">30.4.3 Constants</a></H3>
<p>
@ -859,7 +859,7 @@ print example::FOO, "\n";
</pre>
</div>
<H3><a name="Perl5_nn18">35.4.4 Pointers</a></H3>
<H3><a name="Perl5_nn18">30.4.4 Pointers</a></H3>
<p>
@ -968,7 +968,7 @@ as XS and <tt>xsubpp</tt>. Given the advancement of the SWIG typesystem and the
SWIG and XS, this is no longer supported.
</p>
<H3><a name="Perl5_nn19">35.4.5 Structures</a></H3>
<H3><a name="Perl5_nn19">30.4.5 Structures</a></H3>
<p>
@ -1102,7 +1102,7 @@ void Bar_f_set(Bar *b, Foo *val) {
</div>
<H3><a name="Perl5_nn20">35.4.6 C++ classes</a></H3>
<H3><a name="Perl5_nn20">30.4.6 C++ classes</a></H3>
<p>
@ -1167,7 +1167,7 @@ provides direct access to C++ objects. A higher level interface using Perl prox
can be built using these low-level accessors. This is described shortly.
</p>
<H3><a name="Perl5_nn21">35.4.7 C++ classes and type-checking</a></H3>
<H3><a name="Perl5_nn21">30.4.7 C++ classes and type-checking</a></H3>
<p>
@ -1203,7 +1203,7 @@ If necessary, the type-checker also adjusts the value of the pointer (as is nece
multiple inheritance is used).
</p>
<H3><a name="Perl5_nn22">35.4.8 C++ overloaded functions</a></H3>
<H3><a name="Perl5_nn22">30.4.8 C++ overloaded functions</a></H3>
<p>
@ -1247,7 +1247,7 @@ example::Spam_foo_d($s, 3.14);
Please refer to the "SWIG Basics" chapter for more information.
</p>
<H3><a name="Perl5_nn23">35.4.9 Operators</a></H3>
<H3><a name="Perl5_nn23">30.4.9 Operators</a></H3>
<p>
@ -1274,7 +1274,7 @@ The following C++ operators are currently supported by the Perl module:
<li>operator or </li>
</ul>
<H3><a name="Perl5_nn24">35.4.10 Modules and packages</a></H3>
<H3><a name="Perl5_nn24">30.4.10 Modules and packages</a></H3>
<p>
@ -1369,7 +1369,7 @@ print Foo::fact(4), "\n"; # Call a function in package FooBar
</pre></div>
-->
<H2><a name="Perl5_nn25">35.5 Input and output parameters</a></H2>
<H2><a name="Perl5_nn25">30.5 Input and output parameters</a></H2>
<p>
@ -1588,7 +1588,7 @@ print "$c\n";
<b>Note:</b> The <tt>REFERENCE</tt> feature is only currently supported for numeric types (integers and floating point).
</p>
<H2><a name="Perl5_nn26">35.6 Exception handling</a></H2>
<H2><a name="Perl5_nn26">30.6 Exception handling</a></H2>
<p>
@ -1752,7 +1752,7 @@ This is still supported, but it is deprecated. The newer <tt>%exception</tt> di
functionality, but it has additional capabilities that make it more powerful.
</p>
<H2><a name="Perl5_nn27">35.7 Remapping datatypes with typemaps</a></H2>
<H2><a name="Perl5_nn27">30.7 Remapping datatypes with typemaps</a></H2>
<p>
@ -1769,7 +1769,7 @@ Typemaps are only used if you want to change some aspect of the primitive
C-Perl interface.
</p>
<H3><a name="Perl5_nn28">35.7.1 A simple typemap example</a></H3>
<H3><a name="Perl5_nn28">30.7.1 A simple typemap example</a></H3>
<p>
@ -1873,7 +1873,7 @@ example::count("e", "Hello World");
</div>
<H3><a name="Perl5_nn29">35.7.2 Perl5 typemaps</a></H3>
<H3><a name="Perl5_nn29">30.7.2 Perl5 typemaps</a></H3>
<p>
@ -1978,7 +1978,7 @@ Return of C++ member data (all languages).
Check value of input parameter.
</div>
<H3><a name="Perl5_nn30">35.7.3 Typemap variables</a></H3>
<H3><a name="Perl5_nn30">30.7.3 Typemap variables</a></H3>
<p>
@ -2049,7 +2049,7 @@ properly assigned.
The Perl name of the wrapper function being created.
</div>
<H3><a name="Perl5_nn31">35.7.4 Useful functions</a></H3>
<H3><a name="Perl5_nn31">30.7.4 Useful functions</a></H3>
<p>
@ -2118,7 +2118,7 @@ int sv_isa(SV *, char *0;
</div>
<H2><a name="Perl5_nn32">35.8 Typemap Examples</a></H2>
<H2><a name="Perl5_nn32">30.8 Typemap Examples</a></H2>
<p>
@ -2127,7 +2127,7 @@ might look at the files "<tt>perl5.swg</tt>" and "<tt>typemaps.i</tt>" in
the SWIG library.
</p>
<H3><a name="Perl5_nn33">35.8.1 Converting a Perl5 array to a char **</a></H3>
<H3><a name="Perl5_nn33">30.8.1 Converting a Perl5 array to a char **</a></H3>
<p>
@ -2219,7 +2219,7 @@ print @$b, "\n"; # Print it out
</pre></div>
<H3><a name="Perl5_nn34">35.8.2 Return values</a></H3>
<H3><a name="Perl5_nn34">30.8.2 Return values</a></H3>
<p>
@ -2248,7 +2248,7 @@ can be done using the <tt>EXTEND()</tt> macro as in:
}
</pre></div>
<H3><a name="Perl5_nn35">35.8.3 Returning values from arguments</a></H3>
<H3><a name="Perl5_nn35">30.8.3 Returning values from arguments</a></H3>
<p>
@ -2302,7 +2302,7 @@ print "multout(7, 13) = @r\n";
($x, $y) = multout(7, 13);
</pre></div>
<H3><a name="Perl5_nn36">35.8.4 Accessing array structure members</a></H3>
<H3><a name="Perl5_nn36">30.8.4 Accessing array structure members</a></H3>
<p>
@ -2365,7 +2365,7 @@ the "in" typemap in the previous section would be used to convert an
to copy the converted array into a C data structure.
</p>
<H3><a name="Perl5_nn37">35.8.5 Turning Perl references into C pointers</a></H3>
<H3><a name="Perl5_nn37">30.8.5 Turning Perl references into C pointers</a></H3>
<p>
@ -2430,7 +2430,7 @@ print "$c\n";
</pre></div>
<H3><a name="Perl5_nn38">35.8.6 Pointer handling</a></H3>
<H3><a name="Perl5_nn38">30.8.6 Pointer handling</a></H3>
<p>
@ -2515,7 +2515,7 @@ For example:
</pre>
</div>
<H2><a name="Perl5_nn39">35.9 Proxy classes</a></H2>
<H2><a name="Perl5_nn39">30.9 Proxy classes</a></H2>
<p>
@ -2531,7 +2531,7 @@ to the underlying code. This section describes the implementation
details of the proxy interface.
</p>
<H3><a name="Perl5_nn40">35.9.1 Preliminaries</a></H3>
<H3><a name="Perl5_nn40">30.9.1 Preliminaries</a></H3>
<p>
@ -2553,7 +2553,7 @@ SWIG creates a collection of high-level Perl wrappers. In your scripts, you wil
high level wrappers. The wrappers, in turn, interact with the low-level procedural module.
</p>
<H3><a name="Perl5_nn41">35.9.2 Structure and class wrappers</a></H3>
<H3><a name="Perl5_nn41">30.9.2 Structure and class wrappers</a></H3>
<p>
@ -2680,7 +2680,7 @@ $v-&gt;DESTROY();
</pre></div>
<H3><a name="Perl5_nn42">35.9.3 Object Ownership</a></H3>
<H3><a name="Perl5_nn42">30.9.3 Object Ownership</a></H3>
<p>
@ -2767,7 +2767,7 @@ counting, garbage collection, or advanced features one might find in
sophisticated languages.
</p>
<H3><a name="Perl5_nn43">35.9.4 Nested Objects</a></H3>
<H3><a name="Perl5_nn43">30.9.4 Nested Objects</a></H3>
<p>
@ -2820,7 +2820,7 @@ $p-&gt;{f}-&gt;{x} = 0.0;
%${$p-&gt;{v}} = ( x=&gt;0, y=&gt;0, z=&gt;0);
</pre></div>
<H3><a name="Perl5_nn44">35.9.5 Proxy Functions</a></H3>
<H3><a name="Perl5_nn44">30.9.5 Proxy Functions</a></H3>
<p>
@ -2854,7 +2854,7 @@ This function replaces the original function, but operates in an
identical manner.
</p>
<H3><a name="Perl5_nn45">35.9.6 Inheritance</a></H3>
<H3><a name="Perl5_nn45">30.9.6 Inheritance</a></H3>
<p>
@ -2930,7 +2930,7 @@ particular, inheritance of data members is extremely tricky (and I'm
not even sure if it really works).
</p>
<H3><a name="Perl5_nn46">35.9.7 Modifying the proxy methods</a></H3>
<H3><a name="Perl5_nn46">30.9.7 Modifying the proxy methods</a></H3>
<p>
@ -2958,7 +2958,7 @@ public:
};
</pre></div>
<H2><a name="Perl5_nn47">35.10 Adding additional Perl code</a></H2>
<H2><a name="Perl5_nn47">30.10 Adding additional Perl code</a></H2>
<p>
@ -3009,7 +3009,7 @@ set_transform($im, $a);
</pre>
</div>
<H2><a name="Perl5_directors">35.11 Cross language polymorphism</a></H2>
<H2><a name="Perl5_directors">30.11 Cross language polymorphism</a></H2>
<p>
@ -3043,7 +3043,7 @@ proxy classes, director classes, and C wrapper functions takes care of
all the cross-language method routing transparently.
</p>
<H3><a name="Perl5_nn48">35.11.1 Enabling directors</a></H3>
<H3><a name="Perl5_nn48">30.11.1 Enabling directors</a></H3>
<p>
@ -3133,7 +3133,7 @@ sub one {
</div>
<H3><a name="Perl5_nn49">35.11.2 Director classes</a></H3>
<H3><a name="Perl5_nn49">30.11.2 Director classes</a></H3>
@ -3213,7 +3213,7 @@ so there is no need for the extra overhead involved with routing the
calls through Perl.
</p>
<H3><a name="Perl5_nn50">35.11.3 Ownership and object destruction</a></H3>
<H3><a name="Perl5_nn50">30.11.3 Ownership and object destruction</a></H3>
<p>
@ -3262,7 +3262,7 @@ sub DESTROY {
</div>
<H3><a name="Perl5_nn51">35.11.4 Exception unrolling</a></H3>
<H3><a name="Perl5_nn51">30.11.4 Exception unrolling</a></H3>
<p>
@ -3318,7 +3318,7 @@ Swig::DirectorMethodException is thrown, Perl will register the
exception as soon as the C wrapper function returns.
</p>
<H3><a name="Perl5_nn52">35.11.5 Overhead and code bloat</a></H3>
<H3><a name="Perl5_nn52">30.11.5 Overhead and code bloat</a></H3>
<p>
@ -3352,7 +3352,7 @@ directive) for only those methods that are likely to be extended in
Perl.
</p>
<H3><a name="Perl5_nn53">35.11.6 Typemaps</a></H3>
<H3><a name="Perl5_nn53">30.11.6 Typemaps</a></H3>
<p>