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

Function auxupvalue

extlibs/lua/src/ldblib.c:257–266  ·  view source on GitHub ↗

** get (if 'get' is true) or set an upvalue from a closure */

Source from the content-addressed store, hash-verified

255** get (if 'get' is true) or set an upvalue from a closure
256*/
257static int auxupvalue (lua_State *L, int get) {
258 const char *name;
259 int n = (int)luaL_checkinteger(L, 2); /* upvalue index */
260 luaL_checktype(L, 1, LUA_TFUNCTION); /* closure */
261 name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n);
262 if (name == NULL) return 0;
263 lua_pushstring(L, name);
264 lua_insert(L, -(get+1)); /* no-op if get is false */
265 return get + 1;
266}
267
268
269static int db_getupvalue (lua_State *L) {

Callers 2

db_getupvalueFunction · 0.85
db_setupvalueFunction · 0.85

Calls 5

luaL_checkintegerFunction · 0.85
luaL_checktypeFunction · 0.85
lua_getupvalueFunction · 0.85
lua_setupvalueFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected