java: fix Java arrays for m24lr64e

Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Petre Eftime 2015-09-01 18:55:06 +03:00 committed by Mihai Tudor Panu
parent 0406258466
commit dc7e33558e

View File

@ -3,10 +3,23 @@
%include "stdint.i" %include "stdint.i"
%include "arrays_java.i"; %include "arrays_java.i";
%apply signed char[] {uint8_t *};
%{ %{
#include "m24lr64e.h" #include "m24lr64e.h"
%} %}
%typemap(jni) (uint8_t *buf, unsigned int len) "jbyteArray";
%typemap(jtype) (uint8_t *buf, unsigned int len) "byte[]";
%typemap(jstype) (uint8_t *buf, unsigned int len) "byte[]";
%typemap(javain) (uint8_t *buf, unsigned int len) "$javainput";
%typemap(in) (uint8_t *buf, unsigned int len) {
$1 = (uint8_t *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
$2 = JCALL1(GetArrayLength, jenv, $input);
}
%typemap(freearg) (uint8_t *buf, unsigned int len) {
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
}
%include "m24lr64e.h" %include "m24lr64e.h"