[Pharo-users] [squeak-dev] FFI syntax

Chris Cunningham cunningham.cb at gmail.com
Wed Oct 15 21:09:52 UTC 2014


So, I use the ODBC package from SqueakMap, which relies on FFI.  It works.
Although I have a fun time trying to remember how to do it each time, so I
wrote notes the last time.  In essence:

<Load FFI From SqueakMap>
<Load ODBC For Squeak from SqueakMap>

<Load FFI-Win32 manually (constants need to go first, by hand) from
source.squeak.org/FFI>
- this last one because it regularly fails for Win32 things, which I use.
Among other things, this part requires you to turn on _ as part of variable
names, so that things like
WS_EX_ACCEPTFILES := 16r10.
is valid.

Note this is all old FFI - not Alien.

-cbc

On Wed, Oct 15, 2014 at 1:59 PM, Nicolai Hess <nicolaihess at web.de> wrote:

> 2014-10-15 19:18 GMT+02:00 Eliot Miranda <eliot.miranda at gmail.com>:
>
>> Hi Annick,
>>
>> On Wed, Oct 15, 2014 at 7:57 AM, Annick Fron <list at afceurope.com> wrote:
>>
>>> What is the syntax to describe an external structure with an array of
>>> int of size 6 ?
>>>
>>> I know only the syntax
>>>
>>> fields
>>> ^#(
>>> (param1 ‘long’)
>>> (param2 ‘long’)
>>> (param3 ‘long’)
>>> (param4 ‘long’)
>>> (param5 ‘long’)
>>> (param6 ‘long’)
>>> )
>>>
>>
>> Hmm.  Good question.  It seems you can write
>>
>> fields
>> "IAXCallStateEvent defineFields"
>> ^#(
>> (type 'long')
>> (callNo 'long')
>> (state 'long')
>> (format 'long')
>> (vformat 'long')
>> (remote 'char[256]')
>> (remoteName 'char[256]')
>> (local 'char[256]')
>> (localContext 'char[256]')
>> )
>>
>
>
>
>
>>
>> But as a community we really need to document the FFI more thoroughly :-/
>>
>>
>
> +1
> I can not even find up to date information on how to *install* current
> working FFI.
> Aren't there any "alive" projects build on FFI (old or Alien-FFI).
> It would help to see more real-life examples.
>
>
>
>
>>
>>> Annick
>>>
>>
>>
>>
>> --
>> best,
>> Eliot
>>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141015/64d1b582/attachment.htm


More information about the Squeak-dev mailing list