Commit Graph

707 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
4d814600d7 Bump the major version of the .so library generated up to 4.0 to avoid conflicts because some downstream packagers of json-c had already done their own bump to ".so.3" for a much older 0.12 release. 2018-01-15 23:34:05 -05:00
Eric Haszlakiewicz
a70466ebbf PR#394: fix breakage with VS build. 2017-12-25 15:17:52 -05:00
Eric Haszlakiewicz
8270e83552 PR#394: don't always append the ".0" if the double value rounds to zero because some custom formats *will* include it (e.g. %.2f).
Also try to accomodate formats to explicitly exclude the decimal (e.g. %.0f).
2017-12-25 15:17:52 -05:00
Eric Haszlakiewicz
eb55c83600 Merge pull request #392 from besser82/json-c-0.13
json_object: Avoid invalid free (and thus a segfault) when ref_count gets < 0
2017-12-14 17:25:53 -05:00
Björn Esser
3e89278476 Makefile: Add ACLOCAL_AMFLAGS
This is recommended by the libtool manual.
2017-12-14 15:48:31 +01:00
Björn Esser
99ea93338d json_object: Avoid invalid free (and thus a segfault) when ref_count gets < 0 2017-12-14 15:45:22 +01:00
Rikard Falkeborn
b5a3eff582 Fix non-GNUC define for JSON_C_CONST_FUNCTION 2017-12-13 22:04:28 -05:00
Eric Haszlakiewicz
1882e3c425 Merge pull request #390 from besser82/json-c-0.13
json_object: Add const size_t json_c_object_sizeof()
2017-12-13 22:03:51 -05:00
Eric Haszlakiewicz
8baf437817 Apply gcc's "const" attribute to the json_c_object_sizeof() function as an optimizer hint. Also, rename that function from json_object_sizeof(). 2017-12-13 21:17:39 +01:00
Björn Esser
10fe00650c json_object: Add size_t json_object_sizeof() 2017-12-13 21:17:21 +01:00
Eric Haszlakiewicz
2849650f11 Regenerate Makefile.in with private headers excluded from install. json-c-0.13-20171207 2017-12-07 18:28:34 -05:00
Eric Haszlakiewicz
b484ff0b6d Merge d447fbc from master to json-c-0.13, to avoid installing private headers. 2017-12-07 18:25:40 -05:00
Eric Haszlakiewicz
d447fbca77 Don't include private headers when installing. 2017-12-07 18:24:08 -05:00
Eric Haszlakiewicz
17374f345d Add generated docs for the 0.13 release. 2017-12-07 18:06:19 -05:00
Eric Haszlakiewicz
0c991854a1 Save autoconf/automake generated files for the new 0.13 release. 2017-12-07 18:05:30 -05:00
Eric Haszlakiewicz
1f3bc5f20c Bump the version up to 0.13 2017-12-07 18:03:29 -05:00
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