summaryrefslogtreecommitdiff
path: root/reformatter
diff options
context:
space:
mode:
authorlloydh <lloydh@e775cfb5-b74b-0410-aad5-5bebe4a96390>2007-07-25 06:58:52 +0000
committerlloydh <lloydh@e775cfb5-b74b-0410-aad5-5bebe4a96390>2007-07-25 06:58:52 +0000
commitf4f23d8f42e781bc11a184fe5fcfc5b30ff73653 (patch)
treedd288f274a5e4c23782cacd652b5a30311b0c505 /reformatter
parentaa80518b07e6a21e6d875830e8864530458cd8dd (diff)
downloadyajl-f4f23d8f42e781bc11a184fe5fcfc5b30ff73653.tar.gz
support comments, configurable with an argument to yajl_alloc.
git-svn-id: http://yajl-c.googlecode.com/svn/yajl/trunk@63 e775cfb5-b74b-0410-aad5-5bebe4a96390
Diffstat (limited to 'reformatter')
-rw-r--r--reformatter/json_reformat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/reformatter/json_reformat.c b/reformatter/json_reformat.c
index 275af16..ef0b3a7 100644
--- a/reformatter/json_reformat.c
+++ b/reformatter/json_reformat.c
@@ -143,6 +143,8 @@ main(int argc, char ** argv)
yajl_gen g;
yajl_status stat;
size_t rd;
+ /* allow comments */
+ yajl_parser_config cfg = { 1 };
/* check arguments. We expect exactly one! */
if (argc == 2) {
@@ -158,7 +160,7 @@ main(int argc, char ** argv)
g = yajl_gen_alloc(&conf);
/* ok. open file. let's read and parse */
- hand = yajl_alloc(&callbacks, (void *) g);
+ hand = yajl_alloc(&callbacks, &cfg, (void *) g);
rd = fread((void *) fileData, 1, sizeof(fileData) - 1, stdin);