Commit graph

57 commits

Author SHA1 Message Date
Olly Betts
4fbb9e24d6 [PHP] Add casts to the typemaps for long long and unsigned long
long to avoid issues when they are used with shorter types via
%apply.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12520 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-07 04:06:54 +00:00
William S Fulton
28deca09be [PHP] Add missing INPUT, OUTPUT and INOUT typemaps in the typemaps.i library for primitive reference types as well as signed char * and bool *.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12480 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-19 14:53:53 +00:00
Olly Betts
3cee7b7b3e [PHP] Fix invalid erase during iteration of std::map in generated
director code.  Reported by Cory Bennett in SF#3175820.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12469 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-18 05:30:26 +00:00
William S Fulton
5f8c936569 Fix some eroneous typecheck rankings for php
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12439 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-05 22:58:32 +00:00
William S Fulton
640cce2c50 Fix typecheck typemaps for SWIGTYPE *const&
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12413 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-30 00:42:27 +00:00
William S Fulton
ef865e06d5 Added some missing multi-argument typemaps: (char *STRING, size_t LENGTH) and (char *STRING, int LENGTH) - Java patch is from Volker Grabsch. Elements of the primitive_types.i testcase for this moved into char_binary.i. Documentation for this enhanced.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12393 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-14 19:06:43 +00:00
Olly Betts
b36ae8aaf4 Attach the swig_php_init_member_ptr fragment to all the typemaps which need it.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12148 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-25 01:48:33 +00:00
William S Fulton
b946430c8a Remove potential symbol clash with wrapped code (php)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12147 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-24 19:33:21 +00:00
Olly Betts
0d7863c810 Wrapping pointer to member function types is likely to be rare, so use
%fragment to only pull in the required machinery if it is going to be
used.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12145 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-24 14:16:16 +00:00
Olly Betts
c7a6e3dad4 Fix // comments to /* */ in typemaps which should be usable from C code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12109 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-10 02:34:25 +00:00
William S Fulton
bb41eeb343 Fix potential name clashes with symbols in the Director class
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12062 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-27 20:55:24 +00:00
Olly Betts
1392a6e497 [PHP] When using %throws or %catches, SWIG-generated PHP5 wrappers
now throw PHP Exception objects instead of giving a PHP error of
type E_ERROR.

This change shouldn't cause incompatibility issues, since you can't
set an error handler for E_ERROR, so previously PHP would just exit
which also happens for unhandled exceptions.  The benefit is you can
now catch them if you want to.

Fixes SF#2545578 and SF#2955522.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12055 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-26 07:32:20 +00:00
Olly Betts
ed98187e3b Tidy up typemaps, combining variants with the same code.
Use const_cast to remove const-ness from const char * for stupid PHP API in
%throws typemap.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12054 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-26 00:19:08 +00:00
Olly Betts
9207a2fe37 [PHP] Add missing directorin typemap for const std::string &.
Fixes SF#3006404 reported by t-Legiaw.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12053 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-25 23:38:44 +00:00
Olly Betts
08cdb5a7ee Set string contents when we allocate it for a small efficiency gain.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12052 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-25 21:46:23 +00:00
William S Fulton
964382336e remove std::map specializations - not needed since the typemap matching rules were changed to follow type deducation used in template specialization
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11978 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-04-04 20:37:20 +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
William S Fulton
4308dd03cf SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:26:02 +00:00
Olly Betts
b2fc62f21f [PHP] Add datetime to the list of PHP predefined classes (patch from David
Fletcher in SF#2931042).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11822 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-01-13 11:53:18 +00:00
Olly Betts
0633acd24f [PHP] "empty" is a reserved word in PHP, so rename empty() method
on STL classes to "is_empty()" (previously this was automatically
renamed to "c_empty()").
*** POTENTIAL INCOMPATIBILITY ***


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11772 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-04 04:33:58 +00:00
Olly Betts
7ba280b4b8 Fix warnings for passing string constant for char * (the PHP API isn't const
correct).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11769 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 13:58:44 +00:00
Olly Betts
67bbac4872 Add PHP typemaps for pointer to method.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11768 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 12:59:59 +00:00
Olly Betts
d277354167 Add long long and unsigned long long const reference typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11767 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 05:21:48 +00:00
Olly Betts
d6984c5253 [PHP] Add typemaps for long long and unsigned long long.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11766 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 04:48:54 +00:00
Olly Betts
52bdfa3097 Add input typemaps for long long and unsigned long long for PHP.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11765 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 01:29:45 +00:00
Olly Betts
2c74fbf9e4 [PHP] Fix warning and rename of reserved class name to be case insensitive.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11763 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-02 13:02:38 +00:00
William S Fulton
3932d02a2a fix SWIG naming convention
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11663 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-21 00:25:11 +00:00
William S Fulton
06c06f8742 remove redundant if not __cplusplus for directorin typemap - directors are always c++
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11575 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 22:47:11 +00:00
Miklos Vajna
6f80e2f7a6 PHP: Add directorout typemap for primitive type const refs
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11559 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 04:22:03 +00:00
William S Fulton
45359dc12c Add SWIGTYPE *& typemaps for PHP
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11556 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 01:14:49 +00:00
Olly Betts
3675a7baf7 Add min and max as built-in functions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11555 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 01:00:36 +00:00
William S Fulton
cc43f20f6d PHP fix const char\*\& typemaps and add in char_strings runtime test based on Java version
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11552 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-13 23:31:19 +00:00
William S Fulton
42d7f3bb10 add php typecheck typemaps for const reference for primitives
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11551 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-13 22:39:20 +00:00
William S Fulton
d2316a8189 PHP std::vector wrappers overhaul modelling on Java std_vector.i. Work around empty rename warning problem. Add capacity and reserve(). Remove need for specialize_std_vector macro.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11550 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-13 22:07:34 +00:00
William S Fulton
627d9faffd Add PHP const ref typemaps for primitive types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11549 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-13 21:41:23 +00:00
Miklos Vajna
ac8f104d7b PHP: Add more comments in SWIG_ZTS_SetPointerZval()
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11536 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-11 22:53:32 +00:00
Miklos Vajna
e27c32d885 PHP: fix PHP 5.3 support
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11502 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-05 09:26:25 +00:00
Olly Betts
110562d364 [PHP] Fix generated code to work with PHP 5.3.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11498 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-04 15:37:32 +00:00
Miklos Vajna
a9f9b7cbbf PHP: fix for the li_math testcase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11496 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-04 10:32:25 +00:00
Olly Betts
1f01eb5d7d [PHP] Fix memory leak in PHP OUTPUT typemaps. Reported by Hitoshi
Amano in SF#2826322.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11464 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-29 02:27:54 +00:00
Olly Betts
c321421bc5 [PHP] Update warnings about clashes between identifiers and PHP
keywords and automatic renaming to work with the PHP5 class 
wrappers.  Fixes SF#1613679.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11460 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-28 13:12:06 +00:00
Miklos Vajna
0249eea389 Merge https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-vmiklos/
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11434 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-22 11:08:29 +00:00
Olly Betts
949ea9b580 [PHP] Update the list of PHP keywords - "cfunction" is no longer a
keyword in PHP5 and PHP 5.3 added "goto", "namespace", "__DIR__",
and "__NAMESPACE__".


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11368 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-05 05:40:50 +00:00
Olly Betts
9e919ef866 Removed unused struct tag.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11362 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-05 04:06:39 +00:00
Olly Betts
64843143f1 The default out typemap for char[ANY] now returns up to a zero byte, or the end
of the array if there is no zero byte.  This is the same as Python does, and seems
more generally useful than the previous behaviour of returning the whole
contents of the array including any zero bytes.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11176 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-03-30 02:22:14 +00:00
William S Fulton
06b2eca75e remove last vestiges of php4 and encourage use of -php rather than -php5
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10969 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-06 23:15:20 +00:00
Olly Betts
fccd1e294a Fix indentation. Use %{ %} in a couple of typemaps to avoid adding needless
{ } to the generated code.  Use memcpy() instead of memmove() where the
destination is freshly allocated so there's no possibility of overlap.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10887 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-10-01 11:54:31 +00:00
Olly Betts
0f0c13204e Fix non-standard indentation.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10886 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-10-01 05:28:45 +00:00
Olly Betts
7ef2b73a6d [PHP5] Fill in typemaps for SWIGTYPE and void * (SF#2095186).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10881 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-09-25 07:11:36 +00:00
Olly Betts
03429576fc [PHP5] Add typemaps for long long and unsigned long long.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10876 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-09-19 03:20:59 +00:00