Callbacks in gforth-0.6.9-20080716
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
Callbacks in gforth-0.6.9-20080716         


Author: ddaa
Date: Aug 30, 2008 14:56

Hello, I have trouble making callbacks work in gforth-0.6.9-20080716.

So far, I can use libcc to build both the callback and the caller
function, and use them in gforth. But I cannot make the final step to
lib.fs callbacks. Apparently, I'm not passing the callback right to
the C code.

The system is an Ubuntu 8.04, with my self-made package of gforth, out
of combining the existing package and the gforth-0.6.9-20080716
upstream ("make check" passes). By the way, I'd be glad to give it to
anyone who could help make it land in Debian.

Can anyone (yes, Anton, I'm looking at you) help me make it work?
Show full article (2.38Kb)
2 Comments
Re: Callbacks in gforth-0.6.9-20080716         


Author: ddaa
Date: Sep 5, 2008 14:37

On Aug 30, 11:56 pm, ddaa gmail.com> wrote:
> Hello, I have trouble making callbacks work in gforth-0.6.9-20080716.
>
> So far, I can use libcc to build both the callback and the caller
> function, and use them in gforth. But I cannot make the final step to
> lib.fs callbacks. Apparently, I'm not passing the callback right to
> the C code.

I had some time again to investigate. I think I tracked down the
problem to the way fflib calls back into gforth_engine.

At this point I'm stumped.

-----8<----------8<----------8<----------8<----------8<----------8<-----
\c #include
\c #include
\c static va_alist gforth_clist;
\c static Cell *gforth_RP;
\c static char *gforth_LP...
Show full article (2.49Kb)
no comments
Re: Callbacks in gforth-0.6.9-20080716         


Author: Anton Ertl
Date: Sep 18, 2008 13:20

ddaa gmail.com> writes:
>Hello, I have trouble making callbacks work in gforth-0.6.9-20080716.
>
>So far, I can use libcc to build both the callback and the caller
>function, and use them in gforth. But I cannot make the final step to
>lib.fs callbacks. Apparently, I'm not passing the callback right to
>the C code.
>
>The system is an Ubuntu 8.04, with my self-made package of gforth, out
>of combining the existing package and the gforth-0.6.9-20080716
>upstream ("make check" passes). By the way, I'd be glad to give it to
>anyone who could help make it land in Debian.
>
>Can anyone (yes, Anton, I'm looking at you) help me make it work?

Actually, Bernd is the guy who knows about the callbacks (and I was
busy). And with the latest changes he has just committed, this
example seems to work nicely, whether I use libffi.fs or fflib.fs.
This is on a Linux-AMD64 box:
Show full article (1.55Kb)
no comments