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/SWIG@5706 626c5289-ae23-0410-ae9c-e8d60b6d4f22
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
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
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
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
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/SWIG@5683 626c5289-ae23-0410-ae9c-e8d60b6d4f22
(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
the supported languages.
- Added keyword list for most of the languages that didn't
have one.
- "All keywords" warning support, through the -DSWIG_ALLKW
option.
Read the Changes.current
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5543 626c5289-ae23-0410-ae9c-e8d60b6d4f22
- Potential member variable and method name clashes remove by preceding with 'swig'
- consistent use of C++ booleans for the swig_disown flag across and within the modules that use this it in director code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5139 626c5289-ae23-0410-ae9c-e8d60b6d4f22
- Removed asserts
- The unused __DIRECTOR__ base class default constructor removed. I've used the conventional approach of having no default constructor rather than a private one (declaring it private doesn't serve any useful purpose when this constructor is not wanted).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5132 626c5289-ae23-0410-ae9c-e8d60b6d4f22
These were useless as they just produced a setter that gave a runtime error.
Exposes some missing varin SWIGTYPE[ANY] typemaps - they show up in the test-suite.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4843 626c5289-ae23-0410-ae9c-e8d60b6d4f22