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
This commit is contained in:
Kevin Ruland 2005-09-07 02:06:03 +00:00
commit 62149bec4f

View file

@ -74,7 +74,7 @@
/* Object passed by value. Convert to a pointer */ /* Object passed by value. Convert to a pointer */
%typemap(in) SWIGTYPE ($&1_ltype tmp) %typemap(in) SWIGTYPE ($&1_ltype tmp)
{ {
if(SWIG_ConvertPtr(*$input, (void **) &tmp, $&1_descriptor) < 0) { if(SWIG_ConvertPtr(*$input, (void **) &tmp, $&1_descriptor, 0) < 0) {
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor");
} }
$1 = *tmp; $1 = *tmp;
@ -85,17 +85,24 @@
SWIGTYPE & SWIGTYPE &
{ {
/* typemap(in) SWIGTYPE * */ /* typemap(in) SWIGTYPE * */
if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor) < 0) { if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) {
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor");
} }
} }
%typemap(in) SWIGTYPE *DISOWN
{
/* typemap(in) SWIGTYPE *DISOWN */
if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, SWIG_POINTER_DISOWN ) < 0) {
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor");
}
}
%typemap(argout) SWIGTYPE *, %typemap(argout) SWIGTYPE *,
SWIGTYPE [], SWIGTYPE [],
SWIGTYPE&; SWIGTYPE&;
%typemap(in) void * %typemap(in) void *
{ {
if(SWIG_ConvertPtr(*$input, (void **) &$1, 0) < 0) { if(SWIG_ConvertPtr(*$input, (void **) &$1, 0, 0) < 0) {
/* Allow NULL from php for void* */ /* Allow NULL from php for void* */
if ((*$input)->type==IS_NULL) $1=0; if ((*$input)->type==IS_NULL) $1=0;
else else
@ -110,7 +117,7 @@
{ {
/* If they pass NULL by reference, make it into a void* /* If they pass NULL by reference, make it into a void*
This bit should go in arginit if arginit support init-ing scripting args */ This bit should go in arginit if arginit support init-ing scripting args */
if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor) < 0) { if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) {
/* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */
if ((*$input)->type==IS_NULL && PZVAL_IS_REF(*$input)) { if ((*$input)->type==IS_NULL && PZVAL_IS_REF(*$input)) {
#ifdef __cplusplus #ifdef __cplusplus
@ -248,7 +255,7 @@
{ {
/* typecheck SWIGTYPE * */ /* typecheck SWIGTYPE * */
void *tmp; void *tmp;
_v = (SWIG_ConvertPtr( *$input, (void**)&tmp, $1_descriptor) < 0)? 0:1; _v = (SWIG_ConvertPtr( *$input, (void**)&tmp, $1_descriptor, 0) < 0)? 0:1;
} }
%typecheck(SWIG_TYPECHECK_VOIDPTR) void * %typecheck(SWIG_TYPECHECK_VOIDPTR) void *