Callbacks in Squeak

Bergel, Alexandre bergel at iam.unibe.ch
Fri Dec 14 14:25:25 UTC 2007


I am also interested into this. If you got a private answer please  
let me know.

Alexandre


On 10 Dec 2007, at 12:50, Conrad Pöpke wrote:

> 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
>
>
>

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






More information about the Squeak-dev mailing list