1
0
mirror of https://github.com/kgabis/parson.git synced 2025-01-28 06:32:55 +08:00

74 Commits

Author SHA1 Message Date
Krzysztof Gabis
343fe13f17 Order of items in an array is preserved after removing an item.
Issue #81
2017-09-06 10:02:52 +01:00
Krzysztof Gabis
d485b068c7 Fixes a memory leak (issue #82). 2017-09-04 19:56:17 +01:00
Krzysztof Gabis
e410fc7c33 Increases MAX_NESTING of json objects/arrays to 2048.
Fixes #75
2017-05-08 19:55:29 +01:00
Krzysztof Gabis
20ad63f8ff Fixes memory leaks.
Thanks to Thales de Carvalho for finding this and submitting a patch.
2017-03-09 20:59:22 +00:00
Krzysztof Gabis
ba2a854c27 Fixes undefined behaviour as reported by clang ub sanitizer.
Issue #72
2017-03-01 19:33:40 +00:00
Krzysztof Gabis
2bfa4153db Updates copyright. 2017-02-18 16:41:14 +00:00
Krzysztof Gabis
96150ba1fd Removes dependency on sscanf and prints line numbers in tests output.
Some libraries don't have sscanf and since it wasn't used heavily it was easily replaced with a custom function. This doesn't mean that sscanf won't be used in future though (but I'll try to avoid it).
Fixes #68. Thanks to @compulim for initial work on this issue.
2017-02-18 15:26:22 +00:00
Krzysztof Gabis
cb14736e96 Checking errno after strtod call. 2017-01-06 21:35:29 +01:00
Krzysztof Gabis
defb57f2d3 Some extra null checks (issue #60). 2016-12-30 23:04:14 +01:00
Krzysztof Gabis
f419334a32 Adds links to parent values and values used to wrap objects/arrays. Assigning a value to 2 objects/arrays returns an error now.
Addresses issues #66 and #30.
2016-12-29 23:50:20 +01:00
Krzysztof Gabis
dcf85b88c8 Support for UTF-8 with BOM.
Fixes #65
2016-12-08 21:40:52 +00:00
Jean-Marie Lemetayer
d198f6ebfe Add support to print unsigned integers
Else numbers between INT_MAX and UINT_MAX will be printed using double format
2016-09-20 16:48:13 +02:00
t-k-
7b90bbbf24 Further escape \x00 - \x1F control characters. 2016-09-08 21:01:02 +08:00
Krzysztof Gabis
c22be794ce Using braces in every if statement + whitespace cleanup. 2016-08-23 20:57:10 +01:00
Krzysztof Gabis
a1c356eaa9 Adds functions to check if object has value with a certain name (and optionally type).
This closes #42.
2016-07-05 12:23:17 +02:00
Krzysztof Gabis
bcefc459dd Changes skip_quotes return type to JSON_Status. 2016-07-05 11:52:24 +02:00
Krzysztof Gabis
8075050bc1 Fixes #43 2016-07-05 11:45:41 +02:00
Jacob Enget
1c1b77aa7e Fixes typo causing problems with array element validation 2016-06-06 13:45:14 -05:00
Krzysztof Gabis
5c4a11b036 Removes trailing whitespace. 2016-04-23 12:11:25 +02:00
Krzysztof Gabis
473c7f3d8d Adds json_object_get_value_at function to access values in objects in O(1) time.
Also adds some missing null checking.
2016-04-23 11:59:34 +02:00
Krzysztof Gabis
77ef99571e Avoiding _CRT_SECURE_NO_WARNINGS redefinition. 2016-04-23 11:42:09 +02:00
Krzysztof Gabis
0c04a7e678 Removes unnecessary SKIP_WHITESPACES. 2016-04-16 12:35:44 +01:00
Krzysztof Gabis
f860d3dd1b Accepting json texts that are not objects or arrays.
According to RFC 7159 it's now valid to accept json texts that are not object or arrays.
Also reordered realloc opeartion in json_object_add to not be called if key already exists.
2016-04-16 12:30:46 +01:00
Krzysztof Gabis
19c1175064 Fixes a bug where fopen() error was being ignored. 2016-03-03 18:52:30 +00:00
Volodymyr Kuznetsov
c27133715b Fixed error condition on malloc failure.
Fixed error condition on malloc failure, it looks like it should be temp_values, not temp_names.
2016-02-05 13:31:05 -08:00
Krzysztof Gabis
c9b920c4a3 Fixes a bug in json_array_remove and adds relevant tests (thanks to KB for finding this).
Also - it's 2016, time to update copyright notices, yay!
2016-01-13 20:47:47 +00:00
Krzysztof Gabis
8324ff92bf Escaping / to make json embeddable in xml\/html. 2015-11-08 16:34:34 +00:00
Krzysztof Gabis
849f00728b parson should compile with c++ compilers (again). 2015-10-05 08:37:25 +01:00
Krzysztof Gabis
18761d99ff Checking if json_serialization_size failed. 2015-07-03 19:12:48 +01:00
Krzysztof Gabis
8eb5eab54d Checking if serialization_size is <0 before casting from int to size_t. 2015-07-01 19:24:16 +01:00
Krzysztof Gabis
f16e4292f3 Using same code for determining serialization buffer size and serialization. Updated license year. 2015-06-26 00:12:06 +02:00
Krzysztof Gabis
83a0a3e133 Changed "json_serialize_to_buffer_r" to return number of written characters. 2015-06-25 12:11:01 +02:00
Krzysztof Gabis
6905548257 Pretty serialization + tests. 2015-06-22 16:53:19 +02:00
Krzysztof Gabis
1586461280 Adds function to change default allocator, fixes potential memory leak, refactoring. 2015-06-01 22:26:31 +01:00
Krzysztof Gabis
7fd8dc1c4c UTF8 validation in json_value_init_string (+ tests). 2015-05-03 12:55:48 +01:00
Rinat Ibragimov
9782447a74 free temporary JSON_Value's on failure 2015-04-29 22:44:17 +03:00
Rinat Ibragimov
717e551cb2 free memory after json_value_init_string_no_copy() failure 2015-04-29 21:46:18 +03:00
Rinat Ibragimov
33b77673cb check if ftell() returns -1 2015-04-29 21:27:41 +03:00
Krzysztof Gabis
2b4d17b337 Replaced strlen in process_string with pointer arithmetic. 2015-04-25 18:31:35 +01:00
Krzysztof Gabis
4a4cf7d795 Not parsing strings in json_value_init_string and *{set,dotset,replace,append}_string functions. 2015-04-06 10:12:04 +02:00
Krzysztof Gabis
0d5ac45286 Added additional null checks and tests. 2015-04-05 15:26:58 +02:00
Michael Sproul
fcf0b810ba Marked various files as not executable.
Also updated the .gitignore file to ignore object code,
which is particularly useful when using this project as a
git submodule.
2015-02-28 20:33:17 -08:00
Krzysztof Gabis
f57f2d94bb No longer escaping '/' when serializing. 2014-11-23 20:13:39 +01:00
@gageas
775b2b21d0 Fix compile error on C++ compiler. (mismatch between char* and const char*) 2014-11-12 19:32:09 +09:00
Krzysztof Gabis
638190d6a0 Merged changes from parson-devel (serialization, copying, comparing, validation, creating values). 2014-10-07 21:11:29 +02:00
Krzysztof Gabis
6e9e934b5a Bugfix in parsing escaped characters (+ additional tests to prevent this bug in future).
Thanks to Joseph Werle for bringing attention to it.
2014-06-10 20:59:35 +02:00
Krzysztof Gabis
c707051778 Added surrogate pairs support (JSON support is full now), removed PARSON_VERSION macro. 2014-04-10 17:00:40 +02:00
Fedor Indutny
ce73431753 Skip whitespace at the start of string/file 2014-04-03 14:59:03 +04:00
Stephen Mathieson
4413910346 Fix memory leak
If `fread` fails, `file_contents` is leaked.  I’m just freeing the memory allocated :)
2013-12-06 14:31:18 -05:00
Krzysztof Gabis
08a4396b32 Fixed warnings and error resulting in printing string without comments (old debug statement). 2013-11-30 20:35:55 +01:00