lua-users home
lua-l archive

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


How can I do the following:

lua_register( L, "aFunction", func );
lua_register( L, "anotherFunction", func );
lua_register( L, "aThirdFunction", func );

static int func (lua_State *L) 
{
	// How do I check which function that was actually called?
}


... I also want to know how to "trap" those tags (or what they are called).
So I can do this in Lua:

func[ "aFunction" ] = 3
func[ "anotherFunction" ] = 8
func[ "aThirdFunction" ] = 1


Please help me out!

/Peter Bjorklund