Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
Optimized json_equal, json_delete, json_copy, json_deep_copy
Replaced if to switch
Removed unnecessary check for NULL.
|
|
|
|
|
|
|
|
Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing
and testing.
|
|
|
|
|
|
|
|
Also:
Steal strings during parsing for half the mallocs!
Change all input-caused assertions to errors. No crashes please, we're programmers.
|
|
|
|
Fixes #126.
|
|
Fixes redefined warnings ("_GNU_SOURCE")
|
|
|
|
It didn't affect only the last element but all of them. One item too
much was always moved.
|
|
Uninitialized memory was read when the last item of a "full" array was
removed.
|
|
|
|
|
|
Jansson now builds correctly with Visual C++ Express 2010.
|
|
|
|
Closes #37.
|
|
Also change many places to use it internally to replace hand-crafted
iteration.
Closes #45, #46.
|
|
This will make it possible to implement json_object_foreach(). It
should also have some (positive) effect on speed.
|
|
|
|
Transform serial key comparison from substraction to real comparison.
Reset serial to zero in json_object_clear() to avoid it growing out of
bounds when reusing objects.
Closes GH-40.
Closes GH-41.
|
|
|
|
|
|
The keys which are stored temporarily to a hashtable to make sure that
all object keys are unpacked, were hashed with the object key hashing
function. It is meant to compute hashes for object_key_t values, and
it works incorrectly for plain strings.
Fixed by introducing suitable functions for hashing and comparing
strings for string-keyed hashtables.
|
|
Return 0 as documented if the argument is not a JSON object.
Closes GH-18.
|
|
Thanks to Basile Starynkevitch for the suggestion and initial patch.
Thanks to Jonathan Landis and Deron Meranda for showing how this can
be utilized for implementing secure memory operations.
|
|
* By default, json_unpack() now checks that all items of arrays and
objects are unpacked. This is useful for validation.
* Add format specifier '*' to suppress this check for individual
arrays and objects. '*' must appear as the last format specifier
before the closing ']' or '}'.
|
|
|
|
On some platforms (Visual C++ for one) the standard library already
defines max() as a macro.
|
|
It's a C99 feature and not available on all compilers (Visual C++, for
example).
|
|
This makes it easier to compile without the configure script (e.g. on
Windows).
|
|
Conflicts:
doc/apiref.rst
src/jansson_private.h
|
|
json_int_t is typedef'd to long long if it's supported, or long
otherwise. There's also some supporting things, like the
JSON_INTEGER_FORMAT macro that expands to the printf() conversion
specifier that corresponds to json_int_t's actual type.
This is a backwards incompatible change.
|
|
A flexible array member is unportable. Use a table of length 1
instead. This needs some adjustment to the memory allocatio, too.
|
|
This is a backwards incompatible change.
|
|
Replace all occurences of unsigned int and unsigned long with size_t.
This is a backwards incompatible change, as the signature of many API
functions changes.
|
|
Conflicts:
configure.ac
|
|
Use AC_C_INLINE autoconf macro, include config.h where needed, and add
a define of JSON_INLINE to jansson.h that has the correct "inline"
keyword.
|
|
|
|
Initialize their reference counts to (unsigned int)-1 to disable
reference counting on them. It already was meant to work like this,
but the reference counts were just initialized to 1 instead of -1.
Thanks to Andrew Thompson for reporting this issue.
|
|
With this encoding flag, the object key-value pairs in output are in
the same order in which they were first inserted into the object.
To make this possible, a key of an object is now a serial number plus
a string. An object keeps an increasing counter which is used to
assign serial number to the keys. Hashing, comparison and public API
functions were changed to act only on the string part, i.e. the serial
number is ignored everywhere else but in the encoder, where it's used
to order object keys if JSON_PRESERVE_ORDER flag is used.
|
|
Conflicts:
LICENSE
|
|
|
|
|
|
|