minor changes

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4626 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-03-25 18:48:50 +00:00
commit 413501cabb
9 changed files with 70 additions and 54 deletions

View file

@ -4,11 +4,11 @@ SWIG Features
<h2>SWIG Features</h2> <h2>SWIG Features</h2>
<p> <p>
This information is based on the current release, SWIG-1.3.16. This information is based on the current release, SWIG-1.3.18.
<h3>Code Generation</h3> <h3>Code Generation</h3>
SWIG current generates wrapper code for nine different target languages: SWIG current generates wrapper code for eleven different target languages:
<ul> <ul>
<li>Guile <li>Guile
@ -20,6 +20,8 @@ SWIG current generates wrapper code for nine different target languages:
<li>Python <li>Python
<li>Ruby <li>Ruby
<li>Tcl <li>Tcl
<li>Chicken
<li>C#
</ul> </ul>
In addition to this, an XML output module was recently added and work In addition to this, an XML output module was recently added and work
@ -63,8 +65,9 @@ SWIG provides wrapping support for almost all of ANSI C++.
The only major C++ feature not currently supported by SWIG is the The only major C++ feature not currently supported by SWIG is the
wrapping of nested classes--a problem we're working on. SWIG also wrapping of nested classes--a problem we're working on. SWIG also
does not allow C++ virtual methods to be implemented in the does not allow C++ virtual methods to be implemented in certain
target language (a subtle feature that might be useful in certain projects). target languages (a subtle feature that might be useful in projects that
rely heavily on the use of callback functions).
<p> <p>
C++ users who rely on advanced template programming techniques C++ users who rely on advanced template programming techniques

View file

@ -7,7 +7,7 @@ Proposed SWIG Copyright
<pre> <pre>
Simplified Wrapper and Interface Generator (SWIG) Simplified Wrapper and Interface Generator (SWIG)
Copyright (C) 1995-2000 Copyright (C) 1995-2003
The University of Chicago The University of Chicago
All Rights Reserved All Rights Reserved

View file

@ -7,7 +7,7 @@ SWIG Documentation, Presentations, and Papers
<H3>SWIG1.3</h3> <H3>SWIG1.3</h3>
<ul> <ul>
<li> <a href="Doc1.3/index.html">Development Documentation</a> for SWIG1.3.17. <li> <a href="Doc1.3/index.html">Development Documentation</a> for SWIG1.3.18.
<li> Also available in <a href="swigdoc.pdf">PDF</a> and <a href="swigdoc.ps">postscript</a> (SWIG-1.3.11). <li> Also available in <a href="swigdoc.pdf">PDF</a> and <a href="swigdoc.ps">postscript</a> (SWIG-1.3.11).
</ul> </ul>

View file

@ -5,63 +5,69 @@ Executive Summary
<p> <p>
SWIG is an interface compiler that connects programs written in C and SWIG is an interface compiler that connects programs written in C and
C++ with scripting languages including <a href="http://www.perl.org">Perl</a>, C++ with scripting languages such as Perl, Python, Ruby, and Tcl. It
<a href="http://www.python.org">Python</a>, and works by taking the declarations found in C/C++ header files and using
<a href="http://www.scriptics.com">Tcl/Tk</a>. It works by taking the declarations commonly found in C/C++ header them to generate the wrapper code that scripting languages need to
files and using them to generate the glue code (wrappers) that scripting access the underlying C/C++ code. In addition, SWIG provides a
languages need to access the underlying C/C++ code. variety of customization features that let you tailor the wrapping
process to suit your application.
<p> <p>
John Ousterhout has written a John Ousterhout (creator of Tcl) has written a
<a href="http://home.pacbell.net/ouster/scripting.html">paper</a> <a href="http://home.pacbell.net/ouster/scripting.html">paper</a>
that describes the that describes the
benefits of scripting languages. SWIG makes it fairly easy to connect scripting benefits of scripting languages. SWIG makes it fairly easy to connect scripting
languages with C/C++ code. languages with C/C++ code.
<p>You might use SWIG in a number of ways: <p>SWIG is used in a number of ways:
<ul> <ul>
<li><b>Building more powerful C/C++ programs</b>. Using SWIG, you can replace the main() <li><b>Building more powerful C/C++ programs</b>. Using SWIG, you can
function of a C program with a scripting interpreter from which you can control your replace the main() function of a C program with a scripting
application. This adds quite a lot of flexibility and makes it easier to build interpreter from which you can control the application. This adds
extensible programs. When combined with Tk, you can also build graphical user interfaces. quite a lot of flexibility and makes the program "programmable." That
is, the scripting interface allows users and developers to easily
modifiy the behavior of the program without having to modify low-level
C/C++ code. The benefits of this are numerous. In fact think of all
of the large software packages that you use every day---nearly all of
them include special a macro language, configuration language, or even
a scripting engine that allows users to make customizations.
<p> <p>
<li><b>Rapid prototyping and debugging</b>. SWIG allows C/C++ programs to be placed in <li><b>Rapid prototyping and debugging</b>. SWIG allows C/C++ programs to be placed in
a scripting environment that can be used for testing and debugging. a scripting environment that can be used for testing and debugging.
For example, you might test a library with a collection of scripts or use the scripting For example, you might test a library with a collection of scripts or use the scripting
interpreter as an interactive debugger. Since SWIG requires no modifications to the interpreter as an interactive debugger. Since SWIG requires no modifications to the
underlying C code, it can be used even if the final product does not rely upon scripting. underlying C/C++ code, it can be used even if the final product does not rely upon scripting.
<p> <p>
<li><b>Systems integration</b>. Scripting languages work fairly well for controlling and gluing <li><b>Systems integration</b>. Scripting languages work fairly well
software components together. With SWIG, different C/C++ programs can be turned into for controlling and gluing loosely-coupled software components
scripting language extension modules. These modules can then be combined together together. With SWIG, different C/C++ programs can be turned into
to create new and interesting applications. scripting language extension modules. These modules can then be
combined together to create new and interesting applications.
<p> <p>
<li><b>Construction of scripting language extension modules</b>. SWIG can <li><b>Construction of scripting language extension modules</b>. SWIG
be used to turn common C/C++ libraries into components for use in can be used to turn common C/C++ libraries into components for use in
popular scripting languages. However, before doing this, you might popular scripting languages. Of course, you will still want to make
want to do a search to see if someone else has already made sure that no-one else has already created a module before doing this.
such a module.
</ul> </ul>
SWIG is sometimes compared to interface definition language (IDL) SWIG is sometimes compared to interface definition language (IDL)
compilers such as those you would find with systems such as CORBA and compilers such as those you find with systems such as CORBA and COM.
COM. Although there are a few similarities, the whole point of SWIG Although there are a few similarities, the whole point of SWIG is to
is to make it so you don't have to add an extra layer of IDL specifications make it so you don't have to add an extra layer of IDL specifications
to your application. If anything, it's much more of a rapid application development and to your application. If anything, it's much more of a rapid
prototyping tool. Specifically: application development and prototyping tool. Specifically:
<p> <p>
<ul> <ul>
<li><b>ANSI C/C++ syntax</b>. SWIG parses a form of ANSI C <li><b>ANSI C/C++ syntax</b>. SWIG parses ANSI C++ that has been
syntax that has been extended with a number of special directives. extended with a number of special directives. As a result, interfaces
As a result, interfaces are usually built by grabbing a header file are usually built by grabbing a header file and tweaking it a little
and tweaking it a little bit. This particular approach is especially bit. This particular approach is especially useful when the
useful when the underlying C/C++ program undergoes frequent underlying C/C++ program undergoes frequent modification.
modification.
<p> <p>
<li><b>SWIG is not a stub generator</b>. SWIG produces code that you <li><b>SWIG is not a stub generator</b>. SWIG produces code that you
@ -83,23 +89,17 @@ its scripting interface.
<p> <p>
<li><b>Extensibility</b>. SWIG provides a variety of customization options that <li><b>Extensibility</b>. SWIG provides a variety of customization options that
allow you to blow your whole leg off. SWIG does not enforce any rules related to programming allow you to blow your whole leg off if that's what you want to do.
morality. SWIG is not here to enforce programming morality.
</ul> </ul>
It is also worth noting that even though SWIG is occasionally compared Finally, it is worth noting that even though SWIG is occasionally compared
to other more specialized scripting language extension building tools to other more specialized scripting language extension building tools
(e.g., Perl XS, Python bgen, etc.), its primary audience is C/C++ (e.g., Perl XS, Python bgen, etc.), its primary audience is C/C++
programmers who want to add a scripting language component to their programmers who want to add a scripting language component to their
applications. Because of this, SWIG tends to have a slightly applications. Because of this, SWIG tends to have a slightly
different focus than tools designed to build small modules for different focus than tools designed to build small modules for
widespread use in a scripting language distribution. By far, the most widespread use in a scripting language distribution. applications.
significant difference between SWIG and similar tools is that SWIG
implements the full C++ type system--with support for all C datatypes,
C++ classes, namespaces, and templates. By focusing on types, SWIG is
able to provide a high degree of reliability and it is able to handle
the wrapping of large-scale C/C++ code that appears in real
applications.
<p> <p>
A number of <a href="doc.html">papers and tutorials</a> describing SWIG are available. A number of <a href="doc.html">papers and tutorials</a> describing SWIG are available.
@ -110,8 +110,10 @@ in their <a href="projects.html">projects</a>.
<p> <p>
SWIG has been freely available in various forms since February, 1996 SWIG has been freely available in various forms since February, 1996
and a large number of developers have made contributions. Today, SWIG and a large number of developers have made contributions. Today, SWIG
remains an all-volunteer effort. Approximately 750 people subscribe remains an all-volunteer effort. Approximately 875 people subscribe
to the SWIG mailing list (swig@cs.uchicago.edu) and a public CVS to the SWIG mailing list (swig@cs.uchicago.edu) and a public CVS
repository is available at the University of Chicago. Over 12000 people repository is available at the University of Chicago. Versions of
downloaded the last SWIG release (SWIG-1.3.11). SWIG can now be found in most Linux distributions (however, you'll almost
certainly want to get the latest version here).

View file

@ -53,6 +53,7 @@ handling of overloaded functions added.
<li>September 9, 2002. SWIG-1.3.15 released. <li>September 9, 2002. SWIG-1.3.15 released.
<li>October 14, 2002. SWIG-1.3.16 released. <li>October 14, 2002. SWIG-1.3.16 released.
<li>November 22, 2002. SWIG-1.3.17 released. <li>November 22, 2002. SWIG-1.3.17 released.
<li>March 23, 2003. SWIG-1.3.18 released.
</ul> </ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

9
swigweb/screenshot2.ht Normal file
View file

@ -0,0 +1,9 @@
SWIG Screenshot
<p><img src="images/screen.png" alt="Screenshot">
<p><img src="images/screenshot2.png">
<p>
Much better than before, don't you think?

View file

@ -23,8 +23,9 @@ SWIG Subversion
</center> </center>
<p> <p>
<li>The ever-so-impressive SWIG <a href="screenshot.html">screenshot</a>. <li>The ever-so-impressive SWIG-1.1 <a href="screenshot.html">screenshot</a>.
<li><a href="visual.html">Visual SWIG 2000++</a>--the version for funding agents and managers. <li>An even more impressive <a href="screenshot2.html">screenshot</a> showing the new streamlined interface to SWIG-1.3.
<li><a href="visual.html">Visual SWIG 2002++ .NET</a>--the version for managers.
<li>The greatly simplified <a href="copyfun.html">copyright</a>. <li>The greatly simplified <a href="copyfun.html">copyright</a>.
</ul> </ul>

View file

@ -262,7 +262,7 @@ Now, compiling (Python):
<blockquote> <blockquote>
<pre> <pre>
$ swig -proxy -python -c++ pair.i $ swig -python -c++ pair.i
$ c++ -c pair_wrap.c -I/usr/local/include/python2.1 $ c++ -c pair_wrap.c -I/usr/local/include/python2.1
$ c++ -shared pair_wrap.o -o paircmodule.so $ c++ -shared pair_wrap.o -o paircmodule.so
$ python $ python