minor changes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4626 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
321cae599e
commit
413501cabb
9 changed files with 70 additions and 54 deletions
|
|
@ -4,11 +4,11 @@ SWIG Features
|
|||
<h2>SWIG Features</h2>
|
||||
|
||||
<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>
|
||||
|
||||
SWIG current generates wrapper code for nine different target languages:
|
||||
SWIG current generates wrapper code for eleven different target languages:
|
||||
|
||||
<ul>
|
||||
<li>Guile
|
||||
|
|
@ -20,6 +20,8 @@ SWIG current generates wrapper code for nine different target languages:
|
|||
<li>Python
|
||||
<li>Ruby
|
||||
<li>Tcl
|
||||
<li>Chicken
|
||||
<li>C#
|
||||
</ul>
|
||||
|
||||
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
|
||||
wrapping of nested classes--a problem we're working on. SWIG also
|
||||
does not allow C++ virtual methods to be implemented in the
|
||||
target language (a subtle feature that might be useful in certain projects).
|
||||
does not allow C++ virtual methods to be implemented in certain
|
||||
target languages (a subtle feature that might be useful in projects that
|
||||
rely heavily on the use of callback functions).
|
||||
|
||||
<p>
|
||||
C++ users who rely on advanced template programming techniques
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Proposed SWIG Copyright
|
|||
<pre>
|
||||
Simplified Wrapper and Interface Generator (SWIG)
|
||||
|
||||
Copyright (C) 1995-2000
|
||||
Copyright (C) 1995-2003
|
||||
The University of Chicago
|
||||
All Rights Reserved
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ SWIG Documentation, Presentations, and Papers
|
|||
<H3>SWIG1.3</h3>
|
||||
<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).
|
||||
</ul>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,63 +5,69 @@ Executive Summary
|
|||
|
||||
<p>
|
||||
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>,
|
||||
<a href="http://www.python.org">Python</a>, and
|
||||
<a href="http://www.scriptics.com">Tcl/Tk</a>. It works by taking the declarations commonly found in C/C++ header
|
||||
files and using them to generate the glue code (wrappers) that scripting
|
||||
languages need to access the underlying C/C++ code.
|
||||
C++ with scripting languages such as Perl, Python, Ruby, and Tcl. It
|
||||
works by taking the declarations found in C/C++ header files and using
|
||||
them to generate the wrapper code that scripting languages need to
|
||||
access the underlying C/C++ code. In addition, SWIG provides a
|
||||
variety of customization features that let you tailor the wrapping
|
||||
process to suit your application.
|
||||
|
||||
<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>
|
||||
that describes the
|
||||
benefits of scripting languages. SWIG makes it fairly easy to connect scripting
|
||||
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>
|
||||
<li><b>Building more powerful C/C++ programs</b>. Using SWIG, you can replace the main()
|
||||
function of a C program with a scripting interpreter from which you can control your
|
||||
application. This adds quite a lot of flexibility and makes it easier to build
|
||||
extensible programs. When combined with Tk, you can also build graphical user interfaces.
|
||||
<li><b>Building more powerful C/C++ programs</b>. Using SWIG, you can
|
||||
replace the main() function of a C program with a scripting
|
||||
interpreter from which you can control the application. This adds
|
||||
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>
|
||||
<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.
|
||||
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
|
||||
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>
|
||||
<li><b>Systems integration</b>. Scripting languages work fairly well for controlling and gluing
|
||||
software components together. With SWIG, different C/C++ programs can be turned into
|
||||
scripting language extension modules. These modules can then be combined together
|
||||
to create new and interesting applications.
|
||||
<li><b>Systems integration</b>. Scripting languages work fairly well
|
||||
for controlling and gluing loosely-coupled software components
|
||||
together. With SWIG, different C/C++ programs can be turned into
|
||||
scripting language extension modules. These modules can then be
|
||||
combined together to create new and interesting applications.
|
||||
|
||||
<p>
|
||||
<li><b>Construction of scripting language extension modules</b>. SWIG can
|
||||
be used to turn common C/C++ libraries into components for use in
|
||||
popular scripting languages. However, before doing this, you might
|
||||
want to do a search to see if someone else has already made
|
||||
such a module.
|
||||
<li><b>Construction of scripting language extension modules</b>. SWIG
|
||||
can be used to turn common C/C++ libraries into components for use in
|
||||
popular scripting languages. Of course, you will still want to make
|
||||
sure that no-one else has already created a module before doing this.
|
||||
</ul>
|
||||
|
||||
SWIG is sometimes compared to interface definition language (IDL)
|
||||
compilers such as those you would find with systems such as CORBA and
|
||||
COM. Although there are a few similarities, the whole point of SWIG
|
||||
is to 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
|
||||
prototyping tool. Specifically:
|
||||
compilers such as those you find with systems such as CORBA and COM.
|
||||
Although there are a few similarities, the whole point of SWIG is to
|
||||
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 prototyping tool. Specifically:
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
<li><b>ANSI C/C++ syntax</b>. SWIG parses a form of ANSI C
|
||||
syntax that has been extended with a number of special directives.
|
||||
As a result, interfaces are usually built by grabbing a header file
|
||||
and tweaking it a little bit. This particular approach is especially
|
||||
useful when the underlying C/C++ program undergoes frequent
|
||||
modification.
|
||||
<li><b>ANSI C/C++ syntax</b>. SWIG parses ANSI C++ that has been
|
||||
extended with a number of special directives. As a result, interfaces
|
||||
are usually built by grabbing a header file and tweaking it a little
|
||||
bit. This particular approach is especially useful when the
|
||||
underlying C/C++ program undergoes frequent modification.
|
||||
|
||||
<p>
|
||||
<li><b>SWIG is not a stub generator</b>. SWIG produces code that you
|
||||
|
|
@ -83,23 +89,17 @@ its scripting interface.
|
|||
|
||||
<p>
|
||||
<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
|
||||
morality.
|
||||
allow you to blow your whole leg off if that's what you want to do.
|
||||
SWIG is not here to enforce programming morality.
|
||||
</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
|
||||
(e.g., Perl XS, Python bgen, etc.), its primary audience is C/C++
|
||||
programmers who want to add a scripting language component to their
|
||||
applications. Because of this, SWIG tends to have a slightly
|
||||
different focus than tools designed to build small modules for
|
||||
widespread use in a scripting language distribution. By far, the most
|
||||
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.
|
||||
widespread use in a scripting language distribution. applications.
|
||||
|
||||
<p>
|
||||
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>
|
||||
SWIG has been freely available in various forms since February, 1996
|
||||
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
|
||||
repository is available at the University of Chicago. Over 12000 people
|
||||
downloaded the last SWIG release (SWIG-1.3.11).
|
||||
repository is available at the University of Chicago. Versions of
|
||||
SWIG can now be found in most Linux distributions (however, you'll almost
|
||||
certainly want to get the latest version here).
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ handling of overloaded functions added.
|
|||
<li>September 9, 2002. SWIG-1.3.15 released.
|
||||
<li>October 14, 2002. SWIG-1.3.16 released.
|
||||
<li>November 22, 2002. SWIG-1.3.17 released.
|
||||
<li>March 23, 2003. SWIG-1.3.18 released.
|
||||
</ul>
|
||||
|
||||
|
||||
|
|
|
|||
BIN
swigweb/images/screenshot2.png
Normal file
BIN
swigweb/images/screenshot2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
9
swigweb/screenshot2.ht
Normal file
9
swigweb/screenshot2.ht
Normal 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?
|
||||
|
||||
|
|
@ -23,8 +23,9 @@ SWIG Subversion
|
|||
</center>
|
||||
|
||||
<p>
|
||||
<li>The ever-so-impressive SWIG <a href="screenshot.html">screenshot</a>.
|
||||
<li><a href="visual.html">Visual SWIG 2000++</a>--the version for funding agents and managers.
|
||||
<li>The ever-so-impressive SWIG-1.1 <a href="screenshot.html">screenshot</a>.
|
||||
<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>.
|
||||
</ul>
|
||||
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ Now, compiling (Python):
|
|||
|
||||
<blockquote>
|
||||
<pre>
|
||||
$ swig -proxy -python -c++ pair.i
|
||||
$ swig -python -c++ pair.i
|
||||
$ c++ -c pair_wrap.c -I/usr/local/include/python2.1
|
||||
$ c++ -shared pair_wrap.o -o paircmodule.so
|
||||
$ python
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue