I need to pass a nested struct as argument to JNI function e.g.
struct A {
int a
struct B
}
struct B {
long b
struct B * next
}
What is a good way to do this. I think I can use GetFieldID and
SetField for each field but since the structs are big its very
cumbersome.
Should I just pass a string of values and compose this data structure
on the java side. What other options do I have?
> I need to pass a nested struct as argument to JNI function e.g.
>
[quoted text clipped - 9 lines]
>
> What is a good way to do this.
A good way to do *what*?
> I think I can use GetFieldID and SetField for each field but since
> the structs are big its very cumbersome.
>
> Should I just pass a string of values and compose this data
> structure on the java side. What other options do I have?
It's far from clear what you're trying to do exactly. GetFieldID() etc
are for accessing fields in Java objects, but those C structs cannot
be fields in a Java object.
When you say "JNI function", are you referring to native methods,
parts of the JNI API, or C functions in general?
/gordon

Signature
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e