11 messages in net.java.dev.jna.usersRe: Structure Order
FromSent OnAttachments
Nicolas VienneJan 10, 2008 2:15 am 
Albert StrasheimJan 10, 2008 2:32 am 
Nicolas VienneJan 10, 2008 2:56 am 
Albert StrasheimJan 10, 2008 3:02 am 
Albert StrasheimJan 10, 2008 3:08 am 
Timothy WallJan 12, 2008 10:49 am 
Nicolas VienneJan 17, 2008 3:45 am 
Albert StrasheimJan 17, 2008 3:48 am 
Timothy WallJan 17, 2008 5:15 am 
Nicolas VienneJan 17, 2008 5:53 am 
Nicolas VienneJan 17, 2008 5:56 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Structure OrderActions...
From:Nicolas Vienne (ikar@tagazok.net)
Date:Jan 10, 2008 2:56:36 am
List:net.java.dev.jna.users

Albert Strasheim <fullung@...> writes:

If you have control over the C library you are accessing with JNA, you could add getter and setter functions for the struct in C. You could then treat the struct as an opaque object.

For example, you'd have:

void TestStruct_setA(TestStruct* ts, int a); int TestStruct_getA(const TestStruct* ts);

I already thought of this way to solve the problem, but unfortunately, I have no control over this library : i'm not its authors (that's why I cannot control the field order). Moreover I cannot ask for including this getters and setters.

Anyway thank you.

I think that the undelying problem is that the communication between a high level Java and a low level native library is tied to the low level structures (ie use of pointers, memory allocation should be taken into account, etc.) and that a communication between high level langagues is expected (e.g. object field mapping ).

Cheers,

Nicolas