[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Interfacing lua with C
- From: "jimmyp_gr <jimmyp@...>" <jimmyp@...>
- Date: Tue, 14 Jan 2003 00:56:39 -0000
Thanks for the fast reply,
> >2)I was hoping that there would be some way to get rid of the wrappers
> >for ech C function you wan't to call from lua code.Would it be
> >possible to write a universal wrapper that get's called in every
> >function call,then gets the function address and args (somehow... like
> >from the stack) and calls the C function(via inline assembly).
>
> Not portably, but yes. I think libffi (I forget the name) does this.
the portability issues have to do with the calling convention I
assume.That would be no problem since it would only take minor
alterations in the universal wrapper to port it.How is it possible to
make the lua interpreter call the wrapper function instead of the
actual C function supplying it with C function pointer and args(so
that the wrapper can do the actual calling)?