| 1800 | } |
| 1801 | |
| 1802 | static JSONValue json_load(const char *filename) |
| 1803 | { |
| 1804 | FILE *f; |
| 1805 | JSONValue val; |
| 1806 | size_t size; |
| 1807 | char *buf; |
| 1808 | |
| 1809 | f = fopen(filename, "rb"); |
| 1810 | if (!f) { |
| 1811 | perror(filename); |
| 1812 | exit(1); |
| 1813 | } |
| 1814 | fseek(f, 0, SEEK_END); |
| 1815 | size = ftell(f); |
| 1816 | fseek(f, 0, SEEK_SET); |
| 1817 | buf = malloc(size + 1); |
| 1818 | fread(buf, 1, size, f); |
| 1819 | fclose(f); |
| 1820 | val = json_parse_value_len(buf, size); |
| 1821 | free(buf); |
| 1822 | return val; |
| 1823 | } |
| 1824 | |
| 1825 | void fs_dump_cache_load(FSDevice *fs1, const char *cfg_filename) |
| 1826 | { |
no test coverage detected