MCPcopy Create free account
hub / github.com/DFHack/dfhack / auxgetstr

Function auxgetstr

depends/lua/src/lapi.c:588–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586
587
588static int auxgetstr (lua_State *L, const TValue *t, const char *k) {
589 const TValue *slot;
590 TString *str = luaS_new(L, k);
591 if (luaV_fastget(L, t, str, slot, luaH_getstr)) {
592 setobj2s(L, L->top, slot);
593 api_incr_top(L);
594 }
595 else {
596 setsvalue2s(L, L->top, str);
597 api_incr_top(L);
598 luaV_finishget(L, t, L->top - 1, L->top - 1, slot);
599 }
600 lua_unlock(L);
601 return ttnov(L->top - 1);
602}
603
604
605LUA_API int lua_getglobal (lua_State *L, const char *name) {

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