Swig

Latest version: v4.2.1

Safety actively analyzes 638466 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 13

1.3.7

==================================

9/02/2001: beazley
Added special %ignore directive to ignore declarations. This
feature works exactly like %rename. For example:

%ignore foo; // Ignore all declarations foo
%ignore ::foo; // Only ignore foo in global scope
%ignore Spam::foo; // Only ignore in class Spam
%ignore *::foo; // Ignore in all classes

%ignore can also be parameterized. For example:

%ignore foo(int);
%ignore ::foo(int);
%ignore Spam::foo(int);
%ignore *::foo(int);

*** NEW FEATURE ***


9/02/2001: cheetah (william fulton)
[Java] shadowcode pragma modified so that the code that is output
in the shadow file is placed relative to where it is placed in the
c/c++ code. This allows support for JavaDoc function comments.

9/01/2001: beazley
Fixed SF Patch [ 447791 ] Fix for python -interface option.
Submitted by Tarn Weisner Burton.

9/01/2001: beazley
SWIG no longer generates default constructors/destructors
for a class if it only defines a private/protected constructor
or destructor or if any one of its base classes only has
private constructors/destructors. This was reported in
SF Patch [ 444281 ] nonpublic/default/inhereted ctor/dtor
by Marcelo Matus.

9/01/2001: beazley
Added patch to Perl5 module that allows constants to be
wrapped as constants that don't require the leading $.
This feature is enabled using the -const option.
Patch contributed by Rich Wales.
*** NEW FEATURE ***

8/31/2001: beazley
Added parsing support for the 'volatile' type qualifier.
volatile doesn't mean anything to SWIG, but it is
needed to properly generate prototypes for declarations
that use it. It's also been added to make the SWIG type
system more complete.
*** NEW FEATURE ***

8/30/2001: beazley
Added support for parameterized %rename directive. *** This
new feature can be used to greatly simplify the task of
resolving overloaded methods and functions. ***

In prior versions of SWIG, the %rename directive was
used to consistently apply an identifier renaming. For
example, if you said this:

%rename foo bar;

Every occurrence of 'foo' would be renamed to 'bar'.
Although this works fine for resolving a conflict with a
target language reserved word, it is useless for
for dealing with overloaded methods. This is because
all methods are simply renamed to the same thing
(generating the same conflict as before).

Therefore, the only way to deal with overloaded methods
was to go through and individually rename them all using
%name. For example:

class Foo {
public:
virtual void bar(void);
%name(bar_i) virtual void bar(int);
...
};

To make matters worse, you had to do this for all
derived classes too.

class Spam : public Foo {
public:
virtual void bar(void);
%name(bar_i) virtual void bar(int);
...
};

Needless to say, this makes it extremely hard to resolve
overloading without a lot of work and makes it almost
impossible to use SWIG on raw C++ .h files.

To fix this, %rename now accepts parameter declarators.
The syntax has also been changed slightly. For example,
the following declaration renames all occurrences of 'bar(int)'
to 'bar_i', leaving any other occurrence of 'bar' alone.

%rename(bar_i) bar(int);

Using this feature, you can now selectively rename
certain declarations in advance. For example:

%rename(bar_i) bar(int);
%rename(bar_d) bar(double);

// Include raw C++ header
%include "header.h"

When %rename is used in this manner, all occurrence of bar(int)
are renamed wherever they might occur. More control is obtained
through explicit qualification. For example,

%rename(bar_i) ::bar(int);

only applies the renaming if bar(int) is defined in the global scope.
The declaration,

%rename(bar_i) Foo::bar(int);

applies the renaming if bar(int) is defined in a class Foo.
This latter form also supports inheritance. Therefore, if you
had a class like this:

class Spam : public Foo {
public:
void bar(int);
}

The Spam::bar(int) method would also be renamed (since Spam
is a subclass of Foo). This latter feature makes it easy
for SWIG to apply a consistent renaming across an entire
class hierarchy simply by specifying renaming rules for
the base class.

A class wildcard of * can be used if you want to renaming
all matching members of all classes. For example:

%rename(bar_i) *::bar(int);

will rename all members bar(int) that are defined in classes.
It will not renamed definitions of bar(int) in the global
scope.

The old use of %rename is still supported, but is somewhat
enhanced.

%rename(foo) bar; // Renames all occurrences of 'bar'.
%rename(foo) ::bar; // Rename all 'bar' in global scope only.
%rename(foo) *::bar; // Rename all 'bar' in classes only.
%rename(foo) Foo::bar; // Rename all 'bar' defined in class Foo.

*** NEW FEATURE ***

8/30/2001: beazley
Added support for data-member to member-function
transformation. For example, suppose you had a
structure like this:

struct Vector {
double x,y;
};

Now suppose that you wanted to access x and y
through a member function interface instead
of the usual SWIG behavior. For example:

f.set_x(3.4) instead of f.x = 3.4
x = f.get_x() instead of x = f.x

To do this, simply use the new %attributefunc
directive. For example:

%attributefunc(get_%s,set_%s)
struct Vector {
double x,y;
};
%noattributefunc

The arguments to %attributefunc are C-style printf
format strings that determine the naming convention
to use. %s is replaced with the actual name of the
data member. SWIG provides a number of printf
extensions that might help. For example, if you
wanted to title case all of the attributes, you
could do this:

%attributefunc(get%(title)s,set%(title)s);

This will turn an attribute 'bar' to 'getBar()' and 'setBar()'.

(someone requested this long ago, but I finally figured
how to implement it in a straightforward manner).
*** EXPERIMENTAL NEW FEATURE ***

8/30/2001: beazley
SWIG now automatically generates default constructors
and destructors if none are defined. This used to be
enabled with a command line switch -make_default, but
most people want these functions anyways. To turn
off this behavior use the -no_default option or include
the following pragma in the interface file:

%pragma no_default;

This may break certain interfaces that defined their
own constructors/destructors using the same naming
convention as SWIG. If so, you will get duplicate
symbols when compiling the SWIG wrapper file.
*** POTENTIAL INCOMPATIBILITY ***

8/29/2001: beazley
Changes to Perl5 shadow class code generation. Iterators
are no longer supported (FIRSTKEY, NEXTKEY). Also, attribute
access has been changed to rely on inheritance in order
to provide better behavior across modules.

8/28/2001: beazley
Various obscure improvements to the type system and classes.
Strange declarations like this are now wrapped correctly
(i.e., the generated wrapper code doesn't cause the C++
compiler to die with a type error).

class Foo {
public:
typedef double Real;
Real foo(Real (*op)(Real,Real), Real x, Real y);
};

Inheritance of types is also handled correctly.

8/28/2001: beazley
Changes to class wrappers. When SWIG sees two classes like this,

class X {
public:
void foo();
...
}

class Y : public X {
public:
void bar();
...
}

it now only generates two wrapper functions:

X_foo(X *x) { x->foo(); }
Y_bar(Y *y) { y->bar(); }

Unlike SWIG1.15, the foo() method does *not* propagate to a wrapper
function Y_foo(). Instead, the base class method X_foo() must be
used.

This change should not affect modules that use shadow classes, but
it might break modules that directly use the low-level C wrappers.
This change is being made for a number of reasons:

- It greatly simplifies the implementation of SWIG--especially
with anticipated future changes such as overloaded methods.

- It results in substantially less wrapper code--especially
for big C++ class hierarchies (inherited declarations
are no longer copied into every single derived class).

- It allows for better code generation across multiple
SWIG generated modules (code isn't replicated in
every single module).

*** POTENTIAL INCOMPATIBILITY ***

8/22/2001: cheetah (william fulton)
Provided some Windows documentation in the Win directory and some
Visual C++ project files for running examples on Windows.

8/28/2001: mkoeppe
[Guile] Handle renamed overloaded functions properly;
thanks to Marc Zonzon <Marc.Zonzonuniv-rennes1.fr> for the
patch. See the new test case name_cxx.

8/27/2001: mkoeppe
[Tcl] Removed lots of warnings issued by the Sun Forte
compilers, which were caused by mixing function pointers
of different linkages (C++/C).

8/23/2001: mkoeppe
Improved the MzScheme module by porting Guile's pointer
type checking system and making type dispatch
typemap-driven.

8/22/2001: beazley
Entirely new symbol table processing. SWIG should be able to
report much better error messages for multiple declarations.
Also, the new symbol table allows for overloaded functions
(although overloading isn't quite supported in the language
modules yet).

8/22/2001: cheetah (william fulton)
* [Java] %new support added.
* [Java] Package JNI name refixed!

8/19/2001: beazley
Python module modified to support pointers to C++ members. This
is an experimental feature.
*** NEW FEATURE ***

8/19/2001: beazley
Added limited parsing and full type-system support for pointers to
members. None of SWIG's language modules really know how to deal with
this so this is really only provided for completeness and future
expansion. Note: SWIG does not support pointers to members which
are themselves pointers to members, references to pointers to members,
or other complicated declarations like this.
*** NEW FEATURE ***

8/19/2001: beazley
SWIG is much better at parsing certain C++ declarations. Operators and
friends generally don't cause anymore syntax errors. However, neither
are really supported.

8/18/2001: beazley
Added *highly* experimental support for wrapping of C++
template declarations. Since C++ templates are essentially
glorified macros and SWIG has a fully operational C
preprocessor with macro support, the parser now converts
template declarations to macros. For example, a function
template like this

template<class T> T max(T a, T b);

is internally converted into a macro like this:

%define %_template_max(__name,T)
%name(__name) T max(T a, T b);
%enddef

To instantiate a version of the template, a special %template declaration
is used like this:

%template(maxint) max<int>;
%template(maxdouble) max<double>;

The parameter to the %template directive must be proper C identifier that's
used to uniquely name the resulting instantiation. When used, the
the expanded macro looks like this:

%name(maxint) int max(int a, int b);
%name(maxdouble) double max(double a, double b);

A similar technique is used for template classes. For instance:

template<class T> class vector {
T *data;
int sz;
public:
vector(int nitems);
T *get(int n);
...
};

Gets converted into a macro like this:

%define %_template_vector(__name, T)
%{
typedef vector<T> __name;
%}
class __name {
T *data;
int sz;
public:
__name(int nitems);
T *get(int n);
...
};
typedef __name vector<T>;
%enddef

A specific instantiation is created in exactly the same way:

%template(intvec) vector<int>;

The resulting code parsed by SWIG is then:

%{
typedef vector<int> intvec;
%}
class intvec {
int *data;
int sz;
public:
intvec(int nitems);
int *get(int n);
...
};
typedef intvec vector<int>;

Note: the last typedef is non-standard C and is used by SWIG to provide
an association between the name "intvec" and the template type
"vector<int>".

CAUTION: This is an experimental feature and the first time SWIG has
supported C++ templates. Error reporting is essential non-existent.
It will probably break in certain cases.
*** EXPERIMENTAL NEW FEATURE ****

8/15/2001: beazley
Change to wrapping of multi-dimensional arrays. Arrays
are now properly mapped to a pointer to an array of
one less dimension. For example:

int [10]; --> int *
int [10][20]; --> int (*)[20];
int [10][20][30]; --> int (*)[20][30];

This change may break certain SWIG extensions because
older versions simply mapped all arrays into a single
pointer such as "int *". Although possibly unusual,
the new version is correct in terms of the C type system.
*** POTENTIAL INCOMPATIBILITY ***

8/06/2001: cheetah (william fulton)
* [Java] Array setters generated for struct/class array members.

8/13/2001: beazley
Many improvements to Tcl/Perl/Python modules to better
work with multiple interface files and the %import directive.

8/13/2001: beazley
Fixed up the behavior of %import in the Python module.
SWIG no longer pollutes the module namespace by using
'from module import *' to refer to the other module.
Instead, it does a proper 'import module'. Also, SWIG
may work a lot better when importing modules that include
references to other imported modules.

8/13/2001: mkoeppe
Added new typemap substitutions, generalizing those of the
Guile-specific 5/27/2001 changes:
* $descriptor is the same as SWIGTYPE$mangle, but also
ensures that the type descriptor of this name gets
defined.
* $*type, $*ltype, $*mangle, $*descriptor are the same as
the variants without star, but they REMOVE one level of
pointers from the type. (This is only valid for pointer
types.)
* $&type, $&ltype, $&mangle, $&descriptor are the same as
the variants without ampersand, but they ADD one level of
pointers to the type.
The Guile-specific substitution $basedescriptor was removed
because it was useless.

8/12/2001: beazley
The %extern directive is now deprecated and withdrawn. The
purpose of this directive was to import selected definitions
from other interface files and headers. However, the same
functionality is better handled through %import. This
leaves SWIG with two file inclusion directives:

%include filename - Inserts into current interface
%import filename - Import types and classes from
another module

*** POTENTIAL INCOMPATIBILITY ***

8/09/2001: beazley
Added new support for wrapping C/C++ callback functions.
A common problem with some C libraries is that many
functions take a function pointer as an argument. For example:

int do_op(..., int (*op)(int,int), ...);

Unfortunately, the only way to call such a function is to
pass it a function pointer of some compatible type. In
previous versions of SWIG, you had to solve this problem
with some really gross hacks. For example, if you wanted to
use the following function as a callback,

int foo(int, int);

you had to install a pointer to it as a constant. For example:

%constant int (*FOO)(int,int) = foo;

or

const int (*FOO)(int,int) = foo;

or if you had a really old SWIG version:

typedef int (*OP_FUNC)(int,int);
int do_op(..., OP_FUNC, ...);
const OP_FUNC FOO = foo;


Now, you can do one of two things:

%constant int foo(int,int);

This creates a constant 'foo' of type int (*)(int,int).
Alternatively, you can do this:

%callback("%s");
int foo(int,int);
int bar(int,int);
%nocallback;

In this case, the functions are installed as constants where
the name is defined by the format string given to %callback().
If the names generated by the format string differ from the
actual function name, both a function wrapper and a callback
constant are created. For example:

%callback("%(upper)s");
int foo(int,int);
int bar(int,int);
%nocallback;

Creates two wrapper functions 'foo', 'bar' and additionally
creates two callback constants 'FOO', 'BAR'.

Note: SWIG still does not provide automatic support for
writing callback functions in the target language.
*** NEW FEATURE ***

8/06/2001: cheetah (william fulton)
* struct nesting fixes as per SF bug 447488.

8/03/2001: beazley
The %name directive now applies to constants created with
define and %constant. However, most language modules
were never written to support this and will have to be
modified to make it work. Tcl, Python, and Perl modules
are working now.
*** NEW FEATURE ***

8/03/2001: beazley
Massive changes and simplification of C declaration parsing.
Although SWIG is still not a full C parser, its ability
to handle complex datatypes including pointers to functions
and pointers to arrays has been vastly improved.

8/03/2001: cheetah (william fulton)
* Distribution fixes: autoconf no longer needed to install SWIG.

8/02/2001: beazley
Removed two undocumented parsing features. SWIG no longer
supports out-of-class static function or variable
declarations. For example:

static int Foo::bar;

This feature may return if there is sufficient demand.
However, since SWIG is most often used with header files,
it is more likely for these definitions to be included
in the class definition.
*** POTENTIAL INCOMPATIBILITY ***

8/02/2001: cheetah (william fulton)
* Cleanup of the GIFPlot examples. Upgraded Java GIFPlot example.

8/01/2001: cheetah (william fulton)
* [Java] Efficiency changes: _cPtr used where possible rather than
getCPtr(). Bug fixes for inheritance - derived class sometimes
didn't delete the c memory when _delete() was called.
* [Java] Abstract c++ classes are wrapped with a java abstract shadow
class. Also a pure virtual function is mapped with an abstract method.
* The default output file has always been <module>_wrap.c. It is now
<module>_wrap.cxx if the -c++ commandline option is passed to swig.
This has been done as otherwise c++ code would appear in a c file.
*** POTENTIAL INCOMPATIBILITY ***

7/31/2001: beazley
Modified the %constant directive to be more C-like in syntax.
The syntax is now:

%constant NAME = VALUE;
%constant TYPE NAME = VALUE;

For example:

%constant Foo *Bar = &Spam;

A more subtle case is as follows:

%constant int (*FOO)(int,int) = blah;

*** POTENTIAL INCOMPATIBILITY *** Modules that were using
the %constant directive directly will need to be modified.

7/30/2001: beazley
Removed obscure and undocumented form of the %inline directive:

%inline int blah(int a, int b) {
...
}

*** POTENTIAL INCOMPATIBILITY ***
(note: this feature was never documented and is withdrawn)

7/30/2001: beazley
Removed support for functions with no explicitly declared
return type. For example:

foo(int);

In C, such functions were implicitly assumed to return an 'int'.
In C++, this is illegal. Either way, it's considered bad
style. Removing support for this in SWIG will simplify
certain issues in parsing.
*** POTENTIAL INCOMPATIBILITY ***

7/30/2001: mkoeppe
* Partial merge from the CVS trunk. The Source/DOH directory
and most of the Source/Swig directory is up-to-date now.
* [Guile] %scheme is now a macro for %insert("scheme").
New syntax: %scheme "FILENAME";
New syntax: %scheme %{ SCHEME-CODE %}
New macros %multiple_values, %values_as_list,
%values_as_vector.

7/29/2001: beazley
%readonly and %readwrite have been turned into SWIG pragmas.
%pragma(swig) readonly and %pragma(swig) readwrite. Macros
are used to provide backwards compatibility.

7/29/2001: beazley
Minor changes to %pragma directive. %pragma must always
be directed to a specific language. For example:

%pragma(swig) make_default;
%pragma(perl5) include = "blah.i";

Also extended the pragma directive to allow code blocks

%pragma(foo) code = %{
... some code ...
%}

*** POTENTIAL INCOMPATIBILITY ***

7/29/2001: beazley
Change to the way 'const' variables are wrapped. In
previous versions of SWIG, a 'const' variable was
wrapped as a constant. Now, 'const' variables are
wrapped as read-only variables. There are several
reasons for making this change, mostly pertaining to
subtle details of how 'const' actually works.

This will probably break old interfaces that used 'const'
to create constants. As a replacement, consider using this:

const int a = 4; ===> %constant int a = 4;
*** POTENTIAL INCOMPATIBILITY ***

7/29/2001: beazley
Reorganization and simplification of type parsing.
Types with 'const' should work correctly now.

7/29/2001: beazley
Most swig directives related to the documentation system
are now deprecated.

7/29/2001: beazley
Removed support for Objective-C in order to simplify
parser reconstruction. Will return if there is sufficient
demand.
*** POTENTIAL INCOMPATIBILITY ***

7/29/2001: beazley
Code inclusion has been modified in the parser. A common
directive %insert is now used for everything. This
inserts a file into the output:

%insert(header) "foo.swg"

This inserts some inline code into the output

%insert(header) %{
... some code ...
%}

There are five predefined targets for the insert directive:

"header" - Header section of wrapper file
"runtime" - Runtime section of wrapper file
"wrapper" - Wrapper section
"init" - Initialization function
"null" - Nothing. Discard.

The following directives are still supported, but are
now defined in terms of macros:

%{ ... %} -> %insert(header) %{ ... %}
%init %{ ... %} -> %insert(init) %{ ... %}
%wrapper %{ ... %} -> %insert(wrapper) %{ ... %}
%runtime %{ ... %} -> %insert(runtime) %{ ... %}

Language modules can define new named targets by using the
C API function Swig_register_filebyname() (see main.cxx).
For example, if you wanted to expose a shadow class file,
you could do this:

Swig_register_filebyname("shadow", f_shadow);

Then in the interface file:

%insert(shadow) %{ ... %}

Note: this change should not affect any old interfaces, but
does open up new possibilities for enhancements.

7/29/2001: beazley
SWIG now always includes a standard library file 'swig.swg'.
This file defines a large number of macro definitions
that define the behavior of various SWIG directives.
Previously, all SWIG directives were handled as special
cases in the parser. This made the parser a large
bloated mess. Now, the parser is stripped down to a few
simple directives and macros are used to handle everything else.

7/26/2001: cheetah (william fulton)
* Fixes for Sourceforge bug 444748 - new testcase cpp_static:
[TCL] Class with just static member variable/function fix
[Java] Fixed static variables support
[Ruby] Static variables workaround removed

7/27/2001: mkoeppe
* stype.c (SwigType_default): Strip qualifiers first. The
default type of "int * const" is now "SWIGPOINTER *".
* main.cxx: Define "__cplusplus" in SWIG's preprocessor if
in C++ mode.
* [Guile]: Added some support for arrays and C++
references, fixing the "constant_pointers" test case.
* Moved most tests from the old Guile-specific test-suite
to the new test-suite. Also moved perl5/pointer-cxx
example there.

7/26/2001: cheetah (william fulton)
* Test-suite added.
* Initial testcases: constant_pointers cpp_enum defines
sizeof_pointers unions virtual_destructor
* Make clean improvements.

7/24/2001: cheetah (william fulton)
* [Java] Underscores in the package name and/or module name
no longer give linking problems.

7/17/2001: cheetah (william fulton)
* More parser bug fixes for constant pointers

7/19/2001: mkoeppe
* [Guile] Aesthetic improvement in variable wrappers.

7/18/2001: beazley
* Fixed core-dump problem in pointer library when
freeing character arrays.
SF Bug [ 415837 ] pointer lib core dump

7/18/2001: beazley
* Fixed problem with default destructors and shadow
classes. SF bug 221128.

7/18/2001: beazley
* To provide better line-number tracking in interfaces
with lots of macros, special locator comments are
now generated by the SWIG preprocessor. For example:

/*foo.i,42,BLAH*/expanded macro/**/

The first /*...*/ sequence sets the context
to point to the macro code. The /**/ comment
terminates the context. The SWIG parser should
ignore all of the locator comments as should
the C compiler (should such comments end up
in generated wrapper code).

7/18/2001: mkoeppe
* The parser now handles severely constified types in
typemaps. This introduced a new shift/reduce conflict, but
only with a heuristic function-pointer catch-all rule.
* [Guile]: Added typemaps for severely constified types.
* Fixed the "template-whitespace" problem by canonicalizing
whitespace, especially around angle brackets and commas.

7/17/2001: mkoeppe
* [Guile]: A Scheme file is emitted if the -scmstub FILE.SCM
command-line option is used. The %scheme directive
(implemented as a macro for a pragma) allows to insert
arbitrary code here. In "simple" and "passive" linkage,
the file gets filled with define-module and export
declarations.

7/17/2001: cheetah (william fulton)
* Parser bug fix to support constant pointers, eg int* const ptr.
Fixed everywhere - variables, parameters, return types etc. Note that
when wrapping a constant pointer variable only the getter is generated.

7/17/2001: mkoeppe
* Fixed SF bug 441470 (define X "//" would not be parsed,
see test-suite entry "preproc-1"), reported by T. W. Burton
<twburtonusers.sf.net>.
* Changed the type of character constants to "char", rather
than "char *". Changed the individual language modules
to keep the old behaviour, except for the Guile module,
where it is desired to make them Scheme characters. This
fixes SF bug 231409, test-suite entry "char-constant".
* Applied patch for DOH/Doh/memory.c by Les Schaffer
<schafferoptonline.net> (avoid required side effects in
assert).

7/17/2001: cheetah (william fulton)
* Bug fix in parser for virtual destructor with void as parameter
* Bug fix in parser defines embedded within classes/structs/unions
Consequently %constant can now also be placed within a struct/class/union.
* Bug fix in parser to allow sizeof(*I_am_a_pointer) within a define

7/16/2001: mkoeppe
* Added changes for the Macintosh contributed by Luigi
Ballabio <ballabiomac.com>.
* Some "const" fixes in the code.
* [Guile]: Made the constant-wrapper functions much shorter.

7/13/2001: mkoeppe
* [Guile]: Some "const" fixes for Guile version 1.3.4.
* Handle anonymous arguments with default values and static
array members of classes. Both bugs reported by Annalisa Terracina
<annalisa.terracinadatamat.it>; see the files
Examples/guile/test-suite/static-array-member.i and
anonymous-arg.i.

1.3.6

=============================

7/09/2001: cheetah (william fulton)
* GIFPlot examples: FOREGROUND and BACKGROUND definition missing
after TRANSPARENT define fix in GIFPlot

7/03/2001: beazley
Fixed up the version numbers so that the release is known
as 1.3.6. All future releases should have a similar
version format.

7/02/2001: mkoeppe
* [Python]: Prevent the problem of self.thisown not being
defined if the C++ class constructor raised an exception.
Thanks to Luigi Ballabio <ballabiomac.com>.

6/29/2001: mkoeppe
* More portability fixes; fixed "gcc -Wall" warnings.

6/29/2001: cheetah (william fulton)
* GIFPlot examples: TRANSPARENT define multiple times on Solaris
(clashes with stream.h).
* Multiple definition bug fix for shadow classes. The perl and python
modules had workarounds which have been replaced with fixes in
the core. Many of the Language::cpp_xxxx functions now set a
flag which the derived classes can access through
is_multiple_definition() to see whether or not code should be
generated. The code below would have produced varying degrees
of incorrect shadow class code for the various modules:
class TestClass
{
public:
TestClass() {}
TestClass(int a) {}
~TestClass() {}
unsigned long xyz(short k) {}
unsigned long xyz(int n) {}
static void static_func() {}
static void static_func(int a) {}
};
void delete_TestClass(int a);

6/27/2001: mkoeppe
* [Perl] Another const-related portability fix.

6/26/2001: cheetah (william fulton)
* [Java] Added in cpp_pragma() support with a host of new pragmas - see
jswig.html. These are designed for better mixing of Java and c++. It
enables the user to specify pure Java classes as bases and/or interfaces
for the wrapped c/c++.
* [Java] Old pragmas renamed. Warning given for the moment if used.
*** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***

6/25/2001: mkoeppe
* Incorporated more build changes contributed by Wyss Clemens
<WYShelbling.ch> for swig/ruby on cygwin.

6/20/2001: cheetah (william fulton)
* Makefile mods so that 'make check' uses the swig options in the makefiles
* [Java] Removed Generating wrappers message
* [Java] NULL pointer bug fix
* [Java] Bug fix for Kaffe JVM

6/20/2001: mkoeppe
* SWIG_TypeQuery from common.swg now returns a
swig_type_info* rather than a void*. This fixes a problem
when using pointer.i and C++, as illustrated by the new
test-suite example perl5/pointer-cxx.
* Portability fixes (const char *).
* Incorporated build changes contributed by Wyss Clemens
<WYShelbling.ch>, which make swig runnable on cygwin.

6/19/2001: cheetah (william fulton)
* [Java] Bug fix for SF bug 211144. This fix is a workaround
until fixed in the core.

6/19/2001: mkoeppe
* [Guile]: Portability fixes for use with the Sun Forte
compilers.
* [Tcl]: Portability fix (const char *).
* [Tcl]: Configure now first tries to find a tclConfig.sh
file in order to find the Tcl include directory, library
location and library name.
* [Python]: Added a few possible library locations.

6/18/2001: mkoeppe
* [Guile]: Don't call scm_c_export if nothing is to be
exported. Don't warn on %module if module has been set
already (this frequently occurs when %import is used).

6/16/2001: mkoeppe
* [Guile]: New "passive" linkage, which is appropriate for
multi-module extensions without Guile module magic.

6/15/2001: mkoeppe
* [Guile]: Fixed printing of smobs (space and angle were
missing).
* Properly generate type information for base classes
imported with the %import directive. Thanks to Marcelo
Matus <mmatusacms.arizona.edu> for the report and the
patch; this closes SF bug 231619; see also
Examples/guile/test-suite/import*.
* [Guile]: Fix casting between class and base class; the
runtime type system had it the wrong way around; see
Examples/guile/test-suite/casts.i
* Make typemaps for SWIGPOINTER * with arg name take
precedence over those without arg name, to match normal
typemap precedence rules.
* Fixed the random-line-numbers problem reported as SF bug
217310; thanks to Michael Scharf <scharfusers.sf.net>.
* [Guile]: Handle the %name and %rename directives.
* New syntax: %name and %rename now optionally take double
quotes around the scripting name. This is to allow scripting
names that aren't valid C identifiers.

6/14/2001: beazley
Made a minor change to the way files are loaded in
order to get file/line number reporting correct in
the preprocessor.

6/14/2001: mkoeppe
* The parser now understands the (non-standard) "long long"
types. It is up to the individual language modules to
provide typemaps if needed. Reported by Sam Steingold, SF
bug 429176.
* The parser now understands arguments like "const int *
const i". This fixes SF bug 215649.
* Fixed the Guile test-suite.

6/13/2001: mkoeppe
Partial merge from the CVS trunk at tag
"mkoeppe-merge-1". This covers the following changes:

| 01/16/01: ttn
| Wrote table of contents for Doc/engineering.html. Added section
| on CVS tagging conventions. Added copyright to other docs.
| 9/25/00 : beazley
| Modified the preprocessor so that macro names can start with a '%'.
| This may allow new SWIG "directives" to be defined as macros instead
| of having to be hard-coded into the parser.
|
| *** Also a yet-to-be-documented quoting mechanism with backquotes
| *** has been implemented?

6/13/2001: mkoeppe
* When configure does not find a language, don't use default
paths like /usr/local/include; this only causes build
problems.
* New directory: Examples/Guile/test-suite, where a few
bugs in 1.3a5 are demonstrated.
* Handle C++ methods that have both a "const" and a "throw"
directive (see Examples/Guile/test-suite/cplusplus-throw.i);
thanks to Scott B. Drummonds for the report and the fix.
* Handle C++ pointer-reference arguments (like "int *& arg")
(see Examples/Guile/test-suite/pointer-reference.i,
reported as SF bug 432224).
* [Ruby] Fixed typo in rubydec.swg; thanks to Lyle Johnson!
* Don't stop testing when one test fails.
* [Guile, MzScheme] Don't print "Generating wrappers...".

6/12/2001: mkoeppe
[Guile] VECTORLENINPUT and LISTLENINPUT now have separate
list length variables. TYPEMAP_POINTER_INPUT_OUTPUT
attaches argument documentation involving SCM_TYPE to the
standard pointer typemaps. INOUT is now an alias for BOTH.

6/12/2001: cheetah (william fulton)
Some Java documentation added.
[Java] Fixed bugs in import pragma and shadow pragma.

6/12/2001: mkoeppe
Fix declarations of SWIG_define_class
(Lib/ruby/rubydec.swg) and SWIG_TypeQuery
(Lib/common.swg). Thanks to Lyle Johnson
<ljohnsonresgen.com> for the patches.

6/11/2001: mkoeppe
[Guile] Use long instead of scm_bits_t; this makes the
generated wrapper code compatible with Guile 1.3.4
again. Thanks to Masaki Fukushima for pointing this out.

6/11/2001: cheetah (william fulton)
The generic INSTALL file from autoconf added. Few changes to README file.

6/11/2001: mkoeppe
Fixed typo in Makefile.in; thanks to Greg Troxel
<gdtir.bbn.com>.

6/08/2001: cheetah (william fulton)
make check works again. Examples/GIFPlot configure generated by
top level autoconf now.

6/08/2001: mkoeppe
Another build change: The new script autogen.sh runs
autoconf in the appropriate directories. The top-level
configure also configures in Examples/GIFPlot.

6/07/2001: mkoeppe
Made the Makefile work with non-GNU make again.

6/07/2001: cheetah (william fulton)
[Java] Class/struct members that are arrays of pointers to classes/structs -
Shadow class's get/set accessors now use Java classes instead of longs (pointers).
[Java] Shadow classes will now clean up memory if function return type
is a class/struct.
[Java] New example called reference based on the same example from other modules.

6/06/2001: mkoeppe
New configure option --with-release-suffix allows for
attaching a suffix to the swig binary and the swig runtime
libraries. Minor changes to the build system. "swig
-swiglib" works again. If invoked with the new option
"-ldflags", SWIG prints a line of linker flags needed to
link with the runtime library of the selected language
module.

6/06/2001: mkoeppe
[Guile] gswig_list_p is an int, not a SCM. This typo
caused warnings when compiling with a Guile configured with
strict C type checking. In INPUT and BOTH typemaps
generated by the SIMPLE_MAP macro, use the SCM_TO_C
function to convert from Guile to C (rather than C_TO_SCM).
Use scm_intprint to print pointers (rather than
sprintf). Allow using "-linkage" instead of "-Linkage".

6/05/2001: cheetah (william fulton)
[Java] Mods for using inherited c++ classes from Java
[Java] New example called class based on the same example from other modules

6/05/2001: cheetah (william fulton)
[Java] destructor (_delete()) was not aware of %name renaming
[Java] extends baseclass did not know about %name renaming
[Java] extends baseclass did extend even when the baseclass was not known to swig
[Java] sometimes enum-declarations occurred before the Java class declaration
[Java] unrelated enum initialisations no longer appear in Java class
[Java] if module ends in '_' correct JNI names are now produced

6/04/2001: cheetah (william fulton)
[Java] Shadow class mods - Modified constructor replaces
newInstance(). _delete() now thread safe. getCPtr() replaces
_self. _selfClass() removed as now redundant.
*** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***

[Java] Not all output java files had SWIG banner. New banner.

[Java] Shadow class finalizers are output by default: Command
line option -finalize deprecated and replaced with -nofinalize.
*** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***

6/ 1/2001: mkoeppe
[Guile] Cast SCM_CAR() to scm_bits_t before shifting it.
This is required for compiling with a Guile configured with
strict C type checking.

6/ 1/2001: mkoeppe
Added configure option "--with-swiglibdir".

5/31/2001: mkoeppe
[Guile] Support multiple parallel lists or vectors in
the typemaps provided by list-vector.i. New typemaps file,
pointer-in-out.i.

5/25/2001: cheetah (william fulton)
[Java] HTML update for examples.

5/28/2001: mkoeppe
Minor changes to the build system. Added subdirectory for
Debian package control files.

5/28/2001: mkoeppe
[Guile] Build a runtime library, libswigguile.

5/28/2001: mkoeppe
[Guile] New typemap substitution $*descriptor. Use the {}
syntax, rather than the "" syntax for the standard
typemaps, in order to work around strange macro-expansion
behavior of the SWIG preprocessor. This introduces some
extra braces.

5/27/2001: mkoeppe
[Guile] Handle pointer types with typemaps, rather than
hard-coded. New typemap substitutions $descriptor,
$basedescriptor; see documentation. Some clean-up in the
variable/constants wrapper generator code. New convenience
macro SWIG_Guile_MustGetPtr, which allows getting pointers
from smobs in a functional style. New typemap file
"list-vector.i", providing macros that define typemaps for
converting between C arrays and Scheme lists and vectors.

5/25/2001: cheetah (william fulton)
[Java] STL string moved into its own typemap as it is c++ code and
it break any c code using the typemaps.i file.
- Fixes for wrappers around global variables - applies to primitive
types and user types (class/struct) and pointers to these.
- Structure member variables and class public member variables getters
and setters pass a pointer to the member as was in 1.3a3 and 1.1
(1.3a5 was passing by value)
- Parameters that were arrays and return types were incorrectly
being passed to create_function() as pointers.
- Fix for arrays of enums.
[Java] Updated java examples and added two more.
[Java] Java module updated from SWIG1.3a3 including code cleanup etc.
[Java] enum support added.
[Java] Array support implemented
[Java] Shadow classes improved - Java objects used rather than
longs holding the c pointer to the wrapped structure/c++class

5/22/2001: mkoeppe
[Guile] Fixed extern "C" declarations in C++ mode. Thanks
to Greg Troxel <gdtir.bbn.com>.

5/21/2001: mkoeppe
[Guile] New linkage "module" for creating Guile modules for
Guile versions >= 1.5.0.

4/18/2001: mkoeppe
[MzScheme] Added typemaps for passing through Scheme_Object
pointers.

4/9/2001 : mkoeppe
[MzScheme] Added typemaps for `bool'. Inclusion of headers
and support routines is now data-driven via mzscheme.i.
Headers come from the new file mzschemdec.swg. Don't abort
immediately when a type-handling error is reported. When
searching for typemaps for enums, fall back to using int,
like the Guile backend does. Support char constants. Emit
correct wrapper code for variables.

3/12/2001: mkoeppe
[Guile] Fixed typemaps for char **OUTPUT, char **BOTH.

3/2/2001 : mkoeppe
[Guile] Every wrapper function now gets a boolean variable
gswig_list_p which indicates whether multiple values are
present. The macros GUILE_APPEND_RESULT, GUILE_MAYBE_VALUES
and GUILE_MAYBE_VECTOR use this variable, rather than
checking whether the current return value is a list. This
allows for typemaps returning a list as a single value (a
list was erroneously converted into a vector or a
multiple-value object in this case).

3/1/2001 : mkoeppe
[Guile] Added support for returning multiple values as
vectors, or passing them to a muliple-value
continuation. By default, multiple values still get
returned as a list.

3/1/2001 : mkoeppe
[Guile] Added a "beforereturn" pragma. The value of this
pragma is inserted just before every return statement.

3/1/2001 : mkoeppe
[Guile] Added support for Guile 1.4.1 procedure
documentation formats, see internals.html.

2/26/2001: mkoeppe
[Guile] Made the wrapper code compile with C++ if the
"-c++" command-line switch is given. Thanks to
<monkeyiqdingoblue.net.au>.

2/26/2001: mkoeppe
[Guile] Now two type tables, swig_types and
swig_types_initial, are used, as all other SWIG language
modules do. This removes the need for the tricky
construction used before that the broken Redhat 7.0 gcc
doesn't parse. Reported by <monkeyiqdingoblue.net.au>.

2/26/2001: mkoeppe
[Guile] Fixed typemaps for char *OUTPUT, char *BOTH; a bad
free() would be emitted. Added typemap for SCM.

1.3

=======================================

2/11/00 : Added 'void' to prototype of Python module initializer.
Reported by Mark Howson (1/20/00).

2/11/00 : beazley
Modified the Python shadow class code to discard ownership of an
object whenever it is assigned to a member of another object.
This problem has been around for awhile, but was most recently
reported by Burkhard Kloss (12/30/99).

2/11/00 : beazley
Added braces around macros in the exception.i library. Reported
by Buck Hodges (12/19/99)

2/11/00 : beazley
Fixed bug in the constraints.i library. Reported by Buck
Hodges (12/14/99)

2/11/00 : beazley
The %native directive now generates Tcl8 object-style command calls.
A full solution for Tcl7 and Tcl8 is still needed. Patch suggested
by Mike Weiblen (11/29/99)

2/11/00 : beazley
Modified the typemap code to include the $ndim variable for arrays.
Patch provided by Michel Sanner (11/12/99).

2/11/00 : beazley
Modified the Python module to raise a Runtime error if an attempt
is made to set a read-only member of a shadow class. Reported by
Michel Sanner (11/5/99).

2/10/00 : The documentation system has been removed. However, it is likely
to return at some point in the future.

2/1/00 : Added a number of performance enhancements to the Python shadow
classing and type-checking code. Contributed by Vadim Chugunov.

1. Remove _kwargs argument from the shadow wrappers when -keyword
option is not specified. This saves us a construction of keyword
dictionary on each method call.

def method1(self, *_args, **_kwargs):
val = apply(test2c.PyClass1_method1, (self,) + _args, _kwargs)
return val

becomes

def method1(self, *_args):
val = apply(test2c.PyClass1_method1, (self,) + _args)
return val

2. Incorporate self into the _args tuple. This saves at least one tuple
allocation per method call.

def method1(self, *_args):
val = apply(test2c.PyClass1_method1, (self,) + _args)
return val

becomes

def method1(*_args):
val = apply(test2c.PyClass1_method1, _args)
return val

3. Remove *Ptr classes.
Assume that we are SWIGging a c++ class CppClass.
Currently SWIG will generate both CppClassPtr class
that hosts all methods and also CppClass that is derived
from the former and contains just the constructor.
When CppClass method is called, the interpreter will try
to find it in the CppClass's dictionary first, and only then
check the base class.

CppClassPtr functionality may be emulated with:

import new
_new_instance = new.instance
def CppClassPtr(this):
return _new_instance(CppClass, {"this":this,"thisown":0})

This saves us one dictionary lookup per call.

<DB>The new module was first added in Python-1.5.2 so it
won't work with older versions. I've implemented an
alternative that achieves the same thing</DB>

4. Use CObjects instead of strings for pointers.

Dave: This enhancements result in speedups of up to 50% in some
of the preliminary tests I ran.

2/1/00 : Upgraded the Python module to use a new type-checking scheme that
is more memory efficient, provides better performance, and
is less error prone. Unfortunately, it will break all code that
depends on the SWIG_GetPtr() function call in typemaps.
These functions should be changed as follows:

if (SWIG_GetPtr(string,&ptr,"_Foo_p")) {
return NULL;
}

becomes

if (SWIG_ConvertPtr(pyobj, &ptr, SWIG_TYPE_Foo_p) == -1) {
return NULL;
}

Note: In the new implementation SWIG_TYPE_Foo_p is no longer
a type-signature string, but rather an index into a type
encoding table that contains type information.
*** POTENTIAL INCOMPATIBILITY ***

1/30/00 : loic
Conditionally compile experimental code with --enable-experiment
configure flag.
Fix .cvsignore to ignore configure & yacc generated files

1/28/00 : loic
Apply automake everywhere
Keep configure scripts so that people are not *forced* to autoconf
Keep sources generated by yacc so that compilation without yacc
is possible.
Source/LParse/cscanner.c: change lyacc.h into parser.h to please
default yacc generation rules.
Use AC_CONFIG_SUBDIRS in configure.in instead of hand made script.
Update all relevant .cvsignore to include .deps
Fixed missing ; line 136 Source/Swig/swig.h

1/13/00 : beazley
Fixed a number of minor end-of-file parsing problems in the
preprocessor.

1/13/00 : beazley
Added -freeze option that forces SWIG to freeze upon exit.
This is only used as a debugging tool so that I can more
easily examine SWIG's memory footprint.

1/13/00 : beazley
Added patch to guile module for supporting optional arguments
Patch contributed by Dieter Baron.

1/13/00 : loic
Added .cvsignore, Examples/.cvsignore, Source/DOH/Doh/.cvsignore
Source/SWIG1.1/main.cxx: Fixed -I handling bug
Source/Modules1.1/java.cxx: fixed char* -> const char* warnings that are
errors when compiling with gcc-2.95.2
Source/SWIG1.1/main.cxx: cast const char* to char* for String_replace
token and rep should really be const.

1/12/00 : beazley
Added Harco's Java modules.

1/12/00 : beazley
Revoked the %ifdef, %ifndef, %endif, %if, %elif, and %else
directives. These are no longer needed as SWIG now has a real
preprocessor.
*** POTENTIAL INCOMPATIBILITY ***

1/12/00 : beazley
Moved the documentation modules from the SWIG directory
to the Modules directory (where they really should have been
to begin with).

1/12/00 : beazley
Removed the -stat option for printing statistics. The
statistics reporting was inadequate and mostly broken
anyway.
*** POTENTIAL INCOMPATIBILITY ***

1/12/00 : beazley
Removed the -t option for reading a typemap file. More
trouble than it's worth. Just include typemaps at the top
of the interface file.
*** POTENTIAL INCOMPATIBILITY ***

1/12/00 : beazley
Removed the %checkout directive.
*** POTENTIAL INCOMPATIBILITY ***

1/12/00 : beazley
Removed the -ci option for file checkin. Too problematic
to implement. Probably better to just put your SWIG library
under CVS instead.
*** POTENTIAL INCOMPATIBILITY ***.

1/11/00 : beazley
Deleted the LATEX module. Sorry... Didn't know anyone
who was using it. Besides, I'm looking to simplify
the documentation system.
*** POTENTIAL INCOMPATIBILITY ***

1/11/00 : beazley
Modified the ASCII documentation module to use a .txt
suffix for its output file instead of .doc.

1/11/00 : beazley
Added the long-lost SWIG preprocessor back to the system.
It should be enabled by default. Raw preprocessed output
can be viewed using swig -E file.i.
*** NEW FEATURE ***

1/11/00 : beazley and djmitche
Completely reorganized the SWIG directory structure. The
basic organization is now:

Source/ SWIG source code
Lib/ SWIG library files (swig_lib)
Doc/ Documentation
Examples/ Examples

More directories will be added as needed.

12/08/99: Loic Dachary (loicsenga.org)
Enhanced package handling for perl5 and c++.

With new option -hide Foo::Bar, every perl5 object (Frob) is
qualified by Foo::Bar::Frob. The package name is solely used
to encapsulate C/C++ wrappers output in <module>_wrap.c and the
corresponding perl package in <module>.pm. Note that a package
name may contain :: (Frob::Nitz) and will be relative to the
package name provided by -hide (Foo::Bar::Frob::Nitz).

In *_wrap.c, SWIG_init macro is used. Was previously defined
but not used and simplifies code.

Added typemap(perl5,perl5in) and typemap(perl5,perl5out) that
do the equivalent of typemap(perl5,in) and typemap(perl5,out)
but contain perl code and applies to wrappers generated by
-shadow.

Lacking proper regression tests I used
Examples/perl5/{c++,constraint,defarg,except,
graph/graph[1234],multinherit,nested,shadow,simple,tree,
typemaps/{argv,argv2,arraymember,database,file,ignore,integer,
output,passref,reference,return}}/. I ran swig with and without
the patches, diff the generatedsources, run the .pl files
and checked that the results are identical. In all those examples
I had no error.

11/21/99: Modified the Tcl module to provide full variable linking capabilities
to all datatypes. In previous versions, a pair of accessor functions
were created for datatypes incompatible with the Tcl_LinkVar() function.
Now, we simply use variable traces to support everything. This may
break scripts that rely upon the older behavior.
*** POTENTIAL INCOMPATIBILITY ***

11/21/99: Added slight tweak to wrapper generator to collect local variables
of similar type. Produces somewhat more compact wrapper code.

11/20/99: Modified the Tcl module to use SWIG_GetArgs() to parse
arguments. This is a technique borrowed from Python in which
arguments are converted using a format string convention similiar
to fprintf(). This results in a *substantial* reduction in the
size of the resulting wrapper code with only a modest runtime overhead
in going through the extra conversion function.

11/13/99: Completely rewrote the class/structure generation code for the
Tcl module. Now, a small set of runtime functions are used
to implement the functionality for all classes (instead of a
massive amount of runtime code being generated for each class).
Class specific information is simply encoded in a series of
static tables. This results in a *HUGE* reduction in wrapper
code size--especially for C++.

11/13/99: Removed the -tcl (Tcl 7.x) module. Tcl 8.0 is now several
years old and the defacto standard--no real reason to keep
supporting the old version at this point.

11/13/99: Cleaned up -c option for Python module. The pyexp.swg file
is now gone.

11/13/99: Fixed external declarations to work better with static linking
on Windows. Static linking should now be possible by defining
the -DSTATIC_LINK option on the command line. Patch contributed
by Alberto Fonseca.

11/5/99 : Fixed an obscure code generation bug related to the generation
of default constructors. Bug reported by Brad Clements.

11/5/99 : Fixed a few memory problems found by purify.

11/5/99 : Officially deprecated the -htcl, -htk, and -plugin options
from the Tcl and Tcl8 modules.

10/26/99: Removed unused variable from python/typemaps.i. Patch
contributed by Keith Davidson.

8/16/99 : Added _WIN32 symbol to libraries to better support Windows.

8/16/99 : Deprecated the Perl4 module. It is no longer included in the
distribution and no longer supported. In the entire 3 years SWIG
has been around I never received a single comment about it so I'm
assuming no one will miss it...

8/16/99 : Modified the type-checking code to register type mappings using a
table instead of repeated calls to SWIG_RegisterMapping(). This
reduces the size of the module initialization function somewhat.

8/15/99 : Cleaned up the pointer type-checking code in the Tcl module.

8/15/99 : Many changes to the libraries to support runtime libraries.

8/13/99 : Eliminated C++ compiler warning messages about extern "C" linkage.

8/13/99 : Some cleanup of Python .swg files to better support runtime libraries
on Windows.

8/13/99 : Modified the %pragma directive to attach pragmas declared inside
a class definition to the class itself. For example:

class foo {
...
%pragma(python) addtomethod = "insert:print `hello world'"
...
}

Most people don't need to worry about how this works. For people
writing backend modules, class-based pragmas work like this:

lang->cpp_open_class() // Open a class
lang->cpp_pragma() // Supply pragmas
... // Emit members

lang->cpp_close_class() // Close the class

All of the pragmas are passed first since they might be used to
affect the code generation of other members. Please see
the Python module for an example. Patches contributed
by Robin Dunn.

8/13/99 : Patch to Python shadow classes to eliminate ignored
exception errors in destructors. Patch contributed
by Robin Dunn.

8/11/99 : Minor patch to swig_lib/python/swigptr.swg (added SWIGSTATIC
declaration). Patch contributed by Lyle Johnson.

8/11/99 : Added FIRSTKEY/NEXTKEY methods to Perl5 shadow classes
Patch contributed by Dennis Marsa.

8/11/99 : Modified Python module so that NULL pointers are returned
and passed as 'None.' Patch contributed by Tal Shalif.

8/10/99 : Fixed missing 'int' specifiers in various places.

8/10/99 : Added Windows makefile for Runtime libraries. Contributed
by Bob Techentin.

8/10/99 : Fixed minor problem in Python runtime makefile introduced
by keyword arguments.

8/8/99 : Changed $target of perl5(out) typemap from ST(0) to
ST(argvi). Patch contributed by Geoffrey Hort.

8/8/99 : Fixed bug in typemap checking related to the ANY keyword
in arrays and ignored arguments. Error reported by
Geoffrey Hort.

8/8/99 : %enabledoc and %disabledoc directives can now be used
inside class/structure definitions. However, no check
is made to see if they are balanced (i.e., a %disabledoc
directive inside a class does not have to have a matching
%enabledoc in the same class).

8/8/99 : Keyword argument handling is now supported in the Python
module. For example:

int foo(char *bar, int spam, double x);

Can be called from Python as

foo(x = 3.4, bar="hello", spam=42)

To enable this feature, run SWIG with the '-keyword' command
line option. Mixing keyword and default arguments
should work as well. Unnamed arguments are assigned names
such as "arg1", "arg2", etc...

*** POTENTIAL INCOMPATIBILITY ***
Functions with duplicate argument names such as
bar(int *OUTPUT, int *OUTPUT) will likely cause problematic
wrapper code to be generated. To fix this, use different
names or use %apply to map typemaps to alternate names.

8/8/99 : Handling of the 'this' pointer has been changed in Python shadow
classes. Previously, dereferencing of '.this' occurred in the
Python shadow class itself. Now, this step occurs in the C
wrappers using the following function:

SWIG_GetPtrObj(PyObject *, void **ptr, char *type)

This function can accept either a string containing a pointer
or a shadow class instance with a '.this' attribute of
appropriate type. This change allows the following:

1. The real shadow class instance for an object is
passed to the C wrappers where it can be examined/modified
by typemaps.

2. Handling of default/keyword arguments is now greatly
simplified.

3. The Python wrapper code is much more simple.

Plus, it eliminated more than 300 lines of C++ code in the
Python module.

*** CAVEAT : This requires the abstract object interface.
It should work with Python 1.4, but probably nothing older
than that.


8/8/99 : Fixed handling of "const" and pointers in classes. In particular,
declarations such as

class foo {
...
const char *msg;
const int *iptr;
}

are handled as assignable variables as opposed to constant
values (this is the correct behavior in C/C++). Note:
declarations such as "char *const msg" are still unsupported.
Constants declared at the global level using const are also
broken (because I have a number of interfaces that rely upon
this behavior).

*** POTENTIAL INCOMPATIBILITY *** This may break interfaces that
mistakenly treat 'const char *' types as constant values.

8/8/99 : Modified the parser to support bit-fields. For example:

typedef struct {
unsigned int is_keyword : 1;
unsigned int is_extern : 1;
unsigned int is_static : 1;
} flags;

Bit-fields can only be applied to integer types and their
are other restrictions. SWIG performs no such type-checking
(although the C compiler will catch problems when it tries to
compile the wrapper code).

8/8/99 : Removed trailing space of $basetype substitution in typemaps.
This is to allow things like this:

%typemap(python, argout) spam** OUTPUT{
...
char* a = "$basetype_p";
...
}

(Patch suggested by Nathan Dunfield).

6/22/99 : Made a very slight tweak to the Perl5 shadow class
code that allows typemaps to alter the return type
of objects (to support polymorphic types). Patch
contributed by Drake Diedrich.

4/8/99 : Fixed null pointer handling bug in Perl module.
Patch contributed by Junio Hamano.

3/17/99 : Fixed bug in perl5ptr.swg for ActiveState Perl.
Patch contributed by Greg Anderson.

2/27/99 : Eliminated segmentation fault when Swig runs on
empty files.

2/27/99 : Added patch to Guile module to eliminate unused
variables. Contributed by Mike Simons.

2/27/99 : Fixed problem with %addmethods returning references.

2/27/99 : Fixed Runtime/Makefile. Patch contributed by
Mike Romberg.

2/27/99 : Incorporated patches to the type-checker.

2/27/99 : Fixed problem with -exportall switch and shadow classes
in Perl5 module. Patch contributed by Dennis Marsa.

2/27/99 : Modified Perl5 module to recognize 'undef' as a NULL char *.
Patch contributed by Junio Hamano.

2/27/99 : Fixed the Perl5 module to support the newer versions of
ActiveState Perl for Win32.

2/27/99 : Fixed the include order of files specified with the
-I option.

2/5/98- : Dave finishes his dissertation, goes job hunting, moves to
2/5/99 Chicago and generally thrashes about.

1.1

====================================

1. Added new %extern directive for handling multiple files

2. Perl5 shadow classes added

3. Rewrote conditional compilation to work better

4. Added 'bool' datatype

5. %{,%} block is now optional.

6. Fixed some bugs in the Python shadow class module

7. Rewrote all of the SWIG tests to be more informative
(and less scary).

8. Rewrote parameter list handling to be more memory
efficient and flexible.

9. Changed parser to ignore 'static' declarations.

10. Initializers are now ignored. For example :

struct FooBar a = {3,4,5};

11. Somewhat better parsing of arrays (although it's
usually just a better error message now).

12. Lot's of minor bug fixes.

1.1b5

==============================

3/11/97 : Fixed compilation problems introduced by Tcl/Tk 8.0a2.
*** INCOMPATIBILITY *** SWIG no longer works with Tcl/Tk 8.0a1.

3/10/97 : Fixed bug with ignored arguments and C++ member functions in
the Python module.

3/9/97 : Parsing bugs with nested class definitions and privately
declared nested class definitions fixed.

3/9/97 : Fixed a few minor code generation bugs with C++ classes and
constructors. In some cases, the resulting wrapper code
would not compile properly. SWIG now attempts to use
the default copy constructor instead.

3/8/97 : Added a -l option to SWIG that allows additional SWIG library files
to be grabbed without having them specified in the interface file.
This makes it easier to keep the interface file clean and move certain
options into a Makefile. For example :

swig -tcl example.i Build a normal Tcl extension
swig -tcl -lwish.i example.i Build it as a wish extension
by including the 'wish.i' file.

swig -python example.i Build a dynamically loaded extension
swig -python -lembed.i example.i Build a static extension

These kinds of options could previously be accomplished with
conditional compilation such as :

%module example
...
ifdef STATIC
%include embed.i
endif

3/8/97 : Incorporated changes to Guile module to use the new gh interface
in FSF Guile 1.0. The older gscm interface used in Cygnus
Guile releases is no longer supported by SWIG.

3/8/97 : Cleaned up the Tcl Netscape plugin example. It should work with
version 1.1 of the plugin now.

3/8/97 : Added better array support to the typemap module. The keyword
ANY can now be used to match any array dimension. For example :

%typemap(tcl,in) double [ANY] {
... get an array ...
}

This will match any single-dimensional double array. The array
dimension is passed in the variables $dim0, $dim1, ... $dim9. For
example :

%typemap(tcl,in) double [ANY][ANY][ANY] {
printf("Received a double[%d][%d][%d]\n",$dim0,$dim1,$dim2);
}

Any typemap involving a specific array dimension will override any
specified with the ANY tag. Thus, a %typemap(tcl,in) double [5][4][ANY] {}
would override a double [ANY][ANY][ANY]. However, overuse of the ANY
tag in arrays of high-dimensions may not work as you expect due to
the pattern matching rule used. For example, which of the following
typemaps has precedence?

%typemap(in) double [ANY][5] {} // Avoid this!
%typemap(in) double [5][ANY] {}

3/7/97 : Fixed a number of bugs related to multi-dimensional array handling.
Typedefs involving multi-dimensional arrays now works correctly.
For example :

typedef double MATRIX[4][4];

...
extern double foo(MATRIX a);

Typecasting of pointers into multi-dimensional arrays is now
implemented properly when making C/C++ function calls.

3/6/97 : Fixed potentially dangerous bug in the Tcl Object-oriented
interface. Well, actually, didn't fix it but issued a
Tcl error instead. The bug would manifest itself as follows:

% set l [List] Create an object
...
% set m [List -this $l] Make $m into an object assuming $l
contains a pointer.
Since $m == $l, $l gets destroyed
(since its the same command name)
% $m insert Foo
Segmentation fault Note : the list no longer exists!

Now, an error will be generated instead of redefining the command.
As in :

% set l [List]
...
% set m [List -this $l]
Object name already exists!

Use catch{} to ignore the error.

3/3/97 : Better support for enums added. Datatypes of 'enum MyEnum'
and typedefs such as 'typedef enum MyEnum Foo;' now work.

3/3/97 : Parser modified to ignore constructor initializers such as :

class Foo : public Bar {
int a,b;
public:
Foo(int i) : a(0), b(i), Bar(i,0) { };
};

3/3/97 : Modified parser to ignore C++ exception specifications such as :

int foo(double) throw(X,Y);

3/3/97 : Added %import directive. This works exactly like %extern
except it tells the language module that the declarations are
coming from a separate module. This is usually only
needed when working with shadow classes.

3/2/97 : Changed pointer type-checker to be significantly more
efficient when working with derived datatypes. This
has been accomplished by storing type-mappings in sorted
order, using binary search schemes, and caching recently
used datatypes. For SWIG generated C++ modules that
make a large number of C function calls with derived types,
this could result in speedups of between 100 and 50000 percent.
However, due to the required sorting operation, module
loading time may increased slightly when there are lots of
datatypes.

3/2/97 : Fixed some C++ compilation problems with Python
embed.i library files.

2/27/97 : Slight change to C++ code generation to use copy constructors
when returning complex data type by value.

2/26/97 : Fixed bug in Python module with -c option.

2/26/97 : Slight tweak of parser to allow trailing comma in enumerations
such as

enum Value (ALE, STOUT, LAGER, };

2/25/97 : Fixed code generation bug in Tcl module when using the
%name() directive on a classname.

2/25/97 : Finished code-size optimization of C++ code generation with
inheritance of attributes. Inherited attributes now
only generate one set of wrapper functions that are re-used
in any derived classes. This could provide big code
size improvements in some scripting language interfaces.

2/25/97 : Perl5 module modified to support both the Unix and Windows
versions. The windows version has been tested with the
Activeware port of Perl 5.003 running under Windows 95.
The C source generated by SWIG should compile without
modification under both versions of Perl, but is now
even more hideous than before.

2/25/97 : Modified parser to allow scope resolution operation to
appear in expressions and default arguments as in :

void foo(int a = Bar::defvalue);

2/25/97 : Fixed bug when resolving symbols inside C++ classes.
For example :

class Foo {
public:
enum Value {ALE, STOUT, LAGER};
...
void defarg(Value v = STOUT);

};

2/24/97 : Fixed bug with member functions returning void *.

2/23/97 : Modified Python module to be better behaved under Windows

- Module initialization function is now properly exported.
It should not be necessary to explicitly export this function
yourself.

- Bizarre compilation problems when compiling the SWIG wrapper
code as ANSI C under Visual C++ 4.x fixed.

- Tested with both the stock Python-1.4 distribution and Pythonwin
running under Win95.

2/19/97 : Fixed typedef handling bug in Perl5 shadow classes.

2/19/97 : Added exception support. To use it, do the following :

%except(lang) {
... try part of the exception ...
$function
... catch part of exception ...
}

$function is a SWIG variable that will be replaced by the
actual C/C++ function call in a wrapper function. Thus,
a real exception specification might look like this :

%except(perl5) {
try {
$function
} catch (char *& sz) {
... process an exception ...
} catch(...) {
croak("Unknown exception. Bailing out...");
}
}

2/19/97 : Added support for managing generic code fragments (needed
for exceptions).

2/19/97 : Fixed some really obscure typemap scoping bugs in the C++
handler.

2/18/97 : Cleaned up perlmain.i file by removing some problematic,
but seemingly unnecessary declarations.

2/18/97 : Optimized handling of member functions under inheritance.
SWIG can now use wrapper functions generated for a
base class instead of regenerating wrappers for
the same functions in a derived class. This could
make a drastic reduction in wrapper code size for C++
applications with deep inheritance hierarchies and
lots of functions.

2/18/97 : Additional methods specified with %addmethods can now
be inherited along with normal C++ member functions.

2/18/97 : Minor internal fixes to make SWIG's string handling a little
safer.

2/16/97 : Moved some code generation of Tcl shadow classes to
library files.

2/16/97 : Fixed documentation error of '-configure' method in
Tcl modules.

2/16/97 : Modified Perl5 module slightly to allow typemaps
to use Perl references.

2/12/97 : Fixed argument checking bug that was introduced by
default arguments (function calls with too many
arguments would still be executed). Functions now
must have the same number of arguments as C version
(with possibility of default/optional arguments
still supported).

2/12/97 : Fixed default argument bug in Perl5 module when
generating wrapper functions involving default
arguments of complex datatypes.

2/12/97 : Fixed typemap scoping problems. For example :

%typemap(tcl,in) double {
.. get a double ..
}

class Foo {
public:
double bar(double);
}

%typemap(tcl,in) double {
.. new get double ..
}

Would apply the second typemap to all functions in Foo
due to delayed generation of C++ wrapper code (clearly this
is not the desired effect). Problem has been fixed by
assigning unique numerical identifiers to every datatype in
an interface file and recording the "range of effect" of each
typemap.

2/11/97 : Added support for "ignore" and "default" typemaps. Only use
if you absolutely know what you're doing.

2/9/97 : Added automatic creation of constructors and destructors for
C structs and C++ classes that do not specify any sort of
constructor or destructor. This feature can be enabled by
running SWIG with the '-make_default' option or by inserting
the following pragma into an interface file :

%pragma make_default

The following pragma disables automatic constructor generation

%pragma no_default

2/9/97 : Added -make_default option for producing default constructors
and destructors for classes without them.

2/9/97 : Changed the syntax of the SWIG %pragma directive to
%pragma option=value or %pragma(lang) option=value.
This change makes the syntax a little more consistent
between general pragmas and language-specific pragmas.
The old syntax still works, but will probably be phased
out (a warning message is currently printed).

2/9/97 : Improved Tcl support of global variables that are of
structures, classes, and unions.

2/9/97 : Fixed C++ compilation problem in Python 'embed.i' library file.

2/9/97 : Fixed missing return value in perlmain.i library file.

2/9/97 : Fixed Python shadow classes to return an AttributeError when
undefined attributes are accessed (older versions returned
a NameError).

2/9/97 : Fixed bug when %addmethods is used after a class definition whose
last section is protected or private.

2/8/97 : Made slight changes in include file processing to support
the Macintosh.

2/8/97 : Extended swigmain.cxx to provide a rudimentary Macintosh interface.
It's a really bad interface, but works until something better
is written.

1/29/97 : Fixed type-casting bug introduced by 1.1b4 when setting/getting the
value of global variables involving complex data types.

1/29/97 : Removed erroneous white space before an endif in the code generated
by the Python module (was causing errors on DEC Alpha compilers).

1/26/97 : Fixed errors when using default/optional arguments in Python shadow
shadow classes.

1/23/97 : Fixed bug with nested %extern declarations.

1/21/97 : Fixed problem with typedef involving const datatypes.

1/21/97 : Somewhat obscure, but serious bug with having multiple levels
of typedefs fixed. For example :

typedef char *String;
typedef String Name;

1.0

===================================

This release is identical to Beta1 except a few minor bugs are
fixed and the SWIG library has been updated to work with Tcl 7.5/Tk 4.1.
A tcl7.5 examples directory is now included.

- Fixed a bug in the Makefile that didn't install the libraries
correctly.

- SWIG Library files are now updated to work with Tcl 7.5 and Tk 4.1.

- Minor bug fixes in other modules.


Version 1.0 Beta 1 (April 10, 1996).
=====================================

This is the first "semi-official" release of SWIG. It has a
number of substantial improvements over the Alpha release. These
notes are in no particular order--hope I remembered everything....

1. Tcl/Tk

SWIG is known to work with Tcl7.3, Tk3.6 and later versions.
I've also tested SWIG with expect-5.19.

Normally SWIG expects to use the header files "tcl.h" and "tk.h".
Newer versions of Tcl/Tk use version numbers. You can specify these
in SWIG as follows :

% wrap -htcl tcl7.4.h -htk tk4.0.h example.i

Of course, I prefer to simply set up symbolic links between "tcl.h" and
the most recent stable version on the machine.

2. Perl4

This implementation has been based on Perl-4.035. SWIG's interface to
Perl4 is based on the documentation provided in the "Programming Perl"
book by Larry Wall, and files located in the "usub" directory of the
Perl4 distribution.

In order to compile with Perl4, you'll need to link with the uperl.o
file found in the Perl4 source directory. You may want to move this
file to a more convenient location.

3. Perl5

This is a somewhat experimental implementation, but is alot less
buggy than the alpha release. SWIG operates independently of
the XS language and xsubpp supplied with Perl5. Currently SWIG
produces the necessary C code and .pm file needed to dynamically
load a module into Perl5.

To support Perl5's notion of modules and packages (as with xsubpp),
you can use the following command line options :

% wrap -perl5 -module MyModule -package MyPackage example.i

Note : In order for dynamic loading to be effective, you need to be
careful about naming. For a module named "MyModule", you'll need to
create a shared object file called "MyModule.so" using something like

% ld -shared my_obj.o -o MyModule.so

The use of the %init directive must match the module name since Perl5
calls a function "boot_ModuleName" in order to initialize things.
See the Examples directory for some examples of how to get things
to work.

4. Python1.3

This is the first release supporting Python. The Python port is
experimental and may be rewritten. Variable linkage is done through
functions which is sort of a kludge. I also think it would be nice
to import SWIG pointers into Python as a new object (instead of strings).
Of course, this needs a little more work.

5. Guile3

If you really want to live on the edge, pick up a copy of Guile-iii and
play around with this. This is highly experimental---especially since
I'm not sure what the official state of Guile is these days. This
implementation may change at any time should I suddenly figure out better
ways to do things.

6. Extending SWIG

SWIG is written in C++ although I tend to think of the code as mostly
being ANSI C with a little inheritance thrown in. Each target language
is implemented as a C++ class that can be plugged into the system.
If you want to add your own modifications, see Appendix C of the user
manual. Then take a look at the "user" directory which contains some
code for building your own extenions.

7. The SWIG library

The SWIG library is still incomplete. Some of the files mentioned in
the user manual are unavailable. These files will be made available
when they are ready. Subscribe to the SWIG mailing list for announcements
and updates.

8. SWIG Documentation

I have sometimes experienced problems viewing the SWIG documentation in
some postscript viewers. However, the documentation seems to print
normally. I'm working on making much of the documentation online,
but this takes time.

Page 12 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.