Commit graph

41 commits

Author SHA1 Message Date
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
e4450c9ba7 fix missed ANY temporal
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5684 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-24 02:43:54 +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
f981296961 fix typos
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5676 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-23 00:25:42 +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
Marcelo Matus
ca3b23e9ca Adding missing built-in functions and names to pythonkw.swg and
fixing operator! warning code in python.swg


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5573 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-16 06:00:09 +00:00
Marcelo Matus
ea0f636eae - Uniform the definition of the keyword warnings through
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@5543 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-12 02:23:52 +00:00
Marcelo Matus
75c1713b2d 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@5485 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 01:59:28 +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
Matthias Köppe
02110ce67b 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.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5242 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-02 13:48:17 +00:00
William S Fulton
9ecbd6f614 - Compliance with ISO/IEC 14882:1998(E) 17.4.3.1.2 -> eg double underscores removed
- 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@5139 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-22 22:55:17 +00:00
William S Fulton
f569dd135d __DIRECTOR__ renamed Swig::Director
SWIG_DIRECTOR_EXCEPTION renamed Swig::DirectorException (similarly for derived classes)


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5138 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-22 20:13:42 +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
William S Fulton
6e052aeb1d First round of director mods
- 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@5132 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-09-20 15:11:38 +00:00
Mark Rose
c1b57370b6 Abstract directors and typemap fixes.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5024 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-08-30 05:03:34 +00:00
Mark Rose
f3e1293b6f Director typemap cleanup and return by value
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4989 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-08-11 02:38:45 +00:00
William S Fulton
c3b517df76 Removed varin typemaps for SWIGTYPE[] (dimensionless arrays).
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@4843 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-06-01 22:59:10 +00:00
Dave Beazley
dfcf44cba5 Added setter for global arrays.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4831 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-05-29 18:27:57 +00:00
Dave Beazley
8ca5543263 Added DISOWN typemap.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4507 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-11 12:38:06 +00:00
William S Fulton
9f8a23ca5a long long typemap mods for use with %apply
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4443 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-06 23:28:01 +00:00
Mark Rose
bd40a83f1c polymorphism patch merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4435 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-06 19:21:58 +00:00
William S Fulton
410b833cf7 bool typemaps rewrite to keep Visual C++ happy
Fixes to SWIGTYPE& varin and varout typemaps


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4261 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-07 22:09:30 +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
Dave Beazley
0d716c43c2 Fixed default argument handling bug reported by Michael Scharf.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@929 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-10-21 01:41:13 +00:00
Dave Beazley
73d5446035 Fixed ambiguous else.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@890 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-09-25 12:26:07 +00:00
Dave Beazley
3ef3086b5a Changed _swig_type_info to swig_type_info
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@799 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-09-02 16:25:50 +00:00
Dave Beazley
4e06247c43 Moved location of extern "C" (patch for Python 1.6 compilation).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@790 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-09-01 20:38:34 +00:00
Dave Beazley
9a82fd7b0c Bug fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@663 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-08-16 18:12:50 +00:00
Dave Beazley
3e6fdf7563 Moved generic type-checking code to common.swg
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-08-15 21:28:21 +00:00
Dave Beazley
32a8172f4f Applied memory leak patch.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@639 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-08-10 03:17:39 +00:00
Dave Beazley
8cb81bd55b Fixed memory leak in Python pointer type-checking code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@573 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-07-12 20:05:08 +00:00
Dave Beazley
1178e12873 cleanup
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@244 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-02-16 17:46:23 +00:00
Dave Beazley
ede14998df Fixed some compiler warnings.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@243 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-02-15 23:19:56 +00:00
Dave Beazley
7d0922dc27 Fixed runtime support.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@205 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-02-10 00:58:27 +00:00
Dave Beazley
84a7f1b612 Added error handling flag to ConvertPtr function.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@192 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-02-04 05:25:55 +00:00
Dave Beazley
bde299cc9d Make the use of CObjects a conditional compilation flag.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@191 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-02-04 04:22:52 +00:00
Dave Beazley
ae1aa7f56a Performance enhancements
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@182 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-02-02 07:03:21 +00:00
Dave Beazley
8be06b60ce Upgrade of runtime functions to support new pointer type checking scheme.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@177 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-02-02 04:35:41 +00:00
Dave Beazley
d2032af50a *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@46 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-01-12 02:55:03 +00:00