MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / db_setlocal

Function db_setlocal

extlibs/lua/src/ldblib.c:233–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231
232
233static int db_setlocal (lua_State *L) {
234 int arg;
235 const char *name;
236 lua_State *L1 = getthread(L, &arg);
237 lua_Debug ar;
238 int level = (int)luaL_checkinteger(L, arg + 1);
239 int nvar = (int)luaL_checkinteger(L, arg + 2);
240 if (!lua_getstack(L1, level, &ar)) /* out of range? */
241 return luaL_argerror(L, arg+1, "level out of range");
242 luaL_checkany(L, arg+3);
243 lua_settop(L, arg+3);
244 checkstack(L, L1, 1);
245 lua_xmove(L, L1, 1);
246 name = lua_setlocal(L1, &ar, nvar);
247 if (name == NULL)
248 lua_pop(L1, 1); /* pop value (if not popped by 'lua_setlocal') */
249 lua_pushstring(L, name);
250 return 1;
251}
252
253
254/*

Callers

nothing calls this directly

Calls 10

getthreadFunction · 0.85
luaL_checkintegerFunction · 0.85
lua_getstackFunction · 0.85
luaL_argerrorFunction · 0.85
luaL_checkanyFunction · 0.85
lua_settopFunction · 0.85
checkstackFunction · 0.85
lua_xmoveFunction · 0.85
lua_setlocalFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected