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

Function lua_geti

depends/lua/src/lapi.c:628–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626
627
628LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) {
629 StkId t;
630 const TValue *slot;
631 lua_lock(L);
632 t = index2addr(L, idx);
633 if (luaV_fastget(L, t, n, slot, luaH_getint)) {
634 setobj2s(L, L->top, slot);
635 api_incr_top(L);
636 }
637 else {
638 setivalue(L->top, n);
639 api_incr_top(L);
640 luaV_finishget(L, t, L->top - 1, L->top - 1, slot);
641 }
642 lua_unlock(L);
643 return ttnov(L->top - 1);
644}
645
646
647LUA_API int lua_rawget (lua_State *L, int idx) {

Callers 8

ipairsauxFunction · 0.85
tinsertFunction · 0.85
tremoveFunction · 0.85
tmoveFunction · 0.85
addfieldFunction · 0.85
unpackFunction · 0.85
partitionFunction · 0.85
auxsortFunction · 0.85

Calls 2

index2addrFunction · 0.85
luaV_finishgetFunction · 0.85

Tested by

no test coverage detected