| 248 | } |
| 249 | |
| 250 | static apr_status_t jselect_set_new(json_t *val, md_json_t *json, va_list ap) |
| 251 | { |
| 252 | const char *key; |
| 253 | json_t *j; |
| 254 | |
| 255 | j = jselect_parent(&key, 1, json, ap); |
| 256 | |
| 257 | if (!j) { |
| 258 | json_decref(val); |
| 259 | return APR_EINVAL; |
| 260 | } |
| 261 | |
| 262 | if (key) { |
| 263 | if (!json_is_object(j)) { |
| 264 | json_decref(val); |
| 265 | return APR_EINVAL; |
| 266 | } |
| 267 | json_object_set_new(j, key, val); |
| 268 | } |
| 269 | else { |
| 270 | /* replace */ |
| 271 | if (json->j) { |
| 272 | json_decref(json->j); |
| 273 | } |
| 274 | json->j = val; |
| 275 | } |
| 276 | return APR_SUCCESS; |
| 277 | } |
| 278 | |
| 279 | int md_json_has_key(const md_json_t *json, ...) |
| 280 | { |
no test coverage detected