[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Get the function value
- From: "Björklund, Peter" <Peter.Bjorklund@...>
- Date: Tue, 4 Sep 2001 11:55:53 +0200
How do I get the function value from the stack?
-----------------------------------
Sample Lua code:
function onTimer()
doStuff();
end
function onInit()
-- This is a C function
setTimer( 5.0, onTimer );
end
----------------------------------
C code:
static int setTimer(lua_State *L)
{
if ( lua_isnumber( L, 1 ) )
g_waitTime = lua_tonumber( L, 1 );
// lua_typename( L, lua_type( L, 2 ) )
// returns "function" which is what I want :)
g_functionName = // How do I get this parameter?
return 0;
}
Please help me out!
/Peter