lua-users home
lua-l archive

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


I myself wrote:

[..]

int Foo(void) {
 printf("Am I Foo() or Moo( ?)");
}

void Register(void) {
 lua_Register(LuaState, Foo, "Foo");
 lua_Register(LuaState, Foo, "Moo");

}

Hey, it's still on the stack

   int Foo(void) {
     // Get name under which function was called
     const char *pszName = lua_tostring(pLuaState, +1);
                                                  ////
     printf("I'm %s", pszName);
   }

Right ?
Is it safe to do that ?

-Markus-