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

Function auxupvalue

deps/lua/src/ldblib.c:179–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178
179static int auxupvalue (lua_State *L, int get) {
180 const char *name;
181 int n = luaL_checkint(L, 2);
182 luaL_checktype(L, 1, LUA_TFUNCTION);
183 if (lua_iscfunction(L, 1)) return 0; /* cannot touch C upvalues from Lua */
184 name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n);
185 if (name == NULL) return 0;
186 lua_pushstring(L, name);
187 lua_insert(L, -(get+1));
188 return get + 1;
189}
190
191
192static int db_getupvalue (lua_State *L) {

Callers 2

db_getupvalueFunction · 0.85
db_setupvalueFunction · 0.85

Calls 6

luaL_checktypeFunction · 0.85
lua_iscfunctionFunction · 0.85
lua_getupvalueFunction · 0.85
lua_setupvalueFunction · 0.85
lua_pushstringFunction · 0.85
lua_insertFunction · 0.85

Tested by

no test coverage detected