From 4098a01b68712400c025fa76b418c92e5c10d28a Mon Sep 17 00:00:00 2001
From: Ahmon Dancy
@@ -49,7 +49,7 @@ The Microsoft Developer Network (MSDN) h
Monodoc, available from the Mono project, has a very useful section titled Interop with native libraries.
@@ -334,7 +334,7 @@ Windows users can also get the examples working using a
Cygwin or MinGW environment for automatic configuration of the example makefiles.
Any one of the three C# compilers (Portable.NET, Mono or Microsoft) can be detected from within a Cygwin or Mingw environment if installed in your path.
-
@@ -430,7 +430,7 @@ set so should only be used when a C# exception is not created.
@@ -612,7 +612,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 SWIG_CSharpSetPendingException.
@@ -677,7 +677,7 @@ The managed code generated does check for the pending exception as mentioned ear
@@ -734,7 +734,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_evensonly(int jarg1) {
Multiple catch handlers are generated should there be more than one exception specifications declared.
@@ -868,7 +868,7 @@ try {
-
@@ -1000,7 +1000,7 @@ public class Bike : IDisposable {
Note the addReference call.
diff --git a/Doc/Manual/Chicken.html b/Doc/Manual/Chicken.html
index 8668fa3e4..ed7bdb033 100644
--- a/Doc/Manual/Chicken.html
+++ b/Doc/Manual/Chicken.html
@@ -8,7 +8,7 @@
@@ -87,7 +87,7 @@
CHICKEN.
@@ -120,7 +120,7 @@
object files and linked into your project.
@@ -149,10 +149,10 @@
object files and linked into your project.
@@ -168,7 +168,7 @@
%rename SWIG directive in the SWIG interface file.
@@ -190,7 +190,7 @@
(uses modulename)) CHICKEN Scheme form.
@@ -217,7 +217,7 @@
use (my-variable).
@@ -236,7 +236,7 @@
parameters). The return values can then be accessed with The SWIG chicken module has support for exceptions thrown from
@@ -278,7 +278,7 @@
@@ -321,7 +321,7 @@
@@ -342,7 +342,7 @@
We can easily use csc to build a static binary.16 SWIG and C#
+18 SWIG and C#
@@ -29,7 +29,7 @@
-
16.1 Introduction
+18.1 Introduction
16.2 Differences to the Java module
+18.2 Differences to the Java module
16.3 C# Exceptions
+18.3 C# Exceptions
16.3.1 C# exception example using "check" typemap
+18.3.1 C# exception example using "check" typemap
16.3.2 C# exception example using %exception
+18.3.2 C# exception example using %exception
16.3.3 C# exception example using exception specifications
+18.3.3 C# exception example using exception specifications
16.3.4 Custom C# ApplicationException example
+18.3.4 Custom C# ApplicationException example
16.4 C# Typemap examples
+18.4 C# Typemap examples
This section includes a few examples of typemaps. For more examples, you
@@ -876,7 +876,7 @@ might look at the files "csharp.swg" and "typemaps.i" in
the SWIG library.
-16.4.1 Memory management when returning references to member variables
+18.4.1 Memory management when returning references to member variables
16.4.2 Memory management for objects passed to the C++ layer
+18.4.2 Memory management for objects passed to the C++ layer
17 SWIG and Chicken
+19 SWIG and Chicken
@@ -69,7 +69,7 @@
-
17.1 Preliminaries
+19.1 Preliminaries
17.1.1 Running SWIG in C mode
+19.1.1 Running SWIG in C mode
17.1.2 Running SWIG in C++ mode
+19.1.2 Running SWIG in C++ mode
17.2 Code Generation
+19.2 Code Generation
-17.2.1 Naming Conventions
+19.2.1 Naming Conventions
17.2.2 Modules
+19.2.2 Modules
17.2.3 Constants and Variables
+19.2.3 Constants and Variables
17.2.4 Functions
+19.2.4 Functions
(call-with-values).
17.2.5 Exceptions
+19.2.5 Exceptions
17.3 TinyCLOS
+19.3 TinyCLOS
17.4 Linkage
+19.4 Linkage
17.4.1 Static binary or shared library linked at compile time
+19.4.1 Static binary or shared library linked at compile time
Building a shared library like in the above section only works if the library @@ -441,7 +441,7 @@ distributed and used by anyone, even if SWIG is not installed.
See the Examples/chicken/egg directory in the SWIG source for an example that builds two eggs, one using the first method and one using the second method.
-Linking together multiple modules that share type information using the %import
@@ -465,7 +465,7 @@ with (declare (uses ...)).
To create an extension library or an egg, just create a module_load.scm file that (declare (uses ...))
all the modules.
@@ -474,7 +474,7 @@ all the modules.
Lib/chicken/chicken.swg.
-@@ -507,7 +507,7 @@ all the modules.
type. flags is either zero or SWIG_POINTER_DISOWN (see below). -If the owner flag passed to SWIG_NewPointerObj is 1, NewPointerObj will add a
@@ -538,7 +538,7 @@ all the modules.
@@ -91,7 +91,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.
-@@ -121,7 +121,7 @@ obvious, but almost all SWIG directives as well as the low-level generation of wrapper code are driven by C++ datatypes.
-@@ -158,7 +158,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.
-@@ -203,7 +203,7 @@ stage of compilation. The next few sections briefly describe some of these stages.
-@@ -283,7 +283,7 @@ been expanded as well as everything else that goes into the low-level construction of the wrapper code.
-@@ -384,7 +384,7 @@ returning a foo and taking types a and b as arguments).
-@@ -636,7 +636,7 @@ $ swig -c++ -python -dump_tree example.i
@@ -655,7 +655,7 @@ that matches the name of the target language. For example, python:foo perl:foo.
-@@ -743,7 +743,7 @@ example.i:5. Previous declaration is foo_i(int )
@@ -799,7 +799,7 @@ For example, the exception code above is simply stored without any modifications.
-@@ -921,7 +921,7 @@ public : The role of these functions is described shortly.
-@@ -934,7 +934,7 @@ internal data structures, it may be useful keep XML in the back of your mind as a model.
-@@ -980,7 +980,7 @@ typedef Hash Typetab; -
@@ -1121,7 +1121,7 @@ Returns the number of replacements made (if any). -
@@ -1198,7 +1198,7 @@ Returns the list of hash table keys. -
@@ -1287,7 +1287,7 @@ If t is not a standard object, it is assumed to be a char * and is used to create a String object. -
@@ -1774,7 +1774,7 @@ the attribute is optional. Swig_restore() must always be called after function. -
@@ -1783,7 +1783,7 @@ pointers, references, and pointers to members. A detailed discussion of type theory is impossible here. However, let's cover the highlights.
-@@ -1884,7 +1884,7 @@ make the final type, the two parts are just joined together using string concatenation.
-@@ -2053,7 +2053,7 @@ Returns the prefix of a type. For example, if ty is ty is unmodified. -
@@ -2140,7 +2140,7 @@ Checks if ty is a varargs type. Checks if ty is a templatized type. -
@@ -2242,7 +2242,7 @@ Fully reduces ty according to typedef rules. Resulting datatype will consist only of primitive typenames. -
@@ -2279,7 +2279,7 @@ Literal y; // type = 'Literal', ltype='p.char' -
@@ -2341,7 +2341,7 @@ SWIG, but is most commonly associated with type-descriptor objects that appear in wrappers (e.g., SWIGTYPE_p_double). -
@@ -2440,7 +2440,7 @@ included. Used to emit prototypes. Returns the number of required (non-optional) arguments in p. -
@@ -2451,7 +2451,7 @@ describes the creation of a minimal Python module. You should be able to extra this to other languages.
-@@ -2461,7 +2461,7 @@ the parsing of command line options, all aspects of code generation are controll different methods of the Language that must be defined by your module.
-@@ -2574,7 +2574,7 @@ that activates your module. For example, swig -python foo.i. The messages from your new module should appear.
-@@ -2633,7 +2633,7 @@ to mark the option as valid. If you forget to do this, SWIG will terminate wit unrecognized command line option error.
-@@ -2682,7 +2682,7 @@ an implementation file python.cxx and a configuration file python.swg.
-@@ -2740,13 +2740,13 @@ int Python::top(Node *n) { -
@@ -2910,7 +2910,7 @@ Discuss the kinds of functions typically needed for SWIG runtime support (e.g. the SWIG files that implement those functions.
-@@ -2924,7 +2924,7 @@ Discuss the standard library files that most language modules provide, e.g.
@@ -2951,7 +2951,7 @@ during this process, see the section on configuration files.
-@@ -2983,13 +2983,13 @@ Some topics that you'll want to be sure to address include: if available. -
diff --git a/Doc/Manual/Guile.html b/Doc/Manual/Guile.html index ff8275342..7368d6c8e 100644 --- a/Doc/Manual/Guile.html +++ b/Doc/Manual/Guile.html @@ -8,7 +8,7 @@
-This section details guile-specific support in SWIG. -
@@ -55,7 +55,7 @@ There are three different concepts of "module" involved, defined separately for SWIG, Guile, and Libtool. To avoid horrible confusion, we explicitly prefix the context, e.g., "guile-module". -
The guile module can currently export wrapper files that use the guile GH interface or the @@ -103,7 +103,7 @@ for the specific API. Currently only the guile language module has created a ma but there is no reason other languages (like mzscheme or chicken) couldn't also use this. If that happens, there is A LOT less code duplication in the standard typemaps.
-@@ -111,7 +111,7 @@ Guile support is complicated by a lack of user community cohesiveness, which manifests in multiple shared-library usage conventions. A set of policies implementing a usage convention is called a linkage. -
@@ -206,7 +206,7 @@ placed between the define-module form and the
SWIG_init via a preprocessor define to avoid symbol
clashes. For this case, however, passive linkage is available.
-
Passive linkage is just like simple linkage, but it generates an @@ -216,7 +216,7 @@ package name (see below).
You should use passive linkage rather than simple linkage when you are using multiple modules. -
SWIG can also generate wrapper code that does all the Guile module @@ -257,7 +257,7 @@ Newer Guile versions have a shorthand procedure for this:
Guile used to support an autoloading facility for object-code @@ -283,7 +283,7 @@ option, SWIG generates an exported module initialization function with an appropriate name. -
@@ -308,7 +308,7 @@ my/lib/libfoo.so.X.Y.Z and friends. This scheme is still very experimental; the (hobbit4d link) conventions are not well understood.
-
@@ -320,7 +320,7 @@ complained so far.
%rename to specify the Guile name of the wrapped
functions and variables (see CHANGES).
-
@@ -405,7 +405,7 @@ In body, the first result of
See also the "multivalue" example.
@@ -426,7 +426,7 @@ representing the expected pointer type. See also
If the Scheme object passed was not a SWIG smob representing a compatible
pointer, a wrong-type-arg exception is raised.
-
@@ -455,7 +455,7 @@ that created them, so the first module we check will most likely be correct. Once we have a swig_type_info structure, we loop through the linked list of casts, using pointer comparisons.
-The SCM interface (using the "-scm" argument to swig) uses swigrun.swg. @@ -470,7 +470,7 @@ in the smob tag. If a generated GOOPS module has been loaded, smobs will be wra GOOPS class.
-Garbage collection is a feature of the new SCM interface, and it is automatically included @@ -484,7 +484,7 @@ is exactly like described in Object ownership and %newobject in the SWIG manual. All typemaps use an $owner var, and the guile module replaces $owner with 0 or 1 depending on feature:new.
-@@ -510,7 +510,7 @@ mapping: The default when not specified here is to use "swig-error". See Lib/exception.i for details. -
If invoked with the command-line option For global variables, SWIG creates a single wrapper procedure
@@ -574,7 +574,7 @@ struct members, the procedures SWIG can also generate classes and generic functions for use with
@@ -723,7 +723,7 @@ Notice that <Foo> is used before it is defined. The fix is to just put th
As you can see in the example above, there are potential naming conflicts. The default exported
@@ -762,7 +762,7 @@ guile-modules. For example, TODO: Renaming class name prefixes? The guile-modules generated above all need to be linked together. GOOPS support requires
diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html
index ceb806bcf..477a14ce9 100644
--- a/Doc/Manual/Java.html
+++ b/Doc/Manual/Java.html
@@ -5,7 +5,7 @@
@@ -181,7 +181,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.
@@ -197,7 +197,7 @@ Run make -k check from the SWIG root directory after installing SWIG on
The Java module requires your system to support shared libraries and dynamic loading.
This is the commonly used method to load JNI code so your system will more than likely support this.
@@ -244,7 +244,7 @@ To change this, you can use the -o option.
It is also possible to change the output directory that the Java files are generated into using -outdir.
@@ -276,7 +276,7 @@ swig -java -help
Their use will become clearer by the time you have finished reading this section on SWIG and Java.
@@ -291,7 +291,7 @@ They are usually in directories like this:
The exact location may vary on your machine, but the above locations are typical.
@@ -319,7 +319,7 @@ The name of the shared library output file is important.
If the name of your SWIG module is "example", the name of the corresponding shared library file should be "libexample.so" (or equivalent depending on your machine, see Dynamic linking problems for more information).
The name of the module is specified using the %module directive or -module command line option.
@@ -354,7 +354,7 @@ $
If it doesn't work have a look at the following section which discusses problems loading the shared library.
@@ -428,7 +428,7 @@ The following section also contains some C++ specific linking problems and solut
@@ -481,7 +481,7 @@ Finally make sure the version of JDK header files matches the version of Java th
@@ -490,7 +490,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.
@@ -529,7 +529,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 Dynamic linking problems.
@@ -588,7 +588,7 @@ Of course you may want to make changes for it to work for C++ by adding in the -
@@ -598,7 +598,7 @@ variables are wrapped with JavaBean type getters and setters and so forth.
This section briefly covers the essential aspects of this wrapping.
@@ -632,7 +632,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.
-
@@ -666,7 +666,7 @@ System.out.println(example.fact(4));
@@ -753,7 +753,7 @@ extern char *path; // Read-only (due to %immutable)
-
@@ -885,7 +885,7 @@ Or if you decide this practice isn't so bad and your own class implements ex
@@ -899,7 +899,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.
@@ -960,7 +960,7 @@ As in the case of constants, you can access them through either the module class
@@ -1051,7 +1051,7 @@ When upgrading to J2SDK 1.5 or later, proper Java enums could be used instead, w
The following section details proper Java enum generation.
@@ -1103,7 +1103,7 @@ The additional support methods need not be generated if none of the enum items h
Simpler Java enums for enums without initializers section.
@@ -1150,7 +1150,7 @@ Note that unlike typesafe enums, this approach requires users to mostly use diff
Thus the upgrade path to proper enums provided in J2SDK 1.5 is more painful.
@@ -1169,7 +1169,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.
@@ -1257,7 +1257,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.
@@ -1425,7 +1425,7 @@ x.setA(3); // Modify x.a - this is the same as b.f.a
-
@@ -1488,7 +1488,7 @@ int bar = Spam.getBar();
-
@@ -1549,7 +1549,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.
@@ -1604,7 +1604,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).
@@ -1628,7 +1628,7 @@ For spam1 and spam4 above the Java null gets translat
The converse also occurs, that is, NULL pointers are translated into null Java objects when returned from a C/C++ function.
@@ -1743,7 +1743,7 @@ void spam(short); // Ignored
-
@@ -1786,7 +1786,7 @@ Further details on default arguments and how to restore this approach are given
@@ -1846,7 +1846,7 @@ symbols separate, consider wrapping them as separate SWIG modules.
Each SWIG module can be placed into a separate package.
@@ -1895,7 +1895,7 @@ Obviously, there is more to template wrapping than shown in this example.
More details can be found in the SWIG and C++ chapter.
@@ -1979,7 +1979,7 @@ Foo f = p.__deref__(); // Returns underlying Foo *
-
@@ -1994,7 +1994,7 @@ Finally enum classes are covered.
First, the crucial intermediary JNI class is considered.
@@ -2107,7 +2107,7 @@ If name is the same as modulename then the module class name g
from modulename to modulenameModule.
@@ -2186,7 +2186,7 @@ For example, let's change the intermediary JNI class access to public.
All the methods in the intermediary JNI class will then be callable outside of the package as the method modifiers are public by default.
@@ -2217,7 +2217,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 Foo can be passed to the egg function, whereas any long can be passed to the egg function in the intermediary JNI class.
@@ -2268,7 +2268,7 @@ See The intermediary JNI class pragmas section fo
@@ -2342,7 +2342,7 @@ int y = f.spam(5, new Foo());
-
@@ -2504,7 +2504,7 @@ and
@@ -2618,7 +2618,7 @@ However, true cross language polymorphism can be achieved using the 19.4.3.3 Proxy classes and garbage collection
+
@@ -2695,7 +2695,7 @@ The section on Java typemaps details how to specify
-
@@ -2782,7 +2782,7 @@ public static void spam(SWIGTYPE_p_int x, SWIGTYPE_p_int y, int z) { ... }
-
@@ -2791,7 +2791,7 @@ The Enumerations section discussed these but omitted
The following sub-sections detail the various types of enum classes that can be generated.
@@ -2867,7 +2867,7 @@ The swigValue method is used for marshalling in the other direction.
The toString method is overridden so that the enum name is available.
@@ -2939,7 +2939,7 @@ These needn't be generated if the enum being wrapped does not have any initializ
Simpler Java enums for enums without initializers section describes how typemaps can be used to achieve this.
@@ -2969,7 +2969,7 @@ public final class Beverage {
-
@@ -2991,7 +2991,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.
@@ -3062,7 +3062,7 @@ public:
-
@@ -3089,7 +3089,7 @@ If the correct implementation is in Java, the Java API is used to call the metho
@@ -3107,7 +3107,7 @@ This situation can be optimized by selectively enabling director methods (using
@@ -3172,7 +3172,7 @@ directorDerived::upcall_method() invoked.
-
@@ -3184,7 +3184,7 @@ be awkward. This section describes some common SWIG features that are used
to improve the interface to existing C/C++ code.
@@ -3250,7 +3250,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.
@@ -3313,7 +3313,7 @@ Vector(2,3,4)
in any way---the extensions only show up in the Java interface.
@@ -3470,7 +3470,7 @@ to raise exceptions. See the SWIG Library ch
The typemap example Handling C++ exception specifications as Java exceptions provides further exception handling capabilities.
@@ -3496,7 +3496,7 @@ protected static void protect_me() {
-
@@ -3506,7 +3506,7 @@ strings and arrays. This chapter discusses the common techniques for
solving these problems.
@@ -3680,7 +3680,7 @@ void foo(Bar *OUTPUT);
will not have the intended effect since typemaps.i does not define an OUTPUT rule for Bar.
@@ -3746,7 +3746,7 @@ System.out.println("3 + 4 = " + result);
See the SWIG Library chapter for further details.
@@ -3813,7 +3813,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.
@@ -3958,7 +3958,7 @@ well suited for applications in which you need to create buffers,
package binary data, etc.
@@ -3979,7 +3979,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.
-
@@ -4130,7 +4130,7 @@ There is no perfect mapping between Java and C as Java doesn't support all the u
However, the mappings allow the full range of values for each C type from Java.
@@ -4143,7 +4143,7 @@ Unfortunately it won't of course hold true for JNI code.
@@ -4266,7 +4266,7 @@ int c = example.count('e',"Hello World");
-
@@ -4456,7 +4456,7 @@ These are listed below:
-
@@ -4486,7 +4486,7 @@ the union of the exception classes is added to the throws clause ensuring there
See the NaN exception example for further usage.
@@ -4621,7 +4621,7 @@ This special variable expands to the module name, as specified by %module$moduleJNI.
@@ -4658,7 +4658,7 @@ If you do not intend your code to be targeting both C and C++ then your typemaps
@@ -4848,7 +4848,7 @@ For the typemap to be used in all type wrapper classes, all the different types
Again this is the same that is in "java.swg", barring the method modifier for getCPtr.
@@ -5038,7 +5038,7 @@ The basic strategy here is to provide a default package typemap for the majority
-
@@ -5048,7 +5048,7 @@ the SWIG library.
@@ -5127,7 +5127,7 @@ This would be done by using the original versions of these typemaps in "enums.sw
@@ -5252,7 +5252,7 @@ We could alternatively have used %rename to rename what() into
@@ -5370,7 +5370,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.
@@ -5514,7 +5514,7 @@ Lastly the "jni", "jtype" and "jstype" typemaps are also required to specify
what Java types to use.
@@ -5596,7 +5596,7 @@ example.foo(new String[]{"red", "green", "blue", "white"});
-
@@ -5714,7 +5714,7 @@ $ java main
1 12.0 340.0
-
@@ -5920,7 +5920,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.
@@ -5959,7 +5959,7 @@ System.out.println("foo1? " + foo1.equals(foo2));
-
@@ -6018,7 +6018,7 @@ This example contains some useful functionality which you may want in your code.
@@ -6190,7 +6190,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.
@@ -6313,7 +6313,7 @@ public class Bike {
Note the addReference call.
@@ -6430,7 +6430,7 @@ The 'javacode' typemap simply adds in the specified code into the Java proxy cla
-
@@ -6611,10 +6611,10 @@ public abstract class UserVisibleFoo extends Foo {
@@ -6670,7 +6670,7 @@ public class Barmy {
-
@@ -6731,7 +6731,7 @@ All destructors have to be called manually for example the delete_Foo(foo)
@@ -6781,7 +6781,7 @@ This directive is only really useful if you want to mix your own hand crafted JN
@@ -6803,7 +6803,7 @@ This method normally calls the C++ destructor or free() for C code.
diff --git a/Doc/Manual/Lisp.html b/Doc/Manual/Lisp.html
index 38b899a36..440f83f9b 100644
--- a/Doc/Manual/Lisp.html
+++ b/Doc/Manual/Lisp.html
@@ -6,17 +6,23 @@
Common Lisp is a high-level, all-purpose, object-oriented,
dynamic, functional programming language with long history.
@@ -27,10 +33,19 @@
interfaces. SWIG currently supports only the Allegro Common
Lisp, CLisp and UFFI foreign function interfaces.
+ Allegro Common Lisp support in SWIG has been updated to include
+ support for both C and C++. You can read about the interface
+ here
CLISP is a feature-loaded
implementation of common lisp which is portable across most of the
@@ -56,7 +71,8 @@ swig -clispcl -module module-name file-name
interface file for the CLISP module. The CLISP module tries to
produce code which is both human readable and easily modifyable.
The following table list the additional commandline options available for the CLISP module. They can also be seen by using:
@@ -88,7 +104,8 @@ and global variables will be created otherwise only definitions for
As mentioned earlier the CLISP bindings generated by SWIG may need
@@ -211,7 +228,9 @@ struct bar {
-
Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight configuration language for any program that needs one. Lua is implemented as a library, written in clean C (that is, in the common subset of ANSI C and C++). Its also a really tiny language, less than 6000 lines of code, which compiles to <100 kilobytes of binary code. It can be found at http://www.lua.org
@@ -58,7 +58,7 @@ The current SWIG implementation is designed to work with Lua 5.0. It should work
Note: Lua 5.1 (alpha) has just (as of September 05) been released. The current version of SWIG will produce wrappers which are compatible with Lua 5.1, though the dynamic loading mechanism has changed (see below). The configure script and makefiles should work correctly with with Lua 5.1, though some small tweaks may be needed.
@@ -90,7 +90,7 @@ This creates a C/C++ source file example_wrap.c or example_wrap.cxx
The name of the wrapper file is derived from the name of the input file. For example, if the input file is example.i, the name of the wrapper file is example_wrap.c. To change this, you can use the -o option. The wrappered module will export one function "int Example_Init(LuaState* L)" which must be called to register the module with the Lua interpreter. The name "Example_Init" depends upon the name of the module. Note: SWIG will automatically capitalise the module name, so "module example;" becomes "Example_Init".
@@ -137,7 +137,7 @@ $ gcc -c example.c -o example.o
$ gcc -I/usr/include/lua -L/usr/lib/lua min.o example_wrap.o example.o -o my_lua
@@ -173,7 +173,7 @@ The wrappers produced by SWIG can be compiled and linked with Lua 5.1. The loadi
require("example")
-
@@ -191,19 +191,19 @@ $ ./my_lua
>
-
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.
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.
@@ -241,7 +241,7 @@ It is also possible to rename the module with an assignment.
24
-
@@ -296,7 +296,7 @@ nil
3.142
-
@@ -319,7 +319,7 @@ example.SUNDAY=0
Constants are not guaranteed to remain constant in Lua. The name of the constant could be accidentally reassigned to refer to some other object. Unfortunately, there is no easy way for SWIG to generate code that prevents this. You will just have to be careful.
@@ -357,7 +357,7 @@ Lua enforces the integrity of its userdata, so it is virtually impossible to cor
nil
-
@@ -443,7 +443,7 @@ Because the pointer points inside the structure, you can modify the contents and
> x.a = 3 -- Modifies the same structure
-
@@ -503,7 +503,7 @@ It is not (currently) possible to access static members of an instance:
-- does NOT work
-
@@ -528,7 +528,7 @@ then the function spam() accepts a Foo pointer or a pointer to any clas
It is safe to use multiple inheritance with SWIG.
@@ -559,7 +559,7 @@ Foo spam7();
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.
@@ -645,7 +645,7 @@ Please refer to the "SWIG and C++" chapter for more information about overloadin
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.
@@ -760,7 +760,7 @@ It is also possible to overload the operator[], but currently this cann
};
-
@@ -815,7 +815,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).
@@ -850,7 +850,7 @@ In Lua:
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.
@@ -902,7 +902,7 @@ If you ever need to access the underlying pointer returned by operator->(
> f = p:__deref__() -- Returns underlying Foo *
-
@@ -913,7 +913,7 @@ If you ever need to access the underlying pointer returned by operator->(
@@ -972,7 +972,7 @@ end
That way when you call 'a=example.Foo', 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 'example.Foo=10', 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)'.
@@ -1052,7 +1052,7 @@ Note: Both the opaque structures (like the FILE*) and normal wrappered classes/s
Note: Operator overloads are basically done in the same way, by adding functions such as '__add' & '__call' to the classes metatable. The current implementation is a bit rough as it will add any member function beginning with '__' into the metatable too, assuming its an operator overload.
diff --git a/Doc/Manual/Modula3.html b/Doc/Manual/Modula3.html
index 1a0b67e4a..06094b33d 100644
--- a/Doc/Manual/Modula3.html
+++ b/Doc/Manual/Modula3.html
@@ -5,7 +5,7 @@
@@ -90,7 +90,7 @@ So the introduction got a bit longer than it should ... ;-)
@@ -126,7 +126,7 @@ are not advantages of the language itself
but can be provided by function libraries.
@@ -166,7 +166,7 @@ it's statically typed, too.
@@ -179,7 +179,7 @@ Even more fortunately even non-C libraries may provide C header files.
This is where SWIG becomes helpful.
@@ -252,10 +252,10 @@ integrate Modula-3 code into a C / C++ project.
@@ -404,7 +404,7 @@ and the principal type must be renamed (%typemap).
@@ -505,10 +505,10 @@ There is no C++ library I wrote a SWIG interface for,
so I'm not sure if this is possible or sensible, yet.
@@ -522,7 +522,7 @@ For testing examples I use Critical Mass cm3.
@@ -599,10 +599,10 @@ Instead generate templates for some basic typemaps.
-
@@ -818,7 +818,7 @@ consist of the following parts:
-
@@ -870,7 +870,7 @@ that I'd like to automate.
@@ -883,7 +883,7 @@ is not really useful, yet.
@@ -918,7 +918,7 @@ IMPORT M3toC;
@@ -942,7 +942,7 @@ you should declare
%typemap("m3wrapinconv:throws") blah * %{OSError.E%}.
@@ -989,10 +989,10 @@ where almost everything is generated by a typemap:
-
This section contains information on SWIG's support of MzScheme.
-
diff --git a/Doc/Manual/Ocaml.html b/Doc/Manual/Ocaml.html
index 5938e1216..f0a1f4375 100644
--- a/Doc/Manual/Ocaml.html
+++ b/Doc/Manual/Ocaml.html
@@ -6,7 +6,7 @@
@@ -99,7 +99,7 @@ file Examples/Makefile illustrate how to compile and link SWIG modules that
will be loaded dynamically. This has only been tested on Linux so far.
@@ -122,7 +122,7 @@ you will compile the file example_wrap.c with ocamlc or
the resulting .ml and .mli files as well, and do the final link with -custom
(not needed for native link).
@@ -158,7 +158,7 @@ the user more freedom with respect to custom typing.
@@ -234,7 +234,7 @@ let b = C_string (getenv "PATH")
-
@@ -248,7 +248,7 @@ When linking any ocaml bytecode with your module, use the -custom
option is not needed when you build native code.
@@ -259,7 +259,7 @@ liberal with pointer types may not compile under the C++ compiler.
Most code meant to be compiled as C++ will not have problems.
@@ -360,7 +360,7 @@ is that you must append them to the return list with swig_result = caml_list_a
signature for a function that uses value in this way.
@@ -394,7 +394,7 @@ it describes the output SWIG will generate for class definitions.
-
@@ -457,7 +457,7 @@ val x : Enum_test.c_obj = C_enum `a
@@ -470,10 +470,10 @@ functions imported from different modules. You must convert values to master
values using the swig_val function before sharing them with another module.
@@ -494,7 +494,7 @@ arrays of simple types with known bounds in your code, but this only works
for arrays whose bounds are completely specified.
@@ -507,7 +507,7 @@ SWIG can't predict which of these methods will be used in the array,
so you have to specify it for yourself in the form of a typemap.
@@ -521,7 +521,7 @@ Consider writing an object when the ending condition of your array is complex,
such as using a required centinel, etc.
@@ -572,7 +572,7 @@ void printfloats( float *tab, int len );
-
@@ -615,7 +615,7 @@ the underlying pointer, so using create_[x]_from_ptr alters the
returned value for the same object.
@@ -695,7 +695,7 @@ baz
#
-
@@ -725,7 +725,7 @@ public:
};
-
@@ -800,7 +800,7 @@ class foo {
};
@@ -828,7 +828,7 @@ In this example, I'll examine the objective caml code involved in providing
an overloaded class. This example is contained in Examples/ocaml/shapes.
@@ -928,7 +928,7 @@ object from causing a core dump, as long as the object is destroyed
properly.
@@ -939,7 +939,7 @@ well as a function return value in the same way you provide function arguments,
and to receive arguments the same way you normally receive function returns.
@@ -950,7 +950,7 @@ code receives when you are called. In general, a simple directorin typ
can use the same body as a simple out typemap.
@@ -961,7 +961,7 @@ for the same type, except when there are special requirements for object
ownership, etc.
@@ -978,7 +978,7 @@ In the event that you don't specify all of the necessary values, integral
values will read zero, and struct or object returns have undefined results.
diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html
index dbb8883e3..a44fba7d9 100644
--- a/Doc/Manual/Perl5.html
+++ b/Doc/Manual/Perl5.html
@@ -6,7 +6,7 @@
@@ -107,7 +107,7 @@ described. Advanced customization features, typemaps, and other
options are found near the end of the chapter.
@@ -132,7 +132,7 @@ To build the module, you will need to compile the file
example_wrap.c and link it with the rest of your program.
@@ -164,7 +164,7 @@ loaded, an easy way to find out is to run Perl itself.
@@ -197,7 +197,7 @@ the target should be named `example.so',
`example.sl', or the appropriate dynamic module name on your system.
@@ -231,7 +231,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.
@@ -300,7 +300,7 @@ added to it. Depending on your machine, you may need to link with
additional libraries such as -lsocket, -lnsl, -ldl, etc.
@@ -455,7 +455,7 @@ system configuration (this requires root access and you will need to
read the man pages).
@@ -598,7 +598,7 @@ have to find the macro that conflicts and add an #undef into the .i file. Pleas
any conflicting macros you find to swig mailing list.
@@ -625,7 +625,7 @@ also introduce problems on platforms that support more than one
linking standard (e.g., -o32 and -n32 on Irix).
@@ -636,7 +636,7 @@ section assumes you are using SWIG with Microsoft Visual C++
although the procedure may be similar with other compilers.
@@ -699,7 +699,7 @@ print "$a\n";
-
@@ -707,7 +707,7 @@ SWIG is known to work with Cygwin and may work with other compilers on Windows.
For general hints and suggestions refer to the Windows chapter.
@@ -717,7 +717,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.
@@ -740,7 +740,7 @@ use example;
$a = &example::fact(2);
-
@@ -810,7 +810,7 @@ extern char *path; // Declared later in the input
-
@@ -837,7 +837,7 @@ $example::FOO = 2; # Error
-
@@ -946,7 +946,7 @@ as XS and xsubpp. Given the advancement of the SWIG typesystem and the
SWIG and XS, this is no longer supported.
@@ -1080,7 +1080,7 @@ void Bar_f_set(Bar *b, Foo *val) {
-
@@ -1145,7 +1145,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.
@@ -1181,7 +1181,7 @@ If necesssary, the type-checker also adjusts the value of the pointer (as is nec
multiple inheritance is used).
@@ -1225,7 +1225,7 @@ example::Spam_foo_d($s,3.14);
Please refer to the "SWIG Basics" chapter for more information.
@@ -1258,7 +1258,7 @@ $c = example::add_complex($a,$b);
Some preliminary work on mapping C++ operators into Perl operators has been completed. This is covered later.
@@ -1325,7 +1325,7 @@ print Foo::fact(4),"\n"; # Call a function in package FooBar
-->
-
@@ -1544,7 +1544,7 @@ print "$c\n";
Note: The REFERENCE feature is only currently supported for numeric types (integers and floating point).
@@ -1709,7 +1709,7 @@ This is still supported, but it is deprecated. The newer %exception di
functionality, but it has additional capabilities that make it more powerful.
@@ -1726,7 +1726,7 @@ Typemaps are only used if you want to change some aspect of the primitive
C-Perl interface.
@@ -1830,7 +1830,7 @@ example::count("e","Hello World");
-
@@ -1935,7 +1935,7 @@ Return of C++ member data (all languages).
Check value of input parameter.
-
@@ -2006,7 +2006,7 @@ properly assigned.
The Perl name of the wrapper function being created.
-
@@ -2075,7 +2075,7 @@ int sv_isa(SV *, char *0;
-
@@ -2084,7 +2084,7 @@ might look at the files "perl5.swg" and "typemaps.i" in
the SWIG library.
@@ -2176,7 +2176,7 @@ print @$b,"\n"; # Print it out
-
@@ -2205,7 +2205,7 @@ can be done using the EXTEND() macro as in :
}
-
@@ -2259,7 +2259,7 @@ print "multout(7,13) = @r\n";
($x,$y) = multout(7,13);
-
@@ -2322,7 +2322,7 @@ the "in" typemap in the previous section would be used to convert an
to copy the converted array into a C data structure.
@@ -2387,7 +2387,7 @@ print "$c\n";
-
@@ -2466,7 +2466,7 @@ For example:
-
@@ -2482,7 +2482,7 @@ to the underlying code. This section describes the implementation
details of the proxy interface.
@@ -2504,7 +2504,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.
@@ -2630,7 +2630,7 @@ $v->DESTROY();
-
@@ -2717,7 +2717,7 @@ counting, garbage collection, or advanced features one might find in
sophisticated languages.
@@ -2770,7 +2770,7 @@ $p->{f}->{x} = 0.0;
%${$p->{v}} = ( x=>0, y=>0, z=>0);
-
@@ -2804,7 +2804,7 @@ This function replaces the original function, but operates in an
identical manner.
@@ -2880,7 +2880,7 @@ particular, inheritance of data members is extremely tricky (and I'm
not even sure if it really works).
diff --git a/Doc/Manual/Php.html b/Doc/Manual/Php.html
index 40f8bbf0d..e417a34e7 100644
--- a/Doc/Manual/Php.html
+++ b/Doc/Manual/Php.html
@@ -7,7 +7,7 @@
@@ -104,7 +104,7 @@ script. The first choice is the default, however it can be changed by passing
the '-phpfull' command line switch to select the second build method.
@@ -194,7 +194,7 @@ additional optional arguments:
@@ -252,7 +252,7 @@ which contains your new module. You can test it with a php script which
does not have the 'dl' command as used above.
@@ -275,7 +275,7 @@ attempts to do the dl() call for you:
-
@@ -285,7 +285,7 @@ possible for names of symbols in one extension module to clash with
other symbols unless care is taken to %rename them.
@@ -410,7 +410,7 @@ both point to the same value, without the case test taking place. (
Apologies, this paragraph needs rewriting to make some sense. )
@@ -459,7 +459,7 @@ undefined.
At this time SWIG does not support custom accessor methods.
@@ -510,7 +510,7 @@ print $s; # The value of $s was not changed.
@@ -564,7 +564,7 @@ Cause less confusion and doit("2"); will invoke the function
taking the integer argument.
@@ -696,7 +696,7 @@ PHP in a number of ways: by using unset on an existing
variable, or assigning NULL to a variable.
@@ -755,7 +755,7 @@ Would be used in the following way:
Member variables and methods are accessed using the -> operator.
@@ -780,7 +780,7 @@ Complex_im_set($obj,$d);
Complex_im_get($obj);
-
@@ -821,7 +821,7 @@ the programmer can either reassign the variable or call
unset($v)
@@ -861,7 +861,7 @@ Ko::threats(10);
echo "There has now been " . Ko::threats() . " threats\n";
-
@@ -883,7 +883,7 @@ Ko::threats();
-
diff --git a/Doc/Manual/Pike.html b/Doc/Manual/Pike.html
index c38e97fdf..cc9d8fd28 100644
--- a/Doc/Manual/Pike.html
+++ b/Doc/Manual/Pike.html
@@ -6,7 +6,7 @@
@@ -94,7 +94,7 @@ can use the -o option:
@@ -114,7 +114,7 @@ You're looking for files with the names global.h, program.h
and so on.
@@ -129,10 +129,10 @@ Pike v7.4 release 10 running Hilfe v3.5 (Incremental Pike Frontend)
(1) Result: 24
@@ -143,7 +143,7 @@ concerned), SWIG's %module directive doesn't really have any
significance.
@@ -168,7 +168,7 @@ exactly as you'd expect it to:
(1) Result: 24
-
@@ -197,7 +197,7 @@ will result in two functions, Foo_get() and Foo_set():
(3) Result: 3.141590
-
@@ -205,7 +205,7 @@ Enumerated types in C/C++ declarations are wrapped as Pike constants,
not as Pike enums.
@@ -213,7 +213,7 @@ Constructors are wrapped as create() methods, and destructors are
wrapped as destroy() methods, for Pike classes.
diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html
index 9a6eac530..3021d2b45 100644
--- a/Doc/Manual/Python.html
+++ b/Doc/Manual/Python.html
@@ -6,7 +6,7 @@
@@ -153,10 +153,10 @@ described followed by a discussion of low-level implementation
details.
@@ -205,7 +205,7 @@ from the module name specified with %module. If the module name is example.py is created.
@@ -236,7 +236,7 @@ Type "copyright", "credits" or "license" for more information.
@@ -282,10 +282,10 @@ module actually consists of two files; socket.py and
_socket.so. Many other built-in Python modules follow a similar convention.
@@ -364,7 +364,7 @@ If using static linking, you might want to rely on a different approach
(perhaps using distutils).
@@ -521,7 +521,7 @@ system configuration (this requires root access and you will need to
read the man pages).
@@ -618,7 +618,7 @@ erratic program behavior. If working with lots of software components, you
might want to investigate using a more formal standard such as COM.
@@ -655,7 +655,7 @@ and -m64 allow you to choose the desired binary format for your python
extension.
@@ -744,7 +744,7 @@ you may want to consult the 26.3 A tour of basic C/C++ wrapping
+
@@ -753,7 +753,7 @@ to your C/C++ code. Functions are wrapped as functions, classes are wrapped as
This section briefly covers the essential aspects of this wrapping.
@@ -766,7 +766,7 @@ module name, make sure you don't use the same name as a built-in
Python command or standard module name.
@@ -790,7 +790,7 @@ like you think it does:
>>>
-
@@ -928,7 +928,7 @@ that starts with a leading underscore. SWIG does not create cvar
if there are no global variables in a module.
@@ -968,7 +968,7 @@ other object. Unfortunately, there is no easy way for SWIG to
generate code that prevents this. You will just have to be careful.
@@ -1109,7 +1109,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return
None if the conversion can't be performed.
@@ -1298,7 +1298,7 @@ everything works just like you would expect. For example:
-
@@ -1387,7 +1387,7 @@ they are accessed through cvar like this:
-
@@ -1442,7 +1442,7 @@ then the function spam() accepts Foo * or a pointer to any cla
It is safe to use multiple inheritance with SWIG.
@@ -1503,7 +1503,7 @@ treated as a returning value, and it will follow the same
allocation/deallocation process.
@@ -1626,7 +1626,7 @@ first declaration takes precedence.
Please refer to the "SWIG and C++" chapter for more information about overloading.
@@ -1715,7 +1715,7 @@ Also, be aware that certain operators don't map cleanly to Python. For instance
overloaded assignment operators don't map to Python semantics and will be ignored.
@@ -1782,7 +1782,7 @@ utilizes thousands of small deeply nested namespaces each with
identical symbol names, well, then you get what you deserve.
@@ -1835,7 +1835,7 @@ More details can be found in the SWIG and C++
examples will appear later.
@@ -1920,7 +1920,7 @@ simply use the __deref__() method. For example:
-
@@ -2062,7 +2062,7 @@ python releases the shadow instance.
@@ -2075,7 +2075,7 @@ of low-level details were omitted. This section provides a brief overview
of how the proxy classes work.
@@ -2164,7 +2164,7 @@ you can attach new Python methods to the class and you can even inherit from it
by Python built-in types until Python 2.2).
@@ -2351,7 +2351,7 @@ It is also possible to deal with situations like this using
typemaps--an advanced topic discussed later.
@@ -2388,7 +2388,7 @@ class itself. In Python-2.1 and earlier, they have to be accessed as a global
function or through an instance (see the earlier section).
@@ -2422,7 +2422,7 @@ proxy classes, director classes, and C wrapper functions takes care of
all the cross-language method routing transparently.
@@ -2515,7 +2515,7 @@ class MyFoo(mymodule.Foo):
-
@@ -2664,7 +2664,7 @@ deleting all the Foo pointers it contains at some point. Note that no hard
references to the Foo objects remain in Python.
@@ -2723,7 +2723,7 @@ Swig::DirectorMethodException is thrown, Python will register the
exception as soon as the C wrapper function returns.
@@ -2757,7 +2757,7 @@ directive) for only those methods that are likely to be extended in
Python.
@@ -2771,7 +2771,7 @@ need to be supported.
@@ -2818,7 +2818,7 @@ methods that return const references.
@@ -2831,7 +2831,7 @@ This section describes some common SWIG features that are used to
improve your the interface to an extension module.
@@ -2912,7 +2912,7 @@ hard to implement. It is possible to clean this up using Python code, typemaps,
customization features as covered in later sections.
@@ -2966,7 +2966,7 @@ what can be done without having to rely on any of the more advanced
customization features.
@@ -3055,7 +3055,7 @@ Vector(12,14,16)
in any way---the extensions only show up in the Python interface.
@@ -3181,7 +3181,7 @@ The language-independent exception.i library file can also be used
to raise exceptions. See the SWIG Library chapter.
@@ -3191,7 +3191,7 @@ strings, binary data, and arrays. This chapter discusses the common techniques
solving these problems.
@@ -3404,7 +3404,7 @@ void foo(Bar *OUTPUT);
may not have the intended effect since typemaps.i does not define an OUTPUT rule for Bar.
@@ -3473,7 +3473,7 @@ If you replace %pointer_functions() by %pointer_class(type,name)SWIG Library chapter for further details.
@@ -3535,7 +3535,7 @@ well suited for applications in which you need to create buffers,
package binary data, etc.
@@ -3604,16 +3604,16 @@ If you need to return binary data, you might use the
also be used to extra binary data from arbitrary pointers.
@@ -3630,7 +3630,7 @@ Typemaps are only used if you want to change some aspect of the primitive
C-Python interface or if you want to elevate your guru status.
@@ -3746,7 +3746,7 @@ parameter is omitted):
-
@@ -3787,7 +3787,7 @@ a look at the SWIG library version 1.3.20 or so.
@@ -3858,7 +3858,7 @@ properly assigned.
The Python name of the wrapper function being created.
-
@@ -3972,7 +3972,7 @@ write me
-
@@ -3981,7 +3981,7 @@ might look at the files "python.swg" and "typemaps.i" in
the SWIG library.
@@ -4061,7 +4061,7 @@ memory allocation is used to allocate memory for the array, the
the C function.
@@ -4140,7 +4140,7 @@ to supply the argument count. This is automatically set by the typemap code. F
-
@@ -4229,7 +4229,7 @@ function can now be used as follows:
>>>
-
@@ -4278,7 +4278,7 @@ array, such an approach would not be recommended for huge arrays, but
for small structures, this approach works fine.
@@ -4363,7 +4363,7 @@ static int convert_darray(PyObject *input, double *ptr, int size) {
-
@@ -4458,7 +4458,7 @@ class object (if applicable).
-
@@ -4486,7 +4486,7 @@ of your users much simpler.
@@ -4520,7 +4520,7 @@ layout of controls on a panel, etc. to be loaded from an XML file."
-
@@ -4547,7 +4547,7 @@ names, default values if any, and return type if any. There are also
three options for autodoc controlled by the value given to the
feature, described below.
-
@@ -4576,7 +4576,7 @@ def function_name(*args, **kwargs):
-
@@ -4601,7 +4601,7 @@ def function_name(*args, **kwargs):
-
@@ -4620,7 +4620,7 @@ void GetPosition(int* OUTPUT, int* OUTPUT);
-
@@ -4652,7 +4652,7 @@ with more than one line.
-
diff --git a/Doc/Manual/Ruby.html b/Doc/Manual/Ruby.html
index e46a6fb97..bbf9826ab 100644
--- a/Doc/Manual/Ruby.html
+++ b/Doc/Manual/Ruby.html
@@ -5,7 +5,7 @@
This chapter describes SWIG's support of Ruby.
@@ -237,7 +237,7 @@
Basics" chapter. It is also assumed that the reader has a basic
understanding of Ruby.
@@ -259,7 +259,7 @@
extension module. To finish building the module, you need to compile this file
and link it with the rest of your program.
@@ -280,7 +280,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -332,7 +332,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -356,7 +356,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -372,7 +372,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -396,7 +396,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -419,7 +419,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -487,14 +487,14 @@ $ ruby -e 'puts $:.join("\n")'
This section describes the basics of how SWIG maps C or C++ declarations in
your SWIG interface files to Ruby constructs.
@@ -561,7 +561,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -584,7 +584,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -621,7 +621,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -638,7 +638,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -659,7 +659,7 @@ $ ruby -e 'puts $:.join("\n")'
A NULL pointer is always represented by the Ruby nil object.
@@ -724,7 +724,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -758,7 +758,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -851,7 +851,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -913,7 +913,7 @@ $ ruby -e 'puts $:.join("\n")' Please refer to the "SWIG and C++" chapter
for more information about overloading.
@@ -943,7 +943,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -973,7 +973,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1014,7 +1014,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1052,7 +1052,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1062,7 +1062,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1083,7 +1083,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1209,7 +1209,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1222,7 +1222,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1289,7 +1289,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1346,7 +1346,7 @@ $ ruby -e 'puts $:.join("\n")' $symname
@@ -1392,19 +1392,19 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1419,7 +1419,7 @@ $ ruby -e 'puts $:.join("\n")' RARRAY(arr)->ptr
@@ -1486,7 +1486,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1525,14 +1525,14 @@ $ ruby -e 'puts $:.join("\n")'
This section includes a few examples of typemaps. For more examples, you might
look at the examples in the Example/ruby directory.
@@ -1556,7 +1556,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1669,7 +1669,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1716,7 +1716,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1737,7 +1737,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1752,7 +1752,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1789,10 +1789,10 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1863,7 +1863,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1902,7 +1902,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1939,7 +1939,7 @@ $ ruby -e 'puts $:.join("\n")'
@@ -1980,7 +1980,7 @@ $ ruby -e 'puts $:.join("\n")' One of the most common issues in generating SWIG bindings for Ruby is proper
@@ -2024,7 +2024,7 @@ $ ruby -e 'puts $:.join("\n")' As described above, memory management depends on clearly defining who is
@@ -2099,7 +2099,7 @@ $ ruby -e 'puts $:.join("\n")'
This code can be seen in swig/examples/ruby/tracking. The remaining parts of this section will use the class library shown below to
@@ -2168,7 +2168,7 @@ $ ruby -e 'puts $:.join("\n")' With a bit more testing, we see that our class library still has problems. For
@@ -2210,7 +2210,7 @@ $ ruby -e 'puts $:.join("\n")' This code can be seen in swig/examples/ruby/mark_function. By default, SWIG creates a "free" function that is called when a Ruby object is
diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html
index 23389c6f0..7c40b4c5f 100644
--- a/Doc/Manual/Sections.html
+++ b/Doc/Manual/Sections.html
@@ -41,6 +41,7 @@ to help!).
@@ -108,7 +108,7 @@ build a Tcl extension module. To finish building the module, you
need to compile this file and link it with the rest of your program.
@@ -126,7 +126,7 @@ this is the case, you should probably make a symbolic link so that tcl.h
-
@@ -161,7 +161,7 @@ The name of the module is specified using the %module directive or the
-module command line option.
@@ -227,7 +227,7 @@ minimal in most situations (and quite frankly not worth the extra
hassle in the opinion of this author).
@@ -355,7 +355,7 @@ to the default system configuration (this requires root access and you will need
the man pages).
@@ -438,7 +438,7 @@ erratic program behavior. If working with lots of software components, you
might want to investigate using a more formal standard such as COM.
@@ -465,7 +465,7 @@ also introduce problems on platforms that support more than one
linking standard (e.g., -o32 and -n32 on Irix).
@@ -484,7 +484,7 @@ option will append the prefix to the name when creating a command and
call it "Foo_bar".
@@ -506,7 +506,7 @@ When the -namespace option is used, objects in the module
are always accessed with the namespace name such as Foo::bar.
@@ -517,7 +517,7 @@ covers the process of using SWIG with Microsoft Visual C++.
although the procedure may be similar with other compilers.
@@ -575,7 +575,7 @@ MSDOS > tclsh80
%
@@ -638,7 +638,7 @@ to get you started. With a little practice, you'll be making lots of
Tcl extensions.
@@ -649,7 +649,7 @@ classes. This section briefly covers the essential aspects of this
wrapping.
@@ -683,7 +683,7 @@ To fix this, supply an extra argument to load like this:
-
@@ -708,7 +708,7 @@ like you think it does:
%
-
@@ -788,7 +788,7 @@ extern char *path; // Read-only (due to %immutable)
-
@@ -872,7 +872,7 @@ When an identifier name is given, it is used to perform an implicit hash-table l
conversion. This allows the global statement to be ommitted.
@@ -968,7 +968,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return
None if the conversion can't be performed.
@@ -1250,7 +1250,7 @@ Note: Tcl only destroys the underlying object if it has ownership. See the
memory management section that appears shortly.
@@ -1317,7 +1317,7 @@ In Tcl, the static member is accessed as follows:
-
@@ -1366,7 +1366,7 @@ For instance:
It is safe to use multiple inheritance with SWIG.
@@ -1420,7 +1420,7 @@ to hold the result and a pointer is returned (Tcl will release this memory
when the return value is garbage collected).
@@ -1543,7 +1543,7 @@ first declaration takes precedence.
Please refer to the "SWIG and C++" chapter for more information about overloading.
@@ -1645,7 +1645,7 @@ There are ways to make this operator appear as part of the class using the %
Keep reading.
@@ -1709,7 +1709,7 @@ utilizes thousands of small deeply nested namespaces each with
identical symbol names, well, then you get what you deserve.
@@ -1761,7 +1761,7 @@ More details can be found in the SWIG and C++
examples will appear later.
@@ -1845,7 +1845,7 @@ simply use the __deref__() method. For example:
-
@@ -1858,7 +1858,7 @@ of low-level details were omitted. This section provides a brief overview
of how the proxy classes work.
@@ -1923,7 +1923,7 @@ function. This allows objects to be encapsulated objects that look a lot like
as shown in the last section.
@@ -2111,7 +2111,7 @@ typemaps--an advanced topic discussed later.
@@ -2299,7 +2299,7 @@ set c [lindex $dim 1]
-
@@ -2433,7 +2433,7 @@ Since SWIG's exception handling is user-definable, you are not limited to C++ ex
See the chapter on "Customization Features" for more examples.
@@ -2450,7 +2450,7 @@ Typemaps are only used if you want to change some aspect of the primitive
C-Tcl interface.
@@ -2567,7 +2567,7 @@ parameter is ommitted):
-
@@ -2705,7 +2705,7 @@ Initialize an argument to a value before any conversions occur.
Examples of these methods will appear shortly.
@@ -2776,7 +2776,7 @@ properly assigned.
The Tcl name of the wrapper function being created.
-
@@ -2838,7 +2838,7 @@ argv[2] = Larry
3
-
@@ -2880,7 +2880,7 @@ result, a Tcl function using these typemaps will work like this :
%
-
@@ -2957,7 +2957,7 @@ int Tcl_IsShared(Tcl_Obj *obj);
-
@@ -3041,7 +3041,7 @@ work)
-
@@ -3117,7 +3117,7 @@ For example:
-
@@ -3189,7 +3189,7 @@ As a final note, most SWIG examples do not yet use the
to use the load command instead.
@@ -3288,7 +3288,7 @@ danger of blowing something up (although it is easily accomplished
with an out of bounds array access).
diff --git a/Doc/Manual/chapters b/Doc/Manual/chapters
index 93a7fa5af..f7bf49d19 100644
--- a/Doc/Manual/chapters
+++ b/Doc/Manual/chapters
@@ -13,6 +13,8 @@ Contract.html
Varargs.html
Warnings.html
Modules.html
+Lisp.html
+Allegrocl.html
CSharp.html
Chicken.html
Guile.html
diff --git a/Lib/allegrocl/allegrocl.swg b/Lib/allegrocl/allegrocl.swg
index f468edb4c..190a92f83 100644
--- a/Lib/allegrocl/allegrocl.swg
+++ b/Lib/allegrocl/allegrocl.swg
@@ -3,44 +3,275 @@
#define SWIG_ALLEGRO_CL
-/* Typespecs for basic types. */
+#define %ffargs(...) %feature("ffargs", "1", ##__VA_ARGS__)
+%ffargs(strings_convert="t");
-%typemap(ffitype) char ":char";
+/* typemaps for argument and result type conversions. */
+%typemap(lin) SWIGTYPE "(let (($out $in))\n $body)";
+
+%typemap(lout) bool, char, unsigned char, signed char,
+ short, signed short, unsigned short,
+ int, signed int, unsigned int,
+ long, signed long, unsigned long,
+ float, double, long double, char *, void *, void,
+ enum SWIGTYPE "$body";
+%typemap(lout) SWIGTYPE[ANY], SWIGTYPE *,
+ SWIGTYPE & "(make-instance '$lclass :foreign-address $body)";
+%typemap(lout) SWIGTYPE "(let* ((address $body)\n (ACL_result (make-instance '$lclass :foreign-address address)))\n (unless (zerop address)\n (excl:schedule-finalization ACL_result #'$ldestructor))\n ACL_result)";
+
+%typemap(lisptype) bool "boolean";
%typemap(lisptype) char "character";
-%typemap(ffitype) unsigned char ":unsigned-char";
%typemap(lisptype) unsigned char "integer";
-%typemap(ffitype) signed char ":char";
%typemap(lisptype) signed char "integer";
-%typemap(ffitype) short ":short";
-%typemap(ffitype) signed short ":short";
+
+%typemap(ffitype) bool ":int";
+%typemap(ffitype) char ":char";
+%typemap(ffitype) unsigned char ":unsigned-char";
+%typemap(ffitype) signed char ":char";
+%typemap(ffitype) short, signed short ":short";
%typemap(ffitype) unsigned short ":unsigned-short";
-%typemap(ffitype) int ":int";
-%typemap(ffitype) signed int ":int";
+%typemap(ffitype) int, signed int ":int";
%typemap(ffitype) unsigned int ":unsigned-int";
-%typemap(ffitype) long ":long";
-%typemap(ffitype) signed long ":long";
+%typemap(ffitype) long, signed long ":long";
%typemap(ffitype) unsigned long ":unsigned-long";
%typemap(ffitype) float ":float";
%typemap(ffitype) double ":double";
%typemap(ffitype) char * "(* :char)";
%typemap(ffitype) void * "(* :void)";
%typemap(ffitype) void ":void";
+%typemap(ffitype) enum SWIGTYPE ":int";
+%typemap(ffitype) SWIGTYPE & "(* :void)";
-%wrapper %{
+%typemap(ctype) bool "int";
+%typemap(ctype) char, unsigned char, signed char,
+ short, signed short, unsigned short,
+ int, signed int, unsigned int,
+ long, signed long, unsigned long,
+ float, double, long double, char *, void *, void,
+ enum SWIGTYPE, SWIGTYPE *,
+ SWIGTYPE[ANY], SWIGTYPE & "$1_ltype";
+%typemap(ctype) SWIGTYPE "$&1_type";
+
+%typemap(in) bool "$1 = (bool)$input;";
+%typemap(in) char, unsigned char, signed char,
+ short, signed short, unsigned short,
+ int, signed int, unsigned int,
+ long, signed long, unsigned long,
+ float, double, long double, char *, void *, void,
+ enum SWIGTYPE, SWIGTYPE *,
+ SWIGTYPE[ANY], SWIGTYPE & "$1 = $input;";
+%typemap(in) SWIGTYPE "$1 = *$input;";
+
+/* We don't need to do any actual C-side typechecking, but need to
+ use the precedence values to choose which overloaded function
+ interfaces to generate when conflicts arise. */
+
+/* predefined precedence values
+
+Symbolic Name Precedence Value
+------------------------------ ------------------
+SWIG_TYPECHECK_POINTER 0
+SWIG_TYPECHECK_VOIDPTR 10
+SWIG_TYPECHECK_BOOL 15
+SWIG_TYPECHECK_UINT8 20
+SWIG_TYPECHECK_INT8 25
+SWIG_TYPECHECK_UINT16 30
+SWIG_TYPECHECK_INT16 35
+SWIG_TYPECHECK_UINT32 40
+SWIG_TYPECHECK_INT32 45
+SWIG_TYPECHECK_UINT64 50
+SWIG_TYPECHECK_INT64 55
+SWIG_TYPECHECK_UINT128 60
+SWIG_TYPECHECK_INT128 65
+SWIG_TYPECHECK_INTEGER 70
+SWIG_TYPECHECK_FLOAT 80
+SWIG_TYPECHECK_DOUBLE 90
+SWIG_TYPECHECK_COMPLEX 100
+SWIG_TYPECHECK_UNICHAR 110
+SWIG_TYPECHECK_UNISTRING 120
+SWIG_TYPECHECK_CHAR 130
+SWIG_TYPECHECK_STRING 140
+SWIG_TYPECHECK_BOOL_ARRAY 1015
+SWIG_TYPECHECK_INT8_ARRAY 1025
+SWIG_TYPECHECK_INT16_ARRAY 1035
+SWIG_TYPECHECK_INT32_ARRAY 1045
+SWIG_TYPECHECK_INT64_ARRAY 1055
+SWIG_TYPECHECK_INT128_ARRAY 1065
+SWIG_TYPECHECK_FLOAT_ARRAY 1080
+SWIG_TYPECHECK_DOUBLE_ARRAY 1090
+SWIG_TYPECHECK_CHAR_ARRAY 1130
+SWIG_TYPECHECK_STRING_ARRAY 1140
+*/
+
+%typecheck(SWIG_TYPECHECK_BOOL) bool { $1 = 1; };
+%typecheck(SWIG_TYPECHECK_CHAR) char { $1 = 1; };
+%typecheck(SWIG_TYPECHECK_FLOAT) float { $1 = 1; };
+%typecheck(SWIG_TYPECHECK_DOUBLE) double { $1 = 1; };
+%typecheck(SWIG_TYPECHECK_STRING) char * { $1 = 1; };
+%typecheck(SWIG_TYPECHECK_INTEGER)
+ unsigned char, signed char,
+ short, signed short, unsigned short,
+ int, signed int, unsigned int,
+ long, signed long, unsigned long,
+ enum SWIGTYPE { $1 = 1; };
+%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &,
+ SWIGTYPE[ANY], SWIGTYPE { $1 = 1; };
+
+/* This maps C/C++ types to Lisp classes for overload dispatch */
+
+%typemap(lispclass) bool "t";
+%typemap(lispclass) char "character";
+%typemap(lispclass) unsigned char, signed char,
+ short, signed short, unsigned short,
+ int, signed int, unsigned int,
+ long, signed long, unsigned long,
+ enum SWIGTYPE "integer";
+%typemap(lispclass) float "single-float";
+%typemap(lispclass) double "double-float";
+%typemap(lispclass) char * "string";
+
+%typemap(out) bool "$result = (int)$1;";
+%typemap(out) char, unsigned char, signed char,
+ short, signed short, unsigned short,
+ int, signed int, unsigned int,
+ long, signed long, unsigned long,
+ float, double, long double, char *, void *, void,
+ enum SWIGTYPE, SWIGTYPE *,
+ SWIGTYPE[ANY], SWIGTYPE & "$result = $1;";
+%typemap(out) SWIGTYPE "$result = new $1_type($1);";
+
+//////////////////////////////////////////////////////////////
+// UCS-2 string conversion
+
+// should this be SWIG_TYPECHECK_CHAR?
+%typecheck(SWIG_TYPECHECK_UNICHAR) wchar_t { $1 = 1; };
+
+%typemap(in) wchar_t "$1 = $input;";
+%typemap(lin) wchar_t "(let (($out (char-code $in)))\n $body)";
+%typemap(lin) wchar_t* "(excl:with-native-string ($out $in
+:external-format #+little-endian :fat-le #-little-endian :fat)\n
+$body)"
+
+%typemap(out) wchar_t "$result = $1;";
+%typemap(lout) wchar_t "(code-char $body)";
+%typemap(lout) wchar_t* "(excl:native-to-string $body
+:external-format #+little-endian :fat-le #-little-endian :fat)";
+
+%typemap(ffitype) wchar_t ":unsigned-short";
+%typemap(lisptype) wchar_t "";
+%typemap(ctype) wchar_t "wchar_t";
+%typemap(lispclass) wchar_t "character";
+%typemap(lispclass) wchar_t* "string";
+//////////////////////////////////////////////////////////////
+
+/* name conversion for overloaded operators. */
+#ifdef __cplusplus
+%rename(__add__) *::operator+;
+%rename(__pos__) *::operator+();
+%rename(__pos__) *::operator+() const;
+
+%rename(__sub__) *::operator-;
+%rename(__neg__) *::operator-() const;
+%rename(__neg__) *::operator-();
+
+%rename(__mul__) *::operator*;
+%rename(__deref__) *::operator*();
+%rename(__deref__) *::operator*() const;
+
+%rename(__div__) *::operator/;
+%rename(__mod__) *::operator%;
+%rename(__logxor__) *::operator^;
+%rename(__logand__) *::operator&;
+%rename(__logior__) *::operator|;
+%rename(__lognot__) *::operator~();
+%rename(__lognot__) *::operator~() const;
+
+%rename(__not__) *::operator!();
+%rename(__not__) *::operator!() const;
+
+%rename(__assign__) *::operator=;
+
+%rename(__add_assign__) *::operator+=;
+%rename(__sub_assign__) *::operator-=;
+%rename(__mul_assign__) *::operator*=;
+%rename(__div_assign__) *::operator/=;
+%rename(__mod_assign__) *::operator%=;
+%rename(__logxor_assign__) *::operator^=;
+%rename(__logand_assign__) *::operator&=;
+%rename(__logior_assign__) *::operator|=;
+
+%rename(__lshift__) *::operator<<;
+%rename(__lshift_assign__) *::operator<<=;
+%rename(__rshift__) *::operator>>;
+%rename(__rshift_assign__) *::operator>>=;
+
+%rename(__eq__) *::operator==;
+%rename(__ne__) *::operator!=;
+%rename(__lt__) *::operator<;
+%rename(__gt__) *::operator>;
+%rename(__lte__) *::operator<=;
+%rename(__gte__) *::operator>=;
+
+%rename(__and__) *::operator&&;
+%rename(__or__) *::operator||;
+
+%rename(__preincr__) *::operator++();
+%rename(__postincr__) *::operator++(int);
+%rename(__predecr__) *::operator--();
+%rename(__postdecr__) *::operator--(int);
+
+%rename(__comma__) *::operator,();
+%rename(__comma__) *::operator,() const;
+
+%rename(__member_ref__) *::operator->;
+%rename(__member_func_ref__) *::operator->*;
+
+%rename(__funcall__) *::operator();
+%rename(__aref__) *::operator[];
+#endif
+
+%insert("lisphead") %{
;; $Id$
(eval-when (compile eval)
;;; You can define your own identifier converter if you want.
;;; Use the -identifier-converter command line argument to
-;;; specify its name.
-
-(defun identifier-convert-null (id &key type)
- (declare (ignore type))
- (read-from-string id))
+;;; specify its name.
-(defun identifier-convert-lispify (cname &key type)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (defparameter *swig-export-list* nil))
+
+(defun read-symbol-from-string (string)
+ (multiple-value-bind (result position)
+ (read-from-string string nil "eof" :preserve-whitespace t)
+ (if (and (symbolp result) (eql position (length string)))
+ result
+ (intern string))))
+
+(defun full-name (id type arity class)
+ (case type
+ (:getter (format nil "~@[~A_~]~A" class id))
+ (:constructor (format nil "new_~A~@[~A~]" id arity))
+ (:destructor (format nil "delete_~A" id))
+ (:type (format nil "ff_~A" id))
+ (:ff-operator (format nil "ffi_~A" id))
+ (otherwise (format nil "~@[~A_~]~A~@[~A~]"
+ class id arity))))
+
+(defun identifier-convert-null (id &key type class arity)
+ (if (eq type :setter)
+ `(setf ,(identifier-convert-null
+ id :type :getter :class class :arity arity))
+ (read-symbol-from-string (full-name id type arity class))))
+
+(defun identifier-convert-lispify (cname &key type class arity)
(assert (stringp cname))
+ (when (eq type :setter)
+ (return-from identifier-convert-lispify
+ `(setf ,(identifier-convert-lispify
+ cname :type :getter :class class :arity arity))))
+ (setq cname (full-name cname type arity class))
(if (eq type :constant)
(setf cname (format nil "*~A*" cname)))
(setf cname (replace-regexp cname "_" "-"))
@@ -54,7 +285,7 @@
(when (or (and (eq lastcase :upper) (eq newcase :lower))
(and (eq lastcase :lower) (eq newcase :upper)))
- ;; case change... add a dash
+ ;; case change... add a dash
(push #\- res)
(setf newcase :other))
@@ -65,26 +296,191 @@
else
(push char res)
(setf lastcase :other)))
- (read-from-string (coerce (nreverse res) 'string))))
+ (read-symbol-from-string (coerce (nreverse res) 'string))))
+
+(defun id-convert-and-export (name &rest kwargs)
+ (multiple-value-bind (symbol package)
+ (apply *swig-identifier-converter* name kwargs)
+ (let ((args (list (if (consp symbol) (cadr symbol) symbol)
+ (or package *package*))))
+ (apply #'export args)
+ (pushnew args swig::*swig-export-list*))
+ symbol))
+
+(defmacro swig-insert-id (name namespace &key (type :type) class)
+ `(let ((*package* (find-package ,(package-name-for-namespace namespace))))
+ (id-convert-and-export ,name :type ,type :class ,class)))
(defmacro swig-defconstant (string value)
- (let ((symbol (funcall *swig-identifier-converter* string :type :constant)))
+ (let ((symbol (id-convert-and-export string :type :constant)))
`(eval-when (compile load eval)
- (defconstant ,symbol ,value)
- (export (quote ,symbol)))))
+ (defconstant ,symbol ,value))))
-(defmacro swig-defun (name &rest rest)
- (let ((symbol (funcall *swig-identifier-converter* name :type :operator)))
+(defun maybe-reorder-args (funcname arglist)
+ ;; in the foreign setter function the new value will be the last argument
+ ;; in Lisp it needs to be the first
+ (if (consp funcname)
+ (append (last arglist) (butlast arglist))
+ arglist))
+
+(defun maybe-return-value (funcname arglist)
+ ;; setf functions should return the new value
+ (when (consp funcname)
+ `(,(if (consp (car arglist))
+ (caar arglist)
+ (car arglist)))))
+
+(defun swig-anyvarargs-p (arglist)
+ (member :SWIG__varargs_ arglist))
+
+(defmacro swig-defun ((name &optional (mangled-name name)
+ &key (type :operator) class arity)
+ ffargs kwargs
+ &body body)
+ (let* ((symbol (id-convert-and-export name :type type
+ :arity arity :class class))
+ (mangle (if* (eq name mangled-name)
+ then (id-convert-and-export
+ (cond ((eq type :setter) (format nil "~A-set" name))
+ ((eq type :getter) (format nil "~A-get" name))
+ (t name))
+ :type :ff-operator :arity arity :class class)
+ else (intern mangled-name)))
+ (defun-args (maybe-reorder-args
+ symbol
+ (mapcar #'car (and (not (equal ffargs '(:void)))
+ ffargs))
+ ))
+ )
+ (when (swig-anyvarargs-p ffargs)
+ (setq ffargs '()))
`(eval-when (compile load eval)
(excl::compiler-let ((*record-xref-info* nil))
- (ff:def-foreign-call (,symbol ,name) ,@rest)
- (export (quote ,symbol))))))
+ (ff:def-foreign-call (,mangle ,mangled-name) ,ffargs ,@kwargs))
+ (macrolet ((swig-ff-call (&rest args)
+ (cons ',mangle args)))
+ (defun ,symbol ,defun-args
+ ,@body
+ ,@(maybe-return-value symbol defun-args))))))
-(defmacro swig-def-foreign-type (name &rest rest)
- (let ((symbol (funcall *swig-identifier-converter* name :type :type)))
+(defmacro swig-defmethod ((name &optional (mangled-name name)
+ &key (type :operator) class arity)
+ ffargs kwargs
+ &body body)
+ (let* ((symbol (id-convert-and-export name :type type
+ :arity arity :class class))
+ (mangle (intern mangled-name))
+ (defmethod-args (maybe-reorder-args
+ symbol
+ (unless (equal ffargs '(:void))
+ (loop for (name dispatch) in ffargs
+ collect `(,name ,dispatch)))))
+ (ffargs (if (equal ffargs '(:void))
+ ffargs
+ (loop for (name nil . ffi) in ffargs
+ collect `(,name ,@ffi)))))
+ `(eval-when (compile load eval)
+ (excl::compiler-let ((*record-xref-info* nil))
+ (ff:def-foreign-call (,mangle ,mangled-name) ,ffargs ,@kwargs))
+ (macrolet ((swig-ff-call (&rest args)
+ (cons ',mangle args)))
+ (defmethod ,symbol ,defmethod-args
+ ,@body
+ ,@(maybe-return-value symbol defmethod-args))))))
+
+(defmacro swig-dispatcher ((name &key (type :operator) class arities))
+ (let ((symbol (id-convert-and-export name
+ :type type :class class)))
+ `(eval-when (compile load eval)
+ (defun ,symbol (&rest args)
+ (case (length args)
+ ,@(loop for arity in arities
+ for symbol-n = (id-convert-and-export name
+ :type type :class class :arity arity)
+ collect `(,arity (apply #',symbol-n args)))
+ (t (error "No applicable wrapper-methods for foreign call ~a with args ~a of classes ~a" ',symbol args (mapcar #'(lambda (x) (class-name (class-of x))) args)))
+ )))))
+
+(defmacro swig-def-foreign-stub (name)
+ (let ((lsymbol (id-convert-and-export name :type :class))
+ (symbol (id-convert-and-export name :type :type)))
+ `(eval-when (compile load eval)
+ (ff:def-foreign-type ,symbol (:class ))
+ (defclass ,lsymbol (ff:foreign-pointer) ()))))
+
+(defmacro swig-def-foreign-class (name supers &rest rest)
+ (let ((lsymbol (id-convert-and-export name :type :class))
+ (symbol (id-convert-and-export name :type :type)))
`(eval-when (compile load eval)
(ff:def-foreign-type ,symbol ,@rest)
- (export (quote ,symbol)))))
+ (defclass ,lsymbol ,supers
+ ((foreign-type :initform ',symbol :initarg :foreign-type
+ :accessor foreign-pointer-type))))))
+
+(defmacro swig-def-foreign-type (name &rest rest)
+ (let ((symbol (id-convert-and-export name :type :type)))
+ `(eval-when (compile load eval)
+ (ff:def-foreign-type ,symbol ,@rest))))
+
+(defmacro swig-def-synonym-type (synonym of ff-synonym)
+ `(eval-when (compile load eval)
+ (setf (find-class ',synonym) (find-class ',of))
+ (ff:def-foreign-type ,ff-synonym (:struct ))))
+
+(defun package-name-for-namespace (namespace)
+ (list-to-delimited-string
+ (cons *swig-module-name*
+ (mapcar #'(lambda (name)
+ (string
+ (funcall *swig-identifier-converter*
+ name
+ :type :namespace)))
+ namespace))
+ "."))
+
+(defmacro swig-defpackage (namespace)
+ (let* ((parent-namespaces (maplist #'reverse (cdr (reverse namespace))))
+ (parent-strings (mapcar #'package-name-for-namespace
+ parent-namespaces))
+ (string (package-name-for-namespace namespace)))
+ `(eval-when (compile load eval)
+ (defpackage ,string
+ (:use :common-lisp :ff :swig :excl
+ ,@parent-strings ,*swig-module-name*)))))
+
+(defmacro swig-in-package (namespace)
+ `(eval-when (compile load eval)
+ (in-package ,(package-name-for-namespace namespace))))
+
+(defmacro swig-defvar (name mangled-name &key type)
+ (let ((symbol (id-convert-and-export name :type type)))
+ `(eval-when (compile load eval)
+ (ff:def-foreign-variable (,symbol ,mangled-name)))))
) ;; eval-when
+
+(eval-when (compile eval)
+ (flet ((starts-with-p (str prefix)
+ (and (>= (length str) (length prefix))
+ (string= str prefix :end1 (length prefix)))))
+ (export (loop for sym being each present-symbol of *package*
+ when (or (starts-with-p (symbol-name sym) (symbol-name :swig-))
+ (starts-with-p (symbol-name sym) (symbol-name :identifier-convert-)))
+ collect sym))))
+
+(in-package #.*swig-module-name*)
+%}
+
+
+
+%{
+
+#ifdef __cplusplus
+# define EXTERN extern "C"
+#else
+# define EXTERN extern
+#endif
+
+#define EXPORT EXTERN SWIGEXPORT
+
%}
diff --git a/Source/Modules/allegrocl.cxx b/Source/Modules/allegrocl.cxx
index c68a44049..32e2657a3 100644
--- a/Source/Modules/allegrocl.cxx
+++ b/Source/Modules/allegrocl.cxx
@@ -1,29 +1,1547 @@
char cvsroot_allegrocl_cxx[] = "$Header$";
+#include -procdoc
@@ -546,7 +546,7 @@ like this:
typemap argument doc. See Lib/guile/typemaps.i for
details.
-18.9 Procedures with setters
+20.9 Procedures with setters
(struct-member-get
pointer) and (struct-member-set pointer
value) are not generated.
-18.10 GOOPS Proxy Classes
+20.10 GOOPS Proxy Classes
%import "foo.h" before the %inline block.
18.10.1 Naming Issues
+20.10.1 Naming Issues
18.10.2 Linking
+20.10.2 Linking
19 SWIG and Java
+21 SWIG and Java
@@ -146,7 +146,7 @@ It covers most SWIG features, but certain low-level details are covered in less
-
19.1 Overview
+21.1 Overview
19.2 Preliminaries
+21.2 Preliminaries
19.2.1 Running SWIG
+21.2.1 Running SWIG
19.2.2 Additional Commandline Options
+21.2.2 Additional Commandline Options
19.2.3 Getting the right header files
+21.2.3 Getting the right header files
19.2.4 Compiling a dynamic module
+21.2.4 Compiling a dynamic module
19.2.5 Using your module
+21.2.5 Using your module
19.2.6 Dynamic linking problems
+21.2.6 Dynamic linking problems
19.2.7 Compilation problems and compiling with C++
+21.2.7 Compilation problems and compiling with C++
19.2.8 Building on Windows
+21.2.8 Building on Windows
19.2.8.1 Running SWIG from Visual Studio
+21.2.8.1 Running SWIG from Visual Studio
19.2.8.2 Using NMAKE
+21.2.8.2 Using NMAKE
19.3 A tour of basic C/C++ wrapping
+21.3 A tour of basic C/C++ wrapping
19.3.1 Modules, packages and generated Java classes
+21.3.1 Modules, packages and generated Java classes
19.3.2 Functions
+21.3.2 Functions
19.3.3 Global variables
+21.3.3 Global variables
19.3.4 Constants
+21.3.4 Constants
19.3.5 Enumerations
+21.3.5 Enumerations
19.3.5.1 Anonymous enums
+21.3.5.1 Anonymous enums
19.3.5.2 Typesafe enums
+21.3.5.2 Typesafe enums
19.3.5.3 Proper Java enums
+21.3.5.3 Proper Java enums
19.3.5.4 Type unsafe enums
+21.3.5.4 Type unsafe enums
19.3.5.5 Simple enums
+21.3.5.5 Simple enums
19.3.6 Pointers
+21.3.6 Pointers
19.3.7 Structures
+21.3.7 Structures
19.3.8 C++ classes
+21.3.8 C++ classes
19.3.9 C++ inheritance
+21.3.9 C++ inheritance
19.3.10 Pointers, references, arrays and pass by value
+21.3.10 Pointers, references, arrays and pass by value
19.3.10.1 Null pointers
+21.3.10.1 Null pointers
19.3.11 C++ overloaded functions
+21.3.11 C++ overloaded functions
19.3.12 C++ default arguments
+21.3.12 C++ default arguments
19.3.13 C++ namespaces
+21.3.13 C++ namespaces
19.3.14 C++ templates
+21.3.14 C++ templates
19.3.15 C++ Smart Pointers
+21.3.15 C++ Smart Pointers
19.4 Further details on the generated Java classes
+21.4 Further details on the generated Java classes
19.4.1 The intermediary JNI class
+21.4.1 The intermediary JNI class
19.4.1.1 The intermediary JNI class pragmas
+21.4.1.1 The intermediary JNI class pragmas
19.4.2 The Java module class
+21.4.2 The Java module class
19.4.2.1 The Java module class pragmas
+21.4.2.1 The Java module class pragmas
19.4.3 Java proxy classes
+21.4.3 Java proxy classes
19.4.3.1 Memory management
+21.4.3.1 Memory management
19.4.3.2 Inheritance
+21.4.3.2 Inheritance
21.4.3.3 Proxy classes and garbage collection
19.4.4 Type wrapper classes
+21.4.4 Type wrapper classes
19.4.5 Enum classes
+21.4.5 Enum classes
19.4.5.1 Typesafe enum classes
+21.4.5.1 Typesafe enum classes
19.4.5.2 Proper Java enum classes
+21.4.5.2 Proper Java enum classes
19.4.5.3 Type unsafe enum classes
+21.4.5.3 Type unsafe enum classes
19.5 Cross language polymorphism using directors (experimental)
+21.5 Cross language polymorphism using directors (experimental)
19.5.1 Enabling directors
+21.5.1 Enabling directors
19.5.2 Director classes
+21.5.2 Director classes
19.5.3 Overhead and code bloat
+21.5.3 Overhead and code bloat
19.5.4 Simple directors example
+21.5.4 Simple directors example
19.6 Common customization features
+21.6 Common customization features
19.6.1 C/C++ helper functions
+21.6.1 C/C++ helper functions
19.6.2 Class extension with %extend
+21.6.2 Class extension with %extend
19.6.3 Exception handling with %exception and %javaexception
+21.6.3 Exception handling with %exception and %javaexception
19.6.4 Method access with %javamethodmodifiers
+21.6.4 Method access with %javamethodmodifiers
19.7 Tips and techniques
+21.7 Tips and techniques
19.7.1 Input and output parameters using primitive pointers and references
+21.7.1 Input and output parameters using primitive pointers and references
19.7.2 Simple pointers
+21.7.2 Simple pointers
19.7.3 Wrapping C arrays with Java arrays
+21.7.3 Wrapping C arrays with Java arrays
19.7.4 Unbounded C Arrays
+21.7.4 Unbounded C Arrays
19.8 Java typemaps
+21.8 Java typemaps
19.8.1 Default primitive type mappings
+21.8.1 Default primitive type mappings
19.8.2 Sixty four bit JVMs
+21.8.2 Sixty four bit JVMs
19.8.3 What is a typemap?
+21.8.3 What is a typemap?
19.8.4 Typemaps for mapping C/C++ types to Java types
+21.8.4 Typemaps for mapping C/C++ types to Java types
19.8.5 Java typemap attributes
+21.8.5 Java typemap attributes
19.8.6 Java special variables
+21.8.6 Java special variables
19.8.7 Typemaps for both C and C++ compilation
+21.8.7 Typemaps for both C and C++ compilation
19.8.8 Java code typemaps
+21.8.8 Java code typemaps
19.8.9 Director specific typemaps
+21.8.9 Director specific typemaps
19.9 Typemap Examples
+21.9 Typemap Examples
19.9.1 Simpler Java enums for enums without initializers
+21.9.1 Simpler Java enums for enums without initializers
19.9.2 Handling C++ exception specifications as Java exceptions
+21.9.2 Handling C++ exception specifications as Java exceptions
19.9.3 NaN Exception - exception handling for a particular type
+21.9.3 NaN Exception - exception handling for a particular type
19.9.4 Converting Java String arrays to char **
+21.9.4 Converting Java String arrays to char **
19.9.5 Expanding a Java object to multiple arguments
+21.9.5 Expanding a Java object to multiple arguments
19.9.6 Using typemaps to return arguments
+21.9.6 Using typemaps to return arguments
19.9.7 Adding Java downcasts to polymorphic return types
+21.9.7 Adding Java downcasts to polymorphic return types
19.9.8 Adding an equals method to the Java classes
+21.9.8 Adding an equals method to the Java classes
19.9.9 Void pointers and a common Java base class
+21.9.9 Void pointers and a common Java base class
19.9.10 Struct pointer to pointer
+21.9.10 Struct pointer to pointer
19.9.11 Memory management when returning references to member variables
+21.9.11 Memory management when returning references to member variables
19.9.12 Memory management for objects passed to the C++ layer
+21.9.12 Memory management for objects passed to the C++ layer
19.10 Living with Java Directors
+21.10 Living with Java Directors
19.11 Odds and ends
+21.11 Odds and ends
-19.11.1 JavaDoc comments
+21.11.1 JavaDoc comments
19.11.2 Functional interface without proxy classes
+21.11.2 Functional interface without proxy classes
19.11.3 Using your own JNI functions
+21.11.3 Using your own JNI functions
19.11.4 Performance concerns and hints
+21.11.4 Performance concerns and hints
19.12 Examples
+21.12 Examples
30 SWIG and Common Lisp
+16 SWIG and Common Lisp
30.1 Allegro Common Lisp
+16.1 Allegro Common Lisp
+
+
30.2 CLISP
+
+
+16.2 CLISP
+
+
30.2.1 Additional Commandline Options
+16.2.1 Additional Commandline Options
+
-30.2.2 Details on CLISP bindings
+16.2.2 Details on CLISP bindings
+
30.3 UFFI
+16.3 UFFI
+
+
29 SWIG and Lua
+31 SWIG and Lua
@@ -49,7 +49,7 @@
29.1 Preliminaries
+31.1 Preliminaries
29.2 Running SWIG
+31.2 Running SWIG
29.2.1 Compiling and Linking and Interpreter
+31.2.1 Compiling and Linking and Interpreter
29.2.2 Compiling a dynamic module
+31.2.2 Compiling a dynamic module
29.2.3 Using your module
+31.2.3 Using your module
29.3 A tour of basic C/C++ wrapping
+31.3 A tour of basic C/C++ wrapping
29.3.1 Modules
+31.3.1 Modules
29.3.2 Functions
+31.3.2 Functions
29.3.3 Global variables
+31.3.3 Global variables
29.3.4 Constants and enums
+31.3.4 Constants and enums
29.3.5 Pointers
+31.3.5 Pointers
29.3.6 Structures
+31.3.6 Structures
29.3.7 C++ classes
+31.3.7 C++ classes
29.3.8 C++ inheritance
+31.3.8 C++ inheritance
29.3.9 Pointers, references, values, and arrays
+31.3.9 Pointers, references, values, and arrays
29.3.10 C++ overloaded functions
+31.3.10 C++ overloaded functions
29.3.11 C++ operators
+31.3.11 C++ operators
29.3.12 Class extension with %extend
+31.3.12 Class extension with %extend
29.3.13 C++ templates
+31.3.13 C++ templates
29.3.14 C++ Smart Pointers
+31.3.14 C++ Smart Pointers
29.4 Details on the Lua binding
+31.4 Details on the Lua binding
29.4.1 Binding global data into the module.
+31.4.1 Binding global data into the module.
29.4.2 Userdata and Metatables
+31.4.2 Userdata and Metatables
29.4.3 Memory management
+31.4.3 Memory management
20 SWIG and Modula-3
+22 SWIG and Modula-3
@@ -57,7 +57,7 @@ especially
typemaps.
-
20.1 Overview
+22.1 Overview
20.1.1 Why not scripting ?
+22.1.1 Why not scripting ?
20.1.2 Why Modula-3 ?
+22.1.2 Why Modula-3 ?
20.1.3 Why C / C++ ?
+22.1.3 Why C / C++ ?
20.1.4 Why SWIG ?
+22.1.4 Why SWIG ?
20.2 Conception
+22.2 Conception
-20.2.1 Interfaces to C libraries
+22.2.1 Interfaces to C libraries
20.2.2 Interfaces to C++ libraries
+22.2.2 Interfaces to C++ libraries
20.3 Preliminaries
+22.3 Preliminaries
-20.3.1 Compilers
+22.3.1 Compilers
20.3.2 Additional Commandline Options
+22.3.2 Additional Commandline Options
20.4 Modula-3 typemaps
+22.4 Modula-3 typemaps
-20.4.1 Inputs and outputs
+22.4.1 Inputs and outputs
20.4.2 Subranges, Enumerations, Sets
+22.4.2 Subranges, Enumerations, Sets
20.4.3 Objects
+22.4.3 Objects
20.4.4 Imports
+22.4.4 Imports
20.4.5 Exceptions
+22.4.5 Exceptions
20.4.6 Example
+22.4.6 Example
20.5 More hints to the generator
+22.5 More hints to the generator
-20.5.1 Features
+22.5.1 Features
@@ -1029,7 +1029,7 @@ where almost everything is generated by a typemap:
-20.5.2 Pragmas
+22.5.2 Pragmas
@@ -1052,7 +1052,7 @@ where almost everything is generated by a typemap:
-20.6 Remarks
+22.6 Remarks
diff --git a/Doc/Manual/Mzscheme.html b/Doc/Manual/Mzscheme.html
index fb29ab887..191ef6f94 100644
--- a/Doc/Manual/Mzscheme.html
+++ b/Doc/Manual/Mzscheme.html
@@ -8,7 +8,7 @@
-
21 SWIG and MzScheme
+23 SWIG and MzScheme
@@ -22,7 +22,7 @@
21.1 Creating native MzScheme structures
+23.1 Creating native MzScheme structures
22 SWIG and Ocaml
+24 SWIG and Ocaml
@@ -80,7 +80,7 @@ If you're not familiar with the Objective Caml language, you can visit
The Ocaml Website.
-
22.1 Preliminaries
+24.1 Preliminaries
22.1.1 Running SWIG
+24.1.1 Running SWIG
22.1.2 Compiling the code
+24.1.2 Compiling the code
22.1.3 The camlp4 module
+24.1.3 The camlp4 module
22.1.4 Using your module
+24.1.4 Using your module
22.1.5 Compilation problems and compiling with C++
+24.1.5 Compilation problems and compiling with C++
22.2 The low-level Ocaml/C interface
+24.2 The low-level Ocaml/C interface
22.2.1 The generated module
+24.2.1 The generated module
22.2.2 Enums
+24.2.2 Enums
22.2.2.1 Enum typing in Ocaml
+24.2.2.1 Enum typing in Ocaml
22.2.3 Arrays
+24.2.3 Arrays
-22.2.3.1 Simple types of bounded arrays
+24.2.3.1 Simple types of bounded arrays
22.2.3.2 Complex and unbounded arrays
+24.2.3.2 Complex and unbounded arrays
22.2.3.3 Using an object
+24.2.3.3 Using an object
22.2.3.4 Example typemap for a function taking float * and int
+24.2.3.4 Example typemap for a function taking float * and int
22.2.4 C++ Classes
+24.2.4 C++ Classes
22.2.4.1 STL vector and string Example
+24.2.4.1 STL vector and string Example
22.2.4.2 C++ Class Example
+24.2.4.2 C++ Class Example
22.2.4.3 Compiling the example
+24.2.4.3 Compiling the example
@@ -743,7 +743,7 @@ bash-2.05a$ ocamlmktop -custom swig.cmo -I `camlp4 -where` \
-L$QTPATH/lib -cclib -lqt
22.2.4.4 Sample Session
+24.2.4.4 Sample Session
@@ -770,10 +770,10 @@ Assuming you have a working installation of QT, you will see a window
containing the string "hi" in a button.
-
22.2.5 Director Classes
+24.2.5 Director Classes
-22.2.5.1 Director Introduction
+24.2.5.1 Director Introduction
22.2.5.2 Overriding Methods in Ocaml
+24.2.5.2 Overriding Methods in Ocaml
22.2.5.3 Director Usage Example
+24.2.5.3 Director Usage Example
@@ -887,7 +887,7 @@ in a more effortless style in ocaml, while leaving the "engine" part of the
program in C++.
-
22.2.5.4 Creating director objects
+24.2.5.4 Creating director objects
22.2.5.5 Typemaps for directors, directorin, directorout, directorargout
+24.2.5.5 Typemaps for directors, directorin, directorout, directorargout
22.2.5.6 directorin typemap
+24.2.5.6 directorin typemap
22.2.5.7 directorout typemap
+24.2.5.7 directorout typemap
22.2.5.8 directorargout typemap
+24.2.5.8 directorargout typemap
22.2.6 Exceptions
+24.2.6 Exceptions
23 SWIG and Perl5
+25 SWIG and Perl5
@@ -86,7 +86,7 @@ later. Earlier versions are problematic and SWIG generated extensions
may not compile or run correctly.
-
23.1 Overview
+25.1 Overview
23.2 Preliminaries
+25.2 Preliminaries
23.2.1 Getting the right header files
+25.2.1 Getting the right header files
23.2.2 Compiling a dynamic module
+25.2.2 Compiling a dynamic module
23.2.3 Building a dynamic module with MakeMaker
+25.2.3 Building a dynamic module with MakeMaker
23.2.4 Building a static version of Perl
+25.2.4 Building a static version of Perl
23.2.5 Using the module
+25.2.5 Using the module
23.2.6 Compilation problems and compiling with C++
+25.2.6 Compilation problems and compiling with C++
23.2.7 Compiling for 64-bit platforms
+25.2.7 Compiling for 64-bit platforms
23.3 Building Perl Extensions under Windows
+25.3 Building Perl Extensions under Windows
23.3.1 Running SWIG from Developer Studio
+25.3.1 Running SWIG from Developer Studio
23.3.2 Using other compilers
+25.3.2 Using other compilers
23.4 The low-level interface
+25.4 The low-level interface
23.4.1 Functions
+25.4.1 Functions
23.4.2 Global variables
+25.4.2 Global variables
23.4.3 Constants
+25.4.3 Constants
23.4.4 Pointers
+25.4.4 Pointers
23.4.5 Structures
+25.4.5 Structures
23.4.6 C++ classes
+25.4.6 C++ classes
23.4.7 C++ classes and type-checking
+25.4.7 C++ classes and type-checking
23.4.8 C++ overloaded functions
+25.4.8 C++ overloaded functions
23.4.9 Operators
+25.4.9 Operators
23.4.10 Modules and packages
+25.4.10 Modules and packages
23.5 Input and output parameters
+25.5 Input and output parameters
23.6 Exception handling
+25.6 Exception handling
23.7 Remapping datatypes with typemaps
+25.7 Remapping datatypes with typemaps
23.7.1 A simple typemap example
+25.7.1 A simple typemap example
23.7.2 Perl5 typemaps
+25.7.2 Perl5 typemaps
23.7.3 Typemap variables
+25.7.3 Typemap variables
23.7.4 Useful functions
+25.7.4 Useful functions
23.8 Typemap Examples
+25.8 Typemap Examples
23.8.1 Converting a Perl5 array to a char **
+25.8.1 Converting a Perl5 array to a char **
23.8.2 Return values
+25.8.2 Return values
23.8.3 Returning values from arguments
+25.8.3 Returning values from arguments
23.8.4 Accessing array structure members
+25.8.4 Accessing array structure members
23.8.5 Turning Perl references into C pointers
+25.8.5 Turning Perl references into C pointers
23.8.6 Pointer handling
+25.8.6 Pointer handling
23.9 Proxy classes
+25.9 Proxy classes
23.9.1 Preliminaries
+25.9.1 Preliminaries
23.9.2 Structure and class wrappers
+25.9.2 Structure and class wrappers
23.9.3 Object Ownership
+25.9.3 Object Ownership
23.9.4 Nested Objects
+25.9.4 Nested Objects
23.9.5 Proxy Functions
+25.9.5 Proxy Functions
23.9.6 Inheritance
+25.9.6 Inheritance
23.9.7 Modifying the proxy methods
+25.9.7 Modifying the proxy methods
24 SWIG and PHP4
+26 SWIG and PHP4
@@ -66,7 +66,7 @@ extension into php directly (without having the overhead of loading it into
each script), you will need the complete PHP source tree available.
-
-24.1 Generating PHP4 Extensions
+26.1 Generating PHP4 Extensions
24.1.1 Building a loadable extension
+26.1.1 Building a loadable extension
24.1.2 Building extensions into PHP
+26.1.2 Building extensions into PHP
24.1.3 Using PHP4 Extensions
+26.1.3 Using PHP4 Extensions
24.2 Basic PHP4 interface
+26.2 Basic PHP4 interface
24.2.1 Constants
+26.2.1 Constants
24.2.2 Global Variables
+26.2.2 Global Variables
24.2.3 Functions
+26.2.3 Functions
24.2.4 Overloading
+26.2.4 Overloading
24.2.5 Pointers and References
+26.2.5 Pointers and References
24.2.6 Structures and C++ classes
+26.2.6 Structures and C++ classes
24.2.6.1 Using -noproxy
+26.2.6.1 Using -noproxy
24.2.6.2 Constructors and Destructors
+26.2.6.2 Constructors and Destructors
24.2.6.3 Static Member Variables
+26.2.6.3 Static Member Variables
24.2.6.4 Static Member Functions
+26.2.6.4 Static Member Functions
24.2.7 PHP4 Pragmas, Startup and Shutdown code
+26.2.7 PHP4 Pragmas, Startup and Shutdown code
25 SWIG and Pike
+27 SWIG and Pike
@@ -46,10 +46,10 @@ least, make sure you read the "SWIG Basics"
chapter.
-25.1 Preliminaries
+27.1 Preliminaries
-25.1.1 Running SWIG
+27.1.1 Running SWIG
$ swig -pike -o pseudonym.c example.i
25.1.2 Getting the right header files
+27.1.2 Getting the right header files
25.1.3 Using your module
+27.1.3 Using your module
25.2 Basic C/C++ Mapping
+27.2 Basic C/C++ Mapping
-25.2.1 Modules
+27.2.1 Modules
25.2.2 Functions
+27.2.2 Functions
25.2.3 Global variables
+27.2.3 Global variables
25.2.4 Constants and enumerated types
+27.2.4 Constants and enumerated types
25.2.5 Constructors and Destructors
+27.2.5 Constructors and Destructors
25.2.6 Static Members
+27.2.6 Static Members
26 SWIG and Python
+28 SWIG and Python
@@ -126,7 +126,7 @@ very least, make sure you read the "SWIG
Basics" chapter.
-
26.1 Overview
+28.1 Overview
26.2 Preliminaries
+28.2 Preliminaries
-26.2.1 Running SWIG
+28.2.1 Running SWIG
26.2.2 Getting the right header files
+28.2.2 Getting the right header files
26.2.3 Compiling a dynamic module
+28.2.3 Compiling a dynamic module
26.2.4 Using distutils
+28.2.4 Using distutils
-26.2.5 Static linking
+28.2.5 Static linking
26.2.6 Using your module
+28.2.6 Using your module
26.2.7 Compilation of C++ extensions
+28.2.7 Compilation of C++ extensions
26.2.8 Compiling for 64-bit platforms
+28.2.8 Compiling for 64-bit platforms
26.2.9 Building Python Extensions under Windows
+28.2.9 Building Python Extensions under Windows
28.3 A tour of basic C/C++ wrapping
26.3.1 Modules
+28.3.1 Modules
26.3.2 Functions
+28.3.2 Functions
26.3.3 Global variables
+28.3.3 Global variables
26.3.4 Constants and enums
+28.3.4 Constants and enums
26.3.5 Pointers
+28.3.5 Pointers
26.3.6 Structures
+28.3.6 Structures
26.3.7 C++ classes
+28.3.7 C++ classes
26.3.8 C++ inheritance
+28.3.8 C++ inheritance
26.3.9 Pointers, references, values, and arrays
+28.3.9 Pointers, references, values, and arrays
26.3.10 C++ overloaded functions
+28.3.10 C++ overloaded functions
26.3.11 C++ operators
+28.3.11 C++ operators
26.3.12 C++ namespaces
+28.3.12 C++ namespaces
26.3.13 C++ templates
+28.3.13 C++ templates
26.3.14 C++ Smart Pointers
+28.3.14 C++ Smart Pointers
26.3.15 C++ Reference Counted Objects (ref/unref)
+28.3.15 C++ Reference Counted Objects (ref/unref)
26.4 Further details on the Python class interface
+28.4 Further details on the Python class interface
26.4.1 Proxy classes
+28.4.1 Proxy classes
26.4.2 Memory management
+28.4.2 Memory management
26.4.3 Python 2.2 and classic classes
+28.4.3 Python 2.2 and classic classes
26.5 Cross language polymorphism
+28.5 Cross language polymorphism
26.5.1 Enabling directors
+28.5.1 Enabling directors
26.5.2 Director classes
+28.5.2 Director classes
@@ -2597,7 +2597,7 @@ so there is no need for the extra overhead involved with routing the
calls through Python.
-26.5.3 Ownership and object destruction
+28.5.3 Ownership and object destruction
26.5.4 Exception unrolling
+28.5.4 Exception unrolling
26.5.5 Overhead and code bloat
+28.5.5 Overhead and code bloat
26.5.6 Typemaps
+28.5.6 Typemaps
26.5.7 Miscellaneous
+28.5.7 Miscellaneous
26.6 Common customization features
+28.6 Common customization features
26.6.1 C/C++ helper functions
+28.6.1 C/C++ helper functions
26.6.2 Adding additional Python code
+28.6.2 Adding additional Python code
26.6.3 Class extension with %extend
+28.6.3 Class extension with %extend
26.6.4 Exception handling with %exception
+28.6.4 Exception handling with %exception
26.7 Tips and techniques
+28.7 Tips and techniques
26.7.1 Input and output parameters
+28.7.1 Input and output parameters
26.7.2 Simple pointers
+28.7.2 Simple pointers
26.7.3 Unbounded C Arrays
+28.7.3 Unbounded C Arrays
26.7.4 String handling
+28.7.4 String handling
26.7.5 Arrays
+28.7.5 Arrays
-26.7.6 String arrays
+28.7.6 String arrays
-26.7.7 STL wrappers
+28.7.7 STL wrappers
-26.8 Typemaps
+28.8 Typemaps
26.8.1 What is a typemap?
+28.8.1 What is a typemap?
26.8.2 Python typemaps
+28.8.2 Python typemaps
26.8.3 Typemap variables
+28.8.3 Typemap variables
26.8.4 Useful Python Functions
+28.8.4 Useful Python Functions
26.9 Typemap Examples
+28.9 Typemap Examples
26.9.1 Converting Python list to a char **
+28.9.1 Converting Python list to a char **
26.9.2 Expanding a Python object into multiple arguments
+28.9.2 Expanding a Python object into multiple arguments
26.9.3 Using typemaps to return arguments
+28.9.3 Using typemaps to return arguments
26.9.4 Mapping Python tuples into small arrays
+28.9.4 Mapping Python tuples into small arrays
26.9.5 Mapping sequences to C arrays
+28.9.5 Mapping sequences to C arrays
26.9.6 Pointer handling
+28.9.6 Pointer handling
26.10 Docstring Features
+28.10 Docstring Features
26.10.1 Module docstring
+28.10.1 Module docstring
26.10.2 %feature("autodoc")
+28.10.2 %feature("autodoc")
26.10.2.1 %feature("autodoc", "0")
+28.10.2.1 %feature("autodoc", "0")
26.10.2.2 %feature("autodoc", "1")
+28.10.2.2 %feature("autodoc", "1")
26.10.2.3 %feature("autodoc", "docstring")
+28.10.2.3 %feature("autodoc", "docstring")
26.10.3 %feature("docstring")
+28.10.3 %feature("docstring")
26.11 Python Packages
+28.11 Python Packages
27 SWIG and Ruby
+29 SWIG and Ruby
@@ -223,7 +223,7 @@
27.1 Preliminaries
+29.1 Preliminaries
27.1.1 Running SWIG
+29.1.1 Running SWIG
27.1.2 Getting the right header files
+29.1.2 Getting the right header files
/usr/local/lib/ruby/site_ruby/1.6 /usr/
/usr/local/lib/ruby/site_ruby /usr/local/lib/ruby/1.6 /usr/local/lib/ruby/1.6/i686-linux .
-27.1.3 Compiling a dynamic module
+29.1.3 Compiling a dynamic module
/usr/local/lib/ruby/site_ruby/1.6 /usr/
27.1.4 Using your module
+29.1.4 Using your module
/usr/local/lib/ruby/site_ruby/1.6 /usr/
will result in an extension module using the feature name "example" and Ruby
module name "Example".
27.1.5 Static linking
+29.1.5 Static linking
/usr/local/lib/ruby/site_ruby/1.6 /usr/
to the list of extensions in the file, and finally rebuilding Ruby.
27.1.6 Compilation of C++ extensions
+29.1.6 Compilation of C++ extensions
/usr/local/lib/ruby/site_ruby/1.6 /usr/
require 'mkmf'
$libs = append_library($libs, "supc++")
create_makefile('example')27.2 Building Ruby Extensions under Windows 95/NT
+29.2 Building Ruby Extensions under Windows 95/NT
/usr/local/lib/ruby/site_ruby/1.6 /usr/
will need the Ruby header files.
27.2.1 Running SWIG from Developer Studio
+29.2.1 Running SWIG from Developer Studio
/usr/local/lib/ruby/site_ruby/1.6 /usr/
C:\swigtest> ruby run.rb
Foo = 3.027.3 The Ruby-to-C/C++ Mapping
+29.3 The Ruby-to-C/C++ Mapping
27.3.1 Modules
+29.3.1 Modules
/usr/local/lib/ruby/site_ruby/1.6 /usr/
global module, take care that the names of your constants, classes and methods
don't conflict with any of Ruby's built-in names.
27.3.2 Functions
+29.3.2 Functions
/usr/local/lib/ruby/site_ruby/1.6 /usr/
$ irb
irb(main):001:0> require 'example'
true
irb(main):002:0> Example.fact(4)
2427.3.3 Variable Linking
+29.3.3 Variable Linking
/usr/local/lib/ruby/site_ruby/1.6 /usr/
The %immutable directive stays in effect until it is explicitly
disabled using %mutable.
27.3.4 Constants
+29.3.4 Constants
/usr/local/lib/ruby/site_ruby/1.6 /usr/
$ irb
irb(main):001:0> require 'Example'
true
irb(main):002:0> Example::PI
3.1415927.3.5 Pointers
+29.3.5 Pointers
/usr/local/lib/ruby/site_ruby/1.6 /usr/
27.3.6 Structures
+29.3.6 Structures
/usr/local/lib/ruby/site_ruby/1.6 /usr/
Foo *Bar_f_get(Bar *b) {
return &b->f;
}
void Bar_f_set(Bar *b, Foo *val) {
b->f = *val;
}27.3.7 C++ classes
+29.3.7 C++ classes
/usr/local/lib/ruby/site_ruby/1.6 /usr/
require 'Example'
l = Example::List.new
l.insert("Ale")
l.insert("Stout")
l.insert("Lager")
Example.print(l)
l.length()
----- produces the following output
Lager
Stout
Ale
327.3.8 C++ Inheritance
+29.3.8 C++ Inheritance
/usr/local/lib/ruby/site_ruby/1.6 /usr/
will otherwise behave as though they inherit from both Base1 and Base2
(i.e. they exhibit "Duck Typing").
27.3.9 C++ Overloaded Functions
+29.3.9 C++ Overloaded Functions
/usr/local/lib/ruby/site_ruby/1.6 /usr/
27.3.10 C++ Operators
+29.3.10 C++ Operators
/usr/local/lib/ruby/site_ruby/1.6 /usr/
More details about wrapping C++ operators into Ruby operators is discussed in
the section on operator overloading.
27.3.11 C++ namespaces
+29.3.11 C++ namespaces
/usr/local/lib/ruby/site_ruby/1.6 /usr/
namespaces each with identical symbol names, well, then you get what you
deserve.
27.3.12 C++ templates
+29.3.12 C++ templates
/usr/local/lib/ruby/site_ruby/1.6 /usr/
examples. More details can be found in the SWIG
and C++ chapter.
27.3.13 C++ Smart Pointers
+29.3.13 C++ Smart Pointers
/usr/local/lib/ruby/site_ruby/1.6 /usr/
irb(main):004:0> f = p.__deref__() # Returns underlying Foo *
27.3.14 Cross-Language Polymorphism
+29.3.14 Cross-Language Polymorphism
/usr/local/lib/ruby/site_ruby/1.6 /usr/
this section just notes the differences that you need to be aware of when using
this feature with Ruby.
27.3.14.1 Exception Unrolling
+29.3.14.1 Exception Unrolling
/usr/local/lib/ruby/site_ruby/1.6 /usr/
Ruby exception is raised, it will be caught here and a C++ exception is raised
in its place.
27.4 Input and output parameters
+29.4 Input and output parameters
/usr/local/lib/ruby/site_ruby/1.6 /usr/
the standard Ruby exception classes, consult a Ruby reference such as
Programming Ruby.
27.5 Typemaps
+29.5 Typemaps
/usr/local/lib/ruby/site_ruby/1.6 /usr/
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 primitive C-Ruby
interface.27.5.1 What is a typemap?
+29.5.1 What is a typemap?
/usr/local/lib/ruby/site_ruby/1.6 /usr/
puts Example.count('o','Hello World')
227.5.2 Ruby typemaps
+29.5.2 Ruby typemaps
/usr/local/lib/ruby/site_ruby/1.6 /usr/
Examples of these typemaps appears in the section
on typemap examples
27.5.3 Typemap variables
+29.5.3 Typemap variables
Within a typemap, a number of special variables prefaced with a $ may
@@ -1382,7 +1382,7 @@ $ ruby -e 'puts $:.join("\n")'
/usr/local/lib/ruby/site_ruby/1.6 /usr/
27.5.4 Useful Functions
+29.5.4 Useful Functions
/usr/local/lib/ruby/site_ruby/1.6 /usr/
by David Thomas and Andrew Hunt.)
27.5.4.1 C Datatypes to Ruby Objects
+29.5.4.1 C Datatypes to Ruby Objects
INT2NUM(long or int) - int to Fixnum or Bignum
INT2FIX(long or int) - int to Fixnum (faster than INT2NUM)
CHR2FIX(char) - char to Fixnum
rb_str_new2(char*) - char* to String
rb_float_new(double) - double to Float27.5.4.2 Ruby Objects to C Datatypes
+29.5.4.2 Ruby Objects to C Datatypes
int NUM2INT(Numeric)
int FIX2INT(Numeric)
unsigned int NUM2UINT(Numeric)
unsigned int FIX2UINT(Numeric)
long NUM2LONG(Numeric)
long FIX2LONG(Numeric)
unsigned long FIX2ULONG(Numeric)
char NUM2CHR(Numeric or String)
char * STR2CSTR(String)
char * rb_str2cstr(String, int*length)
double NUM2DBL(Numeric)27.5.4.3 Macros for VALUE
+29.5.4.3 Macros for VALUE
/usr/local/lib/ruby/site_ruby/1.6 /usr/
27.5.4.4 Exceptions
+29.5.4.4 Exceptions
/usr/local/lib/ruby/site_ruby/1.6 /usr/
with the -w flag. The given format string fmt and remaining
arguments are interpreted as with printf().
-27.5.4.5 Iterators
+29.5.4.5 Iterators
/usr/local/lib/ruby/site_ruby/1.6 /usr/
27.5.5 Typemap Examples
+29.5.5 Typemap Examples
27.5.6 Converting a Ruby array to a char **
+29.5.6 Converting a Ruby array to a char **
/usr/local/lib/ruby/site_ruby/1.6 /usr/
allocation is used to allocate memory for the array, the "freearg" typemap is
used to later release this memory after the execution of the C function.
27.5.7 Collecting arguments in a hash
+29.5.7 Collecting arguments in a hash
/usr/local/lib/ruby/site_ruby/1.6 /usr/
the extension, can be found in the Examples/ruby/hashargs directory of
the SWIG distribution.
27.5.8 Pointer handling
+29.5.8 Pointer handling
/usr/local/lib/ruby/site_ruby/1.6 /usr/
%typemap(in) Foo * {
SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
}27.5.8.1 Ruby Datatype Wrapping
+29.5.8.1 Ruby Datatype Wrapping
/usr/local/lib/ruby/site_ruby/1.6 /usr/
27.6 Operator overloading
+29.6 Operator overloading
/usr/local/lib/ruby/site_ruby/1.6 /usr/
defining an equivalence operator, there is no separate method for handling inequality
since Ruby parses the expression a != b as !(a == b).
27.6.1 Example: STL Vector to Ruby Array
+29.6.1 Example: STL Vector to Ruby Array
/usr/local/lib/ruby/site_ruby/1.6 /usr/
%define VECTOR_TO_RUBY_ARRAY(vectorclassname, classname)
%typemap(ruby, out) vectorclassname &, const vectorclassname & {
VALUE arr = rb_ary_new2($1->size());
vectorclassname::iterator i = $1->begin(), iend = $1->end();
for ( ; i!=iend; i++ )
rb_ary_push(arr, Data_Wrap_Struct(c ## classname.klass, 0, 0, &(*i)));
$result = arr;
}
%typemap(ruby, out) vectorclassname, const vectorclassname {
VALUE arr = rb_ary_new2($1.size());
vectorclassname::iterator i = $1.begin(), iend = $1.end();
for ( ; i!=iend; i++ )
rb_ary_push(arr, Data_Wrap_Struct(c ## classname.klass, 0, 0, &(*i)));
$result = arr;
}
%enddef27.7 Advanced Topics
+29.7 Advanced Topics
-27.7.1 Creating Multi-Module Packages
+29.7.1 Creating Multi-Module Packages
/usr/local/lib/ruby/site_ruby/1.6 /usr/
$ irb
irb(main):001:0> require 'shape'
true
irb(main):002:0> require 'circle'
true
irb(main):003:0> c = Circle::Circle.new(5, 5, 20)
#<Circle::Circle:0xa097208>
irb(main):004:0> c.kind_of? Shape::Shape
true
irb(main):005:0> c.getX()
5.027.7.2 Defining Aliases
+29.7.2 Defining Aliases
/usr/local/lib/ruby/site_ruby/1.6 /usr/
mechanism and so the same name matching rules used for other kinds of features
apply (see the chapter on "Customization
Features") for more details).27.7.3 Predicate Methods
+29.7.3 Predicate Methods
/usr/local/lib/ruby/site_ruby/1.6 /usr/
of features apply (see the chapter on "Customization
Features") for more details).
27.7.4 Specifying Mixin Modules
+29.7.4 Specifying Mixin Modules
/usr/local/lib/ruby/site_ruby/1.6 /usr/
apply (see the chapter on "Customization
Features") for more details).
27.8 Memory Management
+29.8 Memory Management
/usr/local/lib/ruby/site_ruby/1.6 /usr/
allocated in creating the underlying C struct or C++ struct, then a "free"
function must be defined that deallocates this memory.
27.8.1 Object Ownership
+29.8.1 Object Ownership
/usr/local/lib/ruby/site_ruby/1.6 /usr/
-27.8.2 Object Tracking
+29.8.2 Object Tracking
/usr/local/lib/ruby/site_ruby/1.6 /usr/
implement your own free functions (see below) you may also have to call theSWIG_RubyRemoveTracking
and RubyUnlinkObjects methods.27.8.3 Mark Functions
+29.8.3 Mark Functions
/usr/local/lib/ruby/site_ruby/1.6 /usr/
27.8.4 Free Functions
+29.8.4 Free Functions
28 SWIG and Tcl
+30 SWIG and Tcl
@@ -82,7 +82,7 @@ Tcl 8.0 or a later release. Earlier releases of SWIG supported Tcl 7.x, but
this is no longer supported.
-
28.1 Preliminaries
+30.1 Preliminaries
28.1.1 Getting the right header files
+30.1.1 Getting the right header files
28.1.2 Compiling a dynamic module
+30.1.2 Compiling a dynamic module
28.1.3 Static linking
+30.1.3 Static linking
28.1.4 Using your module
+30.1.4 Using your module
28.1.5 Compilation of C++ extensions
+30.1.5 Compilation of C++ extensions
28.1.6 Compiling for 64-bit platforms
+30.1.6 Compiling for 64-bit platforms
28.1.7 Setting a package prefix
+30.1.7 Setting a package prefix
28.1.8 Using namespaces
+30.1.8 Using namespaces
28.2 Building Tcl/Tk Extensions under Windows 95/NT
+30.2 Building Tcl/Tk Extensions under Windows 95/NT
28.2.1 Running SWIG from Developer Studio
+30.2.1 Running SWIG from Developer Studio
28.2.2 Using NMAKE
+30.2.2 Using NMAKE
28.3 A tour of basic C/C++ wrapping
+30.3 A tour of basic C/C++ wrapping
28.3.1 Modules
+30.3.1 Modules
28.3.2 Functions
+30.3.2 Functions
28.3.3 Global variables
+30.3.3 Global variables
28.3.4 Constants and enums
+30.3.4 Constants and enums
28.3.5 Pointers
+30.3.5 Pointers
28.3.6 Structures
+30.3.6 Structures
28.3.7 C++ classes
+30.3.7 C++ classes
28.3.8 C++ inheritance
+30.3.8 C++ inheritance
28.3.9 Pointers, references, values, and arrays
+30.3.9 Pointers, references, values, and arrays
28.3.10 C++ overloaded functions
+30.3.10 C++ overloaded functions
28.3.11 C++ operators
+30.3.11 C++ operators
28.3.12 C++ namespaces
+30.3.12 C++ namespaces
28.3.13 C++ templates
+30.3.13 C++ templates
28.3.14 C++ Smart Pointers
+30.3.14 C++ Smart Pointers
28.4 Further details on the Tcl class interface
+30.4 Further details on the Tcl class interface
28.4.1 Proxy classes
+30.4.1 Proxy classes
28.4.2 Memory management
+30.4.2 Memory management
28.5 Input and output parameters
+30.5 Input and output parameters
28.6 Exception handling
+30.6 Exception handling
28.7 Typemaps
+30.7 Typemaps
28.7.1 What is a typemap?
+30.7.1 What is a typemap?
28.7.2 Tcl typemaps
+30.7.2 Tcl typemaps
28.7.3 Typemap variables
+30.7.3 Typemap variables
28.7.4 Converting a Tcl list to a char **
+30.7.4 Converting a Tcl list to a char **
28.7.5 Returning values in arguments
+30.7.5 Returning values in arguments
28.7.6 Useful functions
+30.7.6 Useful functions
28.7.7 Standard typemaps
+30.7.7 Standard typemaps
28.7.8 Pointer handling
+30.7.8 Pointer handling
28.8 Turning a SWIG module into a Tcl Package.
+30.8 Turning a SWIG module into a Tcl Package.
28.9 Building new kinds of Tcl interfaces (in Tcl)
+30.9 Building new kinds of Tcl interfaces (in Tcl)
28.9.1 Proxy classes
+30.9.1 Proxy classes