Hello,
On Jan 10, 2008 12:56 PM, Nicolas Vienne <ikar...@tagazok.net> wrote:
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.
All is not necessarily lost. You could write your own library that
adds these getters and setters, and link it against the third party
library.
One would also need some way of reexporting the functions from the
original library from your new library. I'll google around a bit. Or
maybe someone else has done this before?
Cheers,
Albert