175d934cff
Fix compilation without C-99 option
Alex2017-03-02 10:57:49 +02:00
8c86207258
Add a few more cases to test_parse to provide some examples of how parsing works; should help address the questions raised in Issue #302.
Eric Haszlakiewicz2017-02-26 16:22:45 +00:00
3948fcad2d
Issue #300: Cast size_t values to int instead of unsigned long long to work around broken behavior of MinGW.
Eric Haszlakiewicz2017-02-05 17:00:35 +00:00
bad6c9a427
Issue #300: Some platforms, such as MinGW, don't have ETXTBSY and ENOTBLK, so skip those there.
Eric Haszlakiewicz2017-02-05 04:43:54 +00:00
9a64fd7d55
Issue #300: Use %p instead of %lx in test_util_file since some platforms' pointers are larger than "unsigned long". Also, there's no need to worry about output consistency here, since it'll be different anyway due to different pointer values.
Eric Haszlakiewicz2017-02-05 04:37:27 +00:00
91977159ee
Add cast to int in calls to isdigit() since some platforms complain about char being used as an array index.
Eric Haszlakiewicz2017-02-05 04:34:05 +00:00
75825a9f01
Use strdup instead of strndup in test1.c, there's no need for the latter because json_object_to_json_string_length() will always return a properly sized string.
Eric Haszlakiewicz2017-02-03 17:10:27 +00:00
8157784483
Issue #295: also check if size_t is the size of long long, to help support 64-bit Windows platforms.
Eric Haszlakiewicz2017-01-07 22:55:31 -05:00
0a010a59eb
Change a memcpy that should be a memmove within json_pointer_get, and fix memory leaks in of one the json_pointer tests.
Eric Haszlakiewicz2016-12-18 14:33:41 -05:00
a443b9f7e7
Issue#292: bump the required version of configure listed in configure.ac so a more useful error message is generated, rather than failing later because the extra macros from ./autoconf-archive/m4/ didn't get loaded.
Eric Haszlakiewicz2016-12-11 19:18:33 -08:00
aaba8c1080
compat/strdup.h: move common compat check for strdup() to own file
Alexandru Ardelean2016-10-26 10:37:50 +03:00
d4899bd4d5
Handle NULL objects in json_object_get_userdata() by returning NULL, but abort in json_object_set_userdata() since we can't actually do anything with the userdata.
Eric Haszlakiewicz2016-10-29 15:42:36 -04:00
f8132f932d
Issue #280: add a few assert() calls to ensure objects are of the appropriate type.
Eric Haszlakiewicz2016-10-29 15:31:31 -04:00
33339ae595
Use json_visit() to clear the serializer data set when parsing so the output from test_parse reflects the actual values parsed.
Eric Haszlakiewicz2016-10-29 15:13:16 -04:00
ecdc14f535
Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects.
Eric Haszlakiewicz2016-10-29 15:01:20 -04:00
bdead39f63
Changed PROJECT_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR to fix building when used as external project
Steve Gerbino2016-09-25 22:32:35 -04:00
702b42eaf3
Modified CMakeLists.txt to use autotools to generate configuration for Unix systems
Steve Gerbino2016-09-25 22:03:56 -04:00
43afcc0d99
Lowered CMake required version so that Travis CI is able to build, moved include folder to include/json-c to match the behavior of autotools
Steve Gerbino2016-09-25 18:49:34 -04:00
fe941a26a3
Trailing slash seems necessary in the install command to get contents
Steve Gerbino2016-09-25 15:04:05 -04:00
ab7c09dc8e
Forget DESTINATION in CMake install command
Steve Gerbino2016-09-25 14:59:38 -04:00
34b4a490b1
We need to also install the generated configuration files
Steve Gerbino2016-09-25 14:57:15 -04:00
989e39d995
Fixed typo in CMakeList.txt FILES_MATCHING
Steve Gerbino2016-09-25 14:46:33 -04:00
0fcf1d1ae7
Fix memory leak and inconsistent output (due to varying fd numbers) in test_util_file.
Eric Haszlakiewicz2016-08-20 23:06:22 -04:00
5fccfed4f4
Issue #260: add a check to prevent trivial loops in the object tree, even though it is up to the callers to avoid doing so in more complex cases.
Eric Haszlakiewicz2016-08-20 22:41:49 -04:00
c4d060bf80
json_object_object_add_ex() should have shared code with json_object_object_add(), and been changed to return int at the same time the latter was. Do that now. Also correct a couple of calls to _to_json_string to check the return value.
Eric Haszlakiewicz2016-08-20 22:35:29 -04:00
4d62de3898
Revert bogus change to json_object_get() made in f40b08d8 that caused it to always return NULL. (Issue #259) Also undo NULL check in json_tokener_set_flags(): it's not at all valid toi try to set flags on a NULL pointer, and doing so should not be silently ignored.
Eric Haszlakiewicz2016-08-11 17:03:16 -04:00
9688f343a5
Issue #246: Include xlocale.h too, to get locale_t defined, since not all OSes include that in locale.h
Eric Haszlakiewicz2016-08-02 22:25:05 -04:00
1fceb2207a
test: add test of 'json_object_to_json_string_length'
José Bollo2016-08-01 15:04:54 +02:00
fa76e4a8c9
Issue #195: Actually call uselocale() in the new locale handling code in json_tokener. Also, be sure the right locale_t is freed if we fail on the second uselocale. Finally, fix test_locale so it *doesn't* use json_object_to_json_string as that will simple re-emit the original parsed string values.
Eric Haszlakiewicz2016-07-31 14:39:56 -04:00
4091b9c87e
Issue #195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments.
Eric Haszlakiewicz2016-07-30 21:34:58 -04:00
7d637362b7
Linux's %p format doesn't return "0x0" for NULL pointers, so switch to using %lx for consistency.
Eric Haszlakiewicz2016-07-30 15:09:51 -04:00
deb9fa482d
Issue #240: add arbitrary use of val's in foreach loops to squash warnings about unused variables.
Eric Haszlakiewicz2016-07-30 18:27:53 +00:00