MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / lua_getfenv

Function lua_getfenv

other_src/lua/src/lapi.cpp:648–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646
647
648LUA_API void lua_getfenv (lua_State *L, int idx) {
649 StkId o;
650 lua_lock(L);
651 o = index2adr(L, idx);
652 api_checkvalidindex(L, o);
653 switch (ttype(o)) {
654 case LUA_TFUNCTION:
655 sethvalue(L, L->top, clvalue(o)->c.env);
656 break;
657 case LUA_TUSERDATA:
658 sethvalue(L, L->top, uvalue(o)->env);
659 break;
660 case LUA_TTHREAD:
661 setobj2s(L, L->top, gt(thvalue(o)));
662 break;
663 default:
664 setnilvalue(L->top);
665 break;
666 }
667 api_incr_top(L);
668 lua_unlock(L);
669}
670
671
672/*

Callers 8

getpositionFunction · 0.70
jointableFunction · 0.70
printpat_lFunction · 0.70
matchlFunction · 0.70
aux_closeFunction · 0.70
db_getfenvFunction · 0.70
luaB_getfenvFunction · 0.70
PushFunctionEnvFunction · 0.50

Calls 1

index2adrFunction · 0.70

Tested by

no test coverage detected