I have a C function like so.
void useData(char* buf) {
// TODO.....
}
With swig I've managed to get this generated.
public static void useData(SWIGTYPE_p_char buf) {
// SWIG stuff....
}
Now this worked but sometimes I want to pass a ByteBuffer
instead of SWIGTYPE_p_char
.
With another typemap, I've managed to generate this.
public static void useData(ByteBuffer buf) {
// SWIG stuff....
}
This works but my new typemap overrides the old typemap and I can't call the function with SWIGTYPE_p_char
anymore.
My goal is to generate two entry points to my useData
function, one that takes a ByteBuffer
and one that takes a SWIGTYPE_p_char
.
I've been googling and reading through the docs for days now and I can't find anything.
Is this something I can even achieve with SWIG? Or is there something I'm missing? I would highly appreciate pointers, specific docs or alternative search terms.
EDIT:
With the ByteBuffer
typemap, SWIG only generates ByteBuffer
but doesn't generate SWIGTYPE_p_char
. I'm trying to make it generate both.