/usr/share/swig/3.0.12/java
NameSizeModeActions
arrays_java.i137010644editdlrm
boost_intrusive_ptr.i202360644editdlrm
boost_shared_ptr.i88190644editdlrm
director.swg133330644editdlrm
enums.swg45230644editdlrm
enumsimple.swg25750644editdlrm
enumtypesafe.swg46330644editdlrm
enumtypeunsafe.swg27230644editdlrm
java.swg487300644editdlrm
javahead.swg41810644editdlrm
javakw.swg12700644editdlrm
std_array.i11660644editdlrm
std_auto_ptr.i8460644editdlrm
std_common.i1020644editdlrm
std_deque.i280644editdlrm
std_except.i20710644editdlrm
std_map.i23370644editdlrm
std_pair.i7120644editdlrm
std_shared_ptr.i680644editdlrm
std_string.i35480644editdlrm
std_vector.i26330644editdlrm
std_wstring.i50590644editdlrm
stl.i2910644editdlrm
swiginterface.i34050644editdlrm
typemaps.i182110644editdlrm
various.i58720644editdlrm
Edit: /usr/share/swig/3.0.12/java/arrays_java.i (13701B)
/* ----------------------------------------------------------------------------- * arrays_java.i * * These typemaps give more natural support for arrays. The typemaps are not efficient * as there is a lot of copying of the array values whenever the array is passed to C/C++ * from Java and vice versa. The Java array is expected to be the same size as the C array. * An exception is thrown if they are not. * * Example usage: * Wrapping: * * %include * %inline %{ * short FiddleSticks[3]; * %} * * Use from Java like this: * * short[] fs = new short[] {10, 11, 12}; * example.setFiddleSticks(fs); * fs = example.getFiddleSticks(); * ----------------------------------------------------------------------------- */ /* Primitive array support is a combination of SWIG macros and functions in order to reduce * code bloat and aid maintainability. The SWIG preprocessor expands the macros into functions * for inclusion in the generated code. */ /* Array support functions declarations macro */ %define JAVA_ARRAYS_DECL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) %{ static int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input); static void SWIG_JavaArrayArgout##JFUNCNAME (JNIEnv *jenv, JNITYPE *jarr, CTYPE *carr, JNITYPE##Array input); static JNITYPE##Array SWIG_JavaArrayOut##JFUNCNAME (JNIEnv *jenv, CTYPE *result, jsize sz); %} %enddef /* Array support functions macro */ %define JAVA_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) %{ /* CTYPE[] support */ static int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input) { int i; jsize sz; if (!input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); return 0; } sz = JCALL1(GetArrayLength, jenv, input); *jarr = JCALL2(Get##JAVATYPE##ArrayElements, jenv, input, 0); if (!*jarr) return 0; %} #ifdef __cplusplus %{ *carr = new CTYPE[sz]; %} #else %{ *carr = (CTYPE*) malloc(sz * sizeof(CTYPE)); %} #endif %{ if (!*carr) { SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); return 0; } for (i=0; i