| 177 | |
| 178 | |
| 179 | static 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 | |
| 192 | static int db_getupvalue (lua_State *L) { |
no test coverage detected