MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / lua_getglobal

Function lua_getglobal

src/vm/luavm/lua/lapi.c:582–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580
581
582LUA_API int lua_getglobal (lua_State *L, const char *name) {
583 Table *reg = hvalue(&G(L)->l_registry);
584 const TValue *gt; /* global table */
585 lua_lock(L);
586 gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
587 setsvalue2s(L, L->top, luaS_new(L, name));
588 api_incr_top(L);
589 luaV_gettable(L, gt, L->top - 1, L->top - 1);
590 lua_unlock(L);
591 return ttnov(L->top - 1);
592}
593
594
595LUA_API int lua_gettable (lua_State *L, int idx) {

Callers 8

GetVmRunEnvFunction · 0.85
ExLuaPrintFunction · 0.85
RunMethod · 0.85
luaB_printFunction · 0.85
dolibraryFunction · 0.85
get_promptFunction · 0.85
l_printFunction · 0.85
pushargsFunction · 0.85

Calls 3

luaH_getintFunction · 0.85
luaS_newFunction · 0.85
luaV_gettableFunction · 0.85

Tested by

no test coverage detected