1e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%define JAVA_CRITICAL_ARRAYS_TYPEMAPS(CTYPE, JTYPE, JNITYPE, JFUNCNAME, JNIDESC)
2e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa
3e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(jni) CTYPE[ANY], CTYPE[]               %{JNITYPE##Array%}
4e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(jtype) CTYPE[ANY], CTYPE[]             %{JTYPE[]%}
5e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(jstype) CTYPE[ANY], CTYPE[]            %{JTYPE[]%}
6e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa
7e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(in) CTYPE[]
8e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%{ $1 = (CTYPE *)jenv->GetPrimitiveArrayCritical($input, 0); %}
9e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(in) CTYPE[ANY]
10e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%{  if ($input && JCALL1(GetArrayLength, jenv, $input) != $1_size) {
11e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa    SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "incorrect array size");
12e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa    return $null;
13e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa  }
14e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa  $1 = (CTYPE *)jenv->GetPrimitiveArrayCritical($input, 0); %}
15e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(argout) CTYPE[ANY], CTYPE[];
16e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%{ /*SWIG_JavaArrayArgout##JFUNCNAME(jenv, jarr$argnum, (CTYPE *)$1, $input);*/ %}
17e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(out) CTYPE[ANY]
18e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%{ /*$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, (CTYPE *)$1, $1_dim0);*/ %}
19e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(out) CTYPE[]
20e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%{ /*$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, (CTYPE *)$1, FillMeInAsSizeCannotBeDeterminedAutomatically);*/ %}
21e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(freearg) CTYPE[ANY], CTYPE[]
22e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%{ jenv->ReleasePrimitiveArrayCritical($input, (CTYPE *)$1, 0); %}
23e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa
24e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(javain) CTYPE[ANY], CTYPE[] "$javainput"
25e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(javaout) CTYPE[ANY], CTYPE[] {
26e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa    return $jnicall;
27e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa}
28e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa
29e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(memberin) CTYPE[ANY], CTYPE[];
30e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%typemap(globalin) CTYPE[ANY], CTYPE[];
31e6c66a7ce7a62d60bb147f32b5e2db7cf84e96fbXoppa%enddef