MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / db_getlocal

Function db_getlocal

lua/ldblib.c:143–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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