[squeak-dev] FFI type for 'char[12]'?

Eliot Miranda eliot.miranda at gmail.com
Wed Sep 16 15:08:24 UTC 2020


Hi Tom,

On Wed, Sep 16, 2020 at 1:12 AM Beckmann, Tom <
Tom.Beckmann at student.hpi.uni-potsdam.de> wrote:

> Hi,
>
> for ExternalStructure fields definitions I worked around this by exploding
> the array, as in
> #((str1 'char') (str2 'char') (str3 'char') (str4 'char') (str5 'char'))
>
> The same works for other ExternalTypes like Foo of course.
>
> I also have an experimental set of changes that adds an ExternalArrayType
> to support this, however it still has some untested corner cases. I'll
> investigate getting it merged to FFI soon.
>

It is much better to have a new facility "out in the wild" available to
look at b others and test than it is to sit on something until it is
perfect.  Please do release it asap.  Then we can all collaborate on
writing tests for it (we would need tests in the FFI test suite), reviewing
the code, etc.



> Best,
> Tom
> ________________________________________
> From: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> on
> behalf of Taeumel, Marcel
> Sent: Wednesday, September 16, 2020 9:58:45 AM
> To: squeak-dev
> Subject: Re: [squeak-dev] FFI type for 'char[12]'?
>
> Hi Tony,
>
> such container types are still work-in-progress. :-/ For char[12], you can
> either use "string" or "char*", I suppose. "Foo x[5]" can be expressed
> through ExternalData, too, which would be "Foo*".
>
> Best,
> Marcel
>
> Am 16.09.2020 09:49:20 schrieb Tony Garnock-Jones <
> tonyg at leastfixedpoint.com>:
>
> Hi all,
>
> Is there some way in the FFI to specify that an ExternalStructure has a
> member whose type is like 'char x[12]'?
>
> Similarly, given some ExternalStructure Foo, can I have another
> structure that has a member like 'Foo x[5]'?
>
> Tony
>
>
>

-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200916/71f0fbc5/attachment.html>


More information about the Squeak-dev mailing list