<div dir="ltr"><pre>Igor: I tried what you said but I get the same error. Here is more information:<br><br>The C function is like this:<br>&nbsp;<br>int <b>odbx_result</b>(<br>    odbx_t* <i><b>handle</b></i>,<br>    odbx_result_t** <i><b>result</b></i>,<br>
    struct timeval* <i><b>timeout</b></i>,<br>    unsigned long <i><b>chunk</b></i> )<br></pre><br>My method with FFI is this:<br><br>apiQueryResult: connectionHandle handle: handle timeout: timeout chunk: chunk<br>&nbsp;&nbsp;&nbsp; &lt;cdecl: long &#39;odbx_result&#39; (ulong ulong* DBXTimeSpec ulong) module: &#39;opendbx&#39;&gt;<br>
&nbsp;&nbsp;&nbsp; ^self externalCallFailed<br><br>And DBXTimeSpec has 2 attributes (seconds y nseconds). It has this class message:<br><br>DBXTimeSpec<br>fields<br>&nbsp;&nbsp;&nbsp; ^#(<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (seconds&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &#39;long&#39;)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (nseconds&nbsp;&nbsp;&nbsp; &#39;long&#39;))<br>
<br><br>Many thanks,<br><br>Mariano<br><br><br><br><div class="gmail_quote">On Wed, Sep 17, 2008 at 2:02 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2008/9/17 Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt;:<br>

<div><div></div><div class="Wj3C7c">&gt; Hi everybody!<br>
&gt;<br>
&gt; I need to call a C function with a NULL value in one of the parameter. I<br>
&gt; tried to send it a nil but I got an error in FFI when trying to call that<br>
&gt; function. The error is: &quot;cannot coerce arguments&quot;. Obviously this error says<br>
&gt; FFI cannot map from nil to null.<br>
&gt;<br>
&gt; Do someone know how can I do this?<br>
&gt;<br>
</div></div>you mean C&#39;s NULL?<br>
AFAIK it defined as<br>
#define NULL 0<br>
<br>
so, in squeak you can simply pass 0.<br>
<br>
&gt; many thanks,<br>
&gt;<br>
&gt; mariano<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</font></blockquote></div><br></div>