| 422 | } |
| 423 | |
| 424 | static enum format delete_format_hint(const char *resp, jsmntok_t **toks) |
| 425 | { |
| 426 | const jsmntok_t *result = json_get_member(resp, *toks, "result"); |
| 427 | const jsmntok_t *hint; |
| 428 | enum format format = JSON; |
| 429 | |
| 430 | if (!result) |
| 431 | return format; |
| 432 | |
| 433 | hint = json_get_member(resp, result, "format-hint"); |
| 434 | if (!hint) |
| 435 | return format; |
| 436 | |
| 437 | if (json_tok_streq(resp, hint, "simple")) |
| 438 | format = HUMAN; |
| 439 | |
| 440 | /* Don't let hint appear in the output! */ |
| 441 | /* Note the aritmetic on *toks for const-washing */ |
| 442 | json_tok_remove(toks, *toks + (result - *toks), hint-1, 1); |
| 443 | return format; |
| 444 | } |
| 445 | |
| 446 | static enum format choose_format(const char *resp, |
| 447 | jsmntok_t **toks, |
no test coverage detected