I am trying to create a Java implementation to transfer bytes [] to C using Swig.
Swig:
%include "typemaps.i"
%apply(char *STRING, int LENGTH) { (char *buff, int len) };
%inline {
typedef struct {
char* buff;
int len;
} workit_t;
}
In my generated java class (workit_t.java), the buff parameter is a string, not a byte [].
Java:
public void setBuff(String value){
...
}
What am I doing wrong in defining swig?
When I write a simple swig definition without structure, I get the type of parameter I want.
Swig:
%include "typemaps.i"
%apply(char *STRING, int LENGTH) { (char *buff1, int *len1) };
Java:
public static void Mathit(byte[] buff1, byte[] buff2) {
...
}
source
share