Merge branch 'master' of github.com:swig/swig

This commit is contained in:
William S Fulton 2013-01-12 16:55:07 +00:00
commit afc2b884a4
81 changed files with 243 additions and 318 deletions

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SWIG</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View file

@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.10 (in progress)
============================
2013-01-11: Brant Kyser
[Java, C#, D] SF Bug #1299 - Fix generated names for when %nspace is used on
classes with the same name in two different namespaces.
2013-01-11: Vladimir Kalinin
[C#] Add support for csdirectorin 'pre', 'post' and 'terminator' attributes.

View file

@ -25,7 +25,7 @@
<li><a name="i8" href="#8">8. Naming Conventions</a>
<li><a name="i9" href="#9">9. Visibility</a>
<li><a name="i10" href="#10">10. Miscellaneous Coding Guidelines</a>
<li><a name="i11" href="#11">11. SVN Tagging Conventions</a>
<li><a name="i11" href="#11">11. Git Tagging Conventions</a>
</ul>
<a name="1" href="#i1">
@ -119,8 +119,8 @@ are case-insensitive on Windows so this convention will prevent you from inadver
creating two files that differ in case-only.
<p>
Each file should include a short abstract, license information and
a SVN revision tag like this:
Each file should include a short abstract and license information
like this:
<blockquote>
<pre>
@ -137,8 +137,6 @@ a SVN revision tag like this:
* This file defines ...
* ----------------------------------------------------------------------------- */
static char cvs[] = "&#36Id&#36";
#include "swig.h"
/* Declarations */
@ -159,12 +157,6 @@ static int avariable;
</pre>
</blockquote>
The SVN revision tag should be placed into a static string as shown
above mangled with the name of the file.
This adds the revision information to the SWIG executable and
makes it possible to extract version information from a raw binary
(sometimes useful in debugging).
<p>
As a general rule, files start to get unmanageable once they exceed
about 2000 lines. Files larger than this should be broken up into
@ -379,10 +371,10 @@ making your changes.
These are largely covered in the main documentation in the Extending.html file.
<a name="11" href="#i11">
<h2>11. SVN Tagging Conventions</h2>
<h2>11. Git Tagging Conventions</h2>
</a>
Use <tt>svn tag</tt> to declare some set of file revisions as related in some
Use <tt>git tag</tt> to declare some set of file revisions as related in some
symbolic way. This eases reference, retrieval and manipulation of these files
later. At the moment (2001/01/16 14:02:53), the conventions are very simple;
let's hope they stay that way!
@ -390,10 +382,10 @@ let's hope they stay that way!
<p>
There are two types of tags, internal (aka personal) and external.
Internal tags are used by SWIG developers primarily, whereas external
tags are used when communicating with people w/ anonymous svn access.
tags are used when communicating with people w/ anonymous git access.
<ul>
<li> Internal tags should start with the developer name and a hyphen.
<li> External tags should start with "v-".
<li> External tags should start with "rel-".
</ul>
That's all there is to it. Some example tags:
@ -402,10 +394,8 @@ That's all there is to it. Some example tags:
<li> ttn-pre-xml-patch
<li> ttn-post-xml-patch
<li> ttn-going-on-vacation-so-dutifully-tagging-now
<li> v-1-3-a37-fixes-bug-2432
<li> v-1-3-a37-fixes-bug-2433
<li> v-1-3-a37-fixes-bug-2432-again
<li> v-1-3-a37-release
<li> rel-1.3.40
<li> rel-2.0.9
</ul>
<hr>

View file

@ -93,7 +93,7 @@ SWIG along with information about beta releases and future work.
</p>
<p>
Subversion access to the latest version of SWIG is also available. More information
Git and Subversion access to the latest version of SWIG is also available. More information
about this can be obtained at:
</p>

View file

@ -178,6 +178,7 @@ CPP_TEST_CASES += \
director_keywords \
director_namespace_clash \
director_nspace \
director_nspace_director_name_collision \
director_nested \
director_overload \
director_overload2 \

View file

@ -0,0 +1,66 @@
%module(directors="1") director_nspace_director_name_collision
#ifdef SWIGJAVA
SWIG_JAVABODY_PROXY(public, public, SWIGTYPE)
SWIG_JAVABODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
#endif
%{
#include <string>
namespace TopLevel
{
namespace A
{
class Foo {
public:
virtual ~Foo() {}
virtual std::string ping() { return "TopLevel::A::Foo::ping()"; }
};
}
namespace B
{
class Foo {
public:
virtual ~Foo() {}
virtual std::string ping() { return "TopLevel::B:Foo::ping()"; }
};
}
}
%}
%include <std_string.i>
// nspace feature only supported by these languages
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGD)
%nspace TopLevel::A::Foo;
%nspace TopLevel::B::Foo;
#else
#warning nspace feature not yet supported in this target language
#endif
%feature("director") TopLevel::A::Foo;
%feature("director") TopLevel::B::Foo;
namespace TopLevel
{
namespace A
{
class Foo {
public:
virtual ~Foo();
virtual std::string ping();
};
}
namespace B
{
class Foo {
public:
virtual ~Foo();
virtual std::string ping();
};
}
}

View file

@ -46,6 +46,7 @@ SWIGOPT += -package $(JAVA_PACKAGE)
nspace.%: JAVA_PACKAGE = $*Package
nspace_extend.%: JAVA_PACKAGE = $*Package
director_nspace.%: JAVA_PACKAGE = $*Package
director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package
# Rules for the different types of tests
%.cpptest:

View file

@ -20,8 +20,8 @@
* However, this file may be removed in future release of SWIG, so using this file to
* keep these inappropriate names in your SWIG interface file is also not recommended.
* Instead, we provide a simple tool for converting your interface files to
* the new naming convention. You can download the tool here:
* https://swig.svn.sourceforge.net/svnroot/swig/trunk/Tools/pyname_patch.py
* the new naming convention. You can get the tool from the SWIG distribution:
* Tools/pyname_patch.py
*/
%fragment("PySequence_Base", "header", fragment="SwigPySequence_Base") {}

View file

@ -494,7 +494,7 @@ dist:
srcrpm:
rm -fr $(srpm) $(srpm).src.rpm
echo "TODO: update to use svn instead of cvs"
echo "TODO: update to use git instead of cvs"
cvs export -d $(srpm) -r HEAD SWIG
cp swig.spec $(srpm)
tar -cf - $(srpm) | gzip --best > $(srpm).tar.gz
@ -503,7 +503,7 @@ srcrpm:
# Update the autoconf files for detecting host/targets. Automake will do this in
# version 1.10 for our case of not having a top level Makefile.am. Until then we
# can fetch them manually and will have to commit them to SVN.
# can fetch them manually and will have to commit them to Git.
configfiles:
wget ftp://ftp.gnu.org/pub/gnu/config/config.guess -O Tools/config/config.guess
chmod a+x Tools/config/config.guess

48
README
View file

@ -3,9 +3,11 @@ SWIG (Simplified Wrapper and Interface Generator)
Version: 2.0.10 (in progress)
Tagline: SWIG is a compiler that integrates C and C++ with languages
including Perl, Python, Tcl, Ruby, PHP, Java, Ocaml, Lua,
Scheme (Guile, MzScheme, CHICKEN), Pike, C#, Modula-3,
Common Lisp (CLISP, Allegro CL, CFFI, UFFI), Octave and R.
including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua,
Octave, R, Scheme (Guile, MzScheme/Racket, CHICKEN), Ocaml,
Modula-3, Common Lisp (CLISP, Allegro CL, CFFI, UFFI) and Pike.
SWIG can also export its parse tree into Lisp s-expressions and
XML.
SWIG reads annotated C/C++ header files and creates wrapper code (glue
code) in order to make the corresponding C/C++ libraries available to
@ -31,6 +33,22 @@ new features for the current release. The CHANGES file contains bug fixes
and new features for older versions. A summary of changes in each release
can be found in the RELEASENOTES file.
Documentation
=============
The Doc/Manual directory contains the most recent set of updated
documentation for this release. The documentation is available in
three different formats, each of which contains identical content.
These format are, pdf (Doc/Manual/SWIGDocumentation.pdf), single
page html (Doc/Manual/SWIGDocumentation.html) or multiple page html
(other files in Doc/Manual). Please select your chosen format and
copy/install to wherever takes your fancy.
There is some technical developer documentation available in the
Doc/Devel subdirectory. This is not necessarily up-to-date, but it
has some information on SWIG internals.
Documentation is also online at http://www.swig.org/doc.html.
Backwards Compatibility
=======================
The developers strive their best to preserve backwards compatibility
@ -97,9 +115,6 @@ minimal effect. All they do is reduce the amount of testing done with
'make check'. The SWIG executable and library files installed cannot currently
be configured with a subset of target languages.
Please see the Documentation section below on installing documentation as
none is installed by default.
SWIG used to include a set of runtime libraries for some languages for working
with multiple modules. These are no longer built during the installation stage.
However, users can build them just like any wrapper module as described in
@ -108,7 +123,7 @@ examples which build the runtime library.
Notes:
(1) If you checked the code out via SVN, you will have to run ./autogen.sh
(1) If you checked the code out via Git, you will have to run ./autogen.sh
before typing 'configure'. In addition, a full build of SWIG requires
the a number of packages to be installed. Full instructions at
http://www.swig.org/svn.html
@ -175,8 +190,9 @@ The Examples directory contains a variety of examples of using SWIG
and it has some browsable documentation. Simply point your browser to
the file "Example/index.html".
The Examples directory also includes Visual C++ project (.dsp) files for
building some of the examples on Windows.
The Examples directory also includes Visual C++ project 6 (.dsp) files for
building some of the examples on Windows. Later versions of Visual Studio
will convert these old style project files into a current solution file.
Known Issues
============
@ -215,20 +231,6 @@ installed. To fix this:
If you are having other troubles, you might look at the SWIG Wiki at
http://www.dabeaz.com/cgi-bin/wiki.pl.
Documentation
=============
The Doc/Manual directory contains the most recent set of updated
documentation for this release. The documentation is available in
three different formats, each of which contains identical content.
These format are, pdf (Doc/Manual/SWIGDocumentation.pdf), single
page html (Doc/Manual/SWIGDocumentation.html) or multiple page html
(other files in Doc/Manual). Please select your chosen format and
copy/install to wherever takes your fancy.
There is some technical developer documentation available in the
Doc/Devel subdirectory. This is not necessarily up-to-date, but it
has some information on SWIG internals.
Participate!
============
Please report any errors and submit patches (if possible)! We only

View file

@ -15,8 +15,6 @@
* C identifiers up into keywords and SWIG directives.
* ----------------------------------------------------------------------------- */
char cvsroot_cscanner_c[] = "$Id$";
#include "cparse.h"
#include "parser.h"
#include <string.h>

View file

@ -17,8 +17,6 @@
#define yylex yylex
char cvsroot_parser_y[] = "$Id$";
#include "swig.h"
#include "cparse.h"
#include "preprocessor.h"

View file

@ -11,8 +11,6 @@
* Expands a template into a specialized version.
* ----------------------------------------------------------------------------- */
char cvsroot_templ_c[] = "$Id$";
#include "swig.h"
#include "cparse.h"

View file

@ -11,8 +11,6 @@
* Parsing utilities.
* ----------------------------------------------------------------------------- */
char cvsroot_util_c[] = "$Id$";
#include "swig.h"
#include "cparse.h"

View file

@ -12,8 +12,6 @@
* DOH objects. A number of small utility functions are also included.
* ----------------------------------------------------------------------------- */
char cvsroot_base_c[] = "$Id$";
#include "dohint.h"
/* -----------------------------------------------------------------------------

View file

@ -12,8 +12,6 @@
* ordinary FILE * or integer file descriptor.
* ----------------------------------------------------------------------------- */
char cvsroot_file_c[] = "$Id$";
#include "dohint.h"
#ifdef DOH_INTFILE

View file

@ -12,8 +12,6 @@
* formatted output, readline, and splitting.
* ----------------------------------------------------------------------------- */
char cvsroot_fio_c[] = "$Id$";
#include "dohint.h"
#define OBUFLEN 512

View file

@ -11,8 +11,6 @@
* Implements a simple hash table object.
* ----------------------------------------------------------------------------- */
char cvsroot_hash_c[] = "$Id$";
#include "dohint.h"
extern DohObjInfo DohHashType;

View file

@ -11,8 +11,6 @@
* Implements a simple list object.
* ----------------------------------------------------------------------------- */
char cvsroot_list_c[] = "$Id$";
#include "dohint.h"
typedef struct List {

View file

@ -12,8 +12,6 @@
* of objects and checking of objects.
* ----------------------------------------------------------------------------- */
char cvsroot_memory_c[] = "$Id$";
#include "dohint.h"
#ifndef DOH_POOL_SIZE

View file

@ -12,8 +12,6 @@
* file semantics.
* ----------------------------------------------------------------------------- */
char cvsroot_string_c[] = "$Id$";
#include "dohint.h"
extern DohObjInfo DohStringType;

View file

@ -12,8 +12,6 @@
* an arbitrary C object represented as a void *.
* ----------------------------------------------------------------------------- */
char cvsroot_void_c[] = "$Id$";
#include "dohint.h"
typedef struct {

View file

@ -11,8 +11,6 @@
* ALLEGROCL language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_allegrocl_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"
#include <ctype.h>

View file

@ -15,8 +15,6 @@
* Doc/Manual/SWIGPlus.html for details.
* ----------------------------------------------------------------------------- */
char cvsroot_allocate_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"

View file

@ -12,8 +12,6 @@
* feature that's normally disabled.
* ----------------------------------------------------------------------------- */
char cvsroot_browser_cxx[] = "$Id$";
#include "swigmod.h"
#ifdef SWIG_SWILL

View file

@ -11,8 +11,6 @@
* cffi language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_cffi_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"
#include <ctype.h>

View file

@ -11,8 +11,6 @@
* CHICKEN language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_chicken_cxx[] = "$Id$";
#include "swigmod.h"
#include <ctype.h>

View file

@ -11,8 +11,6 @@
* clisp language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_clisp_cxx[] = "$Id$";
#include "swigmod.h"
static const char *usage = (char *) "\

View file

@ -11,8 +11,6 @@
* Support for Wrap by Contract in SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_contract_cxx[] = "$Id$";
#include "swigmod.h"
/* Contract structure. This holds rules about the different kinds of contract sections

View file

@ -11,8 +11,6 @@
* C# language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_csharp_cxx[] = "$Id$";
#include "swigmod.h"
#include <limits.h> // for INT_MAX
#include "cparse.h"
@ -198,24 +196,6 @@ public:
return proxyname;
}
/* -----------------------------------------------------------------------------
* directorClassName()
* ----------------------------------------------------------------------------- */
String *directorClassName(Node *n) {
String *dirclassname;
const char *attrib = "director:classname";
if (!(dirclassname = Getattr(n, attrib))) {
String *classname = Getattr(n, "sym:name");
dirclassname = NewStringf("SwigDirector_%s", classname);
Setattr(n, attrib, dirclassname);
}
return dirclassname;
}
/* ------------------------------------------------------------
* main()
* ------------------------------------------------------------ */
@ -3407,6 +3387,7 @@ public:
String *sym_name = Getattr(n, "sym:name");
String *qualified_classname = Copy(sym_name);
String *nspace = getNSpace();
String *dirClassName = directorClassName(n);
if (nspace)
Insert(qualified_classname, 0, NewStringf("%s.", nspace));
@ -3418,7 +3399,7 @@ public:
Printf(code_wrap->def, "SWIGEXPORT void SWIGSTDCALL %s(void *objarg", wname);
Printf(code_wrap->code, " %s *obj = (%s *)objarg;\n", norm_name, norm_name);
Printf(code_wrap->code, " SwigDirector_%s *director = dynamic_cast<SwigDirector_%s *>(obj);\n", sym_name, sym_name);
Printf(code_wrap->code, " %s *director = dynamic_cast<%s *>(obj);\n", dirClassName, dirClassName);
// TODO: if statement not needed?? - Java too
Printf(code_wrap->code, " if (director) {\n");
Printf(code_wrap->code, " director->swig_connect_director(");
@ -3430,7 +3411,7 @@ public:
Printf(code_wrap->def, ", ");
if (i != first_class_dmethod)
Printf(code_wrap->code, ", ");
Printf(code_wrap->def, "SwigDirector_%s::SWIG_Callback%s_t callback%s", sym_name, methid, methid);
Printf(code_wrap->def, "%s::SWIG_Callback%s_t callback%s", dirClassName, methid, methid);
Printf(code_wrap->code, "callback%s", methid);
Printf(imclass_class_code, ", %s.SwigDelegate%s_%s delegate%s", qualified_classname, sym_name, methid, methid);
}
@ -3447,6 +3428,7 @@ public:
Delete(wname);
Delete(swig_director_connect);
Delete(qualified_classname);
Delete(dirClassName);
}
/* ---------------------------------------------------------------
@ -3958,7 +3940,7 @@ public:
Node *parent = parentNode(n);
String *decl = Getattr(n, "decl");
String *supername = Swig_class_name(parent);
String *classname = directorClassName(parent);
String *dirclassname = directorClassName(parent);
String *sub = NewString("");
Parm *p;
ParmList *superparms = Getattr(n, "parms");
@ -3982,11 +3964,11 @@ public:
/* constructor */
{
String *basetype = Getattr(parent, "classtype");
String *target = Swig_method_decl(0, decl, classname, parms, 0, 0);
String *target = Swig_method_decl(0, decl, dirclassname, parms, 0, 0);
String *call = Swig_csuperclass_call(0, basetype, superparms);
String *classtype = SwigType_namestr(Getattr(n, "name"));
Printf(f_directors, "%s::%s : %s, %s {\n", classname, target, call, Getattr(parent, "director:ctor"));
Printf(f_directors, "%s::%s : %s, %s {\n", dirclassname, target, call, Getattr(parent, "director:ctor"));
Printf(f_directors, " swig_init_callbacks();\n");
Printf(f_directors, "}\n\n");
@ -3997,7 +3979,7 @@ public:
/* constructor header */
{
String *target = Swig_method_decl(0, decl, classname, parms, 0, 1);
String *target = Swig_method_decl(0, decl, dirclassname, parms, 0, 1);
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
@ -4006,6 +3988,7 @@ public:
Delete(sub);
Delete(supername);
Delete(parms);
Delete(dirclassname);
return Language::classDirectorConstructor(n);
}
@ -4014,18 +3997,18 @@ public:
* ------------------------------------------------------------ */
int classDirectorDefaultConstructor(Node *n) {
String *classname = Swig_class_name(n);
String *dirclassname = directorClassName(n);
String *classtype = SwigType_namestr(Getattr(n, "name"));
Wrapper *w = NewWrapper();
Printf(w->def, "SwigDirector_%s::SwigDirector_%s() : %s {", classname, classname, Getattr(n, "director:ctor"));
Printf(w->def, "%s::%s() : %s {", dirclassname, dirclassname, Getattr(n, "director:ctor"));
Printf(w->code, "}\n");
Wrapper_print(w, f_directors);
Printf(f_directors_h, " SwigDirector_%s();\n", classname);
Printf(f_directors_h, " %s();\n", dirclassname);
DelWrapper(w);
Delete(classtype);
Delete(classname);
Delete(dirclassname);
return Language::classDirectorDefaultConstructor(n);
}
@ -4066,15 +4049,15 @@ public:
int classDirectorDestructor(Node *n) {
Node *current_class = getCurrentClass();
String *classname = Swig_class_name(current_class);
String *dirclassname = directorClassName(current_class);
Wrapper *w = NewWrapper();
if (Getattr(n, "throw")) {
Printf(f_directors_h, " virtual ~SwigDirector_%s() throw ();\n", classname);
Printf(w->def, "SwigDirector_%s::~SwigDirector_%s() throw () {\n", classname, classname);
Printf(f_directors_h, " virtual ~%s() throw ();\n", dirclassname);
Printf(w->def, "%s::~%s() throw () {\n", dirclassname, dirclassname);
} else {
Printf(f_directors_h, " virtual ~SwigDirector_%s();\n", classname);
Printf(w->def, "SwigDirector_%s::~SwigDirector_%s() {\n", classname, classname);
Printf(f_directors_h, " virtual ~%s();\n", dirclassname);
Printf(w->def, "%s::~%s() {\n", dirclassname, dirclassname);
}
Printv(w->code, "}\n", NIL);
@ -4082,7 +4065,7 @@ public:
Wrapper_print(w, f_directors);
DelWrapper(w);
Delete(classname);
Delete(dirclassname);
return SWIG_OK;
}
@ -4172,8 +4155,7 @@ public:
String *base = Getattr(n, "classtype");
String *class_ctor = NewString("Swig::Director()");
String *classname = Swig_class_name(n);
String *directorname = NewStringf("SwigDirector_%s", classname);
String *directorname = directorClassName(n);
String *declaration = Swig_class_declaration(n, directorname);
Printf(declaration, " : public %s, public Swig::Director", base);
@ -4181,6 +4163,8 @@ public:
// Stash stuff for later.
Setattr(n, "director:decl", declaration);
Setattr(n, "director:ctor", class_ctor);
Delete(directorname);
}
}; /* class CSHARP */

View file

@ -11,8 +11,6 @@
* D language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_d_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"
#include <ctype.h>
@ -1897,7 +1895,7 @@ public:
// Write C++ director class declaration, for example:
// class SwigDirector_myclass : public myclass, public Swig::Director {
String *classname = Swig_class_name(n);
String *directorname = NewStringf("SwigDirector_%s", classname);
String *directorname = directorClassName(n);
String *declaration = Swig_class_declaration(n, directorname);
const String *base = Getattr(n, "classtype");
@ -1949,7 +1947,7 @@ public:
bool pure_virtual = (!(Cmp(storage, "virtual")) && !(Cmp(value, "0")));
int status = SWIG_OK;
bool output_director = true;
String *dirclassname = getDirectorClassName(parent);
String *dirclassname = directorClassName(parent);
String *qualified_name = NewStringf("%s::%s", dirclassname, name);
SwigType *c_ret_type = NULL;
String *dcallback_call_args = NewString("");
@ -2373,10 +2371,12 @@ public:
Printf(director_callback_pointers, " SWIG_Callback%s_t swig_callback_%s;\n", methid, overloaded_name);
// Write the type alias for the callback to the intermediary D module.
String* proxy_callback_type = NewString("");
Printf(proxy_callback_type, "SwigDirector_%s_Callback%s", classname, methid);
String *proxy_callback_type = NewString("");
String *dirClassName = directorClassName(parent);
Printf(proxy_callback_type, "%s_Callback%s", dirClassName, methid);
Printf(im_dmodule_code, "alias extern(C) %s function(void*%s) %s;\n", proxy_callback_return_type, delegate_parms, proxy_callback_type);
Delete(proxy_callback_type);
Delete(dirClassName);
}
Delete(qualified_return);
@ -2399,7 +2399,7 @@ public:
Node *parent = parentNode(n);
String *decl = Getattr(n, "decl");;
String *supername = Swig_class_name(parent);
String *classname = getDirectorClassName(parent);
String *dirclassname = directorClassName(parent);
String *sub = NewString("");
Parm *p;
ParmList *superparms = Getattr(n, "parms");
@ -2423,11 +2423,11 @@ public:
/* constructor */
{
String *basetype = Getattr(parent, "classtype");
String *target = Swig_method_decl(0, decl, classname, parms, 0, 0);
String *target = Swig_method_decl(0, decl, dirclassname, parms, 0, 0);
String *call = Swig_csuperclass_call(0, basetype, superparms);
String *classtype = SwigType_namestr(Getattr(n, "name"));
Printf(f_directors, "%s::%s : %s, %s {\n", classname, target, call, Getattr(parent, "director:ctor"));
Printf(f_directors, "%s::%s : %s, %s {\n", dirclassname, target, call, Getattr(parent, "director:ctor"));
Printf(f_directors, " swig_init_callbacks();\n");
Printf(f_directors, "}\n\n");
@ -2438,7 +2438,7 @@ public:
/* constructor header */
{
String *target = Swig_method_decl(0, decl, classname, parms, 0, 1);
String *target = Swig_method_decl(0, decl, dirclassname, parms, 0, 1);
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
@ -2447,6 +2447,7 @@ public:
Delete(sub);
Delete(supername);
Delete(parms);
Delete(dirclassname);
return Language::classDirectorConstructor(n);
}
@ -2454,18 +2455,18 @@ public:
* D::classDirectorDefaultConstructor()
* --------------------------------------------------------------------------- */
virtual int classDirectorDefaultConstructor(Node *n) {
String *classname = Swig_class_name(n);
String *dirclassname = directorClassName(n);
String *classtype = SwigType_namestr(Getattr(n, "name"));
Wrapper *w = NewWrapper();
Printf(w->def, "SwigDirector_%s::SwigDirector_%s() : %s {", classname, classname, Getattr(n, "director:ctor"));
Printf(w->def, "%s::%s() : %s {", dirclassname, dirclassname, Getattr(n, "director:ctor"));
Printf(w->code, "}\n");
Wrapper_print(w, f_directors);
Printf(f_directors_h, " SwigDirector_%s();\n", classname);
Printf(f_directors_h, " %s();\n", dirclassname);
DelWrapper(w);
Delete(classtype);
Delete(classname);
Delete(dirclassname);
return Language::classDirectorDefaultConstructor(n);
}
@ -2474,15 +2475,15 @@ public:
* --------------------------------------------------------------------------- */
virtual int classDirectorDestructor(Node *n) {
Node *current_class = getCurrentClass();
String *classname = Swig_class_name(current_class);
String *dirclassname = directorClassName(current_class);
Wrapper *w = NewWrapper();
if (Getattr(n, "throw")) {
Printf(f_directors_h, " virtual ~SwigDirector_%s() throw ();\n", classname);
Printf(w->def, "SwigDirector_%s::~SwigDirector_%s() throw () {\n", classname, classname);
Printf(f_directors_h, " virtual ~%s() throw ();\n", dirclassname);
Printf(w->def, "%s::~%s() throw () {\n", dirclassname, dirclassname);
} else {
Printf(f_directors_h, " virtual ~SwigDirector_%s();\n", classname);
Printf(w->def, "SwigDirector_%s::~SwigDirector_%s() {\n", classname, classname);
Printf(f_directors_h, " virtual ~%s();\n", dirclassname);
Printf(w->def, "%s::~%s() {\n", dirclassname, dirclassname);
}
Printv(w->code, "}\n", NIL);
@ -2490,7 +2491,7 @@ public:
Wrapper_print(w, f_directors);
DelWrapper(w);
Delete(classname);
Delete(dirclassname);
return SWIG_OK;
}
@ -2499,7 +2500,7 @@ public:
* --------------------------------------------------------------------------- */
virtual int classDirectorEnd(Node *n) {
int i;
String *director_classname = getDirectorClassName(n);
String *director_classname = directorClassName(n);
Wrapper *w = NewWrapper();
@ -3308,7 +3309,7 @@ private:
// If directors are enabled for the current class, generate the
// director connect helper function which is called from the constructor
// and write it to the class body.
writeDirectorConnectProxy();
writeDirectorConnectProxy(n);
}
// Write all constants and enumerations first to prevent forward reference
@ -3475,12 +3476,15 @@ private:
}
/* ---------------------------------------------------------------------------
* D::writeDirectorConnectProxy()
* D::writeDirectorConnectProxy(Node *classNode)
*
* Writes the helper method which registers the director callbacks by calling
* the director connect function from the D side to the proxy class.
* --------------------------------------------------------------------------- */
void writeDirectorConnectProxy() {
void writeDirectorConnectProxy(Node* classNode) {
String *dirClassName = directorClassName(classNode);
String *connect_name = Swig_name_member(getNSpace(),
proxy_class_name, "director_connect");
Printf(proxy_class_body_code, "\nprivate void swigDirectorConnect() {\n");
int i;
@ -3491,12 +3495,12 @@ private:
String *return_type = Getattr(udata, "return_type");
String *param_list = Getattr(udata, "param_list");
String *methid = Getattr(udata, "class_methodidx");
Printf(proxy_class_body_code, " %s.SwigDirector_%s_Callback%s callback%s;\n", im_dmodule_fq_name, proxy_class_name, methid, methid);
Printf(proxy_class_body_code, " %s.%s_Callback%s callback%s;\n", im_dmodule_fq_name, dirClassName, methid, methid);
Printf(proxy_class_body_code, " if (swigIsMethodOverridden!(%s delegate(%s), %s function(%s), %s)()) {\n", return_type, param_list, return_type, param_list, method);
Printf(proxy_class_body_code, " callback%s = &swigDirectorCallback_%s_%s;\n", methid, proxy_class_name, overloaded_name);
Printf(proxy_class_body_code, " }\n\n");
}
Printf(proxy_class_body_code, " %s.%s_director_connect(cast(void*)swigCPtr, cast(void*)this", im_dmodule_fq_name, proxy_class_name);
Printf(proxy_class_body_code, " %s.%s(cast(void*)swigCPtr, cast(void*)this", im_dmodule_fq_name, connect_name);
for (i = first_class_dmethod; i < curr_class_dmethod; ++i) {
UpcallData *udata = Getitem(dmethods_seq, i);
String *methid = Getattr(udata, "class_methodidx");
@ -3532,6 +3536,8 @@ private:
director_callback_pointers = NULL;
Delete(director_dcallbacks_code);
director_dcallbacks_code = NULL;
Delete(dirClassName);
Delete(connect_name);
}
/* ---------------------------------------------------------------------------
@ -3548,7 +3554,7 @@ private:
String *norm_name = SwigType_namestr(Getattr(n, "name"));
String *connect_name = Swig_name_member(getNSpace(),
proxy_class_name, "director_connect");
String *sym_name = Getattr(n, "sym:name");
String *dirClassName = directorClassName(n);
Wrapper *code_wrap;
Printv(wrapper_loader_bind_code, wrapper_loader_bind_command, NIL);
@ -3561,7 +3567,7 @@ private:
Printf(code_wrap->def, "SWIGEXPORT void D_%s(void *objarg, void *dobj", connect_name);
Printf(code_wrap->code, " %s *obj = (%s *)objarg;\n", norm_name, norm_name);
Printf(code_wrap->code, " SwigDirector_%s *director = dynamic_cast<SwigDirector_%s *>(obj);\n", sym_name, sym_name);
Printf(code_wrap->code, " %s *director = dynamic_cast<%s *>(obj);\n", dirClassName, dirClassName);
Printf(code_wrap->code, " if (director) {\n");
Printf(code_wrap->code, " director->swig_connect_director(dobj");
@ -3570,9 +3576,9 @@ private:
UpcallData *udata = Getitem(dmethods_seq, i);
String *methid = Getattr(udata, "class_methodidx");
Printf(code_wrap->def, ", SwigDirector_%s::SWIG_Callback%s_t callback%s", sym_name, methid, methid);
Printf(code_wrap->def, ", %s::SWIG_Callback%s_t callback%s", dirClassName, methid, methid);
Printf(code_wrap->code, ", callback%s", methid);
Printf(im_dmodule_code, ", SwigDirector_%s_Callback%s callback%s", sym_name, methid, methid);
Printf(im_dmodule_code, ", %s_Callback%s callback%s", dirClassName, methid, methid);
}
Printf(code_wrap->def, ") {\n");
@ -3585,6 +3591,7 @@ private:
DelWrapper(code_wrap);
Delete(connect_name);
Delete(dirClassName);
}
/* ---------------------------------------------------------------------------
@ -4298,23 +4305,6 @@ private:
return proxyname;
}
/* ---------------------------------------------------------------------------
* D::directorClassName()
* --------------------------------------------------------------------------- */
String *getDirectorClassName(Node *n) const {
String *dirclassname;
const char *attrib = "director:classname";
if (!(dirclassname = Getattr(n, attrib))) {
String *classname = Getattr(n, "sym:name");
dirclassname = NewStringf("SwigDirector_%s", classname);
Setattr(n, attrib, dirclassname);
}
return dirclassname;
}
/* ---------------------------------------------------------------------------
* D::makeParameterName()
*

View file

@ -13,8 +13,6 @@
* in SWIG. --MR
* ----------------------------------------------------------------------------- */
char cvsroot_directors_cxx[] = "$Id";
#include "swigmod.h"
/* Swig_csuperclass_call()
@ -78,9 +76,10 @@ String *Swig_class_name(Node *n) {
String *Swig_director_declaration(Node *n) {
String *classname = Swig_class_name(n);
String *directorname = NewStringf("SwigDirector_%s", classname);
String *directorname = Language::instance()->directorClassName(n);
String *base = Getattr(n, "classtype");
String *declaration = Swig_class_declaration(n, directorname);
Printf(declaration, " : public %s, public Swig::Director {\n", base);
Delete(classname);
Delete(directorname);
@ -280,9 +279,10 @@ void Swig_director_emit_dynamic_cast(Node *n, Wrapper *f) {
checkAttribute(n, "storage", "static"))
&& !Equal(nodeType(n), "constructor"))) {
Node *parent = Getattr(n, "parentNode");
String *symname = Getattr(parent, "sym:name");
String *dirname = NewStringf("SwigDirector_%s", symname);
String *dirdecl = NewStringf("%s *darg = 0", dirname);
String *dirname;
String *dirdecl;
dirname = Language::instance()->directorClassName(parent);
dirdecl = NewStringf("%s *darg = 0", dirname);
Wrapper_add_local(f, "darg", dirdecl);
Printf(f->code, "darg = dynamic_cast<%s *>(arg1);\n", dirname);
Delete(dirname);

View file

@ -11,8 +11,6 @@
* Useful functions for emitting various pieces of code.
* ----------------------------------------------------------------------------- */
char cvsroot_emit_cxx[] = "$Id$";
#include "swigmod.h"
/* -----------------------------------------------------------------------------

View file

@ -7,8 +7,6 @@
* Go language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_go_cxx[] = "$Id";
#include "swigmod.h"
#include "cparse.h"
#include <ctype.h>

View file

@ -11,8 +11,6 @@
* Guile language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_guile_cxx[] = "$Id$";
#include "swigmod.h"
#include <ctype.h>

View file

@ -11,8 +11,6 @@
* Java language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_java_cxx[] = "$Id$";
#include "swigmod.h"
#include <limits.h> // for INT_MAX
#include "cparse.h"
@ -204,24 +202,6 @@ public:
return valid_jni_name;
}
/* -----------------------------------------------------------------------------
* directorClassName()
* ----------------------------------------------------------------------------- */
String *directorClassName(Node *n) {
String *dirclassname;
const char *attrib = "director:classname";
if (!(dirclassname = Getattr(n, attrib))) {
String *classname = Getattr(n, "sym:name");
dirclassname = NewStringf("SwigDirector_%s", classname);
Setattr(n, attrib, dirclassname);
}
return dirclassname;
}
/* ------------------------------------------------------------
* main()
* ------------------------------------------------------------ */
@ -2008,7 +1988,7 @@ public:
Printf(dcast_wrap->code, " jobject jresult = (jobject) 0;\n");
Printf(dcast_wrap->code, " %s *obj = *((%s **)&jCPtrBase);\n", norm_name, norm_name);
Printf(dcast_wrap->code, " if (obj) director = dynamic_cast<Swig::Director *>(obj);\n");
Printf(dcast_wrap->code, " if (director) jresult = director->swig_get_self(jenv);\n");
Printf(dcast_wrap->code, " if (director) jresult = director->swig_get_self);\n");
Printf(dcast_wrap->code, " return jresult;\n");
Printf(dcast_wrap->code, "}\n");
@ -3380,8 +3360,8 @@ public:
String *norm_name = SwigType_namestr(Getattr(n, "name"));
String *swig_director_connect = Swig_name_member(getNSpace(), proxy_class_name, "director_connect");
String *swig_director_connect_jni = makeValidJniName(swig_director_connect);
String *sym_name = Getattr(n, "sym:name");
String *smartptr_feature = Getattr(n, "feature:smartptr");
String *dirClassName = directorClassName(n);
Wrapper *code_wrap;
Printf(imclass_class_code, " public final static native void %s(%s obj, long cptr, boolean mem_own, boolean weak_global);\n",
@ -3401,12 +3381,12 @@ public:
Printf(code_wrap->code, " // raw pointer alive. This is done instead of using the smart pointer's dynamic cast\n");
Printf(code_wrap->code, " // feature since different smart pointer implementations have differently named dynamic\n");
Printf(code_wrap->code, " // cast mechanisms.\n");
Printf(code_wrap->code, " SwigDirector_%s *director = dynamic_cast<SwigDirector_%s *>(obj->operator->());\n", sym_name, sym_name);
Printf(code_wrap->code, " %s *director = dynamic_cast<%s *>(obj->operator->());\n", dirClassName, dirClassName);
}
else {
Printf(code_wrap->code, " %s *obj = *((%s **)&objarg);\n", norm_name, norm_name);
Printf(code_wrap->code, " (void)jcls;\n");
Printf(code_wrap->code, " SwigDirector_%s *director = dynamic_cast<SwigDirector_%s *>(obj);\n", sym_name, sym_name);
Printf(code_wrap->code, " %s *director = dynamic_cast<%s *>(obj);\n", dirClassName, dirClassName);
}
Printf(code_wrap->code, " if (director) {\n");
@ -3432,7 +3412,7 @@ public:
"SWIGEXPORT void JNICALL Java_%s%s_%s(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {\n",
jnipackage, jni_imclass_name, changeown_jnimethod_name);
Printf(code_wrap->code, " %s *obj = *((%s **)&objarg);\n", norm_name, norm_name);
Printf(code_wrap->code, " SwigDirector_%s *director = dynamic_cast<SwigDirector_%s *>(obj);\n", sym_name, sym_name);
Printf(code_wrap->code, " %s *director = dynamic_cast<%s *>(obj);\n", dirClassName, dirClassName);
Printf(code_wrap->code, " (void)jcls;\n");
Printf(code_wrap->code, " if (director) {\n");
Printf(code_wrap->code, " director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);\n");
@ -3445,6 +3425,7 @@ public:
Delete(changeown_method_name);
Delete(changeown_jnimethod_name);
Delete(norm_name);
Delete(dirClassName);
Delete(jni_imclass_name);
}
@ -3583,7 +3564,7 @@ public:
// we're consistent with the sym:overload name in functionWrapper. (?? when
// does the overloaded method name get set?)
imclass_dmethod = NewStringf("SwigDirector_%s", Swig_name_member(getNSpace(), classname, overloaded_name));
imclass_dmethod = NewStringf("%s", Swig_name_member(getNSpace(), dirclassname, overloaded_name));
qualified_return = SwigType_rcaststr(returntype, "c_result");
@ -4116,7 +4097,7 @@ public:
Node *parent = parentNode(n);
String *decl = Getattr(n, "decl");
String *supername = Swig_class_name(parent);
String *classname = directorClassName(parent);
String *dirclassname = directorClassName(parent);
String *sub = NewString("");
Parm *p;
ParmList *superparms = Getattr(n, "parms");
@ -4148,11 +4129,11 @@ public:
/* constructor */
{
String *basetype = Getattr(parent, "classtype");
String *target = Swig_method_decl(0, decl, classname, parms, 0, 0);
String *target = Swig_method_decl(0, decl, dirclassname, parms, 0, 0);
String *call = Swig_csuperclass_call(0, basetype, superparms);
String *classtype = SwigType_namestr(Getattr(n, "name"));
Printf(f_directors, "%s::%s : %s, %s {\n", classname, target, call, Getattr(parent, "director:ctor"));
Printf(f_directors, "%s::%s : %s, %s {\n", dirclassname, target, call, Getattr(parent, "director:ctor"));
Printf(f_directors, "}\n\n");
Delete(classtype);
@ -4162,7 +4143,7 @@ public:
/* constructor header */
{
String *target = Swig_method_decl(0, decl, classname, parms, 0, 1);
String *target = Swig_method_decl(0, decl, dirclassname, parms, 0, 1);
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
@ -4172,6 +4153,7 @@ public:
Delete(supername);
Delete(jenv_type);
Delete(parms);
Delete(dirclassname);
return Language::classDirectorConstructor(n);
}
@ -4182,16 +4164,18 @@ public:
int classDirectorDefaultConstructor(Node *n) {
String *classname = Swig_class_name(n);
String *classtype = SwigType_namestr(Getattr(n, "name"));
String *dirClassName = directorClassName(n);
Wrapper *w = NewWrapper();
Printf(w->def, "SwigDirector_%s::SwigDirector_%s(JNIEnv *jenv) : %s {", classname, classname, Getattr(n, "director:ctor"));
Printf(w->def, "%s::%s(JNIEnv *jenv) : %s {", dirClassName, dirClassName, Getattr(n, "director:ctor"));
Printf(w->code, "}\n");
Wrapper_print(w, f_directors);
Printf(f_directors_h, " SwigDirector_%s(JNIEnv *jenv);\n", classname);
Printf(f_directors_h, " %s(JNIEnv *jenv);\n", dirClassName);
DelWrapper(w);
Delete(classtype);
Delete(classname);
Delete(dirClassName);
directorPrefixArgs(n);
return Language::classDirectorDefaultConstructor(n);
}
@ -4228,14 +4212,15 @@ public:
Node *current_class = getCurrentClass();
String *full_classname = Getattr(current_class, "name");
String *classname = Swig_class_name(current_class);
String *dirClassName = directorClassName(current_class);
Wrapper *w = NewWrapper();
if (Getattr(n, "throw")) {
Printf(f_directors_h, " virtual ~SwigDirector_%s() throw ();\n", classname);
Printf(w->def, "SwigDirector_%s::~SwigDirector_%s() throw () {\n", classname, classname);
Printf(f_directors_h, " virtual ~%s() throw ();\n", dirClassName);
Printf(w->def, "%s::~%s() throw () {\n", dirClassName, dirClassName);
} else {
Printf(f_directors_h, " virtual ~SwigDirector_%s();\n", classname);
Printf(w->def, "SwigDirector_%s::~SwigDirector_%s() {\n", classname, classname);
Printf(f_directors_h, " virtual ~%s();\n", dirClassName);
Printf(w->def, "%s::~%s() {\n", dirClassName, dirClassName);
}
/* Ensure that correct directordisconnect typemap's method name is called
@ -4254,6 +4239,7 @@ public:
DelWrapper(w);
Delete(disconn_attr);
Delete(classname);
Delete(dirClassName);
return SWIG_OK;
}
@ -4400,8 +4386,7 @@ public:
String *base = Getattr(n, "classtype");
String *class_ctor = NewString("Swig::Director(jenv)");
String *classname = Swig_class_name(n);
String *directorname = NewStringf("SwigDirector_%s", classname);
String *directorname = directorClassName(n);
String *declaration = Swig_class_declaration(n, directorname);
Printf(declaration, " : public %s, public Swig::Director", base);

View file

@ -11,8 +11,6 @@
* Language base class functions. Default C++ handling is also implemented here.
* ----------------------------------------------------------------------------- */
char cvsroot_lang_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"
#include <ctype.h>
@ -347,6 +345,27 @@ Language::~Language() {
this_ = 0;
}
/* -----------------------------------------------------------------------------
* directorClassName()
* ----------------------------------------------------------------------------- */
String *Language::directorClassName(Node *n) {
String *dirclassname;
String *nspace = NewString(Getattr(n, "sym:nspace"));
const char *attrib = "director:classname";
String *classname = Getattr(n, "sym:name");
Replace(nspace, NSPACE_SEPARATOR, "_", DOH_REPLACE_ANY);
if (Len(nspace) > 0)
dirclassname = NewStringf("SwigDirector_%s_%s", nspace, classname);
else
dirclassname = NewStringf("SwigDirector_%s", classname);
Setattr(n, attrib, dirclassname);
Delete(nspace);
return dirclassname;
}
/* ----------------------------------------------------------------------
emit_one()
---------------------------------------------------------------------- */
@ -2405,7 +2424,7 @@ int Language::classDeclaration(Node *n) {
}
if (dir) {
DirectorClassName = NewStringf("SwigDirector_%s", symname);
DirectorClassName = directorClassName(n);
classDirector(n);
}
/* check for abstract after resolving directors */

View file

@ -44,8 +44,6 @@
Added support for embedded Lua. Try swig -lua -help for more information
*/
char cvsroot_lua_cxx[] = "$Id$";
#include "swigmod.h"
/**** Diagnostics:

View file

@ -11,8 +11,6 @@
* Main entry point to the SWIG core.
* ----------------------------------------------------------------------------- */
char cvsroot_main_cxx[] = "$Id$";
#include "swigconfig.h"
#if defined(_WIN32)

View file

@ -11,8 +11,6 @@
* Modula3 language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_modula3_cxx[] = "$Id$";
/*
Text formatted with
indent -sob -br -ce -nut -npsl

View file

@ -11,8 +11,6 @@
* This file is responsible for the module system.
* ----------------------------------------------------------------------------- */
char cvsroot_module_cxx[] = "$Id$";
#include "swigmod.h"
struct Module {

View file

@ -11,8 +11,6 @@
* Mzscheme language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_mzscheme_cxx[] = "$Id$";
#include "swigmod.h"
#include <ctype.h>

View file

@ -11,8 +11,6 @@
* Ocaml language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_ocaml_cxx[] = "$Id$";
#include "swigmod.h"
#include <ctype.h>

View file

@ -11,8 +11,6 @@
* Octave language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_octave_cxx[] = "$Id$";
#include "swigmod.h"
static String *global_name = 0;

View file

@ -13,8 +13,6 @@
* building a dispatch function.
* ----------------------------------------------------------------------------- */
char cvsroot_overload_cxx[] = "$Id$";
#include "swigmod.h"
#define MAX_OVERLOAD 4096

View file

@ -11,8 +11,6 @@
* Perl5 language module for SWIG.
* ------------------------------------------------------------------------- */
char cvsroot_perl5_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"
static int treduce = SWIG_cparse_template_reduce(0);

View file

@ -37,8 +37,6 @@
* (may need to add more WARN_PHP_xxx codes...)
*/
char cvsroot_php_cxx[] = "$Id$";
#include "swigmod.h"
#include <ctype.h>

View file

@ -29,8 +29,6 @@
*
*/
char cvsroot_pike_cxx[] = "$Id$";
#include "swigmod.h"
#include <ctype.h> // for isalnum()

View file

@ -11,8 +11,6 @@
* Python language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_python_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"

View file

@ -11,8 +11,6 @@
* R language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_r_cxx[] = "$Id$";
#include "swigmod.h"
static const double DEFAULT_NUMBER = .0000123456712312312323;

View file

@ -11,8 +11,6 @@
* Ruby language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_ruby_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"
static int treduce = SWIG_cparse_template_reduce(0);

View file

@ -11,8 +11,6 @@
* A parse tree represented as Lisp s-expressions.
* ----------------------------------------------------------------------------- */
char cvsroot_s_exp_cxx[] = "$Id$";
#include "swigmod.h"
#include "dohint.h"

View file

@ -16,8 +16,6 @@
* to SWIG, you would modify this file.
* ----------------------------------------------------------------------------- */
char cvsroot_swigmain_cxx[] = "$Id$";
#include "swigmod.h"
#include <ctype.h>

View file

@ -120,6 +120,8 @@ public:
virtual ~Language();
virtual int emit_one(Node *n);
String *directorClassName(Node *n);
/* Parse command line options */
virtual void main(int argc, char *argv[]);

View file

@ -11,8 +11,6 @@
* Tcl8 language module for SWIG.
* ----------------------------------------------------------------------------- */
char cvsroot_tcl8_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"
static int treduce = SWIG_cparse_template_reduce(0);

View file

@ -16,8 +16,6 @@
* and other information needed for compilation.
* ----------------------------------------------------------------------------- */
char cvsroot_typepass_cxx[] = "$Id$";
#include "swigmod.h"
#include "cparse.h"

View file

@ -13,8 +13,6 @@
// TODO: remove remnants of lisptype
char cvsroot_uffi_cxx[] = "$Id$";
#include "swigmod.h"
static const char *usage = (char *) "\

View file

@ -11,8 +11,6 @@
* Various utility functions.
* ----------------------------------------------------------------------------- */
char cvsroot_utils_cxx[] = "$Id$";
#include <swigmod.h>
int is_public(Node *n) {

View file

@ -11,8 +11,6 @@
* An Xml parse tree generator.
* ----------------------------------------------------------------------------- */
char cvsroot_xml_cxx[] = "$Id$";
#include "swigmod.h"
static const char *usage = "\

View file

@ -17,8 +17,6 @@
* - Lines beginning with %# are stripped down to #... and passed through.
* ----------------------------------------------------------------------------- */
char cvsroot_cpp_c[] = "$Id$";
#include "swig.h"
#include "preprocessor.h"
#include <ctype.h>

View file

@ -12,8 +12,6 @@
* encountered during preprocessing.
* ----------------------------------------------------------------------------- */
char cvsroot_expr_c[] = "$Id$";
#include "swig.h"
#include "preprocessor.h"

View file

@ -12,8 +12,6 @@
* the naming of local variables, calling conventions, and so forth.
* ----------------------------------------------------------------------------- */
char cvsroot_cwrap_c[] = "$Id$";
#include "swig.h"
extern int cparse_cplusplus;
@ -855,6 +853,9 @@ int Swig_MethodToFunction(Node *n, const_String_or_char_ptr nspace, String *clas
String *self = 0;
int is_smart_pointer_overload = 0;
String *qualifier = Getattr(n, "qualifier");
String *directorScope = NewString(nspace);
Replace(directorScope, NSPACE_SEPARATOR, "_", DOH_REPLACE_ANY);
/* If smart pointer without const overload or mutable method, change self dereferencing */
if (flags & CWRAP_SMART_POINTER) {
@ -937,7 +938,10 @@ int Swig_MethodToFunction(Node *n, const_String_or_char_ptr nspace, String *clas
/* If protected access (can only be if a director method) then call the extra public accessor method (language module must provide this) */
String *explicit_qualifier_tmp = SwigType_namestr(Getattr(Getattr(parentNode(n), "typescope"), "qname"));
explicitcall_name = NewStringf("%sSwigPublic", name);
explicit_qualifier = NewStringf("SwigDirector_%s", explicit_qualifier_tmp);
if (Len(directorScope) > 0)
explicit_qualifier = NewStringf("SwigDirector_%s_%s", directorScope, explicit_qualifier_tmp);
else
explicit_qualifier = NewStringf("SwigDirector_%s", explicit_qualifier_tmp);
Delete(explicit_qualifier_tmp);
} else {
explicit_qualifier = SwigType_namestr(Getattr(Getattr(parentNode(n), "typescope"), "qname"));
@ -1057,6 +1061,7 @@ int Swig_MethodToFunction(Node *n, const_String_or_char_ptr nspace, String *clas
Delete(p);
Delete(self);
Delete(parms);
Delete(directorScope);
return SWIG_OK;
}
@ -1107,6 +1112,9 @@ int Swig_ConstructorToFunction(Node *n, const_String_or_char_ptr nspace, String
ParmList *directorparms;
SwigType *type;
int use_director;
String *directorScope = NewString(nspace);
Replace(directorScope, NSPACE_SEPARATOR, "_", DOH_REPLACE_ANY);
use_director = Swig_directorclass(n);
@ -1167,12 +1175,17 @@ int Swig_ConstructorToFunction(Node *n, const_String_or_char_ptr nspace, String
Node *parent = Swig_methodclass(n);
int abstract = Getattr(parent, "abstracts") != 0;
String *name = Getattr(parent, "sym:name");
String *directorname = NewStringf("SwigDirector_%s", name);
String *directorname;
String *action = NewStringEmpty();
String *tmp_none_comparison = Copy(none_comparison);
String *director_call;
String *nodirector_call;
if (Len(directorScope) > 0)
directorname = NewStringf("SwigDirector_%s_%s", directorScope, name);
else
directorname = NewStringf("SwigDirector_%s", name);
Replaceall(tmp_none_comparison, "$arg", "arg1");
director_call = Swig_cppconstructor_director_call(directorname, directorparms);
@ -1233,6 +1246,7 @@ int Swig_ConstructorToFunction(Node *n, const_String_or_char_ptr nspace, String
if (directorparms != parms)
Delete(directorparms);
Delete(parms);
Delete(directorScope);
return SWIG_OK;
}

View file

@ -13,8 +13,6 @@
* that the function and/or API needs to be changed in some future release.
* ----------------------------------------------------------------------------- */
char cvsroot_deprecate_c[] = "$Id: parms.c 9630 2007-01-02 21:17:19Z beazley $";
#include "swig.h"
/* ---------------------------------------------------------------------

View file

@ -12,8 +12,6 @@
* error messages.
* ----------------------------------------------------------------------------- */
char cvsroot_error_c[] = "$Id$";
#include "swig.h"
#include <stdarg.h>
#include <ctype.h>

View file

@ -16,8 +16,6 @@
* wrapper code and to generate cleaner wrapper files.
* ----------------------------------------------------------------------------- */
char cvsroot_fragment_c[] = "$Id$";
#include "swig.h"
#include "swigwarn.h"

View file

@ -20,8 +20,6 @@
* Should have cleaner error handling in general.
* ----------------------------------------------------------------------------- */
char cvsroot_getopt_c[] = "$Id$";
#include "swig.h"
static char **args;

View file

@ -13,8 +13,6 @@
* are provided.
* ----------------------------------------------------------------------------- */
char cvsroot_include_c[] = "$Id$";
#include "swig.h"
static List *directories = 0; /* List of include directories */

View file

@ -11,8 +11,6 @@
* Miscellaneous functions that don't really fit anywhere else.
* ----------------------------------------------------------------------------- */
char cvsroot_misc_c[] = "$Id$";
#include "swig.h"
#include <errno.h>
#include <ctype.h>

View file

@ -20,8 +20,6 @@
* %v - variable name is substituted
* ----------------------------------------------------------------------------- */
char cvsroot_naming_c[] = "$Id$";
#include "swig.h"
#include "cparse.h"
#include <ctype.h>

View file

@ -11,8 +11,6 @@
* Parameter list class.
* ----------------------------------------------------------------------------- */
char cvsroot_parms_c[] = "$Id$";
#include "swig.h"
/* ------------------------------------------------------------------------

View file

@ -14,8 +14,6 @@
* to easily construct yacc-compatible scanners.
* ----------------------------------------------------------------------------- */
char cvsroot_scanner_c[] = "$Id$";
#include "swig.h"
#include <ctype.h>

View file

@ -12,8 +12,6 @@
* the form of simple strings.
* ----------------------------------------------------------------------------- */
char cvsroot_stype_c[] = "$Id$";
#include "swig.h"
#include "cparse.h"
#include <ctype.h>

View file

@ -11,8 +11,6 @@
* This file implements the SWIG symbol table. See details below.
* ----------------------------------------------------------------------------- */
char cvsroot_symbol_c[] = "$Id$";
#include "swig.h"
#include "swigwarn.h"
#include <ctype.h>

View file

@ -12,8 +12,6 @@
* parse trees.
* ----------------------------------------------------------------------------- */
char cvsroot_tree_c[] = "$Id$";
#include "swig.h"
#include <stdarg.h>
#include <assert.h>

View file

@ -11,8 +11,6 @@
* A somewhat generalized implementation of SWIG1.1 typemaps.
* ----------------------------------------------------------------------------- */
char cvsroot_typemap_c[] = "$Id$";
#include "swig.h"
#include "cparse.h"
#include <ctype.h>

View file

@ -14,8 +14,6 @@
* like typedef, namespaces, etc.
* ----------------------------------------------------------------------------- */
char cvsroot_typeobj_c[] = "$Id$";
#include "swig.h"
#include <ctype.h>

View file

@ -14,8 +14,6 @@
* run-time type checker is also handled here.
* ----------------------------------------------------------------------------- */
char cvsroot_typesys_c[] = "$Id$";
#include "swig.h"
#include "cparse.h"

View file

@ -13,8 +13,6 @@
* to be created in a piecemeal manner.
* ----------------------------------------------------------------------------- */
char cvsroot_wrapfunc_c[] = "$Id$";
#include "swig.h"
#include <ctype.h>

View file

@ -1,4 +1,4 @@
# You can build the package from SVN using something like:
# You can build the package from Git using something like:
# tar -czf swig-@PACKAGE_VERSION@.tar.gz swig-@PACKAGE_VERSION@ && rpmbuild -tb swig-@PACKAGE_VERSION@.tar.gz
# @configure_input@
@ -36,7 +36,7 @@ its parse tree in the form of XML and Lisp s-expressions.
%setup -q -n %{name}-%{version}
%build
# so we can build package from SVN source too
# so we can build package from Git source too
[ ! -r configure ] && ./autogen.sh
%configure
make