[FFI] Passing array of structures?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[FFI] Passing array of structures?

Nicolas Cellier-3

I can pass an ExternalStructure by value foo(struct bidule).

I can pass an ExternalStructure by address foo(struct bidule *)

But how to pass an array of structure ?
I just cannot figure the smalltalk class to do that...
ExternalData does deal only with atomic arrays...

Of course, i can loosely declare foo(char *),..
Anything better ?

Nicolas


Reply | Threaded
Open this post in threaded view
|

Re: [FFI] Passing array of structures?

Andreas.Raab
nicolas cellier wrote:
> I can pass an ExternalStructure by value foo(struct bidule).
>
> I can pass an ExternalStructure by address foo(struct bidule *)

Which is precisely equivalent to foo(struct bidule[])

> But how to pass an array of structure ?
> I just cannot figure the smalltalk class to do that...
> ExternalData does deal only with atomic arrays...
>
> Of course, i can loosely declare foo(char *),..
> Anything better ?

That is exactly the right way to pass arrays.

Cheers,
   - Andreas