Callbacks in Squeak

Conrad Pöpke conrad.poepke at student.hpi.uni-potsdam.de
Mon Dec 10 15:50:37 UTC 2007


Hallo everyone,

we currently try to integrate a C libary into Squeak. It uses callbacks 
and I tried to find some information about callbacks in Squeak. It 
seems, that callbacks are supported in the Squeak VM. But my problem is, 
that I found no examples which show me in detail how to use them.

I only found this post from  Andrea Raab:
1. Set up a pool of *callback* functions that are varargs based. This
avoids the need to generate *callbacks* stubs (which may be preferrable on
some platforms but it doesn't matter). These functions need to "put
away" the stack pointer for the image to use, signal an FFI semaphore
and *callback* into the interpreter.
2. When the *callback* is picked up in the image, the image needs to call
a set of support functions to take the arguments correctly from the
stack. This would be based on some ffi spec.
3. Once all the arguments are picked up, you run your *callback* code.
4. To return, you need to call another set of support functions for
storing the return value and return from the *callback*.

Maybe someone can help me ?

Best regards
Conrad


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20071210/dc960ee0/attachment.htm


More information about the Squeak-dev mailing list