2 * Copyright (c) 2009 Petri Lehtinen <petri@digip.org>
4 * Jansson is free software; you can redistribute it and/or modify
5 * it under the terms of the MIT license. See LICENSE for details.
12 #define BUFFER_SIZE (256 * 1024)
14 int main(int argc, char *argv[])
19 char buffer[BUFFER_SIZE];
23 fprintf(stderr, "usage: %s\n", argv[0]);
27 count = fread(buffer, 1, BUFFER_SIZE, stdin);
28 if(count < 0 || count >= BUFFER_SIZE) {
29 fprintf(stderr, "unable to read input\n");
34 json = json_loads(buffer, &error);
36 fprintf(stderr, "%d\n%s\n", error.line, error.text);
40 result = json_dumps(json, 0);