Eric Haszlakiewicz
ea1499a372
Issue #263 : add const so the prototype for json_object_object_add_ex() matches the definition.
9 years ago
Eric Haszlakiewicz
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.
9 years ago
jobol
344009bf26
Add method 'json_object_to_json_string_length'
This new method allows to also
get the length of the generated string.
Fix #165
Change-Id: Iea91404027f143ca3d29a4c58d7c07ae53556110
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
9 years ago
Eric Haszlakiewicz
595891729e
Issue #236 : Add -Wcast-qual and fix casts to retain constness.
To better distinguish between entry->k and entry->v being const within linkhash, but non-const outside, add lh_entry_v() and lh_entry_k() accessors.
Make lh_entry->k const.
9 years ago
Eric Haszlakiewicz
e61eb409fd
Merge pull request #233 from NeoRaider/size_t3
Include stddef.h in json_object.h
9 years ago
Matthias Schiffer
f87e378d48
Add public API to get and set userdata
Also, json_object_set_serializer is changed to respect the userdata
and user_delete parameters when to_string_func is NULL.
9 years ago
Matthias Schiffer
22fdcfc71a
Include stddef.h in json_object.h
It is needed for size_t.
9 years ago
Eric Haszlakiewicz
7ae5c3f7a6
Issue #142 : un-deprecate json_object_object_get(), but note why you might want to use json_object_object_get_ex() instead.
9 years ago
Eric Haszlakiewicz
996be85843
Fix a few places that needed adjustment for the size_t changes, including updating the range checks to use a calculated SIZE_T_MAX.
9 years ago
Eric Haszlakiewicz
9a2915ce66
Merge branch 'fixes-for-upstream' of https://github.com/doctaweeks/json-c into doctaweeks-fixes-for-upstream
9 years ago
Jan-Philipp Litza
21dc5dc92b
Export json_object_double_to_json_string() and use custom format string
9 years ago
Jan-Philipp Litza
2200ffa8b0
Fix code in docs for json_object_new_double_s()
9 years ago
Eric Haszlakiewicz
1fb87cd196
Merge branch 'master' of https://github.com/Protovision/json-c into Protovision-master
9 years ago
Eric Haszlakiewicz
4e0c8b55fb
Merge pull request #220 from hschaa/master
Add utility function for comparing json_objects
9 years ago
Mina Naguib
138c2a6b97
Clarify json_object_get_string documentation of NULL handling & returning
9 years ago
Helmut Schaa
00e475c434
Add utility function for comparing json_objects
9 years ago
Eric Haszlakiewicz
537f8bcbdb
Add const qualifiers to several functions that don't modify the json_object.
9 years ago
Eric Haszlakiewicz
980cdd61be
Merge commit '2be921d88376e78f84d79aafa6db2714da804e59'
9 years ago
Eric Haszlakiewicz
316da85818
Fix issue #201 : add a JSON_C_TO_STRING_NOSLASHESCAPE flag to turn off escaping of forward slashes.
9 years ago
Daniel M. Weeks
92e9a5032b
Use size_t for json object array ops
11 years ago
Eric Haszlakiewicz
12916e229c
Merge pull request #196 from rgerhards/improve-performance
Performance improvements
10 years ago
Rainer Gerhards
2d549662be
add json_object_object_add_ex() API
This provides more control over some detail aspects, many
of which are performance related.
10 years ago
Eric Haszlakiewicz
1757a31750
Fix doc for json_object_new_boolean() to indicate the correct value for TRUE (1).
10 years ago
Eric Haszlakiewicz
93b1fe63e5
Add back in the __attribute__((__unused__)) that was lost in the previous commit.
It's needed to squash a "variable 'val' set but not used" warning.
10 years ago
Eric Haszlakiewicz
a8bbefbbb4
Merge pull request #183 from cryogen/master
Apply compile warning fix to master branch
10 years ago
Jacob Alexander
92d4cf15f0
Adding JSON_C_TO_STRING_PRETTY_TAB flag
- Tabs are easier to read for tired eyes and editor adjustable
10 years ago
Stuart Walsh
75d7409c4e
Fix uninitialised variable compile warning, and also fix unused-when-used warning
10 years ago
Mark Swoope
cdca9d3c8e
Added array_list_del_idx and json_object_array_del_idx
10 years ago
Eric Haszlakiewicz
484ca368f0
Slight style tweaks to the bsearch changest.
10 years ago
Eric Haszlakiewicz
a500c1f0b5
Merge pull request #155 from LeSpocky/bsearch
add bsearch for arrays
10 years ago
Eric Haszlakiewicz
9db3099572
Merge pull request #156 from jubalh/master
Remove trailing whitespaces
10 years ago
Eric Haszlakiewicz
ec4879ac5b
Merge pull request #153 from LeSpocky/doc
improve doc for json_object_to_json_string()
11 years ago
Michael Vetter
fcf5ad1bd6
Remove trailing whitespace
11 years ago
Alexander Dahl
2f5789bdef
add bsearch for arrays
Arrays can already be sorted with json_object_array_sort() which uses
qsort() of the standard C library. This adds a counterpart using the
bsearch() from C.
11 years ago
Alexander Dahl
37f5d8696d
improve doc for json_object_to_json_string()
11 years ago
Michael J. Chinn
048dcf288a
Remove json_type enum trailing comma
11 years ago
Michael Clark
64e36901a0
Patch to address the following issues:
* CVE-2013-6371: hash collision denial of service
* CVE-2013-6370: buffer overflow if size_t is larger than int
11 years ago
Eric Haszlakiewicz
51993c28c2
Added a json_object_new_double_s() convenience function to allow an exact string representation of a double to be specified when creating the object and use it in json_tokener_parse_ex() so a re-serialized object more exactly matches the input.
Add json_object_free_userdata() and json_object_userdata_to_json_string() too.
12 years ago
Even Rouault
6c4bb3840c
Add extern to json_object_set_serializer so that it gets exported (Windows fix)
12 years ago
Greg Hazel
88bf1c9960
one definition of json_object_object_foreach only works on c99 and later
12 years ago
Eric Haszlakiewicz
5b36a432c8
Merge branch 'remicollet-issue-float'
Conflicts:
json_util.c
12 years ago
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.
12 years ago
Eric Haszlakiewicz
92d289f5d3
Add a comment briefly describing json_object_object_length()
12 years ago
Greg Hazel
cca74c6de6
add json_object_object_length
12 years ago
Alexander Klauer
2be921d883
Fixed json_object_object_add().
* Return value of json_object_object_add() changed from void to int.
Return value now indicates success or failure.
* Check whether allocations are successful.
* Do not exit program from within the library.
12 years ago
Alexander Klauer
beb12d49e1
Make macro json_object_object_foreach multiple-use safe
12 years ago
Remi Collet
32d149c8f6
probably worth an option for this
12 years ago
Eric Haszlakiewicz
f6b27cbb6c
Make it safe to delete keys while iterating with the json_object_object_foreach macro.
13 years ago
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.
13 years ago
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)
13 years ago