t***@public.gmane.org
2011-04-15 18:31:07 UTC
JNA has a StringArray function (also a PointerArray) whose purpose is
to be used in situations like this. The array of char* is a fairly
common idiom in C, so JNA provides StringArray(String[]) in order to
pass that sort of thing to C functions. Behind the scenes it converts
the Java strings into an array of pointers and populates it
appropriately. It'll also check for modifications after the function
call and update the original array if the native function changed
anything.
to be used in situations like this. The array of char* is a fairly
common idiom in C, so JNA provides StringArray(String[]) in order to
pass that sort of thing to C functions. Behind the scenes it converts
the Java strings into an array of pointers and populates it
appropriately. It'll also check for modifications after the function
call and update the original array if the native function changed
anything.