I’m mocking about with plt-scheme’s ffi and I have a C-function that returns a char ** (array of strings). If I declare my function as (_fun _pointer -> _pointer), how do I convert the result to a list of strings in scheme?
Here are the relevant C-declarations:
typedef char **MYSQL_ROW; /* return data as array of strings */ // ... MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result);
I think that what you want is the cvector:
http://docs.plt-scheme.org/foreign/Derived_Utilities.html#(part._foreign~3acvector)
A cvector of _string/utf-8 or whichever encoding you need seems reasanable.
But that’s from a quick survey of the docs – I haven’t tried this myself. Please let me know if it works!