<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-10-16 11:53 GMT+02:00 Annick Fron <span dir="ltr">&lt;<a href="mailto:list@afceurope.com" target="_blank">list@afceurope.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Hi Eliot,<div><br></div><div>Thank you. Meanwhile I have tried to use only pointers to structs by writing some C code.</div><div><br></div><div>I confirm that in Pharo you can load FFI and OldAlien in the ConfigurationBrowser.</div><div>Yet it seems both FFI and Alien versions in the ConfigurationBrowser are behind the squeak repositories. </div><div>I did not try if  the new versions worked.</div><div><br></div><div>I have posted some time ago an example for X11 windows on Linux, and I never got an answer why it was failing.</div></div></blockquote><div><br></div><div>actually I did answer ;) <a href="http://forum.world.st/FFI-on-Linux-again-td4780236.html">http://forum.world.st/FFI-on-Linux-again-td4780236.html</a><br></div><div>and  you changed the argument &quot;ourWindow&quot; to &quot;ourWindow xid&quot; like I proposed. But yes,<br>actually this didn&#39;t help, I guess. You still get the error &quot;bad argument&quot; ?<br><br></div><div>My next bet would be:<br></div><div>Maybe we cannot mix Alien calls with (old) FFI structures (display is a externalstructure defined for FFI).<br><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>It was the following</div><div>testGetOurWindowLocation<br>  &quot;self new testGetOurWindowLocation&quot;<br><br>  | display ourWindow aParent anX anY aWidth aHeight aBorderWidth aDepth |<br>  display := X11Display XOpenDisplay: nil.<br>  ourWindow := display ourWindow.<br>  (Alien lookup: &#39;XGetGeometry&#39; inLibrary: &#39;X11&#39;)<br>      primFFICallResult: nil<br>      withArguments:<br>          {display.<br>          ourWindow xid.<br>          (aParent := Alien new: 4).<br>          (anX := Alien new: 4).<br>          (anY := Alien new: 4).<br>          (aWidth := Alien new: 4).<br>          (aHeight := Alien new: 4).<br>          (aBorderWidth := Alien new: 4).<br>          (aDepth := Alien new: 4)}.<br>  (anX unsignedLongAt: 1) inspect.</div><div><br></div><div>Has anybody looked at Wayland (replacement of X11) on Linux ?</div><div><br></div><div>Annick</div><div><br><div><div>Le 15 oct. 2014 à 19:18, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; a écrit :</div><div><div class="h5"><br><blockquote type="cite"><div dir="ltr">Hi Annick,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 7:57 AM, Annick Fron <span dir="ltr">&lt;<a href="mailto:list@afceurope.com" target="_blank">list@afceurope.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What is the syntax to describe an external structure with an array of int of size 6 ?<br><br>I know only the syntax<br><br>fields<br>^#(<br>(param1 ‘long’)<br>(param2 ‘long’)<br>(param3 ‘long’)<br>(param4 ‘long’)<br>(param5 ‘long’)<br>(param6 ‘long’)<br>)<br></blockquote><div><br></div><div>Hmm.  Good question.  It seems you can write</div><div><br></div><div>fields</div><div><span style="white-space:pre-wrap">        </span>&quot;IAXCallStateEvent defineFields&quot;</div><div><span style="white-space:pre-wrap">        </span>^#(</div><div><span style="white-space:pre-wrap">                </span>(type &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(callNo &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(state &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(format &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(vformat &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(remote &#39;char[256]&#39;)</div><div><span style="white-space:pre-wrap">                </span>(remoteName &#39;char[256]&#39;)</div><div><span style="white-space:pre-wrap">                </span>(local &#39;char[256]&#39;)</div><div><span style="white-space:pre-wrap">                </span>(localContext &#39;char[256]&#39;)</div><div><span style="white-space:pre-wrap">        </span>)</div><div><br></div><div>But as a community we really need to document the FFI more thoroughly :-/</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span><font color="#888888"><br>Annick<br></font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div></div></div></blockquote></div></div></div></div><div><div>Le 15 oct. 2014 à 19:18, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; a écrit :</div><div><div class="h5"><br><blockquote type="cite"><div dir="ltr">Hi Annick,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 7:57 AM, Annick Fron <span dir="ltr">&lt;<a href="mailto:list@afceurope.com" target="_blank">list@afceurope.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What is the syntax to describe an external structure with an array of int of size 6 ?<br>
<br>
I know only the syntax<br>
<br>
fields<br>
^#(<br>
(param1 ‘long’)<br>
(param2 ‘long’)<br>
(param3 ‘long’)<br>
(param4 ‘long’)<br>
(param5 ‘long’)<br>
(param6 ‘long’)<br>
)<br></blockquote><div><br></div><div>Hmm.  Good question.  It seems you can write</div><div><br></div><div>fields</div><div><span style="white-space:pre-wrap">        </span>&quot;IAXCallStateEvent defineFields&quot;</div><div><span style="white-space:pre-wrap">        </span>^#(</div><div><span style="white-space:pre-wrap">                </span>(type &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(callNo &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(state &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(format &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(vformat &#39;long&#39;)</div><div><span style="white-space:pre-wrap">                </span>(remote &#39;char[256]&#39;)</div><div><span style="white-space:pre-wrap">                </span>(remoteName &#39;char[256]&#39;)</div><div><span style="white-space:pre-wrap">                </span>(local &#39;char[256]&#39;)</div><div><span style="white-space:pre-wrap">                </span>(localContext &#39;char[256]&#39;)</div><div><span style="white-space:pre-wrap">        </span>)</div><div><br></div><div>But as a community we really need to document the FFI more thoroughly :-/</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span><font color="#888888"><br>
Annick<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>
</blockquote></div></div></div><br></div></blockquote></div><br></div></div>