MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / auxgetstr

Function auxgetstr

lib/lua/src/lapi.c:639–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637
638
639l_sinline int auxgetstr (lua_State *L, const TValue *t, const char *k) {
640 const TValue *slot;
641 TString *str = luaS_new(L, k);
642 if (luaV_fastget(L, t, str, slot, luaH_getstr)) {
643 setobj2s(L, L->top.p, slot);
644 api_incr_top(L);
645 }
646 else {
647 setsvalue2s(L, L->top.p, str);
648 api_incr_top(L);
649 luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot);
650 }
651 lua_unlock(L);
652 return ttype(s2v(L->top.p - 1));
653}
654
655
656/*

Callers 2

lua_getglobalFunction · 0.85
lua_getfieldFunction · 0.85

Calls 2

luaS_newFunction · 0.85
luaV_finishgetFunction · 0.85

Tested by

no test coverage detected