Commit graph

57 commits

Author SHA1 Message Date
Marcelo Matus
4e3d516cee now use the new argcargv.i
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5707 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-10 09:55:58 +00:00
Marcelo Matus
2a573e9a08 Keep the old non-resolved type str and add the fully
resolved one if is needed.

Add examples showing the problem with SWIG_TypeQuery
and template+typedef and the old type str, and how
it works now.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5704 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-10 08:37:30 +00:00
Marcelo Matus
f1ed62c2a2 add complex test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5693 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-28 01:38:59 +00:00
Marcelo Matus
3f1f31d1e8 Fix long long and other warnings.
Add the macros

%typemap_asfromcheck()
%typemap_asfrom()

that can be used to defined all the different typemaps
for types where the As/From/Check methods are provided.

All the basic type (int, char,...) typemaps are implemented
using them.

The std::string and std::complex<T> are reimplemented using
the new %typemap_asfrom/check macros too. This helps to complete
all the previously missing typemaps (consttab, varin, varout,..)
and also ilustrates how to define the As/From/Check methods
to use with the %typemap_asfrom/check macros.

As a byproduct, the C complex typemap was added, and the file

complex.i

can be used to load the complex support for either C or C++. The
original C++ std_complex.i is still there, and the corresponding C
ccomplex.i too, if they need to be included explicitly.

Also, the As/From methods are declared via %fragment, so, they
can be reused as needed, and only appear in the wrapped code if
they corresponding typemap is invoked, making the typemaps
and the entire code shorter and simpler.


Marcelo.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-28 01:30:13 +00:00
Marcelo Matus
c429cdb9fc add support for char* to accepts char* :), before
they only accept PyStrings.

now the raw pointer from calloc.i, for example, works
fine.

some of the SWIG_PyObj_(As|From)XXX routines are getting
too large, so, they also will go into the runtime library.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5689 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-26 11:55:22 +00:00
Marcelo Matus
839f109a81 Better mapping of char[ANY] in python, including embedded
null chars, which are allowed in C++ and python, and proper
sizes:

  you can use a shorter string to assign a char[6]:

     x = "he\0l"  -> x := {'h','e',0,'l',0, 0}

  but you always get back in python the original size:

   x := {'h','i','0','0',0, 0} -> "hi\0\0\0\0"

Better mapping of (char*)0, now you get a None in the python
side, and using None, you get a (char*)0, just like
all the other C++ pointers. Before (char*)0 was mapped
into python as "", or as seg. faults.

Better mapping of "", which is not None nor (char*)0.

Added more tests using primitive types with simple templates.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5687 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-25 09:45:18 +00:00
Marcelo Matus
59e7aca99a properly manage the strange but valid case:
typedef char namet[5];
  const namet def_namet = {'h','o', 0, 'l','a'};

ie, char arrays with null embedded characters, and other odd
char[ANY] situations.

add the corresponding test to the primitive_types.i and runme files.

Marcelo

 ----------------------------------------------------------------------


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5685 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-24 07:20:59 +00:00
Marcelo Matus
1a8089a2d4 add extensive tests for the primitive types, it will crash in almost every language now, see the file for instructions about some typemaps that need to be fixed
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5680 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-24 00:21:02 +00:00
Marcelo Matus
308387b7a3 added refcount example using the old macro way and the proposed ref/unref features
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5667 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 06:26:17 +00:00
Marcelo Matus
c92d8c7cf7 added test for simple virtual derivation, where ruby fails
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5666 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 06:23:57 +00:00
Marcelo Matus
05d6e6b04f also, change the module name to director_frob
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5665 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 00:52:06 +00:00
Marcelo Matus
e524a03a55 using better names for frob
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5664 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 00:41:37 +00:00
Marcelo Matus
54737ee9a9 - recover the proper catching exception mechanism for classes
(throw typemap).

- fix the examples with exception problems and warnings

- proper and consist treatment of basic types (short, unsigned char,...)

  now all are checked for range and sign. Before, this was depending of
  the use of parsing or no parsing, and/or the converter method, and/or
  the use of directors, etc.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 01:15:10 +00:00
Marcelo Matus
9cfb9a490b fixes for the nodirector feature and the '0' director member case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5657 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 00:46:08 +00:00
Marcelo Matus
10f3808329 add python runme
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5648 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 20:49:05 +00:00
Marcelo Matus
386d53ce62 fix precatching exception behaviour to postcatching
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5617 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-12 23:40:58 +00:00
Marcelo Matus
ac011192ae added a reference polymorphic return type case, and
some extra test for the Java side.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5596 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-24 06:53:47 +00:00
Marcelo Matus
394aacb890 using static narrow methods instead of %extended ones.
now it looks more natural and similar to the CORBA downcasting mechanism.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5587 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 10:10:04 +00:00
Marcelo Matus
bbeeed588b added the ruby runtime case and more comments.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5584 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 10:41:33 +00:00
Marcelo Matus
c85521c002 Added a simple example where the current universal
Java wrapping mechanism doesn't work, showing the
need to use a different way to wrap polymorphic classes.

They are two runtime examples: one for java, which is
failing, and one for python, which works fine.

Detailed description of the case can be found
in the three files committed.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 06:26:44 +00:00
Marcelo Matus
708021a809 These is the current tests for the friend function support.
They will give you and idea of what is currently working.

If you have another case you think we need to test, please
send me an email to add it and trying it here.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5581 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-20 07:46:27 +00:00
William S Fulton
d71d6d1d85 Added test for %import
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5540 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 21:33:34 +00:00
William S Fulton
55c4bf307f base() changed to basemethod() - base is a C# keyword
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5536 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 21:16:21 +00:00
Marcelo Matus
72984676ca Lateral change to add runtime "reprotection" at the python
side for protected director members.

Lib/python/director.swg: added needed code for runtime checking
Source/Modules/python.cxx: added needed code for runtime checking
director_protected_runme.py: checks now that the runtime protection is working


The extra runtime checking is only done for protected members,
so, the old public directors members don't feel any overhead.

This finished the director protected support for the python language.
Java and Ocalm will need to add the "reprotection" mechanism latter.
But as in the python case, the changes will be localized in the
languages files, and there will be no need to touch the core
files anymore.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5532 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 01:59:12 +00:00
Dave Beazley
b4a8805a9f Added test case just to check a few things with protected/private virtual methods
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5515 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 17:50:29 +00:00
Marcelo Matus
833b2f7f0a detecting polymorphic virtual methods properly
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5511 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 10:36:15 +00:00
Marcelo Matus
bbde8dafa9 Moving the director protected member support to the top level. Now it should works in all the languages. Test it.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5498 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-07 23:00:02 +00:00
Marcelo Matus
0f19564193 Fixes to support protected members with director, proper virtual member recognition and support of the nodirector feature
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5485 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 01:59:28 +00:00
Marcelo Matus
183d0b755b Fixed the include/import error reported by Kerim Borchaev
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5359 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-20 21:37:24 +00:00
Marcelo Matus
04e800b085 Added test for subincluiding files with the same basename, reported by Kerim Borchaev
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5353 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-20 19:56:34 +00:00
Dave Beazley
32a8e14507 new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5322 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-14 18:59:02 +00:00
William S Fulton
b0520285d1 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5089 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-06 15:58:14 +00:00
Dave Beazley
bf892ecf11 new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5050 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-01 17:54:18 +00:00
William S Fulton
5206dd0912 Multiple build directory support
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5040 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-01 15:15:50 +00:00
William S Fulton
976d6e5a2b Makefile replaced with Makefile.in
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5027 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-08-31 16:22:43 +00:00
Mark Rose
ec6251e86d Abstract directors and typemap fixes.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5024 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-08-30 05:03:34 +00:00
Dave Beazley
131f153f70 new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4857 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-06-03 19:08:09 +00:00
Dave Beazley
53ef3e4ac7 new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4835 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-05-29 18:30:10 +00:00
Dave Beazley
f460723127 new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4824 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-05-28 17:30:04 +00:00
William S Fulton
d7e8c0192e test setting of global arrays
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4768 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-05-04 08:56:21 +00:00
Marcelo Matus
20bf783966 Added test that checks the order between the global %except handler and local throw() definitions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4766 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-05-02 21:19:36 +00:00
Logan Johnson
b0065a4a1d Little bug fix for this run test.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4748 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-04-29 16:49:16 +00:00
Dave Beazley
7e615494b8 new tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4701 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-04-23 18:00:17 +00:00
Dave Beazley
9ca7ea8ad0 new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4590 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-20 19:36:16 +00:00
William S Fulton
26dbbdac83 enum renamed enums due to enum keyword in C#
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-19 21:25:59 +00:00
William S Fulton
437e503be9 more varargs runtime test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4579 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-19 20:50:54 +00:00
Dave Beazley
2e6abf1f5d Removed spurious print statement.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4561 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-17 17:51:04 +00:00
Logan Johnson
71f87c15af *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4515 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-11 20:01:59 +00:00
Mark Rose
08e16bed8e four new director tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4449 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-07 10:30:11 +00:00
Marcelo Matus
daa23f01ce Added test that shows a problem in the 'abstract detection method' when virtual base classes are used (in different order)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4378 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-21 21:03:05 +00:00