lua-users home
lua-l archive

How to get Lua functions address?

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


Hi!
I want to do something like this:
I Lua file:
---------------------------------
function KeyFunc(key)
.
.
.
end
SetKeyFunction(KeyFunc)
---------------------------------
SetKeyFunction is a C function. It must to get the address of the 
function and store it in a variable.
Then, when the user press a key, I must call this func (KeyFunc) with 
a parameter (the key pressed).
I have 2 problems: 
1 - how to get and store a Lua function address in a C variable and
2 - how to call it with a parameter from C code.
Any tip?
Thanks in advance
José

AltStyle によって変換されたページ (->オリジナル) /