[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Conversion Lua function to C function
- From: Asko Kauppi <askok@...>
- Date: Sat, 17 Oct 2009 21:08:17 +0530
What he needs to do is store the Lua function entry as such (make a
copy, forget about C pointers) in the Lua registry or a userdata's
environment. This is a common need and many source codes will carry
samples. Then have a C side common callback which picks up that stored
ref to the Lua function and executes it. I've made a helper for all
this but that code is not public.
On 17.10.2009, at 21.03, Wesley Smith <email@example.com> wrote:
I don't completely follow, but you can store arbitrary function
pointers as lightuserdata.
On Oct 17, 2009, at 1:47 AM, Jiří Prymus <firstname.lastname@example.org> wro
I would like to know if there is any chance to convert lua function
c function. I program a small opencv wrapper and there is one
function where I need pointer to function. And that's a problem
because I can get only pointer to Lua function and when I convert it
to C function then it does nothing. I know that lua functions are
stored in tables and that's probably why it doesn't work.
In fact my problem is function gtk_signal_connect(...) where slot
function is my lua function.
Thanks for answer.