| 1013 | } |
| 1014 | |
| 1015 | apr_status_t md_json_writef(const md_json_t *json, apr_pool_t *p, md_json_fmt_t fmt, apr_file_t *f) |
| 1016 | { |
| 1017 | apr_status_t rv; |
| 1018 | const char *s; |
| 1019 | |
| 1020 | if ((s = md_json_writep(json, p, fmt))) { |
| 1021 | rv = apr_file_write_full(f, s, strlen(s), NULL); |
| 1022 | if (APR_SUCCESS != rv) { |
| 1023 | md_log_perror(MD_LOG_MARK, MD_LOG_ERR, rv, json->p, "md_json_writef: error writing file"); |
| 1024 | } |
| 1025 | } |
| 1026 | else { |
| 1027 | rv = APR_EINVAL; |
| 1028 | md_log_perror(MD_LOG_MARK, MD_LOG_ERR, rv, json->p, |
| 1029 | "md_json_writef: error dumping json (%s)", md_json_dump_state(json, p)); |
| 1030 | } |
| 1031 | return rv; |
| 1032 | } |
| 1033 | |
| 1034 | apr_status_t md_json_fcreatex(const md_json_t *json, apr_pool_t *p, md_json_fmt_t fmt, |
| 1035 | const char *fpath, apr_fileperms_t perms) |
no test coverage detected