Add pointer reference typemaps

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

View file

@ -1036,6 +1036,21 @@
return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner);
}
/* Pointer reference typemaps */
%typemap(jni) SWIGTYPE *& "jlong"
%typemap(jtype) SWIGTYPE *& "long"
%typemap(jstype) SWIGTYPE *& "$*javaclassname"
%typemap(javain) SWIGTYPE *& "$*javaclassname.getCPtr($javainput)"
%typemap(javaout) SWIGTYPE *& {
long cPtr = $jnicall;
return (cPtr == 0) ? null : new $*javaclassname(cPtr, $owner);
}
%typemap(in) SWIGTYPE *& ($*1_ltype temp = 0)
%{ temp = *($1_ltype)(void *)&$input;
$1 = &temp; %}
%typemap(out) SWIGTYPE *&
%{ *($1_ltype)(void *)&$result = *$1; %}
/* Typemaps used for the generation of proxy and type wrapper class code */
%typemap(javabase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
%typemap(javaclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class"