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
This commit is contained in:
parent
522ab32693
commit
3ab65a48a0
9 changed files with 1605 additions and 1731 deletions
23
Lib/php4/phppointers.i
Normal file
23
Lib/php4/phppointers.i
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
%define %pass_by_ref( TYPE, CONVERT_IN, CONVERT_OUT )
|
||||
%typemap(in) TYPE * ($*1_ltype tmp),
|
||||
TYPE & ($*1_ltype tmp)
|
||||
{
|
||||
/* First Check for SWIG wrapped type */
|
||||
if ( ZVAL_IS_NULL( *$input ) ) {
|
||||
$1 = 0;
|
||||
} else if ( PZVAL_IS_REF( *$input ) ) {
|
||||
/* Not swig wrapped type, so we check if it's a PHP reference type */
|
||||
CONVERT_IN( tmp, $*1_ltype, $input );
|
||||
$1 = &tmp;
|
||||
} else {
|
||||
SWIG_PHP_Error( E_ERROR, SWIG_PHP_Arg_Error_Msg($argnum, Excpeted a reference) );
|
||||
}
|
||||
}
|
||||
%typemap(argout) TYPE *,
|
||||
TYPE & {
|
||||
CONVERT_OUT(*$input, tmp$argnum );
|
||||
}
|
||||
%enddef
|
||||
|
||||
%pass_by_ref( int, CONVERT_INT_IN, ZVAL_LONG );
|
||||
%pass_by_ref( double, CONVERT_FLOAT_IN, ZVAL_DOUBLE );
|
||||
Loading…
Add table
Add a link
Reference in a new issue