5 #define BUFFER_SIZE (256 * 1024)
7 int main(int argc, char *argv[])
12 char buffer[BUFFER_SIZE];
16 fprintf(stderr, "usage: %s\n", argv[0]);
20 count = fread(buffer, 1, BUFFER_SIZE, stdin);
21 if(count < 0 || count >= BUFFER_SIZE) {
22 fprintf(stderr, "unable to read input\n");
27 json = json_loads(buffer, &error);
29 fprintf(stderr, "%d\n%s\n", error.line, error.text);
33 result = json_dumps(json, 0);