Commit Graph

1041 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
d582d3ae5a Undeprecate the array_list, lh_table and printbuf typedefs, but move each to the corresponding header files. 2017-12-06 23:58:33 -05:00
Eric Haszlakiewicz
8c82f0e5c3 Squash doxygen warnings, and make a few slight improvements to the docs. 2017-12-06 23:53:12 -05:00
Eric Haszlakiewicz
219025727d Upgrade doxygen's Doxyfile to version 1.8.8 2017-12-06 00:27:53 -05:00
Eric Haszlakiewicz
f2f103b986 Add a brief overview of each file to the docs. 2017-12-06 00:20:59 -05:00
Eric Haszlakiewicz
d6d81e6ece Adjust the description of json_object_iterator a bit. 2017-12-05 18:43:18 -05:00
Eric Haszlakiewicz
c01635e03e Rearrange README.md a bit and make it work better in the doxygen generated docs.
Also, add a table of contents, and a brief section on using json-c with links to
the header files most likely to be useful.
2017-12-05 18:01:43 -05:00
Eric Haszlakiewicz
ae242720b6 Add a couple more issues to the list of those closed for 0.13 2017-12-05 18:00:09 -05:00
Eric Haszlakiewicz
11ab365324 Deprecated a few typedefs, add docs on json_object_iter, move json_number_chars and json_hex-chars to json_object_private.h. 2017-12-05 09:20:59 -05:00
Eric Haszlakiewicz
a47eafe868 Cast to int64_t instead of long in test_int_add to fix the test on 32-bit platforms. 2017-12-05 04:32:12 +00:00
Eric Haszlakiewicz
0e7ec2ffcd Add cast to int on tolower() to fix warnings about array subscripts. 2017-12-05 04:29:36 +00:00
Eric Haszlakiewicz
aedd36ac8b Make sure to include the "*" on function pointer arguments to avoid a warnings from VS2015. See also PR#384. 2017-12-04 18:17:52 -05:00
Eric Haszlakiewicz
95015d474e Merge pull request #384 from ssrlive/patch-1
Fix a VS 2015 compiler warning.
2017-12-04 18:11:09 -05:00
ssrlive
2643658b6f Update json_object.c 2017-12-04 14:46:41 +08:00
ssrlive
7709cb1355 Fix a VS 2015 compiler warning.
In VS 2015, the warning text is "warning C4550: expression evaluates to a function which is missing an argument list".
2017-12-04 14:43:25 +08:00
Eric Haszlakiewicz
b34d26ff25 Add a change log entry for the upcoming 0.13 release. 2017-12-02 22:13:22 -05:00
Eric Haszlakiewicz
e00a07b885 Clean up *.vg.out files too to "make distcheck" works. 2017-11-30 18:17:04 -05:00
Eric Haszlakiewicz
5dae561d33 In json_object_deep_copy(), copy over _userdata, at least for json_type_string's with the default serializer set, and provide a way for people using custom serializers to provide a custom shallow_copy method. 2017-11-29 23:35:38 -05:00
Eric Haszlakiewicz
96efeadd6e Always build the json_object_deep_copy() code, but conditionalize running it on a --benchmark command line option. 2017-11-29 17:58:57 -05:00
Eric Haszlakiewicz
437716c5b4 Rename _set_last_err() to _json_c_set_last_err(). 2017-11-29 09:36:53 -05:00
Eric Haszlakiewicz
d99edade72 Merge branch 'commodo-json_deep_copy' 2017-11-29 09:13:32 -05:00
Eric Haszlakiewicz
4dd92180c6 Merge branch 'json_deep_copy' of https://github.com/commodo/json-c into commodo-json_deep_copy 2017-11-29 09:12:59 -05:00
Eric Haszlakiewicz
3628f16dd6 Rename json_object_add_int() to json_object_int_inc() and eliminate the "int64" variant since we store 64-bit values internally anyway. 2017-11-27 17:57:36 -05:00
Alexandru Ardelean
1eab22f0da tests: add test_deep_copy test
Seems to perform better than outputting to string
and re-parsing it.

BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 20 seconds
BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 7 seconds

It should make a difference on embedded systems.
The test was performed on a i5 desktop CPU [~3.5 years of age].

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-27 16:17:48 +02:00
Alexandru Ardelean
bf80d5ad0e json_object: implement json_object_deep_copy()
Because doing `json_tokener_parse(json_object_get_string(src))`
feels sloppy, dirty, and makes me want to cry at night
sometimes.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-27 16:17:48 +02:00
Eric Haszlakiewicz
91662a5b69 Merge pull request #363 from jvijtiuk/integer_addition
Issue #338, add json_object_add_int functions
2017-11-27 09:06:39 -05:00
Eric Haszlakiewicz
9c9529f798 Update test_parse.expected to match the code. 2017-11-27 08:48:08 -05:00
Eric Haszlakiewicz
f81da5e57a Rewrite the json_tokener_state_inf handling in json_tokener to be simpler, and avoid needless copying of the input into a temporary buffer. 2017-11-27 00:20:11 -05:00
Eric Haszlakiewicz
31a6c2fac8 Add a few more tests to the partial parse to cover bytes after "Infinity". 2017-11-27 00:18:55 -05:00
Eric Haszlakiewicz
ba11d334db Save proper expected output for test_parse from the previous commit. 2017-11-27 00:08:59 -05:00
Eric Haszlakiewicz
48f7e389fb Fix parsing of "-Infinity" when the "-" and "Infinity" are split across multiple calls.
Add several additional test cases for partial parsing of infinity values.
2017-11-27 00:04:33 -05:00
Eric Haszlakiewicz
4d1e0b4409 Issue #371: fix parsing of "-Infinity" (although in a somewhat different location than PR#372 used), and add a case to test_parse to check for this. 2017-11-26 22:44:39 -05:00
Eric Haszlakiewicz
2a22858fe7 Add a few extra cases to test_parse to show how trailing bytes are handled, especially for parsing "Infinity". 2017-11-26 22:34:43 -05:00
Eric Haszlakiewicz
b8738dd623 Rewrite test_basic_parse() to factor out a single_basic_parse() to avoid lots of duplicate boiler plate code.
Also, emit the input string in the output so it's easier to see what's going on.
2017-11-26 22:33:36 -05:00
Eric Haszlakiewicz
05c85ddc21 On VS 2013 and newer, actually use strtoll instead of redefining it to _strtoi64. 2017-11-26 14:17:17 -05:00
Eric Haszlakiewicz
04788421fe Merge pull request #373 from commodo/fix-appveyor-build
build: fix build on appveyor CI
2017-11-26 14:08:53 -05:00
Eric Haszlakiewicz
49003242d1 Merge pull request #381 from busterb/fix-makedist
Fix makedist
2017-11-26 13:57:54 -05:00
Brent Cook
185f43afef add/remove missing distribution files 2017-11-26 08:33:04 -06:00
Brent Cook
6727b46454 ignore more autoconf goo 2017-11-26 08:33:04 -06:00
Alexandru Ardelean
03f3b95248 json_util: define strtoll as _strtoi64 for MSVC
Got the idea from this blog post:
  http://www.enchantedage.com/node/231

Simple & concise stuff :)

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-07 16:51:01 +02:00
Alexandru Ardelean
5641227c9b strerror_override: re-organize strerror_override.h
Always include <string.h> before _json_c_strerror() definition.
Should fix linker issues on MSVC.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-07 16:48:53 +02:00
Eric Haszlakiewicz
fabb84a785 Remove out of date win32 build information, and mention the need to use cmake there. 2017-10-22 22:46:05 -04:00
Eric Haszlakiewicz
e424af32b7 Fix definition of NELEM in the tests. 2017-10-22 22:28:35 -04:00
Eric Haszlakiewicz
ac09581cc2 Issue #370: work around Clang-on-windows oddities by rearranging ifdefs. 2017-10-22 22:19:41 -04:00
Eric Haszlakiewicz
c9c84ca7ee Issue #369: note some useful settings when building for Android. 2017-10-19 23:30:51 -04:00
Eric Haszlakiewicz
cf913621f1 Use cmake to create the json-c.pc file, as suggested by PR#362. 2017-10-09 13:16:00 -04:00
Eric Haszlakiewicz
579f0746f0 Issue #173, follow up to using strtoll to allow this to work on older Windows environments: Use cmake to generate config.h from config.h.win32, including checking for strtoll with cmake, or fall back to _strtoi64 for older MSVC's.
Also, add a few missing files to the list of sources to build.
2017-10-03 22:50:29 -04:00
Eric Haszlakiewicz
cfbdf7757b The new cmake-generated VS builds now generate a dynamic .dll instead of a .lib 2017-09-17 21:44:04 -04:00
Eric Haszlakiewicz
139eb64b43 For appveyor builds, json_config.h is actually generated in the "include" directory. 2017-09-17 21:35:53 -04:00
Eric Haszlakiewicz
66a77d129a Split the list of cmake headers into public and private ones, and only install the public ones. 2017-09-17 21:27:07 -04:00
Eric Haszlakiewicz
8899f3fbfb Add a "cmake ." line to the appveyor build file to try to get it working again. 2017-09-17 21:25:49 -04:00