SWIG 1.1 Users Manual
Copyright
About this manual
Alphabetical Topic Index
Preface
Introduction
SWIG resources
About this manual
Credits
What's new?
Bug reports
SWIG is free
1 Introduction
What is SWIG?
Life before SWIG
Life after SWIG
The SWIG package
A SWIG example
C syntax, but not a C compiler
Non-intrusive interface building
Hands off code generation
Event driven C programming
Automatic documentation generation
Summary
SWIG for Windows and Macintosh
2 Scripting Languages
The two language view of the world
How does a scripting language talk to C?
Building scripting language extensions
Shared libraries and dynamic loading
3 SWIG Basics
Running SWIG
Simple C functions, variables, and constants
Pointers and complex objects
Getting down to business
Structures, unions, and object oriented C programming
C++ support
Objective-C
Conditional compilation
Code Insertion
A general interface building strategy
4 Multiple files and the SWIG library
The %include directive
The %extern directive
The %import directive
Including files on the command line
The SWIG library
Library example
Creating Library Files
Working with library files
Static initialization of multiple modules
More about the SWIG library
5 Documentation System
Introduction
How it works
Choosing a documentation format
Function usage and argument names
Titles, sections, and subsections
Formatting
Adding Additional Text
Disabling all documentation
An Example
ASCII Documentation
HTML Documentation
LaTeX Documentation
C++ Support
The Final Word?
6 Pointers, Constraints, and Typemaps
Introduction
The SWIG Pointer Library
Introduction to typemaps
Managing input and output parameters
Applying constraints to input values
Writing new typemaps
Common typemap methods
Writing typemap code
Typemaps for handling arrays
Typemaps and the SWIG Library
Implementing constraints with typemaps
Typemap examples
How to break everything with a typemap
Typemaps and the future
7 Exception Handling
The %except directive
Handling exceptions in C code
Exception handling with longjmp()
Handling C++ exceptions
Defining different exception handlers
Using The SWIG exception library
Debugging and other interesting uses for %except
More Examples
8 SWIG and Perl5
Preliminaries
Building Perl Extensions under Windows 95/NT
Modules, packages, and classes
Basic Perl interface
A simple Perl example
Accessing arrays and other strange objects
Implementing methods in Perl
Shadow classes
Getting serious
Wrapping C libraries and other packages
Building a Perl5 interface to MATLAB
Handling output values (the easy way)
Exception handling
Remapping datatypes with typemaps
The gory details on shadow classes
Where to go from here?
9 SWIG and Python
Preliminaries
Building Python Extensions under Windows 95/NT
The low-level Python/C interface
Python shadow classes
About the Examples
Solving a simple heat-equation
Wrapping a C library
Putting it all together
Exception handling
Remapping C datatypes with typemaps
Implementing C callback functions in Python
Other odds and ends
The gory details of shadow classes
10 SWIG and Tcl
Preliminaries
Building Tcl/Tk Extensions under Windows 95/NT
Basic Tcl Interface
The object oriented interface
About the examples
Binary trees in Tcl
Building C/C++ data structures with Tk
Accessing arrays
Building a simple OpenGL module
Exception handling
Typemaps
Configuration management with SWIG
Building new kinds of Tcl interfaces (in Tcl)
Extending the Tcl Netscape Plugin
Tcl8.0 features
11 Advanced Topics
Creating multi-module packages
Dynamic Loading of C++ modules
Inside the SWIG type-checker
12 Extending SWIG
Introduction
Compiling a SWIG extension
SWIG output
The Language class (simple version)
A tour of SWIG datatypes
Typemaps (from C)
File management
Naming Services
Code Generation Functions
Writing a Real Language Module
C++ Processing
Documentation Processing
The Future of SWIG
SWIG 1.1 - Last Modified : Mon Aug 4 10:47:18 1997