[squeak-dev] FFI (Plugin) | Question about multi-dimensional arrays (e.g., char**, int**, void*****...)

Tobias Pape Das.Linux at gmx.de
Mon Jun 15 12:33:54 UTC 2020


> On 15.06.2020, at 14:24, Jakob Reschke <forums.jakob at resfarm.de> wrote:
> 
> 
> Marcel Taeumel <marcel.taeumel at hpi.de> schrieb am Mo., 15. Juni 2020, 13:22:
> 
> - Accept type names such as "int **" or "int[][]" in FFI-call specs and struct-field spec
> 
> One further note: int[][] is not valid C in parameter types. Only the first [] can be without length, and is equivalent to a pointer. So char*argv[] is the same as char**argv. Valid parameter type examples: int a[][3], int b[][2][3]. These are like int(*a)[3] and int(*b)[2][3] if I am not mistaken.
> 

Hello, C99:

/*      Find all paths that may contain dynamic libraries.
 *      Returns their count. libs may be NULL to get allocation size
 */
static size_t _sqo_lib_paths(size_t const n, char (*libs[n]))
{
 /*...*/
}

;)

-t


More information about the Squeak-dev mailing list