0
我喜歡這個 -等價的C的Java代碼JNA例如
文件代碼:input.h
struct Address{
int a;
int b;
};
void func(struct Address *a);
什麼是等效JNA Java代碼?
我喜歡這個 -等價的C的Java代碼JNA例如
文件代碼:input.h
struct Address{
int a;
int b;
};
void func(struct Address *a);
什麼是等效JNA Java代碼?
只要這樣的一個界面中從一個抽象的Library
或擴展(如果你使用的是Windows)特定的平臺com.sun.jna.win32.StdCallLibrary
:
public interface MyLibrary extends Library {
/**
* Native library instance.
*/
MyLibrary INSTANCE = (MyLibrary)Native.loadLibrary("MyLibrary", MyLibrary.class);
/**
struct Address{
int a;
int b;
};
*/
public class Address extends Structure {
public int a;
public int b;
public static class ByReference extends Address implements Structure.ByReference {
};
public static class ByValue extends Address implements Structure.ByValue {
};
};
/**
void func(struct Address *a);
*/
void func(Address a);
}