| 220 | } |
| 221 | |
| 222 | static apr_status_t jselect_set(json_t *val, md_json_t *json, va_list ap) |
| 223 | { |
| 224 | const char *key; |
| 225 | json_t *j; |
| 226 | |
| 227 | j = jselect_parent(&key, 1, json, ap); |
| 228 | |
| 229 | if (!j) { |
| 230 | return APR_EINVAL; |
| 231 | } |
| 232 | |
| 233 | if (key) { |
| 234 | if (!json_is_object(j)) { |
| 235 | return APR_EINVAL; |
| 236 | } |
| 237 | json_object_set(j, key, val); |
| 238 | } |
| 239 | else { |
| 240 | /* replace */ |
| 241 | if (json->j) { |
| 242 | json_decref(json->j); |
| 243 | } |
| 244 | json_incref(val); |
| 245 | json->j = val; |
| 246 | } |
| 247 | return APR_SUCCESS; |
| 248 | } |
| 249 | |
| 250 | static apr_status_t jselect_set_new(json_t *val, md_json_t *json, va_list ap) |
| 251 | { |
no test coverage detected