On Sun, Jul 26, 2009 at 12:37 PM, Philipp Tessenow <philipp.tessenow@student.hpi.uni-potsdam.de> wrote:
Hello Kiran,

as far as I know the Alien FFI supports callbacks
(http://wiki.squeak.org/squeak/6100).
It looks pretty cool, but the wiki page says it supports Mac only,

That's incorrect.  Alien supports x86 only.
 
so if
you want callbacks in Unix or Windows you may go another way:

Fork a new process that waits on a registered semaphore ('semaIndex :=
Smalltalk registerExternalObject: (example_semaphore).').
Then write a Squeak plugin that implements the callback you need. Every
time your callback is called, signal the registered semaphore
('interpreterProxy->signalSemaphoreWithIndex(semaIndex)') so your Squeak
process can do whatever it needs to do.

See http://www.hpi.uni-potsdam.de/hirschfeld/projects/phidgetlab/ for an
example of the second way.

I hope that helps ;)

Best regards,
 Philipp


KiranMutt schrieb:
> Hello:
>
> I am working at interfacing an external C library ( static/dynamic ), in
> that context wanted to know,
> whether  Squeak supports callbacks and any examples on using the same is
> highly appreciated.
>
> Thanks & Regards
> Kiran
>