Home | History | Annotate | Download | only in src
      1 
      2 %typemap(jni) (uint8_t *buffer, int len) "jbyteArray";
      3 %typemap(jtype) (uint8_t *buffer, int len) "byte[]";
      4 %typemap(jstype) (uint8_t *buffer, int len) "byte[]";
      5 
      6 %typemap(javain) (uint8_t *buffer, int len) "$javainput";
      7 
      8 %typemap(in) (uint8_t *buffer, int len) {
      9         $1 = (uint8_t *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
     10         $2 = JCALL1(GetArrayLength, jenv, $input);
     11 }
     12 
     13 %typemap(freearg) (uint8_t *buffer, int len) {
     14         JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
     15 }
     16 
     17 %typemap(jni) (uint8_t *pkt, int len) "jbyteArray";
     18 %typemap(jtype) (uint8_t *pkt, int len) "byte[]";
     19 %typemap(jstype) (uint8_t *pkt, int len) "byte[]";
     20 
     21 %typemap(javain) (uint8_t *pkt, int len) "$javainput";
     22 
     23 %typemap(in) (uint8_t *pkt, int len) {
     24         $1 = (uint8_t *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
     25         $2 = JCALL1(GetArrayLength, jenv, $input);
     26 }
     27 
     28 %typemap(freearg) (uint8_t *pkt, int len) {
     29         JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
     30 }
     31 
     32 %typemap(jni) (char *buffer, int len) "jbyteArray";
     33 %typemap(jtype) (char *buffer, int len) "byte[]";
     34 %typemap(jstype) (char *buffer, int len) "byte[]";
     35 
     36 %typemap(javain) (char *buffer, int len) "$javainput";
     37 
     38 %typemap(in) (char *buffer, int len) {
     39         $1 = (char *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
     40         $2 = JCALL1(GetArrayLength, jenv, $input);
     41 }
     42 
     43 %typemap(freearg) (char *buffer, int len) {
     44         JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
     45 }
     46