<br><br><div class="gmail_quote">On Sun, Jul 26, 2009 at 12:37 PM, Philipp Tessenow <span dir="ltr">&lt;<a href="mailto:philipp.tessenow@student.hpi.uni-potsdam.de">philipp.tessenow@student.hpi.uni-potsdam.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Kiran,<br>
<br>
as far as I know the Alien FFI supports callbacks<br>
(<a href="http://wiki.squeak.org/squeak/6100" target="_blank">http://wiki.squeak.org/squeak/6100</a>).<br>
It looks pretty cool, but the wiki page says it supports Mac only,</blockquote><div><br></div><div>That&#39;s incorrect.  Alien supports x86 only.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
 so if<br>
you want callbacks in Unix or Windows you may go another way:<br>
<br>
Fork a new process that waits on a registered semaphore (&#39;semaIndex :=<br>
Smalltalk registerExternalObject: (example_semaphore).&#39;).<br>
Then write a Squeak plugin that implements the callback you need. Every<br>
time your callback is called, signal the registered semaphore<br>
(&#39;interpreterProxy-&gt;signalSemaphoreWithIndex(semaIndex)&#39;) so your Squeak<br>
process can do whatever it needs to do.<br>
<br>
See <a href="http://www.hpi.uni-potsdam.de/hirschfeld/projects/phidgetlab/" target="_blank">http://www.hpi.uni-potsdam.de/hirschfeld/projects/phidgetlab/</a> for an<br>
example of the second way.<br>
<br>
I hope that helps ;)<br>
<br>
Best regards,<br>
  Philipp<br>
<br>
<br>
KiranMutt schrieb:<br>
<div><div></div><div class="h5">&gt; Hello:<br>
&gt;<br>
&gt; I am working at interfacing an external C library ( static/dynamic ), in<br>
&gt; that context wanted to know,<br>
&gt; whether  Squeak supports callbacks and any examples on using the same is<br>
&gt; highly appreciated.<br>
&gt;<br>
&gt; Thanks &amp; Regards<br>
&gt; Kiran<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>