lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Mr. Bubel,

In my project I just ran into this issue last night - my workaround was to have Lua send the name of the function over to the C side as a string. My reasoning, I suppose, is if you know the name of the function to send an identifier back, you know the name of the function to send an identifier in double quotes back. It does feel a bit less solid, though.

-Es

On 8/17/07, W. C. Bubel <inmatarian@gmail.com> wrote:
I have a question about making calls from C into Lua functions. The manual is quite clear on what to do when you know the identifier of the function, however I'm wondering if the function itself (a pointer) can be sent to the C side and somehow stored to be called at a later time.

Specifically, I'm wondering if this syntax is possible, assuming setcallback is a C Function:

setcallback( function() ... end )

Is there a specific provision for this, that I overlooked, or would trick need to be involved?