1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
-
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdint.h>
- #include "json.h"
- int main(int argc, char* argv[]) {
- FILE* f;
- size_t fsz;
- char* contents, *txt;
- int nr;
- struct json_file* jf;
-
- jf = json_load_path(argv[1]);
-
-
- json_file_free(jf);
-
- return 0;
-
-
- struct json_output_format fmt = {
- .indentChar = ' ',
- .indentAmt = 4,
- .minArraySzExpand = 4,
- .minObjSzExpand = 3,
- .trailingComma = 1,
- .objColonSpace = 1,
- .useSingleQuotes = 1,
- .noQuoteKeys = 1,
- .maxLineLength = 20,
- };
-
-
- struct json_write_context ctx;
- ctx.sb = json_string_buffer_create(4000);
- ctx.fmt = fmt;
- ctx.depth = 0;
-
- json_stringify(&ctx, jf->root);
-
-
- printf(">%s<\n", ctx.sb->buf);
-
- return 0;
- }
|