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

Function auxupvalue

lua/ldblib.c:178–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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