Commit graph

45 commits

Author SHA1 Message Date
John Lenz
62f5e6cf73 The new python runtime now works from python versions 1.6.1 to 2.3.4
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6626 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-11-02 21:26:39 +00:00
Marcelo Matus
75a937a0d4 more warns fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6618 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-11-02 16:37:10 +00:00
Marcelo Matus
8ec5f847e5 fix warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6614 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-11-02 08:24:22 +00:00
Marcelo Matus
dce447e25d fix warnings for MS compiler
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6585 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-11-01 22:16:52 +00:00
Marcelo Matus
dab4e48132 no more zero value accepted for pointers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6498 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-25 19:11:25 +00:00
John Lenz
b83fe6bd77 - Add SWIG_RUNTIME_VERSION to new type sharing code. This is for future-proof, if
the format of swig_type_info ever changes, this number should be incremented
- Add SWIG_LINK_RUNTIME and SWIG_STATIC_RUNTIME symbols to python
- Convert inline into SWIGINLINE


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6475 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-21 21:53:54 +00:00
Marcelo Matus
7a90a47284 prevent to overide the pointer value when an error occurred
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6418 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-18 00:25:31 +00:00
John Lenz
4645346381 Removed ability to share type information by C linking
All type sharing happens through a global variable in the target language.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6390 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-16 18:23:59 +00:00
Marcelo Matus
a300b82163 isolate language independent STD/STL/C++ code + more documentation + cleaning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6382 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-10 06:42:15 +00:00
Marcelo Matus
a433214393 fix version check for python 2.3.0
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6372 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-07 23:00:57 +00:00
Marcelo Matus
e4e9a5e61b LookupTypePointer now as pyrun
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6335 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-05 23:20:34 +00:00
Marcelo Matus
5edce7c150 isolating the pure 'runtime' code in pyrun.swg, the API declarations are now in pyapi.swg
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6289 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-02 18:44:48 +00:00
Marcelo Matus
afed1d4126 add John Lenz patch for avoiding the runtime library, but allowing the old approach to coexist
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6288 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-02 17:54:38 +00:00
Marcelo Matus
3ae15c245c better error messages, more comments, clean up for the next major modifications
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6284 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-02 01:43:17 +00:00
Marcelo Matus
d7b22b7d90 cleaning + comments, and add the nondynamic feature handlers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6266 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-09-26 01:00:28 +00:00
William S Fulton
61d07f7cae Removed redundant #include of Python.h
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6158 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-08-26 21:17:18 +00:00
Marcelo Matus
a02d064ad6 some performance improvements
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5982 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-06-14 09:14:48 +00:00
Marcelo Matus
de65a09e6c fix tp_del field
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5834 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-04-06 06:28:07 +00:00
Marcelo Matus
abdf9b7980 fix more comp. warns
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5833 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-04-06 00:10:14 +00:00
Marcelo Matus
1d99226334 normalizing the inout typemaps and other cosmetic fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5782 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-03-21 23:26:18 +00:00
Marcelo Matus
328098bbb2 better STL support, see CHANGES.current
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5755 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-03-17 09:41:19 +00:00
Marcelo Matus
c9d6e27b5c Reducing pyrun.swg and splitting python.swg into different files
for clarity and for easier maintainance.

pyrun.swg almost the same than 1.3.20, therefore there will be
compatible again.

code generated is reduced by the use and reuse of %fragments.

as usual, all the test-suite is compiling and a much bigger
"test project" too.

with the new typemaps definition should be much eaiser and
uniform add stl/std and user types.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5706 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-10 09:50:24 +00:00
Logan Johnson
5c2a00ba85 Be sure to initialize all of the fields of the PyTypeObject struct to
something, to avoid numerous compiler warnings.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5700 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-06 17:45:49 +00:00
Marcelo Matus
b85c9ace6b 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@5691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-28 01:30:13 +00:00
Marcelo Matus
aabed0eedf 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@5689 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-26 11:55:22 +00:00
Marcelo Matus
dc061e30f1 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@5687 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-25 09:45:18 +00:00
Marcelo Matus
b3896b1919 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@5685 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-24 07:20:59 +00:00
Marcelo Matus
4ea03cbb10 more on uniforming and 'securing' the typemap declarations
for primitive types.

Finally, you can safetly write:

%apply int {enum Hello};
%apply long {size_t};
%apply int {MyIntClass};

or using references

%apply const int& {const enum Hello&};
%apply const long& {const size_t&};
%apply const int& {MyIntClass&};

and all the primitive typemaps(in, out, directorin, directorout,
constcode, throws, varin, varout) are safetly applied to the
desired types (including the proper conversions when needed).

In fact, the python.swg file now has no typemap
defined for enums, and only use the %apply directives
as above.

Now the primitive_types.i extensive test runs properly.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5683 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-24 00:43:47 +00:00
Marcelo Matus
dedb5a9697 - 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@5659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 01:15:10 +00:00
Dave Beazley
1095ee9859 Added Perl support for member pointers. Some reorganization of other runtime code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5436 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-28 20:56:17 +00:00
William S Fulton
dfd57099df Corrected SWIGEXPORT to SWIGIMPORT
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5412 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-25 21:51:10 +00:00
Dave Beazley
0d090075b5 Contract cleanup
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5323 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-14 18:59:25 +00:00
Dave Beazley
0479fc63c4 Simplified contract API
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5318 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-13 16:59:53 +00:00
Dave Beazley
377175f813 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5270 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-05 21:59:07 +00:00
Matthias Köppe
110924a6f5 Use the preprocessor to rename external functions of the SWIG runtime
API to follow the naming convention SWIG_<language>_<function>.  This
should allow linking more than one interpreter into a program.

Unify the pointer-conversion runtime API.
[Python]: Add the function SWIG_MustGetPtr.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5246 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-02 14:47:06 +00:00
William S Fulton
69d79e0674 typemap name changes:
inv => directorin
outv => directorout
argoutv => directorargout


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5137 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-20 23:52:28 +00:00
Tiger Feng
75ca26902b *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5057 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-01 18:19:41 +00:00
Dave Beazley
62c3f3642a Fixed [ 798205 ] Segfault in SWIG_ConvertPtr.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5046 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-01 17:11:13 +00:00
William S Fulton
804504a3a6 Minor warning fix
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4975 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-08-07 08:31:10 +00:00
Dave Beazley
b5b4699cde Improved error message. Contributed by Zooka.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4964 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-07-28 22:04:15 +00:00
Tiger Feng
dde9afd927 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4875 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-06-10 21:12:35 +00:00
Tiger Feng
d2d6640236 contract: SWIG_assertion(expr) for python
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4808 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-05-21 21:17:23 +00:00
Dave Beazley
56d7071ffa Experimental contract work.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4807 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-05-21 18:08:26 +00:00
Dave Beazley
2acbff274a Added void prototype. [ 635347 ] Compilation warning from libpy.c.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4391 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-25 21:13:44 +00:00
Dave Beazley
516036631c The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2002-11-30 22:01:28 +00:00