ctypes for java
- From: twall@xxxxxxxxxxxx
- Date: 31 Mar 2007 07:12:54 -0700
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.
.
- Prev by Date: function in derby[beginner]
- Next by Date: Re: Quick way to initialize array with all zeros
- Previous by thread: function in derby[beginner]
- Next by thread: Packet Desing and Bock recommendation
- Index(es):