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

Beckmann, Tom Tom.Beckmann at student.hpi.uni-potsdam.de
Wed Sep 16 08:11:59 UTC 2020


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.

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



More information about the Squeak-dev mailing list