ctypes for java



While there have been a number of projects that have attempted this,
most have required a lot of boilerplate and manual configuration
leaving them not much easier to use than JNI itself.

JNA (http://jna.dev.java.net) attempts to remedy the situation. To
reference C library functions, for instance, one only need write:

public interface CLibrary extends com.sun.jna.Library {
CLibrary INSTANCE = (CLibrary)Native.loadLibrary("c",
Clibrary.class);

int atol(String number);
}

int value = CLibrary.INSTANCE.atol("42");

Structures, array arguments, callbacks, and a number of other
conveniences are supported on linux/x86, darwin (x86/ppc), and win32.
The project includes a few demos as well.

.