/* Search for a name for a function in all loaded modules  */
static int pushglobalfuncname(lua_State *L, lua_Debug *ar)
/* Search for a name for a function in all loaded modules  */
static int pushglobalfuncname(lua_State *L, lua_Debug *ar)
{
    const char *name = lua_tostring(L, -1);
    if (strncmp(name, LUA_GNAME ".", 3) == 0) {
      lua_pushstring(L, name + 3);
      lua_remove(L, -2);
    }
    lua_copy(L, -1, top + 1);
    lua_settop(L, top + 1);
    return 1;
  }
  else {
    lua_settop(L, top);
    return 0;
  }
}