Commit graph

76 commits

Author SHA1 Message Date
Olly Betts
fa8bf1b870 Make the char we use to instantiate single character constants static, as
PHP doesn't appear to take a copy.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9406 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-10-04 13:25:38 +00:00
Olly Betts
a8dc94bf85 Fix #1569587 for PHP. Don't use sizeof() except with string literals. Change
some "//" comments to "/* */" for portability.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9404 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-10-04 12:40:04 +00:00
Olly Betts
57a68af35f Register string constants using REGISTER_STRINGL_CONSTANT instead of
REGISTER_STRING_CONSTANT since (a) this will cope with embedded zeros
and (b) it'll be fractionally faster.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9373 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-09-28 06:42:36 +00:00
Olly Betts
5baafd12c0 Overload resolution now works in PHP out of the box.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9305 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-09-20 06:59:07 +00:00
Olly Betts
4302d73927 SWIG_TypeCheck() takes a const char * now, so don't cast argument passed
to char *!


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9304 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-09-20 06:37:50 +00:00
Olly Betts
bb1811ee1f Fix typo in comment
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9303 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-09-20 05:51:00 +00:00
Olly Betts
44eaee3a01 Apply patch from SF bug: [ 1466086 ] PHP namespace clash - ErrorCode
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9262 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-09-05 16:18:01 +00:00
Olly Betts
afa9552b5c Fix the easiest warnings in the generated code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9212 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-07-11 04:53:33 +00:00
William S Fulton
197226f8ce debug comments in generated code removed
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9189 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-07-04 21:02:54 +00:00
Olly Betts
1cf8dee120 Added some missing keywords to the PHP4 keyword list, and
fixed __LINE__ and __FILE__ which were in the wrong category.
Also added all the keywords new in PHP5, and added comments
noting the PHP4 keywords which aren't keywords in PHP5.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9167 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-06-17 13:33:05 +00:00
Olly Betts
ee62933ea5 Don't segfault if PHP Null is passed where a C++ reference is wanted.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9094 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-05-07 01:10:31 +00:00
Olly Betts
092f3a3806 Fix wrappers generated for global 'char' variables to not include a terminating
zero in the PHP string.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9090 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-05-05 14:57:19 +00:00
Olly Betts
acb60e1644 Wrap multi-statement macro SWIG_PHP_Error(code,msg) in do {...} while (0)
to protect it from expanding incorrectly (spotted by Sam Liddicott).
Fortunately all current uses by SWIG itself appear to be safe.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9088 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-05-05 00:34:01 +00:00
Marcelo Matus
52cfa52b83 fix docs, path provided by Olly
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9047 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-04-11 01:40:20 +00:00
William S Fulton
49be05f4fd Common template for head of each file detailing licence, distribution and authors information
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8973 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-03-07 00:14:10 +00:00
Kevin Ruland
ab05388a85 Added some TSRMLS_FETCH() calls to initialize the tsrmls_cc variable.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8881 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-23 21:04:11 +00:00
Kevin Ruland
dbe982a838 Added TSRMLS_CC to get_constant call.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8826 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-16 21:28:08 +00:00
Marcelo Matus
0a2b9d7804 more keyword fixes, from Olly
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8799 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-11 22:01:51 +00:00
Kevin Ruland
3ff3be2a2d Fix typemaps for void* and void**.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8727 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-06 14:02:44 +00:00
Kevin Ruland
4cc9151232 Added typechecks for string and const string&.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8660 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-31 16:38:48 +00:00
Kevin Ruland
138c3bc76e Fix memory leak in GetModule.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-31 16:38:14 +00:00
William S Fulton
4c5d4a9d29 std::string global and member variables are wrapped as strings by default
No need to use the %apply const std::string& { std::string* } trick anymore


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8613 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-29 15:53:41 +00:00
Marcelo Matus
526be12c1e change the %rename predicates to use the prefix %$ and avoid clashings with other rename directives
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8469 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-16 23:27:11 +00:00
William S Fulton
2387c32254 Each target language now has its own std_deque.i like the other STL wrappers.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8303 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-08 20:08:44 +00:00
Marcelo Matus
69c14f087e add initial stl.i to ensure proper file inclussion and extensions for each language
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8232 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-06 00:37:31 +00:00
Marcelo Matus
eb3b0f6b30 add fullname to the php4 kw warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8181 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-02 10:18:49 +00:00
Marcelo Matus
447f7454e5 add insensitive kws
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8174 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-02 04:36:56 +00:00
Marcelo Matus
f3262ed3d9 better kw from Olly's comments
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8151 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-31 10:43:06 +00:00
Kevin Ruland
a961a7d5f2 Made string typemaps handle strings with embedded nulls. Changed to use
cstring::data() instead of c_str() to avoid a possible copy.  (Ollie Betts)


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8147 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-31 03:15:12 +00:00
Marcelo Matus
cab4ae94c6 move print from kw to bn
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8146 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-31 03:06:53 +00:00
Marcelo Matus
1cc7f2cdb1 add built-in macro and flag 'empty' as a built-in name instead of a kw
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8135 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-30 09:14:30 +00:00
Kevin Ruland
a77971ae39 Fixed initial creation of array in t_output_helper.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7901 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-29 15:29:30 +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
William S Fulton
9e66ad828d fix typo for php4kw.swg file
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7816 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-05 23:10:05 +00:00
Marcelo Matus
851bf6cb23 activating the keyword warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7701 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-21 11:00:19 +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
William S Fulton
0c3fe4acae fix typo
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7621 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-08 13:58:50 +00:00
William S Fulton
eca4cc3fae throws typemaps added
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7620 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-08 13:58:31 +00:00
Kevin Ruland
92c5d2a22b Fix error message in %typemap(in) SWIGTYPE*.
Change handling of char[ANY] out.  Now return null padding.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7469 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-20 14:50:16 +00:00
Kevin Ruland
b35cc31dd1 Change handling of char[ANY] output typemaps, have it return the null
padding and use t_output_helper.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7468 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-20 14:44:56 +00:00
Kevin Ruland
91a076f516 Convert PHP nulls into NULL pointers.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7467 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-20 14:44:11 +00:00
Kevin Ruland
cfb985d925 Change typemap to use variable name REF.
Added additional typemaps for other simple types (integers, doubles, strings).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7456 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-16 18:25:49 +00:00
Kevin Ruland
9c1a6a85f3 Switch typechecks for simple data types to allow conversion.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7455 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-16 18:24:05 +00:00
Kevin Ruland
c5fa9623b8 Added a fourth argument (flags) to all calls to SWIG_ConvertPtr.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7415 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-07 02:06:22 +00:00
Kevin Ruland
62149bec4f Added typemap for SWIGTYPE *DISOWN.
Changed all the calls to SWIG_ConvertPtr to pass a fourth argument of 0.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7414 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-07 02:06:03 +00:00
Kevin Ruland
67ed60fb18 Removed the old cptr mangling method SWIG_ConvertPtr_.
Added support for DISOWN typemaps by adding a flag to SWIG_ConvertPtr.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7413 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-07 02:04:55 +00:00
Kevin Ruland
cce19f492a Added support for %minit, %mshutdown, %rinit, %rshutdown user supplied code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7401 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-08-29 11:28:56 +00:00
Kevin Ruland
bc72513c72 Made comment more informative.
Added convert_to_{double|long}_ex in the in typemaps.
Corrected the REFERENCE typemaps so they now work.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7394 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-08-25 18:33:26 +00:00
Kevin Ruland
febf005df2 Added support for a %shutdown %{ %}, or %insert("shutdown") %{ %} block to
inject code into the PHP_MSHUTDOWN_FUNCTION.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7393 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-08-24 17:42:31 +00:00
Kevin Ruland
3ab65a48a0 Fairly major update to php code generation and type library. Brief summary:
- Revised simplified makefile generation using -make switch.
 - Proper support of in, out, argout, ret typemaps.
 - Function overloading with typecheck typemap support.
 - Fragment inclusion in typemaps.
 - Proper handling of object destructors relying on PHP's reference counting.
 - Constants using consttab and varinit typemaps.
 - Global variables using varinit typemaps.
 - Can generate C++ bindings using either objects or no objects (-noproxy).
 - Special phppointer.i typemaps for using php references for pointer passing.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7392 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-08-24 17:10:11 +00:00