MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / json_load

Function json_load

tinyemu/fs_net.c:1802–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1800}
1801
1802static 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
1825void fs_dump_cache_load(FSDevice *fs1, const char *cfg_filename)
1826{

Callers 1

fs_dump_cache_loadFunction · 0.85

Calls 1

json_parse_value_lenFunction · 0.85

Tested by

no test coverage detected