Commit graph

34 commits

Author SHA1 Message Date
William S Fulton
c10a84c775 Cosmetic stray semi-colon removal after %typemap using quotes 2022-08-31 19:40:13 +01:00
William S Fulton
a1f40568d6 Remove non-const char * usage where the Python API now supports it
Python fixed many APIs to use const char * instead of char * at around
Python 2.4. As we support 2.7 and later, we can now remove the non-const
string usage.
Types changed:
  PyArg_ParseTuple
  PyArg_ParseTupleAndKeywords
  PyArg_UnpackTuple
  PyDict_SetItemString
  PyMethodDef
  PyModuleDef
  SWIG_Python_UnpackTuple
  SWIG_Python_str_FromChar
  SWIG_addvarlink
  swig_const_info
2018-10-22 08:19:50 +01:00
Paweł Tomulik
350d43d988 handle const pointers to functions 2016-03-24 10:59:23 +01:00
William S Fulton
504c2030bb Change in default behaviour wrapping C++ bool for Python.
Only a Python True or False will now work for C++ bool parameters.
This fixes overloading bool with other types.
2014-03-08 12:04:19 +00:00
Olly Betts
c6e4dea572 Fix a few typos in comments and docs 2013-12-12 11:45:30 +13:00
William S Fulton
5f6389ab31 Cosmetic Python changes and replace DOH types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12608 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-04 20:13:14 +00:00
Stefan Zager
3d444101d1 A slew of changes based on William Fulton's code review.
- Fixed naming conventions; SwigPyBuiltin is used a lot
- Removed use of std::vector
- builtin.swg isn't included if -builtin isn't specified
- Changed many feature names to use a "python:" prefix
- Eliminated static vars in std_pair.i
- Eliminated C++-style comments (//)
- Enabled autodoc and docstring with -builtin
- Fixed non-ansi generated C code
- Detect and complain if two incompatible swig modules are loaded
- Removed argcargvtest_runme3.py, and fixed argcargvtest_runme.py
  so that 2to3 handles it better
- Removed anonymous namespaces
- Eliminated builtin_init typemaps; consolidated functionality into
  SWIG_Python_NewPointerObj
- Eliminate printf warnings from %U conversion character by switching
  to %S, which works just as well
- Fixed li_std_set_runme.py for python3, which returns set members in
  a different order from python2





git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-29 06:57:02 +00:00
Stefan Zager
eb669d66c0 typecheck SWIGTYPE *const& has been fixed in Lib/typemaps/swigtype.swg, so remove the override here.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12418 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-30 05:41:51 +00:00
Stefan Zager
288c37f5bf Regressions pass! With a few tweaks for unsupported features, primarily:
- Throwing wrapped types as exceptions is unsupported.
- Reverse comparison operators (e.g., __radd__) aren't supported.

Rationalized destructors.

Finished std::map implementation.  Required fixes to typecheck for
SWIGTYPE* const&.

Need a little special handling of the swig_type_info for SwigPyObject
when multiple modules are loaded.

Fall back to SwigPyObject_richcompare if there's no operator overload.

"memberget" and "memberset" attrs are applied strangely; work around
them.

Added 'this' attribute.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12415 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-30 03:17:28 +00:00
Stefan Zager
8ac54d1d5e Director issues should be mostly clean now.
Refactored some type initialization out of SWIG_init.

Use __all__ attribute of module to define public interface.
This is necessary to make available symbols starting with '_'.

Now dying on li_boost_shared_ptr.  Looks like it's gonna be ugly.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12373 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-06 00:09:25 +00:00
Stefan Zager
ee3a6623da First cut. Works for wrapping OpenAccess, but there's plenty
left to do.

Currently, the test suite hurls at director_stl.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12332 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-12-07 21:50:00 +00:00
William S Fulton
bdb136d611 Change typemap matching rules for the default type (SWIGTYPE) to follow template partial specialization type deduction. Fixes some containers of const pointers. SWIGTYPE*& typemps removed and replaced with SWIGTYPE *const&.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11958 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-04-01 18:26:37 +00:00
Haoyu Bai
8f84447860 Commited SF#2158938: change all SWIG symbols start with Py to a new name.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10961 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-03 18:43:44 +00:00
William S Fulton
79eea19382 string handling mods to keep gcc-4.2 happy
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10088 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-11-04 20:35:59 +00:00
Marcelo Matus
a3555839e4 simplify generated code and more consistent names/sections
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8781 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-11 01:57:32 +00:00
Marcelo Matus
750c9c1efb move %extend_smart_pointer to pyuserdir.swg
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8713 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-05 03:07:28 +00:00
Marcelo Matus
336844d502 add extended support for smart pointers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8708 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-04 09:48:40 +00:00
Marcelo Matus
a27b945155 fix warning in solaris
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8663 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-01 05:12:18 +00:00
Marcelo Matus
32d28239da set PyObject * out typemaps back to simple returns
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8584 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-28 03:38:05 +00:00
Marcelo Matus
20cdc2a18c remove 'hello'
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-28 03:24:48 +00:00
Marcelo Matus
5daf66c0db fix memory PyObject * typemaps to avoid memory leaks with iterators
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8375 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-11 23:05:12 +00:00
Marcelo Matus
0e4b388ec9 add implicitconv support and cosmetics for cast rank
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8095 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-27 22:06:26 +00:00
Marcelo Matus
95214810ab add the -fastunpack/-nofastunpack options to avoid using python native UnpackTuple
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7983 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-14 07:28:30 +00:00
Marcelo Matus
0fd2fe23cf add thread support based in proposal #398495 by Joseph Winston
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7929 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-06 06:39:24 +00:00
Marcelo Matus
922d58ac19 don't use Py_None directly nor &PyType_Type
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7925 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-04 08:50:00 +00:00
William S Fulton
cfdad24993 Use the system angle brackets for %include
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7871 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-26 09:28:20 +00:00
Marcelo Matus
ea0c2ca342 adding more missing typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7785 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-03 11:11:21 +00:00
Marcelo Matus
9b9aee8eca add the PyObject **PYTHON_SELF typemap(in)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7774 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-02 15:55:17 +00:00
Marcelo Matus
22a35668b0 add missing SWIG_fail
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7764 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-31 09:51:11 +00:00
Marcelo Matus
e7eeff806a eliminate compilation warnings, add docs, and centralize the access to the unified typemap library
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7710 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-25 09:31:15 +00:00
Marcelo Matus
3c65cea431 Perl added to the Unified typemap library, cleaner way to use the library, and 'normalized' macro names
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7707 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-24 14:59:05 +00:00
Marcelo Matus
2811e2a09a include the user's fragment file in the same place
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7693 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-20 09:58:19 +00:00
Marcelo Matus
ba3efb0917 finishing the first stage of the typemap unification scheme, fixing issues with gcc and valgrind
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7692 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-20 09:47:56 +00:00
Marcelo Matus
7e5e4fd1f9 massive typemap unification
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7676 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-18 13:24:15 +00:00