MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / db_getlocal

Function db_getlocal

deps/lua/src/ldblib.c:144–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142
143
144static int db_getlocal (lua_State *L) {
145 int arg;
146 lua_State *L1 = getthread(L, &arg);
147 lua_Debug ar;
148 const char *name;
149 if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */
150 return luaL_argerror(L, arg+1, "level out of range");
151 name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2));
152 if (name) {
153 lua_xmove(L1, L, 1);
154 lua_pushstring(L, name);
155 lua_pushvalue(L, -2);
156 return 2;
157 }
158 else {
159 lua_pushnil(L);
160 return 1;
161 }
162}
163
164
165static int db_setlocal (lua_State *L) {

Callers

nothing calls this directly

Calls 8

getthreadFunction · 0.85
lua_getstackFunction · 0.85
luaL_argerrorFunction · 0.85
lua_getlocalFunction · 0.85
lua_xmoveFunction · 0.85
lua_pushstringFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pushnilFunction · 0.85

Tested by

no test coverage detected