How can I call a method with this method signature in C from JNA?
int open_device(context *ctx, device **dev, int index);
The last two line
It appears that the JNA Pointer class has setPointer and getPointer methods to allow for multiple indirection, and the Memory class to actually "allocate" native objects. So you should be able to do something like: (I'm just guessing from the JNA docs, I've not tested this)
Pointer pDev = new Memory(Pointer.SIZE); // allocate space to hold a pointer value
// pass pDev to open_device
Pointer dev = pDev.getPointer(0); // retrieve pointer stored at pDev