Convert from md_json_fmt_t to the Jansson json_dumpX flags. */
| 952 | |
| 953 | /* Convert from md_json_fmt_t to the Jansson json_dumpX flags. */ |
| 954 | static size_t fmt_to_flags(md_json_fmt_t fmt) |
| 955 | { |
| 956 | /* NOTE: JSON_PRESERVE_ORDER is off by default before Jansson 2.8. It |
| 957 | * doesn't have any semantic effect on the protocol, but it does let the |
| 958 | * md_json_writeX unit tests run deterministically. */ |
| 959 | return JSON_PRESERVE_ORDER | |
| 960 | ((fmt == MD_JSON_FMT_COMPACT) ? JSON_COMPACT : JSON_INDENT(2)); |
| 961 | } |
| 962 | |
| 963 | static int dump_cb(const char *buffer, size_t len, void *baton) |
| 964 | { |
no outgoing calls
no test coverage detected