Add pointer reference typemaps

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8064 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-12-26 23:09:16 +00:00
commit 674b0795a4
2 changed files with 31 additions and 0 deletions

View file

@ -530,6 +530,22 @@ $1 = &temp; %}
return ret;
} %}
/* Pointer reference typemaps */
%typemap(ctype) SWIGTYPE *& "void *"
%typemap(imtype, out="IntPtr") SWIGTYPE *& "HandleRef"
%typemap(cstype) SWIGTYPE *& "$*csclassname"
%typemap(csin) SWIGTYPE *& "$*csclassname.getCPtr($csinput)"
%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *& {
IntPtr cPtr = $imcall;
$*csclassname ret = (cPtr == IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode
return ret;
}
%typemap(in) SWIGTYPE *& ($*1_ltype temp = 0)
%{ temp = ($*1_ltype)$input;
$1 = &temp; %}
%typemap(out) SWIGTYPE *&
%{ $result = (void *)*$1; %}
/* Typemaps used for the generation of proxy and type wrapper class code */
%typemap(csbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
%typemap(csclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class"