Eric Hawicz
bf92456789
Make json_parse a bit more useful by adding -u (validate UTF8) and -P (specify arbitrary tokener parse flags), and read from stdin if no filename is provided.
2 months ago
Eric Hawicz
474ee12435
Fix the apps/json_parse "-s" (strict) option so it actually does something, and default to non-strict.
11 months ago
Matthias Gatto
9803032b9d
add JSON_C_TO_STRING_COLOR option
This option enable color in json_object_to_json_string_ext.
I've try to made something similar to jq output,
but I've color true/false and null in purple,
as it's what is common color scheme used in programing language in emacs.
also add a '-c' option into json_parser to test it.
note: that I could have done a color() function similar to
what is done with indent(), but as the code is pretty small
I've keep it as it. so if you want me to use a subfunction
tell me and I'll do it.
Signed-off-by: Matthias Gatto <matthias.gatto@protonmail.com>
3 years ago
Eric Hawicz
11311ed2a3
Fix the -f option to apps/json_parse, add a -F <arg> option to specify arbitrary flags to pass to json_object_to_json_string_ext().
2 years ago
Eric Haszlakiewicz
bdd5e03d6e
Apply some of the fixes from PR #740 , although by using size_t instead of castings.
3 years ago
Eric Haszlakiewicz
6ee0a35a20
Fix #771/#768 by marking usage() as "noreturn" instead of using "FALLTHRU" in the case statement where it'd called.
3 years ago
An7ar35
5d00384e0d
missing 'FALLTHRU' added to sort out error messages when using "-Werror=implicit-fallthrough" flag
3 years ago
Eric Haszlakiewicz
6ba1adf8ef
Include the tests and apps directories at the _end_, since order in the
cmake rules matters, and fix compile warnings now that we're building
those sources with all the regular flags.
3 years ago
Marc
4e9e44e525
Fix read past end of buffer
Resolves https://github.com/json-c/json-c/issues/654
5 years ago
Eric Hawicz
45b6416652
Merge branch 'master' of https://github.com/json-c/json-c
5 years ago
Pierce Lopez
090ae4e4d4
json_parse demo: fix and use usage() function
5 years ago
Eric Hawicz
9b64c3e347
Fix printf format issues in apps/json_parse, and actually call the usage() function.
5 years ago
Eric Haszlakiewicz
d9981f67dd
Extend the CMakeLists.txt in the apps directory to be usable as a standalone build, to link against other versions of json-c.
Tweak json_parse.c slightly to allow it to build against older json-c versions.
5 years ago
Eric Haszlakiewicz
55d053118e
Add an apps directory, and a json_parse program to parse an input file and report on memory usage.
This is intended to provide a way, during development, to test out the memory
and performance impacts of a change.
5 years ago