I'm learning how to use dart ffi.
I don't have much C experience or knowledge.
I'm trying to call a function from a C library(tiny file dialogs).
I can call other functions however I can't call this one
char * tinyfd_saveFileDialog(
char const * aTitle , /* NULL or "" */
char const * aDefaultPathAndFile , /* NULL or "" */
int aNumOfFilterPatterns , /* 0 */
char const * const * aFilterPatterns , /* NULL or {"*.jpg","*.png"} */
char const * aSingleFilterDescription ) /* NULL or "image files" */
{
the main issue is that I don't understand what
char const* const * a FilterProperties, / *Null or {"*.jpg", "*.png"} */
means.
As far as I was able to get from this issue the C function is asking for an array of strings. The arg aNumberOfFilterPatterns
defines the length of the array.
If that's the case, how can I prepare the array in dart to pass it to C?