The %import directive
The %include directive



A SWIG example
About the Examples (Python)
About the examples (Tcl)
Accessing array data (Python)
Accessing array structure members (Java)
Accessing array structure members (Perl)
Accessing array structure members (Python)
Accessing arrays (Tcl)
Accessing arrays and other strange objects (Perl)
Accessing member data (Tcl)
Adding member functions to C structures
Adding native Python functions to a SWIG module (Python)
Adding new methods
Additional Commandline Options (Java)
Additional SWIG options (Tcl)
Advanced Topics
Applying constraints to input values
Applying constraints to new datatypes
Applying exception handlers to specific datatypes.
Array handling
Array members
Arrays
Automated shadow class generation (Java)
Automated shadow class generation (Python)
Basic Perl interface (Perl)
Basic Tcl Interface (Tcl)
Basic Type Handling
Binary trees in Tcl (Tcl)
A brief rant about const-correctness
A brief word about const
Bug reports
Building a C data structure in Tcl (Tcl)
Building a dynamic module with MakeMaker (Perl)
Building a loadable extension (Php)
Building a Perl5 interface to MATLAB (Perl)
Building a Perl5 module
Building a Python module
Building a simple 2D imaging class (Python)
Building a simple OpenGL module (Tcl)
Building a static version of Perl (Perl)
Building an object oriented C interface (Tcl)
Building C/C++ data structures with Tk (Tcl)
Building extension into php (Php)
Building Java Extensions under Windows 95/NT (Java)
Building large multi-module systems (Python)
Building libraries and modules
Building new kinds of Tcl interfaces (in Tcl) (Tcl)
Building Perl Extensions under Windows 95/NT (Perl)
Building PHP4 Extensions (Php)
Building Python Extensions under Windows 95/NT (Python)
Building Ruby Extensions under Windows 95/NT (Ruby)
Building scripting language extensions
Building swig.exe on Windows
Building Tcl/Tk Extensions under Windows 95/NT (Tcl)
C constructors and destructors
C files (Tcl)
C Preprocessor
C syntax, but not a C compiler
C++ Classes (Java)
C++ Classes (Python)
C++ Classes (Tcl)
The C++ code (Python)
C++ example
C++ support
Changing member data (Tcl)
Character strings and structures
Checking out library files
Code Insertion
Code insertion blocks
Combining Tcl/Tk Extensions (Tcl)
Comments
Common typemap methods
Compilation problems (Tcl)
Compilation problems and compiling with C++ (Java)
Compilation problems and compiling with C++ (Perl)
Compilation problems and compiling with C++ (Python)
Compiling a dynamic module (Java)
Compiling a dynamic module (Perl)
Compiling a dynamic module (Python)
Compiling a dynamic module (Ruby)
Compiling a dynamic module (Unix) (Tcl)
Compiling modules with shadow classes (Java)
Compiling modules with shadow classes (Python)
A complete application (Python)
Conditional Compilation
Configuration management with SWIG (Tcl)
Constants
Constants
Constants (Java)
Constants (Perl)
Constants (Python)
Constants (Tcl)
Constraint methods
Constructors and destructors
Constructors and destructors (Java)
Constructors and Destructors (Python)
Converting a Tcl list to a char ** (Tcl)
Converting Python list to a char ** (Python)
Converting a Perl5 array to a char ** (Perl)
Converting a Python file object to a FILE * (Python)
Converting Java String arrays to char ** (Java)
Copying a typemap
Creating a new package initialization library (Tcl)
Creating a new typemap
Creating Library Files
Creating local variables
Creating multi-module packages
Creating new objects (Tcl)
Creating read-only variables
Credits
Default type mapping (Java)
The default typemaps
Default/optional arguments
Defining different exception handlers
Deleting a typemap
Deleting objects (Tcl)
Deprecated pragmas (Java)
Derived types, structs, and classes
Documentation not yet written
Documentation System
Documentation that has not yet been updated
Documentation updated to SWIG-1.3
Dynamic linking problems (Java)
Dynamic loading (Tcl)
Dynamic Loading of C++ modules
Enums (Java)
Enums and constants
Examples (Java)
Exception Handling
Exception handling (Java)
Exception handling (Perl)
Exception handling (Python)
Exception handling (Tcl)
Exception Handling (Guile)
Exception handling with %exception
Exception handling with longjmp()
Extending and fixing the gd module (Python)
Extending SWIG
Extending the Tcl Netscape Plugin (Tcl)
Features and the %feature directive
A few dynamic loading gotchas
A few helper functions (Tcl)
File imports
File inclusion
From C to SWIG to Python (Python)
Functions (Java)
Functions (Perl)
Functions (Python)
Functions (Tcl)
G SWIG and Guile
Generated class (Java)
Getting even more serious about array access (Python)
Getting serious (Perl)
Getting started on Windows
Getting the right header files
Getting the right header files (Java)
Getting the right header files (Perl)
Getting the right header files (Python)
Getting the right header files and libraries (Tcl)
Global Variables
Global variables (Perl)
Global variables (Tcl)
Global variables and functions (Java)
The gory details of shadow classes (Java)
The gory details of shadow classes (Python)
The gory details on shadow classes (Perl)
Graphical Web-Statistics in Perl5 (Perl)
Graphs (Perl)
Handling C++ exceptions
Handling exceptions in C code
Handling output values (the easy way) (Perl)
Hands off code generation
High Level Overview
How does a scripting language talk to C?
How to avoid creating the interface from hell
How to avoid reading the manual
Implementing C callback functions in Python (Python)
Implementing constraints with typemaps
Implementing methods in C (Tcl)
Implementing methods in Perl (Perl)
Implementing special Python methods in C (Python)
Including files on the command line
Inheritance
Inheritance (Perl)
Inheritance and shadow classes (Java)
Inheritance and shadow classes (Python)
Initialization blocks
Inlined code blocks
Input format
Input parameters
Input/Output parameters
Inside the SWIG type-checker
Installation on Windows
Instructions for using the Examples with other compilers
Instructions for using the Examples with Visual C++
An Interface Building Strategy
Introduction
Introduction
Introduction
Introduction
Invoking member functions (Tcl)
Iterators (Perl)
Java pragmas (Java)
Java shadow classes (Java)
Java typemaps (Java)
Known bugs (Java)
Library example
Limitations to this approach (Tcl)
Linkage (Guile)
Linking to char *
Linking to structure variables
Linking with shared libraries
Local scope
The low-level Java/C interface (Java)
The low-level Python/C interface (Python)
Macro Expansion
Making a quick a dirty Tcl module (Tcl)
Making a quick and dirty Python module (Python)
malloc.i
Managing input and output parameters
Mapping C structures into Tcl Lists (Tcl)
Mapping Python tuples into small arrays (Python)
A mathematical function plotter (Python)
The MATLAB engine interface (Perl)
Meaning of "Module" (Guile)
Member data
Member data (Java)
Member data (Python)
Member functions
Merging modules (Python)
Methods that return new objects (Java)
Methods that return new objects (Python)
Module and package names (Perl)
Module names (Python)
Modules (Java)
Modules (Python)
Modules, packages, and classes (Perl)
More about %apply and %clear
Multi-argument typemaps
Multiple files and the SWIG library
Name based type conversion (Java)
Name based type conversion (Perl)
Name based type conversion (Python)
Name based type conversion (Tcl)
Nested objects (Java)
Nested Objects (Perl)
Nested objects (Python)
Nested structures
Non-intrusive interface building
The object oriented interface (Tcl)
Object ownership (Java)
Object Ownership (Perl)
Object ownership (Python)
Object ownership and %newobject
An OpenGL package (Tcl)
Organization of this manual
Other odds and ends (Python)
Other Practicalities
Other things to note about structure wrapping
Output parameters
Parser Limitations
Partial class definitions
Passing structures by value
Performance concerns and disabling the object oriented interface (Tcl)
Performance concerns and hints (Java)
Performance concerns and hints (Python)
Performance of the type-checker
Perl5 typemaps (Perl)
Placing the files in the library
Plotting an unstructured mesh (Python)
Pointer handling (Java)
Pointer handling (Java)
Pointer handling (Perl)
Pointer handling (Python)
Pointer handling (Tcl)
Pointers (Java)
Pointers (Perl)
Pointers (Python)
Pointers (Tcl)
Pointers and complex objects
Pointers to functions and callbacks
Pointers to Members
Pointers, Constraints, and Typemaps
Pragma uses (Java)
Preface
Preliminaries (Java)
Preliminaries (Perl)
Preliminaries (Php)
Preliminaries (Python)
Preliminaries (Ruby)
Preliminaries (Tcl)
Preparing a C program for SWIG
Preparing a module (Python)
Preprocessing and %{ ... %} blocks
Preprocessing and { ... }
Prerequisites
Prerequisites
Printing (Python)
The Problem
Problems with the OpenGL interface (Tcl)
Procedure documentation (Guile)
Procedures with setters (Guile)
Protection
Putting it all together (Perl)
Putting it all together (Python)
Python shadow classes (Python)
Python typemaps (Python)
Rebuilding the Python interpreter (aka. static linking) (Python)
Reducing wrapper code size
References
Relationship with pointers (Tcl)
Remapping C datatypes with typemaps (Java)
Remapping C datatypes with typemaps (Python)
Remapping constants (Tcl)
Remapping datatypes with typemaps (Perl)
Renaming
Renaming and ignoring declarations
Required files (Tcl)
Return by value
Return values (Perl)
Returning values in arguments (Tcl)
Run time pointer type checking
The run-time type checker
Running SWIG
Running SWIG (Java)
Running SWIG (Perl)
Running SWIG (Python)
Running SWIG (Ruby)
Running SWIG (Tcl)
Running SWIG from Developer Studio (Java)
Running SWIG from Developer Studio (Perl)
Running SWIG from Developer Studio (Python)
Running SWIG from Developer Studio (Ruby)
Running SWIG from Developer Studio (Tcl)
Running the examples on Windows using Cygwin and Mingw
Runtime support (and potential problems)
Sample Perl Script (Perl)
Scripting Languages
Setting a package prefix (Tcl)
Shadow classes
Shadow classes (Perl)
Shadow classes (Tcl)
Shadow classes and garbage collection (Java)
Shadow Functions (Java)
Shadow Functions (Perl)
Shadow Functions (Python)
Shared libraries and dynamic loading
Shortcuts
Simple constraint example
A simple example (Java)
A simple example (Python)
A simple Perl example (Perl)
Simple pointers
A simple shadow class (Java)
A simple shadow class (Python)
A simple SWIG interface file (Perl)
A simple typemap example (Perl)
Smobs (Guile)
Solving a simple heat-equation (Python)
Special Introduction for Version 1.3
Special variables
Standard typemaps (Python)
Standard typemaps (Tcl)
Standard typemaps (Perl)
Static linking
Static linking (Tcl)
Static members
The step-by-step process for making a plugin extension. (Tcl)
Structures (Java)
Structures (Python)
Structures (Tcl)
Structures and C++ classes (Perl)
Structures and classes
Structures and unions
Summary (so far) (Python)
Supported C++ features
SWIG and Java
SWIG and Perl5
SWIG and Python
SWIG and Ruby
SWIG and Tcl
SWIG Basics
SWIG Directives
SWIG interface file
The SWIG library
SWIG Macros
SWIG on Cygwin and Mingw
SWIG Output
SWIG Preprocessor
SWIG resources
The SWIG runtime library
The SWIG type system
SWIG Users Manual
SWIG Versions
SWIG Windows Examples
Tcl typemaps (Tcl)
Tcl8.0 features (Tcl)
tclsh.i
Templates
The output of SWIG
The swig command
The SWIG interface file
The this pointer (Java)
The this pointer (Python)
Tips (Java)
To be continued... (Php)
Turning a SWIG module into a Tcl Package. (Tcl)
Turning Perl references into C pointers (Perl)
Two classes (Python)
The two language view of the world
Type casting
Type equivalence
Typedef
Typedef and structures
Typemap matching rules
Typemap Parameters
Typemap variables (Java)
Typemap variables (Perl)
Typemap variables (Python)
Typemap variables (Tcl)
Typemaps
Typemaps (Guile)
Typemaps (Tcl)
Typemaps for arrays
Undefined datatypes
Underscore Folding (Guile)
Use Python for control, C for performance (Python)
Use static linking (Python)
Useful functions (Perl)
Useful Functions (Python)
Useful functions (Tcl)
Using our new module (Python)
Using [incr Tcl] namespaces (Tcl)
Using a dynamic module (Tcl)
Using different names
Using dynamic loading (Python)
Using NMAKE (Java)
Using NMAKE (Perl)
Using NMAKE (Python)
Using NMAKE (Tcl)
Using the gd module (Python)
Using the OpenGL module (Tcl)
Using the plugin (Tcl)
Using The SWIG exception library
Using typemaps to return arguments (Java)
Using typemaps to return arguments (Python)
Using typemaps to return values (Perl)
Using your module (Java)
Using your module (Python)
Using your module (Ruby)
Variable linking
Variable Linking (Java)
Variable Linking (Python)
What gets created? (Perl)
What is a typemap?
What is a typemap? (Java)
What is a typemap? (Python)
What is a typemap? (Tcl)
What is SWIG?
What to do with main()
Where to go for more information (Java)
Where to go for more information (Python)
Where to go for more information?
Where to go from here? (Perl)
Why a name based approach?
Why doesn't C++ inheritance work between modules?
Why use separate interface files?
Why use SWIG?
Why write shadow classes in Java? (Java)
Why write shadow classes in Python? (Python)
Windows Executable
Working with library files
Wrapper functions
Wrapping a C library (Python)
Wrapping a library file
Wrapping C libraries and other packages (Perl)
Wrapping gl.h (Tcl)
Wrapping glu.h (Tcl)
Wrapping Overloaded Functions and Methods
Wrapping overloaded operators
Wrapping Simple C Declarations
Wrapping the aux library (Tcl)
Wrapping the MATLAB matrix functions (Perl)
Writing a main program and Tcl_AppInit() (Tcl)
Writing new typemaps
Writing typemap code