<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hallo everyone,<br>
<br>
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.<br>
<span><br>
I only found this post from  Andrea Raab:<br>
<span>1. Set up a pool of <b class="highlight">callback</b> functions
that are varargs based. This </span><br>
<span>avoids the need to generate <b class="highlight">callbacks</b>
stubs (which may be preferrable on </span><br>
<span>some platforms but it doesn't matter). These functions need to
"put </span><br>
<span>away" the stack pointer for the image to use, signal an FFI
semaphore </span><br>
<span>and <b class="highlight">callback</b> into the interpreter.
</span><br>
<span>2. When the <b class="highlight">callback</b> is picked up in
the image, the image needs to call </span><br>
<span>a set of support functions to take the arguments correctly from
the </span><br>
<span>stack. This would be based on some ffi spec.
</span><br>
<span>3. Once all the arguments are picked up, you run your <b
 class="highlight">callback</b> code.
</span><br>
<span>4. To return, you need to call another set of support functions
for </span><br>
<span>storing the return value and return from the <b class="highlight">callback</b>.
</span></span><br>
<span></span><span><br>
Maybe someone can help me ?<br>
<br>
Best regards<br>
Conrad<br>
<br>
<br>
</span>
</body>
</html>