Hi Phil and Esteban,
Thanks for your replies.
I've realised that I badly worded my question.�� By "opaque" I meant that
it is difficult to determine the underlying type of the
variables, but I still want to be access the values of typeA and typeB
in my example structure.
Phil, I had a look through your XMPP code, if it does show an example of
actually retrieving a structure member such as "typeA" in my example, my
apologies and please let me know where it is.
Thanks again,
Alistair
On Fri, 30 Nov 2018 at 23:46, Esteban Lorenzano <estebanlm@gmail.com> wrote:
>
> On 30 Nov 2018, at 19:50, phil--- via Pharo-users <pharo-users@lists.pharo.org> wrote:
>
> From: "phil@highoctane.be" <phil@highoctane.be>
> Subject: Re: [Pharo-users] UFFI and opaque(ish) types
> Date: 30 November 2018 at 19:50:03 CET
> To: Any question about pharo is welcome <pharo-users@lists.pharo.org>
>
>
> Inherit from FFIOpaqueObject
>
> + initialize TypeMap
>
> I have a few here:
>
> https://github.com/Pharophile/XmppTalk
>
> https://github.com/Pharophile/XmppTalk/tree/master/packages/XmppTalk-ExternalStructures.package
> https://github.com/Pharophile/XmppTalk/blob/master/packages/XmppTalk-LibStrophe.package/StropheLib.class/class/initializeTypeMap.st
>
> HTH
> Phil
>
>
> Yes, as he says/shows :)
>
> Esteban
> On Fri, Nov 30, 2018 at 2:39 PM Alistair Grant <akgrant0710@gmail.com> wrote:
>>
>> How are opaque(ish) types normally handled in UFFI (or FFI)?
>>
>> E.g. if I want to use libstuff which defines the following structure:
>>
>> struct stuffstruct {
>>�� �� ��typeA a;
>>�� �� ��typeB b;
>>�� �� ��} stufftype;
>>
>>
>> I might know they're integers, but not the size, signed vs. unsigned,
>> etc.
>>
>> The definitions of typeA and typeB are buried in multiple layers of
>> header files, dependent on #if tests, can be different sizes on
>> different platforms (e.g. Linux vs. MacOS), etc.?
>>
>> Is this documented somewhere?
>>
>> Thanks,
>> Alistair