Correct special variables in 'directorargout' typemap. This change will break any 'directorargout' typemaps you may have written. Please change: to and to \n Also fix the named 'directorargout' DIRECTOROUT typemaps for these languages which didn't previously compile and add in , etc expansion.\n [C#, Go, Java, D] Add support for the 'directorargout' typemap.\n [Java] Add (char *STRING, size_t LENGTH) director typemaps.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12877 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-12-20 20:50:36 +00:00
commit 468ca084fc
18 changed files with 249 additions and 96 deletions

View file

@ -1307,6 +1307,13 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE)
%typemap(argout) (char *STRING, size_t LENGTH) {
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
}
%typemap(directorin, descriptor="[B") (char *STRING, size_t LENGTH) {
jbyteArray jb = (jenv)->NewByteArray($2);
(jenv)->SetByteArrayRegion(jb, 0, $2, (jbyte *)$1);
$input = jb;
}
%typemap(directorargout) (char *STRING, size_t LENGTH)
%{(jenv)->GetByteArrayRegion($input, 0, $2, (jbyte *)$1); %}
%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) }
/* java keywords */

View file

@ -66,14 +66,14 @@
/* directorout */
%define %ptr_directorout_typemap(asptr_meth,frag,Type...)
%typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT ($*ltype temp) {
%typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT ($*ltype temp, int swig_ores) {
Type *swig_optr = 0;
int swig_ores = $input ? asptr_meth($input, &swig_optr) : 0;
swig_ores = $result ? asptr_meth($result, &swig_optr) : 0;
if (!SWIG_IsOK(swig_ores) || !swig_optr) {
%dirout_fail((swig_optr ? swig_ores : SWIG_TypeError),"$type");
}
temp = *swig_optr;
$result = &temp;
$1 = &temp;
if (SWIG_IsNewObj(swig_ores)) %delete(swig_optr);
}

View file

@ -107,13 +107,12 @@
/* directorout */
%define %value_directorout_typemap(asval_meth,frag,Type...)
%typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT {
Type swig_val;
int swig_res = asval_meth($input, &swig_val);
%typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT(Type swig_val, int swig_res) {
swig_res = asval_meth($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
%dirout_fail(swig_res, "$type");
}
*$result = %static_cast(swig_val, $type);
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment=frag) Type {
Type swig_val;