Commit Graph
100 Commits
Author SHA1 Message Date
Eric Haszlakiewicz e8161a11bb Issue #15: add a way to set a JSON_TOKENER_STRICT flag to forbid commas at the end of arrays and objects. 2013-03-31 20:05:36 -05:00
Eric Haszlakiewicz 889400d946 Merge pull request #73 from ghazel/master
one definition of json_object_object_foreach only works on c99 and later
2013-03-23 17:06:03 -07:00
Eric Haszlakiewicz 5ec65e43b2 Merge pull request #71 from WillDignazio/master
Fix Broken Build, Check ADVANCE_CHAR
2013-03-15 21:19:48 -07:00
Eric Haszlakiewicz b64d5ab966 Merge pull request #70 from tg--/master
rename AM_CONFIG_HEADER to AC_CONFIG_HEADER
2013-03-03 20:34:34 -08:00
Eric Haszlakiewicz 1aa29b655a Issue #68: use -std=gnu99 because some versions of gcc seem to think that -std=c99 also implies -ansi, which causes warnings and build breakage. 2013-03-03 22:26:28 -06:00
Eric Haszlakiewicz 94aeed2ecd Include the test_locale test in the tests that run. 2013-02-26 21:14:07 -06:00
Eric Haszlakiewicz 5b36a432c8 Merge branch 'remicollet-issue-float'
Conflicts:
	json_util.c
2013-02-26 21:09:10 -06:00
Eric Haszlakiewicz 9b64c05ff9 Mark the "val" variable in json_object_object_foreach as unused so the compiler doesn't complain. Fix warnings in the testReplaceExisting test. 2013-02-21 12:32:29 -06:00
Eric Haszlakiewicz bfb329223a Add a runtime check to see if parse_int64 needs to workaround sscanf bugs. If that workaround is not needed parsing is nearly twice as fast. 2013-02-09 17:35:33 -06:00
Eric Haszlakiewicz ca8b27d183 Enable -Werror and fix a number of minor warnings that existed. 2013-02-09 16:35:24 -06:00
Eric Haszlakiewicz 92d289f5d3 Add a comment briefly describing json_object_object_length() 2013-02-09 16:18:05 -06:00
Eric Haszlakiewicz c6b399194d Merge pull request #62 from ghazel/master
json_object_object_length
2013-02-09 14:14:33 -08:00
Eric Haszlakiewicz ebeb6a40c9 Merge pull request #66 from ichernev/fix-test-parse
Fixed test_parse for \f
2013-02-09 13:59:51 -08:00
Eric Haszlakiewicz 3ae296f694 Merge pull request #60 from ghazel/master
rename _errno
2013-01-09 15:26:42 -08:00
Eric Haszlakiewicz 85da28c534 Merge pull request #58 from Abioy/master
escape '\f' in json_escape_str
2013-01-02 10:08:44 -08:00
Eric Haszlakiewicz fcc768e667 Bump the version up to 0.10.99 to make it clear that the master branch is beyond anything on the 0.10 branch. 2012-12-23 11:09:20 -06:00
Eric Haszlakiewicz 2943691181 Merge branch 'master' of https://github.com/json-c/json-c 2012-12-23 10:59:52 -06:00
Eric Haszlakiewicz 1461b49385 Add a json_c_version.h header (included from json.h), and several macros and functions for retrieving the json-c version at compile-time and run-time. 2012-12-23 10:57:44 -06:00
Eric Haszlakiewicz 56166e2dff Merge pull request #51 from remicollet/issue-dyndepth
Make maximum recursion depth a runtime option
2012-12-23 08:39:46 -08:00
Eric Haszlakiewicz d7de3aa24b Update the release checklist to include the INSTALL file, and adjust the git command to add the doc directory. 2012-12-23 10:27:14 -06:00
Eric Haszlakiewicz 2e9fef38c2 Revert the test_null test back to emitted to stdout, and update the expected output to match. 2012-12-23 10:25:03 -06:00
Eric Haszlakiewicz 86aedc2d2a Merge pull request #56 from TheCount/develop
Some houskeeping
2012-12-23 08:23:13 -08:00
Eric Haszlakiewicz 4e4af93d66 Fix issue #53 - ensure explicit length string are still NUL terminated, and fix json_tokener_parse() to work properly with embedded unicode \u0000 values in strings.
Adjust test_null to check for this case.
See also http://bugs.debian.org/687269
2012-12-09 16:32:11 -06:00
Eric Haszlakiewicz 7a4506d6df Remove configure as part of maintainer-clean instead of distclean. Addresses issue #48. 2012-12-09 15:46:35 -06:00
Eric Haszlakiewicz 7653d4952a Add PACKAGE_URL to config.h.in 2012-12-09 15:46:23 -06:00
Eric Haszlakiewicz aec876357c Add a missing json_object_get() so we don't try to use a freed object in test1. 2012-11-29 15:06:17 -05:00
Eric Haszlakiewicz 447b88a115 Fix a memory leak in the test_printbuf test. 2012-11-29 13:29:55 -06:00
Eric Haszlakiewicz 23461c75dd Include json_object_iterator.c in the list of sources. 2012-11-29 13:23:06 -06:00
Eric Haszlakiewicz f6b27cbb6c Make it safe to delete keys while iterating with the json_object_object_foreach macro. 2012-10-20 20:26:37 -05:00
Eric Haszlakiewicz 5abc0ea444 Reformat the json_object_object_foreach macro so it is readable, and document what is allowed to be done with the object while iterating. 2012-10-20 20:10:15 -05:00
Eric Haszlakiewicz e36e562872 Reformat json_object_object_get() and json_object_object_get_ex(). 2012-10-18 17:16:36 -05:00
Eric Haszlakiewicz 5450bed051 Fix json_object_object_get() so it returns NULL if the incoming json_object is NULL. 2012-10-18 17:14:41 -05:00
Eric Haszlakiewicz 5f4739e2eb Change json_object_put to return 1 if the object passed was actually freed. (or 0 if only the reference count was decremented) 2012-10-18 17:10:09 -05:00
Eric Haszlakiewicz c3d1d597ab Fix a memory leak in test1 with respect to how json_object_object_del was used. 2012-09-16 20:49:22 -05:00
Eric Haszlakiewicz c3068bfd09 Reformat the test sources. No functional change. 2012-09-16 20:43:29 -05:00
Eric Haszlakiewicz d1f237e28a Fix the home page in the README, and add a list of prerequisites. 2012-09-10 17:32:14 -05:00
Eric Haszlakiewicz 059e8f4d1d Merge pull request #44 from lastquestion/fix_gnu_macosx
Add an autoconf test to test whether the .section .gnu<warning>
2012-09-09 19:24:47 -07:00
Eric Haszlakiewicz 4b1a0668a8 Update the set_serializer test to match the actual output. 2012-09-09 13:53:12 -05:00
Eric Haszlakiewicz 38f421a2e7 Add a json_set_serializer() function to allow the string output of a json_object to be customized. 2012-09-02 15:21:56 -05:00
Eric Haszlakiewicz f74e8f8f9b Add my copyright. 2012-07-29 20:02:00 -05:00
Eric Haszlakiewicz d305cae12c Ignore the tests/testReplaceExisting binary. 2012-07-29 20:00:28 -05:00
Eric Haszlakiewicz 8ce53f9d1e Note the rename in the ChangeLog, and update the instructions in the README file. 2012-07-29 18:43:55 -05:00
Eric Haszlakiewicz 2f2180b70d Take a guess as to the rename changes changes needed to the Android part of the build.
I think this should work, but I can't test it.
2012-07-29 18:29:38 -05:00
Eric Haszlakiewicz 1f9d199522 Re-add the "json" pkg-config file as a compatibility shim.
Also rename the json-c-uninstalled.pc file.
2012-07-29 18:25:09 -05:00
Eric Haszlakiewicz 9f16e25a3e Bump the version of the new library since programs will need to be re-linked to use it. 2012-07-29 18:05:34 -05:00
Eric Haszlakiewicz 943b7a4de7 Add a compatibility symlink json->json-c in the include directory. 2012-07-29 18:05:08 -05:00
Eric Haszlakiewicz 075b783631 Add a --disable-oldname-compat option to configure to turn off the creation of the libjson.so library, and only include libjson-c.so 2012-07-29 17:48:22 -05:00
Eric Haszlakiewicz c7a21203de Ignore a couple more generated files. 2012-07-29 15:10:30 -05:00
Eric Haszlakiewicz 082419edf9 Fix the Libs line in json-uninstalled.pc to use -ljson-c 2012-07-29 15:09:59 -05:00
Eric Haszlakiewicz b98aa6eaa3 Create an additional libjson.so library that simply links against libjson-c, but emits a warning encouraging the use of the new library. 2012-07-29 14:59:01 -05:00
Eric Haszlakiewicz eb37094aa6 Check for the sys/cdefs.h header which on some systems defines the __warn_references macro. 2012-07-29 14:57:59 -05:00
Eric Haszlakiewicz ba1c3810cb Remove test_parse from the top level directory. (accidentally re-introduced with the last merge) 2012-07-29 14:08:26 -05:00
Eric Haszlakiewicz c2d3ccf3af Merge branch 'rename_library' of https://github.com/kdopen/json-c into kdopen-rename_library
Conflicts:
	.gitignore
	Makefile.am
	configure.in
	printbuf.c
	test1.c
	test1.expected
2012-07-29 14:06:52 -05:00
Eric Haszlakiewicz 92f31bd99a Handle the \f escape sequence (the two characters: backslash followed by an f, not a literal formfeed) and extend the test_parse test to check all valid escape sequences. 2012-07-29 12:31:07 -05:00
Eric Haszlakiewicz 8fcfeb63ec Default autogen.sh to not running configure, unless some command line options are specified. 2012-07-29 12:18:37 -05:00
Eric Haszlakiewicz 77c6239465 Initialize errno before calling sscanf in json_parse_int64() so parsing valid numbers after parsing an out of range number works. 2012-07-29 12:13:54 -05:00
Eric Haszlakiewicz 2da148df56 Merge pull request #37 from cgwalters/master
autogen.sh: Add /bin/sh interpreter, honor NOCONFIGURE=1 …
2012-07-29 09:46:22 -07:00
Eric Haszlakiewicz 6988f53fcb Rewrite json_object_object_add to replace just the value if the key already exists so keys remain valid.
This is particularly useful when replacing values in a loop, since it allows
 the key used by json_object_object_foreach to continue to be used.
2012-07-24 23:27:41 -05:00
Eric Haszlakiewicz 381f77c5bc Merge pull request #26 from ford-prefect/master
Android build system
2012-07-08 19:01:19 -07:00
Eric Haszlakiewicz 4154c55eda Add json_object_iterator.h to installed headers. 2012-07-08 20:38:53 -05:00
Eric Haszlakiewicz 9791c3896e Fix git commands for tagging a release. 2012-07-08 20:33:25 -05:00
Eric Haszlakiewicz eead1a7dc4 Remove unnecessary comment from json_util.c 2012-07-08 20:32:12 -05:00
Eric Haszlakiewicz 7bd49df30a Merge pull request #33 from mloskot/master
Added a bunch of missing HAVE_* defines
2012-07-08 18:27:02 -07:00
Eric Haszlakiewicz a789601e6d Merge pull request #27 from OBI-1/master
array_list_expand_internal needs length, not index.
2012-05-30 22:04:05 -07:00
Eric Haszlakiewicz c58386f33f Merge pull request #29 from mloskot/msvc-port
Add missing casts from void* and replace #if HAVE_X with #ifdef HAVE_X
2012-05-30 21:57:28 -07:00
Eric Haszlakiewicz 837d685d78 Use "nodoc", not "doc", for the name of the tarball w/o docs. 2012-05-30 23:03:34 -05:00
Eric Haszlakiewicz 1abaaee658 Update the ChangeLog with the rest of the changes that will be included in the 0.10 release. 2012-04-29 12:54:14 -05:00
Eric Haszlakiewicz e7bd2e97f3 Fill in the missing pieces of the release checklist. 2012-04-29 12:54:04 -05:00
Eric Haszlakiewicz 0cc1db6459 Change the format used for sprintbuf (but not scanf) to use %f instead of %lf because the "l" is unnecessary and some compilers behave differently with it present (e.g. MinGW).
Thanks for Mateusz Loskot for the fix.
2012-04-29 11:04:33 -05:00
Eric Haszlakiewicz 31faa49bd8 Ignore the new test1Formatted and test2Formatted executables. 2012-04-28 14:17:09 -05:00
Eric Haszlakiewicz 4c7f38eb9b Extend test1 and test2 to run using json_object_to_json_string_ext() based on an additional command line parameter.
Extend the run_output_test() function so we actually can pass command line
 parameters and so we can support different output files for the same test
 executable.
Also provide some hints about what to do if a test fails (i.e. set VERBOSE=1).
2012-04-28 14:14:26 -05:00
Eric Haszlakiewicz 3fcffe1bb0 Add a json_object_to_json_string_ext() function to allow the formatting of output to be selected.
There are now three options: JSON_C_TO_STRING_SPACED, JSON_C_TO_STRING_PLAIN and JSON_C_TO_STRING_PRETTY.
This also add a json_object_to_file_ext() that takes the same flags.
Existing output of json_object_to_json_string() is unchanged, and uses JSON_C_TO_STRING_SPACED.
Thanks fo Grant Edwards for the initial patches.
2012-04-28 13:26:09 -05:00
Eric Haszlakiewicz f931f61851 Fixed parsing numbers in E notation. ` 2012-04-24 22:17:13 -05:00
Eric Haszlakiewicz 4e000a65e6 Since we already use a local json_bool type, replace any stdbool.h usage with
that, since not all environments actually have a stdbool.h to use.
2012-04-24 21:54:07 -05:00
Eric Haszlakiewicz 0f8c534502 Merge pull request #25 from kdopen/doc_cleanup
Clean up documentation and correct sample code
2012-04-24 11:43:29 -07:00
Eric Haszlakiewicz ec7ce26ba8 Merge pull request #23 from mloskot/mloskot-msvc-fixes
Fix missing inttypes.h definitions for Visual Studio 2010 and earliers. ...
2012-04-23 11:30:37 -07:00
Eric Haszlakiewicz 178a4b059c Merge pull request #21 from kdopen/add_iterator
Add new iterator implementation and some NULL-pointer safety
2012-04-22 21:40:07 -07:00
Eric Haszlakiewicz 7502b377b7 Merge branch 'master' of https://github.com/json-c/json-c 2012-04-22 14:26:06 -05:00
Eric Haszlakiewicz 3d8817978c Actually save the expected output for the test_printbuf test so it passes. 2012-04-22 14:25:08 -05:00
Eric Haszlakiewicz 37cfe6bc4c Update the list of files to ignore. 2012-04-22 14:21:27 -05:00
Eric Haszlakiewicz e5c1e87f05 Add a test for the printbuf functions. 2012-04-22 14:13:01 -05:00
Eric Haszlakiewicz b80772a0f5 Use a different variable when referring to the json.la file, since the original lib_LTLIBRARIES means something special to automake. 2012-04-22 10:48:30 -05:00
Eric Haszlakiewicz c1b8891a13 Move the rest of the tests into the tests subdirectory. 2012-04-22 10:33:41 -05:00
Eric Haszlakiewicz 1e89ba68af Create a tests subdirectory and move one of the test to there. 2012-04-22 10:27:50 -05:00
Eric Haszlakiewicz 020ed640e8 Merge pull request #20 from kdopen/master
Additional explanatory comments
2012-04-19 21:03:22 -07:00
Eric Haszlakiewicz e0fa94ba31 Fix some bugs with how buffer sizes were being calcuated in printbuf_memset and an off-by-one error in printbuf_memappend. 2012-04-04 17:11:38 -07:00
Eric Haszlakiewicz 7f3298da85 Remove the "#undef PRINTBUF_DEBUG" from printbuf.h so it can be more easily turned on in the Makefile. 2012-04-04 17:11:38 -07:00
Eric Haszlakiewicz 8310d3634c Add a printbuf_memset() function to provide an effecient way to set and append things like whitespace indentation. 2012-04-04 17:11:38 -07:00
Eric Haszlakiewicz 0d79b53456 Fix some bugs with how buffer sizes were being calcuated in printbuf_memset and an off-by-one error in printbuf_memappend. 2012-04-03 14:54:25 -05:00
Eric Haszlakiewicz 61a154e58b Remove the "#undef PRINTBUF_DEBUG" from printbuf.h so it can be more easily turned on in the Makefile. 2012-04-03 14:48:15 -05:00
Eric Haszlakiewicz 2d48543f2e Add a printbuf_memset() function to provide an effecient way to set and append things like whitespace indentation. 2012-04-02 15:39:55 -05:00
Eric Haszlakiewicz 2b5929bb13 Direct people to send bug reports to the json-c google group. 2012-04-02 07:53:25 -07:00
Eric Haszlakiewicz a7bd85caba Remove a few more things in the distclean target to get rid of *all* generated files. 2012-04-02 07:53:25 -07:00
Eric Haszlakiewicz f30a9ace77 Fix a bug in json_tokener_parse_ex when re-using the same tokener to parse multiple objects. Now, json_tokener_reset() does not need to be called after a valid object is parsed. 2012-04-02 07:53:25 -07:00
Eric Haszlakiewicz 30c6c4a1be Split the json_tokener_parse tests off from test1 into their own test and add several more cases to check various incremental parsing situations. 2012-04-02 07:53:25 -07:00
Eric Haszlakiewicz bb7978c95f For the prototype for json_tokener_error_desc(). 2012-04-02 07:53:25 -07:00
Eric Haszlakiewicz 23d0da5870 Mention json_type_to_name() in the docs for json_object_get_type(). 2012-04-02 07:53:25 -07:00
Eric Haszlakiewicz 7c4a964002 Define a LH_LOAD_FACTOR constant and note the range that it can be set to.
Change the resize check from "count > size" to "count >= size" to avoid a
potential infinite loop with high load factors and a full hash table.
2012-04-02 07:53:25 -07:00
Eric Haszlakiewicz e6668b1406 Adjust json_object_is_type and json_object_get_type so they return json_type_null for NULL objects. 2012-04-02 07:53:25 -07:00
Eric Haszlakiewicz d7db7e81a5 Ignore several more files, include .o's, .lo's, etc... 2012-04-02 07:53:25 -07:00