91 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
b4c371fa0c Generate docs for the 0.17 release 2023-08-12 19:00:16 +00:00
Eric Haszlakiewicz
21c70bd767 Bump version to 0.17 2023-08-12 18:59:13 +00:00
Eric Hawicz
12ea386989 Add an abi-check.sh script that shows how to run the abi-compliance-checker, update release creation steps slightly. 2023-08-12 14:56:51 -04:00
Eric Haszlakiewicz
6dd8618170 Also fix messages returned from json_tokener_error_desc() (broke due to the ordering change of enum json_tokener_error) 2023-08-12 18:52:32 +00:00
Eric Hawicz
3dad6941da Move the json_tokener_error_memory entry to the end of enum json_tokener_error to restore binary compatibility with 0.16 2023-08-12 13:54:50 -04:00
Eric Hawicz
f7e9d8e216 Update the AUTHORS file and add issues_closed_for_0.17.md for the upcoming 0.17 release 2023-08-12 13:53:27 -04:00
Eric Hawicz
85ed501a3d Update the ChangeLog for 0.17 based on notable commits since 0.16 2023-08-08 17:31:38 -04:00
Eric Hawicz
077661f3d1 Fix issue #823: add back json_number_chars, but only because it's part of the public API. 2023-08-06 15:36:19 -04:00
Eric Hawicz
87127d31c6 Merge pull request #679 from GitMensch/patch-1
Let json-c be used with obsolete compilers
2023-08-05 22:32:37 -04:00
Eric Hawicz
1ee12100b6 PR #679: add workaround for old compilers w/o stdint.h (i.e. VS2008 and earlier) 2023-08-05 22:11:30 -04:00
Eric Hawicz
0bcfb6bc84 Merge pull request #822 from SSharshunov/master
Added option to disable app build
2023-08-04 11:47:23 -04:00
Sergey Sharshunov
bef40a342e Added option to disable app build 2023-08-04 19:46:50 +05:00
Eric Hawicz
2316dbae85 Merge pull request #702 from commodo/json_patch
json_patch: add first implementation only with patch application
2023-07-31 22:19:30 -04:00
Eric Hawicz
612ba56f06 Don't export json_pointer_get_internal, move json_object_array_insert_idx and json_patch_apply to the JSONC_0.17 section in json-c.sym 2023-07-31 22:18:04 -04:00
Eric Hawicz
469bc0e4bb Work around a somewhat misleading warning about "a function declaration without a prototype is deprecated in all versions of C" in test1.c 2023-07-31 22:18:04 -04:00
Eric Hawicz
ce3184243a Fix json_patch_apply handling of removing the whole document (i.e. "path":"").
Enable all disabled tests, add a few more including some with null documents.
2023-07-31 22:18:04 -04:00
Eric Hawicz
9dbf2880cc Adjust the behavior of the args passed to json_patch_apply to make it easier to do in place modifications, and add a struct json_patch_error to report more details on failures. 2023-07-31 22:18:04 -04:00
Eric Hawicz
a14a3a680c Fix an uninitialized memory access in json_pointer.
Add comments describing when the fields of the internal struct json_pointer_get_result are valid.
2023-07-31 22:18:03 -04:00
Eric Hawicz
efc530594b Create a json_pointer_private.h and move a few things there, fix test warnings, note array_list_insert_idx is private. 2023-07-31 22:18:03 -04:00
Alexandru Ardelean
3b8363fcdc tests: test_json_patch: add test suite for JSON patch
Essentially, this change adds the test cases from this repo:
   https://github.com/json-patch/json-patch-tests

Specifically:
   https://github.com/json-patch/json-patch-tests/blob/master/spec_tests.json
   https://github.com/json-patch/json-patch-tests/blob/master/tests.json

The files were taken at the date of this commit, at git hash
  ea3af85790cb72893d0676597814b7532019c24e

Some tests may not have an 'expected' or 'error' field. Those are ignored.
One test was disabled manually via "disabled_in_json_c", because it tries
an impossible test, i.e. to add 2 "op" fields in the same patch entry,
something which is impossible in a JSON object.

For the 'error' cases, right now we only test that an error happens.
Later, we can extend this to check the error codes.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:18:03 -04:00
Alexandru Ardelean
538b046884 json_patch: add first implementation only with patch application
Initially I wanted to also do a function that generates the JSON patch from
two JSON documents, but even just applying the JSON patch was a bit of
work, especially when needing to satisfy all the test-cases.

This change defines all the operation in the RFC6902. The addition isn't
too big (for the json_patch_apply() function), as part of the heavy lifting
is also done by JSON pointer logic.

All the ops were tested with the test-cases defined at:
  https://github.com/json-patch/json-patch-tests

RFC6902: https://tools.ietf.org/html/rfc6902

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:18:01 -04:00
Alexandru Ardelean
e4d9fbd52a json_pointer: split json_pointer_set_with_array_cb()
JSON patch is a bit more clear on how some array operations should be
handled. Unfortunately, handling them on a case-by-case is a bit tricky
because it's difficult to satisfy properly an 'add' operating with a 'move'
operation and the basic json_pointer_set().

With json_pointer_set{f}() we use json_object_array_put_idx() to insert a
value at a certain index.

With JSON patch:
* for the 'add' operation, we need to insert a value at a given index,
  which means shifting existing values by one to the right
  - also, we cannot allow values to be inserted/added outside the bounds of
    the array
* a 'move' operation, is described as a 'remove' and then an 'add';
  for arrays this complicates things, because when we want to a move a
  value within the array, we have to remove it first (during which the size
  of the array is reduced by one); when the size of the array is reduced by
  one, we can't add it to the last position in the array (before the
  remove)

The only sane method to handle this (after a few considerations) is to
provide a callback to the function that does the final put/insert into
the array. That way, we can do some final checks where these are needed to
handle each corner-case.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:17:30 -04:00
Alexandru Ardelean
1c38dea651 json_pointer: move array out-of-bounds check outside of is_valid_index()
The out-of-bounds check is useful when trying to index/obtain a value from
an array.
However, when we set a value to a specific JSON pointer, we can allow
values that are outside the length of the current array.
The RFC6901 doc isn't clear on that aspect, and doing so is a bit more
in-line with how json_object_array_{put,insert}_idx() functions behave.

This changes the behavior of json_pointer_set{f}() because now a value can
be set anywhere in the array.

Also, added a test-case for this behavior change.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:17:30 -04:00
Alexandru Ardelean
5a46a3b76d json_pointer: introduce json_pointer_get_internal() for internal usage
For JSON patch, we require that we get access to the parent of a JSON
object as well in order to do some operations via the API.

For example, given the object:
{
  "foo": "bar",
  "array", [ 1, 2, 3]
}

Using JSON pointer with the path
 * '/foo' will return 'bar' of type string
 * '/array/0' will return '1', of type integer

The problem is, that if we do 'json_object_put()' on any of the objects
above, this will not detach them from the parent, because there is no
information back to the parent.

One way to fix this, is to introduce links back to the parent, and have
these links be made by 'json_object_array_{put,insert}_idx()' and
'json_object_object_add{_ex}()'[1].

[1] For json_object_object_add_ex() we would need to de-constify the second
parameter, as we need to change it's internal state when being added to a
parent object. It may break some applications, but who knows.

But, since this information is needed mostly for JSON patch, another way to
address this, is to also retrieve the parent of an object via JSON pointer
and use json_object_object_del() and json_object_array_del_idx() on the
object's parent.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:17:30 -04:00
Alexandru Ardelean
43d3118935 json_pointer: convert index to size_t type
The index cannot be negative when parsing in is_valid_index(), because we
don't allow the '-' character in a string before we get to the strtol()
function.

So, might as well remove the negative check (for idx) in is_valid_index()
and convert it to size_t. That may allow for higher values for the index
(which can be insane, but some people may want to try it).

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:17:30 -04:00
Alexandru Ardelean
d5c5b2caec tests: test1: add test cases for json_object_array_insert_idx()
This change adds a few test cases to test the behavior of the new
json_object_array_insert_idx() function, to make sure it behaves according
to specification in doc-string.

This test uses assert() vs the old method of comparing outputs.
This will cause the test to fail because the outputs won't match, since the
assert() will kick in.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:17:30 -04:00
Alexandru Ardelean
a86d7a8f5a json_object: introduce json_object_array_insert_idx() API function
The behavior of the json_object_array_put_idx() is that, if a user wants to
insert an element inside a JSON array, the element will be replaced.

For some cases, a user would want to insert an element into the JSON array
and shift the elements to the right.

For indexes that are outside the length of the current array this behaves
like json_object_array_put_idx().
If a user wants to enforce that the JSON array is not expanded, then the
json_object_array_length() function can be used to guard against that.

The main driver for this change is JSON patch, where the 'add' operation in
an array means inserting a value at a certain index and shifting everything
by one.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:17:30 -04:00
Alexandru Ardelean
5568916eb1 json_pointer: fix comments about printf() variants of set/get()
These were wrong. Some details about the json_pointer_setf() &
json_pointer_getf() were added in the json_pointer_set() &
json_pointer_get() doc-strings.

This change removes them.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2023-07-31 22:17:30 -04:00
Eric Hawicz
71d845e819 Issue #668: add the option to specify "cmake -DUSELOCALE_NEEDS_FREELOCALE=1" to work around a bug in older versions of FreeBSD (<12.4). 2023-07-30 13:38:15 -04:00
Eric Hawicz
c8b0a90e95 Issue #808: turn off -Wshorten-64-to-32 for clang builds (aka iOS builds) to workaround "implicit conversion loses integer precision" warnings. 2023-07-30 11:38:01 -04:00
Eric Hawicz
9b36c72945 Merge pull request #772 from cosmo-ray/color
add JSON_C_TO_STRING_COLOR option
2023-07-13 18:04:48 -04:00
Matthias Gatto
9803032b9d add JSON_C_TO_STRING_COLOR option
This option enable color in json_object_to_json_string_ext.
I've try to made something similar to jq output,
but I've color true/false and null in purple,
as it's what is common color scheme used in programing language in emacs.

also add a '-c' option into json_parser to test it.

note: that I could have done a color() function similar to
what is done with indent(), but as the code is pretty small
I've keep it as it. so if you want  me to use a subfunction
tell me and I'll do it.

Signed-off-by: Matthias Gatto <matthias.gatto@protonmail.com>
2023-07-10 20:45:20 +02:00
Eric Hawicz
bdfdb5fe10 Skip apps when we're included in someone else's build. Inspired by ssrlive in PR #813. 2023-07-06 20:56:49 -04:00
Eric Hawicz
11311ed2a3 Fix the -f option to apps/json_parse, add a -F <arg> option to specify arbitrary flags to pass to json_object_to_json_string_ext(). 2023-07-04 12:00:31 -04:00
Eric Hawicz
e9d3ab209a Merge pull request #759 from c3h2-ctf/truncation
json_tokener_parse_ex: handle out of memory errors
2023-07-04 11:45:57 -04:00
Eric Haszlakiewicz
4d529f92dc Issue #688: Only exclude generated doc/* files, keep the CMakeLists.txt, etc... so the nodoc tarball can still be built. 2023-07-01 18:02:00 +00:00
Eric Haszlakiewicz
d0f32a5a43 Stop linking a copy of _json_c_strerror() (strerror_override.c) into the tests.
That hasn't been needed since since commit 6068d3f, which changed that code to
 check an env var instead ("_JSON_C_STRERROR_ENABLE").
Fixes issue #812, about dup symbols in static builds with clang.
2023-03-28 23:08:39 +00:00
Eric Hawicz
efd536af48 Merge pull request #810 from dijonkitchen/patch-1
docs: update to Internet Standard reference
2023-03-10 14:54:44 -05:00
JC (Jonathan Chen)
4d5507f5dc docs: update to Internet Standard reference 2023-03-10 11:10:29 -05:00
Eric Haszlakiewicz
d1716fe431 Bump up the minimum cmake version to 3.9.
This gets us up to a version that supports features we're already using
(i.e. add_compile_options), but stops short of a cmake that requires
c++11, which some OSes still don't support.
Closes issue #774
2023-02-23 01:01:14 +00:00
Eric Haszlakiewicz
1741bcd3ea Issue #570: note brief instructions for building on Android. 2023-01-05 00:25:09 +00:00
Eric Hawicz
343f24f920 Merge pull request #804 from yrashk/cmp-0042
Problem: cmake 3.25.1 warns about CMP0042 not being set
2022-12-27 09:32:33 -05:00
Eric Hawicz
6ec5e5842d Merge pull request #803 from yrashk/patch-2
Problem: confusing error message in snprintf_compat.h
2022-12-27 09:26:30 -05:00
Eric Hawicz
b6ba9429d0 Merge pull request #802 from yrashk/patch-1
Problem: modern CMake warns about version 2.8
2022-12-27 09:25:58 -05:00
Yurii Rashkovskii
3cc0c47221 Problem: cmake 3.25.1 warns about CMP0042 not being set
Solution: set it explictly to OLD behavior
2022-12-23 15:05:46 -08:00
Yurii Rashkovskii
7b971b52aa Problem: confusing error message in snprintf_compat.h
Solution: fix it to reflect what's happening properly
2022-12-23 14:35:36 -08:00
Yurii Rashkovskii
debe8b70b7 Problem: modern CMake warns about version 2.8
The warning is as follows:

```
Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.
```

Solution: set it at 2.8.12
2022-12-23 14:33:31 -08:00
Eric Hawicz
79c147203e Merge pull request #796 from fedefrancescon/test-add-int-get
Added Test for get int functions
2022-11-16 22:23:11 -05:00
Federico Francescon
1a2fdc49e7 Fixed test_int_get expected output 2022-11-16 01:33:02 +01:00
Federico Francescon
b1fb1508ee Added basic tests for json_object_get_int, json_object_get_int64, json_object_get_uint64 2022-11-16 00:49:18 +01:00
Eric Haszlakiewicz
bc35549f90 Update expected output for test_parse, missed in the previous commit. 2022-10-30 19:42:42 +00:00
Eric Haszlakiewicz
d6f46ae104 Explicitly check for integer overflow/underflow when parsing integers with JSON_TOKENER_STRICT. 2022-10-30 19:39:30 +00:00
Eric Haszlakiewicz
c50bf9df9c Apply same EINVAL handling to json_parse_uint64() as was done for json_parse_int64(). Document that overflow/underflow for these functions is not an error, but sets errno=ERANGE. 2022-10-30 03:25:32 +00:00
Eric Haszlakiewicz
57bef5edc4 Issue #792 - set errno=EINVAL if parsing the string in json_parse_int64 fails, to match the docs for json_object_get_int. 2022-10-26 02:19:38 +00:00
Eric Hawicz
777dd06be8 Merge pull request #790 from Sarcares/patch-1
Small update to README file
2022-09-13 22:15:48 -04:00
Luca Mannella
84248a7884 Small update to README file
it could be necessary to execute make install
2022-09-12 17:29:47 +02:00
Eric Hawicz
81f0807b63 Merge pull request #784 from rouault/get_time_seed_coverity_scan_silence
get_time_seed(): silence warning emitted by Coverity Scan static analyzer
2022-08-16 18:10:06 -04:00
Even Rouault
57ea393004 get_time_seed(): silence warning emitted by Coverity Scan static analyzer
It warns about the return of time() being truncated to 32 bit, which is
not an issue here.
(this warning was emitted because of the https://github.com/OSGeo/gdal
project embedding a copy of libjson-c and running Coverity Scan
analysis)
2022-08-16 11:11:58 +02:00
Eric Hawicz
9417f4e726 Merge pull request #783 from kraj/master
Fix build with clang-15+
2022-08-14 08:19:19 -04:00
Khem Raj
257b29c991 json_pointer.c: Move idx_val declaration to top of function
This helps compiling with MS compiler, error seems to be
due to defining a variable within the body of the function
its allowed in c99 but not in c89. This should fix build with
MSVC 16.0.40219.1 compiler from Visual Studio 14 2015

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-08-14 00:46:28 -07:00
Khem Raj
d1deed499f json_inttypes.h: Define ssize_t on windows platforms
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-08-13 21:45:11 -07:00
Khem Raj
6eca65617a Fix build with clang-15+
Fixes
json_util.c:63:35: error: a function declaration without a prototype is deprecated in all versions of C [-We
rror,-Wstrict-prototypes]
const char *json_util_get_last_err()
                                  ^
                                   void

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-08-13 20:47:20 -07:00
Eric Hawicz
ac4dfa44cb Merge pull request #782 from DimitriPapadopoulos/codespell
Fix typos found by codespell
2022-08-13 09:43:50 -04:00
Dimitri Papadopoulos
9462c0a7b5 Fix typos found by codespell
Do not fix typos from past commits found in release notes.
2022-08-13 15:47:40 +03:00
Eric Haszlakiewicz
bdd5e03d6e Apply some of the fixes from PR #740, although by using size_t instead of castings. 2022-07-31 19:28:48 +00:00
Eric Hawicz
4b0c6de760 Merge pull request #757 from c3h2-ctf/big
json_object_from_fd_ex: fail if file is too large
2022-07-31 14:27:32 -04:00
Eric Haszlakiewicz
253a5fa99d Issue #705: disable locale handling when building for a uClibc system because its duplocale() function (intentionally) crashes. 2022-07-30 20:27:35 +00:00
Eric Haszlakiewicz
9749b0cb66 When serializing with JSON_C_TO_STRING_PRETTY set, keep the opening and closing curly or square braces on same line for empty objects or arrays. Issue #778. 2022-07-30 19:27:14 +00:00
Eric Haszlakiewicz
2e9b7456a5 Update Travis links to point at travis-ci.com instead of travis-ci.org 2022-07-26 23:47:58 +00:00
Eric Haszlakiewicz
5282e73600 Entirely drop mode bits from open(O_RDONLY) to avoid warnings on certain platforms. Fixes issue #779. 2022-07-26 23:43:30 +00:00
Eric Haszlakiewicz
8b35a78d29 Trim a few travis builds, update others to more recent toolchains. 2022-07-24 20:37:14 +00:00
Eric Haszlakiewicz
22773b1e51 Fix the expected output for test_set_serializer. 2022-07-24 19:00:27 +00:00
Eric Haszlakiewicz
16208fc01a Add test to check for the memory leak mentioned in issue #781 2022-07-24 18:59:26 +00:00
Eric Hawicz
2a2d861bc0 Merge pull request #781 from dddaniel/master
Fix memory leak with emtpy strings in json_object_set_string
2022-07-24 14:15:42 -04:00
Daniel Danzberger
213bb5caa1 Fix memory leak with emtpy strings in json_object_set_string
When a json string object is updated with a bigger string, a new
malloc'ed buffer is used to store the new string and it's size is made
negative to indicate that an external buffer is in use.

When that same json string object get's updated again with an empty
stirng (size = 0), the new external malloc'ed buffer is still used.
But the fact that the new size value is not negative removes the
indicator that the externally malloc'ed buffer is used.

This becomes a problem when the object get's updated again with any
other string, because a new buffer will be malloced and linked to the
object while to old one won't be free'd.

This causes a memory leak when updating a json string with
json_object_set_stirng() which has previously been updated
with an empty string.

Example:
--
obj = json_object_new_string("data");
json_object_set_string(obj, "more data");
json_object_set_string(obj, "");
json_object_set_string(obj, "other data"); /* leaks */
--

This commit fixes the issue by free'ing the external buffer when an
empty string is set and use the internal one again.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2022-07-24 19:03:49 +02:00
Eric Haszlakiewicz
d28ac67dde Fix issue #775 - use a loop instead of list(TRANSFORM ...) to support cmake < 3.12. 2022-06-27 02:15:24 +00:00
Eric Hawicz
5d98f7825a Merge pull request #776 from stoeckmann/typo
Fix typo
2022-06-21 21:39:00 -04:00
Tobias Stoeckmann
f63573460c Fix typo 2022-06-21 14:39:01 +02:00
Eric Haszlakiewicz
6ee0a35a20 Fix #771/#768 by marking usage() as "noreturn" instead of using "FALLTHRU" in the case statement where it'd called. 2022-06-13 01:02:53 +00:00
Eric Hawicz
11546bfd07 Merge pull request #769 from An7ar35/issue-768
Issue #768
2022-06-03 23:14:16 -04:00
An7ar35
5d00384e0d missing 'FALLTHRU' added to sort out error messages when using "-Werror=implicit-fallthrough" flag 2022-06-01 12:36:33 +02:00
Eric Haszlakiewicz
49c3721a5a Unset NDEBUG so assert() is enabled in all tests. One more fix there when building with -DCMAKE_BUILD_TYPE=release. 2022-05-30 15:39:54 +00:00
Eric Haszlakiewicz
2f0942bdd7 Specify dependent libraries, including -lbsd, in a more consistent way so linking against a static json-c works better. Related issue #766
Use target_link_libraries, plus fill in Libs.private in json-c.pc so pkg-config --static --libs works appropriately.
Also, only link against libbsd when arc4random is actually found there.
2022-05-30 15:30:11 +00:00
Eric Haszlakiewicz
6ba1adf8ef Include the tests and apps directories at the _end_, since order in the
cmake rules matters, and fix compile warnings now that we're building
those sources with all the regular flags.
2022-05-30 14:33:16 +00:00
Eric Haszlakiewicz
86b46cac07 Add --disable-static and --disable-dynamic options to the cmake-configure script. 2022-05-30 14:31:08 +00:00
Eric Haszlakiewicz
f2fc1ca00a Note the DSIABLE_JSON_POINTER and DISABLE_EXTRA_LIBS build options on the README 2022-04-14 12:57:43 +00:00
Eric Haszlakiewicz
acccefd770 Add a "Getting Help" section to the README. 2022-04-14 12:55:32 +00:00
Eric Haszlakiewicz
de5a64888a Update the master branch to version 16.99 2022-04-14 12:29:39 +00:00
Eric Haszlakiewicz
7e3eba72db Clarify how to set the uploaded release tarballs to be publically readable. 2022-04-14 12:17:59 +00:00
Tobias Stoeckmann
9e6acc9a4e json_tokener_parse_ex: handle out of memory errors
Do not silently truncate values or skip entries if out of memory errors
occur.

Proof of Concept:

- Create poc.c, a program which creates an eight megabyte large json
  object with key "A" and a lot of "B"s as value, one of them is
  UTF-formatted:

```c
 #include <err.h>
 #include <stdio.h>
 #include <string.h>

 #include "json.h"

 #define STR_LEN (8 * 1024 * 1024)
 #define STR_PREFIX "{ \"A\": \""
 #define STR_SUFFIX "\\u0042\" }"

int main(void) {
  char *str;
  struct json_tokener *tok;
  struct json_object *obj;

  if ((tok = json_tokener_new()) == NULL)
    errx(1, "json_tokener_new");

  if ((str = malloc(STR_LEN)) == NULL)
    err(1, "malloc");
  memset(str, 'B', STR_LEN);
  memcpy(str, STR_PREFIX, sizeof(STR_PREFIX) - 1);
  memcpy(str + STR_LEN - sizeof(STR_SUFFIX), STR_SUFFIX, sizeof(STR_SUFFIX));

  obj = json_tokener_parse(str);
  free(str);

  printf("%p\n", obj);
  if (obj != NULL) {
    printf("%.*s\n", 50, json_object_to_json_string(obj));
    json_object_put(obj);
  }

  json_tokener_free(tok);
  return 0;
}
```
- Compile and run poc, assuming you have enough free heap space:
```
gcc $(pkg-config --cflags --libs) -o poc poc.c
./poc
0x559421e15de0
{ "A": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
```
- Reduce available heap and run again, which leads to truncation:
```
ulimit -d 10000
./poc
0x555a5b453de0
{ "A": "B" }
```
- Compile json-c with this change and run with reduced heap again:
```
ulimit -d 10000
./poc
(nil)
```

The output is limited to 70 characters, i.e. json-c parses the 8 MB
string correctly but the poc does not print all of them to the screen.

The truncation occurs because the parser tries to add all chars up
to the UTF-8 formatted 'B' at once. Since memory is limited to 10 MB
there is not enough for this operation. The parser does not fail but
continues normally.

Another possibility is to create a json file close to 2 GB and run a
program on a system with limited amount of RAM, i.e. around 3 GB. But
ulimit restrictions are much easier for proof of concepts.

Treat memory errors correctly and abort operations.
2022-03-20 17:42:47 +01:00
Tobias Stoeckmann
5accae04bb json_object_from_fd_ex: fail if file is too large
If the input file is too large to fit into a printbuf then return an
error value instead of silently truncating the parsed content.

This introduces errno handling into printbuf to distinguish between an
input file being too large and running out of memory.
2022-03-20 13:17:37 +01:00
132 changed files with 4161 additions and 638 deletions

1
.gitignore vendored
View File

@@ -27,6 +27,7 @@
/tests/test_double_serializer
/tests/test_float
/tests/test_int_add
/tests/test_int_get
/tests/test_json_pointer
/tests/test_locale
/tests/test_null

View File

@@ -1,8 +1,8 @@
language: cpp
matrix:
include:
# gcc
# xenial
# ubuntu xenial 16.04
# gcc 5 is the default on xenial
- os: linux
dist: xenial
@@ -15,35 +15,37 @@ matrix:
- doxygen
- cmake
env: CHECK="true"
# bionic
- os: linux
dist: bionic
compiler: gcc
env: MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
# gcc 7 is the default on bionic
# ubuntu bionic 18.04
# gcc 7 is the default on bionic
- os: linux
dist: bionic
compiler: gcc
addons:
apt:
packages:
- valgrind
- cppcheck
- doxygen
- cmake
env: CHECK="true"
# ubuntu focal fossa 20.04
# gcc 9 is the default on bionic
- os: linux
dist: bionic
dist: focal
compiler: gcc
env: MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
addons:
apt:
packages:
- valgrind
- cppcheck
- doxygen
- cmake
env: CHECK="true"
# clang
# xenial
- os: linux
dist: xenial
compiler: clang
addons:
apt:
sources:
- llvm-toolchain-xenial-5.0
packages:
- clang-5.0
- cmake
env: MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
- os: linux
dist: xenial
compiler: clang
@@ -56,9 +58,9 @@ matrix:
- cmake
env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
# clang-7 is the default on xenial and bionic
# clang-7 is the default on focal, xenial and bionic
- os: linux
dist: xenial
dist: focal
compiler: clang
addons:
apt:
@@ -69,17 +71,9 @@ matrix:
- cmake
env: CHECK="true"
# bionic
- os: linux
dist: bionic
compiler: clang
env: CHECK="true"
# osx
- os: osx
osx_image: xcode9.4
env: XCODE="true"
- os: osx
osx_image: xcode12.5
osx_image: xcode13.4
env: XCODE="true" CHECK="true"
# run coveralls

10
AUTHORS
View File

@@ -1,6 +1,7 @@
Alan Coopersmith <alan.coopersmith@oracle.com>
Alexander Dahl <post@lespocky.de>
Alexandru Ardelean <ardeleanalex@gmail.com>
An7ar35 <eadavison@protonmail.com>
andy5995 <andy400-dev@yahoo.com>
Aram Poghosyan <Aram.Poghosyan@teamviewer.com>
Björn Esser <besser82@fedoraproject.org>
@@ -11,13 +12,16 @@ Chris Lamb <lamby@debian.org>
Christopher Head <chead@chead.ca>
Chris Wolfe <chriswwolfe@gmail.com>
C. Watford (christopher.watford@gmail.com)
Daniel Danzberger <daniel@dd-wrt.com>
Darjan Krijan <darjan_krijan@gmx.de>
David McCann <mccannd@uk.ibm.com>
DeX77 <dex@dragonslave.de>
Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
dota17 <chenguopingdota@163.com>
Eric Haszlakiewicz <erh+git@nimenees.com>
Eric Hawicz <erh+git@nimenees.com>
Even Rouault <even.rouault@spatialys.com>
Federico Francescon <federico.francescon@higeco.com>
Gianluigi Tiesi <sherpya@netfarm.it>
grdowns <grdowns@microsoft.com>
Hex052 <elijahiff@gmail.com>
@@ -27,6 +31,7 @@ Ivan Romanov <drizt@land.ru>
Jaap Keuter <jaap.keuter@xs4all.nl>
Jakov Smolic <jakov.smolic@sartura.hr>
janczer <menshikov.ivn@gmail.com>
JC (Jonathan Chen) <jc@dijonkitchen.org>
Jehan <jehan@girinstud.io>
Jehiah Czebotar <jehiah@gmail.com>
Jonathan Wiens <j.wiens@teles.com>
@@ -34,10 +39,13 @@ Jose Bollo <jose.bollo@iot.bzh>
José Bollo <jose.bollo@iot.bzh>
Juuso Alasuutari <juuso.alasuutari@gmail.com>
Keith Holman <keith.holman@windriver.com>
Khem Raj <raj.khem@gmail.com>
Kizuna-Meraki <z9@kizunameraki.de>
Leon Gross <leon.gross@rub.de>
Liang, Gao <liang.gao@intel.com>
Luca Mannella <luca.mannella@studenti.polito.it>
Marc <34656315+MarcT512@users.noreply.github.com>
Matthias Gatto <matthias.gatto@protonmail.com>
max <mpano91@gmail.com>
Micah Snyder <micasnyd@cisco.com>
Michael Clark <michael@metaparadigm.com>
@@ -53,9 +61,11 @@ Robert Bielik <robert.bielik@dirac.com>
Robert <roby_p97@yahoo.com>
Rosen Penev <rosenp@gmail.com>
Rubasri Kalidas <rubasri.kalidas@intel.com>
Sergey Sharshunov <s.sharshunov@gmail.com>
Simon McVittie <smcv@collabora.com>
ssrlive <30760636+ssrlive@users.noreply.github.com>
Tobias Nießen <tniessen@users.noreply.github.com>
Tobias Stoeckmann <tobias@stoeckmann.org>
Tudor Brindus <me@tbrindus.ca>
Unmanned Player <36690541+unmanned-player@users.noreply.github.com>
Yurii Rashkovskii <yrashk@gmail.com>

View File

@@ -1,31 +1,26 @@
# Many projects still are stuck using CMake 2.8 is several places so it's good to provide backward support too. This is
# specially true in old embedded systems (OpenWRT and friends) where CMake isn't necessarily upgraded.
cmake_minimum_required(VERSION 2.8)
# CMake 3.9 was released in 2017/07
# As of 2023, many versions of Linux, NetBSD and FreeBSD provide,
# and many OpenWRT packages require, much newer CMake packages.
# We're stopping before 3.10 because that version starts requiring
# c++11, which isn't available on e.g HPUX.
cmake_minimum_required(VERSION 3.9)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
# The project() command manages VERSION variables.
cmake_policy(SET CMP0048 NEW)
# JSON-C library is C only project.
if (CMAKE_VERSION VERSION_LESS 3.0)
project(json-c)
set(PROJECT_VERSION_MAJOR "0")
set(PROJECT_VERSION_MINOR "16")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
else()
project(json-c LANGUAGES C VERSION 0.16)
endif()
# PROJECT_VERSION{,_MAJOR,_MINOR,_PATCH} set by project():
project(json-c LANGUAGES C VERSION 0.17)
# If we've got 3.0 then it's good, let's provide support. Otherwise, leave it be.
if(POLICY CMP0038)
# Policy CMP0038 introduced was in CMake 3.0
cmake_policy(SET CMP0038 NEW)
endif()
# Targets may not link directly to themselves.
cmake_policy(SET CMP0038 NEW)
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
# MACOSX_RPATH is enabled by default.
# We set it explicitly to avoid the warning
cmake_policy(SET CMP0042 NEW)
# Only interpret if() arguments as variables or keywords when unquoted.
cmake_policy(SET CMP0054 NEW)
# set default build type if not specified by user
if(NOT CMAKE_BUILD_TYPE)
@@ -36,22 +31,13 @@ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
# Include file check macros honor CMAKE_REQUIRED_LIBRARIES
# i.e. the check_include_file() calls will include -lm when checking.
# New in version 3.12.
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()
include(CTest)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING AND
(NOT MSVC OR NOT (MSVC_VERSION LESS 1800)) # Tests need at least VS2013
)
add_subdirectory(tests)
endif()
if (NOT MSVC) # cmd line apps don't built on Windows currently.
add_subdirectory(apps)
endif()
# Set some packaging variables.
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
@@ -102,7 +88,10 @@ option(ENABLE_RDRAND "Enable RDRAND Hardware RNG Hash Seed."
option(ENABLE_THREADING "Enable partial threading support." OFF)
option(OVERRIDE_GET_RANDOM_SEED "Override json_c_get_random_seed() with custom code." OFF)
option(DISABLE_EXTRA_LIBS "Avoid linking against extra libraries, such as libbsd." OFF)
option(DISABLE_JSON_POINTER "Disable JSON pointer (RFC6901) support." OFF)
option(DISABLE_JSON_POINTER "Disable JSON pointer (RFC6901) and JSON patch support." OFF)
option(DISABLE_JSON_PATCH "Disable JSON patch (RFC6902) support." OFF)
option(NEWLOCALE_NEEDS_FREELOCALE "Work around newlocale bugs in old FreeBSD by calling freelocale" OFF)
option(BUILD_APPS "Default to building apps" ON)
if (UNIX OR MINGW OR CYGWIN)
@@ -154,11 +143,14 @@ check_include_file(sys/random.h HAVE_SYS_RANDOM_H)
check_include_file(sys/stat.h HAVE_SYS_STAT_H)
check_include_file(xlocale.h HAVE_XLOCALE_H)
# Set json-c specific vars to stamp into json_config.h
# in a way that hopefully won't conflict with other
# projects that use json-c.
if (HAVE_INTTYPES_H)
# Set a json-c specific var to stamp into json_config.h
# in a way that hopefully won't conflict with other
# projects that use json-c.
set(JSON_C_HAVE_INTTYPES_H 1)
set(JSON_C_HAVE_INTTYPES_H 1)
endif()
if (HAVE_STDINT_H)
set(JSON_C_HAVE_STDINT_H 1)
endif()
check_symbol_exists(_isnan "float.h" HAVE_DECL__ISNAN)
@@ -183,10 +175,12 @@ check_symbol_exists(arc4random "stdlib.h" HAVE_ARC4RANDOM)
if (NOT HAVE_ARC4RANDOM AND DISABLE_EXTRA_LIBS STREQUAL "OFF")
check_include_file(bsd/stdlib.h HAVE_BSD_STDLIB_H)
if (HAVE_BSD_STDLIB_H)
list(APPEND CMAKE_REQUIRED_LIBRARIES "-lbsd")
link_libraries(bsd)
list(APPEND CMAKE_REQUIRED_LIBRARIES "bsd")
unset(HAVE_ARC4RANDOM CACHE)
check_symbol_exists(arc4random "bsd/stdlib.h" HAVE_ARC4RANDOM)
if (NOT HAVE_ARC4RANDOM)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "bsd")
endif()
endif()
endif()
@@ -200,6 +194,18 @@ if (HAVE_LOCALE_H)
check_symbol_exists(setlocale "locale.h" HAVE_SETLOCALE)
check_symbol_exists(uselocale "locale.h" HAVE_USELOCALE)
endif()
# uClibc *intentionally* crashes in duplocale(), at least as of:
# https://github.com/ffainelli/uClibc/blob/266bdc1/libc/misc/locale/locale.c#L1322
# So, if it looks like we're compiling for a system like that just disable
# locale handling entirely.
exec_program(${CMAKE_C_COMPILER} ARGS -dumpmachine OUTPUT_VARIABLE CMAKE_GNU_C_MACHINE)
if (CMAKE_GNU_C_MACHINE MATCHES "uclibc")
message(STATUS "Detected uClibc compiler, disabling locale handling")
set(HAVE_SETLOCALE 0)
set(HAVE_USELOCALE 0)
endif()
if (HAVE_STRINGS_H)
check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
check_symbol_exists(strncasecmp "strings.h" HAVE_STRNCASECMP)
@@ -305,6 +311,11 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL
endif()
add_definitions(-D_GNU_SOURCE)
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
# Remove this for 1.0 when we can bump the ABI and actually fix these warnings.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shorten-64-to-32")
endif()
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4100")
@@ -396,9 +407,9 @@ set(JSON_C_PUBLIC_HEADERS
set(JSON_C_HEADERS
${JSON_C_PUBLIC_HEADERS}
${PROJECT_SOURCE_DIR}/json_object_private.h
${PROJECT_SOURCE_DIR}/json_pointer_private.h
${PROJECT_SOURCE_DIR}/random_seed.h
${PROJECT_SOURCE_DIR}/strerror_override.h
${PROJECT_SOURCE_DIR}/strerror_override_private.h
${PROJECT_SOURCE_DIR}/math_compat.h
${PROJECT_SOURCE_DIR}/snprintf_compat.h
${PROJECT_SOURCE_DIR}/strdup_compat.h
@@ -424,8 +435,15 @@ if (NOT DISABLE_JSON_POINTER)
set(JSON_C_PUBLIC_HEADERS ${JSON_C_PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/json_pointer.h)
set(JSON_C_SOURCES ${JSON_C_SOURCES} ${PROJECT_SOURCE_DIR}/json_pointer.c)
set(JSON_H_JSON_POINTER "#include \"json_pointer.h\"")
if (NOT DISABLE_JSON_PATCH)
set(JSON_C_PUBLIC_HEADERS ${JSON_C_PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/json_patch.h)
set(JSON_C_SOURCES ${JSON_C_SOURCES} ${PROJECT_SOURCE_DIR}/json_patch.c)
set(JSON_H_JSON_PATCH "#include \"json_patch.h\"")
endif()
else()
set(JSON_H_JSON_POINTER "")
set(JSON_H_JSON_PATCH "")
endif()
configure_file(json.h.cmakein ${PROJECT_BINARY_DIR}/json.h @ONLY)
@@ -454,7 +472,7 @@ add_library(${PROJECT_NAME}
${JSON_C_HEADERS}
)
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION 5.2.0
VERSION 5.3.0
SOVERSION 5)
list(APPEND CMAKE_TARGETS ${PROJECT_NAME})
# If json-c is used as subroject it set to target correct interface -I flags and allow
@@ -465,6 +483,8 @@ target_include_directories(${PROJECT_NAME}
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
)
target_link_libraries(${PROJECT_NAME} PUBLIC ${CMAKE_REQUIRED_LIBRARIES})
# Allow to build static and shared libraries at the same time
if (BUILD_STATIC_LIBS AND BUILD_SHARED_LIBS)
set(STATIC_LIB ${PROJECT_NAME}-static)
@@ -478,6 +498,8 @@ if (BUILD_STATIC_LIBS AND BUILD_SHARED_LIBS)
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
)
target_link_libraries(${PROJECT_NAME}-static PUBLIC ${CMAKE_REQUIRED_LIBRARIES})
# rename the static library
if (NOT MSVC)
set_target_properties(${STATIC_LIB} PROPERTIES
@@ -531,6 +553,23 @@ if (UNIX OR MINGW OR CYGWIN)
SET(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
SET(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
SET(VERSION ${PROJECT_VERSION})
# Linking against the static json-c requires
# dependent packages to include additional libs:
SET(LIBS_LIST ${CMAKE_REQUIRED_LIBRARIES})
# Note: We would need cmake >= 3.12 in order to use list(TRANSFORM ...)
function(list_transform_prepend var prefix)
set(temp "")
foreach(f ${${var}})
list(APPEND temp "${prefix}${f}")
endforeach()
set(${var} "${temp}" PARENT_SCOPE)
endfunction()
list_transform_prepend(LIBS_LIST "-l")
string(REPLACE ";" " " LIBS "${LIBS_LIST}")
configure_file(json-c.pc.in json-c.pc @ONLY)
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
install(FILES ${PROJECT_BINARY_DIR}/json-c.pc DESTINATION "${INSTALL_PKGCONFIG_DIR}")
@@ -538,3 +577,16 @@ endif ()
install(FILES ${JSON_C_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/json-c)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING AND
(NOT MSVC OR NOT (MSVC_VERSION LESS 1800)) # Tests need at least VS2013
)
add_subdirectory(tests)
endif()
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_APPS)
# skip apps when we're included in someone else's build
if (NOT MSVC) # cmd line apps don't built on Windows currently.
add_subdirectory(apps)
endif()
endif()

View File

@@ -1,4 +1,39 @@
0.17 (up to commit 077661f, 2023-08-08)
========================================
Deprecated and removed features:
--------------------------------
* None
New features
------------
* json_patch: add first implementation only with patch application
* Add --disable-static and --disable-dynamic options to the cmake-configure script.
* Add -DBUILD_APPS=NO option to disable app build
* Minimum cmake version is now 3.9
Significant changes and bug fixes
---------------------------------
* When serializing with JSON_C_TO_STRING_PRETTY set, keep the opening and
closing curly or square braces on same line for empty objects or arrays.
* Disable locale handling when targeting a uClibc system due to problems
with its duplocale() function.
* When parsing with JSON_TOKENER_STRICT set, integer overflow/underflow
now result in a json_tokener_error_parse_number. Without that flag
values are capped at INT64_MIN/UINT64_MAX.
* Fix memory leak with emtpy strings in json_object_set_string
* json_object_from_fd_ex: fail if file is too large (>=INT_MAX bytes)
* Add back json_number_chars, but only because it's part of the public API.
* Entirely drop mode bits from open(O_RDONLY) to avoid warnings on certain
platforms.
* Specify dependent libraries, including -lbsd, in a more consistent way so
linking against a static json-c works better
* Fix a variety of build problems and add & improve tests
* Update RFC reference to https://www.rfc-editor.org/rfc/rfc8259
***
0.16 (up to commit 66dcdf5, 2022-04-13)
========================================

View File

@@ -4,14 +4,16 @@
========
1. [Overview and Build Status](#overview)
2. [Building on Unix](#buildunix)
2. [Getting Help](#gettinghelp)
3. [Building on Unix](#buildunix)
* [Prerequisites](#installprereq)
* [Build commands](#buildcmds)
3. [CMake options](#CMake)
4. [Testing](#testing)
5. [Building with `vcpkg`](#buildvcpkg)
6. [Linking to libjson-c](#linking)
7. [Using json-c](#using)
4. [CMake options](#CMake)
5. [Testing](#testing)
6. [Building with `vcpkg`](#buildvcpkg)
7. [Building for Android](#android)
7. [Linking to libjson-c](#linking)
8. [Using json-c](#using)
JSON-C - A JSON implementation in C <a name="overview"></a>
-----------------------------------
@@ -19,7 +21,7 @@ JSON-C - A JSON implementation in C <a name="overview"></a>
JSON-C implements a reference counting object model that allows you to easily
construct JSON objects in C, output them as JSON formatted strings and parse
JSON formatted strings back into the C representation of JSON objects.
It aims to conform to [RFC 7159](https://tools.ietf.org/html/rfc7159).
It aims to conform to [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259).
Skip down to [Using json-c](#using)
or check out the [API docs](https://json-c.github.io/json-c/),
@@ -27,12 +29,23 @@ if you already have json-c installed and ready to use.
Home page for json-c: https://github.com/json-c/json-c/wiki
Build Status
* [AppVeyor Build](https://ci.appveyor.com/project/hawicz/json-c) ![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/json-c/json-c?branch=master&svg=true)
* [Travis Build](https://travis-ci.org/json-c/json-c) ![Travis Build Status](https://travis-ci.org/json-c/json-c.svg?branch=master)
Getting Help <a name="gettinghelp"></a>
------------
If you have questions about using json-c, please start a thread on
our forums at: https://groups.google.com/forum/#!forum/json-c
If you believe you've discovered a bug, report it at
(https://github.com/json-c/json-c/issues). Please be sure to include
the version of json-c you're using, the OS you're running on, and any
other relevant details. Fully reproducible test cases and/or patches
to fix problems are greatly appreciated.
Fixes for bugs, or small new features can be directly submitted as a
[pull request](https://github.com/json-c/json-c/pulls). For major new
features or large changes of any kind, please first start a discussion
on the [forums](https://groups.google.com/forum/#!forum/json-c).
Test Status
* [Coveralls](https://coveralls.io/github/json-c/json-c?branch=master) [![Coverage Status](https://coveralls.io/repos/github/json-c/json-c/badge.svg?branch=master)](https://coveralls.io/github/json-c/json-c?branch=master)
Building on Unix with `git`, `gcc` and `cmake` <a name="buildunix"></a>
--------------------------------------------------
@@ -40,6 +53,13 @@ Building on Unix with `git`, `gcc` and `cmake` <a name="buildunix"></a>
If you already have json-c installed, see [Linking to `libjson-c`](#linking)
for how to build and link your program against it.
Build Status
* [AppVeyor Build](https://ci.appveyor.com/project/hawicz/json-c) ![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/json-c/json-c?branch=master&svg=true)
* [Travis Build](https://app.travis-ci.com/github/json-c/json-c) ![Travis Build Status](https://api.travis-ci.com/json-c/json-c.svg?branch=master)
Test Status
* [Coveralls](https://coveralls.io/github/json-c/json-c?branch=master) [![Coverage Status](https://coveralls.io/repos/github/json-c/json-c/badge.svg?branch=master)](https://coveralls.io/github/json-c/json-c?branch=master)
### Prerequisites: <a name="installprereq"></a>
- `gcc`, `clang`, or another C compiler
@@ -81,7 +101,7 @@ Then:
$ make
$ make test
$ make USE_VALGRIND=0 test # optionally skip using valgrind
$ make install
$ sudo make install # it could be necessary to execute make install
```
@@ -112,6 +132,8 @@ DISABLE_STATIC_FPIC | Bool | The default builds position independent
DISABLE_BSYMBOLIC | Bool | Disable use of -Bsymbolic-functions.
DISABLE_THREAD_LOCAL_STORAGE | Bool | Disable use of Thread-Local Storage (HAVE___THREAD).
DISABLE_WERROR | Bool | Disable use of -Werror.
DISABLE_EXTRA_LIBS | Bool | Disable use of extra libraries, libbsd
DISABLE_JSON_POINTER | Bool | Omit json_pointer support from the build.
ENABLE_RDRAND | Bool | Enable RDRAND Hardware RNG Hash Seed.
ENABLE_THREADING | Bool | Enable partial threading support.
OVERRIDE_GET_RANDOM_SEED | String | A block of code to use instead of the default implementation of json_c_get_random_seed(), e.g. on embedded platforms where not even the fallback to time() works. Must be a single line.
@@ -215,6 +237,29 @@ You can download and install JSON-C using the [vcpkg](https://github.com/Microso
The JSON-C port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
Building for Android <a name="android">
----------------------
Building on Android is now particularly well supported, but there
have been some reports of success using
https://developer.android.com/ndk/guides/cmake
```
mkdir json-c-build
cd json-c-build/
export NDK_HOME=~/Library/Android/sdk/ndk/22.1.7171670/
cmake \
--toolchain=$NDK_HOME/build/cmake/android.toolchain.cmake \
-DANDROID_STL=none \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-29 \
-DANDROID_LD=lld \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=<install prefix> \
-DENABLE_THREADING=true \
..
make install
```
Linking to `libjson-c` <a name="linking">
----------------------

View File

@@ -16,6 +16,7 @@
changes (added/removed/updated funcs, etc...), and detect backwards compat
issues.
* https://github.com/lvc/abi-compliance-checker
* See also `abi-check.sh`
* If the new release is not backwards compatible, then this is a MAJOR release.
* Mention removed features in ChangeLog
* Consider re-adding backwards compatible support, through symbol
@@ -40,9 +41,15 @@
## Release creation
Start creating the new release:
release=0.16
PREV=$(git tag | tail -1)
PREV=${PREV#json-c-}
PREV=${PREV%-*}
release=0.$((${PREV#*.} + 1))
cd ~
git clone https://github.com/json-c/json-c json-c-${release}
rm -rf distcheck
mkdir distcheck
cd distcheck
# Note, the build directory *must* be entirely separate from
@@ -54,8 +61,7 @@ Start creating the new release:
Make any fixes/changes *before* branching.
cd json-c-${release}
git branch json-c-${release}
git checkout json-c-${release}
git checkout -b json-c-${release}
------------
@@ -94,7 +100,11 @@ Create the release tarballs:
echo .git > excludes
tar -czf json-c-${release}.tar.gz -X excludes json-c-${release}
echo 'doc/*' >> excludes
echo 'doc/*.cmake' >> excludes
echo 'doc/CMakeFiles' >> excludes
echo 'doc/Makefile' >> excludes
echo 'doc/Doxyfile' >> excludes
echo 'doc/html' >> excludes
tar -czf json-c-${release}-nodoc.tar.gz -X excludes json-c-${release}
------------
@@ -113,7 +123,8 @@ Go to Amazon S3 service at:
https://console.aws.amazon.com/s3/
Upload the two tarballs in the json-c_releases/releases folder.
When uploading, use "Standard" storage class, and make the uploaded files publicly accessible.
* Expand "Permissions", pick "Grant public-read access"
* Expand "Properties", ensure "Standard" storage class is picked.
Logout of Amazon S3, and verify that the files are visible.
https://s3.amazonaws.com/json-c_releases/releases/index.html
@@ -172,7 +183,8 @@ Update checksums on wiki page.
openssl md5 json-c*gz
Copy and paste this output into the wiki page at:
https://github.com/json-c/json-c/wiki
* https://github.com/json-c/json-c/wiki
* https://github.com/json-c/json-c/wiki/Old-Releases
------------

42
abi-check.sh Normal file
View File

@@ -0,0 +1,42 @@
#!/bin/sh
prev=0.16
release=0.17
# ... clone json-c, abi-compliance-checker, abi-dumper
mkdir build
cd build
CFLAGS=-Og cmake -DCMAKE_INSTALL_PREFIX=~/json-c-installs/json-c-${release} ..
make && make test && make install
# Assume the old version has already been built
cd ~/abi-compliance-checker
mkxml()
{
ver="$1"
cat <<EOF > json-c-${ver}.xml
<foo>
<version>
${ver}
</version>
<headers>
../json-c-installs/json-c-${ver}/include/json-c
</headers>
<libs>
../json-c-installs/json-c-${ver}/lib64/libjson-c.so
</libs>
</foo>
EOF
}
mkxml ${release}
mkxml ${prev}
perl abi-compliance-checker.pl -lib json-c -dump json-c-${prev}.xml -dump-path ./ABI-${prev}.dump
perl abi-compliance-checker.pl -lib json-c -dump json-c-${release}.xml -dump-path ./ABI-${release}.dump
perl abi-compliance-checker.pl -l json-c -old ABI-${prev}.dump -new ABI-${release}.dump
echo "look in compat_reports/json-c/..."

View File

@@ -22,16 +22,30 @@
#include <sys/time.h>
#endif
static int formatted_output = 0;
#ifndef JSON_NORETURN
#if defined(_MSC_VER)
#define JSON_NORETURN __declspec(noreturn)
#elif defined(__OS400__)
#define JSON_NORETURN
#else
/* 'cold' attribute is for optimization, telling the computer this code
* path is unlikely.
*/
#define JSON_NORETURN __attribute__((noreturn, cold))
#endif
#endif
static int formatted_output = JSON_C_TO_STRING_SPACED;
static int show_output = 1;
static int strict_mode = 0;
static int color = 0;
static const char *fname = NULL;
#ifndef HAVE_JSON_TOKENER_GET_PARSE_END
#define json_tokener_get_parse_end(tok) ((tok)->char_offset)
#endif
static void usage(const char *argv0, int exitval, const char *errmsg);
JSON_NORETURN static void usage(const char *argv0, int exitval, const char *errmsg);
static void showmem(void);
static int parseit(int fd, int (*callback)(struct json_object *));
static int showobj(struct json_object *new_obj);
@@ -42,7 +56,7 @@ static void showmem(void)
struct rusage rusage;
memset(&rusage, 0, sizeof(rusage));
getrusage(RUSAGE_SELF, &rusage);
printf("maxrss: %ld KB\n", rusage.ru_maxrss);
fprintf(stderr, "maxrss: %ld KB\n", rusage.ru_maxrss);
#endif
}
@@ -50,7 +64,7 @@ static int parseit(int fd, int (*callback)(struct json_object *))
{
struct json_object *obj;
char buf[32768];
int ret;
ssize_t ret;
int depth = JSON_TOKENER_DEFAULT_DEPTH;
json_tokener *tok;
@@ -73,20 +87,21 @@ static int parseit(int fd, int (*callback)(struct json_object *))
size_t total_read = 0;
while ((ret = read(fd, buf, sizeof(buf))) > 0)
{
total_read += ret;
int start_pos = 0;
while (start_pos != ret)
size_t retu = (size_t)ret; // We know it's positive
total_read += retu;
size_t start_pos = 0;
while (start_pos != retu)
{
obj = json_tokener_parse_ex(tok, &buf[start_pos], ret - start_pos);
obj = json_tokener_parse_ex(tok, &buf[start_pos], retu - start_pos);
enum json_tokener_error jerr = json_tokener_get_error(tok);
int parse_end = json_tokener_get_parse_end(tok);
size_t parse_end = json_tokener_get_parse_end(tok);
if (obj == NULL && jerr != json_tokener_continue)
{
char *aterr = (start_pos + parse_end < sizeof(buf)) ?
const char *aterr = (start_pos + parse_end < (int)sizeof(buf)) ?
&buf[start_pos + parse_end] : "";
fflush(stdout);
int fail_offset = total_read - ret + start_pos + parse_end;
fprintf(stderr, "Failed at offset %d: %s %c\n", fail_offset,
size_t fail_offset = total_read - retu + start_pos + parse_end;
fprintf(stderr, "Failed at offset %lu: %s %c\n", (unsigned long)fail_offset,
json_tokener_error_desc(jerr), aterr[0]);
json_tokener_free(tok);
return 1;
@@ -102,7 +117,7 @@ static int parseit(int fd, int (*callback)(struct json_object *))
}
}
start_pos += json_tokener_get_parse_end(tok);
assert(start_pos <= ret);
assert(start_pos <= retu);
}
}
if (ret < 0)
@@ -122,15 +137,12 @@ static int showobj(struct json_object *new_obj)
return 1;
}
printf("Successfully parsed object from %s\n", fname);
fprintf(stderr, "Successfully parsed object from %s\n", fname);
if (show_output)
{
const char *output;
if (formatted_output)
output = json_object_to_json_string(new_obj);
else
output = json_object_to_json_string_ext(new_obj, JSON_C_TO_STRING_PRETTY);
output = json_object_to_json_string_ext(new_obj, formatted_output | color);
printf("%s\n", output);
}
@@ -145,11 +157,14 @@ static void usage(const char *argv0, int exitval, const char *errmsg)
fp = stderr;
if (errmsg != NULL)
fprintf(fp, "ERROR: %s\n\n", errmsg);
fprintf(fp, "Usage: %s [-f] [-n] [-s]\n", argv0);
fprintf(fp, " -f - Format the output with JSON_C_TO_STRING_PRETTY\n");
fprintf(fp, "Usage: %s [-f|-F <arg>] [-n] [-s]\n", argv0);
fprintf(fp, " -f - Format the output to stdout with JSON_C_TO_STRING_PRETTY (default is JSON_C_TO_STRING_SPACED)\n");
fprintf(fp, " -F - Format the output to stdout with <arg>, e.g. 0 for JSON_C_TO_STRING_PLAIN\n");
fprintf(fp, " -n - No output\n");
fprintf(fp, " -c - color\n");
fprintf(fp, " -s - Parse in strict mode, flags:\n");
fprintf(fp, " JSON_TOKENER_STRICT|JSON_TOKENER_ALLOW_TRAILING_CHARS\n");
fprintf(fp, " Diagnostic information will be emitted to stderr\n");
fprintf(fp, "\nWARNING WARNING WARNING\n");
fprintf(fp, "This is a prototype, it may change or be removed at any time!\n");
@@ -158,16 +173,17 @@ static void usage(const char *argv0, int exitval, const char *errmsg)
int main(int argc, char **argv)
{
json_object *new_obj;
int opt;
while ((opt = getopt(argc, argv, "fhns")) != -1)
while ((opt = getopt(argc, argv, "fF:hnsc")) != -1)
{
switch (opt)
{
case 'f': formatted_output = 1; break;
case 'f': formatted_output = JSON_C_TO_STRING_PRETTY; break;
case 'F': formatted_output = atoi(optarg); break;
case 'n': show_output = 0; break;
case 's': strict_mode = 1; break;
case 'c': color = JSON_C_TO_STRING_COLOR; break;
case 'h': usage(argv[0], 0, NULL);
default: /* '?' */ usage(argv[0], EXIT_FAILURE, "Unknown arguments");
}

View File

@@ -125,6 +125,27 @@ int array_list_shrink(struct array_list *arr, size_t empty_slots)
return 0;
}
int array_list_insert_idx(struct array_list *arr, size_t idx, void *data)
{
size_t move_amount;
if (idx >= arr->length)
return array_list_put_idx(arr, idx, data);
/* we're at full size, what size_t can support */
if (arr->length == SIZE_T_MAX)
return -1;
if (array_list_expand_internal(arr, arr->length + 1))
return -1;
move_amount = (arr->length - idx) * sizeof(void *);
memmove(arr->array + idx + 1, arr->array + idx, move_amount);
arr->array[idx] = data;
arr->length++;
return 0;
}
//static inline int _array_list_put_idx(struct array_list *arr, size_t idx, void *data)
int array_list_put_idx(struct array_list *arr, size_t idx, void *data)
{

View File

@@ -62,6 +62,8 @@ extern void array_list_free(struct array_list *al);
extern void *array_list_get_idx(struct array_list *al, size_t i);
extern int array_list_insert_idx(struct array_list *al, size_t i, void *data);
extern int array_list_put_idx(struct array_list *al, size_t i, void *data);
extern int array_list_add(struct array_list *al, void *data);

View File

@@ -65,9 +65,15 @@ while [ $# -gt 0 ] ; do
--enable-shared)
FLAGS+=(-DBUILD_SHARED_LIBS=ON)
;;
--disable-shared)
FLAGS+=(-DBUILD_SHARED_LIBS=OFF)
;;
--enable-static)
FLAGS+=(-DBUILD_STATIC_LIBS=ON)
;;
--disable-static)
FLAGS+=(-DBUILD_STATIC_LIBS=OFF)
;;
--disable-Bsymbolic)
FLAGS+=(-DDISABLE_BSYMBOLIC=ON)
;;

View File

@@ -137,6 +137,9 @@
/* Define to 1 if you have the `uselocale' function. */
#cmakedefine HAVE_USELOCALE
/* Define to 1 if newlocale() needs freelocale() called on it's `base` argument */
#cmakedefine NEWLOCALE_NEEDS_FREELOCALE
/* Define to 1 if you have the `vasprintf' function. */
#cmakedefine HAVE_VASPRINTF

View File

@@ -1,2 +1,5 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine JSON_C_HAVE_INTTYPES_H @JSON_C_HAVE_INTTYPES_H@
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine JSON_C_HAVE_STDINT_H @JSON_C_HAVE_STDINT_H@

View File

@@ -1103,7 +1103,7 @@ HTML_STYLESHEET =
# cascading style sheets that are included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefor more robust against future updates.
# standard style sheet and is therefore more robust against future updates.
# Doxygen will copy the style sheet files to the output directory.
# Note: The order of the extra stylesheet files is of importance (e.g. the last
# stylesheet in the list overrules the setting of the previous ones in the

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -49,7 +49,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -51,17 +51,19 @@
<tr id="row_0_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structarray__list.html" target="_self">array_list</a></td><td class="desc"></td></tr>
<tr id="row_1_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structjson__object__iter.html" target="_self">json_object_iter</a></td><td class="desc"></td></tr>
<tr id="row_2_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structjson__object__iterator.html" target="_self">json_object_iterator</a></td><td class="desc"></td></tr>
<tr id="row_3_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structjson__tokener.html" target="_self">json_tokener</a></td><td class="desc"></td></tr>
<tr id="row_4_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structjson__tokener__srec.html" target="_self">json_tokener_srec</a></td><td class="desc"></td></tr>
<tr id="row_5_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structlh__entry.html" target="_self">lh_entry</a></td><td class="desc"></td></tr>
<tr id="row_6_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structlh__table.html" target="_self">lh_table</a></td><td class="desc"></td></tr>
<tr id="row_7_"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structprintbuf.html" target="_self">printbuf</a></td><td class="desc"></td></tr>
<tr id="row_3_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structjson__patch__error.html" target="_self">json_patch_error</a></td><td class="desc"></td></tr>
<tr id="row_4_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structjson__pointer__get__result.html" target="_self">json_pointer_get_result</a></td><td class="desc"></td></tr>
<tr id="row_5_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structjson__tokener.html" target="_self">json_tokener</a></td><td class="desc"></td></tr>
<tr id="row_6_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structjson__tokener__srec.html" target="_self">json_tokener_srec</a></td><td class="desc"></td></tr>
<tr id="row_7_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structlh__entry.html" target="_self">lh_entry</a></td><td class="desc"></td></tr>
<tr id="row_8_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structlh__table.html" target="_self">lh_table</a></td><td class="desc"></td></tr>
<tr id="row_9_"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structprintbuf.html" target="_self">printbuf</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -82,6 +82,8 @@ Functions</h2></td></tr>
<tr class="separator:acd00fb70f7ca82f23b48b812c3498f67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a114f1af5b20b76a3dbb2d1d055006df8"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#a114f1af5b20b76a3dbb2d1d055006df8">array_list_get_idx</a> (struct <a class="el" href="structarray__list.html">array_list</a> *al, size_t i)</td></tr>
<tr class="separator:a114f1af5b20b76a3dbb2d1d055006df8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6f20316519b3dafec557368ee5c6cf3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#ad6f20316519b3dafec557368ee5c6cf3">array_list_insert_idx</a> (struct <a class="el" href="structarray__list.html">array_list</a> *al, size_t i, void *data)</td></tr>
<tr class="separator:ad6f20316519b3dafec557368ee5c6cf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f92076e9d8229f8a07e536dc286f811"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#a9f92076e9d8229f8a07e536dc286f811">array_list_put_idx</a> (struct <a class="el" href="structarray__list.html">array_list</a> *al, size_t i, void *data)</td></tr>
<tr class="separator:a9f92076e9d8229f8a07e536dc286f811"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e995608aa464244ff3184fb43574dc8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#a6e995608aa464244ff3184fb43574dc8">array_list_add</a> (struct <a class="el" href="structarray__list.html">array_list</a> *al, void *data)</td></tr>
@@ -268,6 +270,38 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ad6f20316519b3dafec557368ee5c6cf3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int array_list_insert_idx </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structarray__list.html">array_list</a> *&#160;</td>
<td class="paramname"><em>al</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="aa3bf90f47aa210032304b14e7ad09ef7"></a>
@@ -441,7 +475,7 @@ Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -49,22 +49,22 @@
<div class="qindex"><a class="qindex" href="#letter_A">A</a>&#160;|&#160;<a class="qindex" href="#letter_J">J</a>&#160;|&#160;<a class="qindex" href="#letter_L">L</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a></div>
<table style="margin: 10px; white-space: nowrap;" align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
<tr><td rowspan="2" valign="bottom"><a name="letter_A"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;A&#160;&#160;</div></td></tr></table>
</td><td valign="top"><a class="el" href="structjson__object__iterator.html">json_object_iterator</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structlh__table.html">lh_table</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td valign="top"><a class="el" href="structjson__tokener.html">json_tokener</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;P&#160;&#160;</div></td></tr></table>
</td><td valign="top"><a class="el" href="structjson__object__iterator.html">json_object_iterator</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structjson__tokener__srec.html">json_tokener_srec</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structlh__table.html">lh_table</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td valign="top"><a class="el" href="structjson__patch__error.html">json_patch_error</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_L"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;L&#160;&#160;</div></td></tr></table>
</td><td rowspan="2" valign="bottom"><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;P&#160;&#160;</div></td></tr></table>
</td><td></td></tr>
<tr><td valign="top"><a class="el" href="structarray__list.html">array_list</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structjson__tokener__srec.html">json_tokener_srec</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td valign="top"><a class="el" href="structarray__list.html">array_list</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structjson__pointer__get__result.html">json_pointer_get_result</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td rowspan="2" valign="bottom"><a name="letter_J"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;J&#160;&#160;</div></td></tr></table>
</td><td rowspan="2" valign="bottom"><a name="letter_L"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;L&#160;&#160;</div></td></tr></table>
</td><td valign="top"><a class="el" href="structprintbuf.html">printbuf</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td valign="top"><a class="el" href="structjson__object__iter.html">json_object_iter</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structlh__entry.html">lh_entry</a>&#160;&#160;&#160;</td><td></td><td></td></tr>
</td><td valign="top"><a class="el" href="structjson__tokener.html">json_tokener</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structlh__entry.html">lh_entry</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structprintbuf.html">printbuf</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
<tr><td valign="top"><a class="el" href="structjson__object__iter.html">json_object_iter</a>&#160;&#160;&#160;</td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
</table>
<div class="qindex"><a class="qindex" href="#letter_A">A</a>&#160;|&#160;<a class="qindex" href="#letter_J">J</a>&#160;|&#160;<a class="qindex" href="#letter_L">L</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a></div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -87,7 +87,7 @@
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -54,7 +54,7 @@ Files</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -55,19 +55,21 @@
<tr id="row_3_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__inttypes_8h.html" target="_self">json_inttypes.h</a></td><td class="desc">Do not use, json-c internal, may be changed or removed at any time</td></tr>
<tr id="row_4_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__object_8h.html" target="_self">json_object.h</a></td><td class="desc">Core json-c API. Start here, or with <a class="el" href="json__tokener_8h.html" title="Methods to parse an input string into a tree of json_object objects.">json_tokener.h</a></td></tr>
<tr id="row_5_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__object__iterator_8h.html" target="_self">json_object_iterator.h</a></td><td class="desc">An API for iterating over json_type_object objects, styled to be familiar to C++ programmers. Unlike <a class="el" href="json__object_8h.html#acf5f514a9e0061c10fc08055762639ee">json_object_object_foreach()</a> and <a class="el" href="json__object_8h.html#a71f07006c12d78f7bbf4cb716a5af3a6">json_object_object_foreachC()</a>, this avoids the need to expose json-c internals like <a class="el" href="structlh__entry.html">lh_entry</a></td></tr>
<tr id="row_6_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__pointer_8h.html" target="_self">json_pointer.h</a></td><td class="desc">JSON Pointer (RFC 6901) implementation for retrieving objects from a json-c object tree</td></tr>
<tr id="row_7_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__tokener_8h.html" target="_self">json_tokener.h</a></td><td class="desc">Methods to parse an input string into a tree of json_object objects</td></tr>
<tr id="row_8_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__types_8h.html" target="_self">json_types.h</a></td><td class="desc">Basic types used in a few places in json-c, but you should include "json_object.h" instead</td></tr>
<tr id="row_9_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__util_8h.html" target="_self">json_util.h</a></td><td class="desc">Miscllaneous utility functions and macros</td></tr>
<tr id="row_10_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__visit_8h.html" target="_self">json_visit.h</a></td><td class="desc">Methods for walking a tree of objects</td></tr>
<tr id="row_11_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="linkhash_8h.html" target="_self">linkhash.h</a></td><td class="desc">Internal methods for working with json_type_object objects. Although this is exposed by the <a class="el" href="json__object_8h.html#a2caa52ae1863bd073444f3737138a4db">json_object_get_object()</a> function and within the <a class="el" href="structjson__object__iter.html">json_object_iter</a> type, it is not recommended for direct use</td></tr>
<tr id="row_12_"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="printbuf_8h.html" target="_self">printbuf.h</a></td><td class="desc">Internal string buffer handling. Unless you're writing a json_object_to_json_string_fn implementation for use with <a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer()</a> direct use of this is not recommended</td></tr>
<tr id="row_6_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__patch_8h.html" target="_self">json_patch.h</a></td><td class="desc">JSON Patch (RFC 6902) implementation for manipulating JSON objects</td></tr>
<tr id="row_7_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__pointer_8h.html" target="_self">json_pointer.h</a></td><td class="desc">JSON Pointer (RFC 6901) implementation for retrieving objects from a json-c object tree</td></tr>
<tr id="row_8_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__pointer__private_8h.html" target="_self">json_pointer_private.h</a></td><td class="desc">Do not use, json-c internal, may be changed or removed at any time</td></tr>
<tr id="row_9_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__tokener_8h.html" target="_self">json_tokener.h</a></td><td class="desc">Methods to parse an input string into a tree of json_object objects</td></tr>
<tr id="row_10_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__types_8h.html" target="_self">json_types.h</a></td><td class="desc">Basic types used in a few places in json-c, but you should include "json_object.h" instead</td></tr>
<tr id="row_11_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__util_8h.html" target="_self">json_util.h</a></td><td class="desc">Miscllaneous utility functions and macros</td></tr>
<tr id="row_12_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json__visit_8h.html" target="_self">json_visit.h</a></td><td class="desc">Methods for walking a tree of objects</td></tr>
<tr id="row_13_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="linkhash_8h.html" target="_self">linkhash.h</a></td><td class="desc">Internal methods for working with json_type_object objects. Although this is exposed by the <a class="el" href="json__object_8h.html#a2caa52ae1863bd073444f3737138a4db">json_object_get_object()</a> function and within the <a class="el" href="structjson__object__iter.html">json_object_iter</a> type, it is not recommended for direct use</td></tr>
<tr id="row_14_"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="printbuf_8h.html" target="_self">printbuf.h</a></td><td class="desc">Internal string buffer handling. Unless you're writing a json_object_to_json_string_fn implementation for use with <a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer()</a> direct use of this is not recommended</td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -120,6 +120,12 @@
<li>err
: <a class="el" href="structjson__tokener.html#adef37cdc2578d8f8920db14315728cbd">json_tokener</a>
</li>
<li>errmsg
: <a class="el" href="structjson__patch__error.html#a6c7bdff0bc64ac7eb84224c3c6be3361">json_patch_error</a>
</li>
<li>errno_code
: <a class="el" href="structjson__patch__error.html#a80d2ee1f1d8ee4c1923e4c5a81950ac3">json_patch_error</a>
</li>
</ul>
@@ -148,6 +154,9 @@
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
<li>index_in_parent
: <a class="el" href="structjson__pointer__get__result.html#ab4018de1d0573e9db323ba0627da6ab1">json_pointer_get_result</a>
</li>
<li>is_double
: <a class="el" href="structjson__tokener.html#ad3bf0aa728ea14549d5aa6ca8dcba070">json_tokener</a>
</li>
@@ -164,6 +173,9 @@
<li>key
: <a class="el" href="structjson__object__iter.html#a0b76228b3a039075e9d84f88fa72ff53">json_object_iter</a>
</li>
<li>key_in_parent
: <a class="el" href="structjson__pointer__get__result.html#a09096a029acda753531551ea2548db6a">json_pointer_get_result</a>
</li>
</ul>
@@ -190,7 +202,8 @@
<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
<li>obj
: <a class="el" href="structjson__tokener__srec.html#ad2bb71affec1da5ba1d9952c3bf2c12a">json_tokener_srec</a>
: <a class="el" href="structjson__pointer__get__result.html#a9919695cf5fd827e14b843d22b222d8b">json_pointer_get_result</a>
, <a class="el" href="structjson__tokener__srec.html#ad2bb71affec1da5ba1d9952c3bf2c12a">json_tokener_srec</a>
</li>
<li>obj_field_name
: <a class="el" href="structjson__tokener__srec.html#a99551c172e97ac2e7a3849a50b4f51ca">json_tokener_srec</a>
@@ -202,6 +215,12 @@
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>parent
: <a class="el" href="structjson__pointer__get__result.html#adba314387ced3bef96877d8cf756b087">json_pointer_get_result</a>
</li>
<li>patch_failure_idx
: <a class="el" href="structjson__patch__error.html#a25a3684349fc0a52585511eb734ecb7a">json_patch_error</a>
</li>
<li>pb
: <a class="el" href="structjson__tokener.html#a1cdc7f85d7bde95f81bb08b7e61d6684">json_tokener</a>
</li>
@@ -267,7 +286,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -120,6 +120,12 @@
<li>err
: <a class="el" href="structjson__tokener.html#adef37cdc2578d8f8920db14315728cbd">json_tokener</a>
</li>
<li>errmsg
: <a class="el" href="structjson__patch__error.html#a6c7bdff0bc64ac7eb84224c3c6be3361">json_patch_error</a>
</li>
<li>errno_code
: <a class="el" href="structjson__patch__error.html#a80d2ee1f1d8ee4c1923e4c5a81950ac3">json_patch_error</a>
</li>
</ul>
@@ -148,6 +154,9 @@
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
<li>index_in_parent
: <a class="el" href="structjson__pointer__get__result.html#ab4018de1d0573e9db323ba0627da6ab1">json_pointer_get_result</a>
</li>
<li>is_double
: <a class="el" href="structjson__tokener.html#ad3bf0aa728ea14549d5aa6ca8dcba070">json_tokener</a>
</li>
@@ -164,6 +173,9 @@
<li>key
: <a class="el" href="structjson__object__iter.html#a0b76228b3a039075e9d84f88fa72ff53">json_object_iter</a>
</li>
<li>key_in_parent
: <a class="el" href="structjson__pointer__get__result.html#a09096a029acda753531551ea2548db6a">json_pointer_get_result</a>
</li>
</ul>
@@ -190,7 +202,8 @@
<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
<li>obj
: <a class="el" href="structjson__tokener__srec.html#ad2bb71affec1da5ba1d9952c3bf2c12a">json_tokener_srec</a>
: <a class="el" href="structjson__pointer__get__result.html#a9919695cf5fd827e14b843d22b222d8b">json_pointer_get_result</a>
, <a class="el" href="structjson__tokener__srec.html#ad2bb71affec1da5ba1d9952c3bf2c12a">json_tokener_srec</a>
</li>
<li>obj_field_name
: <a class="el" href="structjson__tokener__srec.html#a99551c172e97ac2e7a3849a50b4f51ca">json_tokener_srec</a>
@@ -202,6 +215,12 @@
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>parent
: <a class="el" href="structjson__pointer__get__result.html#adba314387ced3bef96877d8cf756b087">json_pointer_get_result</a>
</li>
<li>patch_failure_idx
: <a class="el" href="structjson__patch__error.html#a25a3684349fc0a52585511eb734ecb7a">json_patch_error</a>
</li>
<li>pb
: <a class="el" href="structjson__tokener.html#a1cdc7f85d7bde95f81bb08b7e61d6684">json_tokener</a>
</li>
@@ -267,7 +286,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -54,10 +54,12 @@
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li class="current"><a href="globals.html#index_a"><span>a</span></a></li>
<li><a href="globals_0x69.html#index_i"><span>i</span></a></li>
<li><a href="globals_0x6a.html#index_j"><span>j</span></a></li>
<li><a href="globals_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="globals_0x70.html#index_p"><span>p</span></a></li>
<li><a href="globals_0x73.html#index_s"><span>s</span></a></li>
<li><a href="globals_0x75.html#index_u"><span>u</span></a></li>
</ul>
</div>
</div><!-- top -->
@@ -89,6 +91,9 @@
<li>array_list_get_idx()
: <a class="el" href="arraylist_8h.html#a114f1af5b20b76a3dbb2d1d055006df8">arraylist.h</a>
</li>
<li>array_list_insert_idx()
: <a class="el" href="arraylist_8h.html#ad6f20316519b3dafec557368ee5c6cf3">arraylist.h</a>
</li>
<li>array_list_length()
: <a class="el" href="arraylist_8h.html#aa3bf90f47aa210032304b14e7ad09ef7">arraylist.h</a>
</li>
@@ -111,7 +116,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -0,0 +1,85 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>json-c: Globals</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li class="current"><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_vars.html"><span>Variables</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li><a href="globals_defs.html"><span>Macros</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="globals.html#index_a"><span>a</span></a></li>
<li class="current"><a href="globals_0x69.html#index_i"><span>i</span></a></li>
<li><a href="globals_0x6a.html#index_j"><span>j</span></a></li>
<li><a href="globals_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="globals_0x70.html#index_p"><span>p</span></a></li>
<li><a href="globals_0x73.html#index_s"><span>s</span></a></li>
<li><a href="globals_0x75.html#index_u"><span>u</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
<div class="textblock">Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:</div>
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
<li>int32_t
: <a class="el" href="json__inttypes_8h.html#a37994e3b11c72957c6f454c6ec96d43d">json_inttypes.h</a>
</li>
<li>int64_t
: <a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">json_inttypes.h</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -54,10 +54,12 @@
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="globals.html#index_a"><span>a</span></a></li>
<li><a href="globals_0x69.html#index_i"><span>i</span></a></li>
<li class="current"><a href="globals_0x6a.html#index_j"><span>j</span></a></li>
<li><a href="globals_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="globals_0x70.html#index_p"><span>p</span></a></li>
<li><a href="globals_0x73.html#index_s"><span>s</span></a></li>
<li><a href="globals_0x75.html#index_u"><span>u</span></a></li>
</ul>
</div>
</div><!-- top -->
@@ -113,6 +115,9 @@
<li>JSON_C_STR_HASH_PERLLIKE
: <a class="el" href="linkhash_8h.html#a62316f34fd42941b97a8e9a6b6e68faa">linkhash.h</a>
</li>
<li>JSON_C_TO_STRING_COLOR
: <a class="el" href="json__object_8h.html#a195258c9acc1f8a216d7c9528b00d450">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_NOSLASHESCAPE
: <a class="el" href="json__object_8h.html#a5c11d72c55f3ab7c088f19e7bf118163">json_object.h</a>
</li>
@@ -199,6 +204,9 @@
<li>json_object_array_get_idx()
: <a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object.h</a>
</li>
<li>json_object_array_insert_idx()
: <a class="el" href="json__object_8h.html#ae40a00944afd41c9a463c6d9e8256f3b">json_object.h</a>
</li>
<li>json_object_array_length()
: <a class="el" href="json__object_8h.html#ab9ea8f9c72d5adf83fdcbfe69f97fa44">json_object.h</a>
</li>
@@ -427,15 +435,27 @@
<li>json_parse_uint64()
: <a class="el" href="json__util_8h.html#a94c2340c1344d57f7aa067f2dd0407f9">json_util.h</a>
</li>
<li>json_patch_apply()
: <a class="el" href="json__patch_8h.html#a134aaed1e732d029d34ce2d605f9ac8d">json_patch.h</a>
</li>
<li>json_pointer_array_set_cb
: <a class="el" href="json__pointer__private_8h.html#abd9b2aa5dba43055f07b69a5060bede3">json_pointer_private.h</a>
</li>
<li>json_pointer_get()
: <a class="el" href="json__pointer_8h.html#aff88937e32b0ba6ffbd07cb4b1919053">json_pointer.h</a>
</li>
<li>json_pointer_get_internal()
: <a class="el" href="json__pointer__private_8h.html#a0de79c3e3e33f897ba9db340d7372b64">json_pointer_private.h</a>
</li>
<li>json_pointer_getf()
: <a class="el" href="json__pointer_8h.html#af0ac03df64b215d05041e8007ed0233d">json_pointer.h</a>
</li>
<li>json_pointer_set()
: <a class="el" href="json__pointer_8h.html#aef0e651f63ce5ce35648503705e2586b">json_pointer.h</a>
</li>
<li>json_pointer_set_with_array_cb()
: <a class="el" href="json__pointer__private_8h.html#a0ac7b6b8de2336f8cd463687d7c148d2">json_pointer_private.h</a>
</li>
<li>json_pointer_setf()
: <a class="el" href="json__pointer_8h.html#a66f1f98a2ce085c19f6750193b4c726d">json_pointer.h</a>
</li>
@@ -460,6 +480,9 @@
<li>json_tokener_error_desc()
: <a class="el" href="json__tokener_8h.html#af060dd6b593b3b710044bcb97dcec07f">json_tokener.h</a>
</li>
<li>json_tokener_error_memory
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a23ecf6536cfbfb48781fd7874eef59a0">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_array
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a574846740b785146f164a209dc89574e">json_tokener.h</a>
</li>
@@ -623,7 +646,7 @@
: <a class="el" href="json__tokener_8h.html#a633ab043f2b07fd22420af2b369a260a">json_tokener.h</a>
</li>
<li>json_type
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06c">json_types.h</a>
: <a class="el" href="json__types_8h.html#aba5eff84f8638d22f50403175f270c96">json_types.h</a>
</li>
<li>json_type_array
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cae536c8c9da4648e6b9348abddde6113c">json_types.h</a>
@@ -656,7 +679,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -54,10 +54,12 @@
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="globals.html#index_a"><span>a</span></a></li>
<li><a href="globals_0x69.html#index_i"><span>i</span></a></li>
<li><a href="globals_0x6a.html#index_j"><span>j</span></a></li>
<li class="current"><a href="globals_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="globals_0x70.html#index_p"><span>p</span></a></li>
<li><a href="globals_0x73.html#index_s"><span>s</span></a></li>
<li><a href="globals_0x75.html#index_u"><span>u</span></a></li>
</ul>
</div>
</div><!-- top -->
@@ -162,7 +164,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -54,10 +54,12 @@
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="globals.html#index_a"><span>a</span></a></li>
<li><a href="globals_0x69.html#index_i"><span>i</span></a></li>
<li><a href="globals_0x6a.html#index_j"><span>j</span></a></li>
<li><a href="globals_0x6c.html#index_l"><span>l</span></a></li>
<li class="current"><a href="globals_0x70.html#index_p"><span>p</span></a></li>
<li><a href="globals_0x73.html#index_s"><span>s</span></a></li>
<li><a href="globals_0x75.html#index_u"><span>u</span></a></li>
</ul>
</div>
</div><!-- top -->
@@ -102,7 +104,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -54,10 +54,12 @@
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="globals.html#index_a"><span>a</span></a></li>
<li><a href="globals_0x69.html#index_i"><span>i</span></a></li>
<li><a href="globals_0x6a.html#index_j"><span>j</span></a></li>
<li><a href="globals_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="globals_0x70.html#index_p"><span>p</span></a></li>
<li class="current"><a href="globals_0x73.html#index_s"><span>s</span></a></li>
<li><a href="globals_0x75.html#index_u"><span>u</span></a></li>
</ul>
</div>
</div><!-- top -->
@@ -75,7 +77,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -0,0 +1,85 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>json-c: Globals</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li class="current"><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_vars.html"><span>Variables</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li><a href="globals_defs.html"><span>Macros</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="globals.html#index_a"><span>a</span></a></li>
<li><a href="globals_0x69.html#index_i"><span>i</span></a></li>
<li><a href="globals_0x6a.html#index_j"><span>j</span></a></li>
<li><a href="globals_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="globals_0x70.html#index_p"><span>p</span></a></li>
<li><a href="globals_0x73.html#index_s"><span>s</span></a></li>
<li class="current"><a href="globals_0x75.html#index_u"><span>u</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
<div class="textblock">Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:</div>
<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
<li>uint32_t
: <a class="el" href="json__inttypes_8h.html#a6eb1e68cc391dd753bc8ce896dbb8315">json_inttypes.h</a>
</li>
<li>uint64_t
: <a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">json_inttypes.h</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -105,6 +105,9 @@
<li>JSON_C_STR_HASH_PERLLIKE
: <a class="el" href="linkhash_8h.html#a62316f34fd42941b97a8e9a6b6e68faa">linkhash.h</a>
</li>
<li>JSON_C_TO_STRING_COLOR
: <a class="el" href="json__object_8h.html#a195258c9acc1f8a216d7c9528b00d450">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_NOSLASHESCAPE
: <a class="el" href="json__object_8h.html#a5c11d72c55f3ab7c088f19e7bf118163">json_object.h</a>
</li>
@@ -149,8 +152,8 @@
</li>
<li>JSON_EXPORT
: <a class="el" href="json__types_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">json_types.h</a>
, <a class="el" href="json__c__version_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">json_c_version.h</a>
, <a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">printbuf.h</a>
, <a class="el" href="json__c__version_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">json_c_version.h</a>
</li>
<li>JSON_FILE_BUF_SIZE
: <a class="el" href="json__util_8h.html#a084b6afc8f7fbef88976aabe4aca7efd">json_util.h</a>
@@ -234,7 +237,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -67,7 +67,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -67,6 +67,9 @@
<li>json_tokener_error_depth
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a59b2c36d9cc30c3038e09b9ddee6c86c">json_tokener.h</a>
</li>
<li>json_tokener_error_memory
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a23ecf6536cfbfb48781fd7874eef59a0">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_array
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a574846740b785146f164a209dc89574e">json_tokener.h</a>
</li>
@@ -215,7 +218,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -80,6 +80,9 @@
<li>array_list_get_idx()
: <a class="el" href="arraylist_8h.html#a114f1af5b20b76a3dbb2d1d055006df8">arraylist.h</a>
</li>
<li>array_list_insert_idx()
: <a class="el" href="arraylist_8h.html#ad6f20316519b3dafec557368ee5c6cf3">arraylist.h</a>
</li>
<li>array_list_length()
: <a class="el" href="arraylist_8h.html#aa3bf90f47aa210032304b14e7ad09ef7">arraylist.h</a>
</li>
@@ -132,6 +135,9 @@
<li>json_object_array_get_idx()
: <a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object.h</a>
</li>
<li>json_object_array_insert_idx()
: <a class="el" href="json__object_8h.html#ae40a00944afd41c9a463c6d9e8256f3b">json_object.h</a>
</li>
<li>json_object_array_length()
: <a class="el" href="json__object_8h.html#ab9ea8f9c72d5adf83fdcbfe69f97fa44">json_object.h</a>
</li>
@@ -336,15 +342,24 @@
<li>json_parse_uint64()
: <a class="el" href="json__util_8h.html#a94c2340c1344d57f7aa067f2dd0407f9">json_util.h</a>
</li>
<li>json_patch_apply()
: <a class="el" href="json__patch_8h.html#a134aaed1e732d029d34ce2d605f9ac8d">json_patch.h</a>
</li>
<li>json_pointer_get()
: <a class="el" href="json__pointer_8h.html#aff88937e32b0ba6ffbd07cb4b1919053">json_pointer.h</a>
</li>
<li>json_pointer_get_internal()
: <a class="el" href="json__pointer__private_8h.html#a0de79c3e3e33f897ba9db340d7372b64">json_pointer_private.h</a>
</li>
<li>json_pointer_getf()
: <a class="el" href="json__pointer_8h.html#af0ac03df64b215d05041e8007ed0233d">json_pointer.h</a>
</li>
<li>json_pointer_set()
: <a class="el" href="json__pointer_8h.html#aef0e651f63ce5ce35648503705e2586b">json_pointer.h</a>
</li>
<li>json_pointer_set_with_array_cb()
: <a class="el" href="json__pointer__private_8h.html#a0ac7b6b8de2336f8cd463687d7c148d2">json_pointer_private.h</a>
</li>
<li>json_pointer_setf()
: <a class="el" href="json__pointer_8h.html#a66f1f98a2ce085c19f6750193b4c726d">json_pointer.h</a>
</li>
@@ -484,7 +499,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -60,6 +60,12 @@
<li>array_list_free_fn
: <a class="el" href="arraylist_8h.html#aad83e4ed3c8ea274e6f18459276d774b">arraylist.h</a>
</li>
<li>int32_t
: <a class="el" href="json__inttypes_8h.html#a37994e3b11c72957c6f454c6ec96d43d">json_inttypes.h</a>
</li>
<li>int64_t
: <a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">json_inttypes.h</a>
</li>
<li>json_bool
: <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_types.h</a>
</li>
@@ -81,6 +87,9 @@
<li>json_object_to_json_string_fn
: <a class="el" href="json__types_8h.html#af84078100a9025df418f31626ea866fa">json_types.h</a>
</li>
<li>json_pointer_array_set_cb
: <a class="el" href="json__pointer__private_8h.html#abd9b2aa5dba43055f07b69a5060bede3">json_pointer_private.h</a>
</li>
<li>json_tokener
: <a class="el" href="json__tokener_8h.html#a4dd5e5b65aee7f376f529f86b210ff49">json_tokener.h</a>
</li>
@@ -102,11 +111,17 @@
<li>printbuf
: <a class="el" href="printbuf_8h.html#ace274df280df67463ff417b1b3392395">printbuf.h</a>
</li>
<li>uint32_t
: <a class="el" href="json__inttypes_8h.html#a6eb1e68cc391dd753bc8ce896dbb8315">json_inttypes.h</a>
</li>
<li>uint64_t
: <a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">json_inttypes.h</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -67,7 +67,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -43,6 +43,7 @@
<div class="textblock"><h1><code>json-c</code></h1>
<ol type="1">
<li><a href="#overview">Overview and Build Status</a></li>
<li><a href="#gettinghelp">Getting Help</a></li>
<li><a href="#buildunix">Building on Unix</a><ul>
<li><a href="#installprereq">Prerequisites</a></li>
<li><a href="#buildcmds">Build commands</a></li>
@@ -51,21 +52,30 @@
<li><a href="#CMake">CMake options</a></li>
<li><a href="#testing">Testing</a></li>
<li><a href="#buildvcpkg">Building with `vcpkg`</a></li>
<li><a href="#android">Building for Android</a></li>
</ol>
<ol type="1">
<li><a href="#linking">Linking to libjson-c</a></li>
<li><a href="#using">Using json-c</a></li>
</ol>
<h2>JSON-C - A JSON implementation in C <a class="anchor" id="overview"></a></h2>
<p>JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects. It aims to conform to <a href="https://tools.ietf.org/html/rfc7159">RFC 7159</a>.</p>
<p>JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects. It aims to conform to <a href="https://www.rfc-editor.org/rfc/rfc8259">RFC 8259</a>.</p>
<p>Skip down to <a href="#using">Using json-c</a> or check out the <a href="https://json-c.github.io/json-c/">API docs</a>, if you already have json-c installed and ready to use.</p>
<p>Home page for json-c: <a href="https://github.com/json-c/json-c/wiki">https://github.com/json-c/json-c/wiki</a></p>
<h2>Getting Help <a class="anchor" id="gettinghelp"></a></h2>
<p>If you have questions about using json-c, please start a thread on our forums at: <a href="https://groups.google.com/forum/#!forum/json-c">https://groups.google.com/forum/#!forum/json-c</a></p>
<p>If you believe you've discovered a bug, report it at (<a href="https://github.com/json-c/json-c/issues">https://github.com/json-c/json-c/issues</a>). Please be sure to include the version of json-c you're using, the OS you're running on, and any other relevant details. Fully reproducible test cases and/or patches to fix problems are greatly appreciated.</p>
<p>Fixes for bugs, or small new features can be directly submitted as a <a href="https://github.com/json-c/json-c/pulls">pull request</a>. For major new features or large changes of any kind, please first start a discussion on the <a href="https://groups.google.com/forum/#!forum/json-c">forums</a>.</p>
<h2>Building on Unix with <code>git</code>, <code>gcc</code> and <code>cmake</code> <a class="anchor" id="buildunix"></a></h2>
<p>If you already have json-c installed, see <a href="#linking">Linking to `libjson-c`</a> for how to build and link your program against it.</p>
<p>Build Status</p>
<ul>
<li><a href="https://ci.appveyor.com/project/hawicz/json-c">AppVeyor Build</a> <div class="image">
<img src="https://ci.appveyor.com/api/projects/status/github/json-c/json-c?branch=master&svg=true" alt="AppVeyor Build Status"/>
</div>
</li>
<li><a href="https://travis-ci.org/json-c/json-c">Travis Build</a> <div class="image">
<img src="https://travis-ci.org/json-c/json-c.svg?branch=master" alt="Travis Build Status"/>
<li><a href="https://app.travis-ci.com/github/json-c/json-c">Travis Build</a> <div class="image">
<img src="https://api.travis-ci.com/json-c/json-c.svg?branch=master" alt="Travis Build Status"/>
</div>
</li>
</ul>
@@ -73,8 +83,6 @@
<ul>
<li><a href="https://coveralls.io/github/json-c/json-c?branch=master">Coveralls</a> <a href="https://coveralls.io/github/json-c/json-c?branch=master">![Coverage Status](https://coveralls.io/repos/github/json-c/json-c/badge.svg?branch=master)</a></li>
</ul>
<h2>Building on Unix with <code>git</code>, <code>gcc</code> and <code>cmake</code> <a class="anchor" id="buildunix"></a></h2>
<p>If you already have json-c installed, see <a href="#linking">Linking to `libjson-c`</a> for how to build and link your program against it.</p>
<h3>Prerequisites: <a class="anchor" id="installprereq"></a></h3>
<ul>
<li><code>gcc</code>, <code>clang</code>, or another C compiler</li>
@@ -103,7 +111,7 @@ $ cmake ../json-c # See CMake section below for custom arguments
<pre class="fragment">$ make
$ make test
$ make USE_VALGRIND=0 test # optionally skip using valgrind
$ make install
$ sudo make install # it could be necessary to execute make install
</pre><h3>Generating documentation with Doxygen:</h3>
<p>The library documentation can be generated directly from the source code using Doxygen tool: </p>
<pre class="fragment"># in build directory
@@ -131,6 +139,10 @@ google-chrome doc/html/index.html
<tr>
<td>DISABLE_WERROR </td><td>Bool </td><td>Disable use of -Werror. </td></tr>
<tr>
<td>DISABLE_EXTRA_LIBS </td><td>Bool </td><td>Disable use of extra libraries, libbsd </td></tr>
<tr>
<td>DISABLE_JSON_POINTER </td><td>Bool </td><td>Omit json_pointer support from the build. </td></tr>
<tr>
<td>ENABLE_RDRAND </td><td>Bool </td><td>Enable RDRAND Hardware RNG Hash Seed. </td></tr>
<tr>
<td>ENABLE_THREADING </td><td>Bool </td><td>Enable partial threading support. </td></tr>
@@ -196,7 +208,23 @@ cd vcpkg
./vcpkg integrate install
vcpkg install json-c
</pre><p>The JSON-C port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please <a href="https://github.com/Microsoft/vcpkg">create an issue or pull request</a> on the vcpkg repository.</p>
<h2>Linking to <code>libjson-c</code> <a class="anchor" id="linking"></a></h2>
<h2>Building for Android <a class="anchor" id="android"></a></h2>
<p>Building on Android is now particularly well supported, but there have been some reports of success using <a href="https://developer.android.com/ndk/guides/cmake">https://developer.android.com/ndk/guides/cmake</a> </p>
<pre class="fragment">mkdir json-c-build
cd json-c-build/
export NDK_HOME=~/Library/Android/sdk/ndk/22.1.7171670/
cmake \
--toolchain=$NDK_HOME/build/cmake/android.toolchain.cmake \
-DANDROID_STL=none \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-29 \
-DANDROID_LD=lld \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=&lt;install prefix&gt; \
-DENABLE_THREADING=true \
..
make install
</pre><h2>Linking to <code>libjson-c</code> <a class="anchor" id="linking"></a></h2>
<p>If your system has <code>pkgconfig</code>, then you can just add this to your <code>makefile</code>: </p>
<pre class="fragment">CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)
@@ -235,7 +263,7 @@ LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -49,7 +49,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -49,7 +49,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -49,7 +49,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -49,7 +49,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -0,0 +1,57 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>json-c: issues_closed_for_0.17.md File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">issues_closed_for_0.17.md File Reference</div> </div>
</div><!--header-->
<div class="contents">
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -58,7 +58,7 @@
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -57,13 +57,13 @@
Macros</h2></td></tr>
<tr class="memitem:a251c3e1f59a379a4a905382b4e855125"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__c__version_8h.html#a251c3e1f59a379a4a905382b4e855125">JSON_C_MAJOR_VERSION</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a251c3e1f59a379a4a905382b4e855125"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc87477fbc1c75848fe6b6feec21c2d6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__c__version_8h.html#adc87477fbc1c75848fe6b6feec21c2d6">JSON_C_MINOR_VERSION</a>&#160;&#160;&#160;16</td></tr>
<tr class="memitem:adc87477fbc1c75848fe6b6feec21c2d6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__c__version_8h.html#adc87477fbc1c75848fe6b6feec21c2d6">JSON_C_MINOR_VERSION</a>&#160;&#160;&#160;17</td></tr>
<tr class="separator:adc87477fbc1c75848fe6b6feec21c2d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64457730097067ab096906d82e4a51a6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__c__version_8h.html#a64457730097067ab096906d82e4a51a6">JSON_C_MICRO_VERSION</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a64457730097067ab096906d82e4a51a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78e176eee75ee6aed43c4d65ca4c5b44"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__c__version_8h.html#a78e176eee75ee6aed43c4d65ca4c5b44">JSON_C_VERSION_NUM</a>&#160;&#160;&#160;((<a class="el" href="json__c__version_8h.html#a251c3e1f59a379a4a905382b4e855125">JSON_C_MAJOR_VERSION</a> &lt;&lt; 16) | (<a class="el" href="json__c__version_8h.html#adc87477fbc1c75848fe6b6feec21c2d6">JSON_C_MINOR_VERSION</a> &lt;&lt; 8) | <a class="el" href="json__c__version_8h.html#a64457730097067ab096906d82e4a51a6">JSON_C_MICRO_VERSION</a>)</td></tr>
<tr class="separator:a78e176eee75ee6aed43c4d65ca4c5b44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a894adda66a072bc3fd34ebe91a5aa7f4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__c__version_8h.html#a894adda66a072bc3fd34ebe91a5aa7f4">JSON_C_VERSION</a>&#160;&#160;&#160;&quot;0.16&quot;</td></tr>
<tr class="memitem:a894adda66a072bc3fd34ebe91a5aa7f4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__c__version_8h.html#a894adda66a072bc3fd34ebe91a5aa7f4">JSON_C_VERSION</a>&#160;&#160;&#160;&quot;0.17&quot;</td></tr>
<tr class="separator:a894adda66a072bc3fd34ebe91a5aa7f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a31d5c00f3a4712f2d5d62aee66344e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__c__version_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a>&#160;&#160;&#160;extern</td></tr>
<tr class="separator:a2a31d5c00f3a4712f2d5d62aee66344e"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -107,7 +107,7 @@ Functions</h2></td></tr>
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_C_MINOR_VERSION&#160;&#160;&#160;16</td>
<td class="memname">#define JSON_C_MINOR_VERSION&#160;&#160;&#160;17</td>
</tr>
</table>
</div><div class="memdoc">
@@ -119,7 +119,7 @@ Functions</h2></td></tr>
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_C_VERSION&#160;&#160;&#160;&quot;0.16&quot;</td>
<td class="memname">#define JSON_C_VERSION&#160;&#160;&#160;&quot;0.17&quot;</td>
</tr>
</table>
</div><div class="memdoc">
@@ -191,7 +191,7 @@ Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -43,7 +43,8 @@
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> </div>
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> </div>
<div class="headertitle">
<div class="title">json_inttypes.h File Reference</div> </div>
</div><!--header-->
@@ -60,6 +61,17 @@ Macros</h2></td></tr>
<tr class="separator:ae7044b3fb4cc5cde22155d59437c348f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac582131d7a7c8ee57e73180d1714f9d5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__inttypes_8h.html#ac582131d7a7c8ee57e73180d1714f9d5">PRIu64</a>&#160;&#160;&#160;&quot;I64u&quot;</td></tr>
<tr class="separator:ac582131d7a7c8ee57e73180d1714f9d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a37994e3b11c72957c6f454c6ec96d43d"><td class="memItemLeft" align="right" valign="top">typedef __int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__inttypes_8h.html#a37994e3b11c72957c6f454c6ec96d43d">int32_t</a></td></tr>
<tr class="separator:a37994e3b11c72957c6f454c6ec96d43d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6eb1e68cc391dd753bc8ce896dbb8315"><td class="memItemLeft" align="right" valign="top">typedef unsigned __int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__inttypes_8h.html#a6eb1e68cc391dd753bc8ce896dbb8315">uint32_t</a></td></tr>
<tr class="separator:a6eb1e68cc391dd753bc8ce896dbb8315"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67a9885ef4908cb72ce26d75b694386c"><td class="memItemLeft" align="right" valign="top">typedef __int64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a></td></tr>
<tr class="separator:a67a9885ef4908cb72ce26d75b694386c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec6fcb673ff035718c238c8c9d544c47"><td class="memItemLeft" align="right" valign="top">typedef unsigned __int64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a></td></tr>
<tr class="separator:aec6fcb673ff035718c238c8c9d544c47"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Do not use, json-c internal, may be changed or removed at any time. </p>
@@ -98,12 +110,61 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a37994e3b11c72957c6f454c6ec96d43d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef __int32 <a class="el" href="json__inttypes_8h.html#a37994e3b11c72957c6f454c6ec96d43d">int32_t</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a67a9885ef4908cb72ce26d75b694386c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef __int64 <a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a6eb1e68cc391dd753bc8ce896dbb8315"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef unsigned __int32 <a class="el" href="json__inttypes_8h.html#a6eb1e68cc391dd753bc8ce896dbb8315">uint32_t</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="aec6fcb673ff035718c238c8c9d544c47"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef unsigned __int64 <a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -73,6 +73,8 @@ Macros</h2></td></tr>
<tr class="separator:a34f027c147babf69fc530d088f2b49b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c11d72c55f3ab7c088f19e7bf118163"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a5c11d72c55f3ab7c088f19e7bf118163">JSON_C_TO_STRING_NOSLASHESCAPE</a>&#160;&#160;&#160;(1 &lt;&lt; 4)</td></tr>
<tr class="separator:a5c11d72c55f3ab7c088f19e7bf118163"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a195258c9acc1f8a216d7c9528b00d450"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a195258c9acc1f8a216d7c9528b00d450">JSON_C_TO_STRING_COLOR</a>&#160;&#160;&#160;(1 &lt;&lt; 5)</td></tr>
<tr class="separator:a195258c9acc1f8a216d7c9528b00d450"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8cd01c484155ac99043a35b7c85ae411"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a8cd01c484155ac99043a35b7c85ae411">JSON_C_OBJECT_ADD_KEY_IS_NEW</a>&#160;&#160;&#160;(1 &lt;&lt; 1)</td></tr>
<tr class="separator:a8cd01c484155ac99043a35b7c85ae411"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d303af657ca4ee8e487366ba9692c94"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a4d303af657ca4ee8e487366ba9692c94">JSON_C_OBJECT_ADD_CONSTANT_KEY</a>&#160;&#160;&#160;(1 &lt;&lt; 2)</td></tr>
@@ -149,6 +151,8 @@ Functions</h2></td></tr>
<tr class="separator:a18cdd9a7455e09f36cdf6e5756b7f586"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ac0ccdbc13a25da7d8b2dc9e421dfad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a1ac0ccdbc13a25da7d8b2dc9e421dfad">json_object_array_put_idx</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, size_t idx, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *val)</td></tr>
<tr class="separator:a1ac0ccdbc13a25da7d8b2dc9e421dfad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae40a00944afd41c9a463c6d9e8256f3b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ae40a00944afd41c9a463c6d9e8256f3b">json_object_array_insert_idx</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, size_t idx, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *val)</td></tr>
<tr class="separator:ae40a00944afd41c9a463c6d9e8256f3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a676711a76545d4ec65cc75f100f5fd19"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object_array_get_idx</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, size_t idx)</td></tr>
<tr class="separator:a676711a76545d4ec65cc75f100f5fd19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a722eca9f578704d3af38b97549242c1f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a722eca9f578704d3af38b97549242c1f">json_object_array_del_idx</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, size_t idx, size_t count)</td></tr>
@@ -161,25 +165,25 @@ Functions</h2></td></tr>
<tr class="separator:ac003fb99db7ecd674bb16d983d2f92ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a23863c1503f3a8dd8a460a6405da0a65"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a23863c1503f3a8dd8a460a6405da0a65">json_object_set_boolean</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> new_value)</td></tr>
<tr class="separator:a23863c1503f3a8dd8a460a6405da0a65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae92f0770fb4b3c884ce35de52d3d7de8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ae92f0770fb4b3c884ce35de52d3d7de8">json_object_new_int</a> (int32_t i)</td></tr>
<tr class="memitem:ae92f0770fb4b3c884ce35de52d3d7de8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ae92f0770fb4b3c884ce35de52d3d7de8">json_object_new_int</a> (<a class="el" href="json__inttypes_8h.html#a37994e3b11c72957c6f454c6ec96d43d">int32_t</a> i)</td></tr>
<tr class="separator:ae92f0770fb4b3c884ce35de52d3d7de8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7847f74494645c2b076505c37cc4cb93"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a7847f74494645c2b076505c37cc4cb93">json_object_new_int64</a> (int64_t i)</td></tr>
<tr class="memitem:a7847f74494645c2b076505c37cc4cb93"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a7847f74494645c2b076505c37cc4cb93">json_object_new_int64</a> (<a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a> i)</td></tr>
<tr class="separator:a7847f74494645c2b076505c37cc4cb93"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa602ee5f6182b35f3f75a927320b4efd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#aa602ee5f6182b35f3f75a927320b4efd">json_object_new_uint64</a> (uint64_t i)</td></tr>
<tr class="memitem:aa602ee5f6182b35f3f75a927320b4efd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#aa602ee5f6182b35f3f75a927320b4efd">json_object_new_uint64</a> (<a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a> i)</td></tr>
<tr class="separator:aa602ee5f6182b35f3f75a927320b4efd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c56dc58a02f92cd6789ba5dcb9fe7b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a8c56dc58a02f92cd6789ba5dcb9fe7b1">json_object_get_int</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr>
<tr class="memitem:a8c56dc58a02f92cd6789ba5dcb9fe7b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__inttypes_8h.html#a37994e3b11c72957c6f454c6ec96d43d">int32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a8c56dc58a02f92cd6789ba5dcb9fe7b1">json_object_get_int</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr>
<tr class="separator:a8c56dc58a02f92cd6789ba5dcb9fe7b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ab3568f12e01fd2967e765a72456caa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a4ab3568f12e01fd2967e765a72456caa">json_object_set_int</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, int new_value)</td></tr>
<tr class="separator:a4ab3568f12e01fd2967e765a72456caa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25691322b2d1ab24a3797e5752eb659f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a25691322b2d1ab24a3797e5752eb659f">json_object_int_inc</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, int64_t val)</td></tr>
<tr class="memitem:a25691322b2d1ab24a3797e5752eb659f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a25691322b2d1ab24a3797e5752eb659f">json_object_int_inc</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, <a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a> val)</td></tr>
<tr class="separator:a25691322b2d1ab24a3797e5752eb659f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a14750b3af4df18ec8dc93b090a8e8a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a1a14750b3af4df18ec8dc93b090a8e8a">json_object_get_int64</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr>
<tr class="memitem:a1a14750b3af4df18ec8dc93b090a8e8a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a1a14750b3af4df18ec8dc93b090a8e8a">json_object_get_int64</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr>
<tr class="separator:a1a14750b3af4df18ec8dc93b090a8e8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82c27579b6d25d9d0eb3b72758d8b71d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a82c27579b6d25d9d0eb3b72758d8b71d">json_object_get_uint64</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr>
<tr class="memitem:a82c27579b6d25d9d0eb3b72758d8b71d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a82c27579b6d25d9d0eb3b72758d8b71d">json_object_get_uint64</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr>
<tr class="separator:a82c27579b6d25d9d0eb3b72758d8b71d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d3948600dde732abed0e261264ef53a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a7d3948600dde732abed0e261264ef53a">json_object_set_int64</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, int64_t new_value)</td></tr>
<tr class="memitem:a7d3948600dde732abed0e261264ef53a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a7d3948600dde732abed0e261264ef53a">json_object_set_int64</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, <a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a> new_value)</td></tr>
<tr class="separator:a7d3948600dde732abed0e261264ef53a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9900aa9a425e6f14e295b298460b65d4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a9900aa9a425e6f14e295b298460b65d4">json_object_set_uint64</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, uint64_t new_value)</td></tr>
<tr class="memitem:a9900aa9a425e6f14e295b298460b65d4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a9900aa9a425e6f14e295b298460b65d4">json_object_set_uint64</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, <a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a> new_value)</td></tr>
<tr class="separator:a9900aa9a425e6f14e295b298460b65d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a594a093bafb9091f843da3197e0638aa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a594a093bafb9091f843da3197e0638aa">json_object_new_double</a> (double d)</td></tr>
<tr class="separator:a594a093bafb9091f843da3197e0638aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -306,6 +310,20 @@ Variables</h2></td></tr>
<p>Set a thread-local value of an option, overriding the global value. This will fail if json-c is not compiled with threading enabled, and with the __thread specifier (or equivalent) available.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#ac099272b46fde595831118720b155656">json_c_set_serialization_double_format</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a195258c9acc1f8a216d7c9528b00d450"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_C_TO_STRING_COLOR&#160;&#160;&#160;(1 &lt;&lt; 5)</td>
</tr>
</table>
</div><div class="memdoc">
<p>A flag for the <a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object_to_json_string_ext()</a> and <a class="el" href="json__util_8h.html#a68a7385c555cf21797e361d1d4de3441">json_object_to_file_ext()</a> functions which causes the output to be formatted.</p>
<p>Use color for printing json. </p>
</div>
</div>
<a class="anchor" id="a5c11d72c55f3ab7c088f19e7bf118163"></a>
@@ -730,6 +748,49 @@ Variables</h2></td></tr>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the json_object at the specified index (or NULL) </dd></dl>
</div>
</div>
<a class="anchor" id="ae40a00944afd41c9a463c6d9e8256f3b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_array_insert_idx </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>idx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>val</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Insert an element at a specified index in an array (a json_object of type json_type_array)</p>
<p>The reference count will <em>not</em> be incremented. This is to make adding fields to objects in code more compact. If you want to retain a reference to an added object you must wrap the passed object with json_object_get</p>
<p>The array size will be automatically be expanded to the size of the index if the index is larger than the current size. If the index is within the existing array limits, then the element will be inserted and all elements will be shifted. This is the only difference between this function and <a class="el" href="json__object_8h.html#a1ac0ccdbc13a25da7d8b2dc9e421dfad">json_object_array_put_idx()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>the json_object instance </td></tr>
<tr><td class="paramname">idx</td><td>the index to insert the element at </td></tr>
<tr><td class="paramname">val</td><td>the json_object to be added </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ab9ea8f9c72d5adf83fdcbfe69f97fa44"></a>
@@ -1139,7 +1200,7 @@ Variables</h2></td></tr>
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int32_t json_object_get_int </td>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__inttypes_8h.html#a37994e3b11c72957c6f454c6ec96d43d">int32_t</a> json_object_get_int </td>
<td>(</td>
<td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>obj</em></td><td>)</td>
@@ -1165,7 +1226,7 @@ Variables</h2></td></tr>
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int64_t json_object_get_int64 </td>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a> json_object_get_int64 </td>
<td>(</td>
<td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>obj</em></td><td>)</td>
@@ -1300,7 +1361,7 @@ Variables</h2></td></tr>
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> uint64_t json_object_get_uint64 </td>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a> json_object_get_uint64 </td>
<td>(</td>
<td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>obj</em></td><td>)</td>
@@ -1357,7 +1418,7 @@ Variables</h2></td></tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramtype"><a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a>&#160;</td>
<td class="paramname"><em>val</em>&#160;</td>
</tr>
<tr>
@@ -1601,7 +1662,7 @@ Variables</h2></td></tr>
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_int </td>
<td>(</td>
<td class="paramtype">int32_t&#160;</td>
<td class="paramtype"><a class="el" href="json__inttypes_8h.html#a37994e3b11c72957c6f454c6ec96d43d">int32_t</a>&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
@@ -1633,7 +1694,7 @@ Variables</h2></td></tr>
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_int64 </td>
<td>(</td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramtype"><a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a>&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
@@ -1795,7 +1856,7 @@ Variables</h2></td></tr>
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_uint64 </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramtype"><a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a>&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
@@ -2210,7 +2271,7 @@ Variables</h2></td></tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramtype"><a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a>&#160;</td>
<td class="paramname"><em>new_value</em>&#160;</td>
</tr>
<tr>
@@ -2370,7 +2431,7 @@ Variables</h2></td></tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramtype"><a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a>&#160;</td>
<td class="paramname"><em>new_value</em>&#160;</td>
</tr>
<tr>
@@ -2602,7 +2663,7 @@ Variables</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -326,7 +326,7 @@ User and internal code MUST NOT make any assumptions about and dependencies on t
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -0,0 +1,128 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>json-c: json_patch.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">json_patch.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>JSON Patch (RFC 6902) implementation for manipulating JSON objects.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__patch__error.html">json_patch_error</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a134aaed1e732d029d34ce2d605f9ac8d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__patch_8h.html#a134aaed1e732d029d34ce2d605f9ac8d">json_patch_apply</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *copy_from, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *patch, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> **base, struct <a class="el" href="structjson__patch__error.html">json_patch_error</a> *patch_error)</td></tr>
<tr class="separator:a134aaed1e732d029d34ce2d605f9ac8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>JSON Patch (RFC 6902) implementation for manipulating JSON objects. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a134aaed1e732d029d34ce2d605f9ac8d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_patch_apply </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>copy_from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>patch</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> **&#160;</td>
<td class="paramname"><em>base</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structjson__patch__error.html">json_patch_error</a> *&#160;</td>
<td class="paramname"><em>patch_error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Apply the JSON patch to the base object. The patch object must be formatted as per RFC 6902, i.e. a json_type_array containing patch operations. If the patch is not correctly formatted, an error will be returned.</p>
<p>The json_object at *base will be modified in place. Exactly one of *base or copy_from must be non-NULL. If *base is NULL, a new copy of copy_from will allocated and populated using <a class="el" href="json__object_8h.html#aaac16505f13bc56accfad82604d8bcdc">json_object_deep_copy()</a>. In this case <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a> <em>must</em> be used to free *base even if the overall patching operation fails.</p>
<p>If anything fails during patching a negative value will be returned, and patch_error (if non-NULL) will be populated with error details.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">base</td><td>a pointer to the JSON object which to patch </td></tr>
<tr><td class="paramname">patch</td><td>the JSON object that describes the patch to be applied </td></tr>
<tr><td class="paramname">copy_from</td><td>a JSON object to copy to *base </td></tr>
<tr><td class="paramname">patch_error</td><td>optional, details about errors</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>negative if an error (or not found), or 0 if patch completely applied </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -98,7 +98,6 @@ Functions</h2></td></tr>
<p>Retrieves a JSON sub-object from inside another JSON object using the JSON pointer notation as defined in RFC 6901 <a href="https://tools.ietf.org/html/rfc6901">https://tools.ietf.org/html/rfc6901</a></p>
<p>The returned JSON sub-object is equivalent to parsing manually the 'obj' JSON tree ; i.e. it's not a new object that is created, but rather a pointer inside the JSON tree.</p>
<p>Internally, this is equivalent to doing a series of '<a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get()</a>' and '<a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object_array_get_idx()</a>' along the given 'path'.</p>
<p>Note that the 'path' string supports 'printf()' type arguments, so, whatever is added after the 'res' param will be treated as an argument for 'path' Example: json_pointer_get(obj, "/foo/%d/%s", &amp;res, 0, bar) This means, that you need to escape '' with '%' (just like in printf())</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>the json_object instance/tree from where to retrieve sub-objects </td></tr>
@@ -147,7 +146,8 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>This is a variant of '<a class="el" href="json__pointer_8h.html#aff88937e32b0ba6ffbd07cb4b1919053">json_pointer_get()</a>' that supports printf() style arguments.</p>
<p>Example: json_pointer_getf(obj, res, "/foo/%d/%s", 0, bak) This also means that you need to escape '' with '%' (just like in printf())</p>
<p>Variable arguments go after the 'path_fmt' parameter.</p>
<p>Example: json_pointer_getf(obj, res, "/foo/%d/%s", 0, "bar") This also means that you need to escape '' with '%' (just like in printf())</p>
<p>Please take into consideration all recommended 'printf()' format security aspects when using this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
@@ -194,7 +194,6 @@ Functions</h2></td></tr>
<p>Note that 'obj' is a double pointer, mostly for the "" (empty string) case, where the entire JSON object would be replaced by 'value'. In the case of the "" path, the object at '*obj' will have it's refcount decremented with '<a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a>' and the 'value' object will be assigned to it.</p>
<p>For other cases (JSON sub-objects) ownership of 'value' will be transferred into '*obj' via '<a class="el" href="json__object_8h.html#a27bd808a022251059a43f1f6370441cd">json_object_object_add()</a>' &amp; '<a class="el" href="json__object_8h.html#a1ac0ccdbc13a25da7d8b2dc9e421dfad">json_object_array_put_idx()</a>', so the only time the refcount should be decremented for 'value' is when the return value of '<a class="el" href="json__pointer_8h.html#aef0e651f63ce5ce35648503705e2586b">json_pointer_set()</a>' is negative (meaning the 'value' object did not get set into '*obj').</p>
<p>That also implies that '<a class="el" href="json__pointer_8h.html#aef0e651f63ce5ce35648503705e2586b">json_pointer_set()</a>' does not do any refcount incrementing. (Just that single decrement that was mentioned above).</p>
<p>Note that the 'path' string supports 'printf()' type arguments, so, whatever is added after the 'value' param will be treated as an argument for 'path' Example: json_pointer_set(obj, "/foo/%d/%s", value, 0, bak) This means, that you need to escape '' with '%' (just like in printf())</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>the json_object instance/tree to which to add a sub-object </td></tr>
@@ -243,7 +242,8 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>This is a variant of '<a class="el" href="json__pointer_8h.html#aef0e651f63ce5ce35648503705e2586b">json_pointer_set()</a>' that supports printf() style arguments.</p>
<p>Example: json_pointer_setf(obj, value, "/foo/%d/%s", 0, bak) This also means that you need to escape '' with '%' (just like in printf())</p>
<p>Variable arguments go after the 'path_fmt' parameter.</p>
<p>Example: json_pointer_setf(obj, value, "/foo/%d/%s", 0, "bar") This also means that you need to escape '' with '%' (just like in printf())</p>
<p>Please take into consideration all recommended 'printf()' format security aspects when using this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
@@ -260,7 +260,7 @@ Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -0,0 +1,174 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>json-c: json_pointer_private.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">json_pointer_private.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Do not use, json-c internal, may be changed or removed at any time.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__pointer__get__result.html">json_pointer_get_result</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:abd9b2aa5dba43055f07b69a5060bede3"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__pointer__private_8h.html#abd9b2aa5dba43055f07b69a5060bede3">json_pointer_array_set_cb</a> )(<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *parent, size_t idx, <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *value, void *priv)</td></tr>
<tr class="separator:abd9b2aa5dba43055f07b69a5060bede3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a0de79c3e3e33f897ba9db340d7372b64"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__pointer__private_8h.html#a0de79c3e3e33f897ba9db340d7372b64">json_pointer_get_internal</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, const char *path, struct <a class="el" href="structjson__pointer__get__result.html">json_pointer_get_result</a> *res)</td></tr>
<tr class="separator:a0de79c3e3e33f897ba9db340d7372b64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ac7b6b8de2336f8cd463687d7c148d2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__pointer__private_8h.html#a0ac7b6b8de2336f8cd463687d7c148d2">json_pointer_set_with_array_cb</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> **obj, const char *path, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *value, <a class="el" href="json__pointer__private_8h.html#abd9b2aa5dba43055f07b69a5060bede3">json_pointer_array_set_cb</a> array_set_cb, void *priv)</td></tr>
<tr class="separator:a0ac7b6b8de2336f8cd463687d7c148d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Do not use, json-c internal, may be changed or removed at any time. </p>
</div><h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="abd9b2aa5dba43055f07b69a5060bede3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef int(* json_pointer_array_set_cb)(<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *parent, size_t idx, <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *value, void *priv)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a0de79c3e3e33f897ba9db340d7372b64"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int json_pointer_get_internal </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>path</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structjson__pointer__get__result.html">json_pointer_get_result</a> *&#160;</td>
<td class="paramname"><em>res</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a0ac7b6b8de2336f8cd463687d7c148d2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int json_pointer_set_with_array_cb </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> **&#160;</td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>path</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td>
<td class="paramname"><em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="json__pointer__private_8h.html#abd9b2aa5dba43055f07b69a5060bede3">json_pointer_array_set_cb</a>&#160;</td>
<td class="paramname"><em>array_set_cb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>priv</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -100,7 +100,9 @@ Enumerations</h2></td></tr>
&#160;&#160;<a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a033ce89ce7b8f9e591e4bea92121c4c7">json_tokener_error_parse_string</a>,
<a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a3588c05b1da8b909a8cbdef66b0a1a28">json_tokener_error_parse_comment</a>,
<a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59ab405d4a1282f3b037048d3456869a4c1">json_tokener_error_parse_utf8_string</a>,
<a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a1eeed74de65c0c12c9f9c28cf4f3ff1d">json_tokener_error_size</a>
<a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a23ecf6536cfbfb48781fd7874eef59a0">json_tokener_error_memory</a>,
<br/>
&#160;&#160;<a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a1eeed74de65c0c12c9f9c28cf4f3ff1d">json_tokener_error_size</a>
<br/>
}</td></tr>
<tr class="separator:a0a31f0df8a532ef8be5c09ba40eacb59"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -282,6 +284,8 @@ Functions</h2></td></tr>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a0a31f0df8a532ef8be5c09ba40eacb59ab405d4a1282f3b037048d3456869a4c1"></a>json_tokener_error_parse_utf8_string</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a0a31f0df8a532ef8be5c09ba40eacb59a23ecf6536cfbfb48781fd7874eef59a0"></a>json_tokener_error_memory</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a0a31f0df8a532ef8be5c09ba40eacb59a1eeed74de65c0c12c9f9c28cf4f3ff1d"></a>json_tokener_error_size</em>&nbsp;</td><td>
</td></tr>
</table>
@@ -678,7 +682,7 @@ Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -222,7 +222,7 @@ Enumerations</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -78,9 +78,9 @@ Functions</h2></td></tr>
<tr class="separator:afd492c120e359d2d75b67da96b580661"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fe4dbb5fe32850cdc22a97454e4500b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__util_8h.html#a9fe4dbb5fe32850cdc22a97454e4500b">json_util_get_last_err</a> (void)</td></tr>
<tr class="separator:a9fe4dbb5fe32850cdc22a97454e4500b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d9a63936cdae6639b9cdd87fdd13506"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__util_8h.html#a9d9a63936cdae6639b9cdd87fdd13506">json_parse_int64</a> (const char *buf, int64_t *retval)</td></tr>
<tr class="memitem:a9d9a63936cdae6639b9cdd87fdd13506"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__util_8h.html#a9d9a63936cdae6639b9cdd87fdd13506">json_parse_int64</a> (const char *buf, <a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a> *retval)</td></tr>
<tr class="separator:a9d9a63936cdae6639b9cdd87fdd13506"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94c2340c1344d57f7aa067f2dd0407f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__util_8h.html#a94c2340c1344d57f7aa067f2dd0407f9">json_parse_uint64</a> (const char *buf, uint64_t *retval)</td></tr>
<tr class="memitem:a94c2340c1344d57f7aa067f2dd0407f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__util_8h.html#a94c2340c1344d57f7aa067f2dd0407f9">json_parse_uint64</a> (const char *buf, <a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a> *retval)</td></tr>
<tr class="separator:a94c2340c1344d57f7aa067f2dd0407f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f0f0b8f29a41b47d62e6c867707be50"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__util_8h.html#a3f0f0b8f29a41b47d62e6c867707be50">json_parse_double</a> (const char *buf, double *retval)</td></tr>
<tr class="separator:a3f0f0b8f29a41b47d62e6c867707be50"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -389,7 +389,7 @@ Functions</h2></td></tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t *&#160;</td>
<td class="paramtype"><a class="el" href="json__inttypes_8h.html#a67a9885ef4908cb72ce26d75b694386c">int64_t</a> *&#160;</td>
<td class="paramname"><em>retval</em>&#160;</td>
</tr>
<tr>
@@ -399,6 +399,7 @@ Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>A parsing helper for integer values. Returns 0 on success, with the parsed value assigned to *retval. Overflow/underflow are NOT considered errors, but errno will be set to ERANGE, just like the strtol/strtoll functions do. </p>
</div>
</div>
@@ -415,7 +416,7 @@ Functions</h2></td></tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint64_t *&#160;</td>
<td class="paramtype"><a class="el" href="json__inttypes_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a> *&#160;</td>
<td class="paramname"><em>retval</em>&#160;</td>
</tr>
<tr>
@@ -425,6 +426,7 @@ Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>A parsing help for integer values, providing one extra bit of magnitude beyond <a class="el" href="json__util_8h.html#a9d9a63936cdae6639b9cdd87fdd13506">json_parse_int64()</a>. </p>
</div>
</div>
@@ -465,7 +467,7 @@ Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -231,7 +231,7 @@ Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -1147,7 +1147,7 @@ Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -43,7 +43,7 @@
<div class="textblock"></div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -682,12 +682,98 @@ cat issues.md &gt;&gt; issues_closed_for_0.16.md
<li><a href="https://github.com/json-c/json-c/issues/761">Issue #761</a> - Last commit merged to master breaks compilation</li>
<li><a href="https://github.com/json-c/json-c/issues/762">Issue #762</a> - how to merge two jsons by json-c</li>
<li><a href="https://github.com/json-c/json-c/issues/763">Issue #763</a> - Question: sort_fn arguments</li>
<li><a href="https://github.com/json-c/json-c/issues/764">Issue #764</a> - Make test fail on test case test_util_file </li>
<li><a href="https://github.com/json-c/json-c/issues/764">Issue #764</a> - Make test fail on test case test_util_file</li>
</ul>
<p>This list was created with: </p>
<pre class="fragment">PREV=2022-04-13
NOW=2023-08-12
curl "https://api.github.com/search/issues?q=repo%3Ajson-c%2Fjson-c+closed%3A&gt;${PREV}+created%3A&lt;${NOW}&amp;sort=created&amp;order=asc&amp;per_page=100&amp;page=1" &gt; issues1.out
jq -r '.items[] | "[" + .title + "](" + .url + ")" | tostring' issues?.out &gt; issues.md
sed -e's,^\[ *\(.*\)\](https://api.github.com/.*/\([0-9].*\)),* [Issue #\2](https://github.com/json-c/json-c/issues/\2) - \1,' -i issues.md
cat issues.md &gt;&gt; issues_closed_for_0.17.md
</pre><ul>
<li><a href="https://github.com/json-c/json-c/issues/191">Issue #191</a> - Override int64 to only display uint64 strings</li>
<li><a href="https://github.com/json-c/json-c/issues/537">Issue #537</a> - Replace '\0' only when parsing key, not change data in value.</li>
<li><a href="https://github.com/json-c/json-c/issues/570">Issue #570</a> - Figure out what needs to be done with Android.configure.mk</li>
<li><a href="https://github.com/json-c/json-c/issues/587">Issue #587</a> - Store the hashValue to avoid repeating the hash calculation during the hash resize.</li>
<li><a href="https://github.com/json-c/json-c/issues/612">Issue #612</a> - json-c-0.11: Fix CVE-2020-12762 - json-c through 0.14 has an integer overflow and out-of-bounds write ...</li>
<li><a href="https://github.com/json-c/json-c/issues/620">Issue #620</a> - Introduce json_object_new_string_{ext,noalloc}().</li>
<li><a href="https://github.com/json-c/json-c/issues/624">Issue #624</a> - json-c-0.14: Detect broken RDRAND during initialization.</li>
<li><a href="https://github.com/json-c/json-c/issues/625">Issue #625</a> - json-c-0.13.x: Detect broken RDRAND during initialization.</li>
<li><a href="https://github.com/json-c/json-c/issues/668">Issue #668</a> - Memory usage regression due to newlocal() on older FreeBSD releases</li>
<li><a href="https://github.com/json-c/json-c/issues/676">Issue #676</a> - dereferencing type-punned pointer might break strict-aliasing rules [-Werror=strict-aliasing]</li>
<li><a href="https://github.com/json-c/json-c/issues/677">Issue #677</a> - Naming conflict when using both json-c and jansson</li>
<li><a href="https://github.com/json-c/json-c/issues/679">Issue #679</a> - Let json-c be used with obsolete compilers</li>
<li><a href="https://github.com/json-c/json-c/issues/681">Issue #681</a> - json_tokener_parse_ex: <code>null</code> (4 bytes) only parses as valid JSON when passed with null terminator (5 bytes). Documentation issue?</li>
<li><a href="https://github.com/json-c/json-c/issues/686">Issue #686</a> - Remove dependency on libM::getrandom</li>
<li><a href="https://github.com/json-c/json-c/issues/687">Issue #687</a> - Does not build on Apple Silicon M1</li>
<li><a href="https://github.com/json-c/json-c/issues/688">Issue #688</a> - json-c-0.15-nodoc.tar.gz build fails</li>
<li><a href="https://github.com/json-c/json-c/issues/702">Issue #702</a> - json_patch: add first implementation only with patch application</li>
<li><a href="https://github.com/json-c/json-c/issues/704">Issue #704</a> - add <a class="el" href="json__object_8h.html#ae40a00944afd41c9a463c6d9e8256f3b">json_object_array_insert_idx()</a> + test-cases + fix json_pointer doc-strings</li>
<li><a href="https://github.com/json-c/json-c/issues/705">Issue #705</a> - segmentation fault on json-c parsing methods in cross compiled target</li>
<li><a href="https://github.com/json-c/json-c/issues/721">Issue #721</a> - cmake test fails with building json-c with icc</li>
<li><a href="https://github.com/json-c/json-c/issues/730">Issue #730</a> - Need a comparison with other JSON libraries in C</li>
<li><a href="https://github.com/json-c/json-c/issues/733">Issue #733</a> - Official release? 1.0?</li>
<li><a href="https://github.com/json-c/json-c/issues/756">Issue #756</a> - Question: Is there any way to build this with Gnu Make?</li>
<li><a href="https://github.com/json-c/json-c/issues/757">Issue #757</a> - json_object_from_fd_ex: fail if file is too large</li>
<li><a href="https://github.com/json-c/json-c/issues/759">Issue #759</a> - json_tokener_parse_ex: handle out of memory errors</li>
<li><a href="https://github.com/json-c/json-c/issues/766">Issue #766</a> - Some people have trouble with undefined references to arc4random</li>
<li><a href="https://github.com/json-c/json-c/issues/767">Issue #767</a> - How to create a character array using json-c</li>
<li><a href="https://github.com/json-c/json-c/issues/768">Issue #768</a> - commits from May 30, 2022 killed my docker build process</li>
<li><a href="https://github.com/json-c/json-c/issues/769">Issue #769</a> - Issue #768</li>
<li><a href="https://github.com/json-c/json-c/issues/770">Issue #770</a> - json_parse.c:170:13: error: this statement may fall through</li>
<li><a href="https://github.com/json-c/json-c/issues/771">Issue #771</a> - fix fallthough warning</li>
<li><a href="https://github.com/json-c/json-c/issues/772">Issue #772</a> - add JSON_C_TO_STRING_COLOR option</li>
<li><a href="https://github.com/json-c/json-c/issues/773">Issue #773</a> - problem with u_int64_t</li>
<li><a href="https://github.com/json-c/json-c/issues/774">Issue #774</a> - The function add_compile_options was added to CMake version 2.8.12 and later but your minimum is 2.8 which will not work</li>
<li><a href="https://github.com/json-c/json-c/issues/775">Issue #775</a> - list(TRANSFORM ...) is not available prior to CMake 3.12.</li>
<li><a href="https://github.com/json-c/json-c/issues/776">Issue #776</a> - Fix typo</li>
<li><a href="https://github.com/json-c/json-c/issues/777">Issue #777</a> - Don't try to change locale when libc only supports the C locale</li>
<li><a href="https://github.com/json-c/json-c/issues/778">Issue #778</a> - Do not insert newlines when converting empty arrays to json string and JSON_C_TO_STRING_PRETTY is used</li>
<li><a href="https://github.com/json-c/json-c/issues/779">Issue #779</a> - Fix compiling for Android</li>
<li><a href="https://github.com/json-c/json-c/issues/780">Issue #780</a> - Memory Leak when setting empty strings when c_string.pdata is used</li>
<li><a href="https://github.com/json-c/json-c/issues/781">Issue #781</a> - Fix memory leak with emtpy strings in json_object_set_string</li>
<li><a href="https://github.com/json-c/json-c/issues/782">Issue #782</a> - Fix typos found by codespell</li>
<li><a href="https://github.com/json-c/json-c/issues/783">Issue #783</a> - Fix build with clang-15+</li>
<li><a href="https://github.com/json-c/json-c/issues/784">Issue #784</a> - get_time_seed(): silence warning emitted by Coverity Scan static analyzer</li>
<li><a href="https://github.com/json-c/json-c/issues/786">Issue #786</a> - ghpages update was not published for json-c-0.16</li>
<li><a href="https://github.com/json-c/json-c/issues/787">Issue #787</a> - -static linker flag result in building failed</li>
<li><a href="https://github.com/json-c/json-c/issues/788">Issue #788</a> - Clear sensitive information.</li>
<li><a href="https://github.com/json-c/json-c/issues/789">Issue #789</a> - Unnecessary struct declaration and unsafe function usage</li>
<li><a href="https://github.com/json-c/json-c/issues/790">Issue #790</a> - Small update to README file</li>
<li><a href="https://github.com/json-c/json-c/issues/791">Issue #791</a> - json_object_object_foreach not ISO-C compliant</li>
<li><a href="https://github.com/json-c/json-c/issues/792">Issue #792</a> - <code>json_object_get_int</code> does not set <code>EINVAL</code> on invalid string</li>
<li><a href="https://github.com/json-c/json-c/issues/794">Issue #794</a> - replaced</li>
<li><a href="https://github.com/json-c/json-c/issues/796">Issue #796</a> - Added Test for get int functions</li>
<li><a href="https://github.com/json-c/json-c/issues/797">Issue #797</a> - make uninstall</li>
<li><a href="https://github.com/json-c/json-c/issues/798">Issue #798</a> - API to deal with enums is missing</li>
<li><a href="https://github.com/json-c/json-c/issues/799">Issue #799</a> - json_object_put: Assertion `jso-&gt;_ref_count &gt; 0' failed.</li>
<li><a href="https://github.com/json-c/json-c/issues/800">Issue #800</a> - String converted to scientific notation</li>
<li><a href="https://github.com/json-c/json-c/issues/801">Issue #801</a> - #error You do not have strncasecmp on your system.</li>
<li><a href="https://github.com/json-c/json-c/issues/802">Issue #802</a> - Problem: modern CMake warns about version 2.8</li>
<li><a href="https://github.com/json-c/json-c/issues/803">Issue #803</a> - Problem: confusing error message in snprintf_compat.h</li>
<li><a href="https://github.com/json-c/json-c/issues/804">Issue #804</a> - Problem: cmake 3.25.1 warns about CMP0042 not being set</li>
<li><a href="https://github.com/json-c/json-c/issues/806">Issue #806</a> - The problem is libjson-c.dylib incompatible with OS version</li>
<li><a href="https://github.com/json-c/json-c/issues/807">Issue #807</a> - json simple parse syntax</li>
<li><a href="https://github.com/json-c/json-c/issues/808">Issue #808</a> - iOS Build using cmake fails due to 64 to 32bits conversion precision loss</li>
<li><a href="https://github.com/json-c/json-c/issues/809">Issue #809</a> - Feature request json_object_new_uint()</li>
<li><a href="https://github.com/json-c/json-c/issues/810">Issue #810</a> - docs: update to Internet Standard reference</li>
<li><a href="https://github.com/json-c/json-c/issues/811">Issue #811</a> - dependence on execution character set</li>
<li><a href="https://github.com/json-c/json-c/issues/812">Issue #812</a> - Duplicate symbol when compiling with clang-cl</li>
<li><a href="https://github.com/json-c/json-c/issues/813">Issue #813</a> - Build apps only in project itself.</li>
<li><a href="https://github.com/json-c/json-c/issues/814">Issue #814</a> - Code execution order</li>
<li><a href="https://github.com/json-c/json-c/issues/816">Issue #816</a> - Hi I need to generate libjson-c.so.3 and libjson-c.so.3.0.1, please help with steps</li>
<li><a href="https://github.com/json-c/json-c/issues/818">Issue #818</a> - error: a function declaration without a prototype is deprecated in all versions of C</li>
<li><a href="https://github.com/json-c/json-c/issues/819">Issue #819</a> - build with intel 2023 fails on vasprintf</li>
<li><a href="https://github.com/json-c/json-c/issues/820">Issue #820</a> - ISO C forbids in</li>
<li><a href="https://github.com/json-c/json-c/issues/821">Issue #821</a> - Any release planing for 0.17?</li>
<li><a href="https://github.com/json-c/json-c/issues/822">Issue #822</a> - Added option to disable app build</li>
<li><a href="https://github.com/json-c/json-c/issues/823">Issue #823</a> - Symbol not found during linking stage of libjson-c.so </li>
</ul>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -50,7 +50,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -376,7 +376,7 @@ Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -115,7 +115,7 @@ Data Fields</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -103,7 +103,7 @@ Data Fields</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -75,7 +75,7 @@ Data Fields</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -0,0 +1,120 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>json-c: json_patch_error Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
<div class="title">json_patch_error Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a80d2ee1f1d8ee4c1923e4c5a81950ac3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__patch__error.html#a80d2ee1f1d8ee4c1923e4c5a81950ac3">errno_code</a></td></tr>
<tr class="separator:a80d2ee1f1d8ee4c1923e4c5a81950ac3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25a3684349fc0a52585511eb734ecb7a"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__patch__error.html#a25a3684349fc0a52585511eb734ecb7a">patch_failure_idx</a></td></tr>
<tr class="separator:a25a3684349fc0a52585511eb734ecb7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c7bdff0bc64ac7eb84224c3c6be3361"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__patch__error.html#a6c7bdff0bc64ac7eb84224c3c6be3361">errmsg</a></td></tr>
<tr class="separator:a6c7bdff0bc64ac7eb84224c3c6be3361"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Details of an error that occurred during <a class="el" href="json__patch_8h.html#a134aaed1e732d029d34ce2d605f9ac8d">json_patch_apply()</a> </p>
</div><h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="a6c7bdff0bc64ac7eb84224c3c6be3361"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* json_patch_error::errmsg</td>
</tr>
</table>
</div><div class="memdoc">
<p>A human readable error message. Allocated from static storage, does not need to be freed. </p>
</div>
</div>
<a class="anchor" id="a80d2ee1f1d8ee4c1923e4c5a81950ac3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int json_patch_error::errno_code</td>
</tr>
</table>
</div><div class="memdoc">
<p>An errno value indicating what kind of error occurred. Possible values include:</p>
<ul>
<li>ENOENT - A path referenced in the operation does not exist.</li>
<li>EINVAL - An invalid operation or with invalid path was attempted</li>
<li>ENOMEM - Unable to allocate memory</li>
<li>EFAULT - Invalid arguments were passed to <a class="el" href="json__patch_8h.html#a134aaed1e732d029d34ce2d605f9ac8d">json_patch_apply()</a> (i.e. a C API error, vs. a data error like EINVAL) </li>
</ul>
</div>
</div>
<a class="anchor" id="a25a3684349fc0a52585511eb734ecb7a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t json_patch_error::patch_failure_idx</td>
</tr>
</table>
</div><div class="memdoc">
<p>The index into the patch array of the operation that failed, or SIZE_T_MAX for overall errors. </p>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="json__patch_8h.html">json_patch.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>

View File

@@ -0,0 +1,123 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>json-c: json_pointer_get_result Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
<div class="title">json_pointer_get_result Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:adba314387ced3bef96877d8cf756b087"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__pointer__get__result.html#adba314387ced3bef96877d8cf756b087">parent</a></td></tr>
<tr class="separator:adba314387ced3bef96877d8cf756b087"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9919695cf5fd827e14b843d22b222d8b"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__pointer__get__result.html#a9919695cf5fd827e14b843d22b222d8b">obj</a></td></tr>
<tr class="separator:a9919695cf5fd827e14b843d22b222d8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09096a029acda753531551ea2548db6a"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__pointer__get__result.html#a09096a029acda753531551ea2548db6a">key_in_parent</a></td></tr>
<tr class="separator:a09096a029acda753531551ea2548db6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4018de1d0573e9db323ba0627da6ab1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="json__inttypes_8h.html#a6eb1e68cc391dd753bc8ce896dbb8315">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjson__pointer__get__result.html#ab4018de1d0573e9db323ba0627da6ab1">index_in_parent</a></td></tr>
<tr class="separator:ab4018de1d0573e9db323ba0627da6ab1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="ab4018de1d0573e9db323ba0627da6ab1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="json__inttypes_8h.html#a6eb1e68cc391dd753bc8ce896dbb8315">uint32_t</a> json_pointer_get_result::index_in_parent</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a09096a029acda753531551ea2548db6a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* json_pointer_get_result::key_in_parent</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a9919695cf5fd827e14b843d22b222d8b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_pointer_get_result::obj</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="adba314387ced3bef96877d8cf756b087"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_pointer_get_result::parent</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="json__pointer__private_8h.html">json_pointer_private.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -246,7 +246,7 @@ Data Fields</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -117,7 +117,7 @@ Data Fields</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -151,7 +151,7 @@ Data Fields</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -191,7 +191,7 @@ Data Fields</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

View File

@@ -17,7 +17,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">json-c
&#160;<span id="projectnumber">0.16</span>
&#160;<span id="projectnumber">0.17</span>
</div>
</td>
</tr>
@@ -101,7 +101,7 @@ Data Fields</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 14 2022 01:11:24 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Sat Aug 12 2023 18:59:55 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>

88
issues_closed_for_0.17.md Normal file
View File

@@ -0,0 +1,88 @@
This list was created with:
```
PREV=2022-04-13
NOW=2023-08-12
curl "https://api.github.com/search/issues?q=repo%3Ajson-c%2Fjson-c+closed%3A>${PREV}+created%3A<${NOW}&sort=created&order=asc&per_page=100&page=1" > issues1.out
jq -r '.items[] | "[" + .title + "](" + .url + ")" | tostring' issues?.out > issues.md
sed -e's,^\[ *\(.*\)\](https://api.github.com/.*/\([0-9].*\)),* [Issue #\2](https://github.com/json-c/json-c/issues/\2) - \1,' -i issues.md
cat issues.md >> issues_closed_for_0.17.md
```
* [Issue #191](https://github.com/json-c/json-c/issues/191) - Override int64 to only display uint64 strings
* [Issue #537](https://github.com/json-c/json-c/issues/537) - Replace '\0' only when parsing key, not change data in value.
* [Issue #570](https://github.com/json-c/json-c/issues/570) - Figure out what needs to be done with Android.configure.mk
* [Issue #587](https://github.com/json-c/json-c/issues/587) - Store the hashValue to avoid repeating the hash calculation during the hash resize.
* [Issue #612](https://github.com/json-c/json-c/issues/612) - json-c-0.11: Fix CVE-2020-12762 - json-c through 0.14 has an integer overflow and out-of-bounds write ...
* [Issue #620](https://github.com/json-c/json-c/issues/620) - Introduce json_object_new_string_{ext,noalloc}().
* [Issue #624](https://github.com/json-c/json-c/issues/624) - json-c-0.14: Detect broken RDRAND during initialization.
* [Issue #625](https://github.com/json-c/json-c/issues/625) - json-c-0.13.x: Detect broken RDRAND during initialization.
* [Issue #668](https://github.com/json-c/json-c/issues/668) - Memory usage regression due to newlocal() on older FreeBSD releases
* [Issue #676](https://github.com/json-c/json-c/issues/676) - dereferencing type-punned pointer might break strict-aliasing rules [-Werror=strict-aliasing]
* [Issue #677](https://github.com/json-c/json-c/issues/677) - Naming conflict when using both json-c and jansson
* [Issue #679](https://github.com/json-c/json-c/issues/679) - Let json-c be used with obsolete compilers
* [Issue #681](https://github.com/json-c/json-c/issues/681) - json_tokener_parse_ex: `null` (4 bytes) only parses as valid JSON when passed with null terminator (5 bytes). Documentation issue?
* [Issue #686](https://github.com/json-c/json-c/issues/686) - Remove dependency on libM::getrandom
* [Issue #687](https://github.com/json-c/json-c/issues/687) - Does not build on Apple Silicon M1
* [Issue #688](https://github.com/json-c/json-c/issues/688) - json-c-0.15-nodoc.tar.gz build fails
* [Issue #702](https://github.com/json-c/json-c/issues/702) - json_patch: add first implementation only with patch application
* [Issue #704](https://github.com/json-c/json-c/issues/704) - add json_object_array_insert_idx() + test-cases + fix json_pointer doc-strings
* [Issue #705](https://github.com/json-c/json-c/issues/705) - segmentation fault on json-c parsing methods in cross compiled target
* [Issue #721](https://github.com/json-c/json-c/issues/721) - cmake test fails with building json-c with icc
* [Issue #730](https://github.com/json-c/json-c/issues/730) - Need a comparison with other JSON libraries in C
* [Issue #733](https://github.com/json-c/json-c/issues/733) - Official release? 1.0?
* [Issue #756](https://github.com/json-c/json-c/issues/756) - Question: Is there any way to build this with Gnu Make?
* [Issue #757](https://github.com/json-c/json-c/issues/757) - json_object_from_fd_ex: fail if file is too large
* [Issue #759](https://github.com/json-c/json-c/issues/759) - json_tokener_parse_ex: handle out of memory errors
* [Issue #766](https://github.com/json-c/json-c/issues/766) - Some people have trouble with undefined references to arc4random
* [Issue #767](https://github.com/json-c/json-c/issues/767) - How to create a character array using json-c
* [Issue #768](https://github.com/json-c/json-c/issues/768) - commits from May 30, 2022 killed my docker build process
* [Issue #769](https://github.com/json-c/json-c/issues/769) - Issue #768
* [Issue #770](https://github.com/json-c/json-c/issues/770) - json_parse.c:170:13: error: this statement may fall through
* [Issue #771](https://github.com/json-c/json-c/issues/771) - fix fallthough warning
* [Issue #772](https://github.com/json-c/json-c/issues/772) - add JSON_C_TO_STRING_COLOR option
* [Issue #773](https://github.com/json-c/json-c/issues/773) - problem with u_int64_t
* [Issue #774](https://github.com/json-c/json-c/issues/774) - The function add_compile_options was added to CMake version 2.8.12 and later but your minimum is 2.8 which will not work
* [Issue #775](https://github.com/json-c/json-c/issues/775) - list(TRANSFORM ...) is not available prior to CMake 3.12.
* [Issue #776](https://github.com/json-c/json-c/issues/776) - Fix typo
* [Issue #777](https://github.com/json-c/json-c/issues/777) - Don't try to change locale when libc only supports the C locale
* [Issue #778](https://github.com/json-c/json-c/issues/778) - Do not insert newlines when converting empty arrays to json string and JSON_C_TO_STRING_PRETTY is used
* [Issue #779](https://github.com/json-c/json-c/issues/779) - Fix compiling for Android
* [Issue #780](https://github.com/json-c/json-c/issues/780) - Memory Leak when setting empty strings when c_string.pdata is used
* [Issue #781](https://github.com/json-c/json-c/issues/781) - Fix memory leak with emtpy strings in json_object_set_string
* [Issue #782](https://github.com/json-c/json-c/issues/782) - Fix typos found by codespell
* [Issue #783](https://github.com/json-c/json-c/issues/783) - Fix build with clang-15+
* [Issue #784](https://github.com/json-c/json-c/issues/784) - get_time_seed(): silence warning emitted by Coverity Scan static analyzer
* [Issue #786](https://github.com/json-c/json-c/issues/786) - ghpages update was not published for json-c-0.16
* [Issue #787](https://github.com/json-c/json-c/issues/787) - -static linker flag result in building failed
* [Issue #788](https://github.com/json-c/json-c/issues/788) - Clear sensitive information.
* [Issue #789](https://github.com/json-c/json-c/issues/789) - Unnecessary struct declaration and unsafe function usage
* [Issue #790](https://github.com/json-c/json-c/issues/790) - Small update to README file
* [Issue #791](https://github.com/json-c/json-c/issues/791) - json_object_object_foreach not ISO-C compliant
* [Issue #792](https://github.com/json-c/json-c/issues/792) - ` json_object_get_int` does not set `EINVAL` on invalid string
* [Issue #794](https://github.com/json-c/json-c/issues/794) - replaced
* [Issue #796](https://github.com/json-c/json-c/issues/796) - Added Test for get int functions
* [Issue #797](https://github.com/json-c/json-c/issues/797) - make uninstall
* [Issue #798](https://github.com/json-c/json-c/issues/798) - API to deal with enums is missing
* [Issue #799](https://github.com/json-c/json-c/issues/799) - json_object_put: Assertion `jso->_ref_count > 0' failed.
* [Issue #800](https://github.com/json-c/json-c/issues/800) - String converted to scientific notation
* [Issue #801](https://github.com/json-c/json-c/issues/801) - #error You do not have strncasecmp on your system.
* [Issue #802](https://github.com/json-c/json-c/issues/802) - Problem: modern CMake warns about version 2.8
* [Issue #803](https://github.com/json-c/json-c/issues/803) - Problem: confusing error message in snprintf_compat.h
* [Issue #804](https://github.com/json-c/json-c/issues/804) - Problem: cmake 3.25.1 warns about CMP0042 not being set
* [Issue #806](https://github.com/json-c/json-c/issues/806) - The problem is libjson-c.dylib incompatible with OS version
* [Issue #807](https://github.com/json-c/json-c/issues/807) - json simple parse syntax
* [Issue #808](https://github.com/json-c/json-c/issues/808) - iOS Build using cmake fails due to 64 to 32bits conversion precision loss
* [Issue #809](https://github.com/json-c/json-c/issues/809) - Feature request json_object_new_uint()
* [Issue #810](https://github.com/json-c/json-c/issues/810) - docs: update to Internet Standard reference
* [Issue #811](https://github.com/json-c/json-c/issues/811) - dependence on execution character set
* [Issue #812](https://github.com/json-c/json-c/issues/812) - Duplicate symbol when compiling with clang-cl
* [Issue #813](https://github.com/json-c/json-c/issues/813) - Build apps only in project itself.
* [Issue #814](https://github.com/json-c/json-c/issues/814) - Code execution order
* [Issue #816](https://github.com/json-c/json-c/issues/816) - Hi I need to generate libjson-c.so.3 and libjson-c.so.3.0.1, please help with steps
* [Issue #818](https://github.com/json-c/json-c/issues/818) - error: a function declaration without a prototype is deprecated in all versions of C
* [Issue #819](https://github.com/json-c/json-c/issues/819) - build with intel 2023 fails on vasprintf
* [Issue #820](https://github.com/json-c/json-c/issues/820) - ISO C forbids in
* [Issue #821](https://github.com/json-c/json-c/issues/821) - Any release planing for 0.17?
* [Issue #822](https://github.com/json-c/json-c/issues/822) - Added option to disable app build
* [Issue #823](https://github.com/json-c/json-c/issues/823) - Symbol not found during linking stage of libjson-c.so

View File

@@ -41,6 +41,8 @@ JSONC_PRIVATE {
printbuf_new;
printbuf_reset;
sprintbuf;
# Used by tests:
_json_c_strerror;
};
JSONC_0.14 {
@@ -165,6 +167,12 @@ JSONC_0.15 {
} JSONC_0.14;
JSONC_0.16 {
# global:
# ...new symbols here...
# No new symbols in 0.16
} JSONC_0.15;
JSONC_0.17 {
global:
json_object_array_insert_idx;
json_patch_apply;
# array_list_insert_idx is intentionally not exported
} JSONC_0.16;

View File

@@ -26,6 +26,7 @@ extern "C" {
#include "json_c_version.h"
#include "json_object.h"
#include "json_object_iterator.h"
@JSON_H_JSON_PATCH@
@JSON_H_JSON_POINTER@
#include "json_tokener.h"
#include "json_util.h"

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012,2017-2022 Eric Haszlakiewicz
* Copyright (c) 2012,2017 Eric Haszlakiewicz
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
@@ -17,11 +17,11 @@ extern "C" {
#endif
#define JSON_C_MAJOR_VERSION 0
#define JSON_C_MINOR_VERSION 16
#define JSON_C_MINOR_VERSION 17
#define JSON_C_MICRO_VERSION 0
#define JSON_C_VERSION_NUM \
((JSON_C_MAJOR_VERSION << 16) | (JSON_C_MINOR_VERSION << 8) | JSON_C_MICRO_VERSION)
#define JSON_C_VERSION "0.16"
#define JSON_C_VERSION "0.17"
#ifndef JSON_EXPORT
#if defined(_MSC_VER) && defined(JSON_C_DLL)

View File

@@ -13,7 +13,15 @@
#include <inttypes.h>
#else
#ifdef JSON_C_HAVE_STDINT_H
#include <stdint.h>
#else
/* Really only valid for old MS compilers, VS2008 and earlier: */
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#endif
#define PRId64 "I64d"
#define SCNd64 "I64d"
@@ -21,4 +29,9 @@
#endif
#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif
#endif

View File

@@ -53,6 +53,7 @@
#endif
#endif
const char *json_number_chars = "0123456789.+-eE"; /* Unused, but part of public API, drop for 1.0 */
const char *json_hex_chars = "0123456789abcdefABCDEF";
static void json_object_generic_delete(struct json_object *jso);
@@ -64,6 +65,12 @@ static void json_object_generic_delete(struct json_object *jso);
#define inline
#endif
/* define colors */
#define ANSI_COLOR_RESET "\033[0m"
#define ANSI_COLOR_FG_GREEN "\033[0;32m"
#define ANSI_COLOR_FG_BLUE "\033[0;34m"
#define ANSI_COLOR_FG_MAGENTA "\033[0;35m"
/*
* Helper functions to more safely cast to a particular type of json_object
*/
@@ -460,35 +467,45 @@ static int json_object_object_to_json_string(struct json_object *jso, struct pri
struct json_object_iter iter;
printbuf_strappend(pb, "{" /*}*/);
if (flags & JSON_C_TO_STRING_PRETTY)
printbuf_strappend(pb, "\n");
json_object_object_foreachC(jso, iter)
{
if (had_children)
{
printbuf_strappend(pb, ",");
if (flags & JSON_C_TO_STRING_PRETTY)
printbuf_strappend(pb, "\n");
}
if (flags & JSON_C_TO_STRING_PRETTY)
printbuf_strappend(pb, "\n");
had_children = 1;
if (flags & JSON_C_TO_STRING_SPACED && !(flags & JSON_C_TO_STRING_PRETTY))
printbuf_strappend(pb, " ");
indent(pb, level + 1, flags);
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_FG_BLUE);
printbuf_strappend(pb, "\"");
json_escape_str(pb, iter.key, strlen(iter.key), flags);
printbuf_strappend(pb, "\"");
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_RESET);
if (flags & JSON_C_TO_STRING_SPACED)
printbuf_strappend(pb, "\": ");
printbuf_strappend(pb, ": ");
else
printbuf_strappend(pb, "\":");
if (iter.val == NULL)
printbuf_strappend(pb, ":");
if (iter.val == NULL) {
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_FG_MAGENTA);
printbuf_strappend(pb, "null");
else if (iter.val->_to_json_string(iter.val, pb, level + 1, flags) < 0)
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_RESET);
} else if (iter.val->_to_json_string(iter.val, pb, level + 1, flags) < 0)
return -1;
}
if (flags & JSON_C_TO_STRING_PRETTY)
if ((flags & JSON_C_TO_STRING_PRETTY) && had_children)
{
if (had_children)
printbuf_strappend(pb, "\n");
printbuf_strappend(pb, "\n");
indent(pb, level, flags);
}
if (flags & JSON_C_TO_STRING_SPACED && !(flags & JSON_C_TO_STRING_PRETTY))
@@ -629,9 +646,18 @@ void json_object_object_del(struct json_object *jso, const char *key)
static int json_object_boolean_to_json_string(struct json_object *jso, struct printbuf *pb,
int level, int flags)
{
int ret;
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_FG_MAGENTA);
if (JC_BOOL(jso)->c_boolean)
return printbuf_strappend(pb, "true");
return printbuf_strappend(pb, "false");
ret = printbuf_strappend(pb, "true");
else
ret = printbuf_strappend(pb, "false");
if (ret > -1 && flags & JSON_C_TO_STRING_COLOR)
return printbuf_strappend(pb, ANSI_COLOR_RESET);
return ret;
}
struct json_object *json_object_new_boolean(json_bool b)
@@ -1220,9 +1246,13 @@ static int json_object_string_to_json_string(struct json_object *jso, struct pri
int level, int flags)
{
ssize_t len = JC_STRING(jso)->len;
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_FG_GREEN);
printbuf_strappend(pb, "\"");
json_escape_str(pb, get_string_component(jso), len < 0 ? -(ssize_t)len : len, flags);
printbuf_strappend(pb, "\"");
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_RESET);
return 0;
}
@@ -1323,11 +1353,18 @@ static int _json_object_set_string_len(json_object *jso, const char *s, size_t l
// length as int, cap length at INT_MAX.
return 0;
dstbuf = get_string_component_mutable(jso);
curlen = JC_STRING(jso)->len;
if (curlen < 0)
curlen = -curlen;
if (curlen < 0) {
if (len == 0) {
free(JC_STRING(jso)->c_string.pdata);
JC_STRING(jso)->len = curlen = 0;
} else {
curlen = -curlen;
}
}
newlen = len;
dstbuf = get_string_component_mutable(jso);
if ((ssize_t)len > curlen)
{
@@ -1374,31 +1411,34 @@ static int json_object_array_to_json_string(struct json_object *jso, struct prin
size_t ii;
printbuf_strappend(pb, "[");
if (flags & JSON_C_TO_STRING_PRETTY)
printbuf_strappend(pb, "\n");
for (ii = 0; ii < json_object_array_length(jso); ii++)
{
struct json_object *val;
if (had_children)
{
printbuf_strappend(pb, ",");
if (flags & JSON_C_TO_STRING_PRETTY)
printbuf_strappend(pb, "\n");
}
if (flags & JSON_C_TO_STRING_PRETTY)
printbuf_strappend(pb, "\n");
had_children = 1;
if (flags & JSON_C_TO_STRING_SPACED && !(flags & JSON_C_TO_STRING_PRETTY))
printbuf_strappend(pb, " ");
indent(pb, level + 1, flags);
val = json_object_array_get_idx(jso, ii);
if (val == NULL)
if (val == NULL) {
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_FG_MAGENTA);
printbuf_strappend(pb, "null");
else if (val->_to_json_string(val, pb, level + 1, flags) < 0)
if (flags & JSON_C_TO_STRING_COLOR)
printbuf_strappend(pb, ANSI_COLOR_RESET);
} else if (val->_to_json_string(val, pb, level + 1, flags) < 0)
return -1;
}
if (flags & JSON_C_TO_STRING_PRETTY)
if ((flags & JSON_C_TO_STRING_PRETTY) && had_children)
{
if (had_children)
printbuf_strappend(pb, "\n");
printbuf_strappend(pb, "\n");
indent(pb, level, flags);
}
@@ -1480,6 +1520,12 @@ int json_object_array_add(struct json_object *jso, struct json_object *val)
return array_list_add(JC_ARRAY(jso)->c_array, val);
}
int json_object_array_insert_idx(struct json_object *jso, size_t idx, struct json_object *val)
{
assert(json_object_get_type(jso) == json_type_array);
return array_list_insert_idx(JC_ARRAY(jso)->c_array, idx, val);
}
int json_object_array_put_idx(struct json_object *jso, size_t idx, struct json_object *val)
{
assert(json_object_get_type(jso) == json_type_array);

View File

@@ -74,6 +74,15 @@ extern "C" {
*/
#define JSON_C_TO_STRING_NOSLASHESCAPE (1 << 4)
/**
* A flag for the json_object_to_json_string_ext() and
* json_object_to_file_ext() functions which causes
* the output to be formatted.
*
* Use color for printing json.
*/
#define JSON_C_TO_STRING_COLOR (1 << 5)
/**
* A flag for the json_object_object_add_ex function which
* causes the value to be added without a check if it already exists.
@@ -613,6 +622,25 @@ JSON_EXPORT int json_object_array_add(struct json_object *obj, struct json_objec
JSON_EXPORT int json_object_array_put_idx(struct json_object *obj, size_t idx,
struct json_object *val);
/** Insert an element at a specified index in an array (a json_object of type json_type_array)
*
* The reference count will *not* be incremented. This is to make adding
* fields to objects in code more compact. If you want to retain a reference
* to an added object you must wrap the passed object with json_object_get
*
* The array size will be automatically be expanded to the size of the
* index if the index is larger than the current size.
* If the index is within the existing array limits, then the element will be
* inserted and all elements will be shifted. This is the only difference between
* this function and json_object_array_put_idx().
*
* @param obj the json_object instance
* @param idx the index to insert the element at
* @param val the json_object to be added
*/
JSON_EXPORT int json_object_array_insert_idx(struct json_object *obj, size_t idx,
struct json_object *val);
/** Get the element at specified index of array `obj` (which must be a json_object of type json_type_array)
*
* *No* reference counts will be changed, and ownership of the returned

332
json_patch.c Normal file
View File

@@ -0,0 +1,332 @@
/*
* Copyright (c) 2021 Alexandru Ardelean.
* Copyright (c) 2023 Eric Hawicz
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "json_patch.h"
#include "json_object_private.h"
#include "json_pointer_private.h"
#include <limits.h>
#ifndef SIZE_T_MAX
#if SIZEOF_SIZE_T == SIZEOF_INT
#define SIZE_T_MAX UINT_MAX
#elif SIZEOF_SIZE_T == SIZEOF_LONG
#define SIZE_T_MAX ULONG_MAX
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
#define SIZE_T_MAX ULLONG_MAX
#else
#error Unable to determine size of size_t
#endif
#endif
#define _set_err(_errval, _errmsg) do { \
patch_error->errno_code = (_errval); \
patch_error->errmsg = (_errmsg); \
errno = 0; /* To avoid confusion */ \
} while (0)
#define _set_err_from_ptrget(_errval, _fieldname) do { \
patch_error->errno_code = (_errval); \
patch_error->errmsg = (_errval) == ENOENT ? \
"Did not find element referenced by " _fieldname " field" : \
"Invalid " _fieldname " field"; \
errno = 0; /* To avoid confusion */ \
} while(0)
/**
* JavaScript Object Notation (JSON) Patch
* RFC 6902 - https://tools.ietf.org/html/rfc6902
*/
static int json_patch_apply_test(struct json_object **res,
struct json_object *patch_elem,
const char *path, struct json_patch_error *patch_error)
{
struct json_object *value1, *value2;
if (!json_object_object_get_ex(patch_elem, "value", &value1)) {
_set_err(EINVAL, "Patch object does not contain a 'value' field");
return -1;
}
if (json_pointer_get(*res, path, &value2))
{
_set_err_from_ptrget(errno, "path");
return -1;
}
if (!json_object_equal(value1, value2)) {
_set_err(ENOENT, "Value of element referenced by 'path' field did not match 'value' field");
return -1;
}
return 0;
}
static int __json_patch_apply_remove(struct json_pointer_get_result *jpres)
{
if (json_object_is_type(jpres->parent, json_type_array)) {
return json_object_array_del_idx(jpres->parent, jpres->index_in_parent, 1);
} else if (jpres->parent && jpres->key_in_parent) {
json_object_object_del(jpres->parent, jpres->key_in_parent);
return 0;
} else {
// We're removing the root object
(void)json_object_put(jpres->obj);
jpres->obj = NULL;
return 0;
}
}
static int json_patch_apply_remove(struct json_object **res, const char *path, struct json_patch_error *patch_error)
{
struct json_pointer_get_result jpres;
int rc;
if (json_pointer_get_internal(*res, path, &jpres))
{
_set_err_from_ptrget(errno, "path");
return -1;
}
rc = __json_patch_apply_remove(&jpres);
if (rc < 0)
_set_err(EINVAL, "Unable to remove path referenced by 'path' field");
// This means we removed and freed the root object, i.e. *res
if (jpres.parent == NULL)
*res = NULL;
return rc;
}
// callback for json_pointer_set_with_array_cb()
static int json_object_array_insert_idx_cb(struct json_object *parent, size_t idx,
struct json_object *value, void *priv)
{
int rc;
int *add = priv;
if (idx > json_object_array_length(parent))
{
// Note: will propagate back out through json_pointer_set_with_array_cb()
errno = EINVAL;
return -1;
}
if (*add)
rc = json_object_array_insert_idx(parent, idx, value);
else
rc = json_object_array_put_idx(parent, idx, value);
if (rc < 0)
errno = EINVAL;
return rc;
}
static int json_patch_apply_add_replace(struct json_object **res,
struct json_object *patch_elem,
const char *path, int add, struct json_patch_error *patch_error)
{
struct json_object *value;
int rc;
if (!json_object_object_get_ex(patch_elem, "value", &value)) {
_set_err(EINVAL, "Patch object does not contain a 'value' field");
return -1;
}
/* if this is a replace op, then we need to make sure it exists before replacing */
if (!add && json_pointer_get(*res, path, NULL)) {
_set_err_from_ptrget(errno, "path");
return -1;
}
rc = json_pointer_set_with_array_cb(res, path, json_object_get(value),
json_object_array_insert_idx_cb, &add);
if (rc)
{
_set_err(errno, "Failed to set value at path referenced by 'path' field");
json_object_put(value);
}
return rc;
}
// callback for json_pointer_set_with_array_cb()
static int json_object_array_move_cb(struct json_object *parent, size_t idx,
struct json_object *value, void *priv)
{
int rc;
struct json_pointer_get_result *from = priv;
size_t len = json_object_array_length(parent);
/**
* If it's the same array parent, it means that we removed
* and element from it, so the length is temporarily reduced
* by 1, which means that if we try to move an element to
* the last position, we need to check the current length + 1
*/
if (parent == from->parent)
len++;
if (idx > len)
{
// Note: will propagate back out through json_pointer_set_with_array_cb()
errno = EINVAL;
return -1;
}
rc = json_object_array_insert_idx(parent, idx, value);
if (rc < 0)
errno = EINVAL;
return rc;
}
static int json_patch_apply_move_copy(struct json_object **res,
struct json_object *patch_elem,
const char *path, int move, struct json_patch_error *patch_error)
{
json_pointer_array_set_cb array_set_cb;
struct json_pointer_get_result from;
struct json_object *jfrom;
const char *from_s;
size_t from_s_len;
int rc;
if (!json_object_object_get_ex(patch_elem, "from", &jfrom)) {
_set_err(EINVAL, "Patch does not contain a 'from' field");
return -1;
}
from_s = json_object_get_string(jfrom);
from_s_len = strlen(from_s);
if (strncmp(from_s, path, from_s_len) == 0) {
/**
* If lengths match, it's a noop, if they don't,
* then we're trying to move a parent under a child
* which is not allowed as per RFC 6902 section 4.4
* The "from" location MUST NOT be a proper prefix of the "path"
* location; i.e., a location cannot be moved into one of its children.
*/
if (from_s_len == strlen(path))
return 0;
_set_err(EINVAL, "Invalid attempt to move parent under a child");
return -1;
}
rc = json_pointer_get_internal(*res, from_s, &from);
if (rc)
{
_set_err_from_ptrget(errno, "from");
return rc;
}
// Note: it's impossible for json_pointer to find the root obj, due
// to the path check above, so from.parent is guaranteed non-NULL
json_object_get(from.obj);
if (!move) {
array_set_cb = json_object_array_insert_idx_cb;
} else {
rc = __json_patch_apply_remove(&from);
if (rc < 0) {
json_object_put(from.obj);
return rc;
}
array_set_cb = json_object_array_move_cb;
}
rc = json_pointer_set_with_array_cb(res, path, from.obj, array_set_cb, &from);
if (rc)
{
_set_err(errno, "Failed to set value at path referenced by 'path' field");
json_object_put(from.obj);
}
return rc;
}
int json_patch_apply(struct json_object *copy_from, struct json_object *patch,
struct json_object **base, struct json_patch_error *patch_error)
{
size_t ii;
int rc = 0;
struct json_patch_error placeholder;
if (!patch_error)
patch_error = &placeholder;
patch_error->patch_failure_idx = SIZE_T_MAX;
patch_error->errno_code = 0;
if (base == NULL||
(*base == NULL && copy_from == NULL) ||
(*base != NULL && copy_from != NULL))
{
_set_err(EFAULT, "Exactly one of *base or copy_from must be non-NULL");
return -1;
}
if (!json_object_is_type(patch, json_type_array)) {
_set_err(EFAULT, "Patch object is not of type json_type_array");
return -1;
}
if (copy_from != NULL)
{
if (json_object_deep_copy(copy_from, base, NULL) < 0)
{
_set_err(ENOMEM, "Unable to copy copy_from using json_object_deep_copy()");
return -1;
}
}
/* Go through all operations ; apply them on res */
for (ii = 0; ii < json_object_array_length(patch); ii++) {
struct json_object *jop, *jpath;
struct json_object *patch_elem = json_object_array_get_idx(patch, ii);
const char *op, *path;
patch_error->patch_failure_idx = ii;
if (!json_object_object_get_ex(patch_elem, "op", &jop)) {
_set_err(EINVAL, "Patch object does not contain 'op' field");
return -1;
}
op = json_object_get_string(jop);
if (!json_object_object_get_ex(patch_elem, "path", &jpath)) {
_set_err(EINVAL, "Patch object does not contain 'path' field");
return -1;
}
path = json_object_get_string(jpath); // Note: empty string is ok!
if (!strcmp(op, "test"))
rc = json_patch_apply_test(base, patch_elem, path, patch_error);
else if (!strcmp(op, "remove"))
rc = json_patch_apply_remove(base, path, patch_error);
else if (!strcmp(op, "add"))
rc = json_patch_apply_add_replace(base, patch_elem, path, 1, patch_error);
else if (!strcmp(op, "replace"))
rc = json_patch_apply_add_replace(base, patch_elem, path, 0, patch_error);
else if (!strcmp(op, "move"))
rc = json_patch_apply_move_copy(base, patch_elem, path, 1, patch_error);
else if (!strcmp(op, "copy"))
rc = json_patch_apply_move_copy(base, patch_elem, path, 0, patch_error);
else {
_set_err(EINVAL, "Patch object has invalid 'op' field");
return -1;
}
if (rc < 0)
break;
}
return rc;
}

80
json_patch.h Normal file
View File

@@ -0,0 +1,80 @@
/*
* Copyright (c) 2021 Alexadru Ardelean.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*
*/
/**
* @file
* @brief JSON Patch (RFC 6902) implementation for manipulating JSON objects
*/
#ifndef _json_patch_h_
#define _json_patch_h_
#include "json_pointer.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Details of an error that occurred during json_patch_apply()
*/
struct json_patch_error {
/**
* An errno value indicating what kind of error occurred.
* Possible values include:
* - ENOENT - A path referenced in the operation does not exist.
* - EINVAL - An invalid operation or with invalid path was attempted
* - ENOMEM - Unable to allocate memory
* - EFAULT - Invalid arguments were passed to json_patch_apply()
* (i.e. a C API error, vs. a data error like EINVAL)
*/
int errno_code;
/**
* The index into the patch array of the operation that failed,
* or SIZE_T_MAX for overall errors.
*/
size_t patch_failure_idx;
/**
* A human readable error message.
* Allocated from static storage, does not need to be freed.
*/
const char *errmsg;
};
/**
* Apply the JSON patch to the base object.
* The patch object must be formatted as per RFC 6902, i.e.
* a json_type_array containing patch operations.
* If the patch is not correctly formatted, an error will
* be returned.
*
* The json_object at *base will be modified in place.
* Exactly one of *base or copy_from must be non-NULL.
* If *base is NULL, a new copy of copy_from will allocated and populated
* using json_object_deep_copy(). In this case json_object_put() _must_ be
* used to free *base even if the overall patching operation fails.
*
* If anything fails during patching a negative value will be returned,
* and patch_error (if non-NULL) will be populated with error details.
*
* @param base a pointer to the JSON object which to patch
* @param patch the JSON object that describes the patch to be applied
* @param copy_from a JSON object to copy to *base
* @param patch_error optional, details about errors
*
* @return negative if an error (or not found), or 0 if patch completely applied
*/
JSON_EXPORT int json_patch_apply(struct json_object *copy_from, struct json_object *patch,
struct json_object **base, struct json_patch_error *patch_error);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -15,7 +15,9 @@
#include <stdlib.h>
#include <string.h>
#include "json_object_private.h"
#include "json_pointer.h"
#include "json_pointer_private.h"
#include "strdup_compat.h"
#include "vasprintf_compat.h"
@@ -29,8 +31,8 @@
static void string_replace_all_occurrences_with_char(char *s, const char *occur, char repl_char)
{
int slen = strlen(s);
int skip = strlen(occur) - 1; /* length of the occurrence, minus the char we're replacing */
size_t slen = strlen(s);
size_t skip = strlen(occur) - 1; /* length of the occurrence, minus the char we're replacing */
char *p = s;
while ((p = strstr(p, occur)))
{
@@ -41,9 +43,9 @@ static void string_replace_all_occurrences_with_char(char *s, const char *occur,
}
}
static int is_valid_index(struct json_object *jo, const char *path, int32_t *idx)
static int is_valid_index(const char *path, size_t *idx)
{
int i, len = strlen(path);
size_t i, len = strlen(path);
/* this code-path optimizes a bit, for when we reference the 0-9 index range
* in a JSON array and because leading zeros not allowed
*/
@@ -52,7 +54,7 @@ static int is_valid_index(struct json_object *jo, const char *path, int32_t *idx
if (is_plain_digit(path[0]))
{
*idx = (path[0] - '0');
goto check_oob;
return 1;
}
errno = EINVAL;
return 0;
@@ -73,32 +75,27 @@ static int is_valid_index(struct json_object *jo, const char *path, int32_t *idx
}
}
*idx = strtol(path, NULL, 10);
if (*idx < 0)
{
errno = EINVAL;
return 0;
}
check_oob:
len = json_object_array_length(jo);
if (*idx >= len)
{
errno = ENOENT;
return 0;
}
// We know it's all digits, so the only error case here is overflow,
// but ULLONG_MAX will be longer than any array length so that's ok.
*idx = strtoull(path, NULL, 10);
return 1;
}
static int json_pointer_get_single_path(struct json_object *obj, char *path,
struct json_object **value)
struct json_object **value, size_t *idx)
{
if (json_object_is_type(obj, json_type_array))
{
int32_t idx;
if (!is_valid_index(obj, path, &idx))
if (!is_valid_index(path, idx))
return -1;
obj = json_object_array_get_idx(obj, idx);
if (*idx >= json_object_array_length(obj))
{
errno = ENOENT;
return -1;
}
obj = json_object_array_get_idx(obj, *idx);
if (obj)
{
if (value)
@@ -123,18 +120,25 @@ static int json_pointer_get_single_path(struct json_object *obj, char *path,
return 0;
}
static int json_object_array_put_idx_cb(struct json_object *parent, size_t idx,
struct json_object *value, void *priv)
{
return json_object_array_put_idx(parent, idx, value);
}
static int json_pointer_set_single_path(struct json_object *parent, const char *path,
struct json_object *value)
struct json_object *value,
json_pointer_array_set_cb array_set_cb, void *priv)
{
if (json_object_is_type(parent, json_type_array))
{
int32_t idx;
size_t idx;
/* RFC (Chapter 4) states that '-' may be used to add new elements to an array */
if (path[0] == '-' && path[1] == '\0')
return json_object_array_add(parent, value);
if (!is_valid_index(parent, path, &idx))
if (!is_valid_index(path, &idx))
return -1;
return json_object_array_put_idx(parent, idx, value);
return array_set_cb(parent, idx, value, priv);
}
/* path replacements should have been done in json_pointer_get_single_path(),
@@ -150,9 +154,11 @@ static int json_pointer_set_single_path(struct json_object *parent, const char *
return -1;
}
static int json_pointer_get_recursive(struct json_object *obj, char *path,
struct json_object **value)
static int json_pointer_result_get_recursive(struct json_object *obj, char *path,
struct json_pointer_get_result *res)
{
struct json_object *parent_obj = obj;
size_t idx;
char *endp;
int rc;
@@ -169,24 +175,47 @@ static int json_pointer_get_recursive(struct json_object *obj, char *path,
*endp = '\0';
/* If we err-ed here, return here */
if ((rc = json_pointer_get_single_path(obj, path, &obj)))
if ((rc = json_pointer_get_single_path(obj, path, &obj, &idx)))
return rc;
if (endp)
{
/* Put the slash back, so that the sanity check passes on next recursion level */
*endp = '/';
return json_pointer_get_recursive(obj, endp, value);
return json_pointer_result_get_recursive(obj, endp, res);
}
/* We should be at the end of the recursion here */
if (value)
*value = obj;
if (res) {
res->parent = parent_obj;
res->obj = obj;
if (json_object_is_type(res->parent, json_type_array))
res->index_in_parent = idx;
else
res->key_in_parent = path;
}
return 0;
}
int json_pointer_get(struct json_object *obj, const char *path, struct json_object **res)
static int json_pointer_object_get_recursive(struct json_object *obj, char *path,
struct json_object **value)
{
struct json_pointer_get_result res;
int rc;
rc = json_pointer_result_get_recursive(obj, path, &res);
if (rc)
return rc;
if (value)
*value = res.obj;
return 0;
}
int json_pointer_get_internal(struct json_object *obj, const char *path,
struct json_pointer_get_result *res)
{
char *path_copy = NULL;
int rc;
@@ -199,8 +228,10 @@ int json_pointer_get(struct json_object *obj, const char *path, struct json_obje
if (path[0] == '\0')
{
if (res)
*res = obj;
res->parent = NULL;
res->obj = obj;
res->key_in_parent = NULL;
res->index_in_parent = -1;
return 0;
}
@@ -210,12 +241,30 @@ int json_pointer_get(struct json_object *obj, const char *path, struct json_obje
errno = ENOMEM;
return -1;
}
rc = json_pointer_get_recursive(obj, path_copy, res);
rc = json_pointer_result_get_recursive(obj, path_copy, res);
/* re-map the path string to the const-path string */
if (rc == 0 && json_object_is_type(res->parent, json_type_object) && res->key_in_parent)
res->key_in_parent = path + (res->key_in_parent - path_copy);
free(path_copy);
return rc;
}
int json_pointer_get(struct json_object *obj, const char *path, struct json_object **res)
{
struct json_pointer_get_result jpres;
int rc;
rc = json_pointer_get_internal(obj, path, &jpres);
if (rc)
return rc;
if (res)
*res = jpres.obj;
return 0;
}
int json_pointer_getf(struct json_object *obj, struct json_object **res, const char *path_fmt, ...)
{
char *path_copy = NULL;
@@ -242,14 +291,16 @@ int json_pointer_getf(struct json_object *obj, struct json_object **res, const c
goto out;
}
rc = json_pointer_get_recursive(obj, path_copy, res);
rc = json_pointer_object_get_recursive(obj, path_copy, res);
out:
free(path_copy);
return rc;
}
int json_pointer_set(struct json_object **obj, const char *path, struct json_object *value)
int json_pointer_set_with_array_cb(struct json_object **obj, const char *path,
struct json_object *value,
json_pointer_array_set_cb array_set_cb, void *priv)
{
const char *endp;
char *path_copy = NULL;
@@ -279,7 +330,7 @@ int json_pointer_set(struct json_object **obj, const char *path, struct json_obj
if ((endp = strrchr(path, '/')) == path)
{
path++;
return json_pointer_set_single_path(*obj, path, value);
return json_pointer_set_single_path(*obj, path, value, array_set_cb, priv);
}
/* pass a working copy to the recursive call */
@@ -289,14 +340,19 @@ int json_pointer_set(struct json_object **obj, const char *path, struct json_obj
return -1;
}
path_copy[endp - path] = '\0';
rc = json_pointer_get_recursive(*obj, path_copy, &set);
rc = json_pointer_object_get_recursive(*obj, path_copy, &set);
free(path_copy);
if (rc)
return rc;
endp++;
return json_pointer_set_single_path(set, endp, value);
return json_pointer_set_single_path(set, endp, value, array_set_cb, priv);
}
int json_pointer_set(struct json_object **obj, const char *path, struct json_object *value)
{
return json_pointer_set_with_array_cb(obj, path, value, json_object_array_put_idx_cb, NULL);
}
int json_pointer_setf(struct json_object **obj, struct json_object *value, const char *path_fmt,
@@ -344,14 +400,15 @@ int json_pointer_setf(struct json_object **obj, struct json_object *value, const
}
*endp = '\0';
rc = json_pointer_get_recursive(*obj, path_copy, &set);
rc = json_pointer_object_get_recursive(*obj, path_copy, &set);
if (rc)
goto out;
set_single_path:
endp++;
rc = json_pointer_set_single_path(set, endp, value);
rc = json_pointer_set_single_path(set, endp, value,
json_object_array_put_idx_cb, NULL);
out:
free(path_copy);
return rc;

View File

@@ -32,11 +32,6 @@ extern "C" {
* Internally, this is equivalent to doing a series of 'json_object_object_get()'
* and 'json_object_array_get_idx()' along the given 'path'.
*
* Note that the 'path' string supports 'printf()' type arguments, so, whatever
* is added after the 'res' param will be treated as an argument for 'path'
* Example: json_pointer_get(obj, "/foo/%d/%s", &res, 0, bar)
* This means, that you need to escape '%' with '%%' (just like in printf())
*
* @param obj the json_object instance/tree from where to retrieve sub-objects
* @param path a (RFC6901) string notation for the sub-object to retrieve
* @param res a pointer that stores a reference to the json_object
@@ -50,7 +45,9 @@ JSON_EXPORT int json_pointer_get(struct json_object *obj, const char *path,
/**
* This is a variant of 'json_pointer_get()' that supports printf() style arguments.
*
* Example: json_pointer_getf(obj, res, "/foo/%d/%s", 0, bak)
* Variable arguments go after the 'path_fmt' parameter.
*
* Example: json_pointer_getf(obj, res, "/foo/%d/%s", 0, "bar")
* This also means that you need to escape '%' with '%%' (just like in printf())
*
* Please take into consideration all recommended 'printf()' format security
@@ -84,11 +81,6 @@ JSON_EXPORT int json_pointer_getf(struct json_object *obj, struct json_object **
* That also implies that 'json_pointer_set()' does not do any refcount incrementing.
* (Just that single decrement that was mentioned above).
*
* Note that the 'path' string supports 'printf()' type arguments, so, whatever
* is added after the 'value' param will be treated as an argument for 'path'
* Example: json_pointer_set(obj, "/foo/%d/%s", value, 0, bak)
* This means, that you need to escape '%' with '%%' (just like in printf())
*
* @param obj the json_object instance/tree to which to add a sub-object
* @param path a (RFC6901) string notation for the sub-object to set in the tree
* @param value object to set at path
@@ -101,7 +93,9 @@ JSON_EXPORT int json_pointer_set(struct json_object **obj, const char *path,
/**
* This is a variant of 'json_pointer_set()' that supports printf() style arguments.
*
* Example: json_pointer_setf(obj, value, "/foo/%d/%s", 0, bak)
* Variable arguments go after the 'path_fmt' parameter.
*
* Example: json_pointer_setf(obj, value, "/foo/%d/%s", 0, "bar")
* This also means that you need to escape '%' with '%%' (just like in printf())
*
* Please take into consideration all recommended 'printf()' format security

43
json_pointer_private.h Normal file
View File

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2023 Eric Hawicz
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*/
/**
* @file
* @brief Do not use, json-c internal, may be changed or removed at any time.
*/
#ifndef _json_pointer_private_h_
#define _json_pointer_private_h_
#ifdef __cplusplus
extern "C" {
#endif
struct json_pointer_get_result {
struct json_object *parent;
struct json_object *obj;
// The key of the found object; only valid when parent is json_type_object
// Caution: re-uses tail end of the `path` argument to json_pointer_get_internal
const char *key_in_parent;
// the index of the found object; only valid when parent is json_type_array
uint32_t index_in_parent;
};
int json_pointer_get_internal(struct json_object *obj, const char *path,
struct json_pointer_get_result *res);
typedef int(*json_pointer_array_set_cb)(json_object *parent, size_t idx,
json_object *value, void *priv);
int json_pointer_set_with_array_cb(struct json_object **obj, const char *path,
struct json_object *value,
json_pointer_array_set_cb array_set_cb, void *priv);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -17,6 +17,7 @@
#include "math_compat.h"
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stddef.h>
@@ -115,7 +116,8 @@ static const char *json_tokener_errors[] = {
"invalid string sequence",
"expected comment",
"invalid utf-8 string",
"buffer size overflow"
"buffer size overflow",
"out of memory"
};
/* clang-format on */
@@ -284,11 +286,24 @@ struct json_object *json_tokener_parse_verbose(const char *str, enum json_tokene
/* ADVANCE_CHAR() macro:
* Increments str & tok->char_offset.
* For convenience of existing conditionals, returns the old value of c (0 on eof)
* For convenience of existing conditionals, returns the old value of c (0 on eof).
* Implicit inputs: c var
*/
#define ADVANCE_CHAR(str, tok) (++(str), ((tok)->char_offset)++, c)
/* printbuf_memappend_checked(p, s, l) macro:
* Add string s of length l to printbuffer p.
* If operation fails abort parse operation with memory error.
*/
#define printbuf_memappend_checked(p, s, l) \
do { \
if (printbuf_memappend((p), (s), (l)) < 0) \
{ \
tok->err = json_tokener_error_memory; \
goto out; \
} \
} while (0)
/* End optimization macro defs */
struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *str, int len)
@@ -329,6 +344,11 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
freelocale(duploc);
return NULL;
}
#ifdef NEWLOCALE_NEEDS_FREELOCALE
// Older versions of FreeBSD (<12.4) don't free the locale
// passed to newlocale(), so do it here
freelocale(duploc);
#endif
uselocale(newloc);
}
#elif defined(HAVE_SETLOCALE)
@@ -336,7 +356,11 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
char *tmplocale;
tmplocale = setlocale(LC_NUMERIC, NULL);
if (tmplocale)
{
oldlocale = strdup(tmplocale);
if (oldlocale == NULL)
return NULL;
}
setlocale(LC_NUMERIC, "C");
}
#endif
@@ -358,7 +382,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
if (c == '/' && !(tok->flags & JSON_TOKENER_STRICT))
{
printbuf_reset(tok->pb);
printbuf_memappend_fast(tok->pb, &c, 1);
printbuf_memappend_checked(tok->pb, &c, 1);
state = json_tokener_state_comment_start;
}
else
@@ -376,14 +400,20 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
saved_state = json_tokener_state_object_field_start;
current = json_object_new_object();
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
break;
case '[':
state = json_tokener_state_eatws;
saved_state = json_tokener_state_array;
current = json_object_new_array();
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
break;
case 'I':
case 'i':
@@ -486,7 +516,10 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
}
current = json_object_new_double(is_negative ? -INFINITY : INFINITY);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
saved_state = json_tokener_state_finish;
state = json_tokener_state_eatws;
goto redo_char;
@@ -496,7 +529,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
int size;
int size_nan;
printbuf_memappend_fast(tok->pb, &c, 1);
printbuf_memappend_checked(tok->pb, &c, 1);
size = json_min(tok->st_pos + 1, json_null_str_len);
size_nan = json_min(tok->st_pos + 1, json_nan_str_len);
if ((!(tok->flags & JSON_TOKENER_STRICT) &&
@@ -519,7 +552,10 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
current = json_object_new_double(NAN);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
saved_state = json_tokener_state_finish;
state = json_tokener_state_eatws;
goto redo_char;
@@ -548,7 +584,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
tok->err = json_tokener_error_parse_comment;
goto out;
}
printbuf_memappend_fast(tok->pb, &c, 1);
printbuf_memappend_checked(tok->pb, &c, 1);
break;
case json_tokener_state_comment:
@@ -559,12 +595,12 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
if (!ADVANCE_CHAR(str, tok) || !PEEK_CHAR(c, tok))
{
printbuf_memappend_fast(tok->pb, case_start,
str - case_start);
printbuf_memappend_checked(tok->pb, case_start,
str - case_start);
goto out;
}
}
printbuf_memappend_fast(tok->pb, case_start, 1 + str - case_start);
printbuf_memappend_checked(tok->pb, case_start, 1 + str - case_start);
state = json_tokener_state_comment_end;
}
break;
@@ -577,19 +613,19 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
if (!ADVANCE_CHAR(str, tok) || !PEEK_CHAR(c, tok))
{
printbuf_memappend_fast(tok->pb, case_start,
str - case_start);
printbuf_memappend_checked(tok->pb, case_start,
str - case_start);
goto out;
}
}
printbuf_memappend_fast(tok->pb, case_start, str - case_start);
printbuf_memappend_checked(tok->pb, case_start, str - case_start);
MC_DEBUG("json_tokener_comment: %s\n", tok->pb->buf);
state = json_tokener_state_eatws;
}
break;
case json_tokener_state_comment_end:
printbuf_memappend_fast(tok->pb, &c, 1);
printbuf_memappend_checked(tok->pb, &c, 1);
if (c == '/')
{
MC_DEBUG("json_tokener_comment: %s\n", tok->pb->buf);
@@ -609,28 +645,31 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
if (c == tok->quote_char)
{
printbuf_memappend_fast(tok->pb, case_start,
str - case_start);
printbuf_memappend_checked(tok->pb, case_start,
str - case_start);
current =
json_object_new_string_len(tok->pb->buf, tok->pb->bpos);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
saved_state = json_tokener_state_finish;
state = json_tokener_state_eatws;
break;
}
else if (c == '\\')
{
printbuf_memappend_fast(tok->pb, case_start,
str - case_start);
printbuf_memappend_checked(tok->pb, case_start,
str - case_start);
saved_state = json_tokener_state_string;
state = json_tokener_state_string_escape;
break;
}
if (!ADVANCE_CHAR(str, tok) || !PEEK_CHAR(c, tok))
{
printbuf_memappend_fast(tok->pb, case_start,
str - case_start);
printbuf_memappend_checked(tok->pb, case_start,
str - case_start);
goto out;
}
}
@@ -643,7 +682,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
case '"':
case '\\':
case '/':
printbuf_memappend_fast(tok->pb, &c, 1);
printbuf_memappend_checked(tok->pb, &c, 1);
state = saved_state;
break;
case 'b':
@@ -652,15 +691,15 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
case 't':
case 'f':
if (c == 'b')
printbuf_memappend_fast(tok->pb, "\b", 1);
printbuf_memappend_checked(tok->pb, "\b", 1);
else if (c == 'n')
printbuf_memappend_fast(tok->pb, "\n", 1);
printbuf_memappend_checked(tok->pb, "\n", 1);
else if (c == 'r')
printbuf_memappend_fast(tok->pb, "\r", 1);
printbuf_memappend_checked(tok->pb, "\r", 1);
else if (c == 't')
printbuf_memappend_fast(tok->pb, "\t", 1);
printbuf_memappend_checked(tok->pb, "\t", 1);
else if (c == 'f')
printbuf_memappend_fast(tok->pb, "\f", 1);
printbuf_memappend_checked(tok->pb, "\f", 1);
state = saved_state;
break;
case 'u':
@@ -720,8 +759,8 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
/* High surrogate was not followed by a low surrogate
* Replace the high and process the rest normally
*/
printbuf_memappend_fast(tok->pb,
(char *)utf8_replacement_char, 3);
printbuf_memappend_checked(tok->pb,
(char *)utf8_replacement_char, 3);
}
tok->high_surrogate = 0;
}
@@ -730,14 +769,14 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
unsigned char unescaped_utf[1];
unescaped_utf[0] = tok->ucs_char;
printbuf_memappend_fast(tok->pb, (char *)unescaped_utf, 1);
printbuf_memappend_checked(tok->pb, (char *)unescaped_utf, 1);
}
else if (tok->ucs_char < 0x800)
{
unsigned char unescaped_utf[2];
unescaped_utf[0] = 0xc0 | (tok->ucs_char >> 6);
unescaped_utf[1] = 0x80 | (tok->ucs_char & 0x3f);
printbuf_memappend_fast(tok->pb, (char *)unescaped_utf, 2);
printbuf_memappend_checked(tok->pb, (char *)unescaped_utf, 2);
}
else if (IS_HIGH_SURROGATE(tok->ucs_char))
{
@@ -763,7 +802,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
else if (IS_LOW_SURROGATE(tok->ucs_char))
{
/* Got a low surrogate not preceded by a high */
printbuf_memappend_fast(tok->pb, (char *)utf8_replacement_char, 3);
printbuf_memappend_checked(tok->pb, (char *)utf8_replacement_char, 3);
}
else if (tok->ucs_char < 0x10000)
{
@@ -771,7 +810,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
unescaped_utf[0] = 0xe0 | (tok->ucs_char >> 12);
unescaped_utf[1] = 0x80 | ((tok->ucs_char >> 6) & 0x3f);
unescaped_utf[2] = 0x80 | (tok->ucs_char & 0x3f);
printbuf_memappend_fast(tok->pb, (char *)unescaped_utf, 3);
printbuf_memappend_checked(tok->pb, (char *)unescaped_utf, 3);
}
else if (tok->ucs_char < 0x110000)
{
@@ -780,12 +819,12 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
unescaped_utf[1] = 0x80 | ((tok->ucs_char >> 12) & 0x3f);
unescaped_utf[2] = 0x80 | ((tok->ucs_char >> 6) & 0x3f);
unescaped_utf[3] = 0x80 | (tok->ucs_char & 0x3f);
printbuf_memappend_fast(tok->pb, (char *)unescaped_utf, 4);
printbuf_memappend_checked(tok->pb, (char *)unescaped_utf, 4);
}
else
{
/* Don't know what we got--insert the replacement char */
printbuf_memappend_fast(tok->pb, (char *)utf8_replacement_char, 3);
printbuf_memappend_checked(tok->pb, (char *)utf8_replacement_char, 3);
}
state = saved_state; // i.e. _state_string or _state_object_field
}
@@ -800,7 +839,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
* it. Put a replacement char in for the high surrogate
* and pop back up to _state_string or _state_object_field.
*/
printbuf_memappend_fast(tok->pb, (char *)utf8_replacement_char, 3);
printbuf_memappend_checked(tok->pb, (char *)utf8_replacement_char, 3);
tok->high_surrogate = 0;
tok->ucs_char = 0;
tok->st_pos = 0;
@@ -819,7 +858,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
* Put a replacement char in for the high surrogate
* and handle the escape sequence normally.
*/
printbuf_memappend_fast(tok->pb, (char *)utf8_replacement_char, 3);
printbuf_memappend_checked(tok->pb, (char *)utf8_replacement_char, 3);
tok->high_surrogate = 0;
tok->ucs_char = 0;
tok->st_pos = 0;
@@ -834,7 +873,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
case json_tokener_state_boolean:
{
int size1, size2;
printbuf_memappend_fast(tok->pb, &c, 1);
printbuf_memappend_checked(tok->pb, &c, 1);
size1 = json_min(tok->st_pos + 1, json_true_str_len);
size2 = json_min(tok->st_pos + 1, json_false_str_len);
if ((!(tok->flags & JSON_TOKENER_STRICT) &&
@@ -845,7 +884,10 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
current = json_object_new_boolean(1);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
saved_state = json_tokener_state_finish;
state = json_tokener_state_eatws;
goto redo_char;
@@ -859,7 +901,10 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
current = json_object_new_boolean(0);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
saved_state = json_tokener_state_finish;
state = json_tokener_state_eatws;
goto redo_char;
@@ -939,7 +984,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
if (!ADVANCE_CHAR(str, tok) || !PEEK_CHAR(c, tok))
{
printbuf_memappend_fast(tok->pb, case_start, case_len);
printbuf_memappend_checked(tok->pb, case_start, case_len);
goto out;
}
}
@@ -948,7 +993,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
it might have been intended to be, and return a potentially
more understandable error right away.
However, if we're at the top-level, use the number as-is
because c can be part of a new object to parse on the
because c can be part of a new object to parse on the
next call to json_tokener_parse().
*/
if (tok->depth > 0 && c != ',' && c != ']' && c != '}' && c != '/' &&
@@ -958,7 +1003,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
goto out;
}
if (case_len > 0)
printbuf_memappend_fast(tok->pb, case_start, case_len);
printbuf_memappend_checked(tok->pb, case_start, case_len);
// Check for -Infinity
if (tok->pb->buf[0] == '-' && case_len <= 1 && (c == 'i' || c == 'I'))
@@ -991,13 +1036,26 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
if (!tok->is_double && tok->pb->buf[0] == '-' &&
json_parse_int64(tok->pb->buf, &num64) == 0)
{
if (errno == ERANGE && (tok->flags & JSON_TOKENER_STRICT))
{
tok->err = json_tokener_error_parse_number;
goto out;
}
current = json_object_new_int64(num64);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
}
else if (!tok->is_double && tok->pb->buf[0] != '-' &&
json_parse_uint64(tok->pb->buf, &numuint64) == 0)
{
if (errno == ERANGE && (tok->flags & JSON_TOKENER_STRICT))
{
tok->err = json_tokener_error_parse_number;
goto out;
}
if (numuint64 && tok->pb->buf[0] == '0' &&
(tok->flags & JSON_TOKENER_STRICT))
{
@@ -1009,13 +1067,19 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
num64 = (uint64_t)numuint64;
current = json_object_new_int64(num64);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
}
else
{
current = json_object_new_uint64(numuint64);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
}
}
else if (tok->is_double &&
@@ -1024,7 +1088,10 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
current = json_object_new_double_s(numd, tok->pb->buf);
if (current == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
}
else
{
@@ -1069,7 +1136,10 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
case json_tokener_state_array_add:
if (json_object_array_add(current, obj) != 0)
{
tok->err = json_tokener_error_memory;
goto out;
}
saved_state = json_tokener_state_array_sep;
state = json_tokener_state_eatws;
goto redo_char;
@@ -1129,25 +1199,30 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
{
if (c == tok->quote_char)
{
printbuf_memappend_fast(tok->pb, case_start,
str - case_start);
printbuf_memappend_checked(tok->pb, case_start,
str - case_start);
obj_field_name = strdup(tok->pb->buf);
if (obj_field_name == NULL)
{
tok->err = json_tokener_error_memory;
goto out;
}
saved_state = json_tokener_state_object_field_end;
state = json_tokener_state_eatws;
break;
}
else if (c == '\\')
{
printbuf_memappend_fast(tok->pb, case_start,
str - case_start);
printbuf_memappend_checked(tok->pb, case_start,
str - case_start);
saved_state = json_tokener_state_object_field;
state = json_tokener_state_string_escape;
break;
}
if (!ADVANCE_CHAR(str, tok) || !PEEK_CHAR(c, tok))
{
printbuf_memappend_fast(tok->pb, case_start,
str - case_start);
printbuf_memappend_checked(tok->pb, case_start,
str - case_start);
goto out;
}
}

View File

@@ -40,6 +40,7 @@ enum json_tokener_error
json_tokener_error_parse_string,
json_tokener_error_parse_comment,
json_tokener_error_parse_utf8_string,
json_tokener_error_memory,
json_tokener_error_size
};

View File

@@ -60,7 +60,7 @@ static int _json_object_to_fd(int fd, struct json_object *obj, int flags, const
static char _last_err[256] = "";
const char *json_util_get_last_err()
const char *json_util_get_last_err(void)
{
if (_last_err[0] == '\0')
return NULL;
@@ -85,7 +85,7 @@ struct json_object *json_object_from_fd_ex(int fd, int in_depth)
struct printbuf *pb;
struct json_object *obj;
char buf[JSON_FILE_BUF_SIZE];
int ret;
ssize_t ret;
int depth = JSON_TOKENER_DEFAULT_DEPTH;
json_tokener *tok;
@@ -101,15 +101,25 @@ struct json_object *json_object_from_fd_ex(int fd, int in_depth)
if (!tok)
{
_json_c_set_last_err(
"json_object_from_fd_ex: unable to allocate json_tokener(depth=%d): %s\n", depth,
strerror(errno));
"json_object_from_fd_ex: unable to allocate json_tokener(depth=%d): %s\n",
depth, strerror(errno));
printbuf_free(pb);
return NULL;
}
while ((ret = read(fd, buf, JSON_FILE_BUF_SIZE)) > 0)
while ((ret = read(fd, buf, sizeof(buf))) > 0)
{
printbuf_memappend(pb, buf, ret);
if (printbuf_memappend(pb, buf, ret) < 0)
{
#if JSON_FILE_BUF_SIZE > INT_MAX
#error "Can't append more than INT_MAX bytes at a time"
#endif
_json_c_set_last_err(
"json_object_from_fd_ex: failed to printbuf_memappend after reading %d+%d bytes: %s", printbuf_length(pb), (int)ret, strerror(errno));
json_tokener_free(tok);
printbuf_free(pb);
return NULL;
}
}
if (ret < 0)
{
@@ -184,9 +194,9 @@ int json_object_to_fd(int fd, struct json_object *obj, int flags)
}
static int _json_object_to_fd(int fd, struct json_object *obj, int flags, const char *filename)
{
int ret;
ssize_t ret;
const char *json_str;
unsigned int wpos, wsize;
size_t wpos, wsize;
filename = filename ? filename : "(fd)";
@@ -195,8 +205,7 @@ static int _json_object_to_fd(int fd, struct json_object *obj, int flags, const
return -1;
}
/* CAW: probably unnecessary, but the most 64bit safe */
wsize = (unsigned int)(strlen(json_str) & UINT_MAX);
wsize = strlen(json_str);
wpos = 0;
while (wpos < wsize)
{
@@ -208,7 +217,7 @@ static int _json_object_to_fd(int fd, struct json_object *obj, int flags, const
}
/* because of the above check for ret < 0, we can safely cast and add */
wpos += (unsigned int)ret;
wpos += (size_t)ret;
}
return 0;
@@ -238,7 +247,12 @@ int json_parse_int64(const char *buf, int64_t *retval)
val = strtoll(buf, &end, 10);
if (end != buf)
*retval = val;
return ((val == 0 && errno != 0) || (end == buf)) ? 1 : 0;
if ((val == 0 && errno != 0) || (end == buf))
{
errno = EINVAL;
return 1;
}
return 0;
}
int json_parse_uint64(const char *buf, uint64_t *retval)
@@ -255,7 +269,12 @@ int json_parse_uint64(const char *buf, uint64_t *retval)
val = strtoull(buf, &end, 10);
if (end != buf)
*retval = val;
return ((val == 0 && errno != 0) || (end == buf)) ? 1 : 0;
if ((val == 0 && errno != 0) || (end == buf))
{
errno = EINVAL;
return 1;
}
return 0;
}
#ifndef HAVE_REALLOC

View File

@@ -100,8 +100,17 @@ JSON_EXPORT int json_object_to_fd(int fd, struct json_object *obj, int flags);
*/
JSON_EXPORT const char *json_util_get_last_err(void);
/* these parsing helpers return zero on success */
/**
* A parsing helper for integer values. Returns 0 on success,
* with the parsed value assigned to *retval. Overflow/underflow
* are NOT considered errors, but errno will be set to ERANGE,
* just like the strtol/strtoll functions do.
*/
JSON_EXPORT int json_parse_int64(const char *buf, int64_t *retval);
/**
* A parsing help for integer values, providing one extra bit of
* magnitude beyond json_parse_int64().
*/
JSON_EXPORT int json_parse_uint64(const char *buf, uint64_t *retval);
/**
* @deprecated

View File

@@ -15,6 +15,7 @@
#include "config.h"
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@@ -56,6 +57,8 @@ struct printbuf *printbuf_new(void)
*
* If the current size is large enough, nothing is changed.
*
* If extension failed, errno is set to indicate the error.
*
* Note: this does not check the available space! The caller
* is responsible for performing those calculations.
*/
@@ -68,7 +71,10 @@ static int printbuf_extend(struct printbuf *p, int min_size)
return 0;
/* Prevent signed integer overflows with large buffers. */
if (min_size > INT_MAX - 8)
{
errno = EFBIG;
return -1;
}
if (p->size > INT_MAX / 2)
new_size = min_size + 8;
else {
@@ -77,7 +83,7 @@ static int printbuf_extend(struct printbuf *p, int min_size)
new_size = min_size + 8;
}
#ifdef PRINTBUF_DEBUG
MC_DEBUG("printbuf_memappend: realloc "
MC_DEBUG("printbuf_extend: realloc "
"bpos=%d min_size=%d old_size=%d new_size=%d\n",
p->bpos, min_size, p->size, new_size);
#endif /* PRINTBUF_DEBUG */
@@ -92,7 +98,10 @@ int printbuf_memappend(struct printbuf *p, const char *buf, int size)
{
/* Prevent signed integer overflows with large buffers. */
if (size < 0 || size > INT_MAX - p->bpos - 1)
{
errno = EFBIG;
return -1;
}
if (p->size <= p->bpos + size + 1)
{
if (printbuf_extend(p, p->bpos + size + 1) < 0)
@@ -112,7 +121,10 @@ int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len)
offset = pb->bpos;
/* Prevent signed integer overflows with large buffers. */
if (len < 0 || offset < -1 || len > INT_MAX - offset)
{
errno = EFBIG;
return -1;
}
size_needed = offset + len;
if (pb->size < size_needed)
{

View File

@@ -310,6 +310,7 @@ static int get_time_seed(void)
{
DEBUG_SEED("get_time_seed");
/* coverity[store_truncates_time_t] */
return (unsigned)time(NULL) * 433494437;
}
#endif

View File

@@ -35,7 +35,7 @@ static int json_c_snprintf(char *str, size_t size, const char *format, ...)
#define snprintf json_c_snprintf
#elif !defined(HAVE_SNPRINTF) /* !HAVE_SNPRINTF */
#error Need vsnprintf!
#error snprintf is required but was not found
#endif /* !HAVE_SNPRINTF && defined(WIN32) */
#endif /* __snprintf_compat_h */

View File

@@ -1,14 +0,0 @@
#ifndef __json_strerror_override_private_h__
#define __json_strerror_override_private_h__
/**
* @file
* @brief Do not use, json-c internal, may be changed or removed at any time.
*/
#include "json_types.h"
/* Used by tests to get consistent output */
JSON_EXPORT int _json_c_strerror_enable;
#endif

View File

@@ -24,6 +24,7 @@ set(ALL_TEST_NAMES
test_double_serializer
test_float
test_int_add
test_int_get
test_locale
test_null
test_parse
@@ -38,15 +39,14 @@ set(ALL_TEST_NAMES
if (NOT DISABLE_JSON_POINTER)
set(ALL_TEST_NAMES ${ALL_TEST_NAMES} test_json_pointer)
if (NOT DISABLE_JSON_PATCH)
set(ALL_TEST_NAMES ${ALL_TEST_NAMES} test_json_patch)
endif()
endif()
foreach(TESTNAME ${ALL_TEST_NAMES})
add_executable(${TESTNAME} ${TESTNAME}.c)
if(${TESTNAME} STREQUAL test_strerror OR ${TESTNAME} STREQUAL test_util_file)
# For output consistency, we need _json_c_strerror() in some tests:
target_sources(${TESTNAME} PRIVATE ../strerror_override.c)
endif()
add_test(NAME ${TESTNAME} COMMAND ${PROJECT_SOURCE_DIR}/tests/${TESTNAME}.test)
# XXX using the non-target_ versions of these doesn't work :(

View File

@@ -0,0 +1,233 @@
[
{
"comment": "4.1. add with missing object",
"doc": { "q": { "bar": 2 } },
"patch": [ {"op": "add", "path": "/a/b", "value": 1} ],
"error":
"path /a does not exist -- missing objects are not created recursively"
},
{
"comment": "A.1. Adding an Object Member",
"doc": {
"foo": "bar"
},
"patch": [
{ "op": "add", "path": "/baz", "value": "qux" }
],
"expected": {
"baz": "qux",
"foo": "bar"
}
},
{
"comment": "A.2. Adding an Array Element",
"doc": {
"foo": [ "bar", "baz" ]
},
"patch": [
{ "op": "add", "path": "/foo/1", "value": "qux" }
],
"expected": {
"foo": [ "bar", "qux", "baz" ]
}
},
{
"comment": "A.3. Removing an Object Member",
"doc": {
"baz": "qux",
"foo": "bar"
},
"patch": [
{ "op": "remove", "path": "/baz" }
],
"expected": {
"foo": "bar"
}
},
{
"comment": "A.4. Removing an Array Element",
"doc": {
"foo": [ "bar", "qux", "baz" ]
},
"patch": [
{ "op": "remove", "path": "/foo/1" }
],
"expected": {
"foo": [ "bar", "baz" ]
}
},
{
"comment": "A.5. Replacing a Value",
"doc": {
"baz": "qux",
"foo": "bar"
},
"patch": [
{ "op": "replace", "path": "/baz", "value": "boo" }
],
"expected": {
"baz": "boo",
"foo": "bar"
}
},
{
"comment": "A.6. Moving a Value",
"doc": {
"foo": {
"bar": "baz",
"waldo": "fred"
},
"qux": {
"corge": "grault"
}
},
"patch": [
{ "op": "move", "from": "/foo/waldo", "path": "/qux/thud" }
],
"expected": {
"foo": {
"bar": "baz"
},
"qux": {
"corge": "grault",
"thud": "fred"
}
}
},
{
"comment": "A.7. Moving an Array Element",
"doc": {
"foo": [ "all", "grass", "cows", "eat" ]
},
"patch": [
{ "op": "move", "from": "/foo/1", "path": "/foo/3" }
],
"expected": {
"foo": [ "all", "cows", "eat", "grass" ]
}
},
{
"comment": "A.8. Testing a Value: Success",
"doc": {
"baz": "qux",
"foo": [ "a", 2, "c" ]
},
"patch": [
{ "op": "test", "path": "/baz", "value": "qux" },
{ "op": "test", "path": "/foo/1", "value": 2 }
],
"expected": {
"baz": "qux",
"foo": [ "a", 2, "c" ]
}
},
{
"comment": "A.9. Testing a Value: Error",
"doc": {
"baz": "qux"
},
"patch": [
{ "op": "test", "path": "/baz", "value": "bar" }
],
"error": "string not equivalent"
},
{
"comment": "A.10. Adding a nested Member Object",
"doc": {
"foo": "bar"
},
"patch": [
{ "op": "add", "path": "/child", "value": { "grandchild": { } } }
],
"expected": {
"foo": "bar",
"child": {
"grandchild": {
}
}
}
},
{
"comment": "A.11. Ignoring Unrecognized Elements",
"doc": {
"foo":"bar"
},
"patch": [
{ "op": "add", "path": "/baz", "value": "qux", "xyz": 123 }
],
"expected": {
"foo":"bar",
"baz":"qux"
}
},
{
"comment": "A.12. Adding to a Non-existent Target",
"doc": {
"foo": "bar"
},
"patch": [
{ "op": "add", "path": "/baz/bat", "value": "qux" }
],
"error": "add to a non-existent target"
},
{
"comment": "A.13 Invalid JSON Patch Document",
"doc": {
"foo": "bar"
},
"patch": [
{ "op": "add", "path": "/baz", "value": "qux", "op": "remove" }
],
"error_wont_happen_in_jsonc": "operation has two 'op' members",
"error": "Did not find element referenced by path field"
},
{
"comment": "A.14. ~ Escape Ordering",
"doc": {
"/": 9,
"~1": 10
},
"patch": [{"op": "test", "path": "/~01", "value": 10}],
"expected": {
"/": 9,
"~1": 10
}
},
{
"comment": "A.15. Comparing Strings and Numbers",
"doc": {
"/": 9,
"~1": 10
},
"patch": [{"op": "test", "path": "/~01", "value": "10"}],
"error": "number is not equal to string"
},
{
"comment": "A.16. Adding an Array Value",
"doc": {
"foo": ["bar"]
},
"patch": [{ "op": "add", "path": "/foo/-", "value": ["abc", "def"] }],
"expected": {
"foo": ["bar", ["abc", "def"]]
}
}
]

540
tests/json_patch_tests.json Normal file
View File

@@ -0,0 +1,540 @@
[
{ "comment": "empty list, empty docs",
"doc": {},
"patch": [],
"expected": {} },
{ "comment": "empty patch list",
"doc": {"foo": 1},
"patch": [],
"expected": {"foo": 1} },
{ "comment": "rearrangements OK?",
"doc": {"foo": 1, "bar": 2},
"patch": [],
"expected": {"bar":2, "foo": 1} },
{ "comment": "rearrangements OK? How about one level down ... array",
"doc": [{"foo": 1, "bar": 2}],
"patch": [],
"expected": [{"bar":2, "foo": 1}] },
{ "comment": "rearrangements OK? How about one level down...",
"doc": {"foo":{"foo": 1, "bar": 2}},
"patch": [],
"expected": {"foo":{"bar":2, "foo": 1}} },
{ "comment": "add replaces any existing field",
"doc": {"foo": null},
"patch": [{"op": "add", "path": "/foo", "value":1}],
"expected": {"foo": 1} },
{ "comment": "toplevel array",
"doc": [],
"patch": [{"op": "add", "path": "/0", "value": "foo"}],
"expected": ["foo"] },
{ "comment": "toplevel array, no change",
"doc": ["foo"],
"patch": [],
"expected": ["foo"] },
{ "comment": "toplevel object, numeric string",
"doc": {},
"patch": [{"op": "add", "path": "/foo", "value": "1"}],
"expected": {"foo":"1"} },
{ "comment": "toplevel object, integer",
"doc": {},
"patch": [{"op": "add", "path": "/foo", "value": 1}],
"expected": {"foo":1} },
{ "comment": "Toplevel scalar values OK?",
"doc": "foo",
"patch": [{"op": "replace", "path": "", "value": "bar"}],
"expected": "bar"
},
{ "comment": "replace object document with array document?",
"doc": {},
"patch": [{"op": "add", "path": "", "value": []}],
"expected": [] },
{ "comment": "replace array document with object document?",
"doc": [],
"patch": [{"op": "add", "path": "", "value": {}}],
"expected": {} },
{ "comment": "append to root array document?",
"doc": [],
"patch": [{"op": "add", "path": "/-", "value": "hi"}],
"expected": ["hi"] },
{ "comment": "Add, / target",
"doc": {},
"patch": [ {"op": "add", "path": "/", "value":1 } ],
"expected": {"":1} },
{ "comment": "Add, /foo/ deep target (trailing slash)",
"doc": {"foo": {}},
"patch": [ {"op": "add", "path": "/foo/", "value":1 } ],
"expected": {"foo":{"": 1}} },
{ "comment": "Add composite value at top level",
"doc": {"foo": 1},
"patch": [{"op": "add", "path": "/bar", "value": [1, 2]}],
"expected": {"foo": 1, "bar": [1, 2]} },
{ "comment": "Add into composite value",
"doc": {"foo": 1, "baz": [{"qux": "hello"}]},
"patch": [{"op": "add", "path": "/baz/0/foo", "value": "world"}],
"expected": {"foo": 1, "baz": [{"qux": "hello", "foo": "world"}]} },
{ "doc": {"bar": [1, 2]},
"patch": [{"op": "add", "path": "/bar/8", "value": "5"}],
"error": "Out of bounds (upper)" },
{ "doc": {"bar": [1, 2]},
"patch": [{"op": "add", "path": "/bar/-1", "value": "5"}],
"error": "Out of bounds (lower)" },
{ "doc": {"foo": 1},
"patch": [{"op": "add", "path": "/bar", "value": true}],
"expected": {"foo": 1, "bar": true} },
{ "doc": {"foo": 1},
"patch": [{"op": "add", "path": "/bar", "value": false}],
"expected": {"foo": 1, "bar": false} },
{ "doc": {"foo": 1},
"patch": [{"op": "add", "path": "/bar", "value": null}],
"expected": {"foo": 1, "bar": null} },
{ "comment": "0 can be an array index or object element name",
"doc": {"foo": 1},
"patch": [{"op": "add", "path": "/0", "value": "bar"}],
"expected": {"foo": 1, "0": "bar" } },
{ "doc": ["foo"],
"patch": [{"op": "add", "path": "/1", "value": "bar"}],
"expected": ["foo", "bar"] },
{ "doc": ["foo", "sil"],
"patch": [{"op": "add", "path": "/1", "value": "bar"}],
"expected": ["foo", "bar", "sil"] },
{ "doc": ["foo", "sil"],
"patch": [{"op": "add", "path": "/0", "value": "bar"}],
"expected": ["bar", "foo", "sil"] },
{ "comment": "push item to array via last index + 1",
"doc": ["foo", "sil"],
"patch": [{"op":"add", "path": "/2", "value": "bar"}],
"expected": ["foo", "sil", "bar"] },
{ "comment": "add item to array at index > length should fail",
"doc": ["foo", "sil"],
"patch": [{"op":"add", "path": "/3", "value": "bar"}],
"error": "index is greater than number of items in array" },
{ "comment": "test against implementation-specific numeric parsing",
"doc": {"1e0": "foo"},
"patch": [{"op": "test", "path": "/1e0", "value": "foo"}],
"expected": {"1e0": "foo"} },
{ "comment": "test with bad number should fail",
"doc": ["foo", "bar"],
"patch": [{"op": "test", "path": "/1e0", "value": "bar"}],
"error": "test op shouldn't get array element 1" },
{ "doc": ["foo", "sil"],
"patch": [{"op": "add", "path": "/bar", "value": 42}],
"error": "Object operation on array target" },
{ "doc": ["foo", "sil"],
"patch": [{"op": "add", "path": "/1", "value": ["bar", "baz"]}],
"expected": ["foo", ["bar", "baz"], "sil"],
"comment": "value in array add not flattened" },
{ "doc": {"foo": 1, "bar": [1, 2, 3, 4]},
"patch": [{"op": "remove", "path": "/bar"}],
"expected": {"foo": 1} },
{ "doc": {"foo": 1, "baz": [{"qux": "hello"}]},
"patch": [{"op": "remove", "path": "/baz/0/qux"}],
"expected": {"foo": 1, "baz": [{}]} },
{ "doc": {"foo": 1, "baz": [{"qux": "hello"}]},
"patch": [{"op": "replace", "path": "/foo", "value": [1, 2, 3, 4]}],
"expected": {"foo": [1, 2, 3, 4], "baz": [{"qux": "hello"}]} },
{ "doc": {"foo": [1, 2, 3, 4], "baz": [{"qux": "hello"}]},
"patch": [{"op": "replace", "path": "/baz/0/qux", "value": "world"}],
"expected": {"foo": [1, 2, 3, 4], "baz": [{"qux": "world"}]} },
{ "doc": ["foo"],
"patch": [{"op": "replace", "path": "/0", "value": "bar"}],
"expected": ["bar"] },
{ "doc": [""],
"patch": [{"op": "replace", "path": "/0", "value": 0}],
"expected": [0] },
{ "doc": [""],
"patch": [{"op": "replace", "path": "/0", "value": true}],
"expected": [true] },
{ "doc": [""],
"patch": [{"op": "replace", "path": "/0", "value": false}],
"expected": [false] },
{ "doc": [""],
"patch": [{"op": "replace", "path": "/0", "value": null}],
"expected": [null] },
{ "doc": ["foo", "sil"],
"patch": [{"op": "replace", "path": "/1", "value": ["bar", "baz"]}],
"expected": ["foo", ["bar", "baz"]],
"comment": "value in array replace not flattened" },
{ "comment": "replace whole document",
"doc": {"foo": "bar"},
"patch": [{"op": "replace", "path": "", "value": {"baz": "qux"}}],
"expected": {"baz": "qux"} },
{ "comment": "add whole document, null",
"doc": {},
"Note1": "We can't pass null in to json_patch_apply, so start with _something_ and remove it",
"patch": [
{"op": "remove", "path": ""},
{"op": "add", "path": "", "value": {"baz": "qux"}}
],
"expected": {"baz": "qux"} },
{ "comment": "replace whole document, null",
"doc": {},
"Note1": "We can't pass null in to json_patch_apply, so start with _something_ and remove it",
"patch": [
{"op": "remove", "path": ""},
{"op": "replace", "path": "", "value": {"baz": "qux"}}
],
"error": "The spec says the target location must exist, so replacing a null document fails"
},
{ "comment": "remove whole document",
"doc": {"foo": "bar"},
"patch": [{"op": "remove", "path": ""}],
"expected": null },
{ "comment": "remove whole document",
"doc": {"foo": "bar"},
"patch": [{"op": "remove", "path": ""}],
"expected": null },
{ "comment": "remove whole document, array",
"doc": ["foo", "bar"],
"patch": [{"op": "remove", "path": ""}],
"expected": null },
{ "comment": "remove whole document, string",
"doc": "foo",
"patch": [{"op": "remove", "path": ""}],
"expected": null },
{ "comment": "remove whole document, null",
"doc": {},
"Note1": "We can't pass null in to json_patch_apply, so start with _something_ and remove it",
"patch": [
{"op": "remove", "path": ""},
{"op": "remove", "path": ""},
],
"error": "The spec says the target location must exist, so removing a null document fails"
},
{ "comment": "test replace with missing parent key should fail",
"doc": {"bar": "baz"},
"patch": [{"op": "replace", "path": "/foo/bar", "value": false}],
"error": "replace op should fail with missing parent key" },
{ "comment": "spurious patch properties",
"doc": {"foo": 1},
"patch": [{"op": "test", "path": "/foo", "value": 1, "spurious": 1}],
"expected": {"foo": 1} },
{ "doc": {"foo": null},
"patch": [{"op": "test", "path": "/foo", "value": null}],
"expected": {"foo": null},
"comment": "null value should be valid obj property" },
{ "doc": {"foo": null},
"patch": [{"op": "replace", "path": "/foo", "value": "truthy"}],
"expected": {"foo": "truthy"},
"comment": "null value should be valid obj property to be replaced with something truthy" },
{ "doc": {"foo": null},
"patch": [{"op": "move", "from": "/foo", "path": "/bar"}],
"expected": {"bar": null},
"comment": "null value should be valid obj property to be moved" },
{ "doc": {"foo": null},
"patch": [{"op": "copy", "from": "/foo", "path": "/bar"}],
"expected": {"foo": null, "bar": null},
"comment": "null value should be valid obj property to be copied" },
{ "doc": {"foo": null},
"patch": [{"op": "remove", "path": "/foo"}],
"expected": {},
"comment": "null value should be valid obj property to be removed" },
{ "doc": {"foo": "bar"},
"patch": [{"op": "replace", "path": "/foo", "value": null}],
"expected": {"foo": null},
"comment": "null value should still be valid obj property replace other value" },
{ "doc": {"foo": {"foo": 1, "bar": 2}},
"patch": [{"op": "test", "path": "/foo", "value": {"bar": 2, "foo": 1}}],
"expected": {"foo": {"foo": 1, "bar": 2}},
"comment": "test should pass despite rearrangement" },
{ "doc": {"foo": [{"foo": 1, "bar": 2}]},
"patch": [{"op": "test", "path": "/foo", "value": [{"bar": 2, "foo": 1}]}],
"expected": {"foo": [{"foo": 1, "bar": 2}]},
"comment": "test should pass despite (nested) rearrangement" },
{ "doc": {"foo": {"bar": [1, 2, 5, 4]}},
"patch": [{"op": "test", "path": "/foo", "value": {"bar": [1, 2, 5, 4]}}],
"expected": {"foo": {"bar": [1, 2, 5, 4]}},
"comment": "test should pass - no error" },
{ "doc": {"foo": {"bar": [1, 2, 5, 4]}},
"patch": [{"op": "test", "path": "/foo", "value": [1, 2]}],
"error": "test op should fail" },
{ "comment": "Test the whole document",
"doc": { "foo": 1 },
"patch": [{"op": "test", "path": "", "value": {"foo": 1}}],
"expected": { "foo": 1 } },
{ "comment": "Test the whole document, no match",
"doc": { "foo": 1 },
"patch": [{"op": "test", "path": "", "value": {"foo": 2}}],
"expected": { "foo": 1 },
"error": "Tested value does not match original doc" },
{ "comment": "Empty-string element",
"doc": { "": 1 },
"patch": [{"op": "test", "path": "/", "value": 1}],
"expected": { "": 1 } },
{ "doc": {
"foo": ["bar", "baz"],
"": 0,
"a/b": 1,
"c%d": 2,
"e^f": 3,
"g|h": 4,
"i\\j": 5,
"k\"l": 6,
" ": 7,
"m~n": 8
},
"patch": [{"op": "test", "path": "/foo", "value": ["bar", "baz"]},
{"op": "test", "path": "/foo/0", "value": "bar"},
{"op": "test", "path": "/", "value": 0},
{"op": "test", "path": "/a~1b", "value": 1},
{"op": "test", "path": "/c%d", "value": 2},
{"op": "test", "path": "/e^f", "value": 3},
{"op": "test", "path": "/g|h", "value": 4},
{"op": "test", "path": "/i\\j", "value": 5},
{"op": "test", "path": "/k\"l", "value": 6},
{"op": "test", "path": "/ ", "value": 7},
{"op": "test", "path": "/m~0n", "value": 8}],
"expected": {
"": 0,
" ": 7,
"a/b": 1,
"c%d": 2,
"e^f": 3,
"foo": [
"bar",
"baz"
],
"g|h": 4,
"i\\j": 5,
"k\"l": 6,
"m~n": 8
}
},
{ "comment": "Move to same location has no effect",
"doc": {"foo": 1},
"patch": [{"op": "move", "from": "/foo", "path": "/foo"}],
"expected": {"foo": 1} },
{ "doc": {"foo": 1, "baz": [{"qux": "hello"}]},
"patch": [{"op": "move", "from": "/foo", "path": "/bar"}],
"expected": {"baz": [{"qux": "hello"}], "bar": 1} },
{ "doc": {"baz": [{"qux": "hello"}], "bar": 1},
"patch": [{"op": "move", "from": "/baz/0/qux", "path": "/baz/1"}],
"expected": {"baz": [{}, "hello"], "bar": 1} },
{ "doc": {"baz": [{"qux": "hello"}], "bar": 1},
"patch": [{"op": "copy", "from": "/baz/0", "path": "/boo"}],
"expected": {"baz":[{"qux":"hello"}],"bar":1,"boo":{"qux":"hello"}} },
{ "comment": "replacing the root of the document is possible with add",
"doc": {"foo": "bar"},
"patch": [{"op": "add", "path": "", "value": {"baz": "qux"}}],
"expected": {"baz":"qux"}},
{ "comment": "Adding to \"/-\" adds to the end of the array",
"doc": [ 1, 2 ],
"patch": [ { "op": "add", "path": "/-", "value": { "foo": [ "bar", "baz" ] } } ],
"expected": [ 1, 2, { "foo": [ "bar", "baz" ] } ]},
{ "comment": "Adding to \"/-\" adds to the end of the array, even n levels down",
"doc": [ 1, 2, [ 3, [ 4, 5 ] ] ],
"patch": [ { "op": "add", "path": "/2/1/-", "value": { "foo": [ "bar", "baz" ] } } ],
"expected": [ 1, 2, [ 3, [ 4, 5, { "foo": [ "bar", "baz" ] } ] ] ]},
{ "comment": "test remove with bad number should fail",
"doc": {"foo": 1, "baz": [{"qux": "hello"}]},
"patch": [{"op": "remove", "path": "/baz/1e0/qux"}],
"error": "remove op shouldn't remove from array with bad number" },
{ "comment": "test remove on array",
"doc": [1, 2, 3, 4],
"patch": [{"op": "remove", "path": "/0"}],
"expected": [2, 3, 4] },
{ "comment": "test repeated removes",
"doc": [1, 2, 3, 4],
"patch": [{ "op": "remove", "path": "/1" },
{ "op": "remove", "path": "/2" }],
"expected": [1, 3] },
{ "comment": "test remove with bad index should fail",
"doc": [1, 2, 3, 4],
"patch": [{"op": "remove", "path": "/1e0"}],
"error": "remove op shouldn't remove from array with bad number" },
{ "comment": "test replace with bad number should fail",
"doc": [""],
"patch": [{"op": "replace", "path": "/1e0", "value": false}],
"error": "replace op shouldn't replace in array with bad number" },
{ "comment": "test copy with bad number should fail",
"doc": {"baz": [1,2,3], "bar": 1},
"patch": [{"op": "copy", "from": "/baz/1e0", "path": "/boo"}],
"error": "copy op shouldn't work with bad number" },
{ "comment": "test move with bad number should fail",
"doc": {"foo": 1, "baz": [1,2,3,4]},
"patch": [{"op": "move", "from": "/baz/1e0", "path": "/foo"}],
"error": "move op shouldn't work with bad number" },
{ "comment": "test add with bad number should fail",
"doc": ["foo", "sil"],
"patch": [{"op": "add", "path": "/1e0", "value": "bar"}],
"error": "add op shouldn't add to array with bad number" },
{ "comment": "missing 'path' parameter",
"doc": {},
"patch": [ { "op": "add", "value": "bar" } ],
"error": "missing 'path' parameter" },
{ "comment": "'path' parameter with null value",
"doc": {},
"patch": [ { "op": "add", "path": null, "value": "bar" } ],
"error": "null is not valid value for 'path'" },
{ "comment": "invalid JSON Pointer token",
"doc": {},
"patch": [ { "op": "add", "path": "foo", "value": "bar" } ],
"error": "JSON Pointer should start with a slash" },
{ "comment": "missing 'value' parameter to add",
"doc": [ 1 ],
"patch": [ { "op": "add", "path": "/-" } ],
"error": "missing 'value' parameter" },
{ "comment": "missing 'value' parameter to replace",
"doc": [ 1 ],
"patch": [ { "op": "replace", "path": "/0" } ],
"error": "missing 'value' parameter" },
{ "comment": "missing 'value' parameter to test",
"doc": [ null ],
"patch": [ { "op": "test", "path": "/0" } ],
"error": "missing 'value' parameter" },
{ "comment": "missing value parameter to test - where undef is falsy",
"doc": [ false ],
"patch": [ { "op": "test", "path": "/0" } ],
"error": "missing 'value' parameter" },
{ "comment": "missing from parameter to copy",
"doc": [ 1 ],
"patch": [ { "op": "copy", "path": "/-" } ],
"error": "missing 'from' parameter" },
{ "comment": "missing from location to copy",
"doc": { "foo": 1 },
"patch": [ { "op": "copy", "from": "/bar", "path": "/foo" } ],
"error": "missing 'from' location" },
{ "comment": "missing from parameter to move",
"doc": { "foo": 1 },
"patch": [ { "op": "move", "path": "" } ],
"error": "missing 'from' parameter" },
{ "comment": "missing from location to move",
"doc": { "foo": 1 },
"patch": [ { "op": "move", "from": "/bar", "path": "/foo" } ],
"error": "missing 'from' location" },
{ "comment": "duplicate ops, json-c parses this as op:move",
"doc": { "foo": "bar" },
"patch": [ { "op": "add", "path": "/baz", "value": "qux",
"op": "move", "from":"/foo" } ],
"error_wont_happen_in_jsonc": "patch has two 'op' members",
"expected": { "baz": "bar" }
},
{ "comment": "unrecognized op should fail",
"doc": {"foo": 1},
"patch": [{"op": "spam", "path": "/foo", "value": 1}],
"error": "Unrecognized op 'spam'" },
{ "comment": "test with bad array number that has leading zeros",
"doc": ["foo", "bar"],
"patch": [{"op": "test", "path": "/00", "value": "foo"}],
"error": "test op should reject the array value, it has leading zeros" },
{ "comment": "test with bad array number that has leading zeros",
"doc": ["foo", "bar"],
"patch": [{"op": "test", "path": "/01", "value": "bar"}],
"error": "test op should reject the array value, it has leading zeros" },
{ "comment": "Removing nonexistent field",
"doc": {"foo" : "bar"},
"patch": [{"op": "remove", "path": "/baz"}],
"error": "removing a nonexistent field should fail" },
{ "comment": "Removing deep nonexistent path",
"doc": {"foo" : "bar"},
"patch": [{"op": "remove", "path": "/missing1/missing2"}],
"error": "removing a nonexistent field should fail" },
{ "comment": "Removing nonexistent index",
"doc": ["foo", "bar"],
"patch": [{"op": "remove", "path": "/2"}],
"error": "removing a nonexistent index should fail" },
{ "comment": "Patch with different capitalisation than doc",
"doc": {"foo":"bar"},
"patch": [{"op": "add", "path": "/FOO", "value": "BAR"}],
"expected": {"foo": "bar", "FOO": "BAR"}
}
]

View File

@@ -1,3 +1,6 @@
#ifdef NDEBUG
#undef NDEBUG
#endif
#include "config.h"
#include <stdio.h>

View File

@@ -1,3 +1,6 @@
#ifdef NDEBUG
#undef NDEBUG
#endif
#include <assert.h>
#include <limits.h>
#include <stddef.h>
@@ -58,7 +61,7 @@ static const char *to_json_string(json_object *obj, int flags)
#endif
json_object *make_array(void);
json_object *make_array()
json_object *make_array(void)
{
json_object *my_array;
@@ -74,7 +77,7 @@ json_object *make_array()
}
void test_array_del_idx(void);
void test_array_del_idx()
void test_array_del_idx(void)
{
int rc;
size_t ii;
@@ -140,7 +143,7 @@ void test_array_del_idx()
}
void test_array_list_expand_internal(void);
void test_array_list_expand_internal()
void test_array_list_expand_internal(void)
{
int rc;
size_t ii;
@@ -186,6 +189,42 @@ void test_array_list_expand_internal()
json_object_put(my_array);
}
void test_array_insert_idx(void);
void test_array_insert_idx(void)
{
json_object *my_array;
struct json_object *jo1;
my_array = json_object_new_array();
json_object_array_add(my_array, json_object_new_int(1));
json_object_array_add(my_array, json_object_new_int(2));
json_object_array_add(my_array, json_object_new_int(5));
json_object_array_insert_idx(my_array, 2, json_object_new_int(4));
jo1 = json_tokener_parse("[1, 2, 4, 5]");
assert(1 == json_object_equal(my_array, jo1));
json_object_put(jo1);
json_object_array_insert_idx(my_array, 2, json_object_new_int(3));
jo1 = json_tokener_parse("[1, 2, 3, 4, 5]");
assert(1 == json_object_equal(my_array, jo1));
json_object_put(jo1);
json_object_array_insert_idx(my_array, 5, json_object_new_int(6));
jo1 = json_tokener_parse("[1, 2, 3, 4, 5, 6]");
assert(1 == json_object_equal(my_array, jo1));
json_object_put(jo1);
json_object_array_insert_idx(my_array, 7, json_object_new_int(8));
jo1 = json_tokener_parse("[1, 2, 3, 4, 5, 6, null, 8]");
assert(1 == json_object_equal(my_array, jo1));
json_object_put(jo1);
json_object_put(my_array);
}
int main(int argc, char **argv)
{
json_object *my_string, *my_int, *my_null, *my_object, *my_array;
@@ -250,6 +289,8 @@ int main(int argc, char **argv)
json_object_put(my_array);
test_array_insert_idx();
test_array_del_idx();
test_array_list_expand_internal();
@@ -308,6 +349,11 @@ int main(int argc, char **argv)
{
printf("\t%s: %s\n", key, json_object_to_json_string(val));
}
json_object *empty_array = json_object_new_array();
json_object *empty_obj = json_object_new_object();
json_object_object_add(my_object, "empty_array", empty_array);
json_object_object_add(my_object, "empty_obj", empty_obj);
printf("my_object.to_string()=%s\n", json_object_to_json_string(my_object));
json_object_put(my_array);

View File

@@ -75,4 +75,4 @@ my_object=
foo: "bar"
bool0: false
bool1: true
my_object.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true }
my_object.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "empty_array": [ ], "empty_obj": { } }

View File

@@ -75,4 +75,4 @@ my_object=
foo: "bar"
bool0: false
bool1: true
my_object.to_string()={"abc":12,"foo":"bar","bool0":false,"bool1":true}
my_object.to_string()={"abc":12,"foo":"bar","bool0":false,"bool1":true,"empty_array":[],"empty_obj":{}}

View File

@@ -97,5 +97,7 @@ my_object.to_string()={
"abc":12,
"foo":"bar",
"bool0":false,
"bool1":true
"bool1":true,
"empty_array":[],
"empty_obj":{}
}

View File

@@ -75,4 +75,4 @@ my_object=
foo: "bar"
bool0: false
bool1: true
my_object.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true }
my_object.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "empty_array": [ ], "empty_obj": { } }

View File

@@ -97,5 +97,7 @@ my_object.to_string()={
"abc": 12,
"foo": "bar",
"bool0": false,
"bool1": true
"bool1": true,
"empty_array": [],
"empty_obj": {}
}

Some files were not shown because too many files have changed in this diff Show More