1064 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
Eric Haszlakiewicz
7d303478a4 Update the ChangeLog with recent changes, in preparation for a 0.16 release.
Add a list of issues closed for this release.
2022-04-14 01:05:38 +00:00
Eric Haszlakiewicz
66dcdf549e Add new authors since the 0.15 release, tweak instructions for how to update that list. 2022-04-14 01:04:53 +00:00
Eric Hawicz
4902f9cb87 Merge pull request #765 from jvoisin/patch-1
Improve a bit the coverage of the fuzzer
2022-04-13 14:28:51 -04:00
Julien Voisin
558d48a6f3 Improve a bit the coverage of the fuzzer 2022-04-13 15:42:46 +02:00
Eric Haszlakiewicz
46b58ad9e7 Fix issue #764: adjust test_util_file to match new output (changed in 6e53347) 2022-04-08 22:58:24 +00:00
Eric Hawicz
0b937f6173 Merge pull request #758 from c3h2-ctf/context
Preserve context if out of memory
2022-04-04 18:01:39 -04:00
Eric Hawicz
65274cf3b5 Update issue templates 2022-04-04 17:10:31 -04:00
Tobias Stoeckmann
0c0d901443 Preserve context if out of memory
If memory allocation fails in json_c_set_serialization_double_format or
json_object_copy_serializer_data then return with an error value and
preserve previous values without overriding them with NULL.
2022-03-31 18:05:48 +02:00
Eric Haszlakiewicz
e244146dfd Remove single quote from #error line. Fixes issue #761 2022-03-25 01:12:07 +00:00
Eric Hawicz
a1c092bd7b Merge pull request #760 from BonsaiYi/error
Code style: removed unneeded double-quotes
2022-03-23 00:14:36 -04:00
BonsaY
716978f20d Code style removed unneeded double-quotes
this way, it complies with the other #error usages
2022-03-21 21:10:45 +01: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
Eric Hawicz
79459b2de2 Merge pull request #755 from c3h2-ctf/error
Fix error messages
2022-03-19 10:05:48 -04:00
Eric Hawicz
2326e34390 Merge pull request #754 from c3h2-ctf/doc
Minor improvements to documentation
2022-03-19 10:04:58 -04:00
Tobias Stoeckmann
6e533471a8 Fix error messages
Error messages did not reflect actual function names.
2022-03-19 10:59:43 +01:00
Tobias Stoeckmann
a7d85bfba9 Fix typos in comments
Spotted during code reviews.
2022-03-19 10:39:56 +01:00
Tobias Stoeckmann
cbc603b587 Adjusted URLs
Most of these sites support HTTPS (some forward to HTTPS when accessing
the HTTP versions). Use HTTPS directly if supported.

Some URLs led to 404 error pages. Adjusted the links to point to
new locations.

I did not adjust the Microsoft HTML Help Workshop link because it seems
that this software is not available anymore. Instead of removing the
link entirely I kept it there in case it helps someone to find the
software on archived websites.
2022-03-19 10:34:55 +01:00
Eric Hawicz
f0d93cee14 Merge pull request #748 from c3h2-ctf/printbuf
sprintbuf(): test for all vsnprintf error values
2022-03-07 00:06:57 -05:00
Eric Hawicz
9b832c8710 Merge pull request #752 from c3h2-ctf/typos
Fix typos
2022-03-06 23:33:42 -05:00
Tobias Stoeckmann
543a8eb5f9 Fix typos
Mostly found with codespell and during code review.
2022-03-06 16:07:36 +01:00
Tobias Stoeckmann
94b2a0cb29 sprintbuf(): test for all vsnprintf error values
The POSIX specification states that vsnprintf returns "a negative value"
in case of error, but the code checks explicitly only for -1.
2022-03-06 16:05:32 +01:00
Eric Hawicz
a4389f4f30 Merge pull request #749 from c3h2-ctf/sprintbuf
sprintbuf(): handle printbuf_memappend errors
2022-03-03 21:32:09 -05:00
Eric Hawicz
4493db76d6 Merge pull request #750 from c3h2-ctf/clearmem
printbuf_memset(): set gaps to zero
2022-03-03 21:29:27 -05:00
Eric Hawicz
1491d92038 Merge pull request #751 from c3h2-ctf/arguments
printbuf: do not allow invalid arguments
2022-03-03 21:26:22 -05:00
Tobias Stoeckmann
d07da04c14 sprintbuf(): handle printbuf_memappend errors
If errors occur in printbuf_memappend, then these errors should be
propagated through sprintbuf to indicate the error to the user.

Proof of Concept:
```
 #include <err.h>
 #include <limits.h>
 #include <stdio.h>

 #include "json.h"

 int
 main(void) {
  struct printbuf *pb;
  if ((pb = printbuf_new()) == NULL)
   err(1, "printbuf_new");
  if (printbuf_memset(pb, INT_MAX - 9, 'a', 1) < 0)
   errx(1, "printbuf_memset");
  printf("length: %d\n", printbuf_length(pb));
  printf("sprintbuf: %d\n", sprintbuf(pb, "string too long"));
  printf("length: %d\n", printbuf_length(pb));
  printbuf_free(pb);
  return 0;
 }
```

You can see that sprintbuf does not return an error but length is still
the same, i.e. the string "string too long" has not been appended.

I would like to add this as a unit test but it really depends on the
operating system if printbuf_memset() would fail if not enough memory is
available or not.
2022-03-03 21:24:27 +01:00
Tobias Stoeckmann
63c602ff80 printbuf_memset(): set gaps to zero
It is possible to have a printbuf with "gaps", i.e. areas within the
print buffer which have not been initialized by using printbuf_memset.

Always clear memory in such cases.

Example:
```
struct printbuf *pb = printbuf_new();
printbuf_memset(pb, 10, 'a', 2);
```
In this case pb->buf[0] is '\0' but pb->buf[1] up to pb->buf[9] are
not set. The length would be 12 due to successful printbuf_memset.
2022-03-03 21:18:53 +01:00
Tobias Stoeckmann
4355242477 printbuf: do not allow invalid arguments
If invalid arguments are passed to printbuf functions return -1 to
protect printbuf internals.
2022-03-03 21:15:19 +01:00
Eric Hawicz
bd56cc8bf7 Merge pull request #745 from c3h2-ctf/vasprintf
vasprintf(): avoid out of memory accesses
2022-02-27 08:34:21 -05:00
Eric Hawicz
723ac8cbb5 Merge pull request #746 from rouault/typo_fixes
Fix typos in code comments and ChangeLog
2022-02-26 23:45:15 -05:00
Even Rouault
3bb54f97e7 Fix typos in code comments and ChangeLog 2022-02-25 00:14:47 +01:00
Tobias Stoeckmann
5c72257220 vasprintf(): avoid out of memory accesses
Systems without vasprintf fall back to implementation in header file
vasprintf_compat.h. This version could run into heap overflow issues
with very long arguments or formats provoking a lot of output.

The vsnprintf function returns a negative value if more than INT_MAX
characters would be written since its int return type could not
handle this (and %n couldn't handle it either).

Before testing for a possible error value the additional char for
\0 is already added. A -1 error code would not be detected.

Increment only after implicitly casting to an unsigned value to avoid
signed integer overflow if INT_MAX has been returned.

Use va_copy to duplicate the original ap argument for multiple uses
on non-WIN32 systems. At least with glibc the test suite would fail
because the arguments are not reset after leaving the vsnprintf call.

Removed support for apparently very old glibc versions which do not
comply with vsnprintf standard descriptions. It breaks support for
modern ones which are not forced to return -1 in case of error. The
standard specifies merely "a negative value".

How to reproduce:

- Use a system without vasprintf
- Alternatively remove -D_GNU_SOURCE from CMakeLists.txt
- Compile and run:

  #include "json.h"
  int main(void) {
    struct printbuf *pb = printbuf_new();
    sprintbuf(pb, "prefix %2147483647s", "*");
    printbuf_free(pb);
    return 0;
  }
2022-02-24 23:06:57 +01:00
Eric Hawicz
66cce0a1d7 Merge pull request #739 from rouault/avoid_unsigned_integer_overflow
json_escape_str(): avoid harmless unsigned integer overflow
2022-02-18 20:21:18 -05:00
Eric Hawicz
b11f79c52c Merge pull request #741 from rouault/json_type_to_name_formatter
json_type_to_name(): use correct printf() formatter
2022-02-18 20:08:31 -05:00
Eric Hawicz
78246db72f Merge pull request #742 from rouault/json_object_copy_serializer_data_add_assertion
json_object_copy_serializer_data(): add assertion
2022-02-18 20:08:02 -05:00
Eric Hawicz
a1ea216878 Merge pull request #744 from Kizuna-Meraki/close-random
Close file on error path.
2022-02-18 20:07:33 -05:00
Kizuna-Meraki
d783ad76c7 Close file on error path.
The file was only be closed when there was no error and
was being left open when there was an error. By moving
the close(fd) statement out of the if-clause, the file
can be close regardless if there is an error or not.
After the file is closed, it can be checked for errors.
2022-02-17 21:27:01 +01:00
Even Rouault
f2c0df404b json_type_to_name(): use correct printf() formatter
Was detected by Coverity Scan when analyzing GDAL's code base which has
a copy of json-c
2022-01-31 00:27:41 +01:00
Even Rouault
82d9433813 json_object_copy_serializer_data(): add assertion
This makes Coverity Scan happier since it believes that the initial
check ``if (!src->_userdata && !src->_user_delete)`` could mean that
src->_user_data may be nullptr.
2022-01-16 20:50:58 +01:00
Even Rouault
296db618e9 json_escape_str(): avoid harmless unsigned integer overflow
Current behaviour is perfectly valid, since wrap-over upon overflow is
well defined behaviour for unsigned types, but it is nevertheless nice to be
able to build with -fsanitize=undefined,unsigned-integer-overflow

There is no significant effect on the generated assembly as can be seen
on the diff of objdump -d output on a optimized build (the compiler
just decided to switch the order of a comparison):

@@ -135,8 +135,8 @@
  1d0:	0f 84 70 ff ff ff    	je     146 <json_escape_str+0x146>
  1d6:	4c 3b 24 24          	cmp    (%rsp),%r12
  1da:	0f 85 2d ff ff ff    	jne    10d <json_escape_str+0x10d>
- 1e0:	49 39 f4             	cmp    %rsi,%r12
- 1e3:	0f 87 b7 00 00 00    	ja     2a0 <json_escape_str+0x2a0>
+ 1e0:	4c 39 e6             	cmp    %r12,%rsi
+ 1e3:	0f 82 b7 00 00 00    	jb     2a0 <json_escape_str+0x2a0>
  1e9:	48 8b 44 24 18       	mov    0x18(%rsp),%rax
  1ee:	64 48 33 04 25 28 00 	xor    %fs:0x28,%rax
  1f5:	00 00
2022-01-12 23:44:39 +01:00
Eric Hawicz
3b4f1e92ad Merge pull request #737 from tniessen/patch-1
Fix typo in README
2022-01-11 21:25:38 -05:00
Tobias Nießen
928fa96db7 Fix typo in README 2022-01-10 00:12:25 +01:00
Eric Haszlakiewicz
a5c2e11460 Cause the cmake include dirs to also have ${CMAKE_INSTALL_INCLUDEDIR}/json-c, so downstream packages that use cmake to link against json-c can choose whether to include headers as just e.g. #include <json_object.h>, if they care to do so.
Update the README to better explain this, and make a few other tweaks.
2021-12-22 02:52:37 +00:00
Eric Haszlakiewicz
2d2382d709 Add linkhash accessor functions (lh_table_head(), lh_entry_next(), etc...) to pave the way for making the lh_table and lh_entry structure opaque in the future.
Update the docs to mark all members of those structures deprecated, and
 suggest what to use instead.
2021-11-30 03:27:55 +00:00
Eric Haszlakiewicz
320548caf6 Drop the REFCOUNT_DEBUG code, it hasn't been used in ages. 2021-11-30 03:08:02 +00:00
Eric Hawicz
9a90b8477b Merge pull request #734 from json-c/newer-appveyor
Newer appveyor config for VS2022 etc...
Update the appveyor config to specify "image" instead of just "os", and build for VS2017, VS2019 and VS2022.
2021-11-29 13:40:41 -05:00
Eric Haszlakiewicz
1cb56e705f Put the most recent image first in appveyor builds. 2021-11-29 18:21:05 +00:00
Eric Haszlakiewicz
1763edaba3 Skip most "Release" builds. s/b_config/CONFIGURATION/ to fix artifact creation. 2021-11-29 18:18:48 +00:00
Eric Haszlakiewicz
a5fed59756 There doesn't seem to be a way to extend the appveyor build matrix for just one image, so instead list a whole bunch of excluded builds. 2021-11-27 02:55:29 +00:00
Eric Haszlakiewicz
0910e18bbd Use the newer appveyor images to build for VS2017 and VS2019. Trim the number of builds we do. 2021-11-27 02:29:26 +00:00
Eric Haszlakiewicz
f1fb9abf14 Note the need to also set CTEST_OUTPUT_ON_FAILURE to get test output 2021-11-26 22:49:42 +00:00
Eric Hawicz
42aa6f7257 Merge pull request #732 from DiracResearch/fix/static_include_dirs
Fix/static include dirs
2021-11-11 23:52:43 -05:00
Robert Bielik
286b4fdd27 Fix uninitialized value error for clang-8 msan 2021-11-11 10:23:05 +01:00
Robert Bielik
a66a6cc51b Fix for clang ub sanitizer 2021-11-11 09:51:18 +01:00
Robert Bielik
21f767f63f Add target include dirs for static library as well 2021-11-11 09:37:53 +01:00
Eric Hawicz
9b0fb2b33e Merge pull request #727 from jobol/propo2
Really use prefix JSON_C_OBJECT_ADD_
2021-10-22 19:06:11 -04:00
José Bollo
8bf3b45a29 Really use prefix JSON_C_OBJECT_ADD_*
This change introduces JSON_C_OBJECT_ADD_CONSTANT_KEY
as a replacement of JSON_C_OBJECT_KEY_IS_CONSTANT.

The description of json_object_object_add_ex tells to
look at the flags JSON_C_OBJECT_ADD_* but it is not
for JSON_C_OBJECT_KEY_IS_CONSTANT.

From the point of vue of a developper using json-c,
the function json_object_object_add_ex is mainly used,
not the hash facility, it seems more natural to provide
a regular naming of prefix JSON_C_OBJECT_ADD_CONSTANT_KEY.
2021-10-19 11:18:17 +02:00
Eric Hawicz
05c5d15075 Merge pull request #729 from DeX77/patch-1
* don't assume includedir
2021-10-17 14:23:28 -04:00
DeX77
d6d4b71d7d * don't assume includedir
This change syncs the public header include install location with what gets written into pkgconfig file.
2021-10-15 11:12:39 +02:00
Eric Hawicz
382f9462c2 Merge pull request #726 from leongross/fix/test-cmake3.1
fix cmake version for tests
2021-10-09 09:17:25 -04:00
Leon Gross
8be2ffdcd7 fix cmake version for tests 2021-10-06 15:29:33 +02:00
Eric Hawicz
4fc44f32df Merge pull request #722 from imaami/fix-json_tokener_new_ex-use-after-free
Fix use-after-free in json_tokener_new_ex()
2021-09-04 23:16:13 -04:00
Juuso Alasuutari
9361d8d3a8 Fix use-after-free in json_tokener_new_ex()
The failure path taken in the event of printbuf_new() returning NULL
calls free() on tok->stack after already having freed tok. Swap the
order of the two calls to fix an obvious memory access violation.

Fixes: bcb6d7d347 ("Handle allocation failure in json_tokener_new_ex")
Signed-off-by: Juuso Alasuutari <juuso.alasuutari@gmail.com>
2021-09-04 20:14:30 +03:00
Eric Hawicz
dc1ef7d566 Merge pull request #718 from Pawday/master
CMake create uninstall target if unix generator is used
2021-07-31 22:46:01 -04:00
Pawday
e91e4cc9fb Setted cmake "uninstall" target to exist in unix like operating systems only 2021-07-26 18:52:29 +03:00
Eric Haszlakiewicz
f61f1a7a91 Add workaround for Visual Studio not knowing about "inline". 2021-07-25 20:31:59 +00:00
Eric Haszlakiewicz
db6a6cc2b2 Switch the Travis build to use osx_image: xcode12.5, in an attempt to avoid timeouts with Homebrew. 2021-07-25 20:03:55 +00:00
Eric Haszlakiewicz
6a0df2609e Merge some old work to include (some of) PR #464 into the current master branch. 2021-07-25 19:07:06 +00:00
Eric Haszlakiewicz
8c727e5ce1 Only define an "uninstall" target if it's not already defined (e.g. by projects that include json-c) 2021-07-25 15:11:11 +00:00
Eric Hawicz
be9671e48a Merge pull request #714 from Hex052/clang-format_AfterCaseLabel
Add AfterCaseLabel to .clang-format
2021-07-05 18:18:06 -04:00
Hex052
9dde931a1c Add AfterCaseLabel to .clang-format
This is to fix the behavior that might've changed between older versions of clang-format, I'm not sure.
Version 10 tries to put the bracket on the same line as case without this.
2021-07-04 18:28:21 -08:00
Eric Haszlakiewicz
75bf657cc2 If inttypes.h is present, use it, even on Windows. 2021-06-13 21:12:22 +00:00
Eric Haszlakiewicz
9ca50cf2f8 Issue #709: adjust some include guards to be a bit more json-c specific. 2021-06-02 23:53:23 +00:00
Eric Hawicz
0b7e78c309 Merge pull request #706 from davidjmccann/master
Check __STDC_VERSION__ is defined before checking its value
2021-05-15 08:41:24 -04:00
David McCann
00098efc96 Merge branch 'json-c:master' into master 2021-05-13 06:34:10 +01:00
David McCann
9b53c92ea3 Check __STDC_VERSION__ is defined before checking its value
Prevent an undef warning regarding __STDC_VERSION__ by checking whether it is defined before checking its value.
2021-05-13 06:31:18 +01:00
Eric Hawicz
cd7109f767 Merge pull request #696 from ssrlive/master
To avoid target exe file export JSON functions.
2021-05-01 15:21:31 -04:00
Eric Hawicz
78e390a261 Merge pull request #701 from commodo/configurable-opts
[RFC] json_pointer: allow the feature to be disabled
2021-04-17 17:26:49 -04:00
Alexandru Ardelean
8abeebc9b2 json_pointer: allow the feature to be disabled
Some users may not want to included it in their build/system. So allow a
cmake symbol to disable it.

A user can do 'cmake -DDISABLE_JSON_POINTER=ON <json_c_root_dir>' and
disable the json_pointer functionality. That saves about 17 KB (on an
x86_64) machine. This may be useful on smaller embedded systems; even
though the saving would be fewer kilobytes.

One thing that also needs to change a bit, is that the 'json.h' be
autogenerated via cmake, in order to conditionally include that
"json_pointer.h" file.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2021-04-16 11:49:38 +03:00
Alexandru Ardelean
1f8b64f62c tests: CMakeLists.txt: move test names to variable
The intent is to be able to disable some features that get built into the
library. When we do that, we also need to disable some tests.

It's easier when adjusting a variable that contains the list of test names,
versus modifying the list in the foreach() statement.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2021-04-16 09:32:17 +03:00
Eric Hawicz
94909840be Merge pull request #700 from Philosoph228/werror-fix
Fix unused variable for Win32 build in random_seed.c
2021-04-14 22:38:36 -04:00
Philosoph228
9c0565100a random_seed: fix unused variable for win32 build 2021-04-13 11:47:01 +05:00
ssrlive
ba181548bc To avoid target exe file export JSON functions. 2021-03-02 14:27:40 +08:00
Eric Haszlakiewicz
041cef434a Add a DISABLE_EXTRA_LIBS option to skip using libbsd, per @neheb's request on issue #692/commit 0f61f692. 2021-02-15 20:19:56 +00:00
Eric Haszlakiewicz
f787810890 If arc4random is used, don't bother compiling in the other fallback methods since they'll never be used. Fixes PR#695 about unreachable code too. 2021-02-13 03:23:58 +00:00
Eric Hawicz
7c859c54e4 Merge pull request #694 from ihsinme/patch-1
fix invalid unsigned arithmetic.
2021-02-06 17:25:24 -05:00
ihsinme
c456963110 Update json_object.c 2021-02-05 18:58:20 +03:00
Eric Haszlakiewicz
0f61f6921b Iesue #692: use arc4random() if it's available (in libc on BSD systems, and libbsd on Linux). 2021-01-13 01:57:25 +00:00
Eric Haszlakiewicz
69d650528d Keep the doc directory in the nodoc release tarball, just exclude its contents. 2021-01-13 01:30:16 +00:00
Eric Hawicz
4754f47434 Merge pull request #674 from ploxiln/random_seed_err_continue
random_seed: on error, continue to next method
2021-01-12 20:22:54 -05:00
Eric Hawicz
1fcb9e476b Merge pull request #689 from neheb/patch-1
fix compilation with clang
2020-12-18 21:30:14 -05:00
Rosen Penev
987d3b2c86 fix compilation with clang
Fixes the following warning:

json_pointer.c:230:7: warning: implicit declaration of function
    'vasprintf' is invalid in C99 [-Wimplicit-function-declaration]
            rc = vasprintf(&path_copy, path_fmt, args);
2020-12-17 19:59:37 -08:00
Pierce Lopez
0fd3b7d316 random_seed: on error, continue to next method
instead of exiting the process
2020-10-07 01:22:30 -04:00
Eric Hawicz
df27756491 Merge pull request #667 from stoeckmann/regression
Fixed test1 regression.
2020-09-11 20:56:51 -04:00
Tobias Stoeckmann
7af593c140 Fixed test1 regression.
SIZEOF_SIZE_T might be only defined in config.h.

Include config.h for these systems to pass tests which are only
supposed to be run on 32 bit systems.

Fixes issue #666.
2020-09-11 21:09:40 +02:00
Eric Hawicz
785a94b7a2 Merge pull request #665 from stoeckmann/tokener
Handle more allocation failures in json_tokener* functions
2020-08-24 09:51:41 -04:00
Eric Hawicz
eb08a92218 Merge pull request #660 from stoeckmann/arraylist
Validate size arguments in arraylist functions.
2020-08-24 09:51:18 -04:00
Tobias Stoeckmann
369e8477d2 Validate size arguments in arraylist functions.
The array_list_new2 function, which is externally reachable through
json_object_new_array_ext, does not check if specified initial size
actually fits into memory on 32 bit architectures.

It also allows negative values, which could lead to an overflow on these
architectures as well. I have added test cases for these situations.

While at it, also protect array_list_shrink against too large
empty_slots argument. No test added because it takes a huge length
value, therefore a lot of items within the array, to overflow the
calculation. In theory this affects 64 bit sytems as well, but since the
arraylist API is not supposed to be used by external applications
according to its header file, the call is protected due to int
limitation of json_object_array_shrink.
2020-08-24 12:13:50 +02:00
Eric Hawicz
b4e72c2655 Merge pull request #664 from stoeckmann/string
Limit strings at INT_MAX length
2020-08-23 16:43:31 -04:00
Eric Hawicz
f941931804 Merge pull request #663 from stoeckmann/strerror
Properly format errnos in _json_c_strerror
2020-08-23 16:38:21 -04:00
Eric Hawicz
1bc7a6b223 Merge pull request #662 from stoeckmann/random
Prevent signed overflow in get_time_seed
2020-08-23 16:34:40 -04:00
Tobias Stoeckmann
df62119b7f Prevent signed overflow in get_time_seed
Casting time(2) return value to int and multiplying the result with
such a constant will definitely lead to a signed overflow by this day.

Since signed overflows are undefined behaviour in C, avoid this.

Casting to unsigned is more than enough since the upper bits of a
64 bit time_t value will be removed with the int conversion anyway.
2020-08-22 13:25:21 +02:00
Tobias Stoeckmann
bcb6d7d347 Handle allocation failure in json_tokener_new_ex
The allocation of printbuf_new might fail. Return NULL to indicate tis
error to the caller. Otherwise later usage of the returned tokener would
lead to null pointer dereference.
2020-08-22 13:18:10 +02:00
Tobias Stoeckmann
e50154f615 Cap string length at INT_MAX.
Several issues occur if a string is longer than INT_MAX:

- The function json_object_get_string_len returns the length of a string
  as int. If the string is longer than INT_MAX, the result would be
  negative.
- That in turn would lead to possible out of boundary access when
  comparing these strings with memcmp and the returned length as done in
  json_object_equal.
- If json_escape_str is called with such strings, out of boundary
  accesses can occur due to internal int handling (also fixed).
- The string cannot be printed out due to printbuffer limits at
  INT_MAX (which is still true after this commit).

Such huge strings can only be inserted through API calls at this point
because input files are capped at INT_MAX anyway.

Due to huge amount of RAM needed to reproduce these issues I have not
added test cases.
2020-08-22 13:16:36 +02:00
Tobias Stoeckmann
583911a66c Aligned comment in _json_object_new_string
The comment only aligns correctly if tab size is 4. Replaced
spaces with tabs to stay in sync with style of other lines.
2020-08-22 13:07:45 +02:00
Tobias Stoeckmann
4298431150 Properly format errnos in _json_c_strerror
The function _json_c_strerror does not properly format unknown errnos.
The int to ascii loop ignores the leading digit if the number can be
divided by 10 and if an errno has been formatted, shorter errnos would
not properly terminate the newly created string, showing the ending
numbers of the previous output.

A test case has been added to show these effects.

Since this function has been introduced for tests, the effect of this on
real life code is basically non-existing. First an environment variable
has to be set to activate this strerror code and second an unknown errno
would have to be encountered.
2020-08-22 11:35:50 +02:00
Eric Haszlakiewicz
2b439ea598 Fix json_object_get_boolean() doc for the object and array cases (always returns 0), and add those cases to the test_cast test.
See also issue #658.
2020-08-17 14:57:21 +00:00
Eric Hawicz
cf30cba4ac Merge pull request #657 from stoeckmann/getrandom
Use GRND_NONBLOCK with getrandom.
2020-08-15 15:01:41 -04:00
Tobias Stoeckmann
f052e42f56 Use GRND_NONBLOCK with getrandom.
The json-c library is used in cryptsetup for LUKS2 header information.
Since cryptsetup can be called very early during boot, the developers
avoid getrandom() calls in their own code base for now. [1]

Introducing a blocking getrandom() call in json-c therefore introduces
this issue for cryptsetup as well. Even though cryptsetup issues do not
have to be json-c issues, here is my proposal:

Let's use a non-blocking call, falling back to other sources if the call
would block. Since getrandom() accesses urandom, it must mean that we
are in an early boot phase -- otherwise the call would not block
according to its manual page.

As stated in manual page of random(4), accessing /dev/urandom won't
block but return weak random numbers, therefore this fallback would work
for json-c.

While at it, fixed the debug message.

[1] https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/47
    which references to https://lwn.net/Articles/800509/
2020-08-15 15:52:17 +02:00
Eric Hawicz
104b408ee8 Merge pull request #656 from pogaram/fix-warnings
Fixed warnings
2020-08-14 16:57:32 -04:00
Aram Poghosyan
0ffb384409 Fixed warnings 2020-08-14 11:45:33 +04:00
Eric Hawicz
98b7ee93fd Merge pull request #655 from MarcT512/issue654
json_parse: Fix read past end of buffer
2020-08-07 10:18:30 -04:00
Marc
4e9e44e525 Fix read past end of buffer
Resolves https://github.com/json-c/json-c/issues/654
2020-08-07 10:49:45 +01:00
Eric Haszlakiewicz
8c7849e6e3 Eliminate use of ctype.h and replace isdigit() and tolower() with non-locale-sensitive approaches. 2020-08-02 04:06:44 +00:00
Eric Haszlakiewicz
f3d8006d34 Neither vertical tab nor formfeed are considered whitespace per the JSON spec, remove them from is_ws_char(). 2020-08-02 03:59:56 +00:00
Eric Haszlakiewicz
8b43ff0c22 Merge the is_ws_char() and is_hex_char() changes to json_tokener from branch 'ramiropolla/for_upstream' (PR #464) 2020-08-02 02:55:45 +00:00
Eric Haszlakiewicz
bfec9c8685 Take a hint from PR #464 and use json_object_new_string_len() to avoid a needless extra strlen() call.
Also, create a _json_object_get_string_len() for internal use when we know
for sure the object we're dealing with is a json_type_string.
2020-08-02 02:23:01 +00:00
Eric Hawicz
56a89f902f Merge pull request #653 from lamby/966657-json-c-please-make-the-build-reproducible
Make the documentation build reproducibly
2020-08-01 22:06:38 -04:00
Chris Lamb
46eea84554 Make the documentation build reproducibly
Whilst working on the Reproducible Builds effort [0] I noticed that
json-c could not be built reproducibly.

This is because it used the full, absolute path name as an (sanitised)
input to a filename, resulting in some binary package containing, for
example:

  /usr/share/doc/libjson-c-dev/html/md__build_1st_json-c-0_815_issues_closed_for_0_813.html
                                        ^^^^^^^^^^^^^^^^^^^^^^
or

  /usr/share/doc/libjson-c-dev/html/md__build_2_json-c-0_815_2nd_issues_closed_for_0_813.html
                                        ^^^^^^^^^^^^^^^^^^^^^^^^

These differing values are based on the path in which json-c is built. This was
originally filed in Debian as #966657 [1].

 [0] https://reproducible-builds.org/
 [1] https://bugs.debian.org/966657
2020-08-01 11:26:55 +01:00
Eric Hawicz
88cce7b9c5 Merge pull request #651 from alanc/getrandom
Getrandom
2020-07-31 20:30:11 -04:00
Alan Coopersmith
6cf4847796 Use getrandom() if available in json_c_get_random_seed
Lower overhead than opening & reading from /dev/urandom, and works
in chroots and other situtations where /dev/urandom is not available.
Falls back to existing methods when kernel doesn't support the syscall.
2020-07-31 08:28:07 -07:00
Eric Haszlakiewicz
002411293d Issue #649: Drop the generated doc/Doxyfile when creating a release. 2020-07-28 03:52:22 +00:00
Eric Hawicz
66f8ca3c03 Merge pull request #650 from sartura/readme-update
README: fix spelling errors
2020-07-27 10:31:05 -04:00
Jakov Smolic
55bf2d365d README: fix spelling errors
Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
2020-07-27 15:05:55 +02:00
Eric Haszlakiewicz
47189b5ff1 Include updating the json-c-current-releaes gh-pages symlink as part of the release process. 2020-07-26 15:51:07 +00:00
Eric Haszlakiewicz
de02d09c32 Update the master branch to version 0.15.99 2020-07-26 15:26:53 +00:00
Eric Haszlakiewicz
870965e1ea Update AUTHORS, add issues_closed_for_0.15.md, tweak the release checklist slightly. 2020-07-24 03:17:13 +00:00
Eric Hawicz
616b1050b2 Merge pull request #648 from MarcT512/rbf
Fix "may be used uninitialized" Release build failure
2020-07-23 22:26:58 -04:00
Marc
4a23d3413d Fix "may be used uninitialized" Release build failure
Fixes https://github.com/json-c/json-c/issues/647
2020-07-23 18:19:12 +01:00
Eric Haszlakiewicz
730e3d044f Issue #594 - provide an OVERRIDE_GET_RANDOM_SEED cmake variable to override json_c_get_random_seed() for embedded platforms where time(NULL) doesn't work.
Example:
mkdir build && cd build
cmake -DOVERRIDE_GET_RANDOM_SEED='do { extern uint32_t getMsTicks(void); int ms = getMsTicks() * 433494437; return ms; } while(0)' ..
2020-07-22 02:25:03 +00:00
Eric Hawicz
64de4b6e9f Merge pull request #646 from pascal-cuoq/fix_645
Cast to unsigned char instead of int when calling tolower (Fixes #645)
2020-07-21 21:24:59 -04:00
Pascal Cuoq
1962ba7de3 Fixes #645 2020-07-21 17:54:26 +02:00
Eric Haszlakiewicz
024e835f4c Update the ChangeLog with recent changes, in preparation for a 0.15 release. 2020-07-20 03:39:01 +00:00
Eric Haszlakiewicz
78a0f2ea5d Remove the obsolete config.h.win32 2020-07-17 03:47:28 +00:00
Eric Haszlakiewicz
e46b9cdb7d Fix a number of things with the generated docs, including translating triple-backtick code blocks into a form doxygen understands. 2020-07-17 03:46:21 +00:00
Eric Haszlakiewicz
9a7de35b92 Add some more detail about how to use json-c in README.md. 2020-07-17 03:42:38 +00:00
Eric Haszlakiewicz
cb10a13e94 Remove the THIS_FUNCTION_IS_DEPRECATED define, we stopped using it long ago. 2020-07-17 03:20:29 +00:00
Eric Haszlakiewicz
2508109b18 Remove the obsolete README.json_object-split.md, and mark README.md as being the doxygen mainpage. 2020-07-12 19:16:19 +00:00
Eric Haszlakiewicz
4d9f6dd22e Issue #642: improve the docs for json_object_put() and json_object_get(). 2020-07-12 18:43:27 +00:00
Eric Haszlakiewicz
2330c6f0de Expand the doc for json_object_array_get_idx() to explain that it does not adjust refcounts. 2020-07-12 17:55:46 +00:00
Eric Haszlakiewicz
6542d33cd1 Issue #641: Add a cast to void * to address some theoretically undefined printf behavior. 2020-07-11 15:03:00 +00:00
Eric Haszlakiewicz
10a9ac245e Issue #642: improve docs for json_tokener.h and json_object_object_add(). 2020-07-11 04:04:58 +00:00
Eric Haszlakiewicz
6fa8b7ff42 Don't export json-c symbols starting with an underscore, put deprecated exports into a "JSONC_PRIVATE" version, and note stuff to do during releases.
See also PR #639 and issue #621
2020-07-04 19:00:10 +00:00
Eric Haszlakiewicz
6068d3f6d1 Change the strerror_override handling to check $_JSON_C_STRERROR_OVERRIDE instead of using a variable, so we don't need to export it. 2020-07-04 18:58:00 +00:00
Eric Hawicz
b01d50b8dc Merge pull request #639 from smcv/symbol-versions
build: Add a symbol version to all exported symbols
2020-07-04 14:26:20 -04:00
Simon McVittie
c2c94024f5 build: Add symbol versions to all exported symbols
With this version script, newly-linked binaries that depend on the
json-c shared library will refer to its symbols in a versioned form,
preventing their references from being resolved to a symbol of the same
name exported by json-glib or libjansson if those libraries appear in
dependency search order before json-c, which will usually result in
a crash. This is necessary because ELF symbol resolution normally uses
a single flat namespace, not a tree like Windows symbol resolution.
At least one symbol (json_object_iter_next()) is exported by all three
JSON libraries.

Linking with -Bsymbolic is not enough to have this effect in all cases,
because -Bsymbolic only affects symbol lookup within a shared object,
for example when json_object_set_serializer() calls
json_object_set_userdata(). It does not affect calls from external
code into json-c, unless json-c was statically linked into the
external caller.

This change will also not prevent code that depends on json-glib or
libjansson from finding json-c's symbols and crashing; to prevent
that, a corresponding change in json-glib or libjansson would be needed.

Adding a symbol-version is a backwards-compatible change, but once
added, removing or changing the symbol-version on a symbol would be an
incompatible change that requires a SONAME bump.

Resolves: https://github.com/json-c/json-c/issues/621
(when combined with an equivalent change to libjansson).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-07-01 18:24:26 +01:00
Eric Haszlakiewicz
6465e74020 Use constants referring to the signed integer types when setting SSIZE_T_MAX.
In practice, the sizes of the signed and unsigned integer types will
almost cetainly be the same, but this is more correct.
Pointed out in issue #638.
2020-07-01 00:34:46 +00:00
Eric Haszlakiewicz
34334e5d3f Replace one call to json_object_new_array() with json_object_new_array_ext() to ensure it at least minimally works. 2020-06-29 02:35:26 +00:00
Eric Haszlakiewicz
0b67caec1a Add doc comment for json_object_new_array_ext(). 2020-06-29 02:31:32 +00:00
Eric Haszlakiewicz
a4e3700972 Fix code formatting 2020-06-29 02:31:18 +00:00
Eric Haszlakiewicz
5f3bf70f03 Make sure TEST_PARSE_CHUNKSIZE is valid if it's set. 2020-06-29 02:18:34 +00:00
Eric Haszlakiewicz
f23486a321 In the json_tokener_state_number case, explicitly adjust what "number" characters are allowed based on the exact micro-state that we're in, and check for invalid following characters in a different way, to allow a valid json_type_number object to be returned at the top level.
This causes previously failing strings like "123-456" to return a valid json_object with the appropriate value.  If you care about the trailing content, call json_tokener_parse_ex() and check the parse end point with json_tokener_get_parse_end().
2020-06-29 02:14:26 +00:00
Eric Haszlakiewicz
6eac6986c9 Fix incremental parsing of invalid numbers with exponents, such as "0e+-" and "12.3E12E12", while still allowing "0e+" in non-strict mode.
Deprecate the json_parse_double() function from json_util.h
2020-06-27 15:35:04 +00:00
Eric Haszlakiewicz
84e6032883 Issue #635: Fix "expression has no effect" warning in json_tokener.c by casting to void. 2020-06-23 02:51:46 +00:00
Eric Haszlakiewicz
7a72805e34 Fix memory leak in test_parse's single_incremental_parse(). 2020-06-22 01:12:03 +00:00
Eric Haszlakiewicz
7d3c2d9fad Drop extra blank lines from arraylist.h 2020-06-21 18:30:40 +00:00
Eric Haszlakiewicz
a68566bf6a Issue #616: Change the parsing of surrogate pairs in unicode escapes so it uses a couple of additional states instead of assuming the low surrogate is already present, to ensure that we correctly handle various cases of incremental parsing. 2020-06-21 18:29:57 +00:00
Eric Haszlakiewicz
197e372464 In test_parse, fix lengths passed during a couple of incremental tests.
Add an optional way to use an incremental chunk size ($TEST_PARSE_CHUNKSIZE)
for all of the single_basic_parse tests, in additional to the regular way.
2020-06-21 17:36:38 +00:00
Eric Haszlakiewicz
36118b681e Rearrange the json_tokener_state_escape_unicode case in json_tokener to simplify the code slightly and make it a bit easier to understand.
While here, drop the utf8_replacement_char that is unnecesarily added if we run out of input in the middle of a unicode escape.  No other functional changes (yet).
2020-06-21 03:10:55 +00:00
Eric Haszlakiewicz
50179fb09f Update the json_tokener_parse_ex() docs to clarify that the final '\0' character is to be included in length passed in. 2020-06-21 02:35:42 +00:00
Eric Hawicz
da76ee26e7 Merge pull request #633 from dota17/issue616
fix issue 616: support the surrogate pair in split file.
2020-06-20 22:33:17 -04:00
Eric Haszlakiewicz
e26a1195f4 Add json_object_array_shrink() (and array_list_shrink()) and use it in json_tokener to minimize the amount of memory used. This results in a 39%-50% reduction in memory use (peak RSS, peak heap usage) on the jc-bench benchmark and 9% shorter runtime.
Also add the json_object_new_array_ext, array_list_new2, and array_list_shrink functions.
2020-06-20 18:03:04 +00:00
Eric Hawicz
99bb2121c6 Merge pull request #632 from json-c/json_object-split
Json object split
2020-06-20 13:04:32 -04:00
Eric Haszlakiewicz
0710c835a1 Reformat the json_object-split branch with clang-format 2020-06-16 13:17:58 +00:00
Eric Hawicz
401b29c021 Merge pull request #634 from micahsnyder/json-c-fPIC
Issue #508: `-fPIC` to link libjson-c.a with libs
2020-06-14 17:56:35 -04:00
Micah Snyder
60494684a1 Issue #508: -fPIC to link libjson-c.a with libs
json-c has symbol collisions with other popular C JSON libraries.
To prevent random crashes in downstream applications that may use a
library which depends on json-c, the solution is to statically link
libjson-c.a into those libraries.

`-fPIC`/`-fPIE` is required when building a `.a` so it can be linked
into a `.so`.
2020-06-14 12:35:49 -04:00
Eric Haszlakiewicz
9128ec49b1 Include unistd.h to fix the build on OSX 2020-06-14 03:11:44 +00:00
Eric Haszlakiewicz
5ebfeaedc5 Drop the _delete field from struct json_object and call the type-specific delete functions directly from json_object_put. (Thanks @dota17 for the suggestion in PR #632!) 2020-06-13 18:34:35 +00:00
Eric Haszlakiewicz
4c10712114 Drop the useless "char data[1]" from struct json_object. Fix a typo in a comment. 2020-06-13 18:25:32 +00:00
dota17
c1b872d817 fix issue 616: support the surrogate pair in split file. 2020-06-08 17:19:32 +08:00
Eric Haszlakiewicz
85c244f048 Eliminate unnecessary cast that was added to test_double_serializer. 2020-06-07 18:50:10 +00:00
Eric Haszlakiewicz
02fe2e0ccd Summarize the changes from the json_object-split branch in the ChangeLog. 2020-06-07 18:45:17 +00:00
Eric Haszlakiewicz
ecdfeb18cf Move the ssize_t typedef from json_inttypes.h to json_object_private.h so as not to affect publically exposed symbols. 2020-06-07 18:29:56 +00:00
Eric Haszlakiewicz
66d91fdf86 The split of json_object into type-specific sub-structures is now functionally complete.
Remove all of the temporary defines, structures, old compat fuctions, extra fields, etc... that were needed during the conversion to a split set of json_object_* structures.
2020-06-07 17:23:56 +00:00
Eric Haszlakiewicz
c4cc673071 More fixes for old MSVC builds. 2020-06-07 15:25:59 +00:00
Eric Haszlakiewicz
0a16b23adf Fix typo in previous commit to check for SSIZE_T on MSVC. 2020-06-07 15:19:29 +00:00
Eric Haszlakiewicz
eab1375123 Change CMakeLists.txt to look for SSIZE_T on MSVC too. 2020-06-07 03:36:59 +00:00
Eric Haszlakiewicz
b0466b626b On MSVC, add a ssize_t typedef using SSIZE_T from BaseTsd.h 2020-06-07 03:27:13 +00:00
Eric Haszlakiewicz
0fc9d91277 Kick json_type_string out of struct json_object.
The default is now that string data is stored inline at the end of json_object, though to allow for json_object_set_string() to set a _longer_ string, we still need to allow for the possibility of a separate char * pointer.
All json types have been split out now, next step it cleanup.
2020-06-07 02:56:59 +00:00
Eric Hawicz
bc06f82f85 Merge pull request #628 from clamwin/compat-fixes-master
get_cryptgenrandom_seed: compat with old windows + fallback
2020-06-03 23:53:46 -04:00
Gianluigi Tiesi
481d0a8ede get_cryptgenrandom_seed: compat with old windows + fallback 2020-06-03 07:51:42 +02:00
Eric Haszlakiewicz
1c6086a86a Apply the fix from @pointbre in issue #626 to skip "inline" on AIX, but invert the test to make it a little easier to understand. 2020-05-31 03:22:14 +00:00
Eric Haszlakiewicz
fe308b8862 Issue #626: Restore compatibility with cmake 2.8 by adjusting quoting and explicitly defining the PROJECT_VERSION* variables. 2020-05-30 19:37:46 +00:00
Eric Haszlakiewicz
9ecb1222bd Kick json_type_int and json_type_double out of struct json_object.
Clean up the code in json_object_new_* a bit by dropping unnecesary json_object_base variables.
2020-05-26 02:31:35 +00:00
Eric Haszlakiewicz
0351bb55c8 Declare variables earlier, to appease Visual Studio 2010. 2020-05-25 04:10:11 +00:00
Eric Haszlakiewicz
d1f83bf5ea Kick json_type_boolean out of struct json_object. 2020-05-25 04:05:32 +00:00
Eric Haszlakiewicz
5d89fc8a9d Add some backwards compat for Visual Studio 2013. 2020-05-25 03:52:36 +00:00
Eric Haszlakiewicz
02b687b9a6 Kick json_type_array out of struct json_object; re-enable the test_deep_copy test. 2020-05-25 03:44:56 +00:00
Eric Haszlakiewicz
853b4b5dee Start splitting struct json_object into multiple sub-types, as descibed at https://github.com/json-c/json-c/wiki/Proposal:-struct-json_object-split
The current changes split out _only_ json_type_object, and thus have a number of hacks
 to allow the code to continue to build and work.

Originally  mentioned in issue #535.
When complete, this will probably invalidate #552.
This is likely to cause notable conflicts in any other significant un-merged
changes, such as PR#620.
2020-05-25 03:18:36 +00:00
Eric Haszlakiewicz
4a546e7b2f In arraylist, use malloc instead of calloc, avoid clearing with memeset until we really need to, and micro-optimize array_list_add(). 2020-05-24 03:54:04 +00:00
Eric Hawicz
fbe1543644 Merge pull request #622 from besser82/topic/besser82/doc_subdir
doc: Move Doxyfile into doc subdir.
2020-05-18 15:30:21 -04:00
Björn Esser
1e94da779a CMake: Fix grammar: written -> wrote. 2020-05-18 20:36:16 +02:00
Björn Esser
61e2bae511 doc: Move Doxyfile into doc subdir 2020-05-18 20:36:16 +02:00
Eric Haszlakiewicz
fa6a7dccb9 With the change in cc80203, Doxyfile no longer needs to be updated for a release. 2020-05-18 17:31:22 +00:00
Eric Hawicz
cc802039a8 Merge pull request #619 from besser82/topic/besser82/doxygen_oot
CMake: Fix out-of-tree build for Doxygen documentation.
2020-05-18 13:30:13 -04:00
Eric Hawicz
12b2e1159d Merge pull request #618 from besser82/topic/besser82/test_deep_copy
test_deep_copy: Fix assertion value.
2020-05-18 13:29:21 -04:00
Björn Esser
8f3592b3d5 CMake: Fix out-of-tree build for Doxygen documentation. 2020-05-18 18:20:33 +02:00
Björn Esser
3008401b2a test_deep_copy: Fix assertion value. 2020-05-18 17:06:37 +02:00
Eric Hawicz
a8a0590921 Merge pull request #617 from besser82/topic/besser82/option_disable_tls
Add an option to disable the use of thread-local storage.
2020-05-18 10:25:54 -04:00
Björn Esser
a85d2395ff README: Update configuration options for CMake. 2020-05-18 12:41:18 +02:00
Björn Esser
76dd99abb2 CMake: Re-format config-option block and re-order it alphabetically. 2020-05-18 12:34:08 +02:00
Björn Esser
78642dcb9b CMake: Add an option to disable the use of thread-local storage.
Using thread-local storage may not be desired in all environments
and/or use-cases, thus there should be an option to disable its use
on purpose.

Fixes #451.
2020-05-18 12:27:19 +02:00
Björn Esser
dd040ba446 tests: Fix test_double_serializer without thread-local storage. 2020-05-18 12:27:00 +02:00
Eric Hawicz
5b15c7567d Merge pull request #614 from stoeckmann/format
Prevent truncation on custom double formatters.
2020-05-16 21:04:11 -04:00
Eric Hawicz
311c5e5b2b Update issue templates 2020-05-16 20:55:20 -04:00
Tobias Stoeckmann
5385a566db Prevent truncation on custom double formatters.
A custom double formatter can lead to truncation of the rest of the
JSON document.

If a custom formatter completely fills the buffer used by snprintf
with a trailing dot or comma and the formatting option
JSON_C_TO_STRING_NOZERO has been specified, then an iterator moves
past the ending '\0' (off-by-one buffer overflow) to set an
additional '\0' and adds the first '\0' into the printbuf.

Since '\0' will eventually be considered the terminating character
of the complete printbuf result, all trailing characters are lost.

This leads to an incomplete JSON string as can be seen with the
test case.

The off-by-one can be noticed if compiled with address sanitizer.

Since this is a very special case and a malformed formatter could
do way more harm and is the responsibility of the user of this
library, this is just a protective measure to keep json-c code as
robust as possible.
2020-05-16 15:26:16 +02:00
Eric Haszlakiewicz
0a3d22b9bb Revert part of PR#606 and use isnan/isinf again, but provide macro implementations of those in math_compat.h is needed, as it seems to be on AIX and IBM i systems. 2020-05-16 01:29:18 +00:00
Eric Hawicz
1526c84a13 Merge pull request #606 from davidjmccann/master
Improved support for IBM operating systems
2020-05-15 21:15:18 -04:00
David McCann
add7b13a9a Improved support for IBM operating systems
Fix compiler errors and warnings when building on IBM operating systems such as AIX and IBM i.
2020-05-14 15:39:35 +01:00
Eric Haszlakiewicz
d414d3eabc Issue #604: add check for __MINGW32__ in snprintf_compat.h 2020-05-13 14:53:05 +00:00
Eric Haszlakiewicz
2e71fe0963 Display a bit of info about what exactly we're benchmarking. 2020-05-11 03:05:20 +00:00
Eric Haszlakiewicz
199c52e2db Ignore the bench/work and bench/data directories. 2020-05-11 03:04:10 +00:00
Eric Hawicz
3648c3ed2c Merge pull request #602 from ploxiln/parse_uint64_errno
fix json_parse_uint64() usage of errno
2020-05-10 21:15:47 -04:00
Pierce Lopez
003b58782b fix json_parse_uint64() usage of errno
introduced in #542
fixes #601
2020-05-10 13:38:12 -04:00
Eric Haszlakiewicz
26f080997d Fix snprintf on windows problem for test4. 2020-05-10 04:04:28 +00:00
Eric Haszlakiewicz
06742d6277 Issue #600: don't rename the static library on Windows, it _needs_ to have a different name because the dll build also creates a "json-c.lib" file. 2020-05-10 03:58:51 +00:00
Eric Haszlakiewicz
a59d5acfab Re-format after recent change to fix linkhash. 2020-05-10 03:58:27 +00:00
Eric Haszlakiewicz
4f43a077a4 Issue #598: avoid building static libraries twice. 2020-05-10 03:48:45 +00:00
Eric Haszlakiewicz
519dfe1591 Issue #599: Fix the backwards check in lh_table_insert_w_hash() that was preventing adding more than 11 objects.
Add a test to check for this too.
2020-05-10 03:36:05 +00:00
Eric Hawicz
45b6416652 Merge branch 'master' of https://github.com/json-c/json-c 2020-05-08 22:25:15 -04:00
Eric Hawicz
abc9a0731b Merge pull request #597 from ploxiln/json_parse_usage
json_parse demo: fix and use usage() function
2020-05-08 22:23:28 -04:00
Pierce Lopez
090ae4e4d4 json_parse demo: fix and use usage() function 2020-05-08 18:27:35 -04:00
Eric Hawicz
22870ac2bd Merge pull request #595 from dota17/static_shared
Support to build both static and shared libraries
2020-05-07 23:23:15 -04:00
hofnarr
a100573eec cmake-configure: fix enable-static option 2020-05-08 02:27:06 +03:00
hofnarr
558ef8609c cmake: change variable name 2020-05-08 02:19:38 +03:00
hofnarr
929d74512a cmake: add list for build targets 2020-05-08 02:16:52 +03:00
dota17
e97fc20bfd update 2020-05-07 14:50:43 +08:00
Eric Hawicz
31243e4d12 Merge pull request #592 from stoeckmann/oob
Prevent out of boundary write on malicious input
2020-05-06 23:31:15 -04:00
Tobias Stoeckmann
d07b910149 Fix integer overflows.
The data structures linkhash and printbuf are limited to 2 GB in size
due to a signed integer being used to track their current size.

If too much data is added, then size variable can overflow, which is
an undefined behaviour in C programming language.

Assuming that a signed int overflow just leads to a negative value,
like it happens on many sytems (Linux i686/amd64 with gcc), then
printbuf is vulnerable to an out of boundary write on 64 bit systems.
2020-05-06 20:46:12 +02:00
dota17
952db0f397 support to build both static and shared libraries 2020-05-06 14:46:47 +08:00
Tobias Stoeckmann
77d935b7ae Prevent division by zero in linkhash.
If a linkhash with a size of zero is created, then modulo operations
are prone to division by zero operations.

Purely protective measure against bad usage.
2020-05-04 19:46:45 +02:00
Tobias Stoeckmann
099016b7e8 Protect array_list_del_idx against size_t overflow.
If the assignment of stop overflows due to idx and count being
larger than SIZE_T_MAX in sum, out of boundary access could happen.

It takes invalid usage of this function for this to happen, but
I decided to add this check so array_list_del_idx is as safe against
bad usage as the other arraylist functions.
2020-05-04 19:41:16 +02:00
Eric Haszlakiewicz
8e3d3d5544 Make the benchmark work with pre-cmake versions of json-c. Fetch a few more data files. 2020-05-04 03:40:40 +00:00
Eric Haszlakiewicz
c66e7377f3 In jc-bench.sh, decode the --before and --after args. Use a separate data dir to avoid re-downloading files when the work dir is cleared. 2020-05-04 03:24:39 +00:00
Eric Haszlakiewicz
8086314026 Issue #589: drop the rdrand test loops to just 3, tweak comments and add some links to bug reports, and decrease the nesting level of the has_rdrand() function. 2020-05-04 01:33:15 +00:00
Eric Hawicz
a555d0e2f2 Merge pull request #589 from Xyene/detect-broken-rdrand
Detect broken RDRAND during initialization
2020-05-03 21:13:48 -04:00
Tudor Brindus
4d36b0287d Detect broken RDRAND during initialization
Some CPUs advertise RDRAND in CPUID, but return 0xFFFFFFFF
unconditionally. To avoid locking up later, test RDRAND during
initialization, and if it returns 0xFFFFFFFF, mark it as nonexistent.

Fixes #588.
2020-05-03 15:15:24 -04:00
Eric Hawicz
9b64c3e347 Fix printf format issues in apps/json_parse, and actually call the usage() function. 2020-05-03 14:55:12 -04:00
Eric Hawicz
ee90110f9b Merge pull request #590 from Xyene/fix-cpuid-segfault
Fix segmentation fault in CPUID check
2020-05-03 14:52:31 -04:00
Tudor Brindus
0e5bbcaa16 Fix segmentation fault in CPUID check 2020-05-03 14:39:31 -04:00
Eric Haszlakiewicz
f9605e9072 Fix cmake-configure to accept "--prefix=<foo>" in addition to "--prefix <foo>" (see also Issue #591) 2020-05-03 03:50:50 +00:00
Eric Haszlakiewicz
1059007024 Add an initial version of a benchmarking harness for json-c, to be able to more easily compare the performance of different library versions. 2020-04-27 04:00:00 +00:00
Eric Haszlakiewicz
d9981f67dd Extend the CMakeLists.txt in the apps directory to be usable as a standalone build, to link against other versions of json-c.
Tweak json_parse.c slightly to allow it to build against older json-c versions.
2020-04-26 04:02:36 +00:00
Eric Haszlakiewicz
00272292a7 The json_parse command line app doesn't build on Windows, disable it. 2020-04-21 21:35:41 +00:00
Eric Haszlakiewicz
55d053118e Add an apps directory, and a json_parse program to parse an input file and report on memory usage.
This is intended to provide a way, during development, to test out the memory
and performance impacts of a change.
2020-04-21 03:57:56 +00:00
Eric Haszlakiewicz
f6f76f9430 Add a JSON_TOKENER_ALLOW_TRAILING_CHARS flag for json_tokener_set_flags() to allow multiple objects to be parsed from input even when JSON_TOKENER_STRICT is set. 2020-04-21 03:53:44 +00:00
Eric Haszlakiewicz
05623b3a2e Add an tok_flags field to explicitly specify tokener flags in test_parse and eliminate the previous bogus calls to json_tokener_set_flags() 2020-04-21 03:53:44 +00:00
Eric Haszlakiewicz
fa6bc1e2d7 Issue #471: always create directories with mode 0755, regardless of umask. 2020-04-21 03:19:17 +00:00
Eric Haszlakiewicz
8b511c402b Issue #585: don't install config.h 2020-04-21 01:13:21 +00:00
Eric Haszlakiewicz
ba4527904a Add a few missing git commands to the release checklist, and change the S3 storage to "Standard", since it's actually (barely) cheaper than "Reduced Redundancy" now. 2020-04-19 04:17:29 +00:00
Eric Haszlakiewicz
2babb5b780 Update the master branch to version 0.0.14.99 2020-04-19 03:57:08 +00:00
Eric Haszlakiewicz
31ab57ca8b Fill in the ChangeLog for the upcoming 0.14 release. 2020-04-19 01:31:48 +00:00
Eric Haszlakiewicz
9ed00a694b Fill in a few more pre-release steps to match what we've done for the 0.14 release.
Move the list of contributors to the AUTHORS file.
2020-04-19 01:28:24 +00:00
Eric Haszlakiewicz
4badbe9c20 Rewrite the issued_closed_for_* files so they display a bit nicer. 2020-04-18 03:22:52 +00:00
Eric Haszlakiewicz
0a95f98b8d Explicitly mark several things in json_tokener deprecated. 2020-04-18 02:42:46 +00:00
Eric Haszlakiewicz
ecb9354bb1 Re-do clang-format. 2020-04-18 02:14:13 +00:00
Eric Haszlakiewicz
23ddcbd4da Make json_abort() internal to json_object.c 2020-04-18 02:05:37 +00:00
Eric Haszlakiewicz
5cc11289b4 Make json_tokener_validate_utf8() internal to json_tokener.c, and improve the docs a bit. 2020-04-18 02:02:06 +00:00
Eric Haszlakiewicz
4dc0f1718e Merge pull request #582 from dota17/list_closed_issue_pr
add the list of issues& prs closed
2020-04-17 13:32:17 -04:00
dota17
4313465f25 update 2020-04-17 09:47:30 +08:00
dota17
8bdb420d0f manual adjustment 2020-04-16 16:30:14 +08:00
dota17
6bf6a9e248 add the list of issues& prs closed 2020-04-16 16:15:04 +08:00
Eric Haszlakiewicz
a9114392b4 Merge pull request #524 from dota17/addTestCase_obj_token
Increase coverage
2020-04-15 23:35:21 -04:00
Eric Haszlakiewicz
04bb0fca73 Merge pull request #581 from Jehan/wip/Jehan/no-strict-prototypes-windows
CMakeLists: do not enforce strict prototypes on Windows.
2020-04-15 23:32:59 -04:00
dota17
b14363ae32 remove unsuitable case 2020-04-15 20:06:12 +08:00
Jehan
8c33d1c3c9 CMakeLists: do not enforce strict prototypes on Windows.
On Windows, or at least when cross-built with Mingw-w64, build fails
because strict prototype fails on an included file (thus nothing we can
do about in json-c code):

> from /home/jehan/dev/src/json-c/json_util.c:44:
> /home/jehan/.local/share/crossroad/roads/w64/json-c/include/minwindef.h:196:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
>   196 |   typedef INT_PTR (WINAPI *FARPROC) ();
>       |   ^~~~~~~
> /home/jehan/.local/share/crossroad/roads/w64/json-c/include/minwindef.h:197:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
>   197 |   typedef INT_PTR (WINAPI *NEARPROC) ();
>       |   ^~~~~~~
> /home/jehan/.local/share/crossroad/roads/w64/json-c/include/minwindef.h:198:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
>   198 |   typedef INT_PTR (WINAPI *PROC) ();
>       |   ^~~~~~~

Let's just disable the errors for Windows build.
2020-04-15 13:03:11 +02:00
Eric Haszlakiewicz
7fb8d56458 Merge pull request #580 from besser82/topic/besser82/fix_cmake_tests
Fix CMake tests for enforced strict prototypes.
2020-04-14 15:17:21 -04:00
Björn Esser
053eaa61d7 Fix CMake tests for enforced strict prototypes. 2020-04-14 20:42:32 +02:00
Eric Haszlakiewicz
ab5425a6a6 Merge pull request #527 from dota17/arraylist_test
Arraylist testcase
2020-04-14 10:28:16 -04:00
Eric Haszlakiewicz
511edb51a4 Merge pull request #579 from besser82/topic/besser82/strict-prototypes
Enforce strict prototypes.
2020-04-14 10:25:13 -04:00
dota17
2876fcc137 clang-format two test_util_file.c and test_object_iterator.c 2020-04-14 10:15:27 +08:00
chenguoping
8096125618 Increased the test coverage of json_util.c from 76% to 90.3%. 2020-04-14 10:10:47 +08:00
chenguoping
f56c5c1a60 Increased the test coverage of json_object_iterator.c from 0% to 100% 2020-04-14 10:03:58 +08:00
dota17
74bbe349c4 clang-format test1.c 2020-04-14 09:20:51 +08:00
chenguoping
110c60fcdd fix valgrind errors 2020-04-14 09:13:29 +08:00
chenguoping
76e1472808 testcase for array_list 2020-04-14 09:13:06 +08:00
Björn Esser
d0dc3489dc Enforce strict prototypes. 2020-04-13 11:29:52 +02:00
Eric Haszlakiewicz
4742a2ab1d Merge pull request #578 from besser82/topic/besser82/pkgconfig_install
CMake: Install pkgconfig file in proper location by default
2020-04-12 20:52:01 -04:00
Björn Esser
165e6f58fc CMake: Install pkgconfig file in proper location by default
The default location for pkconfig files on most systems is:
  ${CMAKE_INSTALL_LIBDIR}/pkgconfig

Thus the file should get installed in there by default.
2020-04-12 19:21:54 +02:00
Eric Haszlakiewicz
8269f90956 Merge pull request #577 from besser82/topic/besser82/json_c_version_test_verbose_on_fail
Be verbose on failing json_c_version test.
2020-04-11 22:35:40 -04:00
Björn Esser
5e699f7f73 Be verbose on failing json_c_version test. 2020-04-11 21:09:31 +02:00
Eric Haszlakiewicz
c58d56ab7c Merge pull request #576 from besser82/topic/besser82/increase_coverage
Test coverage for json_c_version.
2020-04-11 14:45:45 -04:00
Eric Haszlakiewicz
d52f1ff2c1 Merge pull request #575 from besser82/topic/besser82/cosmetics
Small cosmetics.
2020-04-11 14:18:37 -04:00
Björn Esser
d47fb12e85 Test coverage for json_c_version. 2020-04-11 12:33:59 +02:00
Björn Esser
73a2ed115a Remove multiple trailing newlines at EOF. 2020-04-11 10:35:42 +02:00
Björn Esser
fd0ae5aba6 gitignore: Add build folder. 2020-04-11 09:41:04 +02:00
Björn Esser
78cd37fb18 Clean trailing white-space. 2020-04-11 09:41:04 +02:00
Björn Esser
37355cf0e6 Fix line terminators to be UNIX. 2020-04-11 09:40:57 +02:00
Eric Haszlakiewicz
270dc2f999 Update README.md to remove autoconf instructions in favor of cmake. 2020-04-11 03:24:51 +00:00
Eric Haszlakiewicz
0734c5303d Merge pull request #572 from besser82/topic/besser82/cmake_fixes
Small fixes to CMakeLists
2020-04-10 22:08:27 -04:00
Chen
69ceb38f2f Merge pull request #573 from besser82/topic/besser82/coverage
Fix coveralls submission.
2020-04-11 09:31:43 +08:00
Björn Esser
0dac15c1ca Fix coveralls submission.
coveralls-cpp is dead and does not work anymore.
Fortunately there is coveralls-lcov available.
2020-04-10 18:07:38 +02:00
Björn Esser
e756777c92 CMake: Check whether BSYMBOLIC is supported by the linker.
Linking with '-Bsymbolic-functions' is supported for ELF-binaries, only.
2020-04-10 17:29:35 +02:00
Björn Esser
58670ec64e CMake: Build Doxygen documentation out-of-tree. 2020-04-10 14:20:57 +02:00
Björn Esser
a989651bd4 CMake: Fix appending of linker flags.
There was a typo in `CMAKE_SHARED_LINKER_FLAGS`.
2020-04-10 14:16:02 +02:00
Eric Haszlakiewicz
61392c867f List the set of contributors since the 0.13 branch 2020-04-10 02:11:48 +00:00
Eric Haszlakiewicz
0a070ef312 Fix one more assert("!invalid cint_type") to use json_abort(...) instead. 2020-04-10 01:26:04 +00:00
Eric Haszlakiewicz
545464322b Issue #568: fix the strtoll and strtoull handing so config.h ends up creating defines for those only when needed, which should exclude mingw environments. 2020-04-09 20:58:28 +00:00
Eric Haszlakiewicz
b64bdfe381 Remove autoconf files from .gitignore. 2020-04-09 02:55:21 +00:00
Eric Haszlakiewicz
0c60125211 Update the oss-fuzz build script to try to get it to work with cmake. 2020-04-09 02:35:41 +00:00
Eric Haszlakiewicz
95737df9d4 Remove autoconf machinery, we're using cmake now. Update the release checklist to account for that, plus fill in other tasks and clean it up a bit. 2020-04-09 02:15:31 +00:00
Eric Haszlakiewicz
96ab2f6596 osx builds also need -DDISABLE_BSYMBOLIC=ON 2020-04-08 03:04:27 +00:00
Eric Haszlakiewicz
96bb334650 I have NFC why osx fails when "set -e" is in effect, but leave it off and clean up the rest of the debuging code in the travis config. 2020-04-08 02:54:10 +00:00
Eric Haszlakiewicz
f357081b57 Not all systems (e.g. osx) have malloc.h, include stdlib.h instead. 2020-04-08 02:53:48 +00:00
Eric Haszlakiewicz
2782a6b62c Try yet again to fix the osx build, this time do set +e 2020-04-08 02:39:03 +00:00
Eric Haszlakiewicz
a86ae1df9a Another attempt at debugging the travis osx build, this time just ignore errors. 2020-04-08 02:28:02 +00:00
Eric Haszlakiewicz
829e0829dd Wait a while before exiting travis to allow output to flush. 2020-04-08 02:17:14 +00:00
Eric Haszlakiewicz
cf8421c36d Apparently cmake is already installed on travis osx builds. Try another approach to figure out what was failing. 2020-04-08 02:02:25 +00:00
Eric Haszlakiewicz
fb0b653612 Install cmake on osx travis builds. s/make check/make test/ 2020-04-08 01:45:49 +00:00
Eric Haszlakiewicz
a3b82cbc77 Perform the travis build in a subdir, so the distcheck target works. 2020-04-08 01:34:22 +00:00
Eric Haszlakiewicz
677a8ccf44 Switch travis to use cmake instead of autoconf. 2020-04-08 01:21:11 +00:00
Eric Haszlakiewicz
19bbf2c069 Add includes and split off json_types.h to help ensure that headers can be included in any order. 2020-04-06 13:55:27 +00:00
Eric Haszlakiewicz
5e19c26cae Don't let clang-format rearrange Windows includes, since they need to be in a particular order. 2020-04-06 02:47:34 +00:00
Eric Haszlakiewicz
9acc4e9d71 Format random_seed.c with clang-format, with key asm sections excluded. 2020-04-06 01:52:28 +00:00
Eric Haszlakiewicz
9a494081cb Update the style guide to mention that we're using clang-format now. 2020-04-06 01:49:14 +00:00
Eric Haszlakiewicz
31f1ab2be1 Merge pull request #555 from dota17/chang_format_3
Format json-c with clang-format tool
2020-04-03 00:13:34 -04:00
dota17
8b162c4b89 clang-format the files 2020-04-03 11:39:30 +08:00
dota17
c117d8a8a8 add the disabling formatting coments and adjust the partial code manuly 2020-04-03 11:28:04 +08:00
dota17
a8cec740f0 add options 2020-04-03 11:27:25 +08:00
dota17
df7833e9a3 clang-format 2020-04-03 11:27:08 +08:00
Eric Haszlakiewicz
ed54353d84 Merge pull request #563 from robybeen/master
Changed order of calloc args to match stdlib
2020-04-02 22:35:21 -04:00
Robert
5d9b8e0fef Changed order of calloc args to match stdlib (2)
Although it is currently working, it's worth to stick with the stdlib definition to avoid further problems
2020-04-02 19:28:55 +02:00
Robert
56f81811c2 Changed order of calloc args to match stdlib
Although it is currently working, it's worth to stick with the stdlib definition to avoid further problems
2020-04-02 19:23:10 +02:00
Eric Haszlakiewicz
6afcf1606b Merge pull request #562 from dota17/testcase_add
Bugfix and testcases supplements
2020-04-02 11:23:39 -04:00
dota17
3822177473 add test cases 2020-03-31 19:12:45 +08:00
Chen
c2ba379b03 Merge pull request #561 from dota17/add_badge
add the badge in README.md and test the coveralls
2020-03-31 10:54:45 +08:00
dota17
203bacb24d add the badge in README.md and test the coveralls 2020-03-30 17:17:28 +08:00
Chen
d1650a582e Merge pull request #541 from dota17/coveralls_final
add coveralls auto tool to json-c
2020-03-28 10:42:17 +08:00
dota17
541a0b609a modify the coveralls configuration file 2020-03-23 11:38:18 +08:00
Chen
353ef26bda Merge pull request #558 from dota17/doc_message_modify
modify the doc target message
2020-03-20 11:17:20 +08:00
dota17
1204a1fded modify the doc target message 2020-03-19 10:27:27 +08:00
Eric Haszlakiewicz
a06339215e Merge pull request #556 from Jehan/wip/Jehan/fix-broken-mingw-w64
Fixes various Wreturn-type and Wimplicit-fallthrough errors on Mingw-w64
2020-03-16 21:24:14 -05:00
Jehan
b15e7ba470 Fixes various Wreturn-type and Wimplicit-fallthrough errors on Mingw-w64
This is a recent regression since commit
6359b79847 which added various assert(0)
calls (often replacing return-s).
With Ming-W64 compiler, json-c build was failing with various errors of
the sort:

> /home/jehan/dev/src/json-c/json_object.c: In function 'json_object_int_inc':
> /home/jehan/dev/src/json-c/json_object.c:841:1: error: control reaches end of non-void function [-Werror=return-type]
>   841 | }
>       | ^
> In file included from /home/jehan/dev/src/json-c/json_object.c:17:
> /home/jehan/dev/src/json-c/json_object.c: In function 'json_object_get_double':
> /home/jehan/.local/share/crossroad/roads/w64/json-c/include/assert.h:76:4: error: this statement may fall through [-Werror=implicit-fallthrough=]
>    76 |   (_assert(#_Expression,__FILE__,__LINE__),0))
>       |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/jehan/dev/src/json-c/json_object.c:1070:7: note: in expansion of macro 'assert'
>  1070 |       assert(0);
>       |       ^~~~~~
> /home/jehan/dev/src/json-c/json_object.c:1072:3: note: here
>  1072 |   case json_type_boolean:
>       |   ^~~~

The problem is that Mingw-w64 does not consider assert() as a noreturn
(even assert(0)), because it has to be compatible by Microsoft
libraries. See the discussion here:
https://sourceforge.net/p/mingw-w64/bugs/306/

Instead let's create a new json_abort() function which is basically just
an abort() function with an optional message, for such cases where
abortion was non-conditional (using assert() and using the assertion
condition as a message here was clearly a misuse of the function). And
mark json_abort() as 'noreturn', as well as 'cold' for optimization
purpose (this is code we expect to never run, unless there is a bug,
that is).

Finally let's use this json_abort() instead of previous misused assert()
calls.
2020-03-16 19:53:28 +01:00
Eric Haszlakiewicz
e94eb90f9f Merge pull request #546 from dota17/make_unistall
Add uninstall target in cmake
2020-03-10 22:12:13 -05:00
dota17
c14c6caa32 delete -r in uninstall 2020-03-11 10:47:04 +08:00
Eric Haszlakiewicz
a8c9284f06 Merge pull request #547 from dota17/assert_test
modify json-c default build type, and fix up the assert() errors in t…
2020-03-03 07:54:21 -06:00
dota17
0030e905b4 modify RELEASE 2020-03-03 14:16:13 +08:00
dota17
e56ab0146f update testcase and delete debug -O0 build 2020-03-02 20:19:35 +08:00
Eric Haszlakiewicz
b3296e778f Follow up the PR#542: improve assert() calls, simplify code in json_object_equal(). 2020-03-02 02:08:49 +00:00
Eric Haszlakiewicz
737aee40c4 Merge pull request #542 from dota17/adduint64_final
add uint64 data to json-c
2020-03-01 08:51:26 -05:00
dota17
2d44f865c3 modify json-c default build type, and fix up the assert() errors in testcase 2020-02-29 15:32:42 +08:00
dota17
6359b79847 update json_object.c and testcase, delete json_object_uint_inc() 2020-02-28 17:51:56 +08:00
dota17
9532f94fa4 modify partial functions and testcase, in order to support automatic conversion for int64/uint64 2020-02-28 09:25:02 +08:00
dota17
1160c8625c Add uninstall target in cmake 2020-02-27 21:02:31 +08:00
dota17
c816de212b modify the json_object, replace c_int64/c_uint64 with struct{union{int64, uint64},...} 2020-02-27 10:26:27 +08:00
Eric Haszlakiewicz
30e00cf757 Merge pull request #545 from dota17/make_doc
add doc target in cmake
2020-02-26 20:56:22 -05:00
dota17
e3b6521baa add doc target on cmake 2020-02-26 18:18:07 +08:00
Eric Haszlakiewicz
5a2b9139f9 Merge pull request #544 from dota17/distcheck
Increase distcheck target in cmake
2020-02-25 21:48:35 -05:00
Eric Haszlakiewicz
a0129c9761 Merge pull request #543 from dota17/readme
Readme
2020-02-25 21:38:18 -05:00
dota17
77d7a99c75 Increase distcheck target in cmake 2020-02-25 19:15:40 +08:00
Chen
0ccb296263 Update README.md 2020-02-25 16:20:41 +08:00
dota17
f69fbd897b Added documentation for camke-configure 2020-02-25 15:01:05 +08:00
dota17
3c3b5920f7 add uint64 data to json-c 2020-02-25 14:51:35 +08:00
dota17
c684b1d40b add coveralls auto tool to json-c 2020-02-18 10:39:43 +08:00
Eric Haszlakiewicz
518f337ce8 Issue #539: use a internal-only serializer function in json_object_new_double_s() to avoid potential conflicts with user code that uses the json_object_userdata_to_json_string serializer. Also, document the serializer-resetting behavior of json_object_set_double(). 2020-02-14 03:48:02 +00:00
Eric Haszlakiewicz
4bf7ffa984 Issue #539: be sure to clean up at the end of test_set_value. 2020-02-14 03:25:46 +00:00
Eric Haszlakiewicz
ae13ca524a Issue #539: reset the serializer when json_object_set_double() is called and the current serializer is the one that json_object_new_double_s() used. 2020-02-13 03:11:10 +00:00
Eric Haszlakiewicz
0ffdbb2395 Merge pull request #531 from dota17/utf8test
validate utf-8 string
2020-02-05 21:56:06 -05:00
Eric Haszlakiewicz
1934eddf29 Merge pull request #536 from dota17/new_null
add json_object_new_null()
2020-01-21 23:23:53 -05:00
dota17
7ad72b81c5 update comment 2020-01-22 09:56:52 +08:00
dota17
010f33d460 add json_object_new_null 2020-01-20 16:46:46 +08:00
dota17
787a8b3f1c update code 2020-01-20 10:41:24 +08:00
Eric Haszlakiewicz
360d28b961 Merge pull request #533 from sunpoet/master
Fix "make check"
2020-01-12 22:42:02 -05:00
Po-Chuan Hsieh
bb5971ba2a Fix make check
cc -DHAVE_CONFIG_H -I. -I..  -I.. -I../tests    -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -Wall -Werror -Wcast-qual -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -D_GNU_SOURCE -D_REENTRANT -MT test_parse.o -MD -MP -MF .deps/test_parse.Tpo -c -o test_parse.o test_parse.c
test_parse.c:256:14: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
        { "null123" + 4,       4, 3, json_tokener_success, 1 },
          ~~~~~~~~~~^~~
test_parse.c:256:14: note: use array indexing to silence this warning
        { "null123" + 4,       4, 3, json_tokener_success, 1 },
                    ^
          &         [  ]
test_parse.c:258:12: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
        { "nullx" + 4,         2, 0, json_tokener_error_parse_unexpected, 1 },
          ~~~~~~~~^~~
test_parse.c:258:12: note: use array indexing to silence this warning
        { "nullx" + 4,         2, 0, json_tokener_error_parse_unexpected, 1 },
                  ^
          &       [  ]
test_parse.c:260:25: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
        { "{\"a\":1}{\"b\":2}" + 7,
          ~~~~~~~~~~~~~~~~~~~~~^~~
test_parse.c:260:25: note: use array indexing to silence this warning
        { "{\"a\":1}{\"b\":2}" + 7,
                               ^
          &                    [  ]
3 errors generated.
*** Error code 1

Stop.
2020-01-11 07:20:44 +00:00
dota17
eca74dcccf test utf8 2020-01-10 18:33:14 +08:00
Eric Haszlakiewicz
e651e96a5b Merge pull request #526 from dota17/addTestCase_printbuf
Increased the test coverage of printbuf.c 82% to 92%.
2020-01-03 08:32:53 -05:00
Eric Haszlakiewicz
a255510cca Merge pull request #525 from dota17/addPointerTestcase
update pointer test case
2020-01-03 08:31:41 -05:00
chenguoping
8c0cb0bd28 Increased the test coverage of printbuf.c 82% to 92%. 2020-01-03 14:34:35 +08:00
Eric Haszlakiewicz
0421772bbc Merge pull request #523 from dota17/updatetestcase
update tsetcase for tokener_c
2020-01-02 22:22:57 -05:00
Eric Haszlakiewicz
4bfed6eb2f Merge pull request #522 from dota17/addVisitTestcase
update json_visit testcase
2020-01-02 22:22:09 -05:00
dota17
5fe4448541 update tsetcase for tokener_c 2020-01-02 19:19:12 +08:00
dota17
a5089f5a79 update json_visit testcase 2020-01-02 16:41:37 +08:00
dota17
48ae9e8874 update pointer test case 2020-01-02 10:49:29 +08:00
Eric Haszlakiewicz
ee34939e74 Merge pull request #519 from dota17/addTestCase_obj_token
Add test case obj token
2019-12-29 16:02:04 -05:00
chenguoping
424b315ce0 pointer types discards qualifiers 2019-12-27 15:39:31 +08:00
chenguoping
1446572997 add testcases of object and token 2019-12-27 15:07:00 +08:00
Eric Haszlakiewicz
d6b968dff7 Merge pull request #512 from JaapKeuter/cmake_test
Properly append to CMAKE_C_FLAGS string
2019-12-12 22:30:15 -05:00
Jaap Keuter
78d8e5c3d5 Properly append to CMAKE_C_FLAGS string
Contrary to other CMAKE variables the CMAKE_C_FLAGS variable is the
composed string of flags for the C compiler. It is therefore not a list
to append to. Current implementation results in these incorrect CFLAGS,
e.g., "-O2 -g -fblahblah;-UNDEBUG". Extending the CFLAGS this way
results in the proper CFLAGS, e.g., "-O2 -g -fblahblah -UNDEBUG".
2019-12-12 21:28:03 +01:00
Eric Haszlakiewicz
6c55f65d07 Set cmake policy CMP0075, to have check_include_file use the value of CMAKE_REQUIRED_LIBRARIES (currently, adds -lm). See issue #510. 2019-12-06 00:15:14 -05:00
Eric Haszlakiewicz
0819a55ffb Undefine NDEBUG for tests - cmake version. See issue #501. 2019-12-05 23:18:59 -05:00
Eric Haszlakiewicz
37b4da6b92 Merge pull request #501 from andy5995/iss_406-2
undefine NDEBUG for tests
2019-12-05 23:18:46 -05:00
Eric Haszlakiewicz
581b94b3bd Add a shim script to ease shift from autoconf to cmake. 2019-12-01 23:42:40 -05:00
Eric Haszlakiewicz
11a638048d Add a few missing features to the cmake setup that are present in configure.ac:
Include all compiler warnings, and provide DISABLE_WERROR to make them not be errors.
 Define _REENTRANT, if setting it works.
 Set -Bsymbolic-functions, and provide DISABLE_BSYMBOLIC to turn that off.
 Implement the check for HAS_GNU_WARNING_LONG
2019-11-26 23:02:15 -05:00
Eric Haszlakiewicz
a92e6d2c28 Set the soversion in the cmake built library, and arrange for the file name to be generated appropriately too. 2019-11-25 23:26:48 -05:00
Eric Haszlakiewicz
41f434e89f Fix test_util_file for VS2013 too, but skip all the tests for anything older than that because the limitations are too inconvenient. 2019-11-23 23:55:04 -05:00
Eric Haszlakiewicz
b99be9cf4e Fix up the test_util_file test for builds on Windows VS2015. 2019-11-23 23:14:24 -05:00
Eric Haszlakiewicz
7f30afc6e5 Fix some Windows compile issues, add JSON_EXPORT's, fix bogus character escapes, define __func__ and omit unistd.h if needed. 2019-11-23 20:31:14 -05:00
Eric Haszlakiewicz
f19abcf981 Get the cmake build a bit closer to the autoconf one: include json_visit.h, and fix the version stamped in json-c.pc. 2019-11-23 15:34:23 -05:00
Eric Haszlakiewicz
bdaff94e9a Build and run the tests as part of the cmake build. 2019-11-23 15:15:48 -05:00
Eric Haszlakiewicz
25aedddcdf Fix memory leaks in test_double_serializer, and make sure all tests return 0 at the end of main(). 2019-11-23 12:05:28 -05:00
Eric Haszlakiewicz
3d3b014971 Add a quick way (JSONC_TEST_TRACE=1) to turn on shell tracing in tests. 2019-11-23 12:03:27 -05:00
Eric Haszlakiewicz
b1ad748842 Extend test_double_serializer to check NaN and Infinity handling. 2019-11-22 22:56:33 -05:00
Eric Haszlakiewicz
af8dd4a307 Define vars earlier to fix old Windows builds. 2019-11-10 20:35:30 -05:00
Eric Haszlakiewicz
baed9983b3 Add a json_object_from_fd_ex() function, to allow the max nesting depth to be specified. 2019-11-10 00:14:44 -05:00
Eric Haszlakiewicz
ac26ea9c5b Add a test for serializing the double value -1.0. 2019-11-10 00:13:00 -05:00
Eric Haszlakiewicz
ddd049045d Merge pull request #505 from grdowns/vcpkg-instructions
Add vcpkg installation instructions
2019-09-26 22:23:52 -04:00
grdowns
7ef51239a9 Update dependencies 2019-09-26 17:11:49 -07:00
grdowns
760c1e284c Add vcpkg installation instructions 2019-09-26 17:09:39 -07:00
Eric Haszlakiewicz
eae040a84a Issue #488: use JSON_EXPORT on functions so they are properly exported on Windows. 2019-09-08 22:42:36 -04:00
Eric Haszlakiewicz
374ffe87c6 Issue #463: fix newlocale() call to use LC_NUMERIC_MASK instead of LC_NUMERIC, and remove incorrect comment.
The second call to newlocale() with LC_TIME accidentally made things
 work because LC_TIME == LC_NUMERIC_MASK on some platforms.
2019-09-08 22:27:30 -04:00
Eric Haszlakiewicz
05b41b159e Add a json_tokener_get_parse_end() function to replace direct access of tok->char_offset. 2019-09-08 21:35:37 -04:00
Eric Haszlakiewicz
087534c030 Minor cleanup of includes in a couple of tests. 2019-09-08 21:34:13 -04:00
Eric Haszlakiewicz
d0b87ee87b Add an explicit cast to double to squash a -Wimplicit-int-float-conversion warning.
Though we will no longer be comparing exactly against INT64_MAX, this is ok
because any value of that magnitude stored in a double will *also* have been
rounded up, so the comparison will work appropriately.
2019-08-12 00:30:45 +00:00
andy5995
8799623806 undefine NDEBUG for tests
(closes #406)
2019-07-30 14:34:51 -05:00
Eric Haszlakiewicz
a91aa5e35d Merge pull request #499 from andy5995/travis_valgrind
.travis.yml:test on more recent clang and gcc versions
2019-07-27 09:29:57 -04:00
andy5995
509600a7f7 add xenial default clang with CHECK enabled 2019-07-26 23:51:18 -05:00
andy5995
4f69529a04 add missing dist 2019-07-26 23:36:01 -05:00
andy5995
dd08b70e46 manually use apt-get to install packages on bionic 2019-07-26 23:21:20 -05:00
andy5995
dd0eef6aab add tests on bionic beaver 2019-07-26 22:42:53 -05:00
andy5995
163db3f6d0 revert toolchain back to "test" 2019-07-26 22:24:12 -05:00
andy5995
1da4b23235 change key 2019-07-26 22:24:12 -05:00
andy5995
a49f1dee8a use "non-test" ppa
Maybe something weird about how gcc is configured with the test
toolchain?
2019-07-26 22:24:12 -05:00
andy5995
897b49f475 remove useless condition that shows logs 2019-07-26 22:24:12 -05:00
andy5995
b140c473d1 install doxygen so 'make distcheck' can succeed 2019-07-26 22:24:12 -05:00
andy5995
6288be340c test for more compilers 2019-07-26 22:24:12 -05:00
andy5995
57e79e1d0b show the logs if tests fail 2019-07-26 22:24:12 -05:00
andy5995
50e7fff0f3 .travis.yml:install valgrind
(#498)
2019-07-26 22:24:12 -05:00
Eric Haszlakiewicz
c8e1b59ae5 Merge pull request #495 from andy5995/README_typos
README.md:fix 2 typos
2019-07-26 23:08:11 -04:00
andy5995
1c7e891e44 "make its use in" [skip ci] 2019-07-26 12:59:24 -05:00
Eric Haszlakiewicz
4a94ddbd8b Merge pull request #500 from andy5995/add_missing_test_deps
test/Makefile.am:add missing deps for test1 and test2
2019-07-26 09:48:34 -04:00
andy5995
e2f46b9f79 partial revert (make use) [skip ci] 2019-07-25 22:55:07 -05:00
Eric Haszlakiewicz
68abf12afa Issue #498: Fix a memory leak bug introduced in test_double_serializer in 485f2a02 by adding a json_object_put call. 2019-07-26 03:35:38 +00:00
Eric Haszlakiewicz
48984dbd42 Merge pull request #496 from andy5995/pointer_doc
json_pointer.h:suggest minor grammar improvement for pointer doc
2019-07-25 22:58:22 -04:00
andy5995
8ab8df1170 test/Makefile.am:add missing deps for test1 and test2
Allows the tests to pass when running `make distcheck`

This fixes the 2 broken tests I mentioned at
https://github.com/json-c/json-c/pull/499#discussion_r306998261
2019-07-25 14:59:56 -05:00
andy5995
a9c34d5531 json_pointer.h:suggest minor grammar improvement for pointer doc 2019-07-23 23:53:06 -05:00
andy5995
3969487376 README.md:fix 2 typos 2019-07-23 23:43:59 -05:00
Eric Haszlakiewicz
07ea04e651 Merge pull request #491 from ploxiln/disable_werror
build: add option --disable-werror to configure
2019-06-09 14:05:46 -04:00
Pierce Lopez
634900d270 tests: appease -Wwrite-strings 2019-06-09 12:17:06 -04:00
Pierce Lopez
44605744dc build: fix compiler option -Wwrite-strings
was typod as -Wwrite-string
2019-06-09 10:55:50 -04:00
Pierce Lopez
21c886534f build: add --disable-werror option to configure
to omit -Werror compiler option
2019-06-09 10:53:56 -04:00
Eric Haszlakiewicz
2b1903cc69 Merge pull request #485 from myd7349/fix-cmake-module
Install CMake module files
2019-05-30 22:38:29 -04:00
Eric Haszlakiewicz
485f2a02c7 Issue #486: append a missing ".0" to negative double values too. 2019-05-28 02:44:22 +00:00
myd7349
c2036ab9fc Install CMake module files 2019-05-18 19:44:29 +08:00
Eric Haszlakiewicz
3e81b4abe3 Merge pull request #474 from Jehan/fix-pc-file-cmake
Installation directories empty with CMake in pkg-config.
2019-01-26 10:55:50 -05:00
Jehan
c46a0636c6 Installation directories empty with CMake in pkg-config.
CMake was not properly substituting the installation dir variables (they
ended up all empty), so the pkg-config results were also wrongs. For
instance cflags was: -I -I/json-c
Even though json-c was found at configure time, this obviously broke the
build of any application using it.
2019-01-26 12:30:40 +01:00
Eric Haszlakiewicz
f1713b3f62 Merge pull request #473 from besser82/fixup/docs_utf8
Convert ChangeLog to valid UTF-8 encoding.
2019-01-23 22:47:27 -05:00
Björn Esser
259d5078c4 Clean trailing white-spaces in ChangeLog. 2019-01-22 17:07:14 +01:00
Björn Esser
6b0745ea1f Convert ChangeLog to valid UTF-8 encoding. 2019-01-22 17:07:14 +01:00
Ramiro Polla
38a112380b json_object: cleanup of *set_string* functions
This commit also has the side-effect that errno is set on failed calls
to json_object_set_string(_len).
2018-12-21 00:30:26 +01:00
Ramiro Polla
906188e1cf json_object: speed up creation of objects
Instead of using calloc(), call malloc() and initialize the relevant
fields individually.

speedup for 32-bit: ~15%
speedup for 64-bit: ~ 5%
2018-12-21 00:30:26 +01:00
Ramiro Polla
c9a0ac5886 json_tokener: optimize parsing of integer values
speedup for 32-bit: ~8%
speedup for 64-bit: ~9%
2018-12-21 00:30:21 +01:00
Ramiro Polla
d98fc501fb json_tokener: optimize check for number characters
speedup for 32-bit: ~5%
speedup for 64-bit: ~3%
2018-12-21 00:24:17 +01:00
Ramiro Polla
45c601bfa4 json_tokener: optimize check for hex characters
speedup for 32-bit: ~1%
speedup for 64-bit: ~1%
2018-12-21 00:24:17 +01:00
Ramiro Polla
158c248d5c json_tokener: optimize check for whitespace characters
speedup for 32-bit: ~15%
speedup for 64-bit: ~ 2%
2018-12-21 00:24:17 +01:00
Ramiro Polla
ab3e40b37c json_object_deep_copy: fix deep copy of strings containing '\0' 2018-12-20 22:26:06 +01:00
Ramiro Polla
1f46d2f40f json_object_private: remove _delete field
This field is set based on o_type when the object is created and it is
not changed during the lifetime of the object. Therefore we can check
o_type to choose the proper delete function in json_object_put(), and
save sizeof(void *) bytes in struct json_object_private.
2018-12-20 22:26:06 +01:00
Eric Haszlakiewicz
39c9fa0a2b Merge pull request #468 from rkalidas/compiler-fixes
Fix compiler warnings
2018-12-19 11:09:01 -05:00
Rubasri Kalidas
3003161eff Fix compiler warnings 2018-12-18 11:30:57 -06:00
Eric Haszlakiewicz
6460446aa6 Switch to building a dynamic lib by default. Tweak language in the README.md slightly. Inspired by PR#452. 2018-12-11 20:59:08 -05:00
Eric Haszlakiewicz
ee4691c9fb Merge pull request #453 from darjankrijan/master
Fixed misalignment in JSON string due to space after \n being printed...
2018-12-11 20:17:43 -05:00
Darjan Krijan
9c4b07faec Removed newly created test case and incorporated it into test1.test and test2.test 2018-12-07 17:39:59 +01:00
Darjan Krijan
7a9075c16b Added test cases for spaced pretty and pretty_tab used together 2018-12-07 17:30:15 +01:00
Eric Haszlakiewicz
240627f260 Merge pull request #454 from ramiropolla/json_object_private
json_object_private: save 8 bytes in struct json_object in 64-bit arc…
2018-11-30 09:49:35 -05:00
Eric Haszlakiewicz
745cadc944 Merge pull request #461 from andy5995/issue_422
json_object.c:set errno in json_object_get_double()
2018-11-28 20:39:42 -05:00
Eric Haszlakiewicz
83cb93b7ae Merge pull request #462 from andy5995/issue_460
json_object.h:document json_object_new_string_len()
2018-11-28 20:39:13 -05:00
andy5995
2942870325 remove [in] from params description
Keeping this would be inconsistent with the other documentation
2018-11-28 16:55:19 -06:00
andy5995
3b108935d0 json_object.h:document json_object_new_string_len()
I also added a couple trivial, but related, suggestions.

closes #460
2018-11-27 11:35:45 -06:00
andy5995
506a32d4ab json_object.c:set errno in json_object_get_double()
closes #422
2018-11-26 21:12:06 -06:00
Eric Haszlakiewicz
7539ab2d2e Merge pull request #459 from andy5995/issue_438
README.html:fix link to Doxygen docs, remove WIN32 link
2018-11-25 21:19:02 -05:00
Eric Haszlakiewicz
753de5a5a9 Merge pull request #458 from andy5995/README_files_link
README.md:fix dead "file.html" link
2018-11-25 21:17:40 -05:00
Eric Haszlakiewicz
80bf857b27 Merge pull request #457 from andy5995/gitignore_build
.gitignore:add build directory
2018-11-25 21:14:34 -05:00
Eric Haszlakiewicz
aa831c7960 Merge pull request #456 from andy5995/style_perms
STYLE.txt:remove executable permissions
2018-11-25 21:14:14 -05:00
andy5995
fc1b113b29 README.html:fix link to Doxygen docs, remove WIN32 link
fixes #438
[skip ci]
2018-11-25 07:09:00 -06:00
andy5995
71f5c2d50b README.md:fix dead "file.html" link 2018-11-25 06:51:21 -06:00
andy5995
c3e11d6812 .gitignore:add build directory 2018-11-25 06:45:21 -06:00
andy5995
dba65cbd30 STYLE.txt:remove executable permissions 2018-11-25 06:43:02 -06:00
Ramiro Polla
5bb5e2e8fc json_object_private: save 8 bytes in struct json_object in 64-bit architectures
- there is no need for _ref_count to be uint_fast32_t (the compiler
  might decide to use a 64-bit int). make it uint32_t instead.
- reorder the 32-bit integer fields (o_type and _ref_count) so that
  there is no wasted 4-byte gap after each of them.
2018-11-24 04:16:36 +01:00
Darjan Krijan
b0bceaa8bf Added a test for the space after \n issue with flags=JSON_C_TO_STRING_SPACED|JSON_C_TO_STRING_PRETTY|(JSON_C_TO_STRING_PRETTY_TAB) used in json_object_array_to_json_string 2018-11-21 22:41:13 +01:00
Darjan Krijan
3943960874 Removed spaces after \n for arrays as well 2018-11-21 22:34:01 +01:00
Darjan Krijan
e8cec5c9e4 Fixed misalignment in JSON string due to space after \n being printed when choosing JSON_C_TO_STRING_SPACED together with JSON_C_TO_STRING_PRETTY in json_object_array_to_json_string 2018-11-20 22:21:27 +01:00
Eric Haszlakiewicz
ebe520e96e Merge pull request #450 from drizt/subproject
Allow use json-c cmake as subproject
2018-10-20 23:01:20 -04:00
Ivan Romanov
ba5a02e8a9 Allow use json-c cmake as subproject
Now json-c can be bundled to any cmake-based project and used with
couple lines of code:

add_subdirectory(json-c EXCLUDE_FROM_ALL)
target_link_libraries(MyProject json-c)
2018-10-20 10:50:15 +05:00
Eric Haszlakiewicz
994e6c1f60 Re-add creation and installation of the json-c.pc file to the cmake build. 2018-09-01 15:06:14 -04:00
Eric Haszlakiewicz
705e2fd010 Merge pull request #444 from Hawk777/document-ref-count-tokener
Document refcount of json_tokener_parse_ex return
2018-08-31 01:16:53 -04:00
Christopher Head
31d4d3dee7 Document refcount of json_tokener_parse_ex return 2018-08-30 09:18:29 -07:00
Eric Haszlakiewicz
0a8ac2ed92 Merge pull request #441 from changyongGuo/c_flag_error
fix c flag loss during cmake building
2018-08-14 20:40:49 -04:00
changyong guo
08c8231cc8 fix c flag loss during cmake building 2018-08-14 13:52:18 +08:00
Eric Haszlakiewicz
bf29aa0f8c Merge pull request #434 from unmanned-player/devel
The real CMake support
2018-07-28 11:59:46 -04:00
Eric Haszlakiewicz
91f9884591 Merge pull request #436 from jobol/master
Improve pkgconfig setting
2018-07-26 23:28:42 -04:00
Jose Bollo
d189d7b5ff Improve pkgconfig setting
This changes allows to use #include <json-c/json.h>
instead of just #include <json.h>

This is normally possible but in some tricky case
this usage is broken without this change.

Here is the case that I encountered. I had to
compile json-c fresh version for some investigations
on newer versions. Then I installed it on my local
environment using option --prefix. After that I
had 2 versions:

 - the system wide version in usual locations
   /usr/lib and /usr/include
 - mine in my HOME directory

Then, as I'm used to include <json-c/json.h>, the
included iheder's version was the system wide one
whereas the linked lib was mine.

Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-25 15:51:02 +02:00
Unmanned Player
f2e991a341 The real CMake support
This patch provides a CMakeLists.txt file to build JSON-C library without relying on auto-tools support. This makes the build a bit more portable and cleaner.

It can detect headers and symbols and generate config.h header file based on those detections. It cannot yet handle ctest(1) as the testing itself depends on comparing the output against files. Testing would need some creative abuse of CMake :) This will be provided a few patches later and may possibly involve refactoring test cases.

The patch has been tested on GCC 4.8.5 (Linux), GCC 7.2.0 (MinGW) and Microsoft Visual C++ 16.0 (2010?) locally. Also, compiles correctly on Travis CI and AppVeyor without errors.
2018-07-24 08:06:13 +10:00
Eric Haszlakiewicz
2327b23d8e Merge pull request #431 from LeSpocky/cmake
cmake: Bump required version
2018-07-12 22:26:48 -04:00
Alexander Dahl
901d59b29f cmake: Bump required version
Using 'project(foo VERSION 1.0)' requires CMake 3.0, the VERSION option
is not part of CMake 2.8.7, see:

* https://cmake.org/cmake/help/v2.8.7/cmake.html#command:project
* https://cmake.org/cmake/help/v3.0/release/3.0.0.html#commands

The property C_STANDARD was introduced with CMake 3.1, see:

* https://cmake.org/cmake/help/v3.1/release/3.1.0.html#properties

Signed-off-by: Alexander Dahl <post@lespocky.de>
2018-07-12 21:25:38 +02:00
Eric Haszlakiewicz
3df1f98b4a Explain why we're not setting the output name for static libraries when on Windows. 2018-06-23 22:10:55 -04:00
Eric Haszlakiewicz
a056893263 Merge pull request #415 from sgbihu/master
Resolve windows name conflict
2018-06-23 22:08:25 -04:00
Eric Haszlakiewicz
e3752b5894 Issue #418: Fix docs for json_util_from_fd and json_util_from_file to say that they return NULL on failures. 2018-06-14 22:24:45 -04:00
Eric Haszlakiewicz
c1c71097a1 Issue #419: document that NULL may be passed to json_object_put(). 2018-06-12 23:16:31 -04:00
Eric Haszlakiewicz
fb042f449b Merge pull request #421 from lt-holman/install_header_file
install json_object_iterator.h header file
2018-06-08 23:45:47 -04:00
Keith Holman
37a2edf468 install json_object_iterator.h header file
When building the project using cmake then installing it.  The
definitions in `json_object_iterator.h` are required but not installed
by the cmake install rule.  This patch adds the `json_object_iterator.h`
file to the list of files to install.

Signed-off-by: Keith Holman <keith.holman@windriver.com>
2018-06-07 13:19:27 -04:00
Eric Haszlakiewicz
4bbc72f633 Merge pull request #420 from angelskieglazki/master
arraylist: Fixed names of parameters for callback function
2018-06-02 23:01:04 -04:00
max
7a4759f165 arraylist: Fix names of parameters for callback function 2018-06-01 18:21:06 +03:00
Eric Haszlakiewicz
4414d068b3 Always create debug info (pdb file) even for release builds. 2018-05-27 21:50:57 -04:00
Eric Haszlakiewicz
7038bb8061 Try the appveyor changes again, using %Configuration% instead of "Debug" 2018-05-27 18:20:32 -04:00
Eric Haszlakiewicz
dfc0fddf22 Include the json-c.lib, .pdb and .exp files in the zip file created by the appveyor build, since it seems they're needed for linking and debugging. 2018-05-27 16:07:11 -04:00
Liang, Gao
0b3616d580 Resolve windows name conflict
1. The windows dll will output the lib and dll, and rename the static
    lib will have conflict on windows.
2. Delete rename code to dismiss the conflict.
2018-05-21 16:34:13 +08:00
Eric Haszlakiewicz
c75ebe8973 Merge pull request #410 from janczer/fix-typos
Fixed typos
2018-04-24 22:01:09 -04:00
janczer
8bd62177e7 Fixed typos 2018-04-24 16:00:38 +02:00
Eric Haszlakiewicz
f8c632f579 Issue #407: fix incorrect casts in calls to ctype functions (isdigit and isspace) so we don't crash when asserts are enabled on certain platforms and characters > 128 are parsed. 2018-03-25 18:25:58 -04:00
Eric Haszlakiewicz
da4b34355d Add an parse test for content starting with a UTF8 BOM, which is _not_ a valid start to a JSON message. 2018-03-25 18:23:42 -04:00
Eric Haszlakiewicz
104aef0a6e Update the change log for the 0.13.1 release. 2018-03-05 22:54:57 -05:00
Eric Haszlakiewicz
2fd95844c3 Issue #396: check for toolchain compatibilty with _REENTRANT before adding it to CFLAGS. 2018-03-04 22:32:45 -05:00
Eric Haszlakiewicz
1e301d94be Merge pull request #402 from derwolfe/fuzz
Add fuzzers from OSS-Fuzz
2018-02-19 13:54:18 -05:00
Chris Wolfe
1e08150838 pull in fuzzers, add CI scripts later 2018-02-05 19:26:24 -06:00
Eric Haszlakiewicz
f8eb1dec64 Merge pull request #399 from jonathan-wiens/bugfix/initialize_variable
Avoid uninitialized variable warnings
2018-01-26 23:46:33 -05:00
Jonathan Wiens
cdc4e9f64b Avoid uninitialized variable warnings
Fix json_object_object_foreach to avoid uninitialized variable warnings
using ANSI C or MSC.
2018-01-17 15:57:52 +01:00
Eric Haszlakiewicz
250de31f17 Bump the major version of the .so library generated up to 4.0 to avoid conflicts because some downstream packagers of json-c had already done their own bump to ".so.3" for a much older 0.12 release. 2018-01-15 23:31:55 -05:00
Eric Haszlakiewicz
c652b6ad29 PR#394: fix breakage with VS build. 2017-12-24 14:42:58 -05:00
Eric Haszlakiewicz
d5da847f51 PR#394: don't always append the ".0" if the double value rounds to zero because some custom formats *will* include it (e.g. %.2f).
Also try to accomodate formats to explicitly exclude the decimal (e.g. %.0f).
2017-12-24 13:45:52 -05:00
Eric Haszlakiewicz
0992aac61f Remove the TRUE and FALSE defines. 2017-12-23 09:42:17 -05:00
Eric Haszlakiewicz
cfd09c87f0 Merge pull request #393 from besser82/enhancement/unsigned_refcount
json_object_private: Use unsigned 32-bit integer type for refcount
2017-12-17 09:52:27 -05:00
Björn Esser
c233f5c05e json_object_private: Use unsigned 32-bit integer type for refcount 2017-12-17 12:51:17 +01:00
Eric Haszlakiewicz
5ea6a05bfa Merge pull request #389 from besser82/bugfix/invalid_free
json_object: Avoid double free (and thus a segfault) when ref_count gets < 0
2017-12-14 09:28:06 -05:00
Björn Esser
9aca3b6a08 json_object: Avoid invalid free (and thus a segfault) when ref_count gets < 0 2017-12-14 14:36:07 +01:00
Eric Haszlakiewicz
8c214902d9 Merge pull request #386 from besser82/bugfix/aclocal_amflags
Makefile: Add ACLOCAL_AMFLAGS
2017-12-13 22:03:20 -05:00
Eric Haszlakiewicz
e411b1a36e Merge pull request #391 from rikardfalkeborn/fix-const-function-define
Fix non-GNUC define for JSON_C_CONST_FUNCTION
2017-12-13 21:51:13 -05:00
Rikard Falkeborn
84dcc01da1 Fix non-GNUC define for JSON_C_CONST_FUNCTION 2017-12-13 22:29:16 +01:00
Björn Esser
87556afe2a Makefile: Add ACLOCAL_AMFLAGS
This is recommended by the libtool manual.
2017-12-13 01:26:35 +01:00
Eric Haszlakiewicz
5b6d62259a Apply gcc's "const" attribute to the json_c_object_sizeof() function as an optimizer hint. Also, rename that function from json_object_sizeof(). 2017-12-12 18:26:51 -05:00
Eric Haszlakiewicz
94fd101601 Merge pull request #388 from besser82/enhancement/json_object_sizeof
json_object: Add size_t json_object_sizeof()
2017-12-12 18:14:40 -05:00
Eric Haszlakiewicz
25afa92ed5 Merge pull request #387 from LeSpocky/doc
doc: Use other doxygen feature to specify mainpage
2017-12-12 09:13:36 -05:00
Björn Esser
c123a1c21b json_object: Add size_t json_object_sizeof() 2017-12-11 16:16:15 +01:00
Alexander Dahl
89747ac758 doc: Use other doxygen feature to specify mainpage
Previously a special tag was added to README.md to make this the
main page in Doxygen generated docs. When viewing the README on the
GitHub page this tag was not hidden.

After upgrading to Doxygen 1.8.8 (and above) in changeset
219025727d a new Doxygen feature can be
used to specify the main page: Since release 1.8.3 Doxygen has a special
option to set a markdown file as main page. When using this option we
can drop the tag, making the README rendered by GitHub nice to look at.

Fixes: ae66b24369
2017-12-11 09:46:28 +01:00
Eric Haszlakiewicz
a19031411d Remove the previously deprecated lh_table_lookup() function, in favor of lh_table_lookup_ex(). 2017-12-10 00:27:01 -05:00
Eric Haszlakiewicz
f83cf244cd Remove the previously deprecated bits.h and the lh_abort() function. 2017-12-10 00:25:00 -05:00
Eric Haszlakiewicz
963e707ca4 Drop mention of README-WIN32.html in the release checklist. 2017-12-09 15:12:08 -05:00
Eric Haszlakiewicz
0631c37c7f Update the master branch to version 0.13.99 2017-12-09 14:59:48 -05:00
Eric Haszlakiewicz
8c4a941475 Tweak the release checklist slightly to fix problems noticed during this past release process. 2017-12-09 14:59:05 -05:00
Eric Haszlakiewicz
d447fbca77 Don't include private headers when installing. 2017-12-07 18:24:08 -05:00
Eric Haszlakiewicz
d582d3ae5a Undeprecate the array_list, lh_table and printbuf typedefs, but move each to the corresponding header files. 2017-12-06 23:58:33 -05:00
Eric Haszlakiewicz
8c82f0e5c3 Squash doxygen warnings, and make a few slight improvements to the docs. 2017-12-06 23:53:12 -05:00
Eric Haszlakiewicz
219025727d Upgrade doxygen's Doxyfile to version 1.8.8 2017-12-06 00:27:53 -05:00
Eric Haszlakiewicz
f2f103b986 Add a brief overview of each file to the docs. 2017-12-06 00:20:59 -05:00
Eric Haszlakiewicz
d6d81e6ece Adjust the description of json_object_iterator a bit. 2017-12-05 18:43:18 -05:00
Eric Haszlakiewicz
c01635e03e Rearrange README.md a bit and make it work better in the doxygen generated docs.
Also, add a table of contents, and a brief section on using json-c with links to
the header files most likely to be useful.
2017-12-05 18:01:43 -05:00
Eric Haszlakiewicz
ae242720b6 Add a couple more issues to the list of those closed for 0.13 2017-12-05 18:00:09 -05:00
Eric Haszlakiewicz
11ab365324 Deprecated a few typedefs, add docs on json_object_iter, move json_number_chars and json_hex-chars to json_object_private.h. 2017-12-05 09:20:59 -05:00
Eric Haszlakiewicz
a47eafe868 Cast to int64_t instead of long in test_int_add to fix the test on 32-bit platforms. 2017-12-05 04:32:12 +00:00
Eric Haszlakiewicz
0e7ec2ffcd Add cast to int on tolower() to fix warnings about array subscripts. 2017-12-05 04:29:36 +00:00
Eric Haszlakiewicz
aedd36ac8b Make sure to include the "*" on function pointer arguments to avoid a warnings from VS2015. See also PR#384. 2017-12-04 18:17:52 -05:00
Eric Haszlakiewicz
95015d474e Merge pull request #384 from ssrlive/patch-1
Fix a VS 2015 compiler warning.
2017-12-04 18:11:09 -05:00
ssrlive
2643658b6f Update json_object.c 2017-12-04 14:46:41 +08:00
ssrlive
7709cb1355 Fix a VS 2015 compiler warning.
In VS 2015, the warning text is "warning C4550: expression evaluates to a function which is missing an argument list".
2017-12-04 14:43:25 +08:00
Eric Haszlakiewicz
b34d26ff25 Add a change log entry for the upcoming 0.13 release. 2017-12-02 22:13:22 -05:00
Eric Haszlakiewicz
e00a07b885 Clean up *.vg.out files too to "make distcheck" works. 2017-11-30 18:17:04 -05:00
Eric Haszlakiewicz
5dae561d33 In json_object_deep_copy(), copy over _userdata, at least for json_type_string's with the default serializer set, and provide a way for people using custom serializers to provide a custom shallow_copy method. 2017-11-29 23:35:38 -05:00
Eric Haszlakiewicz
96efeadd6e Always build the json_object_deep_copy() code, but conditionalize running it on a --benchmark command line option. 2017-11-29 17:58:57 -05:00
Eric Haszlakiewicz
437716c5b4 Rename _set_last_err() to _json_c_set_last_err(). 2017-11-29 09:36:53 -05:00
Eric Haszlakiewicz
d99edade72 Merge branch 'commodo-json_deep_copy' 2017-11-29 09:13:32 -05:00
Eric Haszlakiewicz
4dd92180c6 Merge branch 'json_deep_copy' of https://github.com/commodo/json-c into commodo-json_deep_copy 2017-11-29 09:12:59 -05:00
Eric Haszlakiewicz
3628f16dd6 Rename json_object_add_int() to json_object_int_inc() and eliminate the "int64" variant since we store 64-bit values internally anyway. 2017-11-27 17:57:36 -05:00
Alexandru Ardelean
1eab22f0da tests: add test_deep_copy test
Seems to perform better than outputting to string
and re-parsing it.

BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 20 seconds
BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 7 seconds

It should make a difference on embedded systems.
The test was performed on a i5 desktop CPU [~3.5 years of age].

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-27 16:17:48 +02:00
Alexandru Ardelean
bf80d5ad0e json_object: implement json_object_deep_copy()
Because doing `json_tokener_parse(json_object_get_string(src))`
feels sloppy, dirty, and makes me want to cry at night
sometimes.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-27 16:17:48 +02:00
Eric Haszlakiewicz
91662a5b69 Merge pull request #363 from jvijtiuk/integer_addition
Issue #338, add json_object_add_int functions
2017-11-27 09:06:39 -05:00
Eric Haszlakiewicz
9c9529f798 Update test_parse.expected to match the code. 2017-11-27 08:48:08 -05:00
Eric Haszlakiewicz
f81da5e57a Rewrite the json_tokener_state_inf handling in json_tokener to be simpler, and avoid needless copying of the input into a temporary buffer. 2017-11-27 00:20:11 -05:00
Eric Haszlakiewicz
31a6c2fac8 Add a few more tests to the partial parse to cover bytes after "Infinity". 2017-11-27 00:18:55 -05:00
Eric Haszlakiewicz
ba11d334db Save proper expected output for test_parse from the previous commit. 2017-11-27 00:08:59 -05:00
Eric Haszlakiewicz
48f7e389fb Fix parsing of "-Infinity" when the "-" and "Infinity" are split across multiple calls.
Add several additional test cases for partial parsing of infinity values.
2017-11-27 00:04:33 -05:00
Eric Haszlakiewicz
4d1e0b4409 Issue #371: fix parsing of "-Infinity" (although in a somewhat different location than PR#372 used), and add a case to test_parse to check for this. 2017-11-26 22:44:39 -05:00
Eric Haszlakiewicz
2a22858fe7 Add a few extra cases to test_parse to show how trailing bytes are handled, especially for parsing "Infinity". 2017-11-26 22:34:43 -05:00
Eric Haszlakiewicz
b8738dd623 Rewrite test_basic_parse() to factor out a single_basic_parse() to avoid lots of duplicate boiler plate code.
Also, emit the input string in the output so it's easier to see what's going on.
2017-11-26 22:33:36 -05:00
Eric Haszlakiewicz
05c85ddc21 On VS 2013 and newer, actually use strtoll instead of redefining it to _strtoi64. 2017-11-26 14:17:17 -05:00
Eric Haszlakiewicz
04788421fe Merge pull request #373 from commodo/fix-appveyor-build
build: fix build on appveyor CI
2017-11-26 14:08:53 -05:00
Eric Haszlakiewicz
49003242d1 Merge pull request #381 from busterb/fix-makedist
Fix makedist
2017-11-26 13:57:54 -05:00
Brent Cook
185f43afef add/remove missing distribution files 2017-11-26 08:33:04 -06:00
Brent Cook
6727b46454 ignore more autoconf goo 2017-11-26 08:33:04 -06:00
Alexandru Ardelean
03f3b95248 json_util: define strtoll as _strtoi64 for MSVC
Got the idea from this blog post:
  http://www.enchantedage.com/node/231

Simple & concise stuff :)

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-07 16:51:01 +02:00
Alexandru Ardelean
5641227c9b strerror_override: re-organize strerror_override.h
Always include <string.h> before _json_c_strerror() definition.
Should fix linker issues on MSVC.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-07 16:48:53 +02:00
Eric Haszlakiewicz
fabb84a785 Remove out of date win32 build information, and mention the need to use cmake there. 2017-10-22 22:46:05 -04:00
Eric Haszlakiewicz
e424af32b7 Fix definition of NELEM in the tests. 2017-10-22 22:28:35 -04:00
Eric Haszlakiewicz
ac09581cc2 Issue #370: work around Clang-on-windows oddities by rearranging ifdefs. 2017-10-22 22:19:41 -04:00
Eric Haszlakiewicz
c9c84ca7ee Issue #369: note some useful settings when building for Android. 2017-10-19 23:30:51 -04:00
Eric Haszlakiewicz
cf913621f1 Use cmake to create the json-c.pc file, as suggested by PR#362. 2017-10-09 13:16:00 -04:00
Eric Haszlakiewicz
579f0746f0 Issue #173, follow up to using strtoll to allow this to work on older Windows environments: Use cmake to generate config.h from config.h.win32, including checking for strtoll with cmake, or fall back to _strtoi64 for older MSVC's.
Also, add a few missing files to the list of sources to build.
2017-10-03 22:50:29 -04:00
Eric Haszlakiewicz
cfbdf7757b The new cmake-generated VS builds now generate a dynamic .dll instead of a .lib 2017-09-17 21:44:04 -04:00
Eric Haszlakiewicz
139eb64b43 For appveyor builds, json_config.h is actually generated in the "include" directory. 2017-09-17 21:35:53 -04:00
Eric Haszlakiewicz
66a77d129a Split the list of cmake headers into public and private ones, and only install the public ones. 2017-09-17 21:27:07 -04:00
Eric Haszlakiewicz
8899f3fbfb Add a "cmake ." line to the appveyor build file to try to get it working again. 2017-09-17 21:25:49 -04:00
Juraj Vijtiuk
1110e84cce Add json_object_add_int functions 2017-09-14 09:36:12 -04:00
Eric Haszlakiewicz
dc79d94c38 Merge pull request #361 from schwehr/int64
Fix double to int cast overflow in json_object_get_int64.
2017-09-11 21:25:27 -04:00
Kurt Schwehr
d9879c2533 Fix double to int cast overflow in json_object_get_int64.
Found with autofuzz in GDAL
2017-09-11 07:23:00 -07:00
Eric Haszlakiewicz
5454c4eaa3 Merge pull request #360 from jasonbking/master
Use strtoll() to parse ints
2017-09-07 22:45:48 -04:00
Eric Haszlakiewicz
4ac47a0219 Issue#353: attempt to fix or ignore a few -Wdocumentation messages from Clang. 2017-09-07 22:22:25 -04:00
Eric Haszlakiewicz
edde8eff9f Issue#353: mark lh_abort as actually deprecated, not just in the docs. 2017-09-07 22:21:29 -04:00
Jason King
e3fabe9a44 Add long long 64-bit check 2017-09-08 01:46:06 +00:00
Jason King
5355d387e9 Use strtoll to parse ints 2017-09-07 17:21:14 +00:00
Eric Haszlakiewicz
e1561ed1df Remove the Visual Studio project files as they were out of date, and should now be generated by using cmake. 2017-09-06 23:50:03 -04:00
Eric Haszlakiewicz
7e608c5728 Issue #359: Use consistent spacing in CMakeLists.txt 2017-09-06 23:42:38 -04:00
Eric Haszlakiewicz
32f503f738 Issue #359: Don't duplicate lh_get_hash, just omit the "inline" for VS2010. 2017-09-06 23:42:30 -04:00
Eric Haszlakiewicz
d58693b0f0 Merge pull request #359 from Haffon/api-0.12
update CMakeLists.txt for compile with visual studio at least 2010
2017-09-06 23:20:36 -04:00
Haffon
837a249f01 set JSON_C_HEADERS full file name 2017-09-07 10:39:14 +08:00
Haffon
e9f9f14f22 if compile with vs2015, enable the "static inline" declare. 2017-09-07 10:28:26 +08:00
Haffon
b301f4ea01 rollback api to 0.12 2017-09-07 10:02:21 +08:00
Haffon
86a3a6475f Merge pull request #2 from json-c/master
merge upstream
2017-09-07 09:33:07 +08:00
Eric Haszlakiewicz
548d000891 Undo a bit of 2d1da5ab: handle per-thread formats for double serialization, even if --enable-threading wasn't specified. 2017-09-05 01:56:42 -04:00
Eric Haszlakiewicz
b2afca4560 Issue #173: since some sscanf implementations return 0 for non-zero inputs, directly check for "0" in the input. 2017-09-05 01:53:13 -04:00
Eric Haszlakiewicz
2d1da5ab13 Add a --enable-threading configure option, and only use the (slower) __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified. 2017-09-03 23:37:12 -04:00
Eric Haszlakiewicz
8777c9477a Use AC_CONFIG_MACRO_DIRS to specify path to the ax macros instead of passing -I to autoreconf in autogen.sh. 2017-09-03 22:35:58 -04:00
Eric Haszlakiewicz
5b11e9adff Explicitly check for GCC's atomic functions instead of depending on the __GNUC__ define.
Add a comment mentioning the limitation even though the _ref_count value is hanled atomically.
2017-09-02 14:48:17 -04:00
Eric Haszlakiewicz
ab0d4dbc69 Merge branch 'pull-211'
This is EmielBruijntes' "Atomic updates for the refcount"
2017-09-02 13:54:15 -04:00
Eric Haszlakiewicz
95dff31951 Issue #351: don't redefine SIZE_T_MAX if it's already defined. 2017-08-30 23:35:56 -04:00
Eric Haszlakiewicz
447d67d5f3 Issue #349: none of automake's clean targets are suite for really cleaning up everything, so add a local "really-clean" target that does so. 2017-08-30 23:17:24 -04:00
Haffon
95e174e2fb Merge pull request #1 from json-c/master
want to merge the original repository
2017-08-30 00:02:59 +08:00
Eric Haszlakiewicz
81f6edbfd5 PR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string is terminated. 2017-08-25 01:15:39 -04:00
Haffon
3141c3976b 1.make it can been compiled with Visual Studio 2010
2.replace json_object_get/put API with json_object_retain/release, as they operate the reference counter, and confused with array_list_get/put_idx.
3.replace array_list_get/put_idx API with array_list_get/insert to make them more clear to use.
2017-08-22 13:53:47 +08:00
Eric Haszlakiewicz
256ebcd827 Merge pull request #346 from schwehr/get_int
Clamp double to int32 when narrowing in json_object_get_int.
2017-08-21 20:50:58 -05:00
Eric Haszlakiewicz
474376f30a Merge pull request #345 from MrAnno/fix-make-dist
Fix make dist and make distcheck
2017-08-21 20:50:20 -05:00
Eric Haszlakiewicz
2f1fe55f66 Merge pull request #344 from fastogt/master
Fix Mingw build
2017-08-21 20:39:11 -05:00
Kurt Schwehr
ef7b08ce7f Clamp double to int32 when narrowing in json_object_get_int.
Avoids undefined behavior.  Found by autofuzz.
2017-08-08 07:54:38 -07:00
László Várady
e0e34f0a13 Fix 'make distcheck'
Signed-off-by: László Várady <laszlo.varady@balabit.com>
2017-08-04 12:31:11 +02:00
László Várady
db8dbbf371 Fix 'make dist'
EXTRA_DIST copies the listed directories/files from the _source_ directory
into the distribution.

Since the doc directory does not exist after running autogen + configure
+ make dist, the distribution tarball generation fails.

Note that the dist-hook rule below operates on 'distdir', not on the source
directory where EXTRA_DIST expects the existence of the doc folder.

In summary, even if I removed 'doc' from EXTRA_DIST, the dist tarball will
always contain the documentation (due to the dist-hook rule).

Signed-off-by: László Várady <laszlo.varady@balabit.com>
2017-08-04 12:31:06 +02:00
topilski
0a99e7a5c1 Fix Mingw build 2017-07-30 07:37:17 +03:00
topilski
65884f4d9e Fix parsing doubles for mingw 2017-07-30 07:30:05 +03:00
Eric Haszlakiewicz
af87944585 PR #336: fix to previous change, be sure to include string.h when we're using the real strerror. 2017-07-27 20:17:25 -07:00
Eric Haszlakiewicz
36dbe2d74e PR #336: Fix typo in defining STRERROR_OVERRIDE_IMPL 2017-07-27 20:10:53 -07:00
Eric Haszlakiewicz
8d8a785bd2 Merge pull request #340 from commodo/fix-appveyor-build
strerror_override: add extern "C" and JSON_EXPORT specifiers for Visual C++ compilers
2017-07-27 23:09:12 -04:00
Alexandru Ardelean
d8fbfc7aa1 build,travis: drop -enable-strerror-override argument (no longer exists)
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-19 15:22:36 +03:00
Alexandru Ardelean
ddce7c28e4 strerror_override: add extern "C" and JSON_EXPORT specifiers for Visual C++ compilers
Fixes build on AppVeyor.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-19 15:17:39 +03:00
Eric Haszlakiewicz
fcad0ec015 PR #336: since we can't use function overriding (due to problems with it on
OSX) always include the _json_c_strerror function but only enable it with a flag
 during tests.
2017-07-15 07:12:44 -07:00
Eric Haszlakiewicz
730ab7b019 PR #336: since we can't use function overriding (due to problems with it on OSX) always include the _json_c_strerror function but only enable it with a flag during tests. 2017-07-15 07:07:28 -07:00
Eric Haszlakiewicz
40317f079e Allow USE_VALGRIND to be set to anything starting with 0, N or n to disable valgrind during tests. 2017-07-15 07:03:18 -07:00
Eric Haszlakiewicz
c0b7d762b2 Merge pull request #336 from commodo/fix-tests
tests: fix tests in travis-ci.org
2017-07-13 22:39:01 -04:00
Alexandru Ardelean
bc2e30453b build,travis: enable strerror override option in build
To get consistent output between Linux & OS X.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 10:27:33 +03:00
Alexandru Ardelean
fb72160caf build: make strerror() override-able
If we want to override `strerror()` in libjson-c
to make tests consistent across platforms, we
need to do it build-wide as configure/build
option.

Apple linkers make it really hard to override functions
at link-time, and this seems to be locked down on travis-ci.org
[ for security reasons I assume ].
While I got it to work locally, it did not work
when running on travis.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 10:27:24 +03:00
Alexandru Ardelean
85f57859fd configure.ac: check for uselocale function only on Linux platforms
On Apple this seems to fail the `test_locale` test,
which would imply that the `uselocale` function
does not behave as expected.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 09:33:42 +03:00
Alexandru Ardelean
7b9432d564 tests: fix leak in test_util_file ; found by cppcheck
Which now seems to fail the build.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 09:05:13 +03:00
Alexandru Ardelean
effab3f91a travis,tests: run cppcheck only if it exists
ugh... seems cppcheck is not packaged for OS X
And `set -e` exposes this.

And also `cppcheck` seems to exit with non-zero
exit codes by default [even if errs found].

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 09:05:13 +03:00
Alexandru Ardelean
9d47ae824c tests: compress test_utile_file with test_basic
More code compression/de-duplication.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-11 10:38:25 +03:00
Alexandru Ardelean
ba8625a701 tests: add set -e specifier to bail early on build run
Seems that test1 is failing, but travis is not catching it.
Likely, this is because the `cppcheck` returns success
and we need to bail on the `make check` step.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-11 10:38:25 +03:00
Eric Haszlakiewicz
dd8dcb8228 Merge pull request #335 from commodo/build_status_travis
README.md: show build status tag from travis-ci.org
2017-07-11 00:16:12 -04:00
Alexandru Ardelean
061afc7993 README.md: show build status tag from travis & appveyor.
Looks nice to see a `Build Passing` tag when you
scroll to the README.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-10 11:45:24 +03:00
Eric Haszlakiewicz
b64402ede2 Move a variable declaration to the start of the block to work better with older compilers. 2017-07-09 16:09:09 -07:00
Eric Haszlakiewicz
a14ada5730 Remove a spurious comma in configure.ac 2017-07-09 16:00:32 -07:00
Eric Haszlakiewicz
33db761551 Updated expected test1 output which should have been included in commit fd9b3b2. 2017-07-09 15:22:53 -07:00
Eric Haszlakiewicz
1d3e97f2ab Comment out the warning about racy random seed initialization in lh_char_hash(), if you're on a platform where it'll be triggered it just makes it a pain to build. 2017-07-09 15:13:02 -07:00
Eric Haszlakiewicz
f7a44ad101 Add extra casts to void * to squash some warning on certain systems (e.g. CentOS w/ gcc 4.1.2). 2017-07-09 15:08:21 -07:00
Eric Haszlakiewicz
7b7a76e161 Fix bad usage of strncat introduces in 1a94c70. Pointed out by @rouault in PR #331. 2017-07-09 15:04:18 -07:00
Eric Haszlakiewicz
55ecae3e58 Eliminate static qualifiers on a couple local variables that were causing thread safety issues. Suggested by @rouault in PR #331. 2017-07-09 14:56:18 -07:00
Eric Haszlakiewicz
5a99e527ff Reformat json_object_double_to_json_string_format() to have consistent spacing. 2017-07-08 20:33:28 -07:00
Eric Haszlakiewicz
5e33dabda1 Issue #308: improve the build instructions in README.md to include the exact commands to run for installing prerequisites, as mentioned earlier on Issue #308. 2017-07-08 19:35:06 -07:00
Eric Haszlakiewicz
fd9b3b2260 Issue #332: fix a long-standing bug in array_list_put_idx() where it would attempt to free previously free'd entries due to not checking the current array length.
Add a test that triggers the problem to ensure it stays fixed.
2017-07-08 19:04:35 -07:00
Eric Haszlakiewicz
7fd74fc7a3 Merge pull request #312 from Tailmon/master
Fix CMake Build process improved for MinGW and MSYS2
2017-07-08 21:25:48 -04:00
Eric Haszlakiewicz
4deed587e7 Merge pull request #319 from Dashlane/visual-studio-build
Windows: Fix dynamic library build with Visual Studio
2017-07-08 21:24:55 -04:00
Eric Haszlakiewicz
a3f97eeeeb Merge pull request #329 from commodo/rename-static-lib
build,cmake: build,cmake: rename libjson-c-static.a to libjson-c.a
2017-07-08 15:44:27 -04:00
Eric Haszlakiewicz
db3115cee9 Merge pull request #330 from commodo/symlink_some_tests
tests: symlink basic tests to a single file that has the common code
2017-07-08 15:43:45 -04:00
Eric Haszlakiewicz
cc201fdcaa Merge pull request #333 from besser82/bugfix/obsolete_macros_autotools
Replace obsolete AM_PROG_LIBTOOL
2017-07-08 15:17:17 -04:00
Björn Esser
cec97ebc6f Replace obsolete AM_PROG_LIBTOOL 2017-07-04 12:54:46 +02:00
Alexandru Ardelean
73636c2ed0 tests: symlink basic tests to a single file that has the common code
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-06-22 10:08:26 +03:00
Alexandru Ardelean
8f6ecbf37b build,cmake: set C_STANDARD 99 property to libjson-c-static
Apply the same property as to json-c.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-06-19 18:12:28 +03:00
Alexandru Ardelean
4fb2eefac2 build,cmake: rename libjson-c-static.a to libjson-c.a
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-06-19 18:08:45 +03:00
Eric Haszlakiewicz
a36396992d Merge pull request #321 from commodo/fix-cmake-vasprintf
build,cmake: fix vasprintf implicit definition and generate both static & shared libs
2017-06-19 00:34:44 -04:00
Eric Haszlakiewicz
e8e574fbe4 Issue #161: add a json_object_to_fd() function. 2017-06-18 18:44:45 +00:00
Eric Haszlakiewicz
23e064ad29 Fix test_double_serializer expected output. 2017-06-18 18:34:41 +00:00
Eric Haszlakiewicz
1a94c70336 Add a json_c_set_serialization_double_format() function to set the *library-wide* format for how doubles are written to a serialized JSON output. 2017-06-18 18:12:07 +00:00
Eric Haszlakiewicz
8581806558 Make _set_last_err() non-static so it can be used outside of json_util.c 2017-06-18 18:11:17 +00:00
Eric Haszlakiewicz
e76ea37772 Merge pull request #325 from rouault/fix_stack_overflow_in_json_object_double_to_json_string_format
Fix stack buffer overflow in json_object_double_to_json_string_format()
2017-05-21 21:35:16 -04:00
Even Rouault
2c2deb87f8 Fix stack buffer overflow in json_object_double_to_json_string_format()
Issue originally found in the json-c 0.11 internal copy in GDAL but also found
in latest git version.

If doing things like
json_object* obj = json_object_new_double(1e300);
json_object_set_serializer(obj, json_object_double_to_json_string, "%f", NULL);
json_object_to_json_string(obj)

    size = snprintf(buf, sizeof(buf),
        format ? format :
          (modf(jso->o.c_double, &dummy) == 0) ? "%.17g.0" : "%.17g",
          jso->o.c_double);
will return a value greater than 128 since at least 300 characters are needed.
This value is then passed to printbuf_memappend(pb, buf, size); that tries to
read size bytes in buf.

So we should clamp size to sizeof(buf). And on Windows, _snprintf() returns -1
in that situation, so deal also with this case.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1682
Credit to OSS-Fuzz
2017-05-18 22:36:35 +02:00
Alexandru Ardelean
f10a5ae4d7 .gitignore: add cmake generated files
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-05-03 12:00:38 +03:00
Alexandru Ardelean
4b5e39c89c build,cmake: generate both static and shared libjson
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-05-03 12:00:38 +03:00
Alexandru Ardelean
cfbbb23141 build,cmake: add _GNU_SOURCE to CFLAGS
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-05-03 11:36:45 +03:00
David Henot
a9f265d166 Fix library build with Visual Studio 2017-04-26 14:11:17 +02:00
Pablo Sanabria
d3f813a14e Fixed linkhash.c for MinGW
Added #ifdef conditions for MinGW because this compiler doesn't define
gcc atomic builtins, so __sync_val_compare_and_swap was not found
neither any of any __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* definition
2017-03-26 23:14:37 -03:00
Pablo Sanabria
2cda677d06 Fix CMake Build process for MinGW and MSYS2
This fix includes some fixes for config.h.win32 that was generating
some compiling errors on MinGW64 and also fix CMakeLists.txt in order to
give better support to MinGW and MSYS2
2017-03-26 23:14:37 -03:00
Eric Haszlakiewicz
6bd86d1044 Merge pull request #311 from jj1118/master
Fix error C3688 when compiling on Visual Studio 2015
2017-03-26 03:52:57 +00:00
Jason Li
0f81ecf5f4 Fix error C3688 when compiling on Visual Studio 2015: invalid literal suffix 'PRId64'; literal operator or literal operator template 'operator ""PRId64' not found 2017-03-24 14:53:25 +08:00
Eric Haszlakiewicz
4e673656a1 Merge pull request #310 from marxin/fix-gcc7-warnings
Add FALLTHRU comment to handle GCC7 warnings.
2017-03-22 23:37:14 -04:00
marxin
014924ba89 Add FALLTHRU comment to handle GCC7 warnings. 2017-03-21 08:42:11 +01:00
Eric Haszlakiewicz
82f5a4ab29 Merge pull request #305 from alexanderst/master
Fix compilation without C-99 option
2017-03-03 23:12:56 -05:00
Alex
175d934cff Fix compilation without C-99 option 2017-03-02 10:57:49 +02:00
Eric Haszlakiewicz
8c86207258 Add a few more cases to test_parse to provide some examples of how parsing works; should help address the questions raised in Issue #302. 2017-02-26 16:22:45 +00:00
Eric Haszlakiewicz
d74b7eb144 Merge pull request #303 from yogo1212/tokener_h
fix doc in tokener header file
2017-02-24 22:34:36 -05:00
Leon M. George
482e771af1 fix doc in tokener header file 2017-02-20 04:41:55 +01:00
Eric Haszlakiewicz
3948fcad2d Issue #300: Cast size_t values to int instead of unsigned long long to work around broken behavior of MinGW. 2017-02-05 17:00:35 +00:00
Eric Haszlakiewicz
bad6c9a427 Issue #300: Some platforms, such as MinGW, don't have ETXTBSY and ENOTBLK, so skip those there. 2017-02-05 04:44:30 +00:00
Eric Haszlakiewicz
9a64fd7d55 Issue #300: Use %p instead of %lx in test_util_file since some platforms' pointers are larger than "unsigned long".
Also, there's no need to worry about output consistency here, since it'll be
 different anyway due to different pointer values.
2017-02-05 04:38:53 +00:00
Eric Haszlakiewicz
91977159ee Add cast to int in calls to isdigit() since some platforms complain about char being used as an array index. 2017-02-05 04:34:05 +00:00
Eric Haszlakiewicz
3fab117e4e Merge pull request #299 from qlyoung/perf-improvements
Improve json_object -> string performance
2017-02-04 11:13:14 -05:00
Quentin Young
f6f852fd93 Restore sprintbuf(), add macro for string literals
Hawciz pointed out that the previous commit modifies the public
interface of printbuf. Per his suggestion, sprintbuf() was restored
and a new pair of macros was added that wraps printbuf_memappend().

Using a wrapper macro instead of modifying sprintbuf() also reduces
function call overhead, bringing total performance gains to
approximately 400%.
2017-02-04 01:02:00 +00:00
Eric Haszlakiewicz
75825a9f01 Use strdup instead of strndup in test1.c, there's no need for the latter because json_object_to_json_string_length() will always return a properly sized string. 2017-02-03 17:10:27 +00:00
Quentin Young
9ff0f4987f Improve json_object -> string performance
Removes variadic prints for ~3x performance improvement.
2017-02-02 17:33:54 +00:00
Eric Haszlakiewicz
8157784483 Issue #295: also check if size_t is the size of long long, to help support 64-bit Windows platforms. 2017-01-07 22:55:31 -05:00
Eric Haszlakiewicz
177c401e02 Ignore tests/test_float 2016-12-18 14:35:06 -05:00
Eric Haszlakiewicz
0a010a59eb Change a memcpy that should be a memmove within json_pointer_get, and fix memory leaks in of one the json_pointer tests. 2016-12-18 14:33:41 -05:00
Eric Haszlakiewicz
779b77a164 Note some minimum versions needed for autoconf, etc... 2016-12-12 23:01:20 -05:00
Eric Haszlakiewicz
a443b9f7e7 Issue#292: bump the required version of configure listed in configure.ac so a more useful error message is generated, rather than failing later because the extra macros from ./autoconf-archive/m4/ didn't get loaded. 2016-12-11 19:18:33 -08:00
Eric Haszlakiewicz
1e4824a841 Merge pull request #289 from jgerhards/i-278
bugfix: floating point representaion without fractional part
2016-12-04 20:52:33 -05:00
Jan Gerhards
61db4cfac5 testbench: add test for floating point representation 2016-11-27 11:50:48 +01:00
Jan Gerhards
ca7a1973e2 bugfix: floating point representaion without fractional part
closes https://github.com/json-c/json-c/issues/278
2016-11-27 11:47:00 +01:00
Eric Haszlakiewicz
d050f1e622 Merge pull request #287 from commodo/json_pointer_va_args
json_pointer: extend setter & getter with printf() style arguments
2016-11-24 15:03:50 -05:00
Alexandru Ardelean
47f32a76ef vasprintf_compat.h: spin-off this compat header ; use math_compat.h as template
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-22 16:37:30 +02:00
Alexandru Ardelean
8cb86a583a strdup_compat.h: re-spin this compat header ; use math_compat.h as template
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-22 16:37:29 +02:00
Alexandru Ardelean
c0da680f13 test_json_pointer: update test with a few printf variants
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-22 16:37:18 +02:00
Alexandru Ardelean
742e059da1 json_pointer: add json_pointer_getf/setf() function variants
These include support for printf() style args for path.

Adds support for calling with 'json_pointer_getf(obj, &res, "/foo/%d/%s", 0, bar)'
style args.

Makes it easier for doing more dynamic stuff/magic, without
needing to use vasprintf() externally.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-22 16:33:49 +02:00
Alexandru Ardelean
97dd7d5103 json_pointer.c: fix whitespace
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-16 16:15:53 +02:00
Eric Haszlakiewicz
8e12f4a21c Merge pull request #285 from ebassi/revert-strdup-compat
Revert "compat/strdup.h: move common compat check for strdup() to own…
2016-11-09 09:56:58 -05:00
Emmanuele Bassi
7601f20d70 Revert "compat/strdup.h: move common compat check for strdup() to own file"
This reverts commit aaba8c1080.

This commit breaks builddir != srcdir build, but, more importantly, it
also adds a dependency on a header, "config.h", which is not installed
and it's supposed to be private — since it's generated at configuration
time and it's not meant to be used by projects compiling against a
library.
2016-11-07 20:51:11 +00:00
Eric Haszlakiewicz
e8ce1db471 Merge pull request #283 from commodo/json_pointer
json_pointer: add first revision based on RFC 6901
2016-11-04 11:48:30 -04:00
Alexandru Ardelean
ee7fc26de1 tests: add test_json_pointer test
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-04 09:59:43 +02:00
Alexandru Ardelean
2fbdee19da tests/strerror_override.c: fix compilation error
I got this on Mac OS X at least.
Not sure if it shows up in other envs

error:
```
strerror_override.c:53:13: error: incompatible redeclaration of library function 'strerror' [-Werror,-Wincompatible-library-redeclaration]
const char *strerror(int errno_in)
```

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-04 09:51:44 +02:00
Alexandru Ardelean
0e91183300 json_pointer: add first revision
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-04 09:51:36 +02:00
Alexandru Ardelean
aaba8c1080 compat/strdup.h: move common compat check for strdup() to own file
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-03 15:51:33 +02:00
Eric Haszlakiewicz
d4899bd4d5 Handle NULL objects in json_object_get_userdata() by returning NULL, but abort in json_object_set_userdata() since we can't actually do anything with the userdata. 2016-10-29 15:42:36 -04:00
Eric Haszlakiewicz
f8132f932d Issue #280: add a few assert() calls to ensure objects are of the appropriate type. 2016-10-29 15:31:31 -04:00
Eric Haszlakiewicz
33339ae595 Use json_visit() to clear the serializer data set when parsing so the output from test_parse reflects the actual values parsed. 2016-10-29 15:13:16 -04:00
Eric Haszlakiewicz
ecdc14f535 Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects. 2016-10-29 15:01:20 -04:00
Eric Haszlakiewicz
7e12b9f47c Fix broken key-order test in test_compare. 2016-10-10 00:13:39 -04:00
Eric Haszlakiewicz
80150a18d3 Merge pull request #272 from sgerbino/master
Allows for compilation with CMake on macOS
2016-10-08 13:13:33 -04:00
Eric Haszlakiewicz
818156f6f7 Merge pull request #277 from ALLTERCO/json_object_set_xxx
Json object set xxx
2016-10-08 12:08:53 -04:00
Stoian Ivanov
be63ba99ca try restore windows automated builds 2016-10-07 22:54:06 +03:00
Stoian Ivanov
a26305d428 fix compiler warning for int sizes 2016-10-07 01:07:34 +03:00
Stoian Ivanov
e518b22b72 string set and tests 2016-10-07 00:51:24 +03:00
Stoian Ivanov
9a313f767f gitignore test; add double value set checks in test 2016-10-06 23:32:19 +03:00
Stoian Ivanov
6a0667567d some simple tests 2016-10-06 23:16:29 +03:00
Eric Haszlakiewicz
36a28fcb0c Issue #275: fix out of bounds read when handling unicode surrogate pairs. 2016-10-05 23:15:51 -04:00
Stoian Ivanov
05f025c075 some basic set 2016-10-05 23:55:46 +03:00
Eric Haszlakiewicz
5fd99e62ed Merge pull request #273 from konoal/master
fixed wrong object name in json_object_all_values_equal
2016-09-28 08:08:01 -04:00
Eric Haszlakiewicz
5653bc61a4 Merge pull request #274 from pepevel/master
Support for 64 bit pointers on Windows
2016-09-28 08:05:50 -04:00
pepevel
0df34b4c96 Support for 64 bit pointers on Windows 2016-09-27 20:12:03 +01:00
Alexey Konovalov
b2fbf93df0 fixed wrong object name in json_object_all_values_equal 2016-09-27 11:20:49 +03:00
Steve Gerbino
c5c93724fe Changed CMake variables and adding output for debugging 2016-09-26 00:19:46 -04:00
Steve Gerbino
0c749d96ea Target C99 standards to get rid of warnings 2016-09-26 00:09:55 -04:00
Steve Gerbino
928858457b Modified the execute_process commands 2016-09-25 23:08:39 -04:00
Steve Gerbino
bdead39f63 Changed PROJECT_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR to fix building when used as external project 2016-09-25 22:32:35 -04:00
Steve Gerbino
702b42eaf3 Modified CMakeLists.txt to use autotools to generate configuration for Unix systems 2016-09-25 22:03:56 -04:00
Steve Gerbino
43afcc0d99 Lowered CMake required version so that Travis CI is able to build, moved include folder to include/json-c to match the behavior of autotools 2016-09-25 18:49:34 -04:00
Steve Gerbino
fe941a26a3 Trailing slash seems necessary in the install command to get contents 2016-09-25 15:04:05 -04:00
Steve Gerbino
ab7c09dc8e Forget DESTINATION in CMake install command 2016-09-25 14:59:38 -04:00
Steve Gerbino
34b4a490b1 We need to also install the generated configuration files 2016-09-25 14:57:15 -04:00
Steve Gerbino
989e39d995 Fixed typo in CMakeList.txt FILES_MATCHING 2016-09-25 14:46:33 -04:00
Steve Gerbino
e2ee223dc2 Added install instructions for CMake 2016-09-25 14:42:14 -04:00
Steve Gerbino
69f018c49e Resolves json-c/json-c#271 by adding MacOS configuration files and modifies CMakeLists.txt to use them 2016-09-25 02:14:57 -04:00
Stoian Ivanov
fae09456ae json_object_set_boolean for upstream style check 2016-09-21 01:31:00 +03:00
Eric Haszlakiewicz
9f9c3326fe Merge pull request #267 from sixlettervariables/patch-1
Removes me as Win32 maintainer, because I'm not.
2016-09-12 18:19:26 -04:00
Christopher Watford
21e5ffbcf8 Removes me as a maintainer, because I'm not.
Updates README-WIN32.html to remove my status as a maintainer (I'm not). Also removes ancient porting notes and adds a reference to json_config.h.win32 which is where most folks should go to start with Windows issues.
2016-09-12 14:18:21 -04:00
Eric Haszlakiewicz
ea1499a372 Issue #263: add const so the prototype for json_object_object_add_ex() matches the definition. 2016-08-24 23:41:22 -04:00
Randy Armstrong
c5b5a984cd Add Cmakefile 2016-08-24 22:49:16 -04:00
Eric Haszlakiewicz
0fcf1d1ae7 Fix memory leak and inconsistent output (due to varying fd numbers) in test_util_file. 2016-08-20 23:06:22 -04:00
Eric Haszlakiewicz
5fccfed4f4 Issue #260: add a check to prevent trivial loops in the object tree, even though it is up to the callers to avoid doing so in more complex cases. 2016-08-20 22:42:59 -04:00
Eric Haszlakiewicz
c4d060bf80 json_object_object_add_ex() should have shared code with json_object_object_add(), and been changed to return int at the same time the latter was. Do that now.
Also correct a couple of calls to _to_json_string to check the return value.
2016-08-20 22:42:59 -04:00
Eric Haszlakiewicz
e40505e489 Merge branch 'RyDroid-tests' 2016-08-13 09:17:25 -04:00
Eric Haszlakiewicz
61cd433131 Merge branch 'tests' of https://github.com/RyDroid/json-c into RyDroid-tests
Conflicts:
	tests/test_util_file.c
2016-08-13 09:17:01 -04:00
Eric Haszlakiewicz
e076ae756d Merge pull request #251 from RyDroid/editorconfig
Adding a file for EditorConfig
2016-08-13 08:31:57 -04:00
Nicola Spanti (RyDroid)
8215c0ac0e Very minor changes to some tests 2016-08-13 00:53:33 +02:00
Nicola Spanti (RyDroid)
b222d4386e Adding a file for EditorConfig 2016-08-13 00:27:58 +02:00
Eric Haszlakiewicz
4d62de3898 Revert bogus change to json_object_get() made in f40b08d8 that caused it to always return NULL. (Issue #259)
Also undo NULL check in json_tokener_set_flags(): it's not at all valid toi
 try to set flags on a NULL pointer, and doing so should not be silently
 ignored.
2016-08-11 17:05:41 -04:00
Eric Haszlakiewicz
0ad87649d4 Merge pull request #255 from RyDroid/minor-c2
Minor changes in C source code
2016-08-10 15:06:30 -04:00
Eric Haszlakiewicz
9f9a9ac426 Merge pull request #252 from RyDroid/minor-no-c
Very minor changes not related to C source code
2016-08-09 07:39:27 -04:00
Eric Haszlakiewicz
71d0615e98 Merge branch 'jobol-issue-165' 2016-08-09 07:38:18 -04:00
Eric Haszlakiewicz
f3db59d990 Merge branch 'issue-165' of https://github.com/jobol/json-c into jobol-issue-165
Conflicts:
	tests/test_util_file.c
2016-08-09 07:36:54 -04:00
Eric Haszlakiewicz
bc3e691a1e Merge pull request #253 from RyDroid/cppcheck-travis
Adding a test with cppcheck for Travis CI
2016-08-08 22:57:56 -04:00
Eric Haszlakiewicz
51b011ce24 Merge pull request #249 from RyDroid/readme
Improving README
2016-08-08 22:53:33 -04:00
Eric Haszlakiewicz
d758f4a8a7 Add a brief style guide. Address Issue #257. 2016-08-08 22:50:23 -04:00
Eric Haszlakiewicz
33ae9f5d44 Merge pull request #250 from RyDroid/gitignore
Improving .gitignore
2016-08-08 18:42:01 +00:00
Nicola Spanti (RyDroid)
ab1d761865 Improving .gitignore 2016-08-08 15:29:47 +02:00
Nicola Spanti (RyDroid)
f2e7dda910 Improving README 2016-08-08 15:25:31 +02:00
Nicola Spanti (RyDroid)
36b4003118 Adding a test with cppcheck for Travis CI 2016-08-08 15:23:27 +02:00
Nicola Spanti (RyDroid)
f40b08d8f0 Minor changes in C source code 2016-08-08 15:20:41 +02:00
Nicola Spanti (RyDroid)
250a3987cf Very minor changes not related to C source code 2016-08-08 15:13:43 +02:00
Eric Haszlakiewicz
9688f343a5 Issue #246: Include xlocale.h too, to get locale_t defined, since not all OSes include that in locale.h 2016-08-02 22:25:05 -04:00
José Bollo
1fceb2207a test: add test of 'json_object_to_json_string_length'
The test is implied in test1.

The idea is to check that the returned lengths and strings
are identical to what is expected to return the already
tested function 'json_object_to_json_string_ext'.

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-08-01 15:04:54 +02:00
Eric Haszlakiewicz
fa76e4a8c9 Issue #195: Actually call uselocale() in the new locale handling code in json_tokener.
Also, be sure the right locale_t is freed if we fail on the second uselocale.
Finally, fix test_locale so it *doesn't* use json_object_to_json_string as
 that will simple re-emit the original parsed string values.
2016-07-31 14:43:14 -04:00
Eric Haszlakiewicz
4091b9c87e Issue #195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments. 2016-07-30 21:34:58 -04:00
Eric Haszlakiewicz
7d637362b7 Linux's %p format doesn't return "0x0" for NULL pointers, so switch to using %lx for consistency. 2016-07-30 15:09:51 -04:00
Eric Haszlakiewicz
deb9fa482d Issue #240: add arbitrary use of val's in foreach loops to squash warnings about unused variables. 2016-07-30 18:27:53 +00:00
jobol
344009bf26 Add method 'json_object_to_json_string_length'
This new method allows to also
get the length of the generated string.

Fix #165

Change-Id: Iea91404027f143ca3d29a4c58d7c07ae53556110
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-07-27 14:45:25 +02:00
José Bollo
54ae254537 Fix a compiling error
The function fstat isn't declared without this include
on debian strect/sid and Fedora-23

Change-Id: I660a32ff173dcba04674aed51ed855b4fa55ac67
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-07-27 14:42:25 +02:00
Eric Haszlakiewicz
b366750e11 Merge pull request #239 from ploxiln/printbuf_empty
initialize null terminator of new printbuf
2016-07-16 13:49:08 -04:00
Pierce Lopez
868b20ce4e initialize null terminator of new printbuf
It's possible (e.g. by using json_object_from_file() on an empty file)
to get json-c to try to use a printbuf that has never had anything
written to it. Before this change, it could access a string that
should be length zero, but was never initialized, and could
theoretically have an unexpected string.
2016-07-16 00:30:31 -04:00
Eric Haszlakiewicz
2b255d0ebf Fix absolute paths in test_util_file that vary depending on where it is run. 2016-06-27 04:30:10 +00:00
Eric Haszlakiewicz
b1d65b62db Issue #113: Add more files to EXTRA_DIST and a dist-hook to get distcheck to at least not fail. 2016-06-27 04:30:04 +00:00
Eric Haszlakiewicz
1071385896 Issue #113: add "new" files to appropriate variables in Makefile, and note the need to run "make distcheck" as part of the release process.
Fix issues with the test script so it works under distcheck too.
2016-06-27 04:15:30 +00:00
Eric Haszlakiewicz
29005ef7b1 Merge pull request #238 from nagamalli9999/master
linkhash.c: optimised the table_free path
2016-06-26 23:09:42 -04:00
Eric Haszlakiewicz
29ef73f21d Issue #189: Eliminate use of MC_ERROR from json_util.c, and add a json_util_get_last_err() function to retrieve the error for those callers that care about it.
Add tests and descriptions for the functions in json_util.c
2016-06-26 02:20:33 +00:00
Eswar Yaganti
78cf6e63ff linkhash.h: removed redundant params from comments 2016-06-25 23:05:41 +05:30
Eswar Yaganti
5fb63a09f9 linkhash.c: optimised the table_free path 2016-06-25 22:50:36 +05:30
Eric Haszlakiewicz
595891729e Issue #236: Add -Wcast-qual and fix casts to retain constness.
To better distinguish between entry->k and entry->v being const within linkhash, but non-const outside, add lh_entry_v() and lh_entry_k() accessors.
Make lh_entry->k const.
2016-06-11 18:19:39 +00:00
Eric Haszlakiewicz
f285c0a2e5 Issue #175: disable the fast-and-loose code in hashlittle() when running with AddressSanitizer. 2016-06-08 03:24:59 +00:00
Eric Haszlakiewicz
ae66b24369 Mention that we're aiming to follow RFC 7159 now.
Cause README.md to show up in Doxygen output as the main page.
2016-06-08 02:37:15 +00:00
Eric Haszlakiewicz
40de3c67cd Merge pull request #232 from NeoRaider/size_t2
tests/tests1: fix printf format for size_t arguments
2016-06-07 16:47:40 -04:00
Matthias Schiffer
d13cfe10f6 tests/tests1: fix printf format for size_t arguments
Change %d to %llu and add cast to unsigned long long for size_t arguments,
otherwise compilation will fail with errors like:

test1.c:70:15: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t {aka long unsigned int}’ [-Werror=format=]

%zu is avoided to stay compatible with old libc versions (like old Visual
Studio).
2016-06-07 10:49:42 +02:00
Eric Haszlakiewicz
a42caac805 Copy over note about the 0.12.1 release to the master branch. 2016-06-07 04:13:15 +00:00
Eric Haszlakiewicz
0539191d18 Check the __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{2,4,8} defines to decide whether to use __sync_val_compare_and_swap(), as described at https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
Also, fix the types of the variables when building on Windows.
Also, should address issue #214.
2016-06-07 03:26:46 +00:00
Eric Haszlakiewicz
1eb5a700f9 Merge pull request #230 from ebassi/master
Use stdint.h to check for size_t size
2016-06-06 22:59:38 -04:00
Eric Haszlakiewicz
e61eb409fd Merge pull request #233 from NeoRaider/size_t3
Include stddef.h in json_object.h
2016-06-06 22:55:44 -04:00
Eric Haszlakiewicz
ce7ad480f4 Merge pull request #234 from NeoRaider/userdata
Add public API to use userdata independently of custom serializer
2016-06-06 22:54:40 -04:00
Michael Clark
0e1a057449 Remove reference to svn.metaparadigm.com
svn.metaparadigm.com no longer exists so it is not possible to use source from there.
2016-06-07 08:11:16 +12:00
Matthias Schiffer
f87e378d48 Add public API to get and set userdata
Also, json_object_set_serializer is changed to respect the userdata
and user_delete parameters when to_string_func is NULL.
2016-05-29 11:24:55 +02:00
Matthias Schiffer
c2b004ba0e Make default double serializer ignore userdata again
The user might want to use the userdata for something different, so the
serializer should ignore it by default.

Explicitly setting the serializer to json_object_double_to_json_string will
still make it interpret the userdata as a format string.
2016-05-29 11:24:55 +02:00
Matthias Schiffer
22fdcfc71a Include stddef.h in json_object.h
It is needed for size_t.
2016-05-29 05:19:50 +02:00
Emmanuele Bassi
28c1ca1240 Use stdint.h to check for size_t size
If we use json_inttypes.h we are going to fail when builddir != srcdir,
and since JSON_C_HAVE_INTTYPES_H is defined after the configure script
has run, including json_inttypes.h would be the equivalent on including
stdint.h anyway.

This fixes the build of json-c in the GNOME Continuous builder.
2016-05-23 10:20:48 +01:00
Eric Haszlakiewicz
7ae5c3f7a6 Issue #142: un-deprecate json_object_object_get(), but note why you might want to use json_object_object_get_ex() instead. 2016-05-23 03:02:34 +00:00
Eric Haszlakiewicz
5e4e5f7d9d Issue #205: use _strdup instead of strdup on Windows. 2016-05-23 02:37:09 +00:00
Eric Haszlakiewicz
f4ca1325ae Merge branch 'doctaweeks-fixes-for-upstream' 2016-05-23 02:12:51 +00:00
Eric Haszlakiewicz
996be85843 Fix a few places that needed adjustment for the size_t changes, including updating the range checks to use a calculated SIZE_T_MAX. 2016-05-23 02:10:58 +00:00
Eric Haszlakiewicz
9a2915ce66 Merge branch 'fixes-for-upstream' of https://github.com/doctaweeks/json-c into doctaweeks-fixes-for-upstream 2016-05-23 02:08:28 +00:00
Eric Haszlakiewicz
b2c5969aff Merge pull request #193 from jplitza/master
Make serialization format of doubles configurable
2016-05-18 16:10:27 -04:00
Jan-Philipp Litza
21dc5dc92b Export json_object_double_to_json_string() and use custom format string 2016-05-06 16:12:44 +02:00
Jan-Philipp Litza
2200ffa8b0 Fix code in docs for json_object_new_double_s() 2016-05-06 16:12:19 +02:00
Eric Haszlakiewicz
3345b25962 Add tests for the json_object_array_del_idx() function. 2016-04-30 19:09:45 +00:00
Eric Haszlakiewicz
9edf2418e0 Merge branch 'Protovision-master' 2016-04-30 18:53:16 +00:00
Eric Haszlakiewicz
1fb87cd196 Merge branch 'master' of https://github.com/Protovision/json-c into Protovision-master 2016-04-30 18:52:47 +00:00
Eric Haszlakiewicz
e3fb74942a Merge pull request #216 from Jehan/master
configure: check realloc with AC_CHECK_FUNCS() to fix cross-compilation.
2016-04-30 14:45:16 -04:00
Eric Haszlakiewicz
c6a97eb9ce Merge pull request #218 from sevan/patch-1
Use a macro to indicate C99 to the compiler
2016-04-30 14:44:29 -04:00
Eric Haszlakiewicz
82bdbdba24 Merge pull request #219 from rouault/low_heap_robustness_fixes
Fix various potential null ptr deref and int32 overflows
2016-04-30 14:44:05 -04:00
Eric Haszlakiewicz
4e0c8b55fb Merge pull request #220 from hschaa/master
Add utility function for comparing json_objects
2016-04-30 14:42:16 -04:00
Eric Haszlakiewicz
afa9f824e7 Merge pull request #222 from chenha0/master
Fix issue #221: JSON_C_TO_STRING_NOSLASHESCAPE works incorrectly
2016-04-30 14:40:30 -04:00
Eric Haszlakiewicz
02a2151b2b Merge pull request #223 from minaguib/master
Clarify json_object_get_string documentation of NULL handling & return
2016-04-30 14:36:02 -04:00
Mina Naguib
138c2a6b97 Clarify json_object_get_string documentation of NULL handling & returning 2016-02-07 20:55:25 -05:00
chenha0
dffdee966f Fix issue #221: JSON_C_TO_STRING_NOSLASHESCAPE works incorrectly
Tests added.
2016-01-21 20:12:48 +08:00
Helmut Schaa
dec5fcd50b Add some basic tests for verifying json_object_equal behavior
Do some basic checks on ints, doubles, strings, arrays and "complex" objects.
2016-01-13 15:56:39 +01:00
Helmut Schaa
00e475c434 Add utility function for comparing json_objects 2016-01-13 15:56:38 +01:00
Even Rouault
77a4276a8c Fix various potential null ptr deref and int32 overflows
This fix errors that can happen when ingesting very large JSON files
when hitting the maximum heap size of the process.
2016-01-11 12:15:54 +01:00
Sevan Janiyan
7150b7f28d Use a macro to indicate C99 to the compiler
The [AC_PROG_CC_C99 macro](https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/C-Compiler.html) sets the complier to the C99 standard if the compiler does not default to such behaviour (albeit gnu99). This is better than specifically hardcoding flags
2016-01-05 11:43:17 +00:00
Jehan
79c99aeb2b configure: check realloc with AC_CHECK_FUNCS() to fix cross-compilation.
AC_FUNC_REALLOC is messed up when cross-compiling, ending up in failed
build with "undefined reference to `rpl_realloc'" error.
AC_CHECK_FUNCS will work both with native and cross builds.
2016-01-01 18:46:02 +01:00
Eric Haszlakiewicz
537f8bcbdb Add const qualifiers to several functions that don't modify the json_object. 2015-12-26 21:42:18 +00:00
Eric Haszlakiewicz
882b7d95cc Issue #137: remove config.h.in from change control. 2015-12-08 21:20:42 -06:00
Eric Haszlakiewicz
980cdd61be Merge commit '2be921d88376e78f84d79aafa6db2714da804e59' 2015-12-08 20:51:06 -06:00
Eric Haszlakiewicz
65be8275da Merge pull request #209 from rgerhards/fix-regression
fix regression from 2d549662be
2015-11-29 21:24:50 -05:00
Eric Haszlakiewicz
316da85818 Fix issue #201: add a JSON_C_TO_STRING_NOSLASHESCAPE flag to turn off escaping of forward slashes. 2015-11-28 20:00:30 -06:00
Eric Haszlakiewicz
5a6a378725 Merge pull request #198 from unmole/master
Fix possible memory leak and remove superfluous NULL checks before free()
2015-11-28 13:58:07 -05:00
Emiel Bruijntjes
7e98ed93f4 subtract first, then retrieve value 2015-11-28 14:19:43 +01:00
Emiel Bruijntjes
9d85367679 added tabs instead of spaces to be compatible with rest of code 2015-11-27 16:53:57 +01:00
Emiel Bruijntjes
827f0fd8ef update indentation 2015-11-27 16:52:17 +01:00
Emiel Bruijntjes
23ee243113 reference increment and decrement is now atomic (when using a GCC compatible compiler), which allows passing json objects between threads 2015-11-27 16:49:32 +01:00
Daniel M. Weeks
92e9a5032b Use size_t for json object array ops 2015-11-24 14:00:32 -05:00
Daniel M. Weeks
45c56b80c4 Use size_t for array list length and size 2015-11-24 14:00:31 -05:00
Rainer Gerhards
36610fb697 fix regression from 2d549662be
That commit introduced read-only keys, but when the hash table
was resized, that attribute was not preserved. This resulted in
an invalid free at time of table destruction.
2015-11-19 11:05:15 +01:00
Eric Haszlakiewicz
c97bbd3797 Merge pull request #199 from Nzbuu/fix_vs_build
Fix build in Visual Studio
2015-11-14 23:31:15 -05:00
Eric Haszlakiewicz
b82a51a5cd Merge pull request #200 from Nzbuu/ci_build
Add build scripts for CI platforms
2015-11-14 23:30:38 -05:00
James Myatt
239c146a4b Appveyor: Visual Studio v140 no longer fails 2015-11-05 13:50:30 +00:00
James Myatt
fd43c2b99a Appveyor: Create artefact with library and include files only 2015-11-05 13:45:01 +00:00
Eric Haszlakiewicz
80c1f69b9e Use AX_APPEND_COMPILE_FLAGS() to check the various compile flags, such as -Wall, to ensure the compile supports. 2015-10-23 02:16:40 +00:00
Eric Haszlakiewicz
10d50aadf2 Remove the AC_FUNC_MALLOC check, since we don't depend on the malloc(0) behavior it checks for, and we don't provide a rpl_malloc() implementation anyway. 2015-10-22 02:57:13 +00:00
James Myatt
82030cd0af Travis: add osx and clang builds 2015-10-09 23:58:02 +01:00
James Myatt
88dedb8824 Travis: skip install step 2015-10-09 23:58:01 +01:00
James Myatt
f786feac0a Add Travis build script 2015-10-09 23:58:00 +01:00
James Myatt
17e11e2c92 Appveyor: Allow failing builds against newest toolset 2015-10-09 23:54:14 +01:00
James Myatt
f6f8436e97 Add initial version of Appveyor build script 2015-10-09 23:54:13 +01:00
James Myatt
3f012eb0f8 Fix build in Visual Studio 2015-10-09 23:24:55 +01:00
Anmol Sarma
467102fa78 Remove superfluous NULL checks 2015-10-01 14:14:03 +05:30
Anmol Sarma
f37b0a10a5 Fix possible memory leak 2015-10-01 14:09:09 +05:30
Eric Haszlakiewicz
12916e229c Merge pull request #196 from rgerhards/improve-performance
Performance improvements
2015-09-28 22:25:29 -04:00
Rainer Gerhards
c4f8cc34df more efficient handling for smalls strings inside json_object
smalls strings inside json_objects had a high overhead because dynamic
memory allocation was needed for each of them. This also meant that the
pointer needed to be updated. This is now changed so that small strings
can directly be stored inside the json_object. Note that on the regular
64 bit machines a pointer takes 8 bytes. So even without increasing
memory, we could store string up to 7 bytes directly inside the object.
The max size is configurable. I have selected up to 31 bytes (which
means a buffer of 32 including the NUL byte). This brings a 24-bytes
memory overhead, but I consider that still useful because the memory
allocator usually also has quite some overhead (16 bytes) for
dyn alloced memory blocks. In any case, the max buffer size can be
tweaked via #define.
2015-09-23 15:56:48 +02:00
Rainer Gerhards
1ae4b50bde remove unneeded data items from hashtable code
These items were used for statistics tracking, but no code at all
exists to consume them. By removing them we save

a) space
   because they counters required space, and did so in each and every
   json object

b) performance
   because calloc() needs to write less data and the counters are
   no longer maintained; cache performance can be better, load
   on OS main memory is lighter

We could conditionally enable/disable these counters, but I have not
done this they were really nowhere used and it looked more like a
left-over from the import of hashtable code.
2015-09-23 12:40:57 +02:00
Rainer Gerhards
8f8d03df46 add perllike hash function for strings
This also adds a new API json_global_set_string_hash() which permits
to select the hash function. The default one is the only one that was
previously present. So there are no changes to existing apps, and the
new hash function needs to be explicitely be opted in. Especially for
smaller strings, the perllike functions seems to be around twice as
fast as the other one, with similarly good results in value distribution.
2015-09-23 12:23:09 +02:00
Rainer Gerhards
2d549662be add json_object_object_add_ex() API
This provides more control over some detail aspects, many
of which are performance related.
2015-09-23 09:43:00 +02:00
Rainer Gerhards
d8e44dc685 reduce duplicate hash computation in json_object_object_add()
This can be a very considerable performance saver.
2015-09-22 19:07:30 +02:00
Eric Haszlakiewicz
1757a31750 Fix doc for json_object_new_boolean() to indicate the correct value for TRUE (1). 2015-08-23 00:08:14 -04:00
Eric Haszlakiewicz
d4f8f92eb0 Squash deprecated function warning by replacing json_object_object_get calls with json_object_object_get_ex in test_cast. 2015-08-23 00:06:36 -04:00
Eric Haszlakiewicz
93b1fe63e5 Add back in the __attribute__((__unused__)) that was lost in the previous commit.
It's needed to squash a "variable 'val' set but not used" warning.
2015-08-23 00:00:12 -04:00
Eric Haszlakiewicz
a8bbefbbb4 Merge pull request #183 from cryogen/master
Apply compile warning fix to master branch
2015-08-22 15:24:26 -04:00
Eric Haszlakiewicz
55530bfc0f Merge pull request #186 from Virtual-Instruments/master
Syntax error
2015-08-05 23:19:19 -04:00
Jacob Alexander
e8a302017f Syntax error
- ./configure would fail due to bad code generation
2015-06-02 14:34:51 -07:00
Eric Haszlakiewicz
b594c34f57 Merge pull request #174 from haata/master
Adding JSON_C_TO_STRING_PRETTY_TAB flag
2015-05-31 12:10:13 -07:00
Jacob Alexander
92d4cf15f0 Adding JSON_C_TO_STRING_PRETTY_TAB flag
- Tabs are easier to read for tired eyes and editor adjustable
2015-05-27 17:37:39 -07:00
Eric Haszlakiewicz
cd8bd7f617 Tell the compiler we're intentionally ignoring the return value from __sync_val_compare_and_swap(). 2015-05-26 19:02:19 -07:00
Stuart Walsh
75d7409c4e Fix uninitialised variable compile warning, and also fix unused-when-used warning 2015-05-10 09:21:28 +01:00
Eric Haszlakiewicz
cbedf2f7ca Merge pull request #149 from cicku/patch-2
SONAME bump
2015-05-09 21:35:22 -04:00
Eric Haszlakiewicz
e4fce5d6ae Merge pull request #171 from Nzbuu/vs2010_build
Update configuration for VS2010 and win64
2015-05-08 21:31:37 -04:00
Eric Haszlakiewicz
e1eb298de1 Merge pull request #182 from tpetazzoni/libm-fix
Link against libm when needed
2015-05-08 21:19:48 -04:00
Eric Haszlakiewicz
82a1316f76 Merge pull request #180 from yegorich/silent
Enable silent build by default
2015-05-08 21:19:05 -04:00
Thomas Petazzoni
93582ad85e Link against libm when needed
In certain C libraries (e.g uClibc), isnan() and related functions are
implemented in libm, so json-c needs to link against it. This commit
therefore adds an AC_TRY_LINK() test to check whether a program
calling isnan() can be properly linked with no special flags. If not,
we assume linking against libm is needed.

The json-c.pc.in file is also adjusted so that in the case of static
linking against json-c, -lm is also used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-05-01 13:01:17 +02:00
Yegor Yefremov
36b0169ed6 Enable silent build by default 2015-04-25 22:11:44 +02:00
Mark Swoope
cdca9d3c8e Added array_list_del_idx and json_object_array_del_idx 2015-04-02 14:05:27 -07:00
James Myatt
736f4b3581 Build random_seed.c as well 2015-03-04 10:45:40 +00:00
James Myatt
9d3d8d6fc0 Add x64 build configurations 2015-03-04 10:45:40 +00:00
James Myatt
e1a3f33a26 Set CompileAsCpp flag (Required for vs2010/winsdk71)
Revert some project settings to defaults
2015-03-04 10:45:39 +00:00
James Myatt
d5baa0381f Update VS project to include current source files 2015-03-04 10:45:38 +00:00
James Myatt
18b3c49296 Use more appropriate casts 2015-03-04 10:45:37 +00:00
James Myatt
bf32650c83 Add missing include file to random_seed 2015-03-04 10:45:37 +00:00
James Myatt
720d566d03 Define macros from inttypes.h when not available 2015-03-04 10:45:36 +00:00
James Myatt
9be71700eb json_tokener requires INF and NAN 2015-03-04 10:45:35 +00:00
James Myatt
72310c87a5 Define INFINITY and NAN when missing 2015-03-04 10:45:34 +00:00
James Myatt
0137103f4b Include config.h in linkhash so that HAVE_ENDIAN_H is defined (if available) 2015-03-04 10:45:33 +00:00
James Myatt
a74f6b2867 Updated config for vs2010/winsdk71 as well as vs2013
Define JSON_C_HAVE_INTTYPES_H in json_config.h.win32 only
2015-03-04 10:45:33 +00:00
Eric Haszlakiewicz
68d856f618 Merge pull request #168 from bugness-chl/master
Tightening the number parsing algorithm
2015-03-03 22:41:31 -05:00
Eric Haszlakiewicz
7e3a6c6b9d Merge pull request #163 from sixlettervariables/fix-win32-build-problems
Fix Win32 build problems
2015-03-03 22:35:36 -05:00
Eric Haszlakiewicz
da62fca305 Merge pull request #144 from mhei/master
Introduce json_object_from_fd
2015-03-03 22:12:49 -05:00
Eric Haszlakiewicz
484ca368f0 Slight style tweaks to the bsearch changest. 2015-03-04 03:10:10 +00:00
Eric Haszlakiewicz
a500c1f0b5 Merge pull request #155 from LeSpocky/bsearch
add bsearch for arrays
2015-03-03 22:00:08 -05:00
Eric Haszlakiewicz
9db3099572 Merge pull request #156 from jubalh/master
Remove trailing whitespaces
2015-03-03 21:37:02 -05:00
chl
99d8fc975e Tightening the number parsing algorithm
Some badly formated "numbers" could get partly parsed,
resulting in truncated results instead of raising an
error.

Examples :
 '1.2.3'      -> (double)1.2
 '2015-01-15' -> (int)2015

This patch is not perfect (ex: input can still end with a 'E', which
is forbidden by json.org doc) but should avoid non-sensically
formated input.

Tests added.
2015-02-05 01:50:37 +01:00
Christopher Watford
4d18d39d99 Adds json_config.h.win32 to project. Adds VS2k13 project. 2014-12-05 10:27:44 -05:00
Christopher Watford
0609a5729c Fixes #160 'missing header file on windows' 2014-12-05 10:22:36 -05:00
Eric Haszlakiewicz
ec4879ac5b Merge pull request #153 from LeSpocky/doc
improve doc for json_object_to_json_string()
2014-09-13 22:18:51 -04:00
Eric Haszlakiewicz
6ec6fdaf8c Merge pull request #151 from mjchinn/json_type-comma
Remove json_type enum trailing comma
2014-09-13 22:18:14 -04:00
Eric Haszlakiewicz
2c722277ee Merge pull request #150 from ams-cs/master
Fix build using MinGW.
2014-09-13 22:17:57 -04:00
Eric Haszlakiewicz
f88db708ac Merge pull request #141 from AlexandruCostache/master
Removed duplicate check in random_seed test - bug #140
2014-09-13 22:14:44 -04:00
Michael Vetter
fcf5ad1bd6 Remove trailing whitespace 2014-08-26 14:48:59 +02:00
Alexander Dahl
2f5789bdef add bsearch for arrays
Arrays can already be sorted with json_object_array_sort() which uses
qsort() of the standard C library. This adds a counterpart using the
bsearch() from C.
2014-08-21 15:42:50 +02:00
Alexander Dahl
37f5d8696d improve doc for json_object_to_json_string() 2014-08-18 10:28:38 +02:00
Michael J. Chinn
048dcf288a Remove json_type enum trailing comma 2014-08-10 00:46:25 -04:00
Andrew Stubbs
ca0ebe0f71 Fix build using MinGW.
MinGW requires wincrypt.h.
GCC does not support #pragma comment, which trips Werror.
2014-08-04 11:44:25 +01:00
Christopher Meng
db833f2411 SONAME bump
The last json_tokener_errors change affects the binary package, we need a bump to solve the issue.

See [this bug of postgis.](https://bugzilla.redhat.com/show_bug.cgi?id=1123785)
2014-07-28 19:28:19 +08:00
Michael Heimpold
a7534dbb7e Introduce json_object_from_fd
Also refactor json_object_from_file to use json_object_from_fd
internally.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2014-07-21 23:15:45 +02:00
Alexandru Costache
4841c48f81 Removed duplicate check in random_seed test - bug #140 2014-07-04 12:28:35 +03:00
Eric Haszlakiewicz
d4e81f9ec8 Move the json_min() and json_max() macros to json_util.h and mark everything else in bits.h deprecated.
Eliminate all uses of bits.h within the json-c code.
2014-05-04 22:33:26 -04:00
Eric Haszlakiewicz
1da0599e0e Fix the definition of the error_description() macro in bits.h now that json_tokener_errors[] is not exported. 2014-05-03 22:26:26 -04:00
Eric Haszlakiewicz
2149a04ca8 Check for failures when allocating memory; return NULL and set errno=ENOMEM in a few of those cases.
Thanks to Susant Sahani for pointing out some of these.
2014-04-19 20:33:05 -04:00
Eric Haszlakiewicz
92a7740e90 Reformat some code in json_object.c 2014-04-19 20:23:54 -04:00
Eric Haszlakiewicz
795e9151a1 Add an empty README file to placate autoconf. 2014-04-19 20:22:44 -04:00
Eric Haszlakiewicz
4569e3e430 Fix minor typo in README file. 2014-04-19 20:11:05 -04:00
Eric Haszlakiewicz
40aab4c502 Merge pull request #133 from haneefmubarak/patch-1
Update and rename README to README.md
2014-04-19 20:10:10 -04:00
Eric Haszlakiewicz
332a594fd4 Merge pull request #132 from pkoretic/master
Remove unused variable 'size'
2014-04-19 20:05:06 -04:00
Haneef Mubarak
7870978c2e Update README.md
- code blocks
 - slight text changes (rewording)
 - pretty printing
2014-04-12 00:40:05 -07:00
Haneef Mubarak
23620b827c Update and rename README to README.md
Markdownify + fix a few errors here and there
2014-04-12 00:36:08 -07:00
Eric Haszlakiewicz
fa54bd542e Update the release checklist to include calculating the tarball checksums and updating the wiki. 2014-04-11 20:07:49 -04:00
Petar Koretić
259c5c0b5f Remove unused variable 'size' 2014-04-11 10:03:40 +02:00
Eric Haszlakiewicz
515ba0dfb7 Bump versions up to 0.12.99 since a 0.12 release was just created. 2014-04-10 22:44:13 -04:00
Eric Haszlakiewicz
f84d9c55db Update the ChangeLog with the changes for the 0.12 release.
Bump the version in the release checklist.
2014-04-10 21:07:20 -04:00
Michael Clark
64e36901a0 Patch to address the following issues:
* CVE-2013-6371: hash collision denial of service
* CVE-2013-6370: buffer overflow if size_t is larger than int
2014-04-09 13:48:21 +08:00
Eric Haszlakiewicz
784534a31f Eliminate the deprecated mc_abort() function and MC_ABORT macro. 2014-03-22 21:48:34 -04:00
Eric Haszlakiewicz
f9136f6852 Make the json_tokener_errors array local. It has been deprecated for a while, and json_tokener_error_desc() should be used instead. 2014-03-22 21:41:24 -04:00
Eric Haszlakiewicz
936d036ea3 Simplify the tests Makefile to avoid repeating the name of each test. 2014-03-22 21:40:37 -04:00
Eric Haszlakiewicz
e2bbb5664c Rename the "test_case" test to "test_charcase" to make it slightly less confusing. 2014-03-22 21:15:41 -04:00
Eric Haszlakiewicz
9f26d96f09 Fix warnings from autoconf about "...no AC_LANG_SOURCE call detected..." by adding that call within the AC_LINK_IFELSE call. 2014-03-22 19:15:01 -04:00
Eric Haszlakiewicz
05da316b9c Issue #103: allow Infinity and -Infinity to be parsed. 2014-03-22 17:28:40 -04:00
Eric Haszlakiewicz
217bc29352 Merge pull request #123 from fingon/use-NAN-if-available
nan function requires -lm on some platforms - use of NAN is better, if available
2014-03-22 13:39:36 -04:00
Markus Stenberg
a1c8991e13 nan function requires -lm on some platforms; use of NAN is better, if available. 2014-03-18 16:29:49 +02:00
Eric Haszlakiewicz
0eedf3802f Issue#102 - add support for parsing "NaN". 2014-03-09 16:41:33 -04:00
Eric Haszlakiewicz
e6f1322b5e Issue#114: check for the presence of isnan and isinf, and provide compat macros on MSCV where _isnan and _finite exist instead. 2014-03-02 12:16:37 -05:00
Eric Haszlakiewicz
db117ca02b Merge pull request #121 from TazeTSchnitzel/LowercaseLiterals
Missing lowercase literals test
2014-02-12 13:37:17 -05:00
Andrea Faulds
cf23e7506e Merge branch 'master' into LowercaseLiterals 2014-02-12 09:52:25 +00:00
Andrea Faulds
1d6f9140ba Missing tests 2014-02-12 09:51:51 +00:00
Eric Haszlakiewicz
4c086dfff7 Merge commit '89535bb' 2014-02-11 23:57:24 -05:00
Eric Haszlakiewicz
020fa65724 Merge pull request #112 from TazeTSchnitzel/LowercaseLiterals
Only allow lowercase literals in STRICT mode
2014-02-11 23:21:50 -05:00
Eric Haszlakiewicz
56df93d128 Fix Issue #111: Fix off-by-one error when range checking the input to json_tokener_error_desc(). 2014-02-11 23:16:53 -05:00
Eric Haszlakiewicz
ceeaf42bc8 Merge pull request #109 from kdopen/use_strtod
Avoid potential overflow in json_object_get_double
2014-02-11 23:13:19 -05:00
Eric Haszlakiewicz
b821f0e10f Merge branch 'ebassi-master' 2014-02-11 23:06:19 -05:00
Eric Haszlakiewicz
c8e0497d47 Merge branch 'master' of https://github.com/ebassi/json-c into ebassi-master
Conflicts:
	Makefile.am
2014-02-11 23:05:54 -05:00
Eric Haszlakiewicz
295bea21d0 Ignore and cleanup a few more files that automake creates. 2014-02-11 23:03:46 -05:00
Eric Haszlakiewicz
a2c078fc6e Issue#105: Rename configure.in to configure.ac 2014-02-11 22:55:52 -05:00
Eric Haszlakiewicz
c8ee919642 Remove the old libjson.so name compatibility support. The library is only created as libjson-c.so now and headers are only installed into the ${prefix}/json-c directory. 2014-02-11 22:49:59 -05:00
Ross Burton
89535bb1ff build: call AM_PROG_CC_C_O as requested by autoreconf 2013-11-18 16:25:14 +00:00
Andrea Faulds
bda0540cb9 Only allow lowercase literals in STRICT mode 2013-11-14 21:13:32 +00:00
Keith Derrick
c51b88d69a Avoid potential overflow in json_object_get_double
sscanf is always a potential problem when converting numeric
values as it does not correctly handle over- and underflow
(or at least gives no indication that it has done so).

This change converts json_object_get_double() to use strtod()
according to CERT guidelines.
2013-10-01 10:17:00 -07:00
Emmanuele Bassi
311686f63e Add a check for the -Bsymbolic-functions linker flag
The -Bsymbolic-functions linker flag reduces the amount of PLT jumps in
a shared object, and has a side effect of preventing symbol collisions
in libraries and applications linking against two different shared
objects exposing the same symbol.

While the former is (generally) a performance win, the latter is less
rare than expected. For instance, PulseAudio started linking against
json-c a while ago; now, every project linking against PulseAudio is
leaking json-c symbols. In the GNOME platform, this means that projects
linking against PulseAudio cannot be safely linked against other
libraries depending on the GLib-based JSON parsing libraries JSON-GLib,
because of a symbol conflict. Nominally, this conflict would not be an
issue: libraries and applications do not need to depend on two different
JSON parsing libraries; the symbol leakage, though, ends up causing
either segmentation faults, or weird errors. For further reference,
please see: https://bugzilla.gnome.org/show_bug.cgi?id=703734

JSON-GLib already switched to using -Bsymbolic-functions, but it would
be safe if json-c did the same, wherever the linker flag is available.
2013-09-17 13:08:14 +01:00
Eric Haszlakiewicz
06450206c4 Issue #59: change the floating point output format to %.17g so values with more than 6 digits show up in the output. 2013-09-11 21:09:43 -05:00
Eric Haszlakiewicz
a23caf677c Use sizeof instead of hard coded values when calling snprintf. 2013-09-11 20:28:56 -05:00
Eric Haszlakiewicz
51993c28c2 Added a json_object_new_double_s() convenience function to allow an exact string representation of a double to be specified when creating the object and use it in json_tokener_parse_ex() so a re-serialized object more exactly matches the input.
Add json_object_free_userdata() and json_object_userdata_to_json_string() too.
2013-09-11 20:27:39 -05:00
Eric Haszlakiewicz
b83e0f1182 Ignore the test-driver script that is now created, and the script for the test_locale test. 2013-09-08 17:30:54 -05:00
Eric Haszlakiewicz
60e4990d1d The updated test driver creates .log and .trs files; ignore them. 2013-09-08 17:23:24 -05:00
Eric Haszlakiewicz
8d18815f8a strndup is gone, remove it from the README file. 2013-09-08 17:21:52 -05:00
Eric Haszlakiewicz
b939bd3768 Merge pull request #97 from pascal-bach/master
Add const qualifiers to json_object_to_file and json_object_to_file_ext
2013-09-08 13:36:40 -07:00
Eric Haszlakiewicz
ef43fe3571 Merge pull request #96 from rouault/remove_strdnup
Remove redefinition of strndup() which is no longer used in the codebase
2013-09-08 13:35:28 -07:00
Eric Haszlakiewicz
a030120c55 Merge pull request #95 from rouault/extern_json_object_set_serializer
Add extern to json_object_set_serializer so that it gets exported (Windows fix)
2013-09-08 13:33:22 -07:00
Eric Haszlakiewicz
02aa6f01f4 Merge pull request #94 from remicollet/issue-strict2
more strictness
2013-09-08 13:29:05 -07:00
Eric Haszlakiewicz
8356ecc16b Merge pull request #93 from tmielika/master
fixing problem that isinf(-Inf) can be 1 or -1
2013-09-08 13:26:56 -07:00
Eric Haszlakiewicz
bd42b8310d Merge pull request #104 from rouault/fix_json_tokener_error_desc_out_of_bounds_read
Fix potential out-of-bounds read in json_tokener_error_desc
2013-09-08 13:20:08 -07:00
Even Rouault
86dd55a74a Fix potential out-of-bounds read in json_tokener_error_desc
Found by Coverity. The number of elements of an array 'ar' is found by
sizeof(ar)/sizeof(ar[0]) and not sizeof(ar)

76const char *json_tokener_error_desc(enum json_tokener_error jerr)
 77{
 78        int jerr_int = (int)jerr;

1. Condition "jerr_int < 0", taking false branch

2. Condition "jerr_int > 112 /* (int)sizeof (gdal_json_tokener_errors) */", taking false branch
 79        if (jerr_int < 0 || jerr_int > (int)sizeof(json_tokener_errors))
 80                return "Unknown error, invalid json_tokener_error value passed to json_tokener_error_desc()";

CID 1076806 (#1 of 1): Out-of-bounds read (OVERRUN)3. overrun-local: Overrunning array "gdal_json_tokener_errors" of 14 8-byte elements at element index 112 (byte offset 896) using index "jerr" (which evaluates to 112).
 81        return json_tokener_errors[jerr];
 82}
2013-09-08 11:31:38 +02:00
Remi Collet
4039f91cab trailing char not allowed in strict mode 2013-08-23 13:40:01 +02:00
Remi Collet
87fa32dfe0 no comment in strict mode 2013-08-21 15:41:40 +02:00
Pascal Bach
20e4708c8a Update json_util
filename should be passed as const char* to functions
json_object_to_file and json_object_to_file
2013-08-13 18:27:02 +02:00
Even Rouault
1a957c2edc Remove redefinition of strndup() which is no longer used in the codebase 2013-08-12 20:49:19 +02:00
Even Rouault
6c4bb3840c Add extern to json_object_set_serializer so that it gets exported (Windows fix) 2013-08-11 01:18:17 +02:00
Remi Collet
a07ef3d197 no single-quote string in strict mode 2013-08-06 10:41:14 +02:00
Taneli Mielikainen
c5523a17e8 fixing problem that isinf(-Inf) can be 1 or -1 2013-08-04 00:21:58 +03:00
Eric Haszlakiewicz
b3bce4d594 Eliminate use of MC_ABORT in json-c code, and mark MC_ABORT/mc_abort deprecated.
Also adjust an error message in json_util to make it unique.  Fixes #87.
2013-06-29 15:31:18 -05:00
Eric Haszlakiewicz
be002fbb96 Issue#84: explicitly remove old headers and include/json directory so creating the compat symlink can work. 2013-06-29 15:21:04 -05:00
Eric Haszlakiewicz
c62965660b Fix the _MSC_VER check so it compiles on non-windows compilers. Issue#91 2013-06-23 19:12:14 -05:00
Eric Haszlakiewicz
5e8df40523 Mention that libtoolize is needed if you're not using a release tarball. 2013-06-23 18:55:02 -05:00
Eric Haszlakiewicz
d032aad1f4 Minor spell check. 2013-06-19 09:14:19 -05:00
Eric Haszlakiewicz
8b1bdbb94d Merge pull request #90 from remicollet/issue-strict
in strick mode, number must not start with 0
2013-06-19 07:13:21 -07:00
Eric Haszlakiewicz
98a62a7652 Merge pull request #89 from ayanes/master
Support NaN and Infinity
2013-06-18 21:18:27 -07:00
Eric Haszlakiewicz
b6539d6e90 Merge pull request #88 from weltling/master
Several MSVC fixes
2013-06-18 21:16:04 -07:00
Remi Collet
e9ee4ae18a in strick mode, number must not start with 0 2013-06-13 13:40:01 +02:00
Adrian Yanes
d086e2018c Fixes for Infinity and NaN
Although JSON RFC does not support NaN or Infinity
as numeric values ECMA 262 section 9.8.1 defines
how to handle these cases as strings
2013-06-12 19:48:00 -07:00
Anatol Belski
990fa8e3ee Fix C89 compat needed by MSVC 2013-06-04 20:18:28 +02:00
Anatol Belski
ed819fb926 snprintf definition is needed here, too 2013-06-04 20:18:05 +02:00
Anatol Belski
48ba6b8c06 fixe int32_t definition for VC11
int32_t is nowhere in msvc, so the version check could be even removed
2013-06-04 20:17:12 +02:00
Eric Haszlakiewicz
e48a25cfbb Issue #76: use old style comment to allow json_object_iterator.h to build in ansi mode. 2013-04-30 09:47:19 -05:00
Eric Haszlakiewicz
e843616cc6 Fill in the instructions for update the gh-pages branch. 2013-04-02 21:36:28 -05:00
Eric Haszlakiewicz
4207147c24 Bump the versions for the non-release branch; add a placeholder section to the change log. 2013-04-02 21:22:59 -05:00
Eric Haszlakiewicz
20db5a4e84 Fill in a number of missing steps in the release process. 2013-04-02 21:21:38 -05:00
Alexander Klauer
2be921d883 Fixed json_object_object_add().
* Return value of json_object_object_add() changed from void to int.
  Return value now indicates success or failure.

* Check whether allocations are successful.

* Do not exit program from within the library.
2013-01-08 14:24:21 +01:00
270 changed files with 35091 additions and 4695 deletions

55
.clang-format Normal file
View File

@@ -0,0 +1,55 @@
BasedOnStyle: LLVM
# If true, clang-format will attempt to re-flow comments
ReflowComments: false
# The column limit.
ColumnLimit: 100
# Indent width for line continuations.
ContinuationIndentWidth: 4
# The number of columns to use for indentation.
IndentWidth: 8
# The number of columns used for tab stops.
TabWidth: 8
UseTab: ForIndentation
# Options for aligning backslashes in escaped newlines.
AlignEscapedNewlines: Left
# Short Block Style
AllowShortBlocksOnASingleLine: true
# If true, short case labels will be contracted to a single line.
AllowShortCaseLabelsOnASingleLine: true
# Dependent on the value, int f() { return 0; } can be put on a single line.
AllowShortFunctionsOnASingleLine: Empty
# The brace breaking style to use.
BreakBeforeBraces: Custom
# Control of individual brace wrapping cases.
BraceWrapping:
# Wrap brackets inside of a case
AfterCaseLabel: true
# Wrap class definition.
AfterClass: true
# Wrap control statements
AfterControlStatement: true
# Wrap enum definitions.
AfterEnum: true
# Wrap function definitions.
AfterFunction: true
# Wrap namespace definitions.
AfterNamespace: true
# Wrap struct definitions.
AfterStruct: true
# Wrap union definitions.
AfterUnion: true
# Wrap extern blocks.
AfterExternBlock: false
# Wrap before catch.
BeforeCatch: true
# Wrap before else.
BeforeElse: true
# Indent the wrapped braces themselves.
IndentBraces: false
# If false, empty function body can be put on a single line.
SplitEmptyFunction: false
# If false, empty record (e.g. class, struct or union) body can be put on a single line.
SplitEmptyRecord: false
# If false, empty namespace body can be put on a single line.
SplitEmptyNamespace: false

15
.editorconfig Normal file
View File

@@ -0,0 +1,15 @@
# EditorConfig
# https://EditorConfig.org
# top-most EditorConfig file
root = true
# LF end-of-line, insert an empty new line and UTF-8
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
# Tab indentation
[makefile,Makefile]
indent_style = tab

23
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
Note: for general questions and comments, please use the forums at:
https://groups.google.com/g/json-c
**Describe the bug**
A clear and concise description of what the bug is, and any information about where you're running into the bug that you feel might be relevant.
**Steps To Reproduce**
List the steps to reproduce the behavior.
If possible, please attach a sample json file and/or a minimal code example.
**Version and Platform**
- json-c version: [e.g. json-c-0.14, or a specific commit hash]
- OS: [e.g. Ubuntu 20.04, Debian Buster, NetBSD 9, etc...]
- Custom cmake/build flags, if any

110
.gitignore vendored
View File

@@ -1,32 +1,18 @@
# Temp files
*~
*.swp
/INSTALL
.deps/
.libs/
/aclocal.m4
/autom4te.cache
/config.guess
/json_config.h
/config.h
/config.log
/config.status
/config.sub
/configure
/depcomp
/doc
/install-sh
/json.pc
/json-c.pc
/json-c-uninstalled.pc
/libtool
/ltmain.sh
/Makefile
/Makefile.in
/missing
/stamp-h1
/stamp-h2
*.bak
*.backup
\#*
.\#*
*\#
*.sav
*.save
*.autosav
*.autosave
# Tests
/tests/Makefile
/tests/Makefile.in
/tests/test1
/tests/test1Formatted
/tests/test2
@@ -34,16 +20,76 @@
/tests/test4
/tests/testReplaceExisting
/tests/testSubDir
/tests/test_parse_int64
/tests/test_parse
/tests/test_cast
/tests/test_charcase
/tests/test_compare
/tests/test_deep_copy
/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
/tests/test_parse
/tests/test_parse_int64
/tests/test_printbuf
/tests/test_set_serializer
/tests/test_set_value
/tests/test_util_file
/tests/test_visit
/tests/*.vg.out
/tests/*.log
/tests/*.trs
# Generated folders
/build
/Debug
/Release
*.lo
*.o
/libjson-c.la
/libjson.la
/*/Debug
/*/Release
# Archives
*.zip
*.tar.*
*.tgz
*.gz
*.bz2
*.xz
*.lz
*.lzma
*.7z
*.dll
*.deb
*.rpm
*.apk
*.exe
*.msi
*.dmg
*.ipa
# It's not good practice to build directly in the source tree
# but ignore cmake auto-generated files anyway:
/json_config.h
/json.h
/config.h
/json-c.pc
/Makefile
/CMakeCache.txt
/CMakeFiles
/CMakeDoxyfile.in
/*.cmake
/DartConfiguration.tcl
/tests/CMakeFiles/
/tests/*.cmake
/Testing/
# ...and build artifacts.
/doc/html
/libjson-c.a
/libjson-c.so
/libjson-c.so.*
# Benchmarking input and output
/bench/data
/bench/work

147
.travis.yml Normal file
View File

@@ -0,0 +1,147 @@
language: cpp
matrix:
include:
# ubuntu xenial 16.04
# gcc 5 is the default on xenial
- os: linux
dist: xenial
compiler: gcc
addons:
apt:
packages:
- valgrind
- cppcheck
- doxygen
- cmake
env: CHECK="true"
# 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: focal
compiler: gcc
addons:
apt:
packages:
- valgrind
- cppcheck
- doxygen
- cmake
env: CHECK="true"
# clang
# xenial
- os: linux
dist: xenial
compiler: clang
addons:
apt:
sources:
- llvm-toolchain-xenial-6.0
packages:
- clang-6.0
- cmake
env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
# clang-7 is the default on focal, xenial and bionic
- os: linux
dist: focal
compiler: clang
addons:
apt:
packages:
- valgrind
- cppcheck
- doxygen
- cmake
env: CHECK="true"
# osx
- os: osx
osx_image: xcode13.4
env: XCODE="true" CHECK="true"
# run coveralls
- os: linux
dist: xenial
compiler: gcc
addons:
apt:
packages:
- lcov
env: CHECK="true"
before_install:
- sudo gem install coveralls-lcov
- echo $CC
- echo $LANG
- echo $LC_ALL
- set -e
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
eval "${MATRIX_EVAL}";
if [ -n "$MATRIX_EVAL" ] && [ "$TRAVIS_COMPILER" != "clang" ]; then
sudo apt-get install -y $CC;
fi;
fi
before_script:
- export CFLAGS="-fprofile-arcs -ftest-coverage"
- mkdir build && cd build && cmake ..
script:
- make
- make test
after_success:
- cd ..
- lcov -d build/ -b . -c -o build/all_coverage.info
- lcov -r build/all_coverage.info '/usr/*' '*CMakeFiles*' '*fuzz*' '*test*' -o build/coverage.info
- coveralls-lcov --verbose build/coverage.info
# allow_failures:
# - os: osx
before_install:
- echo $CC
- echo $LANG
- echo $LC_ALL
- set -e
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
eval "${MATRIX_EVAL}";
if [ -n "$MATRIX_EVAL" ] && [ "$TRAVIS_COMPILER" != "clang" ]; then
sudo apt-get install -y $CC;
fi;
fi
before_script:
# XXX osx on travis doesn't work w/ set -e, so turn it off :(
- set +e
- mkdir -p build || echo "Failed to mkdir build"
- cd build || echo "Failed to cd build"
- cmake .. || echo "Failed to run cmake"
script:
- make
# when using bionic, Travis seems to ignore the "addons" section, so installing the packages with apt-get...
- if [ -n "$CHECK" ]; then
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew install doxygen;
else
if [ "$TRAVIS_DIST" = "bionic" ]; then
sudo apt-get install -y valgrind cppcheck doxygen;
fi;
fi;
make distcheck;
if type cppcheck &> /dev/null ; then cppcheck --error-exitcode=1 --quiet *.h *.c tests/ ; fi;
fi

74
AUTHORS
View File

@@ -1,5 +1,71 @@
Michael Clark <michael@metaparadigm.com>
Jehiah Czebotar <jehiah@gmail.com>
Eric Haszlakiewicz <hawicz+json-c@gmail.com>
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>
BonsaY <bonsay@posteo.de>
changyong guo <guo1487@163.com>
chenguoping <chenguopingdota@163.com>
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>
hofnarr <hofnarr@hofnarr.fi>
ihsinme <61293369+ihsinme@users.noreply.github.com>
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>
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>
myd7349 <myd7349@gmail.com>
Pascal Cuoq <cuoq@trust-in-soft.com>
Pawday <pawday@mail.ru>
Philosoph228 <philosoph228@gmail.com>
Pierce Lopez <pierce.lopez@gmail.com>
Po-Chuan Hsieh <sunpoet@sunpoet.net>
Ramiro Polla <ramiro.polla@gmail.com>
Rikard Falkeborn <rikard.falkeborn@gmail.com>
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,4 +1,14 @@
# This file is the top android makefile for all sub-modules.
#
# Suggested settings to build for Android:
#
# export PATH=$PATH:/opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/
# export SYSROOT=/opt/android-ndk/platforms/android-9/arch-arm/usr/
# export LD=arm-linux-androideabi-ld
# export CC="arm-linux-androideabi-gcc --sysroot=/opt/android-ndk/platforms/android-9/arch-arm"
#
# Then run autogen.sh, configure and make.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

592
CMakeLists.txt Normal file
View File

@@ -0,0 +1,592 @@
# 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)
# The project() command manages VERSION variables.
cmake_policy(SET CMP0048 NEW)
# JSON-C library is C only project.
# PROJECT_VERSION{,_MAJOR,_MINOR,_PATCH} set by project():
project(json-c LANGUAGES C VERSION 0.17)
# Targets may not link directly to themselves.
cmake_policy(SET CMP0038 NEW)
# 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)
set(CMAKE_BUILD_TYPE debug)
endif()
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)
# Set some packaging variables.
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(JSON_C_BUGREPORT "json-c@googlegroups.com")
set(CPACK_SOURCE_IGNORE_FILES
${PROJECT_SOURCE_DIR}/build
${PROJECT_SOURCE_DIR}/cmake-build-debug
${PROJECT_SOURCE_DIR}/pack
${PROJECT_SOURCE_DIR}/.idea
${PROJECT_SOURCE_DIR}/.DS_Store
${PROJECT_SOURCE_DIR}/.git
${PROJECT_SOURCE_DIR}/.vscode)
include(CheckSymbolExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckCSourceCompiles)
include(CheckTypeSize)
include(CPack)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
option(BUILD_SHARED_LIBS "Default to building shared libraries" ON)
option(BUILD_STATIC_LIBS "Default to building static libraries" ON)
if (BUILD_SHARED_LIBS)
add_definitions(-D JSON_C_DLL)
endif()
# Generate a release merge and test it to verify the correctness of republishing the package.
ADD_CUSTOM_TARGET(distcheck
COMMAND make package_source
COMMAND tar -xvf "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source.tar.gz"
COMMAND mkdir "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build"
COMMAND cmake "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/" -B"./${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build/"
COMMAND make -C "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build"
COMMAND make test -C "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build"
COMMAND rm -rf "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source"
)
# Enable or disable features. By default, all features are turned off.
option(DISABLE_BSYMBOLIC "Avoid linking with -Bsymbolic-function." OFF)
option(DISABLE_THREAD_LOCAL_STORAGE "Disable using Thread-Local Storage (HAVE___THREAD)." OFF)
option(DISABLE_WERROR "Avoid treating compiler warnings as fatal errors." OFF)
option(ENABLE_RDRAND "Enable RDRAND Hardware RNG Hash Seed." OFF)
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) 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)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
endif()
if (UNIX)
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
endif()
if (MSVC)
list(APPEND CMAKE_REQUIRED_DEFINITIONS /D_CRT_SECURE_NO_DEPRECATE)
list(APPEND CMAKE_REQUIRED_FLAGS /wd4996)
endif()
if (NOT DISABLE_STATIC_FPIC)
# Use '-fPIC'/'-fPIE' option.
# This will allow other libraries to statically link in libjson-c.a
# which in turn prevents crashes in downstream apps that may use
# a different JSON library with identical symbol names.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
check_include_file("fcntl.h" HAVE_FCNTL_H)
check_include_file("inttypes.h" HAVE_INTTYPES_H)
check_include_file(stdarg.h HAVE_STDARG_H)
check_include_file(strings.h HAVE_STRINGS_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(syslog.h HAVE_SYSLOG_H)
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) # for getrusage
check_include_file("dlfcn.h" HAVE_DLFCN_H)
check_include_file("endian.h" HAVE_ENDIAN_H)
check_include_file("limits.h" HAVE_LIMITS_H)
check_include_file("locale.h" HAVE_LOCALE_H)
check_include_file("memory.h" HAVE_MEMORY_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stdlib.h HAVE_STDLIB_H)
check_include_file(sys/cdefs.h HAVE_SYS_CDEFS_H)
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
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(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)
check_symbol_exists(_finite "float.h" HAVE_DECL__FINITE)
if ((MSVC AND NOT (MSVC_VERSION LESS 1800)) OR MINGW OR CYGWIN OR UNIX)
check_symbol_exists(INFINITY "math.h" HAVE_DECL_INFINITY)
check_symbol_exists(isinf "math.h" HAVE_DECL_ISINF)
check_symbol_exists(isnan "math.h" HAVE_DECL_ISNAN)
check_symbol_exists(nan "math.h" HAVE_DECL_NAN)
endif()
check_symbol_exists(_doprnt "stdio.h" HAVE_DOPRNT)
if (UNIX OR MINGW OR CYGWIN)
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
endif()
check_symbol_exists(vasprintf "stdio.h" HAVE_VASPRINTF)
check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
check_symbol_exists(vprintf "stdio.h" HAVE_VPRINTF)
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 "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()
if (HAVE_FCNTL_H)
check_symbol_exists(open "fcntl.h" HAVE_OPEN)
endif()
if (HAVE_STDLIB_H)
check_symbol_exists(realloc "stdlib.h" HAVE_REALLOC)
endif()
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)
endif()
if (HAVE_STRING_H)
check_symbol_exists(strdup "string.h" HAVE_STRDUP)
check_symbol_exists(strerror "string.h" HAVE_STRERROR)
endif()
if (HAVE_SYSLOG_H)
check_symbol_exists(vsyslog "syslog.h" HAVE_VSYSLOG)
endif()
if (HAVE_SYS_RANDOM_H)
check_symbol_exists(getrandom "sys/random.h" HAVE_GETRANDOM)
endif()
if (HAVE_SYS_RESOURCE_H)
check_symbol_exists(getrusage "sys/resource.h" HAVE_GETRUSAGE)
endif()
check_symbol_exists(strtoll "stdlib.h" HAVE_STRTOLL)
check_symbol_exists(strtoull "stdlib.h" HAVE_STRTOULL)
set(json_c_strtoll "strtoll")
if (NOT HAVE_STRTOLL)
# Use _strtoi64 if strtoll is not available.
check_symbol_exists(_strtoi64 "stdlib.h" __have_strtoi64)
if (__have_strtoi64)
#set(HAVE_STRTOLL 1)
set(json_c_strtoll "_strtoi64")
endif()
endif()
set(json_c_strtoull "strtoull")
if (NOT HAVE_STRTOULL)
# Use _strtoui64 if strtoull is not available.
check_symbol_exists(_strtoui64 "stdlib.h" __have_strtoui64)
if (__have_strtoui64)
#set(HAVE_STRTOULL 1)
set(json_c_strtoull "_strtoui64")
endif()
endif()
check_type_size(int SIZEOF_INT)
check_type_size(int64_t SIZEOF_INT64_T)
check_type_size(long SIZEOF_LONG)
check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size("size_t" SIZEOF_SIZE_T)
if (MSVC)
list(APPEND CMAKE_EXTRA_INCLUDE_FILES BaseTsd.h)
check_type_size("SSIZE_T" SIZEOF_SSIZE_T)
else()
check_type_size("ssize_t" SIZEOF_SSIZE_T)
endif()
check_c_source_compiles(
"
extern void json_object_get();
__asm__(\".section .gnu.json_object_get\\n\\t.ascii \\\"Please link against libjson-c instead of libjson\\\"\\n\\t.text\");
int main(int c, char *v) { return 0;}
"
HAS_GNU_WARNING_LONG)
check_c_source_compiles(
"int main() { int i, x = 0; i = __sync_add_and_fetch(&x,1); return x; }"
HAVE_ATOMIC_BUILTINS)
if (NOT DISABLE_THREAD_LOCAL_STORAGE)
check_c_source_compiles(
"__thread int x = 0; int main() { return 0; }"
HAVE___THREAD)
if (HAVE___THREAD)
set(SPEC___THREAD __thread)
elseif (MSVC)
set(SPEC___THREAD __declspec(thread))
endif()
endif()
# Hardware random number is not available on Windows? Says, config.h.win32. Best to preserve compatibility.
if (WIN32)
set(ENABLE_RDRAND 0)
endif()
# Once we've done basic symbol/header searches let's add them in.
configure_file(${PROJECT_SOURCE_DIR}/cmake/config.h.in ${PROJECT_BINARY_DIR}/config.h)
message(STATUS "Wrote ${PROJECT_BINARY_DIR}/config.h")
configure_file(${PROJECT_SOURCE_DIR}/cmake/json_config.h.in ${PROJECT_BINARY_DIR}/json_config.h)
message(STATUS "Wrote ${PROJECT_BINARY_DIR}/json_config.h")
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
if ("${DISABLE_WERROR}" STREQUAL "OFF")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcast-qual")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=deprecated-declarations")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wwrite-strings")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
if (NOT WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes")
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")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4244")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4706")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4702")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4701")
endif()
if (NOT ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC"))
check_c_source_compiles(
"
/* uClibc toolchains without threading barf when _REENTRANT is defined */
#define _REENTRANT 1
#include <sys/types.h>
int main (void)
{
return 0;
}
"
REENTRANT_WORKS
)
if (REENTRANT_WORKS)
add_compile_options("-D_REENTRANT")
endif()
# OSX Mach-O doesn't support linking with '-Bsymbolic-functions'.
# Others may not support it, too.
list(APPEND CMAKE_REQUIRED_LIBRARIES "-Wl,-Bsymbolic-functions")
check_c_source_compiles(
"
int main (void)
{
return 0;
}
"
BSYMBOLIC_WORKS
)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "-Wl,-Bsymbolic-functions")
if (DISABLE_BSYMBOLIC STREQUAL "OFF" AND BSYMBOLIC_WORKS)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic-functions")
# XXX need cmake>=3.13 for this:
#add_link_options("-Wl,-Bsymbolic-functions")
endif()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym" "TEST { global: *; };")
list(APPEND CMAKE_REQUIRED_LIBRARIES "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym")
check_c_source_compiles(
"
int main (void)
{
return 0;
}
"
VERSION_SCRIPT_WORKS
)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym")
if (VERSION_SCRIPT_WORKS)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/json-c.sym")
endif()
endif()
if ($ENV{VALGRIND})
# Build so that valgrind doesn't complain about linkhash.c
add_definitions(-DVALGRIND=1)
endif()
set(JSON_C_PUBLIC_HEADERS
# Note: config.h is _not_ included here
${PROJECT_BINARY_DIR}/json_config.h
${PROJECT_BINARY_DIR}/json.h
${PROJECT_SOURCE_DIR}/arraylist.h
${PROJECT_SOURCE_DIR}/debug.h
${PROJECT_SOURCE_DIR}/json_c_version.h
${PROJECT_SOURCE_DIR}/json_inttypes.h
${PROJECT_SOURCE_DIR}/json_object.h
${PROJECT_SOURCE_DIR}/json_object_iterator.h
${PROJECT_SOURCE_DIR}/json_tokener.h
${PROJECT_SOURCE_DIR}/json_types.h
${PROJECT_SOURCE_DIR}/json_util.h
${PROJECT_SOURCE_DIR}/json_visit.h
${PROJECT_SOURCE_DIR}/linkhash.h
${PROJECT_SOURCE_DIR}/printbuf.h
)
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}/math_compat.h
${PROJECT_SOURCE_DIR}/snprintf_compat.h
${PROJECT_SOURCE_DIR}/strdup_compat.h
${PROJECT_SOURCE_DIR}/vasprintf_compat.h
)
set(JSON_C_SOURCES
${PROJECT_SOURCE_DIR}/arraylist.c
${PROJECT_SOURCE_DIR}/debug.c
${PROJECT_SOURCE_DIR}/json_c_version.c
${PROJECT_SOURCE_DIR}/json_object.c
${PROJECT_SOURCE_DIR}/json_object_iterator.c
${PROJECT_SOURCE_DIR}/json_tokener.c
${PROJECT_SOURCE_DIR}/json_util.c
${PROJECT_SOURCE_DIR}/json_visit.c
${PROJECT_SOURCE_DIR}/linkhash.c
${PROJECT_SOURCE_DIR}/printbuf.c
${PROJECT_SOURCE_DIR}/random_seed.c
${PROJECT_SOURCE_DIR}/strerror_override.c
)
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)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})
add_subdirectory(doc)
# "uninstall" custom target for make generators in unix like operating systems
# and if that target is not present
if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
if(NOT TARGET uninstall)
add_custom_target(uninstall
COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif()
endif()
# XXX for a normal full distribution we'll need to figure out
# XXX how to build both shared and static libraries.
# Probably leverage that to build a local VALGRIND=1 library for testing too.
add_library(${PROJECT_NAME}
${JSON_C_SOURCES}
${JSON_C_HEADERS}
)
set_target_properties(${PROJECT_NAME} PROPERTIES
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
# to build external target without extra include_directories(...)
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<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)
add_library(${STATIC_LIB} STATIC
${JSON_C_SOURCES}
${JSON_C_HEADERS}
)
target_include_directories(${PROJECT_NAME}-static
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<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
OUTPUT_NAME ${PROJECT_NAME}
)
endif()
list(APPEND CMAKE_TARGETS ${STATIC_LIB})
endif ()
# Always create new install dirs with 0755 permissions, regardless of umask
set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
OWNER_READ
OWNER_WRITE
OWNER_EXECUTE
GROUP_READ
GROUP_EXECUTE
WORLD_READ
WORLD_EXECUTE
)
install(TARGETS ${CMAKE_TARGETS}
EXPORT ${PROJECT_NAME}-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/json-c
)
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}-targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
configure_package_config_file(
"cmake/Config.cmake.in"
${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
install(
FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
if (UNIX OR MINGW OR CYGWIN)
SET(prefix ${CMAKE_INSTALL_PREFIX})
# exec_prefix is prefix by default and CMake does not have the
# concept.
SET(exec_prefix ${CMAKE_INSTALL_PREFIX})
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}")
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()

459
ChangeLog
View File

@@ -1,5 +1,438 @@
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)
========================================
Deprecated and removed features:
--------------------------------
* JSON_C_OBJECT_KEY_IS_CONSTANT is deprecated in favor of
JSON_C_OBJECT_ADD_CONSTANT_KEY
* Direct access to lh_table and lh_entry structure members is deprecated.
Use access functions instead, lh_table_head(), lh_entry_next(), etc...
* Drop REFCOUNT_DEBUG code.
New features
------------
* The 0.16 release introduces no new features
Build changes
-------------
* Add a DISABLE_EXTRA_LIBS option to skip using libbsd
* Add a DISABLE_JSON_POINTER option to skip compiling in json_pointer support.
Significant changes and bug fixes
---------------------------------
* Cap string length at INT_MAX to avoid various issues with very long strings.
* json_object_deep_copy: fix deep copy of strings containing '\0'
* Fix read past end of buffer in the "json_parse" command
* Avoid out of memory accesses in the locally provided vasprintf() function
(for those platforms that use it)
* Handle allocation failure in json_tokener_new_ex
* Fix use-after-free in json_tokener_new_ex() in the event of printbuf_new() returning NULL
* printbuf_memset(): set gaps to zero - areas within the print buffer which
have not been initialized by using printbuf_memset
* printbuf: return -1 on invalid arguments (len < 0 or total buffer > INT_MAX)
* sprintbuf(): propagate printbuf_memappend errors back to the caller
Optimizations
--------------
* Speed up parsing by replacing ctype functions with simplified, faster
non-locale-sensitive ones in json_tokener and json_object_to_json_string.
* Neither vertical tab nor formfeed are considered whitespace per the JSON spec
* json_object: speed up creation of objects, calloc() -> malloc() + set fields
* Avoid needless extra strlen() call in json_c_shallow_copy_default() and
json_object_equal() when the object is known to be a json_type_string.
Other changes
-------------
* Validate size arguments in arraylist functions.
* Use getrandom() if available; with GRND_NONBLOCK to allow use of json-c
very early during boot, such as part of cryptsetup.
* Use arc4random() if it's available.
* random_seed: on error, continue to next method instead of exiting the process
* Close file when unable to read from /dev/urandom in get_dev_random_seed()
***
0.15 (up to commit 870965e, 2020/07/26)
========================================
Deprecated and removed features:
--------------------------------
* Deprecate `array_list_new()` in favor of `array_list_new2()`
* Remove the THIS_FUNCTION_IS_DEPRECATED define.
* Remove config.h.win32
New features
------------
* Add a `JSON_TOKENER_ALLOW_TRAILING_CHARS` flag to allow multiple objects
to be parsed even when `JSON_TOKENER_STRICT` is set.
* Add `json_object_new_array_ext(int)` and `array_list_new_2(int)` to allow
arrays to be allocated with the exact size needed, when known.
* Add `json_object_array_shrink()` (and `array_list_shrink()`) and use it in
json_tokener to minimize the amount of memory used.
* Add a json_parse binary, for use in testing changes (not installed, but
available in the apps directory).
Build changes
-------------
* #639/#621 - Add symbol versions to all exported symbols
* #508/#634 - Always enable -fPIC to allow use of the json-c static library in
other libraries
* Build both static and shared libraries at the same time.
* #626 - Restore compatibility with cmake 2.8
* #471 - Always create directories with mode 0755, regardless of umask.
* #606/#604 - Improve support for OSes like AIX and IBM i, as well as for
MINGW32 and old versions of MSVC
* #451/#617 - Add a DISABLE_THREAD_LOCAL_STORAGE cmake option to disable
the use of thread-local storage.
Significant changes and bug fixes
---------------------------------
* Split the internal json_object structure into several sub-types, one for
each json_type (json_object_object, json_object_string, etc...).
This improves memory usage and speed, with the benchmark under
bench/ report 5.8% faster test time and 6%(max RSS)-12%(peak heap)
less memory usage.
Memory used just for json_object structures decreased 27%, so use cases
with fewer arrays and/or strings would benefit more.
* Minimize memory usage in array handling in json_tokener by shrinking
arrays to the exact number of elements parsed. On bench/ benchmark:
9% faster test time, 39%(max RSS)-50%(peak heap) less memory usage.
Add json_object_array_shrink() and array_list_shrink() functions.
* #616 - Parsing of surrogate pairs in unicode escapes now properly handles
incremental parsing.
* Fix incremental parsing of numbers, especially those with exponents, e.g.
so parsing "[0", "e+", "-]" now properly returns an error.
Strict mode now rejects missing exponents ("0e").
* Successfully return number objects at the top level even when they are
followed by a "-", "." or "e". This makes parsing things like "123-45"
behave consistently with things like "123xyz".
Other changes
-------------
* #589 - Detect broken RDRAND during initialization; also, fix segfault
in the CPUID check.
* #592 - Fix integer overflows to prevert out of bounds write on large input.
* Protect against division by zero in linkhash, when created with zero size.
* #602 - Fix json_parse_uint64() internal error checking, leaving the retval
untouched in more failure cases.
* #614 - Prevent truncation when custom double formatters insert extra \0's
***
0.14 (up to commit 9ed00a6, 2020/04/14)
=========================================
Deprecated and removed features:
--------------------------------
* bits.h has been removed
* lh_abort() has been removed
* lh_table_lookup() has been removed, use lh_table_lookup_ex() instead.
* Remove TRUE and FALSE defines, use 1 and 0 instead.
Build changes:
--------------
## Deprecated and removed features:
* bits.h has been removed
* lh_abort() has been removed
* lh_table_lookup() has been removed, use lh_table_lookup_ex() instead.
* Remove TRUE and FALSE defines, use 1 and 0 instead.
* autoconf support, including autogen.sh, has been removed. See details about cmake, below.
* With the addition of json_tokener_get_parse_end(), access to internal fields of json_tokener, as well as use of many other symbols and types in json_tokener.h, is deprecated now.
* The use of Android.configure.mk to build for Android no longer works, and it is unknown how (or if) the new cmake-based build machinery can be used.
* Reports of success, or pull requests to correct issues are welcome.
## Notable improvements and new features
### Builds and documentation
* Build machinery has been switched to CMake. See README.md for details about how to build.
* TL;DR: `mkdir build ; cd build ; cmake -DCMAKE_INSTALL_PREFIX=/some/path ../json-c ; make all test install`
* To ease the transition, there is a `cmake-configure` wrapper that emulates the old autoconf-based configure script.
* This has enabled improvements to the build on Windows system; also all public functions have been fixed to be properly exported. For best results, use Visual Studio 2015 or newer.
* The json-c style guide has been updated to specify the use of clang-format, and all code has been reformatted.
* Since many lines of code have trivial changes now, when using git blame, be sure to specify -w
* Numerous improvements have been made to the documentation including function effects on refcounts, when passing a NULL is safe, and so on.
### json_tokener changes
* Added a json_tokener_get_parse_end() function to replace direct access of tok->char_offset.
* The char_offset field, and the rest of the json_tokener structure remain exposed for now, but expect a future release to hide it like is done with json_object_private.h
* json_tokener_parse_ex() now accepts a new JSON_TOKENER_VALIDATE_UTF8 flag to validate that input is UTF8.
* If validation fails, json_tokener_get_error(tok) will return json_tokener_error_parse_utf8_string (see enum json_tokener_error).
### Other changes and additions
* Add support for unsigned 64-bit integers, uint64_t, to gain one extra bit of magnitude for positive ints.
* json_tokener will now parse values up to UINT64_MAX (18446744073709551615)
* Existing methods returning int32_t or int64_t will cap out-of-range values at INT32_MAX or INT64_MAX, preserving existing behavior.
* The implementation includes the possibility of easily extending this to larger sizes in the future.
* A total of 7 new functions were added:
* json_object_get_uint64 ( struct json_object const* jso )
* json_object_new_uint64 ( uint64_t i )
* json_object_set_uint64 ( struct json_object* jso, uint64_t new_value )
* json_parse_uint64 ( char const* buf, uint64_t* retval )
* See description of uint64 support, above.
* json_tokener_get_parse_end ( struct json_tokener* tok )
* See details under "json_tokener changes", above.
* json_object_from_fd_ex ( int fd, int in_depth )
* Allows the max nesting depth to be specified.
* json_object_new_null ( )
* Simply returns NULL. Its use is not recommended.
* The size of struct json_object has decreased from 96 bytes to 88 bytes.
### Testing
* Many updates were made to test cases, increasing code coverage.
* There is now a quick way (JSONC_TEST_TRACE=1) to turn on shell tracing in tests.
* To run tests, use `make test`; the old "check" target no longer exists.
## Significant bug fixes
For the full list of issues and pull requests since the previous release, please see issues_closed_for_0.14.md
* [Issue #389](https://github.com/json-c/json-c/issues/389): Add an assert to explicitly crash when _ref_count is corrupted, instead of a later "double free" error.
* [Issue #407](https://github.com/json-c/json-c/issues/407): fix incorrect casts in calls to ctype functions (isdigit and isspace) so we don't crash when asserts are enabled on certain platforms and characters > 128 are parsed.
* [Issue #418](https://github.com/json-c/json-c/issues/418): Fix docs for json_util_from_fd and json_util_from_file to say that they return NULL on failures.
* [Issue #422](https://github.com/json-c/json-c/issues/422): json_object.c:set errno in json_object_get_double() when called on a json_type_string object with bad content.
* [Issue #453](https://github.com/json-c/json-c/issues/453): Fixed misalignment in JSON serialization when JSON_C_TO_STRING_SPACED and JSON_C_TO_STRING_PRETTY are used together.
* [Issue #463](https://github.com/json-c/json-c/issues/463): fix newlocale() call to use LC_NUMERIC_MASK instead of LC_NUMERIC, and remove incorrect comment.
* [Issue #486](https://github.com/json-c/json-c/issues/486): append a missing ".0" to negative double values to ensure they are serialized as floating point numbers.
* [Issue #488](https://github.com/json-c/json-c/issues/488): use JSON_EXPORT on functions so they are properly exported on Windows.
* [Issue #539](https://github.com/json-c/json-c/issues/539): use an internal-only serializer function in json_object_new_double_s() to avoid potential conflicts with user code that uses the json_object_userdata_to_json_string serializer.
***
0.13.1 (up to commit 0f814e5, 2018/03/04)
=========================================
* Bump the major version of the .so library generated up to 4.0 to avoid
conflicts because some downstream packagers of json-c had already done
their own bump to ".so.3" for a much older 0.12 release.
* Add const size_t json_c_object_sizeof()
* Avoid invalid free (and thus a segfault) when ref_count gets < 0
* PR#394: fix handling of custom double formats that include a ".0"
* Avoid uninitialized variable warnings in json_object_object_foreach
* Issue #396: fix build for certain uClibc based systems.
* Add a top level fuzz directory for fuzzers run by OSS-Fuzz
0.13 (up to commit 5dae561, 2017/11/29)
=================================
This release, being three and a half years after the 0.12 branch (f84d9c),
has quite a number of changes included. The following is a sampling of
the most significant ones.
Since the 0.12 release, 250 issues and pull requests have been closed.
See issues_closed_for_0.13.md for a complete list.
Deprecated and removed features:
--------------------------------
* All internal use of bits.h has been eliminated. The file will be removed.
Do not use: hexdigit(), error_ptr(), error_descrition() and it_error()
* lh_abort() is deprecated. It will be removed.
Behavior changes:
-----------------
* Tighten the number parsing algorithm to raise errors instead of truncating
the results. For example 12.3.4 or 2015-01-15, which now return null.
See commit 99d8fc
* Use size_t for array length and size. Platforms where sizeof(size_t) != sizeof(int) may not be backwards compatible
See commits 45c56b, 92e9a5 and others.
* Check for failure when allocating memory, returning NULL and errno=ENOMEM.
See commit 2149a04.
* Change json_object_object_add() return type from void to int, and will return -1 on failures, instead of exiting. (Note: this is not an ABI change)
New features:
-------------
* We're aiming to follow RFC 7159 now.
* Add a couple of additional option to json_object_to_json_string_ext:
JSON_C_TO_STRING_PRETTY_TAB
JSON_C_TO_STRING_NOSLASHESCAPE
* Add a json_object_object_add_ex() function to allow for performance
improvements when certain constraints are known to be true.
* Make serialization format of doubles configurable, in two different ways:
Call json_object_set_serializer with json_object_double_to_json_string and a custom
format on each double object, or
Call json_c_set_serialization_double_format() to set a global or thread-wide format.
* Add utility function for comparing json_objects - json_object_equal()
* Add a way to copy entire object trees: json_object_deep_copy()
* Add json_object_set_<type> function to modify the value of existing json_object's
without the need to recreate them. Also add a json_object_int_inc function to
adjust an int's value.
* Add support for JSON pointer, RFC 6901. See json_pointer.h
* Add a json_util_get_last_err() function to retrieve the string describing the
cause of errors, instead of printing to stderr.
* Add perllike hash function for strings, and json_global_set_string_hash() 8f8d03d
* Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects.
Notable bug fixes and other improvements:
-----------------------------------------
* Make reference increment and decrement atomic to allow passing json objects between threads.
* Fix json_object_object_foreach to avoid uninitialized variable warnings.
* Improve performance by removing unneeded data items from hashtable code and reducing duplicate hash computation.
* Improve performance by storing small strings inside json_object
* Improve performance of json_object_to_json_string by removing variadic printf. commit 9ff0f49
* Issue #371: fix parsing of "-Infinity", and avoid needlessly copying the input when doing so.
* Fix stack buffer overflow in json_object_double_to_json_string_format() - commit 2c2deb87
* Fix various potential null ptr deref and int32 overflows
* Issue #332: fix a long-standing bug in array_list_put_idx() where it would attempt to free previously free'd entries due to not checking the current array length.
* Issue #195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments.
* Issue #275: fix out of bounds read when handling unicode surrogate pairs.
* Ensure doubles that happen to be a whole number are emitted with ".0" - commit ca7a19
* PR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string is terminated.
* Fix double to int cast overflow in json_object_get_int64.
* Clamp double to int32 when narrowing in json_object_get_int.
* Use strtoll() to parse ints - instead of sscanf
* Miscellaneous smaller changes, including removing unused variables, fixing warning
about uninitialized variables adding const qualifiers, reformatting code, etc...
Build changes:
--------------
* Add Appveyor and Travis build support
* Switch to using CMake when building on Windows with Visual Studio.
A dynamic .dll is generated instead of a .lib
config.h is now generated, config.h.win32 should no longer be manually copied
* Add support for MacOS through CMake too.
* Enable silent build by default
* Link against libm when needed
* Add support for building with AddressSanitizer
* Add support for building with Clang
* Add a --enable-threading configure option, and only use the (slower) __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified.
List of new functions added:
----------------------------
### json_object.h
* array_list_bsearch()
* array_list_del_idx()
* json_object_to_json_string_length()
* json_object_get_userdata()
* json_object_set_userdata()
* json_object_object_add_ex()
* json_object_array_bsearch()
* json_object_array_del_idx()
* json_object_set_boolean()
* json_object_set_int()
* json_object_int_inc()
* json_object_set_int64()
* json_c_set_serialization_double_format()
* json_object_double_to_json_string()
* json_object_set_double()
* json_object_set_string()
* json_object_set_string_len()
* json_object_equal()
* json_object_deep_copy()
### json_pointer.h
* json_pointer_get()
* json_pointer_getf()
* json_pointer_set()
* json_pointer_setf()
### json_util.h
* json_object_from_fd()
* json_object_to_fd()
* json_util_get_last_err()
### json_visit.h
* json_c_visit()
### linkhash.h
* json_global_set_string_hash()
* lh_table_resize()
### printbuf.h
* printbuf_strappend()
0.12.1
======
* Minimal changes to address compile issues.
0.12
====
* Address security issues:
* CVE-2013-6371: hash collision denial of service
* CVE-2013-6370: buffer overflow if size_t is larger than int
* Avoid potential overflow in json_object_get_double
* Eliminate the mc_abort() function and MC_ABORT macro.
* Make the json_tokener_errors array local. It has been deprecated for
a while, and json_tokener_error_desc() should be used instead.
* change the floating point output format to %.17g so values with
more than 6 digits show up in the output.
* Remove the old libjson.so name compatibility support. The library is
only created as libjson-c.so now and headers are only installed
into the ${prefix}/json-c directory.
* When supported by the linker, add the -Bsymbolic-functions flag.
* Various changes to fix the build on MSVC.
* Make strict mode more strict:
* number must not start with 0
* no single-quote strings
* no comments
* trailing char not allowed
* only allow lowercase literals
* Added a json_object_new_double_s() convenience function to allow
an exact string representation of a double to be specified when
creating the object and use it in json_tokener_parse_ex() so
a re-serialized object more exactly matches the input.
* Add support NaN and Infinity
0.11
====
* IMPORTANT: the name of the library has changed to libjson-c.so and
the header files are now in include/json-c.
@@ -23,6 +456,7 @@
* Fix a bug (buffer overrun) when expanding arrays to more than 64 entries.
0.10
====
* Add a json_object_to_json_string_ext() function to allow output to be
formatted in a more human readable form.
@@ -31,7 +465,7 @@
* Add an alternative iterator implementation, see json_object_iterator.h
* Make json_object_iter public to enable external use of the
json_object_object_foreachC macro.
* Add a printbuf_memset() function to provide an effecient way to set and
* Add a printbuf_memset() function to provide an efficient way to set and
append things like whitespace indentation.
* Adjust json_object_is_type and json_object_get_type so they return
json_type_null for NULL objects and handle NULL passed to
@@ -41,7 +475,7 @@
* Allow json_tokener_parse_ex() to be re-used to parse multiple object.
Also, fix some parsing issues with capitalized hexadecimal numbers and
number in E notation.
* Add json_tokener_get_error() and json_tokener_error_desc() to better
* Add json_tokener_get_error() and json_tokener_error_desc() to better
encapsulate the process of retrieving errors while parsing.
* Various improvements to the documentation of many functions.
* Add new json_object_array_sort() function.
@@ -71,6 +505,7 @@
Brent Miller, bdmiller at yahoo dash inc dot com
0.9
===
* Add README.html README-WIN32.html config.h.win32 to Makefile.am
Michael Clark, <michael@metaparadigm.com>
* Add const qualifier to the json_tokener_parse functions
@@ -87,7 +522,7 @@
Brent Miller, bdmiller at yahoo dash inc dot com
* Disable REFCOUNT_DEBUG by default in json_object.c
* Don't use this as a variable, so we can compile with a C++ compiler
* Add casts from void* to type of assignment when using malloc
* Add casts from void* to type of assignment when using malloc
* Add #ifdef __cplusplus guards to all of the headers
* Add typedefs for json_object, json_tokener, array_list, printbuf, lh_table
Michael Clark, <michael@metaparadigm.com>
@@ -101,6 +536,7 @@
Gerard Krol, g dot c dot krol at student dot tudelft dot nl
0.8
===
* Add va_end for every va_start
Dotan Barak, dotanba at gmail dot com
* Add macros to enable compiling out debug code
@@ -113,19 +549,22 @@
Geoffrey Young, geoff at modperlcookbook dot org
0.7
===
* Add escaping of backslash to json output
* Add escaping of foward slash on tokenizing and output
* Add escaping of forward slash on tokenizing and output
* Changes to internal tokenizer from using recursion to
using a depth state structure to allow incremental parsing
0.6
===
* Fix bug in escaping of control characters
Johan Bj<EFBFBD>rklund, johbjo09 at kth dot se
Johan Björklund, johbjo09 at kth dot se
* Remove include "config.h" from headers (should only
be included from .c files)
Michael Clark <michael@metaparadigm.com>
0.5
===
* Make headers C++ compatible by change *this to *obj
* Add ifdef C++ extern "C" to headers
* Use simpler definition of min and max in bits.h
@@ -138,18 +577,21 @@
Michael Clark <michael@metaparadigm.com>
0.4
===
* Fix additional error case in object parsing
* Add back sign reversal in nested object parse as error pointer
value is negative, while error value is positive.
Michael Clark <michael@metaparadigm.com>
0.3
===
* fix pointer arithmetic bug for error pointer check in is_error() macro
* fix type passed to printbuf_memappend in json_tokener
* update autotools bootstrap instructions in README
Michael Clark <michael@metaparadigm.com>
0.2
===
* printbuf.c - C. Watford (christopher.watford@gmail.com)
Added a Win32/Win64 compliant implementation of vasprintf
* debug.c - C. Watford (christopher.watford@gmail.com)
@@ -164,12 +606,13 @@
Added a Win32/Win64 compliant implementation of strndup
* json_util.c - C. Watford (christopher.watford@gmail.com)
Added cast and mask to suffice size_t v. unsigned int conversion
correctness
correctness
* json_tokener.c - sign reversal issue on error info for nested object parse
spotted by Johan Bj<EFBFBD>rklund (johbjo09 at kth.se)
spotted by Johan Björklund (johbjo09 at kth.se)
* json_object.c - escape " in json_escape_str
* Change to automake and libtool to build shared and static library
Michael Clark <michael@metaparadigm.com>
0.1
===
* initial release

1153
Doxyfile

File diff suppressed because it is too large Load Diff

2
INSTALL Normal file
View File

@@ -0,0 +1,2 @@
See README.md for installation instructions.

View File

@@ -1,92 +0,0 @@
include Makefile.am.inc
EXTRA_DIST = README.html README-WIN32.html config.h.win32 doc json-c.vcproj
SUBDIRS = . tests
lib_LTLIBRARIES = libjson-c.la
if ENABLE_OLDNAME_COMPAT
lib_LTLIBRARIES+=libjson.la
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = json-c.pc
if ENABLE_OLDNAME_COMPAT
pkgconfig_DATA += json.pc
endif
libjson_cincludedir = $(includedir)/json-c
libjson_cinclude_HEADERS = \
arraylist.h \
bits.h \
debug.h \
json.h \
json_config.h \
json_c_version.h \
json_inttypes.h \
json_object.h \
json_object_iterator.h \
json_object_private.h \
json_tokener.h \
json_util.h \
linkhash.h \
printbuf.h
#libjsonx_includedir = $(libdir)/json-c-@VERSION@
#
#libjsonx_include_HEADERS = \
# json_config.h
libjson_c_la_LDFLAGS = -version-info 2:0:0 -no-undefined
if ENABLE_OLDNAME_COMPAT
libjson_la_LDFLAGS = -version-info 1:0:1 -no-undefined -ljson-c
# Temporary libjson library. This will be removed after one release.
libjson_la_LIBADD = -ljson-c
endif
libjson_c_la_SOURCES = \
arraylist.c \
debug.c \
json_c_version.c \
json_object.c \
json_object_iterator.c \
json_tokener.c \
json_util.c \
linkhash.c \
printbuf.c
distclean-local:
-rm -rf $(testsubdir)
-rm -rf config.h.in~ Makefile.in aclocal.m4 autom4te.cache/ config.guess config.sub depcomp install-sh ltmain.sh missing
maintainer-clean-local:
-rm -rf configure
if ENABLE_OLDNAME_COMPAT
install-data-hook:
test \! -e "$(DESTDIR)@includedir@/json" || rm "$(DESTDIR)@includedir@/json"
$(LN_S) json-c "$(DESTDIR)@includedir@/json"
uninstall-local:
rm -f "$(DESTDIR)@includedir@/json"
rm -rf "$(DESTDIR)@includedir@/json-c"
endif
ANDROID_CFLAGS = -I$(top_srcdir) -DHAVE_CONFIG_H
Android.mk: Makefile.am
androgenizer -:PROJECT json-c \
-:SHARED libjson-c \
-:TAGS eng debug \
-:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
-:SOURCES $(libjson_c_la_SOURCES) $(nodist_libjson_c_la_SOURCES) \
-:CFLAGS $(DEFS) $(ANDROID_CFLAGS) $(libjson_c_la_CFLAGS) \
-:LDFLAGS $(libjson_c_la_LDFLAGS) $(libjson_c_la_LIBADD) \
-:HEADER_TARGET json-c \
-:HEADERS $(libjson_cinclude_HEADERS) \
-:PASSTHROUGH LOCAL_ARM_MODE:=arm \
> $@

View File

@@ -1,2 +0,0 @@
AM_CFLAGS = -Wall -Werror -Wextra -Wwrite-strings -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE -D_REENTRANT

1
NEWS
View File

@@ -0,0 +1 @@
See the git repo.

45
README
View File

@@ -1,44 +1 @@
Building on Unix with git, gcc and autotools
Home page for json-c:
https://github.com/json-c/json-c/wiki
Caution: do NOT use sources from svn.metaparadigm.com, they are old.
Prerequisites:
gcc (or another C compiler)
libtool
If you're not using a release tarball, you'll also need:
autoconf (autoreconf)
automake
Github repo for json-c:
https://github.com/json-c/json-c
$ git clone https://github.com/json-c/json-c.git
$ cd json-c
$ sh autogen.sh
Then
$ ./configure
$ make
$ make install
To build and run the test programs run
$ make check
Linking to libjson-c
If your system has pkgconfig then you can just add this to your makefile
CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)
Without pkgconfig, you would do something like this:
JSON_C_DIR=/path/to/json_c/install
CFLAGS += -I$(JSON_C_DIR)/include/json-c
LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
See README.md or README.html

View File

@@ -1,50 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>JSON-C - A JSON implementation in C - Win32 specific notes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h2>Windows specific notes for JSON-C</h2>
<p>Please send Win32 bug reports to <a href="mailto:christopher.watford@gmail.com">christopher.watford@gmail.com</a></p>
<p><b>Win32 Specific Changes:</b></p>
<ul>
<li>
Various functions have been redefined to their Win32 version (i.e. <tt>open</tt>
on win32 is <tt>_open</tt>)</li>
<li>
Implemented missing functions from MS's libc (i.e. <tt>vasprintf</tt> and <tt>strndup</tt>)</li>
<li>
Added code to allow Win64 support without integer resizing issues, this
probably makes it much nicer on 64bit machines everywhere (i.e. using <tt>ptrdiff_t</tt>
for pointer math)</li>
</ul>
<p><b>Porting Changelog:</b></p>
<dl>
<dt><tt>printbuf.c</tt> - C. Watford (christopher.watford@gmail.com)</dt>
<dd>
Added a Win32/Win64 compliant implementation of <tt>vasprintf</tt></dd>
<dt><tt>debug.c</tt> - C. Watford (christopher.watford@gmail.com)</dt>
<dd>
Removed usage of <tt>vsyslog</tt> on Win32/Win64 systems, needs to be handled
by a configure script</dd>
<dt><tt>json_object.c</tt> - C. Watford (christopher.watford@gmail.com)</dt>
<dd>
Added scope operator to wrap usage of <tt>json_object_object_foreach</tt>, this needs to be
rethought to be more ANSI C friendly</dd>
<dt><tt>json_object.h</tt> - C. Watford (christopher.watford@gmail.com)</dt>
<dd>
Added Microsoft C friendly version of <tt>json_object_object_foreach</tt></dd>
<dt><tt>json_tokener.c</tt> - C. Watford (christopher.watford@gmail.com)</dt>
<dd>
Added a Win32/Win64 compliant implementation of <tt>strndup</tt></dd>
<dt><tt>json_util.c</tt> - C. Watford (christopher.watford@gmail.com)</dt>
<dd>
Added cast and mask to suffice <tt>size_t</tt> v. <tt>unsigned int</tt>
conversion correctness</dd>
</dl>
<p>This program is free software; you can redistribute it and/or modify it under
the terms of the MIT License. See COPYING for details.</p>
<hr />
</body>
</html>

View File

@@ -8,27 +8,34 @@
<h2>JSON-C - A JSON implementation in C</h2>
<h3>Overview</h3>
<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.</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://tools.ietf.org/html/rfc7159">RFC 7159</a>.
</p>
<h3>Building</h3>
<p>To setup JSON-C to build on your system please run <tt>configure</tt> and <tt>make</tt>.</p>
<p>If you are on Win32 and are not using the VS project file, be sure
to rename <tt>config.h.win32</tt> to <tt>config.h</tt> before building.</p>
<p>If you are on Win32 cmake is required, generally:</p>
<ul>
<li>mkdir build</li>
<li>cd build</li>
<li>cmake ..</li>
<li>msbuild "json-c.vcxproj" /m /verbosity:normal /p:OutDir=lib\</li>
<li>Or, open the project in Visual Studio</li>
</ul>
<h3>Documentation</h3>
<P>Doxygen generated documentation exists <a href="doc/html/json__object_8h.html">here</a>
and Win32 specific notes can be found <a href="README-WIN32.html">here</a>.</P>
<P>Doxygen generated documentation exists <a href="https://json-c.github.io/json-c/">here</a>.</P>
<h3><a href="https://github.com/json-c/json-c">GIT Reposository</a></h3>
<p><strong><code>git clone https://github.com/json-c/json-c.git</code></strong></p>
<h3><a href="http://groups.google.com/group/json-c">Mailing List</a></h3>
<h3><a href="https://groups.google.com/group/json-c">Mailing List</a></h3>
<pi>Send email to <strong><code>json-c <i>&lt;at&gt;</i> googlegroups <i>&lt;dot&gt;</i> com</code></strong></p>
<h3><a href="COPYING">License</a></h3>
<p>This program is free software; you can redistribute it and/or modify it under the terms of the MIT License..</p>
<p>This program is free software; you can redistribute it and/or modify it under the terms of the MIT License.</p>
<hr/>
</body>
</html>

345
README.md Normal file
View File

@@ -0,0 +1,345 @@
\mainpage
`json-c`
========
1. [Overview and Build Status](#overview)
2. [Getting Help](#gettinghelp)
3. [Building on Unix](#buildunix)
* [Prerequisites](#installprereq)
* [Build commands](#buildcmds)
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>
-----------------------------------
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 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/),
if you already have json-c installed and ready to use.
Home page for json-c: https://github.com/json-c/json-c/wiki
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).
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
- `cmake>=2.8`, `>=3.16` recommended, `cmake=>3.1` for tests
To generate docs you'll also need:
- `doxygen>=1.8.13`
If you are on a relatively modern system, you'll likely be able to install
the prerequisites using your OS's packaging system.
### Install using apt (e.g. Ubuntu 16.04.2 LTS)
```sh
sudo apt install git
sudo apt install cmake
sudo apt install doxygen # optional
sudo apt install valgrind # optional
```
### Build instructions: <a name="buildcmds"></a>
`json-c` GitHub repo: https://github.com/json-c/json-c
```sh
$ git clone https://github.com/json-c/json-c.git
$ mkdir json-c-build
$ cd json-c-build
$ cmake ../json-c # See CMake section below for custom arguments
```
Note: it's also possible to put your build directory inside the json-c
source directory, or even not use a separate build directory at all, but
certain things might not work quite right (notably, `make distcheck`)
Then:
```sh
$ make
$ make test
$ make USE_VALGRIND=0 test # optionally skip using valgrind
$ sudo make install # it could be necessary to execute make install
```
### Generating documentation with Doxygen:
The library documentation can be generated directly from the source code using Doxygen tool:
```sh
# in build directory
make doc
google-chrome doc/html/index.html
```
CMake Options <a name="CMake"></a>
--------------------
The json-c library is built with [CMake](https://cmake.org/cmake-tutorial/),
which can take a few options.
Variable | Type | Description
-----------------------------|--------|--------------
CMAKE_INSTALL_PREFIX | String | The install location.
CMAKE_BUILD_TYPE | String | Defaults to "debug".
BUILD_SHARED_LIBS | Bool | The default build generates a dynamic (dll/so) library. Set this to OFF to create a static library only.
BUILD_STATIC_LIBS | Bool | The default build generates a static (lib/a) library. Set this to OFF to create a shared library only.
DISABLE_STATIC_FPIC | Bool | The default builds position independent code. Set this to OFF to create a shared library only.
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.
Pass these options as `-D` on CMake's command-line.
```sh
# build a static library only
cmake -DBUILD_SHARED_LIBS=OFF ..
```
### Building with partial threading support
Although json-c does not support fully multi-threaded access to
object trees, it has some code to help make its use in threaded programs
a bit safer. Currently, this is limited to using atomic operations for
json_object_get() and json_object_put().
Since this may have a performance impact, of at least 3x slower
according to https://stackoverflow.com/a/11609063, it is disabled by
default. You may turn it on by adjusting your cmake command with:
-DENABLE_THREADING=ON
Separately, the default hash function used for object field keys,
lh_char_hash, uses a compare-and-swap operation to ensure the random
seed is only generated once. Because this is a one-time operation, it
is always compiled in when the compare-and-swap operation is available.
### cmake-configure wrapper script
For those familiar with the old autoconf/autogen.sh/configure method,
there is a `cmake-configure` wrapper script to ease the transition to cmake.
```sh
mkdir build
cd build
../cmake-configure --prefix=/some/install/path
make
```
cmake-configure can take a few options.
| options | Description|
| ---- | ---- |
| prefix=PREFIX | install architecture-independent files in PREFIX |
| enable-threading | Enable code to support partly multi-threaded use |
| enable-rdrand | Enable RDRAND Hardware RNG Hash Seed generation on supported x86/x64 platforms. |
| enable-shared | build shared libraries [default=yes] |
| enable-static | build static libraries [default=yes] |
| disable-Bsymbolic | Avoid linking with -Bsymbolic-function |
| disable-werror | Avoid treating compiler warnings as fatal errors |
Testing: <a name="testing"></a>
----------
By default, if valgrind is available running tests uses it.
That can slow the tests down considerably, so to disable it use:
```sh
export USE_VALGRIND=0
```
To run tests a separate build directory is recommended:
```sh
mkdir build-test
cd build-test
# VALGRIND=1 causes -DVALGRIND=1 to be passed when compiling code
# which uses slightly slower, but valgrind-safe code.
VALGRIND=1 cmake ..
make
make test
# By default, if valgrind is available running tests uses it.
make USE_VALGRIND=0 test # optionally skip using valgrind
```
If a test fails, check `Testing/Temporary/LastTest.log`,
`tests/testSubDir/${testname}/${testname}.vg.out`, and other similar files.
If there is insufficient output try:
```sh
VERBOSE=1 CTEST_OUTPUT_ON_FAILURE=1 make test
```
or
```sh
JSONC_TEST_TRACE=1 make test
```
and check the log files again.
Building on Unix and Windows with `vcpkg` <a name="buildvcpkg"></a>
--------------------------------------------------
You can download and install JSON-C using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
vcpkg install json-c
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">
----------------------
If your system has `pkgconfig`,
then you can just add this to your `makefile`:
```make
CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)
```
Without `pkgconfig`, you might do something like this:
```make
JSON_C_DIR=/path/to/json_c/install
CFLAGS += -I$(JSON_C_DIR)/include/json-c
# Or to use lines like: #include <json-c/json_object.h>
#CFLAGS += -I$(JSON_C_DIR)/include
LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
```
If your project uses cmake:
* Add to your CMakeLists.txt file:
```cmake
find_package(json-c CONFIG)
target_link_libraries(${PROJECT_NAME} PRIVATE json-c::json-c)
```
* Then you might run in your project:
```sh
cd build
cmake -DCMAKE_PREFIX_PATH=/path/to/json_c/install/lib64/cmake ..
```
Using json-c <a name="using">
------------
To use json-c you can either include json.h, or preferably, one of the
following more specific header files:
* json_object.h - Core types and methods.
* json_tokener.h - Methods for parsing and serializing json-c object trees.
* json_pointer.h - JSON Pointer (RFC 6901) implementation for retrieving
objects from a json-c object tree.
* json_object_iterator.h - Methods for iterating over single json_object instances. (See also `json_object_object_foreach()` in json_object.h)
* json_visit.h - Methods for walking a tree of json-c objects.
* json_util.h - Miscellaneous utility functions.
For a full list of headers see [files.html](https://json-c.github.io/json-c/json-c-current-release/doc/html/files.html)
The primary type in json-c is json_object. It describes a reference counted
tree of json objects which are created by either parsing text with a
json_tokener (i.e. `json_tokener_parse_ex()`), or by creating
(with `json_object_new_object()`, `json_object_new_int()`, etc...) and adding
(with `json_object_object_add()`, `json_object_array_add()`, etc...) them
individually.
Typically, every object in the tree will have one reference, from its parent.
When you are done with the tree of objects, you call json_object_put() on just
the root object to free it, which recurses down through any child objects
calling json_object_put() on each one of those in turn.
You can get a reference to a single child
(`json_object_object_get()` or `json_object_array_get_idx()`)
and use that object as long as its parent is valid.
If you need a child object to live longer than its parent, you can
increment the child's refcount (`json_object_get()`) to allow it to survive
the parent being freed or it being removed from its parent
(`json_object_object_del()` or `json_object_array_del_idx()`)
When parsing text, the json_tokener object is independent from the json_object
that it returns. It can be allocated (`json_tokener_new()`)
used one or multiple times (`json_tokener_parse_ex()`, and
freed (`json_tokener_free()`) while the json_object objects live on.
A json_object tree can be serialized back into a string with
`json_object_to_json_string_ext()`. The string that is returned
is only valid until the next "to_json_string" call on that same object.
Also, it is freed when the json_object is freed.

View File

@@ -1,61 +1,191 @@
Release checklist:
# Release checklist:
release=0.11
git clone https://github.com/json-c/json-c json-c-${release}
cd json-c-${release}
## Pre-release tasks
Check that the compile works on Linux
Check that the compile works on NetBSD
Check that the compile works on Windows
Check ChangeLog to see if anything should be added.
* Figure out whether a release is worthwhile to do.
* Analyze the previous release branch to see if anything should have been
applied to master.
* Collect changes and assemble tentative release notes.
* Identify previous release branch point
* Check commit logs between previous branch point and now for
notable changes worth mentioning
* Create a new issues_closed_for_X.Y.md file
* Include notable entries from here in the release notes.
* Analyze APIs between previous release branch and master to produce list of
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
aliases and appropriate entries in json-c.sym
* Be sure any new symbols are listed in json-c.sym as part of
the _new_ release version.
* Update the AUTHORS file
git branch json-c-${release}
git checkout json-c-${release}
PREV=$(git tag | tail -1)
( git log -r ${PREV}..HEAD | grep Author: | sed -e's/Author: //' ; cat AUTHORS ) | sort -u > A1
mv A1 AUTHORS
Generate the configure script and other files:
sh autogen.sh
git add -f Makefile.in aclocal.m4 config.guess \
config.sub configure depcomp install-sh \
ltmain.sh missing tests/Makefile.in \
INSTALL
* Exclude mentioning changes that have already been included in a point
release of the previous release branch.
# check for anything else to be added:
git status --ignored
git commit
* Update ChangeLog with relevant notes before branching.
* Check that the compile works on Linux - automatic through Travis
* Check that the compile works on NetBSD
* Check that the compile works on Windows - automatic through AppVeyor
## Release creation
Start creating the new release:
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
# the source tree for distcheck to work properly.
cmake -DCMAKE_BUILD_TYPE=Release ../json-c-${release}
make distcheck
cd ..
Make any fixes/changes *before* branching.
cd json-c-${release}
git checkout -b json-c-${release}
------------
Using ${release}:
Update the version in json_c_version.h
Update the version in CMakeLists.txt (VERSION in the project(...) line)
Update the set_target_properties() line in CmakeLists.txt to set the shared
library version. Generally, unless we're doing a major release, change:
VERSION x.y.z
to
VERSION x.y+1.z
git commit -a -m "Bump version to ${release}"
If we're doing a major release (SONAME bump), also bump the version
of ALL symbols in json-c.sym.
See explanation at https://github.com/json-c/json-c/issues/621
More info at: https://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf
------------
Generate the doxygen documentation:
doxygen
git add -f doc
git commit doc
cd ..
echo .git > excludes
echo autom4te.cache >> excludes
tar -czf json-c-${release}.tar.gz -X excludes json-c-${release}
(cd ../distcheck && make doc)
cp -r -p ../distcheck/doc/{html,Doxyfile} doc/.
rm doc/Doxyfile # Remove generated file w/ hardcoded paths
git add -f doc
git commit doc -m "Generate docs for the ${release} release"
echo doc >> excludes
tar -czf json-c-${release}-nodoc.tar.gz -X excludes json-c-${release}
------------
Create the release tarballs:
cd ..
echo .git > excludes
tar -czf json-c-${release}.tar.gz -X excludes json-c-${release}
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}
------------
Tag the branch:
cd json-c-${release}
git tag -a json-c-${release}-$(date +%Y%m%d)
git push
git push --tags
Go to https://github.com/json-c/json-c/downloads
Upload the two tarballs.
cd json-c-${release}
git tag -a json-c-${release}-$(date +%Y%m%d) -m "Release json-c-${release}"
git push origin json-c-${release}
git push --tags
------------
Go to Amazon S3 service at:
https://console.aws.amazon.com/s3/
Upload the two tarballs in the json-c_releases/releases folder.
* 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
===================================
Post-release checklist:
git branch master
Add new section to CHANGES
Update the version in json_c_version.h
Update the version in Doxyfile
Update the version in configure.in
Update the libjson_la_LDFLAGS line in Makefile.am to the new version.
http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
git checkout master
Add new section to ChangeLog for ${release}+1
Use ${release}.99 to indicate a version "newer" than anything on the branch:
Update the version in json_c_version.h
Update the version in CMakeLists.txt
Update RELEASE_CHECKLIST.txt, set release=${release}+1
Add a new empty section to the json-c.sym file, for ${release}+1
Update the set_target_properties() line in CmakeLists.txt to match the release branch.
git commit -a -m "Update the master branch to version ${release}.99"
git push
------------
Update the gh-pages branch with new docs:
cd json-c-${release}
git checkout json-c-${release}
cd ..
git clone -b gh-pages https://github.com/json-c/json-c json-c-pages
cd json-c-pages
mkdir json-c-${release}
cp -R ../json-c-${release}/doc json-c-${release}/.
git add json-c-${release}
rm json-c-current-release
ln -s json-c-${release} json-c-current-release
git commit -a -m "Add the ${release} docs."
vi index.html
# Add/change links to current release.
git commit -a -m "Update the doc links to point at ${release}"
git push
------------
Update checksums on wiki page.
cd ..
openssl sha -sha256 json-c*gz
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/Old-Releases
------------
Send an email to the mailing list.

31
STYLE.txt Normal file
View File

@@ -0,0 +1,31 @@
In general:
For minor changes to a function, copy the existing formatting.
When changing the style, commit that separately from other changes.
For new code and major changes to a function, switch to the official json-c style.
Official json-c style:
Aim for readability, not strict conformance to fixed style rules.
Formatting is tab based; previous attempts at proper alignment with
spaces for continuation lines have been abandoned in favor of the
convenience of using clang-format.
Refer to the .clang-format file for details, and run the tool before commit:
clang-format -i somefile.c foo.h
For sections of code that would be significantly negatively impacted, surround
them with magic comments to disable formatting:
/* clang-format off */
...code...
/* clang-format on */
Naming:
Words within function and variable names are separated with underscores. Avoid camel case.
Prefer longer, more descriptive names, but not excessively so. No single letter variable names.
Other:
Variables should be defined for the smallest scope needed.
Functions should be defined static when possible.
When possible, avoid exposing internals in the public API.

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/..."

122
apps/CMakeLists.txt Normal file
View File

@@ -0,0 +1,122 @@
cmake_minimum_required(VERSION 2.8) # see ../CMakeLists.txt for why 2.8
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()
include(CheckSymbolExists)
include(CheckIncludeFile)
include(CMakePackageConfigHelpers)
# First, sort out whether we're running inside a json-c build,
# or standalone, such as part of a benchmark build.
if ("${PROJECT_NAME}" STREQUAL "json-c")
# Part of an overall json-c build
set(APPS_LINK_LIBS "${PROJECT_NAME}")
# We know we have this in our current sources:
set(HAVE_JSON_TOKENER_GET_PARSE_END)
else()
# Standalone mode, using an already installed json-c library, somewhere.
# The path to the json-c install must be specified with -DCMAKE_PREFIX_PATH=...
project(apps)
find_package(PkgConfig)
# PkgConfig is supposed to include CMAKE_PREFIX_PATH in the PKG_CONFIG_PATH
# that's used when running pkg-config, but it just doesn't work :(
# https://gitlab.kitware.com/cmake/cmake/issues/18150
#set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH True)
# Instead, we handle it explicitly here and update PKG_CONFIG_PATH ourselves.
if (NOT CMAKE_PREFIX_PATH)
message(FATAL_ERROR "Please specify -DCMAKE_PREFIX_PATH=... when running cmake.")
endif()
# Note: find_file isn't recursive :(
find_file(PC_FILE_PATH "json-c.pc"
PATHS "${CMAKE_PREFIX_PATH}/lib64" "${CMAKE_PREFIX_PATH}/lib"
PATH_SUFFIXES "pkgconfig"
NO_DEFAULT_PATH)
get_filename_component(PC_DIR_PATH "${PC_FILE_PATH}" DIRECTORY)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${PC_DIR_PATH}")
message(STATUS "PC_FILE_PATH=${PC_FILE_PATH}")
message(STATUS "PC_DIR_PATH=${PC_DIR_PATH}")
pkg_check_modules(PC_JSONC json-c)
if (PC_JSONC_FOUND)
message(STATUS "Found json-c using pkg-config: ${PC_JSONC_PREFIX}")
message(STATUS " PC_JSONC_INCLUDE_DIRS=${PC_JSONC_INCLUDE_DIRS}")
message(STATUS " PC_JSONC_LIBRARIES=${PC_JSONC_LIBRARIES}")
message(STATUS " PC_JSONC_LIBRARY_DIRS=${PC_JSONC_LIBRARY_DIRS}")
link_directories(${PC_JSONC_LIBRARY_DIRS})
include_directories(${PC_JSONC_INCLUDE_DIRS})
# for target_link_libraries(...)
set(APPS_INCLUDE_DIRS ${PC_JSONC_INCLUDE_DIRS})
set(APPS_LINK_DIRS ${PC_JSONC_LIBRARY_DIRS})
set(APPS_LINK_LIBS ${PC_JSONC_LIBRARIES})
else()
message(STATUS "Using find_package to locate json-c")
# Note: find_package needs CMAKE_PREFIX_PATH set appropriately.
# XXX json-c's installed cmake files don't actually set up what's
# needed to use find_package() by itself, so we're just using it
# to confirm the top of the install location.
find_package(json-c CONFIG) # sets json-c_DIR
# Assume json-c-config.cmake is in lib64/cmake/json-c/
get_filename_component(json-c_TOP "${json-c_DIR}/../../.." ABSOLUTE)
get_filename_component(json-c_LIBDIR "${json-c_DIR}/../.." ABSOLUTE)
message(STATUS " json-c_TOP=${json-c_TOP}")
message(STATUS " json-c_DIR=${json-c_DIR}")
message(STATUS " json-c_LIBDIR=${json-c_LIBDIR}")
link_directories(${json-c_LIBDIR})
include_directories(${json-c_TOP}/include)
include_directories(${json-c_TOP}/include/json-c)
set(APPS_LINK_DIRS "${json-c_LIBDIR}")
set(APPS_INCLUDE_DIRS "${json-c_TOP}/include;${json-c_TOP}/include/json-c")
set(APPS_LINK_LIBS json-c)
endif()
set(CMAKE_REQUIRED_LINK_OPTIONS "-L${APPS_LINK_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES ${APPS_LINK_LIBS})
set(CMAKE_REQUIRED_INCLUDES ${APPS_INCLUDE_DIRS})
check_symbol_exists(json_tokener_get_parse_end "json_tokener.h" HAVE_JSON_TOKENER_GET_PARSE_END)
endif() # end "standalone mode" block
# ---------------------------------
check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) # for getrusage
if (HAVE_SYS_RESOURCE_H)
check_symbol_exists(getrusage "sys/resource.h" HAVE_GETRUSAGE)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/apps_config.h.in
${PROJECT_BINARY_DIR}/apps_config.h)
message(STATUS "Wrote ${PROJECT_BINARY_DIR}/apps_config.h")
# ---------------------------------
include_directories(PUBLIC ${CMAKE_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})
# ---------------------------------
# Now, finally, the actual executables we're building:
add_executable(json_parse json_parse.c)
target_link_libraries(json_parse PRIVATE ${APPS_LINK_LIBS})
# Note: it is intentional that there are no install instructions here yet.
# When/if the interface of the app(s) listed here settles down enough to
# publish as part of a regular build that will be added.

View File

@@ -0,0 +1,8 @@
/* Define to 1 if you have the <sys/resource.h> header file. */
#cmakedefine HAVE_SYS_RESOURCE_H
/* Define if you have the `getrusage' function. */
#cmakedefine HAVE_GETRUSAGE
#cmakedefine HAVE_JSON_TOKENER_GET_PARSE_END

204
apps/json_parse.c Normal file
View File

@@ -0,0 +1,204 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "apps_config.h"
/* XXX for a regular program, these should be <json-c/foo.h>
* but that's inconvenient when building in the json-c source tree.
*/
#include "json_object.h"
#include "json_tokener.h"
#include "json_util.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#include <sys/time.h>
#endif
#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
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);
static void showmem(void)
{
#ifdef HAVE_GETRUSAGE
struct rusage rusage;
memset(&rusage, 0, sizeof(rusage));
getrusage(RUSAGE_SELF, &rusage);
fprintf(stderr, "maxrss: %ld KB\n", rusage.ru_maxrss);
#endif
}
static int parseit(int fd, int (*callback)(struct json_object *))
{
struct json_object *obj;
char buf[32768];
ssize_t ret;
int depth = JSON_TOKENER_DEFAULT_DEPTH;
json_tokener *tok;
tok = json_tokener_new_ex(depth);
if (!tok)
{
fprintf(stderr, "unable to allocate json_tokener: %s\n", strerror(errno));
return 1;
}
json_tokener_set_flags(tok, JSON_TOKENER_STRICT
#ifdef JSON_TOKENER_ALLOW_TRAILING_CHARS
| JSON_TOKENER_ALLOW_TRAILING_CHARS
#endif
);
// XXX push this into some kind of json_tokener_parse_fd API?
// json_object_from_fd isn't flexible enough, and mirroring
// everything you can do with a tokener into json_util.c seems
// like the wrong approach.
size_t total_read = 0;
while ((ret = read(fd, buf, sizeof(buf))) > 0)
{
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], retu - start_pos);
enum json_tokener_error jerr = json_tokener_get_error(tok);
size_t parse_end = json_tokener_get_parse_end(tok);
if (obj == NULL && jerr != json_tokener_continue)
{
const char *aterr = (start_pos + parse_end < (int)sizeof(buf)) ?
&buf[start_pos + parse_end] : "";
fflush(stdout);
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;
}
if (obj != NULL)
{
int cb_ret = callback(obj);
json_object_put(obj);
if (cb_ret != 0)
{
json_tokener_free(tok);
return 1;
}
}
start_pos += json_tokener_get_parse_end(tok);
assert(start_pos <= retu);
}
}
if (ret < 0)
{
fprintf(stderr, "error reading fd %d: %s\n", fd, strerror(errno));
}
json_tokener_free(tok);
return 0;
}
static int showobj(struct json_object *new_obj)
{
if (new_obj == NULL)
{
fprintf(stderr, "%s: Failed to parse\n", fname);
return 1;
}
fprintf(stderr, "Successfully parsed object from %s\n", fname);
if (show_output)
{
const char *output;
output = json_object_to_json_string_ext(new_obj, formatted_output | color);
printf("%s\n", output);
}
showmem();
return 0;
}
static void usage(const char *argv0, int exitval, const char *errmsg)
{
FILE *fp = stdout;
if (exitval != 0)
fp = stderr;
if (errmsg != NULL)
fprintf(fp, "ERROR: %s\n\n", errmsg);
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");
exit(exitval);
}
int main(int argc, char **argv)
{
int opt;
while ((opt = getopt(argc, argv, "fF:hnsc")) != -1)
{
switch (opt)
{
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");
}
}
if (optind >= argc)
{
usage(argv[0], EXIT_FAILURE, "Expected argument after options");
}
fname = argv[optind];
int fd = open(argv[optind], O_RDONLY, 0);
showmem();
if (parseit(fd, showobj) != 0)
exit(EXIT_FAILURE);
showmem();
exit(EXIT_SUCCESS);
}

125
appveyor.yml Normal file
View File

@@ -0,0 +1,125 @@
version: '{branch}.{build}'
image:
# b_toolset: v143
- Visual Studio 2022
# VS2015 also used for earlier VS builds
# aka os: Windows Server 2012 R2
- Visual Studio 2015
# aka os: Windows Server 2016
# b_toolset: v141
- Visual Studio 2017
# aka os: Windows Server 2019
# b_toolset: v142
- Visual Studio 2019
platform: x64
environment:
matrix:
- b_toolset: Windows7.1SDK
- b_toolset: v120
- b_toolset: v140
- b_toolset: v141
- b_toolset: v142
- b_toolset: v143
configuration:
- Debug
- Release
build_script:
- cmake -T %b_toolset% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=t_install .
- cmake --build . --target install
matrix:
exclude:
# Skip release builds for all except the newest image
- image: Visual Studio 2015
configuration: Release
# In the "old" image, new toolsets aren't available:
- image: Visual Studio 2015
b_toolset: v141
- image: Visual Studio 2015
b_toolset: v142
- image: Visual Studio 2015
b_toolset: v143
# ----
- image: Visual Studio 2017
configuration: Release
# In the "new" images, exclude all toolsets except the relevant
# one for that image:
- image: Visual Studio 2017
b_toolset: Windows7.1SDK
- image: Visual Studio 2017
b_toolset: v120
- image: Visual Studio 2017
b_toolset: v140
- image: Visual Studio 2017
b_toolset: v142
- image: Visual Studio 2017
b_toolset: v143
# ----
- image: Visual Studio 2019
configuration: Release
- image: Visual Studio 2019
b_toolset: Windows7.1SDK
- image: Visual Studio 2019
b_toolset: v120
- image: Visual Studio 2019
b_toolset: v140
- image: Visual Studio 2019
b_toolset: v141
- image: Visual Studio 2019
b_toolset: v143
# ----
- image: Visual Studio 2022
b_toolset: Windows7.1SDK
- image: Visual Studio 2022
b_toolset: v120
- image: Visual Studio 2022
b_toolset: v140
- image: Visual Studio 2022
b_toolset: v141
- image: Visual Studio 2022
b_toolset: v142
after_build:
- cd t_install
- 7z a ../json-c.win32.%b_toolset%.%CONFIGURATION%.zip *
artifacts:
- path: json-c.win32.%b_toolset%.%CONFIGURATION%.zip
name: json-c.win32.%b_toolset%.%CONFIGURATION%.zip

View File

@@ -11,91 +11,216 @@
#include "config.h"
#include <limits.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <string.h>
#include <stdlib.h>
#include <string.h>
#endif /* STDC_HEADERS */
#if defined(HAVE_STRINGS_H) && !defined(_STRING_H) && !defined(__USE_BSD)
# include <strings.h>
#include <strings.h>
#endif /* HAVE_STRINGS_H */
#include "bits.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
#include "arraylist.h"
struct array_list*
array_list_new(array_list_free_fn *free_fn)
struct array_list *array_list_new(array_list_free_fn *free_fn)
{
struct array_list *arr;
arr = (struct array_list*)calloc(1, sizeof(struct array_list));
if(!arr) return NULL;
arr->size = ARRAY_LIST_DEFAULT_SIZE;
arr->length = 0;
arr->free_fn = free_fn;
if(!(arr->array = (void**)calloc(sizeof(void*), arr->size))) {
free(arr);
return NULL;
}
return arr;
return array_list_new2(free_fn, ARRAY_LIST_DEFAULT_SIZE);
}
extern void
array_list_free(struct array_list *arr)
struct array_list *array_list_new2(array_list_free_fn *free_fn, int initial_size)
{
int i;
for(i = 0; i < arr->length; i++)
if(arr->array[i]) arr->free_fn(arr->array[i]);
free(arr->array);
free(arr);
struct array_list *arr;
if (initial_size < 0 || (size_t)initial_size >= SIZE_T_MAX / sizeof(void *))
return NULL;
arr = (struct array_list *)malloc(sizeof(struct array_list));
if (!arr)
return NULL;
arr->size = initial_size;
arr->length = 0;
arr->free_fn = free_fn;
if (!(arr->array = (void **)malloc(arr->size * sizeof(void *))))
{
free(arr);
return NULL;
}
return arr;
}
void*
array_list_get_idx(struct array_list *arr, int i)
extern void array_list_free(struct array_list *arr)
{
if(i >= arr->length) return NULL;
return arr->array[i];
size_t i;
for (i = 0; i < arr->length; i++)
if (arr->array[i])
arr->free_fn(arr->array[i]);
free(arr->array);
free(arr);
}
static int array_list_expand_internal(struct array_list *arr, int max)
void *array_list_get_idx(struct array_list *arr, size_t i)
{
void *t;
int new_size;
if(max < arr->size) return 0;
new_size = json_max(arr->size << 1, max);
if(!(t = realloc(arr->array, new_size*sizeof(void*)))) return -1;
arr->array = (void**)t;
(void)memset(arr->array + arr->size, 0, (new_size-arr->size)*sizeof(void*));
arr->size = new_size;
return 0;
if (i >= arr->length)
return NULL;
return arr->array[i];
}
int
array_list_put_idx(struct array_list *arr, int idx, void *data)
static int array_list_expand_internal(struct array_list *arr, size_t max)
{
if(array_list_expand_internal(arr, idx+1)) return -1;
if(arr->array[idx]) arr->free_fn(arr->array[idx]);
arr->array[idx] = data;
if(arr->length <= idx) arr->length = idx + 1;
return 0;
void *t;
size_t new_size;
if (max < arr->size)
return 0;
/* Avoid undefined behaviour on size_t overflow */
if (arr->size >= SIZE_T_MAX / 2)
new_size = max;
else
{
new_size = arr->size << 1;
if (new_size < max)
new_size = max;
}
if (new_size > (~((size_t)0)) / sizeof(void *))
return -1;
if (!(t = realloc(arr->array, new_size * sizeof(void *))))
return -1;
arr->array = (void **)t;
arr->size = new_size;
return 0;
}
int
array_list_add(struct array_list *arr, void *data)
int array_list_shrink(struct array_list *arr, size_t empty_slots)
{
return array_list_put_idx(arr, arr->length, data);
void *t;
size_t new_size;
if (empty_slots >= SIZE_T_MAX / sizeof(void *) - arr->length)
return -1;
new_size = arr->length + empty_slots;
if (new_size == arr->size)
return 0;
if (new_size > arr->size)
return array_list_expand_internal(arr, new_size);
if (new_size == 0)
new_size = 1;
if (!(t = realloc(arr->array, new_size * sizeof(void *))))
return -1;
arr->array = (void **)t;
arr->size = new_size;
return 0;
}
void
array_list_sort(struct array_list *arr, int(*sort_fn)(const void *, const void *))
int array_list_insert_idx(struct array_list *arr, size_t idx, void *data)
{
qsort(arr->array, arr->length, sizeof(arr->array[0]),
(int (*)(const void *, const void *))sort_fn);
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;
}
int
array_list_length(struct array_list *arr)
//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)
{
return arr->length;
if (idx > SIZE_T_MAX - 1)
return -1;
if (array_list_expand_internal(arr, idx + 1))
return -1;
if (idx < arr->length && arr->array[idx])
arr->free_fn(arr->array[idx]);
arr->array[idx] = data;
if (idx > arr->length)
{
/* Zero out the arraylist slots in between the old length
and the newly added entry so we know those entries are
empty.
e.g. when setting array[7] in an array that used to be
only 5 elements longs, array[5] and array[6] need to be
set to 0.
*/
memset(arr->array + arr->length, 0, (idx - arr->length) * sizeof(void *));
}
if (arr->length <= idx)
arr->length = idx + 1;
return 0;
}
int array_list_add(struct array_list *arr, void *data)
{
/* Repeat some of array_list_put_idx() so we can skip several
checks that we know are unnecessary when appending at the end
*/
size_t idx = arr->length;
if (idx > SIZE_T_MAX - 1)
return -1;
if (array_list_expand_internal(arr, idx + 1))
return -1;
arr->array[idx] = data;
arr->length++;
return 0;
}
void array_list_sort(struct array_list *arr, int (*compar)(const void *, const void *))
{
qsort(arr->array, arr->length, sizeof(arr->array[0]), compar);
}
void *array_list_bsearch(const void **key, struct array_list *arr,
int (*compar)(const void *, const void *))
{
return bsearch(key, arr->array, arr->length, sizeof(arr->array[0]), compar);
}
size_t array_list_length(struct array_list *arr)
{
return arr->length;
}
int array_list_del_idx(struct array_list *arr, size_t idx, size_t count)
{
size_t i, stop;
/* Avoid overflow in calculation with large indices. */
if (idx > SIZE_T_MAX - count)
return -1;
stop = idx + count;
if (idx >= arr->length || stop > arr->length)
return -1;
for (i = idx; i < stop; ++i)
{
// Because put_idx can skip entries, we need to check if
// there's actually anything in each slot we're erasing.
if (arr->array[i])
arr->free_fn(arr->array[i]);
}
memmove(arr->array + idx, arr->array + stop, (arr->length - stop) * sizeof(void *));
arr->length -= count;
return 0;
}

View File

@@ -9,45 +9,79 @@
*
*/
#ifndef _arraylist_h_
#define _arraylist_h_
/**
* @file
* @brief Internal methods for working with json_type_array objects.
* Although this is exposed by the json_object_get_array() method,
* it is not recommended for direct use.
*/
#ifndef _json_c_arraylist_h_
#define _json_c_arraylist_h_
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#define ARRAY_LIST_DEFAULT_SIZE 32
typedef void (array_list_free_fn) (void *data);
typedef void(array_list_free_fn)(void *data);
struct array_list
{
void **array;
int length;
int size;
array_list_free_fn *free_fn;
void **array;
size_t length;
size_t size;
array_list_free_fn *free_fn;
};
typedef struct array_list array_list;
extern struct array_list*
array_list_new(array_list_free_fn *free_fn);
/**
* Allocate an array_list of the default size (32).
* @deprecated Use array_list_new2() instead.
*/
extern struct array_list *array_list_new(array_list_free_fn *free_fn);
extern void
array_list_free(struct array_list *al);
/**
* Allocate an array_list of the desired size.
*
* If possible, the size should be chosen to closely match
* the actual number of elements expected to be used.
* If the exact size is unknown, there are tradeoffs to be made:
* - too small - the array_list code will need to call realloc() more
* often (which might incur an additional memory copy).
* - too large - will waste memory, but that can be mitigated
* by calling array_list_shrink() once the final size is known.
*
* @see array_list_shrink
*/
extern struct array_list *array_list_new2(array_list_free_fn *free_fn, int initial_size);
extern void*
array_list_get_idx(struct array_list *al, int i);
extern void array_list_free(struct array_list *al);
extern int
array_list_put_idx(struct array_list *al, int i, void *data);
extern void *array_list_get_idx(struct array_list *al, size_t i);
extern int
array_list_add(struct array_list *al, void *data);
extern int array_list_insert_idx(struct array_list *al, size_t i, void *data);
extern int
array_list_length(struct array_list *al);
extern int array_list_put_idx(struct array_list *al, size_t i, void *data);
extern void
array_list_sort(struct array_list *arr, int(*compar)(const void *, const void *));
extern int array_list_add(struct array_list *al, void *data);
extern size_t array_list_length(struct array_list *al);
extern void array_list_sort(struct array_list *arr, int (*compar)(const void *, const void *));
extern void *array_list_bsearch(const void **key, struct array_list *arr,
int (*compar)(const void *, const void *));
extern int array_list_del_idx(struct array_list *arr, size_t idx, size_t count);
/**
* Shrink the array list to just enough to fit the number of elements in it,
* plus empty_slots.
*/
extern int array_list_shrink(struct array_list *arr, size_t empty_slots);
#ifdef __cplusplus
}

View File

@@ -1,13 +0,0 @@
#!/bin/sh
autoreconf -v --install || exit 1
# If there are any options, assume the user wants to run configure.
# To run configure w/o any options, use ./autogen.sh --configure
if [ $# -gt 0 ] ; then
case "$1" in
--conf*)
shift 1
;;
esac
exec ./configure "$@"
fi

80
bench/README.bench.md Normal file
View File

@@ -0,0 +1,80 @@
Benchmark tests for json-c
General strategy:
-------------------
* Identify "after" commit hash
* Use provided directory
* Use provided commit hash
* Local changes in current working directory
* ${cur_branch}
* Identify "before" commit hash, in order of preference
* Use provided directory
* Use provided commit hash
* Use origin/${cur_branch}, if different from ${after_commit}
* Use previous release
* If not using existing dir, clone to src-${after_commit}
* or, checkout appropriate commit in existing src-${after_commit}
* Create build & install dirs for ${after_commit}
* Build & install ${after_commit}
* Compile benchmark programs against install-${after_commit}
* If not using existing dir, clone to src-${before_commit}
* or, checkout appropriate commit in existing src-${before_commit}
* Create build & install dirs for ${before_commit}
* Build & install ${before_commit}
* Compile benchmark programs against install-${before_commit}
* Run benchmark in each location
* Compare results
heaptrack memory profiler
---------------------------
https://milianw.de/blog/heaptrack-a-heap-memory-profiler-for-linux.html
```
yum install libdwarf-devel elfutils boost-devel libunwind-devel
git clone git://anongit.kde.org/heaptrack
cd heaptrack
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=$HOME/heaptrack-install ..
make install
```
Issues
--------
* jc-bench.sh is incomplete.
* valgrind massif misreports "extra-heap" bytes?
"json_parse -n canada.json" shows 38640 KB maxrss.
Using valgrind --tool=massif, a large amount of memory is listed as
wasted "extra-heap" bytes. (~5.6MB)
```
valgrind --tool=massif --massif-out-file=massif.out ./json_parse -n ~/canada.json
ms_print massif.out
```
Using heaptrack, and analyzing the histogram, only shows ~2.6MB
```
heaptrack ./json_parse -n canada.json
heaptrack --analyze heaptrack*gz -H histogram.out
awk ' { s=$1; count=$2; ru=(int((s+ 15) / 16)) * 16; wasted = ((ru-s)*count); print s, count, ru-s, wasted; total=total+wasted} END { print "Total: ", total }' histogram.out
```
With the (unreleased) arraylist trimming changes, maxrss reported by
getrusage() goes down, but massif claims *more* total usage, and a HUGE
extra-heap amount (50% of total).

284
bench/jc-bench.sh Executable file
View File

@@ -0,0 +1,284 @@
#!/bin/sh
#
# Benchmarking harness for json-c
#
# Use this to compare the behavior of two different versions of the library,
# such as json-c-0.14 release vs master, master vs local changes, etc...
#
set -e
trap 'echo "FAILED!"' EXIT
RUNDIR=$(dirname "$0")
RUNDIR=$(cd "$RUNDIR" && pwd)
TOP=$(cd "$RUNDIR/.." && pwd)
usage()
{
exitval=$1
errmsg=$2
if [ $exitval -ne 0 ] ; then
exec 1>&2
fi
if [ ! -z "$errmsg" ] ; then
echo "ERROR: $errmsg" 1>&2
fi
cat <<EOF
Usage: $0 [-h] [-v] [--build] [--run] [--compare] ...XAX...
EOF
exit $extival
}
before_arg=
after_arg=
do_all=1
do_build=0
do_run=0
do_compare=0
while [ $# -gt 0 ] ; do
case "$1" in
--before)
before_arg=$2
shift
;;
--after)
after_arg=$2
shift
;;
--build)
do_all=0
do_build=1
;;
--run)
do_all=0
do_run=1
;;
--compare)
do_all=0
do_compare=1
;;
-h)
usage 0 ""
;;
-v)
set -x
;;
*)
usage 1 "Unknown args: $*"
;;
esac
shift
done
WORK="${RUNDIR}/work"
mkdir -p "${WORK}"
DATA="${RUNDIR}/data"
mkdir -p "${DATA}"
for file in citm_catalog.json twitter.json canada.json ; do
if [ ! -r "${DATA}/${file}" ] ; then
echo "Fetching ${file} from github.com/mloskot/json_benchmark"
URL="https://github.com/mloskot/json_benchmark/raw/master/data/${file}"
curl -s -L -o "${DATA}/${file}" "$URL"
fi
done
echo
# Identify "after" commit hash, in order of preference
if [ ! -z "$after_arg" -a -d "$after_arg" ] ; then
# Use provided directory
after_src_dir="$after_arg"
after_commit=
echo "Using provided directory [$after_arg] as 'after'"
else
_commit=
if [ ! -z "$after_arg" ] ; then
# Use provided commit hash
_commit=$(git rev-parse --verify "$after_arg")
fi
if [ ! -z "$_commit" ] ;then
after_src_dir= # i.e. current tree
after_commit="$_commit"
echo "Using provided commit [$after_arg => $_commit] as 'after'"
else
# Local changes in current working directory
# ${cur_branch}
after_src_dir=$TOP
after_commit=
echo "Using local changes in $TOP as 'after'"
fi
fi
# Identify "before" commit hash, in order of preference
if [ ! -z "$before_arg" -a -d "$before_arg" ] ; then
# Use provided directory
before_src_dir="$before_arg"
before_commit=
echo "Using provided directory [$before_arg] as 'before'"
else
_commit=
if [ ! -z "$before_arg" ] ; then
# Use provided commit hash
_commit=$(git rev-parse --verify "$before_arg")
fi
if [ ! -z "$_commit" ] ;then
before_src_dir= # i.e. current tree
before_commit="$_commit"
echo "Using provided commit [$before_arg => $_commit] as 'before'"
else
# Use origin/${cur_branch}, if different from ${after_commit}
_cur_branch=$(git rev-parse --abbrev-ref HEAD)
_commit=
if [ ! -z "${_cur_branch}" ] ; then
_commit=$(git rev-parse --verify "origin/${_cur_branch}")
echo "Using origin/${_cur_branch} [$_commit] as 'before'"
fi
if [ "$_commit" = "${after_commit}" ] ; then
_commit=
fi
fi
if [ ! -z "$_commit" ] ; then
before_src_dir= # i.e. current tree
before_commit="$_commit"
else
# Use previous release
before_src_dir= # i.e. current tree
before_commit="$(git tag | sort | tail -1)"
echo "Using previous release [$before_commit] as 'before'"
fi
fi
echo
compile_benchmark()
{
local bname=$1
local src_dir="$2"
local src_commit="$3"
local build_dir="${WORK}/$bname/build"
local inst_dir="${WORK}/$bname/install"
local bench_dir="${WORK}/$bname/bench"
echo
echo "=========== $bname ==========="
echo
mkdir -p "${build_dir}"
mkdir -p "${inst_dir}"
mkdir -p "${bench_dir}"
if [ ! -z "$src_commit" ] ; then
# Resolve the short hash, tag or branch name to full hash
src_commit=$(git rev-parse $src_commit)
fi
# No src dir specified, clone and checkout $src_commit
if [ -z "$src_dir" ] ; then
src_dir="${WORK}/$bname/src"
echo "=== Using sources in $src_dir"
mkdir -p "$src_dir"
at_commit=$(git --git-dir="$src_dir/.git" rev-parse HEAD 2> /dev/null || true)
echo "at_commit: $at_commit"
if [ -z "$at_commit" ] ; then
# Assume it's an empty dir
git clone -n "$TOP" "$src_dir"
fi
git -C "$src_dir" --git-dir="$src_dir/.git" checkout "$src_commit"
fi
# else, use the provided $src_dir
if [ -e "${src_dir}/CMakeLists.txt" ] ; then
cd "${build_dir}"
cmake -DCMAKE_INSTALL_PREFIX="${inst_dir}" "${src_dir}"
else
# Old versions of json-c used automake/autoconf
cd "${src_dir}"
sh autogen.sh # always run it, configure doesn't always work
cd "${build_dir}"
"${src_dir}/configure" --prefix="${inst_dir}"
fi
make all install
cd "${bench_dir}"
cmake -DCMAKE_PREFIX_PATH="${inst_dir}" "${TOP}/apps"
make all
}
# XXX TODO: name "after" and "before" uniquely using the dir & commit
if [ $do_all -ne 0 -o $do_build -ne 0 ] ; then
sleep 5 # Wait slightly, to allow the human to read the message
# about what exactly we're doing to benchmark.
compile_benchmark "after" "${after_src_dir}" "${after_commit}"
compile_benchmark "before" "${before_src_dir}" "${before_commit}"
fi
run_benchmark()
{
local bname=$1
local inst_dir="${WORK}/$bname/install"
local bench_dir="${WORK}/$bname/bench"
local INPUT=${DATA}/canada.json
cd "${bench_dir}"
mkdir -p results
(time ./json_parse -n "${INPUT}") > results/basic_timing.out 2>&1
valgrind --tool=massif --massif-out-file=massif.out ./json_parse -n "${INPUT}"
ms_print massif.out > results/ms_print.out
heaptrack -o heaptrack_out ./json_parse -n "${INPUT}"
heaptrack --analyze heaptrack_out.gz -H histogram.out > results/heaptrack.out
awk ' { s=$1; count=$2; ru=(int((s+ 15) / 16)) * 16; wasted = ((ru-s)*count); print s, count, ru-s, wasted; total=total+wasted} END { print "Total: ", total }' histogram.out > results/histogram2.out
# XXX stamp some info about what was built & run into ./results/.
echo "DONE with $bname"
}
if [ $do_all -ne 0 -o $do_run -ne 0 ] ; then
run_benchmark "after"
run_benchmark "before"
fi
if [ $do_compare -ne 0 ] ; then
# XXX this needs better analysis
cd "${WORK}"
diff -udr before/bench/results after/bench/results || true
else
echo "To compare results, run:"
echo "$0 --compare"
fi
trap '' EXIT
:<<=cut
Benchmarks to run:
* Parse JSON strings, of various sizes and characteristics
* Flags: STRICT vs. non-STRICT, validate UTF8
* Serialization time
* plain, spaces, pretty
* json_c_visit tests
* JSON pointer tests
Things to record and compare:
* Running time
* Peak memory usage
* Useful bytes vs. overhead for memory allocations
* Total number of allocations
* Average allocation size
* Log of all allocation sizes
=cut

28
bits.h
View File

@@ -1,28 +0,0 @@
/*
* $Id: bits.h,v 1.10 2006/01/30 23:07:57 mclark Exp $
*
* Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
* Michael Clark <michael@metaparadigm.com>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*
*/
#ifndef _bits_h_
#define _bits_h_
#ifndef json_min
#define json_min(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef json_max
#define json_max(a,b) ((a) > (b) ? (a) : (b))
#endif
#define hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)
#define error_ptr(error) ((void*)error)
#define error_description(error) (json_tokener_errors[error])
#define is_error(ptr) (ptr == NULL)
#endif

100
cmake-configure Executable file
View File

@@ -0,0 +1,100 @@
#!/bin/bash
# Wrapper around cmake to emulate useful options
# from the previous autoconf-based configure script.
RUNDIR=$(dirname "$0")
RUNDIR=$(cd "$RUNDIR" && pwd)
CURDIR=$(pwd)
FLAGS=()
usage()
{
exitval="$1"
errmsg="$2"
if [ $exitval -ne 0 ] ; then
exec 1>&2
fi
if [ ! -z "$errmsg" ] ; then
echo "ERROR: $errmsg" 1>&2
fi
cat <<EOF
$0 [<configure_options>] [-- [<cmake options>]]
--prefix=PREFIX install architecture-independent files in PREFIX
--enable-threading Enable code to support partly multi-threaded use
--enable-rdrand Enable RDRAND Hardware RNG Hash Seed generation on
supported x86/x64 platforms.
--enable-shared build shared libraries [default=yes]
--enable-static build static libraries [default=yes]
--disable-Bsymbolic Avoid linking with -Bsymbolic-function
--disable-werror Avoid treating compiler warnings as fatal errors
--disable-extra-libs Avoid linking against extra libraries, such as libbsd
EOF
exit
}
if [ "$CURDIR" = "$RUNDIR" ] ; then
usage 1 "Please mkdir some other build directory, and run this script from there."
fi
if ! cmake --version ; then
usage 1 "Unable to find a working cmake, please be sure you have it installed and on your PATH"
fi
while [ $# -gt 0 ] ; do
case "$1" in
-h|--help)
usage 0
;;
--prefix)
FLAGS+=(-DCMAKE_INSTALL_PREFIX="$2")
shift
;;
--prefix=*)
FLAGS+=(-DCMAKE_INSTALL_PREFIX="${1##--prefix=}")
;;
--enable-threading)
FLAGS+=(-DENABLE_THREADING=ON)
;;
--enable-rdrand)
FLAGS+=(-DENABLE_RDRAND=ON)
;;
--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)
;;
--disable-werror)
FLAGS+=(-DDISABLE_WERROR=ON)
;;
--disable-extra-libs)
FLAGS+=(-DDISABLE_EXTRA_LIBS=ON)
;;
--)
shift
break
;;
-*)
usage 1 "Unknown arguments: $*"
;;
*)
break
;;
esac
shift
done
exec cmake "${FLAGS[@]}" "$@" "${RUNDIR}"

4
cmake/Config.cmake.in Normal file
View File

@@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
check_required_components("@PROJECT_NAME@")

231
cmake/config.h.in Normal file
View File

@@ -0,0 +1,231 @@
/* Enable RDRAND Hardware RNG Hash Seed */
#cmakedefine ENABLE_RDRAND "@ENABLE_RDRAND@"
/* Override json_c_get_random_seed() with custom code */
#cmakedefine OVERRIDE_GET_RANDOM_SEED @OVERRIDE_GET_RANDOM_SEED@
/* Enable partial threading support */
#cmakedefine ENABLE_THREADING "@@"
/* Define if .gnu.warning accepts long strings. */
#cmakedefine HAS_GNU_WARNING_LONG "@@"
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H
/* Define to 1 if you have the <endian.h> header file. */
#cmakedefine HAVE_ENDIAN_H
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H
/* Define to 1 if you have the <limits.h> header file. */
#cmakedefine HAVE_LIMITS_H
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H
/* Define to 1 if you have the <stdarg.h> header file. */
#cmakedefine HAVE_STDARG_H
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H
/* Define to 1 if you have the <syslog.h> header file. */
#cmakedefine HAVE_SYSLOG_H @HAVE_SYSLOG_H@
/* Define to 1 if you have the <sys/cdefs.h> header file. */
#cmakedefine HAVE_SYS_CDEFS_H
/* Define to 1 if you have the <sys/param.h> header file. */
#cmakedefine HAVE_SYS_PARAM_H @HAVE_SYS_PARAM_H@
/* Define to 1 if you have the <sys/random.h> header file. */
#cmakedefine HAVE_SYS_RANDOM_H
/* Define to 1 if you have the <sys/resource.h> header file. */
#cmakedefine HAVE_SYS_RESOURCE_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
/* Define to 1 if you have the <xlocale.h> header file. */
#cmakedefine HAVE_XLOCALE_H
/* Define to 1 if you have the <bsd/stdlib.h> header file. */
#cmakedefine HAVE_BSD_STDLIB_H
/* Define to 1 if you have `arc4random' */
#cmakedefine HAVE_ARC4RANDOM
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#cmakedefine HAVE_DOPRNT
/* Has atomic builtins */
#cmakedefine HAVE_ATOMIC_BUILTINS
/* Define to 1 if you have the declaration of `INFINITY', and to 0 if you
don't. */
#cmakedefine HAVE_DECL_INFINITY
/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
*/
#cmakedefine HAVE_DECL_ISINF
/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
*/
#cmakedefine HAVE_DECL_ISNAN
/* Define to 1 if you have the declaration of `nan', and to 0 if you don't. */
#cmakedefine HAVE_DECL_NAN
/* Define to 1 if you have the declaration of `_finite', and to 0 if you
don't. */
#cmakedefine HAVE_DECL__FINITE
/* Define to 1 if you have the declaration of `_isnan', and to 0 if you don't.
*/
#cmakedefine HAVE_DECL__ISNAN
/* Define to 1 if you have the `open' function. */
#cmakedefine HAVE_OPEN
/* Define to 1 if you have the `realloc' function. */
#cmakedefine HAVE_REALLOC
/* Define to 1 if you have the `setlocale' function. */
#cmakedefine HAVE_SETLOCALE
/* Define to 1 if you have the `snprintf' function. */
#cmakedefine HAVE_SNPRINTF
/* Define to 1 if you have the `strcasecmp' function. */
#cmakedefine HAVE_STRCASECMP @HAVE_STRCASECMP@
/* Define to 1 if you have the `strdup' function. */
#cmakedefine HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#cmakedefine HAVE_STRERROR
/* Define to 1 if you have the `strncasecmp' function. */
#cmakedefine HAVE_STRNCASECMP @HAVE_STRNCASECMP@
/* 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
/* Define to 1 if you have the `vprintf' function. */
#cmakedefine HAVE_VPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#cmakedefine HAVE_VSNPRINTF
/* Define to 1 if you have the `vsyslog' function. */
#cmakedefine HAVE_VSYSLOG @HAVE_VSYSLOG@
/* Define if you have the `getrandom' function. */
#cmakedefine HAVE_GETRANDOM
/* Define if you have the `getrusage' function. */
#cmakedefine HAVE_GETRUSAGE
#cmakedefine HAVE_STRTOLL
#if !defined(HAVE_STRTOLL)
#define strtoll @json_c_strtoll@
/* #cmakedefine json_c_strtoll @json_c_strtoll@*/
#endif
#cmakedefine HAVE_STRTOULL
#if !defined(HAVE_STRTOULL)
#define strtoull @json_c_strtoull@
/* #cmakedefine json_c_strtoull @json_c_strtoull@ */
#endif
/* Have __thread */
#cmakedefine HAVE___THREAD
/* Public define for json_inttypes.h */
#cmakedefine JSON_C_HAVE_INTTYPES_H @JSON_C_HAVE_INTTYPES_H@
/* Name of package */
#define PACKAGE "@PROJECT_NAME@"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "@JSON_C_BUGREPORT@"
/* Define to the full name of this package. */
#define PACKAGE_NAME "@PROJECT_NAME@"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "@PROJECT_NAME@ @CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "@PROJECT_NAME@"
/* Define to the home page for this package. */
#define PACKAGE_URL "https://github.com/json-c/json-c"
/* Define to the version of this package. */
#define PACKAGE_VERSION "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
/* The number of bytes in type int */
#cmakedefine SIZEOF_INT @SIZEOF_INT@
/* The number of bytes in type int64_t */
#cmakedefine SIZEOF_INT64_T @SIZEOF_INT64_T@
/* The number of bytes in type long */
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
/* The number of bytes in type long long */
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
/* The number of bytes in type size_t */
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
/* The number of bytes in type ssize_t */
#cmakedefine SIZEOF_SSIZE_T @SIZEOF_SSIZE_T@
/* Specifier for __thread */
#cmakedefine SPEC___THREAD @SPEC___THREAD@
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine STDC_HEADERS
/* Version number of package */
#define VERSION "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
/* Define to empty if `const' does not conform to ANSI C. */
#cmakedefine const
/* Define to `unsigned int' if <sys/types.h> does not define. */
#cmakedefine size_t

5
cmake/json_config.h.in Normal file
View File

@@ -0,0 +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

@@ -1,148 +0,0 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define if .gnu.warning accepts long strings. */
#undef HAS_GNU_WARNING_LONG
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `open' function. */
#undef HAVE_OPEN
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#undef HAVE_REALLOC
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define to 1 if you have the <sys/cdefs.h> header file. */
#undef HAVE_SYS_CDEFS_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define to 1 if you have the `vsyslog' function. */
#undef HAVE_VSYSLOG
/* Public define for json_inttypes.h */
#undef JSON_C_HAVE_INTTYPES_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to rpl_realloc if the replacement function should be used. */
#undef realloc
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

View File

@@ -1,94 +0,0 @@
/*
* $Id: config.h.win32,v 1.2 2006/01/26 02:16:28 mclark Exp $
*
* Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
* Michael Clark <michael@metaparadigm.com>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*
*/
/* config.h.win32 Generated by configure. */
#define PACKAGE_STRING "JSON C Library 0.2"
#define PACKAGE_BUGREPORT "json-c@googlegroups.com"
#define PACKAGE_NAME "JSON C Library"
#define PACKAGE_TARNAME "json-c"
#define PACKAGE_VERSION "0.2"
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#define HAVE_MALLOC 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `open' function. */
#undef HAVE_OPEN
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#define HAVE_REALLOC 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define to 1 if you have the `vsyslog' function. */
#undef HAVE_VSYSLOG
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

View File

@@ -1,69 +0,0 @@
AC_PREREQ(2.52)
# Process this file with autoconf to produce a configure script.
AC_INIT([json-c], 0.10.99, [json-c@googlegroups.com])
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AC_PROG_MAKE_SET
AC_ARG_ENABLE(oldname-compat,
AS_HELP_STRING([--disable-oldname-compat],
[Don't include the old libjson.so library and include/json directory.]),
[],
[enable_oldname_compat=yes]
)
AM_CONDITIONAL(ENABLE_OLDNAME_COMPAT, [test "x${enable_oldname_compat}" != "xno"])
# Checks for programs.
# Checks for libraries.
# Checks for header files.
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(json_config.h)
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h strings.h syslog.h unistd.h [sys/cdefs.h] [sys/param.h] stdarg.h locale.h)
AC_CHECK_HEADER(inttypes.h,[AC_DEFINE([JSON_C_HAVE_INTTYPES_H],[1],[Public define for json_inttypes.h])])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MEMCMP
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS(strcasecmp strdup strndup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale)
#check if .section.gnu.warning accepts long strings (for __warn_references)
AC_LANG_PUSH([C])
AC_MSG_CHECKING([if .gnu.warning accepts long strings])
AC_LINK_IFELSE([[
extern void json_object_get();
__asm__(".section .gnu.json_object_get,\n\t.ascii \"Please link against libjson-c instead of libjson\"\n\t.text");
int main(int c,char* v) {return 0;}
]], [
AC_DEFINE(HAS_GNU_WARNING_LONG, 1, [Define if .gnu.warning accepts long strings.])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
])
AC_LANG_POP([C])
AM_PROG_LIBTOOL
AC_CONFIG_FILES([
Makefile
json.pc
json-c.pc
tests/Makefile
json-c-uninstalled.pc
])
AC_OUTPUT

78
debug.c
View File

@@ -11,17 +11,17 @@
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#if HAVE_SYSLOG_H
# include <syslog.h>
#include <syslog.h>
#endif /* HAVE_SYSLOG_H */
#if HAVE_UNISTD_H
# include <unistd.h>
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#if HAVE_SYS_PARAM_H
@@ -33,66 +33,64 @@
static int _syslog = 0;
static int _debug = 0;
void mc_set_debug(int debug) { _debug = debug; }
int mc_get_debug(void) { return _debug; }
void mc_set_debug(int debug)
{
_debug = debug;
}
int mc_get_debug(void)
{
return _debug;
}
extern void mc_set_syslog(int syslog)
{
_syslog = syslog;
_syslog = syslog;
}
void mc_abort(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
#if HAVE_VSYSLOG
if(_syslog) {
vsyslog(LOG_ERR, msg, ap);
} else
#endif
vprintf(msg, ap);
va_end(ap);
exit(1);
}
void mc_debug(const char *msg, ...)
{
va_list ap;
if(_debug) {
va_start(ap, msg);
va_list ap;
if (_debug)
{
va_start(ap, msg);
#if HAVE_VSYSLOG
if(_syslog) {
vsyslog(LOG_DEBUG, msg, ap);
} else
if (_syslog)
{
vsyslog(LOG_DEBUG, msg, ap);
}
else
#endif
vprintf(msg, ap);
va_end(ap);
}
vprintf(msg, ap);
va_end(ap);
}
}
void mc_error(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
va_list ap;
va_start(ap, msg);
#if HAVE_VSYSLOG
if(_syslog) {
if (_syslog)
{
vsyslog(LOG_ERR, msg, ap);
} else
}
else
#endif
vfprintf(stderr, msg, ap);
va_end(ap);
va_end(ap);
}
void mc_info(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
va_list ap;
va_start(ap, msg);
#if HAVE_VSYSLOG
if(_syslog) {
if (_syslog)
{
vsyslog(LOG_INFO, msg, ap);
} else
}
else
#endif
vfprintf(stderr, msg, ap);
va_end(ap);
va_end(ap);
}

70
debug.h
View File

@@ -10,8 +10,12 @@
*
*/
#ifndef _DEBUG_H_
#define _DEBUG_H_
/**
* @file
* @brief Do not use, json-c internal, may be changed or removed at any time.
*/
#ifndef _JSON_C_DEBUG_H_
#define _JSON_C_DEBUG_H_
#include <stdlib.h>
@@ -19,14 +23,22 @@
extern "C" {
#endif
extern void mc_set_debug(int debug);
extern int mc_get_debug(void);
#ifndef JSON_EXPORT
#if defined(_MSC_VER) && defined(JSON_C_DLL)
#define JSON_EXPORT __declspec(dllexport)
#else
#define JSON_EXPORT extern
#endif
#endif
extern void mc_set_syslog(int syslog);
extern void mc_abort(const char *msg, ...);
extern void mc_debug(const char *msg, ...);
extern void mc_error(const char *msg, ...);
extern void mc_info(const char *msg, ...);
JSON_EXPORT void mc_set_debug(int debug);
JSON_EXPORT int mc_get_debug(void);
JSON_EXPORT void mc_set_syslog(int syslog);
JSON_EXPORT void mc_debug(const char *msg, ...);
JSON_EXPORT void mc_error(const char *msg, ...);
JSON_EXPORT void mc_info(const char *msg, ...);
#ifndef __STRING
#define __STRING(x) #x
@@ -34,21 +46,27 @@ extern void mc_info(const char *msg, ...);
#ifndef PARSER_BROKEN_FIXED
#define JASSERT(cond) do {} while(0)
#define JASSERT(cond) \
do \
{ \
} while (0)
#else
#define JASSERT(cond) do { \
if (!(cond)) { \
mc_error("cjson assert failure %s:%d : cond \"" __STRING(cond) "failed\n", __FILE__, __LINE__); \
*(int *)0 = 1;\
abort(); \
}\
} while(0)
#define JASSERT(cond) \
do \
{ \
if (!(cond)) \
{ \
mc_error("cjson assert failure %s:%d : cond \"" __STRING(cond) "failed\n", \
__FILE__, __LINE__); \
*(int *)0 = 1; \
abort(); \
} \
} while (0)
#endif
#define MC_ABORT(x, ...) mc_abort(x, ##__VA_ARGS__)
#define MC_ERROR(x, ...) mc_error(x, ##__VA_ARGS__)
#ifdef MC_MAINTAINER_MODE
@@ -58,11 +76,19 @@ extern void mc_info(const char *msg, ...);
#define MC_DEBUG(x, ...) mc_debug(x, ##__VA_ARGS__)
#define MC_INFO(x, ...) mc_info(x, ##__VA_ARGS__)
#else
#define MC_SET_DEBUG(x) if (0) mc_set_debug(x)
#define MC_SET_DEBUG(x) \
if (0) \
mc_set_debug(x)
#define MC_GET_DEBUG() (0)
#define MC_SET_SYSLOG(x) if (0) mc_set_syslog(x)
#define MC_DEBUG(x, ...) if (0) mc_debug(x, ##__VA_ARGS__)
#define MC_INFO(x, ...) if (0) mc_info(x, ##__VA_ARGS__)
#define MC_SET_SYSLOG(x) \
if (0) \
mc_set_syslog(x)
#define MC_DEBUG(x, ...) \
if (0) \
mc_debug(x, ##__VA_ARGS__)
#define MC_INFO(x, ...) \
if (0) \
mc_info(x, ##__VA_ARGS__)
#endif
#ifdef __cplusplus

16
doc/CMakeLists.txt Normal file
View File

@@ -0,0 +1,16 @@
# generate doxygen documentation for json-c API
find_package(Doxygen)
if (DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
message(STATUS "Wrote ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
else (DOXYGEN_FOUND)
message("Warning: doxygen not found, the 'doc' target will not be included")
endif(DOXYGEN_FOUND)

2366
doc/Doxyfile.in Normal file

File diff suppressed because it is too large Load Diff

6
doc/fixup_markdown.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
#
# Doxygen markdown doesn't support triple-backticks like github does.
# Convert all of those to space-prefixed blocks instead.
#
awk '/```/ { prefix=!prefix; print ""; next; } { if (prefix) { printf " "; } print $0; } ' "$@"

57
doc/html/README_8md.html Normal file
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: README.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">README.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>

71
doc/html/annotated.html Normal file
View File

@@ -0,0 +1,71 @@
<!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: Data Structures</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 class="current"><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="headertitle">
<div class="title">Data Structures</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the data structures with brief descriptions:</div><div class="directory">
<table class="directory">
<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__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 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>

483
doc/html/arraylist_8h.html Normal file
View File

@@ -0,0 +1,483 @@
<!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: arraylist.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="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">arraylist.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Internal methods for working with json_type_array objects. Although this is exposed by the <a class="el" href="json__object_8h.html#a23d20e3f886c1638a7116be66b7b5ec2">json_object_get_array()</a> method, it is not recommended for direct use.
<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="structarray__list.html">array_list</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="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:acd30d910b398421574eb1f59e78617f5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#acd30d910b398421574eb1f59e78617f5">ARRAY_LIST_DEFAULT_SIZE</a>&#160;&#160;&#160;32</td></tr>
<tr class="separator:acd30d910b398421574eb1f59e78617f5"><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:aad83e4ed3c8ea274e6f18459276d774b"><td class="memItemLeft" align="right" valign="top">typedef void(&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#aad83e4ed3c8ea274e6f18459276d774b">array_list_free_fn</a> )(void *data)</td></tr>
<tr class="separator:aad83e4ed3c8ea274e6f18459276d774b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d6d32d8b026ea2025df519b9e90f44a"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structarray__list.html">array_list</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#a6d6d32d8b026ea2025df519b9e90f44a">array_list</a></td></tr>
<tr class="separator:a6d6d32d8b026ea2025df519b9e90f44a"><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:a0d4bfac055dfd98e17296142abf4d894"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structarray__list.html">array_list</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#a0d4bfac055dfd98e17296142abf4d894">array_list_new</a> (<a class="el" href="arraylist_8h.html#aad83e4ed3c8ea274e6f18459276d774b">array_list_free_fn</a> *free_fn)</td></tr>
<tr class="separator:a0d4bfac055dfd98e17296142abf4d894"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3e43dc68f5d1815f3aaa36916602e45"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structarray__list.html">array_list</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#ae3e43dc68f5d1815f3aaa36916602e45">array_list_new2</a> (<a class="el" href="arraylist_8h.html#aad83e4ed3c8ea274e6f18459276d774b">array_list_free_fn</a> *free_fn, int initial_size)</td></tr>
<tr class="separator:ae3e43dc68f5d1815f3aaa36916602e45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd00fb70f7ca82f23b48b812c3498f67"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#acd00fb70f7ca82f23b48b812c3498f67">array_list_free</a> (struct <a class="el" href="structarray__list.html">array_list</a> *al)</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>
<tr class="separator:a6e995608aa464244ff3184fb43574dc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3bf90f47aa210032304b14e7ad09ef7"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#aa3bf90f47aa210032304b14e7ad09ef7">array_list_length</a> (struct <a class="el" href="structarray__list.html">array_list</a> *al)</td></tr>
<tr class="separator:aa3bf90f47aa210032304b14e7ad09ef7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb67cc8e2e5c9be41c3e644536079169"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#afb67cc8e2e5c9be41c3e644536079169">array_list_sort</a> (struct <a class="el" href="structarray__list.html">array_list</a> *arr, int(*compar)(const void *, const void *))</td></tr>
<tr class="separator:afb67cc8e2e5c9be41c3e644536079169"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5d066b971fee72ce80084c1694109e3"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#ac5d066b971fee72ce80084c1694109e3">array_list_bsearch</a> (const void **key, struct <a class="el" href="structarray__list.html">array_list</a> *arr, int(*compar)(const void *, const void *))</td></tr>
<tr class="separator:ac5d066b971fee72ce80084c1694109e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aecedd8601ee96e2fd8eff5d83fda89ab"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#aecedd8601ee96e2fd8eff5d83fda89ab">array_list_del_idx</a> (struct <a class="el" href="structarray__list.html">array_list</a> *arr, size_t idx, size_t count)</td></tr>
<tr class="separator:aecedd8601ee96e2fd8eff5d83fda89ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff21b2a00573f8f0085b81ce1de1a850"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arraylist_8h.html#aff21b2a00573f8f0085b81ce1de1a850">array_list_shrink</a> (struct <a class="el" href="structarray__list.html">array_list</a> *arr, size_t empty_slots)</td></tr>
<tr class="separator:aff21b2a00573f8f0085b81ce1de1a850"><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>Internal methods for working with json_type_array objects. Although this is exposed by the <a class="el" href="json__object_8h.html#a23d20e3f886c1638a7116be66b7b5ec2">json_object_get_array()</a> method, it is not recommended for direct use. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="acd30d910b398421574eb1f59e78617f5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ARRAY_LIST_DEFAULT_SIZE&#160;&#160;&#160;32</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a6d6d32d8b026ea2025df519b9e90f44a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="structarray__list.html">array_list</a> <a class="el" href="structarray__list.html">array_list</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="aad83e4ed3c8ea274e6f18459276d774b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void( array_list_free_fn)(void *data)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6e995608aa464244ff3184fb43574dc8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int array_list_add </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">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="ac5d066b971fee72ce80084c1694109e3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* array_list_bsearch </td>
<td>(</td>
<td class="paramtype">const void **&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structarray__list.html">array_list</a> *&#160;</td>
<td class="paramname"><em>arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int(*)(const void *, const void *)&#160;</td>
<td class="paramname"><em>compar</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="aecedd8601ee96e2fd8eff5d83fda89ab"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int array_list_del_idx </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structarray__list.html">array_list</a> *&#160;</td>
<td class="paramname"><em>arr</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">size_t&#160;</td>
<td class="paramname"><em>count</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="acd00fb70f7ca82f23b48b812c3498f67"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void array_list_free </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><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a114f1af5b20b76a3dbb2d1d055006df8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* array_list_get_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>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></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>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t array_list_length </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><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a0d4bfac055dfd98e17296142abf4d894"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="structarray__list.html">array_list</a>* array_list_new </td>
<td>(</td>
<td class="paramtype"><a class="el" href="arraylist_8h.html#aad83e4ed3c8ea274e6f18459276d774b">array_list_free_fn</a> *&#160;</td>
<td class="paramname"><em>free_fn</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocate an <a class="el" href="structarray__list.html">array_list</a> of the default size (32). </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>Use <a class="el" href="arraylist_8h.html#ae3e43dc68f5d1815f3aaa36916602e45">array_list_new2()</a> instead. </dd></dl>
</div>
</div>
<a class="anchor" id="ae3e43dc68f5d1815f3aaa36916602e45"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="structarray__list.html">array_list</a>* array_list_new2 </td>
<td>(</td>
<td class="paramtype"><a class="el" href="arraylist_8h.html#aad83e4ed3c8ea274e6f18459276d774b">array_list_free_fn</a> *&#160;</td>
<td class="paramname"><em>free_fn</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>initial_size</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocate an <a class="el" href="structarray__list.html">array_list</a> of the desired size.</p>
<p>If possible, the size should be chosen to closely match the actual number of elements expected to be used. If the exact size is unknown, there are tradeoffs to be made:</p>
<ul>
<li>too small - the <a class="el" href="structarray__list.html">array_list</a> code will need to call realloc() more often (which might incur an additional memory copy).</li>
<li>too large - will waste memory, but that can be mitigated by calling <a class="el" href="arraylist_8h.html#aff21b2a00573f8f0085b81ce1de1a850">array_list_shrink()</a> once the final size is known.</li>
</ul>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="arraylist_8h.html#aff21b2a00573f8f0085b81ce1de1a850">array_list_shrink</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a9f92076e9d8229f8a07e536dc286f811"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int array_list_put_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="aff21b2a00573f8f0085b81ce1de1a850"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int array_list_shrink </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structarray__list.html">array_list</a> *&#160;</td>
<td class="paramname"><em>arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>empty_slots</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Shrink the array list to just enough to fit the number of elements in it, plus empty_slots. </p>
</div>
</div>
<a class="anchor" id="afb67cc8e2e5c9be41c3e644536079169"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void array_list_sort </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structarray__list.html">array_list</a> *&#160;</td>
<td class="paramname"><em>arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int(*)(const void *, const void *)&#160;</td>
<td class="paramname"><em>compar</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>

BIN
doc/html/bc_s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

BIN
doc/html/bdwn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

72
doc/html/classes.html Normal file
View File

@@ -0,0 +1,72 @@
<!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: Data Structure Index</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="headertitle">
<div class="title">Data Structure Index</div> </div>
</div><!--header-->
<div class="contents">
<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="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__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 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 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>

BIN
doc/html/closed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

95
doc/html/deprecated.html Normal file
View File

@@ -0,0 +1,95 @@
<!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: Deprecated List</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 class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Deprecated List </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="reflist">
<dt><a class="anchor" id="_deprecated000001"></a>Global <a class="el" href="arraylist_8h.html#a0d4bfac055dfd98e17296142abf4d894">array_list_new</a> (array_list_free_fn *free_fn)</dt>
<dd>Use <a class="el" href="arraylist_8h.html#ae3e43dc68f5d1815f3aaa36916602e45">array_list_new2()</a> instead. </dd>
<dt><a class="anchor" id="_deprecated000008"></a>Global <a class="el" href="json__util_8h.html#a3f0f0b8f29a41b47d62e6c867707be50">json_parse_double</a> (const char *buf, double *retval)</dt>
<dd></dd>
<dt><a class="anchor" id="_deprecated000004"></a>Global <a class="el" href="json__tokener_8h.html#a4dd5e5b65aee7f376f529f86b210ff49">json_tokener</a> </dt>
<dd>Unused in json-c code </dd>
<dt><a class="anchor" id="_deprecated000006"></a>Global <a class="el" href="structjson__tokener.html#a9daae2516fd6df23555d33ef01020a76">json_tokener::char_offset</a> </dt>
<dd>See <a class="el" href="json__tokener_8h.html#a4a2fa28d815f8b370cbb00b80ebc0f1d">json_tokener_get_parse_end()</a> instead. </dd>
<dt><a class="anchor" id="_deprecated000007"></a>Global <a class="el" href="structjson__tokener.html#adef37cdc2578d8f8920db14315728cbd">json_tokener::err</a> </dt>
<dd>See <a class="el" href="json__tokener_8h.html#af5d7ffd95a0f6e5d5bb5994d233b4197">json_tokener_get_error()</a> instead. </dd>
<dt><a class="anchor" id="_deprecated000005"></a>Global <a class="el" href="structjson__tokener.html#a9772e2170322a19d8da6ce5d7dc46895">json_tokener::str</a> </dt>
<dd>Do not access any of these fields outside of json_tokener.c </dd>
<dt><a class="anchor" id="_deprecated000003"></a>Class <a class="el" href="structjson__tokener__srec.html">json_tokener_srec</a> </dt>
<dd>Don't use this outside of json_tokener.c, it will be made private in a future release. </dd>
<dt><a class="anchor" id="_deprecated000002"></a>Global <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2">json_tokener_state</a> </dt>
<dd>Don't use this outside of json_tokener.c, it will be made private in a future release. </dd>
<dt><a class="anchor" id="_deprecated000011"></a>Global <a class="el" href="structlh__entry.html#a79d9f1ef0dc444e17105aaeaf167e22c">lh_entry::k</a> </dt>
<dd>Use <a class="el" href="linkhash_8h.html#a82e5d699ba2fd4c520352c003f8554a5">lh_entry_k()</a> instead of accessing this directly. </dd>
<dt><a class="anchor" id="_deprecated000012"></a>Global <a class="el" href="structlh__entry.html#a14f40cc124c32b03f81151ae7934d2e7">lh_entry::k_is_constant</a> </dt>
<dd>use <a class="el" href="linkhash_8h.html#a724c308f1c606271ea3deb01ed9e3cc9">lh_entry_k_is_constant()</a> instead. </dd>
<dt><a class="anchor" id="_deprecated000014"></a>Global <a class="el" href="structlh__entry.html#a7c40c46e72d9a0ba071a8d49d535bc67">lh_entry::next</a> </dt>
<dd>Use <a class="el" href="linkhash_8h.html#a603f6f2cc6d292a160b09b357c7a0a69">lh_entry_next()</a> instead of accessing this directly. </dd>
<dt><a class="anchor" id="_deprecated000015"></a>Global <a class="el" href="structlh__entry.html#a6fb9c3de01fb5af67d8d429921cc6a3b">lh_entry::prev</a> </dt>
<dd>Use <a class="el" href="linkhash_8h.html#a965145d36d3e00eae825c692205d2f81">lh_entry_prev()</a> instead of accessing this directly. </dd>
<dt><a class="anchor" id="_deprecated000013"></a>Global <a class="el" href="structlh__entry.html#a1b676732ab2ad3eeaedf6ec60a6a0835">lh_entry::v</a> </dt>
<dd>Use <a class="el" href="linkhash_8h.html#ab163f65568af863f3738ccd05900745e">lh_entry_v()</a> instead of accessing this directly. </dd>
<dt><a class="anchor" id="_deprecated000017"></a>Global <a class="el" href="structlh__table.html#aa172ed8fe205367b54e0e2cdf9ea8c6c">lh_table::count</a> </dt>
<dd>Use <a class="el" href="linkhash_8h.html#ac9ba631c91fe80fb905f04c7cd526f2b">lh_table_length()</a> instead. </dd>
<dt><a class="anchor" id="_deprecated000023"></a>Global <a class="el" href="structlh__table.html#aa646c287a6a46e09da6c7457c981a359">lh_table::equal_fn</a> </dt>
<dd>do not use outside of linkhash.c </dd>
<dt><a class="anchor" id="_deprecated000021"></a>Global <a class="el" href="structlh__table.html#a30ea5903f4f8126abd6aa489ffe14737">lh_table::free_fn</a> </dt>
<dd>do not use outside of linkhash.c </dd>
<dt><a class="anchor" id="_deprecated000022"></a>Global <a class="el" href="structlh__table.html#a1488d1a4a320b1a9bb2f441859544be1">lh_table::hash_fn</a> </dt>
<dd>do not use outside of linkhash.c </dd>
<dt><a class="anchor" id="_deprecated000018"></a>Global <a class="el" href="structlh__table.html#aa7d986a3b12a9fa47e349713794c30fb">lh_table::head</a> </dt>
<dd>Use <a class="el" href="linkhash_8h.html#a3bacf1f7c40830c20440fd95d493f35f">lh_table_head()</a> instead. </dd>
<dt><a class="anchor" id="_deprecated000016"></a>Global <a class="el" href="structlh__table.html#ae251575ec2935bcb0e0589ca8e243839">lh_table::size</a> </dt>
<dd>do not use outside of linkhash.c </dd>
<dt><a class="anchor" id="_deprecated000020"></a>Global <a class="el" href="structlh__table.html#a4fd9c5aba38791b26ab0ec614a5caf8f">lh_table::table</a> </dt>
<dd>do not use outside of linkhash.c </dd>
<dt><a class="anchor" id="_deprecated000019"></a>Global <a class="el" href="structlh__table.html#a479895e45db2bdf9bf5d173fa4b7e277">lh_table::tail</a> </dt>
<dd>Do not use, may be removed in a future release. </dd>
</dl>
</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

@@ -0,0 +1,62 @@
<!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: /home/erh/distcheck Directory 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><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_b62156a74b5a818be0c2ef9f85294b95.html">distcheck</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">distcheck Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:json_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html">json.h</a></td></tr>
<tr class="memdesc:json_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">A convenience header that may be included instead of other individual ones. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</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>

1172
doc/html/doxygen.css Normal file

File diff suppressed because it is too large Load Diff

BIN
doc/html/doxygen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

78
doc/html/dynsections.js Normal file
View File

@@ -0,0 +1,78 @@
function toggleVisibility(linkObj)
{
var base = $(linkObj).attr('id');
var summary = $('#'+base+'-summary');
var content = $('#'+base+'-content');
var trigger = $('#'+base+'-trigger');
var src=$(trigger).attr('src');
if (content.is(':visible')===true) {
content.hide();
summary.show();
$(linkObj).addClass('closed').removeClass('opened');
$(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
} else {
content.show();
summary.hide();
$(linkObj).removeClass('closed').addClass('opened');
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
}
return false;
}
function updateStripes()
{
$('table.directory tr').
removeClass('even').filter(':visible:even').addClass('even');
}
function toggleLevel(level)
{
$('table.directory tr').each(function(){
var l = this.id.split('_').length-1;
var i = $('#img'+this.id.substring(3));
var a = $('#arr'+this.id.substring(3));
if (l<level+1) {
i.attr('src','ftv2folderopen.png');
a.attr('src','ftv2mnode.png');
$(this).show();
} else if (l==level+1) {
i.attr('src','ftv2folderclosed.png');
a.attr('src','ftv2pnode.png');
$(this).show();
} else {
$(this).hide();
}
});
updateStripes();
}
function toggleFolder(id)
{
var n = $('[id^=row_'+id+']');
var i = $('[id^=img_'+id+']');
var a = $('[id^=arr_'+id+']');
var c = n.slice(1);
if (c.filter(':first').is(':visible')===true) {
i.attr('src','ftv2folderclosed.png');
a.attr('src','ftv2pnode.png');
c.hide();
} else {
i.attr('src','ftv2folderopen.png');
a.attr('src','ftv2mnode.png');
c.show();
}
updateStripes();
}
function toggleInherit(id)
{
var rows = $('tr.inherit.'+id);
var img = $('tr.inherit_header.'+id+' img');
var src = $(img).attr('src');
if (rows.filter(':first').is(':visible')===true) {
rows.css('display','none');
$(img).attr('src',src.substring(0,src.length-8)+'closed.png');
} else {
rows.css('display','table-row'); // using show() causes jump in firefox
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
}
}

77
doc/html/files.html Normal file
View File

@@ -0,0 +1,77 @@
<!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: File List</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 class="current"><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">File List</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here is a list of all files with brief descriptions:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><img id="arr_0_" src="ftv2mnode.png" alt="o" width="16" height="22" onclick="toggleFolder('0_')"/><img id="img_0_" src="ftv2folderopen.png" alt="-" width="24" height="22" onclick="toggleFolder('0_')"/><a class="el" href="dir_b62156a74b5a818be0c2ef9f85294b95.html" target="_self">distcheck</a></td><td class="desc"></td></tr>
<tr id="row_0_0_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="json_8h.html" target="_self">json.h</a></td><td class="desc">A convenience header that may be included instead of other individual ones</td></tr>
<tr id="row_1_" 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="arraylist_8h.html" target="_self">arraylist.h</a></td><td class="desc">Internal methods for working with json_type_array objects. Although this is exposed by the <a class="el" href="json__object_8h.html#a23d20e3f886c1638a7116be66b7b5ec2">json_object_get_array()</a> method, it is not recommended for direct use</td></tr>
<tr id="row_2_"><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__c__version_8h.html" target="_self">json_c_version.h</a></td><td class="desc">Methods for retrieving the json-c version</td></tr>
<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__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 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>

BIN
doc/html/ftv2blank.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

BIN
doc/html/ftv2cl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

BIN
doc/html/ftv2doc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

BIN
doc/html/ftv2folderopen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

BIN
doc/html/ftv2lastnode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

BIN
doc/html/ftv2link.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

BIN
doc/html/ftv2mlastnode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
doc/html/ftv2mnode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
doc/html/ftv2mo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

BIN
doc/html/ftv2node.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

BIN
doc/html/ftv2ns.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

BIN
doc/html/ftv2plastnode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

BIN
doc/html/ftv2pnode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

BIN
doc/html/ftv2splitbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

BIN
doc/html/ftv2vertline.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

294
doc/html/functions.html Normal file
View File

@@ -0,0 +1,294 @@
<!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: Data Fields</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 class="current"><a href="functions.html"><span>Data&#160;Fields</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_a"><span>a</span></a></li>
<li><a href="#index_b"><span>b</span></a></li>
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_e"><span>e</span></a></li>
<li><a href="#index_f"><span>f</span></a></li>
<li><a href="#index_h"><span>h</span></a></li>
<li><a href="#index_i"><span>i</span></a></li>
<li><a href="#index_k"><span>k</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_m"><span>m</span></a></li>
<li><a href="#index_n"><span>n</span></a></li>
<li><a href="#index_o"><span>o</span></a></li>
<li><a href="#index_p"><span>p</span></a></li>
<li><a href="#index_q"><span>q</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_t"><span>t</span></a></li>
<li><a href="#index_u"><span>u</span></a></li>
<li><a href="#index_v"><span>v</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
<div class="textblock">Here is a list of all struct and union fields with links to the structures/unions they belong to:</div>
<h3><a class="anchor" id="index_a"></a>- a -</h3><ul>
<li>array
: <a class="el" href="structarray__list.html#a7ba65feda2b156148c08667cf155b657">array_list</a>
</li>
</ul>
<h3><a class="anchor" id="index_b"></a>- b -</h3><ul>
<li>bpos
: <a class="el" href="structprintbuf.html#aba980ad7406329e32f557dfa0eb7b1b2">printbuf</a>
</li>
<li>buf
: <a class="el" href="structprintbuf.html#a5d7cf8ac260f1f7c50fecaf9bd7bc651">printbuf</a>
</li>
</ul>
<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
<li>char_offset
: <a class="el" href="structjson__tokener.html#a9daae2516fd6df23555d33ef01020a76">json_tokener</a>
</li>
<li>count
: <a class="el" href="structlh__table.html#aa172ed8fe205367b54e0e2cdf9ea8c6c">lh_table</a>
</li>
<li>current
: <a class="el" href="structjson__tokener__srec.html#a466f192f920368a5a6375aeba1e2757f">json_tokener_srec</a>
</li>
</ul>
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>depth
: <a class="el" href="structjson__tokener.html#ae0e5102b44cc1fc680be3e0fb5fff028">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
<li>entry
: <a class="el" href="structjson__object__iter.html#a64e326f050826c644c02ed5bcd214faa">json_object_iter</a>
</li>
<li>equal_fn
: <a class="el" href="structlh__table.html#aa646c287a6a46e09da6c7457c981a359">lh_table</a>
</li>
<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>
<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
<li>flags
: <a class="el" href="structjson__tokener.html#aabfdcf2825154108669ffa3f4ab9c4ea">json_tokener</a>
</li>
<li>free_fn
: <a class="el" href="structlh__table.html#a30ea5903f4f8126abd6aa489ffe14737">lh_table</a>
, <a class="el" href="structarray__list.html#ab7989cdde357e5c7819c562c7680ab74">array_list</a>
</li>
</ul>
<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
<li>hash_fn
: <a class="el" href="structlh__table.html#a1488d1a4a320b1a9bb2f441859544be1">lh_table</a>
</li>
<li>head
: <a class="el" href="structlh__table.html#aa7d986a3b12a9fa47e349713794c30fb">lh_table</a>
</li>
<li>high_surrogate
: <a class="el" href="structjson__tokener.html#a7432d9136ff5e5ceff0d02b1c3e28c18">json_tokener</a>
</li>
</ul>
<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>
</ul>
<h3><a class="anchor" id="index_k"></a>- k -</h3><ul>
<li>k
: <a class="el" href="structlh__entry.html#a79d9f1ef0dc444e17105aaeaf167e22c">lh_entry</a>
</li>
<li>k_is_constant
: <a class="el" href="structlh__entry.html#a14f40cc124c32b03f81151ae7934d2e7">lh_entry</a>
</li>
<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>
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
<li>length
: <a class="el" href="structarray__list.html#a5638022574f4ddb0f80d62535085bf4f">array_list</a>
</li>
</ul>
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>max_depth
: <a class="el" href="structjson__tokener.html#a9d9b33c3982925349627dc6a3edca940">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
<li>next
: <a class="el" href="structlh__entry.html#a7c40c46e72d9a0ba071a8d49d535bc67">lh_entry</a>
</li>
</ul>
<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
<li>obj
: <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>
</li>
<li>opaque_
: <a class="el" href="structjson__object__iterator.html#a69c61c14f5a36b1dc2217e49cd987f47">json_object_iterator</a>
</li>
</ul>
<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>
<li>prev
: <a class="el" href="structlh__entry.html#a6fb9c3de01fb5af67d8d429921cc6a3b">lh_entry</a>
</li>
</ul>
<h3><a class="anchor" id="index_q"></a>- q -</h3><ul>
<li>quote_char
: <a class="el" href="structjson__tokener.html#aea488b73085ac7c5969ae7fc29e25fa0">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>saved_state
: <a class="el" href="structjson__tokener__srec.html#a868b9912dbb1e4813a630c944f522d48">json_tokener_srec</a>
</li>
<li>size
: <a class="el" href="structarray__list.html#a11b92f48ed715b187f8609351405342f">array_list</a>
, <a class="el" href="structprintbuf.html#a12ce6440eaa06a55b96ebdc5a9778dd5">printbuf</a>
, <a class="el" href="structlh__table.html#ae251575ec2935bcb0e0589ca8e243839">lh_table</a>
</li>
<li>st_pos
: <a class="el" href="structjson__tokener.html#a8eed213c0a37d09c1df66c8567e44471">json_tokener</a>
</li>
<li>stack
: <a class="el" href="structjson__tokener.html#a3521d62906eb0e15d07d7b4f64a5fac3">json_tokener</a>
</li>
<li>str
: <a class="el" href="structjson__tokener.html#a9772e2170322a19d8da6ce5d7dc46895">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
<li>table
: <a class="el" href="structlh__table.html#a4fd9c5aba38791b26ab0ec614a5caf8f">lh_table</a>
</li>
<li>tail
: <a class="el" href="structlh__table.html#a479895e45db2bdf9bf5d173fa4b7e277">lh_table</a>
</li>
</ul>
<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
<li>ucs_char
: <a class="el" href="structjson__tokener.html#a32fa73e43fb760e6845231a8482eb064">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
<li>v
: <a class="el" href="structlh__entry.html#a1b676732ab2ad3eeaedf6ec60a6a0835">lh_entry</a>
</li>
<li>val
: <a class="el" href="structjson__object__iter.html#aaae14a8d17aacddacb0a57234e0a4491">json_object_iter</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,294 @@
<!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: Data Fields - Variables</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 class="current"><a href="functions.html"><span>Data&#160;Fields</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="functions.html"><span>All</span></a></li>
<li class="current"><a href="functions_vars.html"><span>Variables</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_a"><span>a</span></a></li>
<li><a href="#index_b"><span>b</span></a></li>
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_e"><span>e</span></a></li>
<li><a href="#index_f"><span>f</span></a></li>
<li><a href="#index_h"><span>h</span></a></li>
<li><a href="#index_i"><span>i</span></a></li>
<li><a href="#index_k"><span>k</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_m"><span>m</span></a></li>
<li><a href="#index_n"><span>n</span></a></li>
<li><a href="#index_o"><span>o</span></a></li>
<li><a href="#index_p"><span>p</span></a></li>
<li><a href="#index_q"><span>q</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_t"><span>t</span></a></li>
<li><a href="#index_u"><span>u</span></a></li>
<li><a href="#index_v"><span>v</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
&#160;
<h3><a class="anchor" id="index_a"></a>- a -</h3><ul>
<li>array
: <a class="el" href="structarray__list.html#a7ba65feda2b156148c08667cf155b657">array_list</a>
</li>
</ul>
<h3><a class="anchor" id="index_b"></a>- b -</h3><ul>
<li>bpos
: <a class="el" href="structprintbuf.html#aba980ad7406329e32f557dfa0eb7b1b2">printbuf</a>
</li>
<li>buf
: <a class="el" href="structprintbuf.html#a5d7cf8ac260f1f7c50fecaf9bd7bc651">printbuf</a>
</li>
</ul>
<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
<li>char_offset
: <a class="el" href="structjson__tokener.html#a9daae2516fd6df23555d33ef01020a76">json_tokener</a>
</li>
<li>count
: <a class="el" href="structlh__table.html#aa172ed8fe205367b54e0e2cdf9ea8c6c">lh_table</a>
</li>
<li>current
: <a class="el" href="structjson__tokener__srec.html#a466f192f920368a5a6375aeba1e2757f">json_tokener_srec</a>
</li>
</ul>
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>depth
: <a class="el" href="structjson__tokener.html#ae0e5102b44cc1fc680be3e0fb5fff028">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
<li>entry
: <a class="el" href="structjson__object__iter.html#a64e326f050826c644c02ed5bcd214faa">json_object_iter</a>
</li>
<li>equal_fn
: <a class="el" href="structlh__table.html#aa646c287a6a46e09da6c7457c981a359">lh_table</a>
</li>
<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>
<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
<li>flags
: <a class="el" href="structjson__tokener.html#aabfdcf2825154108669ffa3f4ab9c4ea">json_tokener</a>
</li>
<li>free_fn
: <a class="el" href="structlh__table.html#a30ea5903f4f8126abd6aa489ffe14737">lh_table</a>
, <a class="el" href="structarray__list.html#ab7989cdde357e5c7819c562c7680ab74">array_list</a>
</li>
</ul>
<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
<li>hash_fn
: <a class="el" href="structlh__table.html#a1488d1a4a320b1a9bb2f441859544be1">lh_table</a>
</li>
<li>head
: <a class="el" href="structlh__table.html#aa7d986a3b12a9fa47e349713794c30fb">lh_table</a>
</li>
<li>high_surrogate
: <a class="el" href="structjson__tokener.html#a7432d9136ff5e5ceff0d02b1c3e28c18">json_tokener</a>
</li>
</ul>
<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>
</ul>
<h3><a class="anchor" id="index_k"></a>- k -</h3><ul>
<li>k
: <a class="el" href="structlh__entry.html#a79d9f1ef0dc444e17105aaeaf167e22c">lh_entry</a>
</li>
<li>k_is_constant
: <a class="el" href="structlh__entry.html#a14f40cc124c32b03f81151ae7934d2e7">lh_entry</a>
</li>
<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>
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
<li>length
: <a class="el" href="structarray__list.html#a5638022574f4ddb0f80d62535085bf4f">array_list</a>
</li>
</ul>
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>max_depth
: <a class="el" href="structjson__tokener.html#a9d9b33c3982925349627dc6a3edca940">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
<li>next
: <a class="el" href="structlh__entry.html#a7c40c46e72d9a0ba071a8d49d535bc67">lh_entry</a>
</li>
</ul>
<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
<li>obj
: <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>
</li>
<li>opaque_
: <a class="el" href="structjson__object__iterator.html#a69c61c14f5a36b1dc2217e49cd987f47">json_object_iterator</a>
</li>
</ul>
<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>
<li>prev
: <a class="el" href="structlh__entry.html#a6fb9c3de01fb5af67d8d429921cc6a3b">lh_entry</a>
</li>
</ul>
<h3><a class="anchor" id="index_q"></a>- q -</h3><ul>
<li>quote_char
: <a class="el" href="structjson__tokener.html#aea488b73085ac7c5969ae7fc29e25fa0">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>saved_state
: <a class="el" href="structjson__tokener__srec.html#a868b9912dbb1e4813a630c944f522d48">json_tokener_srec</a>
</li>
<li>size
: <a class="el" href="structarray__list.html#a11b92f48ed715b187f8609351405342f">array_list</a>
, <a class="el" href="structprintbuf.html#a12ce6440eaa06a55b96ebdc5a9778dd5">printbuf</a>
, <a class="el" href="structlh__table.html#ae251575ec2935bcb0e0589ca8e243839">lh_table</a>
</li>
<li>st_pos
: <a class="el" href="structjson__tokener.html#a8eed213c0a37d09c1df66c8567e44471">json_tokener</a>
</li>
<li>stack
: <a class="el" href="structjson__tokener.html#a3521d62906eb0e15d07d7b4f64a5fac3">json_tokener</a>
</li>
<li>str
: <a class="el" href="structjson__tokener.html#a9772e2170322a19d8da6ce5d7dc46895">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
<li>table
: <a class="el" href="structlh__table.html#a4fd9c5aba38791b26ab0ec614a5caf8f">lh_table</a>
</li>
<li>tail
: <a class="el" href="structlh__table.html#a479895e45db2bdf9bf5d173fa4b7e277">lh_table</a>
</li>
</ul>
<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
<li>ucs_char
: <a class="el" href="structjson__tokener.html#a32fa73e43fb760e6845231a8482eb064">json_tokener</a>
</li>
</ul>
<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
<li>v
: <a class="el" href="structlh__entry.html#a1b676732ab2ad3eeaedf6ec60a6a0835">lh_entry</a>
</li>
<li>val
: <a class="el" href="structjson__object__iter.html#aaae14a8d17aacddacb0a57234e0a4491">json_object_iter</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>

124
doc/html/globals.html Normal file
View File

@@ -0,0 +1,124 @@
<!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 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 -->
<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_a"></a>- a -</h3><ul>
<li>array_list
: <a class="el" href="arraylist_8h.html#a6d6d32d8b026ea2025df519b9e90f44a">arraylist.h</a>
</li>
<li>array_list_add()
: <a class="el" href="arraylist_8h.html#a6e995608aa464244ff3184fb43574dc8">arraylist.h</a>
</li>
<li>array_list_bsearch()
: <a class="el" href="arraylist_8h.html#ac5d066b971fee72ce80084c1694109e3">arraylist.h</a>
</li>
<li>ARRAY_LIST_DEFAULT_SIZE
: <a class="el" href="arraylist_8h.html#acd30d910b398421574eb1f59e78617f5">arraylist.h</a>
</li>
<li>array_list_del_idx()
: <a class="el" href="arraylist_8h.html#aecedd8601ee96e2fd8eff5d83fda89ab">arraylist.h</a>
</li>
<li>array_list_free()
: <a class="el" href="arraylist_8h.html#acd00fb70f7ca82f23b48b812c3498f67">arraylist.h</a>
</li>
<li>array_list_free_fn
: <a class="el" href="arraylist_8h.html#aad83e4ed3c8ea274e6f18459276d774b">arraylist.h</a>
</li>
<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>
<li>array_list_new()
: <a class="el" href="arraylist_8h.html#a0d4bfac055dfd98e17296142abf4d894">arraylist.h</a>
</li>
<li>array_list_new2()
: <a class="el" href="arraylist_8h.html#ae3e43dc68f5d1815f3aaa36916602e45">arraylist.h</a>
</li>
<li>array_list_put_idx()
: <a class="el" href="arraylist_8h.html#a9f92076e9d8229f8a07e536dc286f811">arraylist.h</a>
</li>
<li>array_list_shrink()
: <a class="el" href="arraylist_8h.html#aff21b2a00573f8f0085b81ce1de1a850">arraylist.h</a>
</li>
<li>array_list_sort()
: <a class="el" href="arraylist_8h.html#afb67cc8e2e5c9be41c3e644536079169">arraylist.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,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>

687
doc/html/globals_0x6a.html Normal file
View File

@@ -0,0 +1,687 @@
<!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 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 -->
<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_j"></a>- j -</h3><ul>
<li>json_bool
: <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_types.h</a>
</li>
<li>JSON_C_CONST_FUNCTION
: <a class="el" href="json__object_8h.html#a878f59e029f19db79ff9eb41fdcf4c6d">json_object.h</a>
</li>
<li>JSON_C_MAJOR_VERSION
: <a class="el" href="json__c__version_8h.html#a251c3e1f59a379a4a905382b4e855125">json_c_version.h</a>
</li>
<li>JSON_C_MICRO_VERSION
: <a class="el" href="json__c__version_8h.html#a64457730097067ab096906d82e4a51a6">json_c_version.h</a>
</li>
<li>JSON_C_MINOR_VERSION
: <a class="el" href="json__c__version_8h.html#adc87477fbc1c75848fe6b6feec21c2d6">json_c_version.h</a>
</li>
<li>JSON_C_OBJECT_ADD_CONSTANT_KEY
: <a class="el" href="json__object_8h.html#a4d303af657ca4ee8e487366ba9692c94">json_object.h</a>
</li>
<li>JSON_C_OBJECT_ADD_KEY_IS_NEW
: <a class="el" href="json__object_8h.html#a8cd01c484155ac99043a35b7c85ae411">json_object.h</a>
</li>
<li>JSON_C_OBJECT_KEY_IS_CONSTANT
: <a class="el" href="json__object_8h.html#a134ffafc6116799a20134dc7646b5a37">json_object.h</a>
</li>
<li>json_c_object_sizeof()
: <a class="el" href="json__object_8h.html#af50be932ec85694ae40141b46901bd00">json_object.h</a>
</li>
<li>JSON_C_OPTION_GLOBAL
: <a class="el" href="json__object_8h.html#a45837b8c6564f9e605f8a2bc76243750">json_object.h</a>
</li>
<li>JSON_C_OPTION_THREAD
: <a class="el" href="json__object_8h.html#a50d1490598fe476d7a53e204e02cdc9d">json_object.h</a>
</li>
<li>json_c_set_serialization_double_format()
: <a class="el" href="json__object_8h.html#ac099272b46fde595831118720b155656">json_object.h</a>
</li>
<li>json_c_shallow_copy_default
: <a class="el" href="json__object_8h.html#a86ea08e75ddf054742bf806a3bc3f983">json_object.h</a>
</li>
<li>json_c_shallow_copy_fn
: <a class="el" href="json__object_8h.html#af4562514916f62ea56adf752ada10b52">json_object.h</a>
</li>
<li>JSON_C_STR_HASH_DFLT
: <a class="el" href="linkhash_8h.html#ac32e80138c5be6dd9b0483a9cbcc8799">linkhash.h</a>
</li>
<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>
<li>JSON_C_TO_STRING_NOZERO
: <a class="el" href="json__object_8h.html#a34f027c147babf69fc530d088f2b49b0">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_PLAIN
: <a class="el" href="json__object_8h.html#a3294cb92765cdeb497cfd346644d1059">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_PRETTY
: <a class="el" href="json__object_8h.html#a2025bc677c35f130e117dfda5bf1ef73">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_PRETTY_TAB
: <a class="el" href="json__object_8h.html#afc1486af21f6b1653c6f523025bdfd3b">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_SPACED
: <a class="el" href="json__object_8h.html#aa821746c8668e6ad62bed90ec9e00103">json_object.h</a>
</li>
<li>json_c_version()
: <a class="el" href="json__c__version_8h.html#a1c42f6f71943775e2696c47951989711">json_c_version.h</a>
</li>
<li>JSON_C_VERSION
: <a class="el" href="json__c__version_8h.html#a894adda66a072bc3fd34ebe91a5aa7f4">json_c_version.h</a>
</li>
<li>json_c_version_num()
: <a class="el" href="json__c__version_8h.html#a860ee32b09f4faf38d73771a6ed193ed">json_c_version.h</a>
</li>
<li>JSON_C_VERSION_NUM
: <a class="el" href="json__c__version_8h.html#a78e176eee75ee6aed43c4d65ca4c5b44">json_c_version.h</a>
</li>
<li>json_c_visit()
: <a class="el" href="json__visit_8h.html#a0f585e56a5d417381cdf6c28538dbb20">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_CONTINUE
: <a class="el" href="json__visit_8h.html#a98b35e1ba1d52d41799dccbfd2c170a1">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_ERROR
: <a class="el" href="json__visit_8h.html#abfacb0713b81c897a8ce5f37ff6ffb9c">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_POP
: <a class="el" href="json__visit_8h.html#a327a21f1f1c6f84e7a13fbaaf4a51b13">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_SKIP
: <a class="el" href="json__visit_8h.html#adc7ca60a79c4ae870d9463e41527c2a1">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_STOP
: <a class="el" href="json__visit_8h.html#a5956f41bed48f90a127f9b37fad7ea97">json_visit.h</a>
</li>
<li>JSON_C_VISIT_SECOND
: <a class="el" href="json__visit_8h.html#ac5be4a96b99b724833943003715dfc1c">json_visit.h</a>
</li>
<li>json_c_visit_userfunc
: <a class="el" href="json__visit_8h.html#a0fadec4abb2befcacfaff7df822f3f8d">json_visit.h</a>
</li>
<li>JSON_EXPORT
: <a class="el" href="json__c__version_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">json_c_version.h</a>
, <a class="el" href="json__types_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">json_types.h</a>
, <a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">printbuf.h</a>
</li>
<li>JSON_FILE_BUF_SIZE
: <a class="el" href="json__util_8h.html#a084b6afc8f7fbef88976aabe4aca7efd">json_util.h</a>
</li>
<li>json_global_set_string_hash()
: <a class="el" href="linkhash_8h.html#ac8e1d61af44d9c0824d8c7980385bcd3">linkhash.h</a>
</li>
<li>json_max
: <a class="el" href="json__util_8h.html#a57d63d199d4b9ea40359253618951300">json_util.h</a>
</li>
<li>json_min
: <a class="el" href="json__util_8h.html#a3dde282dc23d0eaa3c4840df8dc262d4">json_util.h</a>
</li>
<li>json_object
: <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_types.h</a>
</li>
<li>json_object_array_add()
: <a class="el" href="json__object_8h.html#a18cdd9a7455e09f36cdf6e5756b7f586">json_object.h</a>
</li>
<li>json_object_array_bsearch()
: <a class="el" href="json__object_8h.html#aed353084ed3ad84e7b7575afbe7e719d">json_object.h</a>
</li>
<li>json_object_array_del_idx()
: <a class="el" href="json__object_8h.html#a722eca9f578704d3af38b97549242c1f">json_object.h</a>
</li>
<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>
<li>json_object_array_put_idx()
: <a class="el" href="json__object_8h.html#a1ac0ccdbc13a25da7d8b2dc9e421dfad">json_object.h</a>
</li>
<li>json_object_array_shrink()
: <a class="el" href="json__object_8h.html#a95552402a95c9470b230052d92270247">json_object.h</a>
</li>
<li>json_object_array_sort()
: <a class="el" href="json__object_8h.html#a5584e2f2051cd1faa7fafd07ba888fd1">json_object.h</a>
</li>
<li>json_object_deep_copy()
: <a class="el" href="json__object_8h.html#aaac16505f13bc56accfad82604d8bcdc">json_object.h</a>
</li>
<li>JSON_OBJECT_DEF_HASH_ENTRIES
: <a class="el" href="json__object_8h.html#a268a63dd1b2e6d81559e268a4529e9bf">json_object.h</a>
</li>
<li>json_object_delete_fn
: <a class="el" href="json__types_8h.html#aa647d7c567a06abe1a1a511f6d6860e4">json_types.h</a>
</li>
<li>json_object_double_to_json_string()
: <a class="el" href="json__object_8h.html#ada262c62364e3819b6a64b1e3a632336">json_object.h</a>
</li>
<li>json_object_equal()
: <a class="el" href="json__object_8h.html#a5a1d4640525e0217059868e312f20579">json_object.h</a>
</li>
<li>json_object_free_userdata
: <a class="el" href="json__object_8h.html#aff3190c34884bea3b4e65e286b973d89">json_object.h</a>
</li>
<li>json_object_from_fd()
: <a class="el" href="json__util_8h.html#a5b72bf6f3ac8fb03da38d2e2d1e18d1b">json_util.h</a>
</li>
<li>json_object_from_fd_ex()
: <a class="el" href="json__util_8h.html#a88c5c7ce735d95f6c3c81c73475e14aa">json_util.h</a>
</li>
<li>json_object_from_file()
: <a class="el" href="json__util_8h.html#a03119ec0a71af4eee95318e9b2aaf05b">json_util.h</a>
</li>
<li>json_object_get()
: <a class="el" href="json__object_8h.html#a675aa3a9cced685dbfd1c1a770a0c3e4">json_object.h</a>
</li>
<li>json_object_get_array()
: <a class="el" href="json__object_8h.html#a23d20e3f886c1638a7116be66b7b5ec2">json_object.h</a>
</li>
<li>json_object_get_boolean()
: <a class="el" href="json__object_8h.html#ac003fb99db7ecd674bb16d983d2f92ee">json_object.h</a>
</li>
<li>json_object_get_double()
: <a class="el" href="json__object_8h.html#a94a70cff6a14398b581b7b10b0792c5b">json_object.h</a>
</li>
<li>json_object_get_int()
: <a class="el" href="json__object_8h.html#a8c56dc58a02f92cd6789ba5dcb9fe7b1">json_object.h</a>
</li>
<li>json_object_get_int64()
: <a class="el" href="json__object_8h.html#a1a14750b3af4df18ec8dc93b090a8e8a">json_object.h</a>
</li>
<li>json_object_get_object()
: <a class="el" href="json__object_8h.html#a2caa52ae1863bd073444f3737138a4db">json_object.h</a>
</li>
<li>json_object_get_string()
: <a class="el" href="json__object_8h.html#a9ee29ca8d79896e15007131527f6002e">json_object.h</a>
</li>
<li>json_object_get_string_len()
: <a class="el" href="json__object_8h.html#ac1d1f95a27a5e5d93bb66a8adfc1a2f4">json_object.h</a>
</li>
<li>json_object_get_type()
: <a class="el" href="json__object_8h.html#af256a3a7910e271a2b9735e5044c3827">json_object.h</a>
</li>
<li>json_object_get_uint64()
: <a class="el" href="json__object_8h.html#a82c27579b6d25d9d0eb3b72758d8b71d">json_object.h</a>
</li>
<li>json_object_get_userdata()
: <a class="el" href="json__object_8h.html#ae925f3ec0f61cba5ea3dd50e0315f194">json_object.h</a>
</li>
<li>json_object_int_inc()
: <a class="el" href="json__object_8h.html#a25691322b2d1ab24a3797e5752eb659f">json_object.h</a>
</li>
<li>json_object_is_type()
: <a class="el" href="json__object_8h.html#a8ab506a3d8f4ba5eb6a12ce0a6bbd37b">json_object.h</a>
</li>
<li>json_object_iter
: <a class="el" href="json__types_8h.html#af88126730e765f2068968f4b16fd074f">json_types.h</a>
</li>
<li>json_object_iter_begin()
: <a class="el" href="json__object__iterator_8h.html#afdcd32f83dd8f20e25669f197fb7bde9">json_object_iterator.h</a>
</li>
<li>json_object_iter_end()
: <a class="el" href="json__object__iterator_8h.html#a381fbae848a3268013110002d553c32e">json_object_iterator.h</a>
</li>
<li>json_object_iter_equal()
: <a class="el" href="json__object__iterator_8h.html#a9cbb250d185348e8b193a886c35ae39e">json_object_iterator.h</a>
</li>
<li>json_object_iter_init_default()
: <a class="el" href="json__object__iterator_8h.html#ae93958fa755852192553f1686d248cd1">json_object_iterator.h</a>
</li>
<li>json_object_iter_next()
: <a class="el" href="json__object__iterator_8h.html#a8a152d153844f1ec1698419abae8c2e4">json_object_iterator.h</a>
</li>
<li>json_object_iter_peek_name()
: <a class="el" href="json__object__iterator_8h.html#adbbc3583aef14d9416a0fc8dbf750727">json_object_iterator.h</a>
</li>
<li>json_object_iter_peek_value()
: <a class="el" href="json__object__iterator_8h.html#ad8fe9251ca04af4d8e6840a44de7984b">json_object_iterator.h</a>
</li>
<li>json_object_new_array()
: <a class="el" href="json__object_8h.html#a84f7f8c0774c4600d958561d7548d649">json_object.h</a>
</li>
<li>json_object_new_array_ext()
: <a class="el" href="json__object_8h.html#a62af9fb3b02fb153190369d949394b26">json_object.h</a>
</li>
<li>json_object_new_boolean()
: <a class="el" href="json__object_8h.html#a2e290acd80e72cca745f89fb4600fb78">json_object.h</a>
</li>
<li>json_object_new_double()
: <a class="el" href="json__object_8h.html#a594a093bafb9091f843da3197e0638aa">json_object.h</a>
</li>
<li>json_object_new_double_s()
: <a class="el" href="json__object_8h.html#ae49671c026fe1ada370a75321e4e65f6">json_object.h</a>
</li>
<li>json_object_new_int()
: <a class="el" href="json__object_8h.html#ae92f0770fb4b3c884ce35de52d3d7de8">json_object.h</a>
</li>
<li>json_object_new_int64()
: <a class="el" href="json__object_8h.html#a7847f74494645c2b076505c37cc4cb93">json_object.h</a>
</li>
<li>json_object_new_null()
: <a class="el" href="json__object_8h.html#a29e23b5be729c679960242b3b81bcde0">json_object.h</a>
</li>
<li>json_object_new_object()
: <a class="el" href="json__object_8h.html#a68c383f54544fca19b5f2425be397600">json_object.h</a>
</li>
<li>json_object_new_string()
: <a class="el" href="json__object_8h.html#a7b7b5302b3903c9347eeb1f4a64d657b">json_object.h</a>
</li>
<li>json_object_new_string_len()
: <a class="el" href="json__object_8h.html#a778a1aa34a508d08daac3bdb83e24b52">json_object.h</a>
</li>
<li>json_object_new_uint64()
: <a class="el" href="json__object_8h.html#aa602ee5f6182b35f3f75a927320b4efd">json_object.h</a>
</li>
<li>json_object_object_add()
: <a class="el" href="json__object_8h.html#a27bd808a022251059a43f1f6370441cd">json_object.h</a>
</li>
<li>json_object_object_add_ex()
: <a class="el" href="json__object_8h.html#a57d3e444dd7db6b4510d21bf3716a002">json_object.h</a>
</li>
<li>json_object_object_del()
: <a class="el" href="json__object_8h.html#ac6605fdafca20bd5d33c84f4f80a3bda">json_object.h</a>
</li>
<li>json_object_object_foreach
: <a class="el" href="json__object_8h.html#acf5f514a9e0061c10fc08055762639ee">json_object.h</a>
</li>
<li>json_object_object_foreachC
: <a class="el" href="json__object_8h.html#a71f07006c12d78f7bbf4cb716a5af3a6">json_object.h</a>
</li>
<li>json_object_object_get()
: <a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object.h</a>
</li>
<li>json_object_object_get_ex()
: <a class="el" href="json__object_8h.html#a90d5f16d58636f01d2ed1a6030c7366a">json_object.h</a>
</li>
<li>json_object_object_length()
: <a class="el" href="json__object_8h.html#ad59a0ad2ec914a5eef90af53acae06d9">json_object.h</a>
</li>
<li>json_object_put()
: <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object.h</a>
</li>
<li>json_object_set_boolean()
: <a class="el" href="json__object_8h.html#a23863c1503f3a8dd8a460a6405da0a65">json_object.h</a>
</li>
<li>json_object_set_double()
: <a class="el" href="json__object_8h.html#a3a7b7ce585565558cb69dad8d45d7757">json_object.h</a>
</li>
<li>json_object_set_int()
: <a class="el" href="json__object_8h.html#a4ab3568f12e01fd2967e765a72456caa">json_object.h</a>
</li>
<li>json_object_set_int64()
: <a class="el" href="json__object_8h.html#a7d3948600dde732abed0e261264ef53a">json_object.h</a>
</li>
<li>json_object_set_serializer()
: <a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object.h</a>
</li>
<li>json_object_set_string()
: <a class="el" href="json__object_8h.html#ac35013e51cdc0651512801c947df431c">json_object.h</a>
</li>
<li>json_object_set_string_len()
: <a class="el" href="json__object_8h.html#ae48707a0c8689e14aaa3a9b831db27fc">json_object.h</a>
</li>
<li>json_object_set_uint64()
: <a class="el" href="json__object_8h.html#a9900aa9a425e6f14e295b298460b65d4">json_object.h</a>
</li>
<li>json_object_set_userdata()
: <a class="el" href="json__object_8h.html#a4ee4281ccd123c62878e931a0a3bc43b">json_object.h</a>
</li>
<li>json_object_to_fd()
: <a class="el" href="json__util_8h.html#afd492c120e359d2d75b67da96b580661">json_util.h</a>
</li>
<li>json_object_to_file()
: <a class="el" href="json__util_8h.html#a486fc95fafe7cb91c58c7f6487036bc5">json_util.h</a>
</li>
<li>json_object_to_file_ext()
: <a class="el" href="json__util_8h.html#a68a7385c555cf21797e361d1d4de3441">json_util.h</a>
</li>
<li>json_object_to_json_string()
: <a class="el" href="json__object_8h.html#ab7390c22baa1700d977c2af6b22d43a4">json_object.h</a>
</li>
<li>json_object_to_json_string_ext()
: <a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object.h</a>
</li>
<li>json_object_to_json_string_fn
: <a class="el" href="json__types_8h.html#af84078100a9025df418f31626ea866fa">json_types.h</a>
</li>
<li>json_object_to_json_string_length()
: <a class="el" href="json__object_8h.html#add3770a3ba3d01a8f9adedfcd6bd8dbb">json_object.h</a>
</li>
<li>json_object_userdata_to_json_string
: <a class="el" href="json__object_8h.html#a56091ddbd2ec6d6200558cbeff1b86b8">json_object.h</a>
</li>
<li>json_parse_double()
: <a class="el" href="json__util_8h.html#a3f0f0b8f29a41b47d62e6c867707be50">json_util.h</a>
</li>
<li>json_parse_int64()
: <a class="el" href="json__util_8h.html#a9d9a63936cdae6639b9cdd87fdd13506">json_util.h</a>
</li>
<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>
<li>json_tokener
: <a class="el" href="json__tokener_8h.html#a4dd5e5b65aee7f376f529f86b210ff49">json_tokener.h</a>
</li>
<li>JSON_TOKENER_ALLOW_TRAILING_CHARS
: <a class="el" href="json__tokener_8h.html#aa74428c9cf57655eea5b49feae3f2704">json_tokener.h</a>
</li>
<li>json_tokener_continue
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a9b26e920ca765df91c84e999561d8fb0">json_tokener.h</a>
</li>
<li>JSON_TOKENER_DEFAULT_DEPTH
: <a class="el" href="json__tokener_8h.html#a5ccd346459feb66e4e0af32005360279">json_tokener.h</a>
</li>
<li>json_tokener_error
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59">json_tokener.h</a>
</li>
<li>json_tokener_error_depth
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a59b2c36d9cc30c3038e09b9ddee6c86c">json_tokener.h</a>
</li>
<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>
<li>json_tokener_error_parse_boolean
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59addbdfe084e20709da3d20c8ae8ca278c">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_comment
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a3588c05b1da8b909a8cbdef66b0a1a28">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_eof
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a8f774f4c7869afdd9b92295fca3a9ded">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_null
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a641bbb8d881fdd1e463f20a1a203b77c">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_number
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59ab1b3ad685eb97235d269cc5b9eb7ab81">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_object_key_name
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a2003bd8e96c6680cd22419c5ceafd4c0">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_object_key_sep
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59af91a2a819b0d6344d6d4e1d2579f28fd">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_object_value_sep
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a9ddb98741aebf7ac44735b4a43717013">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_string
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a033ce89ce7b8f9e591e4bea92121c4c7">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_unexpected
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a3309fa8ea4ab3ee0a81c55b69d223710">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_utf8_string
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59ab405d4a1282f3b037048d3456869a4c1">json_tokener.h</a>
</li>
<li>json_tokener_error_size
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a1eeed74de65c0c12c9f9c28cf4f3ff1d">json_tokener.h</a>
</li>
<li>json_tokener_free()
: <a class="el" href="json__tokener_8h.html#a887c4661906fc6b36cc366304e522534">json_tokener.h</a>
</li>
<li>json_tokener_get_error()
: <a class="el" href="json__tokener_8h.html#af5d7ffd95a0f6e5d5bb5994d233b4197">json_tokener.h</a>
</li>
<li>json_tokener_get_parse_end()
: <a class="el" href="json__tokener_8h.html#a4a2fa28d815f8b370cbb00b80ebc0f1d">json_tokener.h</a>
</li>
<li>json_tokener_new()
: <a class="el" href="json__tokener_8h.html#a5ac7e2c350bc592cf2fa7b9935b00ef5">json_tokener.h</a>
</li>
<li>json_tokener_new_ex()
: <a class="el" href="json__tokener_8h.html#a6a1583ddd434e13515d6232de813462e">json_tokener.h</a>
</li>
<li>json_tokener_parse()
: <a class="el" href="json__tokener_8h.html#a236ef64d079822a4411d13eae7190c4d">json_tokener.h</a>
</li>
<li>json_tokener_parse_ex()
: <a class="el" href="json__tokener_8h.html#a61679f178111963a9ffa3c8179553f7a">json_tokener.h</a>
</li>
<li>json_tokener_parse_verbose()
: <a class="el" href="json__tokener_8h.html#a735f2dc755d57ed5c5b807aaaaef3b14">json_tokener.h</a>
</li>
<li>json_tokener_reset()
: <a class="el" href="json__tokener_8h.html#a238649a59737be5152d525aeaf4153ab">json_tokener.h</a>
</li>
<li>json_tokener_set_flags()
: <a class="el" href="json__tokener_8h.html#a7e7a0c0c9dc79e5e47b2608bb8aad7b7">json_tokener.h</a>
</li>
<li>json_tokener_state
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2">json_tokener.h</a>
</li>
<li>json_tokener_state_array
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ab3d763300f1914865be09d603ddc11f4">json_tokener.h</a>
</li>
<li>json_tokener_state_array_add
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2aa2a01798ebe318ea91c38a886418f771">json_tokener.h</a>
</li>
<li>json_tokener_state_array_after_sep
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ab1a0ad626ec662c1ba4fb5bfee1cd0a9">json_tokener.h</a>
</li>
<li>json_tokener_state_array_sep
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a4ec7762aeab3424cbb14354c94025865">json_tokener.h</a>
</li>
<li>json_tokener_state_boolean
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a3525b15ecd0a698281b3914115b6bd3e">json_tokener.h</a>
</li>
<li>json_tokener_state_comment
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a8c2680b8873a8dce85f0b1ac25882dc9">json_tokener.h</a>
</li>
<li>json_tokener_state_comment_end
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a62cef297a37a98b1239ea4bbd39723e1">json_tokener.h</a>
</li>
<li>json_tokener_state_comment_eol
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ad8151350b1ef50298bafbab244ac1162">json_tokener.h</a>
</li>
<li>json_tokener_state_comment_start
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a0ff1d1935d49188aa1e6b998d43e655c">json_tokener.h</a>
</li>
<li>json_tokener_state_eatws
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a9db152607ec1872a000f1fcd8757297d">json_tokener.h</a>
</li>
<li>json_tokener_state_escape_unicode
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a6c852da2e694be56799c58c201d6dca0">json_tokener.h</a>
</li>
<li>json_tokener_state_escape_unicode_need_escape
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a482827c786d2378635ef54dc2b092264">json_tokener.h</a>
</li>
<li>json_tokener_state_escape_unicode_need_u
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a5cab1cdfea9128e0ed9db85ffdc71df4">json_tokener.h</a>
</li>
<li>json_tokener_state_finish
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ad80b689cb709967b67a348de3d8601d2">json_tokener.h</a>
</li>
<li>json_tokener_state_inf
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ab9f6244bfca4924db61ed3050c780b53">json_tokener.h</a>
</li>
<li>json_tokener_state_null
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a668fb2654c59608945370003403a5792">json_tokener.h</a>
</li>
<li>json_tokener_state_number
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a7ce18d281d322af690b45f3b8b599e81">json_tokener.h</a>
</li>
<li>json_tokener_state_object_field
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a77375940a10806e81d99876d13be67fc">json_tokener.h</a>
</li>
<li>json_tokener_state_object_field_end
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a0220aea1d9204aadfffde92c7f73f5f7">json_tokener.h</a>
</li>
<li>json_tokener_state_object_field_start
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a8c7dbda177a5d83a36a64f7cb99b9a29">json_tokener.h</a>
</li>
<li>json_tokener_state_object_field_start_after_sep
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a3a2c9cf26d076936a10a6ae3ca4eb523">json_tokener.h</a>
</li>
<li>json_tokener_state_object_sep
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2adaf3e06c5fc04fd4f04040cd67698215">json_tokener.h</a>
</li>
<li>json_tokener_state_object_value
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a4c7b7deac37355491572f6da84f208aa">json_tokener.h</a>
</li>
<li>json_tokener_state_object_value_add
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ade6bee72f2147e634b19eb84e58eb162">json_tokener.h</a>
</li>
<li>json_tokener_state_start
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a7c4c0bed1ebde45f5a99de4278792d72">json_tokener.h</a>
</li>
<li>json_tokener_state_string
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2aa90ea4c327a285bfbbce49d42d491d65">json_tokener.h</a>
</li>
<li>json_tokener_state_string_escape
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a1cf793d73587f68c4f2b3b4f65ff728e">json_tokener.h</a>
</li>
<li>JSON_TOKENER_STRICT
: <a class="el" href="json__tokener_8h.html#a72be595cb7e090c70b1d29feb1cbfb16">json_tokener.h</a>
</li>
<li>json_tokener_success
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59afe2fa9bde03155019b2df30f66a5fcd0">json_tokener.h</a>
</li>
<li>JSON_TOKENER_VALIDATE_UTF8
: <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#aba5eff84f8638d22f50403175f270c96">json_types.h</a>
</li>
<li>json_type_array
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cae536c8c9da4648e6b9348abddde6113c">json_types.h</a>
</li>
<li>json_type_boolean
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06ca5d15299e90dbb9935ff6d3e2c22a285c">json_types.h</a>
</li>
<li>json_type_double
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cac6ac2d9a16577d00210fea64d16b47cd">json_types.h</a>
</li>
<li>json_type_int
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06ca7bf325c213b43c5f970ae2d4443ab956">json_types.h</a>
</li>
<li>json_type_null
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06ca127e62d156e13517471fcde3378979c1">json_types.h</a>
</li>
<li>json_type_object
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cac966c8008f0b2c07da59ee8a60ad440f">json_types.h</a>
</li>
<li>json_type_string
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cac9f56e57c09245522d764015a054faa6">json_types.h</a>
</li>
<li>json_type_to_name()
: <a class="el" href="json__util_8h.html#a762aaf3df0a9c7b6919cdc1035348012">json_util.h</a>
</li>
<li>json_util_get_last_err()
: <a class="el" href="json__util_8h.html#a9fe4dbb5fe32850cdc22a97454e4500b">json_util.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>

172
doc/html/globals_0x6c.html Normal file
View File

@@ -0,0 +1,172 @@
<!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 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 -->
<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_l"></a>- l -</h3><ul>
<li>LH_EMPTY
: <a class="el" href="linkhash_8h.html#a93fad7f8ae44575dc89c9567859972d2">linkhash.h</a>
</li>
<li>lh_entry_free_fn
: <a class="el" href="linkhash_8h.html#a671553d0ee3c2a123190ba0f8ed2b635">linkhash.h</a>
</li>
<li>lh_entry_k()
: <a class="el" href="linkhash_8h.html#a82e5d699ba2fd4c520352c003f8554a5">linkhash.h</a>
</li>
<li>lh_entry_k_is_constant()
: <a class="el" href="linkhash_8h.html#a724c308f1c606271ea3deb01ed9e3cc9">linkhash.h</a>
</li>
<li>lh_entry_next()
: <a class="el" href="linkhash_8h.html#a603f6f2cc6d292a160b09b357c7a0a69">linkhash.h</a>
</li>
<li>lh_entry_prev()
: <a class="el" href="linkhash_8h.html#a965145d36d3e00eae825c692205d2f81">linkhash.h</a>
</li>
<li>lh_entry_set_val()
: <a class="el" href="linkhash_8h.html#ad94e87a8ef92ee6371e5314b7241e635">linkhash.h</a>
</li>
<li>lh_entry_v()
: <a class="el" href="linkhash_8h.html#ab163f65568af863f3738ccd05900745e">linkhash.h</a>
</li>
<li>lh_equal_fn
: <a class="el" href="linkhash_8h.html#a91fd85fc81b0c7c83c62f00e84729091">linkhash.h</a>
</li>
<li>lh_foreach
: <a class="el" href="linkhash_8h.html#ad7dd67da915065dce2c6f44cb03e2d82">linkhash.h</a>
</li>
<li>lh_foreach_safe
: <a class="el" href="linkhash_8h.html#abcbb0df08b4976d0649b826b6bacfca1">linkhash.h</a>
</li>
<li>LH_FREED
: <a class="el" href="linkhash_8h.html#ac69428f2de0a6fb080b6fb373d506aa7">linkhash.h</a>
</li>
<li>lh_get_hash()
: <a class="el" href="linkhash_8h.html#a33c74c884530d407d0b3baa365238fb4">linkhash.h</a>
</li>
<li>lh_hash_fn
: <a class="el" href="linkhash_8h.html#a38bae27995dcfb6ee3fb109a9be229b2">linkhash.h</a>
</li>
<li>lh_kchar_table_new()
: <a class="el" href="linkhash_8h.html#a6bf630754affe92612639542a6c49c3f">linkhash.h</a>
</li>
<li>lh_kptr_table_new()
: <a class="el" href="linkhash_8h.html#af8108563b961dbf5471fe2c0e51f40a5">linkhash.h</a>
</li>
<li>LH_LOAD_FACTOR
: <a class="el" href="linkhash_8h.html#a66b61772c29d85eb52b697e0b0dc0aaf">linkhash.h</a>
</li>
<li>LH_PRIME
: <a class="el" href="linkhash_8h.html#a032f1bd115df254dda325437203ce5fb">linkhash.h</a>
</li>
<li>lh_table
: <a class="el" href="linkhash_8h.html#a766e90057496fc6712d6be0da180a21f">linkhash.h</a>
</li>
<li>lh_table_delete()
: <a class="el" href="linkhash_8h.html#a2fed2c78f70d229edb2d00775ffe593c">linkhash.h</a>
</li>
<li>lh_table_delete_entry()
: <a class="el" href="linkhash_8h.html#ae5885a71c3457190fb1dc2d6e20dde3b">linkhash.h</a>
</li>
<li>lh_table_free()
: <a class="el" href="linkhash_8h.html#a81653acf740cf8c9fe672e6cd16df0cf">linkhash.h</a>
</li>
<li>lh_table_head()
: <a class="el" href="linkhash_8h.html#a3bacf1f7c40830c20440fd95d493f35f">linkhash.h</a>
</li>
<li>lh_table_insert()
: <a class="el" href="linkhash_8h.html#a86c0cd547be1e2c2486a73bd58e1352c">linkhash.h</a>
</li>
<li>lh_table_insert_w_hash()
: <a class="el" href="linkhash_8h.html#a4558a9347a422e03a15b0b7a29b82dc3">linkhash.h</a>
</li>
<li>lh_table_length()
: <a class="el" href="linkhash_8h.html#ac9ba631c91fe80fb905f04c7cd526f2b">linkhash.h</a>
</li>
<li>lh_table_lookup_entry()
: <a class="el" href="linkhash_8h.html#ad3b6ca2d967a6c3021ee6c39e014a918">linkhash.h</a>
</li>
<li>lh_table_lookup_entry_w_hash()
: <a class="el" href="linkhash_8h.html#a59ecaf34ef59280952f4459b2de63677">linkhash.h</a>
</li>
<li>lh_table_lookup_ex()
: <a class="el" href="linkhash_8h.html#a81c270bb0dd9d5c8a3e7ae20bc4d67f3">linkhash.h</a>
</li>
<li>lh_table_new()
: <a class="el" href="linkhash_8h.html#a9c4f8a71dbe4d3390d9f7adb331beb0e">linkhash.h</a>
</li>
<li>lh_table_resize()
: <a class="el" href="linkhash_8h.html#a30c8414e31aeee7669acc938116d933f">linkhash.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>

112
doc/html/globals_0x70.html Normal file
View File

@@ -0,0 +1,112 @@
<!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 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 -->
<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_p"></a>- p -</h3><ul>
<li>PRId64
: <a class="el" href="json__inttypes_8h.html#ae372e90b62c1e8b51dc5d95bf7f5ba48">json_inttypes.h</a>
</li>
<li>printbuf
: <a class="el" href="printbuf_8h.html#ace274df280df67463ff417b1b3392395">printbuf.h</a>
</li>
<li>printbuf_free()
: <a class="el" href="printbuf_8h.html#a2b744266191ef5e3102fbf910e790a98">printbuf.h</a>
</li>
<li>printbuf_length
: <a class="el" href="printbuf_8h.html#acdd84ad88987c0166b7ba0e3f1f8f1bb">printbuf.h</a>
</li>
<li>printbuf_memappend()
: <a class="el" href="printbuf_8h.html#a9c193d30e9ca4936ea28a6c9e8e4f6f0">printbuf.h</a>
</li>
<li>printbuf_memappend_fast
: <a class="el" href="printbuf_8h.html#a6f3a4dc87fab41c37e3eff42f40dc346">printbuf.h</a>
</li>
<li>printbuf_memset()
: <a class="el" href="printbuf_8h.html#a93a27f4f8a092c58666724de23ae804d">printbuf.h</a>
</li>
<li>printbuf_new()
: <a class="el" href="printbuf_8h.html#a645670fa132f0ae9a75f43c0b464bdaf">printbuf.h</a>
</li>
<li>printbuf_reset()
: <a class="el" href="printbuf_8h.html#a705c62167df13e65e04de9ae60f6e136">printbuf.h</a>
</li>
<li>printbuf_strappend
: <a class="el" href="printbuf_8h.html#a2f30492682f5fbc59a8749b428e0e4ba">printbuf.h</a>
</li>
<li>PRIu64
: <a class="el" href="json__inttypes_8h.html#ac582131d7a7c8ee57e73180d1714f9d5">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

@@ -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 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 -->
<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_s"></a>- s -</h3><ul>
<li>SCNd64
: <a class="el" href="json__inttypes_8h.html#ae7044b3fb4cc5cde22155d59437c348f">json_inttypes.h</a>
</li>
<li>sprintbuf()
: <a class="el" href="printbuf_8h.html#a61f6bc0b1ca5787f0faca6799d61a0bb">printbuf.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,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>

245
doc/html/globals_defs.html Normal file
View File

@@ -0,0 +1,245 @@
<!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><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 class="current"><a href="globals_defs.html"><span>Macros</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_a"><span>a</span></a></li>
<li><a href="#index_j"><span>j</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_p"><span>p</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
&#160;
<h3><a class="anchor" id="index_a"></a>- a -</h3><ul>
<li>ARRAY_LIST_DEFAULT_SIZE
: <a class="el" href="arraylist_8h.html#acd30d910b398421574eb1f59e78617f5">arraylist.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_j"></a>- j -</h3><ul>
<li>JSON_C_CONST_FUNCTION
: <a class="el" href="json__object_8h.html#a878f59e029f19db79ff9eb41fdcf4c6d">json_object.h</a>
</li>
<li>JSON_C_MAJOR_VERSION
: <a class="el" href="json__c__version_8h.html#a251c3e1f59a379a4a905382b4e855125">json_c_version.h</a>
</li>
<li>JSON_C_MICRO_VERSION
: <a class="el" href="json__c__version_8h.html#a64457730097067ab096906d82e4a51a6">json_c_version.h</a>
</li>
<li>JSON_C_MINOR_VERSION
: <a class="el" href="json__c__version_8h.html#adc87477fbc1c75848fe6b6feec21c2d6">json_c_version.h</a>
</li>
<li>JSON_C_OBJECT_ADD_CONSTANT_KEY
: <a class="el" href="json__object_8h.html#a4d303af657ca4ee8e487366ba9692c94">json_object.h</a>
</li>
<li>JSON_C_OBJECT_ADD_KEY_IS_NEW
: <a class="el" href="json__object_8h.html#a8cd01c484155ac99043a35b7c85ae411">json_object.h</a>
</li>
<li>JSON_C_OBJECT_KEY_IS_CONSTANT
: <a class="el" href="json__object_8h.html#a134ffafc6116799a20134dc7646b5a37">json_object.h</a>
</li>
<li>JSON_C_OPTION_GLOBAL
: <a class="el" href="json__object_8h.html#a45837b8c6564f9e605f8a2bc76243750">json_object.h</a>
</li>
<li>JSON_C_OPTION_THREAD
: <a class="el" href="json__object_8h.html#a50d1490598fe476d7a53e204e02cdc9d">json_object.h</a>
</li>
<li>JSON_C_STR_HASH_DFLT
: <a class="el" href="linkhash_8h.html#ac32e80138c5be6dd9b0483a9cbcc8799">linkhash.h</a>
</li>
<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>
<li>JSON_C_TO_STRING_NOZERO
: <a class="el" href="json__object_8h.html#a34f027c147babf69fc530d088f2b49b0">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_PLAIN
: <a class="el" href="json__object_8h.html#a3294cb92765cdeb497cfd346644d1059">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_PRETTY
: <a class="el" href="json__object_8h.html#a2025bc677c35f130e117dfda5bf1ef73">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_PRETTY_TAB
: <a class="el" href="json__object_8h.html#afc1486af21f6b1653c6f523025bdfd3b">json_object.h</a>
</li>
<li>JSON_C_TO_STRING_SPACED
: <a class="el" href="json__object_8h.html#aa821746c8668e6ad62bed90ec9e00103">json_object.h</a>
</li>
<li>JSON_C_VERSION
: <a class="el" href="json__c__version_8h.html#a894adda66a072bc3fd34ebe91a5aa7f4">json_c_version.h</a>
</li>
<li>JSON_C_VERSION_NUM
: <a class="el" href="json__c__version_8h.html#a78e176eee75ee6aed43c4d65ca4c5b44">json_c_version.h</a>
</li>
<li>JSON_C_VISIT_RETURN_CONTINUE
: <a class="el" href="json__visit_8h.html#a98b35e1ba1d52d41799dccbfd2c170a1">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_ERROR
: <a class="el" href="json__visit_8h.html#abfacb0713b81c897a8ce5f37ff6ffb9c">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_POP
: <a class="el" href="json__visit_8h.html#a327a21f1f1c6f84e7a13fbaaf4a51b13">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_SKIP
: <a class="el" href="json__visit_8h.html#adc7ca60a79c4ae870d9463e41527c2a1">json_visit.h</a>
</li>
<li>JSON_C_VISIT_RETURN_STOP
: <a class="el" href="json__visit_8h.html#a5956f41bed48f90a127f9b37fad7ea97">json_visit.h</a>
</li>
<li>JSON_C_VISIT_SECOND
: <a class="el" href="json__visit_8h.html#ac5be4a96b99b724833943003715dfc1c">json_visit.h</a>
</li>
<li>JSON_EXPORT
: <a class="el" href="json__types_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">json_types.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>
</li>
<li>json_max
: <a class="el" href="json__util_8h.html#a57d63d199d4b9ea40359253618951300">json_util.h</a>
</li>
<li>json_min
: <a class="el" href="json__util_8h.html#a3dde282dc23d0eaa3c4840df8dc262d4">json_util.h</a>
</li>
<li>JSON_OBJECT_DEF_HASH_ENTRIES
: <a class="el" href="json__object_8h.html#a268a63dd1b2e6d81559e268a4529e9bf">json_object.h</a>
</li>
<li>json_object_object_foreach
: <a class="el" href="json__object_8h.html#acf5f514a9e0061c10fc08055762639ee">json_object.h</a>
</li>
<li>json_object_object_foreachC
: <a class="el" href="json__object_8h.html#a71f07006c12d78f7bbf4cb716a5af3a6">json_object.h</a>
</li>
<li>JSON_TOKENER_ALLOW_TRAILING_CHARS
: <a class="el" href="json__tokener_8h.html#aa74428c9cf57655eea5b49feae3f2704">json_tokener.h</a>
</li>
<li>JSON_TOKENER_DEFAULT_DEPTH
: <a class="el" href="json__tokener_8h.html#a5ccd346459feb66e4e0af32005360279">json_tokener.h</a>
</li>
<li>JSON_TOKENER_STRICT
: <a class="el" href="json__tokener_8h.html#a72be595cb7e090c70b1d29feb1cbfb16">json_tokener.h</a>
</li>
<li>JSON_TOKENER_VALIDATE_UTF8
: <a class="el" href="json__tokener_8h.html#a633ab043f2b07fd22420af2b369a260a">json_tokener.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
<li>LH_EMPTY
: <a class="el" href="linkhash_8h.html#a93fad7f8ae44575dc89c9567859972d2">linkhash.h</a>
</li>
<li>lh_foreach
: <a class="el" href="linkhash_8h.html#ad7dd67da915065dce2c6f44cb03e2d82">linkhash.h</a>
</li>
<li>lh_foreach_safe
: <a class="el" href="linkhash_8h.html#abcbb0df08b4976d0649b826b6bacfca1">linkhash.h</a>
</li>
<li>LH_FREED
: <a class="el" href="linkhash_8h.html#ac69428f2de0a6fb080b6fb373d506aa7">linkhash.h</a>
</li>
<li>LH_LOAD_FACTOR
: <a class="el" href="linkhash_8h.html#a66b61772c29d85eb52b697e0b0dc0aaf">linkhash.h</a>
</li>
<li>LH_PRIME
: <a class="el" href="linkhash_8h.html#a032f1bd115df254dda325437203ce5fb">linkhash.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>PRId64
: <a class="el" href="json__inttypes_8h.html#ae372e90b62c1e8b51dc5d95bf7f5ba48">json_inttypes.h</a>
</li>
<li>printbuf_length
: <a class="el" href="printbuf_8h.html#acdd84ad88987c0166b7ba0e3f1f8f1bb">printbuf.h</a>
</li>
<li>printbuf_memappend_fast
: <a class="el" href="printbuf_8h.html#a6f3a4dc87fab41c37e3eff42f40dc346">printbuf.h</a>
</li>
<li>printbuf_strappend
: <a class="el" href="printbuf_8h.html#a2f30492682f5fbc59a8749b428e0e4ba">printbuf.h</a>
</li>
<li>PRIu64
: <a class="el" href="json__inttypes_8h.html#ac582131d7a7c8ee57e73180d1714f9d5">json_inttypes.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>SCNd64
: <a class="el" href="json__inttypes_8h.html#ae7044b3fb4cc5cde22155d59437c348f">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

@@ -0,0 +1,75 @@
<!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><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 class="current"><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><!-- top -->
<div class="contents">
&#160;<ul>
<li>json_tokener_error
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59">json_tokener.h</a>
</li>
<li>json_tokener_state
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2">json_tokener.h</a>
</li>
<li>json_type
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06c">json_types.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>

226
doc/html/globals_eval.html Normal file
View File

@@ -0,0 +1,226 @@
<!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><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 class="current"><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="#index_j"><span>j</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
&#160;
<h3><a class="anchor" id="index_j"></a>- j -</h3><ul>
<li>json_tokener_continue
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a9b26e920ca765df91c84e999561d8fb0">json_tokener.h</a>
</li>
<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>
<li>json_tokener_error_parse_boolean
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59addbdfe084e20709da3d20c8ae8ca278c">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_comment
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a3588c05b1da8b909a8cbdef66b0a1a28">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_eof
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a8f774f4c7869afdd9b92295fca3a9ded">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_null
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a641bbb8d881fdd1e463f20a1a203b77c">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_number
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59ab1b3ad685eb97235d269cc5b9eb7ab81">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_object_key_name
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a2003bd8e96c6680cd22419c5ceafd4c0">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_object_key_sep
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59af91a2a819b0d6344d6d4e1d2579f28fd">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_object_value_sep
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a9ddb98741aebf7ac44735b4a43717013">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_string
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a033ce89ce7b8f9e591e4bea92121c4c7">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_unexpected
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a3309fa8ea4ab3ee0a81c55b69d223710">json_tokener.h</a>
</li>
<li>json_tokener_error_parse_utf8_string
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59ab405d4a1282f3b037048d3456869a4c1">json_tokener.h</a>
</li>
<li>json_tokener_error_size
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59a1eeed74de65c0c12c9f9c28cf4f3ff1d">json_tokener.h</a>
</li>
<li>json_tokener_state_array
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ab3d763300f1914865be09d603ddc11f4">json_tokener.h</a>
</li>
<li>json_tokener_state_array_add
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2aa2a01798ebe318ea91c38a886418f771">json_tokener.h</a>
</li>
<li>json_tokener_state_array_after_sep
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ab1a0ad626ec662c1ba4fb5bfee1cd0a9">json_tokener.h</a>
</li>
<li>json_tokener_state_array_sep
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a4ec7762aeab3424cbb14354c94025865">json_tokener.h</a>
</li>
<li>json_tokener_state_boolean
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a3525b15ecd0a698281b3914115b6bd3e">json_tokener.h</a>
</li>
<li>json_tokener_state_comment
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a8c2680b8873a8dce85f0b1ac25882dc9">json_tokener.h</a>
</li>
<li>json_tokener_state_comment_end
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a62cef297a37a98b1239ea4bbd39723e1">json_tokener.h</a>
</li>
<li>json_tokener_state_comment_eol
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ad8151350b1ef50298bafbab244ac1162">json_tokener.h</a>
</li>
<li>json_tokener_state_comment_start
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a0ff1d1935d49188aa1e6b998d43e655c">json_tokener.h</a>
</li>
<li>json_tokener_state_eatws
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a9db152607ec1872a000f1fcd8757297d">json_tokener.h</a>
</li>
<li>json_tokener_state_escape_unicode
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a6c852da2e694be56799c58c201d6dca0">json_tokener.h</a>
</li>
<li>json_tokener_state_escape_unicode_need_escape
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a482827c786d2378635ef54dc2b092264">json_tokener.h</a>
</li>
<li>json_tokener_state_escape_unicode_need_u
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a5cab1cdfea9128e0ed9db85ffdc71df4">json_tokener.h</a>
</li>
<li>json_tokener_state_finish
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ad80b689cb709967b67a348de3d8601d2">json_tokener.h</a>
</li>
<li>json_tokener_state_inf
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ab9f6244bfca4924db61ed3050c780b53">json_tokener.h</a>
</li>
<li>json_tokener_state_null
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a668fb2654c59608945370003403a5792">json_tokener.h</a>
</li>
<li>json_tokener_state_number
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a7ce18d281d322af690b45f3b8b599e81">json_tokener.h</a>
</li>
<li>json_tokener_state_object_field
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a77375940a10806e81d99876d13be67fc">json_tokener.h</a>
</li>
<li>json_tokener_state_object_field_end
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a0220aea1d9204aadfffde92c7f73f5f7">json_tokener.h</a>
</li>
<li>json_tokener_state_object_field_start
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a8c7dbda177a5d83a36a64f7cb99b9a29">json_tokener.h</a>
</li>
<li>json_tokener_state_object_field_start_after_sep
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a3a2c9cf26d076936a10a6ae3ca4eb523">json_tokener.h</a>
</li>
<li>json_tokener_state_object_sep
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2adaf3e06c5fc04fd4f04040cd67698215">json_tokener.h</a>
</li>
<li>json_tokener_state_object_value
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a4c7b7deac37355491572f6da84f208aa">json_tokener.h</a>
</li>
<li>json_tokener_state_object_value_add
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2ade6bee72f2147e634b19eb84e58eb162">json_tokener.h</a>
</li>
<li>json_tokener_state_start
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a7c4c0bed1ebde45f5a99de4278792d72">json_tokener.h</a>
</li>
<li>json_tokener_state_string
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2aa90ea4c327a285bfbbce49d42d491d65">json_tokener.h</a>
</li>
<li>json_tokener_state_string_escape
: <a class="el" href="json__tokener_8h.html#af026dec71e4548e6200eb2f902f1c4e2a1cf793d73587f68c4f2b3b4f65ff728e">json_tokener.h</a>
</li>
<li>json_tokener_success
: <a class="el" href="json__tokener_8h.html#a0a31f0df8a532ef8be5c09ba40eacb59afe2fa9bde03155019b2df30f66a5fcd0">json_tokener.h</a>
</li>
<li>json_type_array
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cae536c8c9da4648e6b9348abddde6113c">json_types.h</a>
</li>
<li>json_type_boolean
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06ca5d15299e90dbb9935ff6d3e2c22a285c">json_types.h</a>
</li>
<li>json_type_double
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cac6ac2d9a16577d00210fea64d16b47cd">json_types.h</a>
</li>
<li>json_type_int
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06ca7bf325c213b43c5f970ae2d4443ab956">json_types.h</a>
</li>
<li>json_type_null
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06ca127e62d156e13517471fcde3378979c1">json_types.h</a>
</li>
<li>json_type_object
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cac966c8008f0b2c07da59ee8a60ad440f">json_types.h</a>
</li>
<li>json_type_string
: <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06cac9f56e57c09245522d764015a054faa6">json_types.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>

507
doc/html/globals_func.html Normal file
View File

@@ -0,0 +1,507 @@
<!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><a href="globals.html"><span>All</span></a></li>
<li class="current"><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="#index_a"><span>a</span></a></li>
<li><a href="#index_j"><span>j</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_p"><span>p</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
&#160;
<h3><a class="anchor" id="index_a"></a>- a -</h3><ul>
<li>array_list_add()
: <a class="el" href="arraylist_8h.html#a6e995608aa464244ff3184fb43574dc8">arraylist.h</a>
</li>
<li>array_list_bsearch()
: <a class="el" href="arraylist_8h.html#ac5d066b971fee72ce80084c1694109e3">arraylist.h</a>
</li>
<li>array_list_del_idx()
: <a class="el" href="arraylist_8h.html#aecedd8601ee96e2fd8eff5d83fda89ab">arraylist.h</a>
</li>
<li>array_list_free()
: <a class="el" href="arraylist_8h.html#acd00fb70f7ca82f23b48b812c3498f67">arraylist.h</a>
</li>
<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>
<li>array_list_new()
: <a class="el" href="arraylist_8h.html#a0d4bfac055dfd98e17296142abf4d894">arraylist.h</a>
</li>
<li>array_list_new2()
: <a class="el" href="arraylist_8h.html#ae3e43dc68f5d1815f3aaa36916602e45">arraylist.h</a>
</li>
<li>array_list_put_idx()
: <a class="el" href="arraylist_8h.html#a9f92076e9d8229f8a07e536dc286f811">arraylist.h</a>
</li>
<li>array_list_shrink()
: <a class="el" href="arraylist_8h.html#aff21b2a00573f8f0085b81ce1de1a850">arraylist.h</a>
</li>
<li>array_list_sort()
: <a class="el" href="arraylist_8h.html#afb67cc8e2e5c9be41c3e644536079169">arraylist.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_j"></a>- j -</h3><ul>
<li>json_c_object_sizeof()
: <a class="el" href="json__object_8h.html#af50be932ec85694ae40141b46901bd00">json_object.h</a>
</li>
<li>json_c_set_serialization_double_format()
: <a class="el" href="json__object_8h.html#ac099272b46fde595831118720b155656">json_object.h</a>
</li>
<li>json_c_version()
: <a class="el" href="json__c__version_8h.html#a1c42f6f71943775e2696c47951989711">json_c_version.h</a>
</li>
<li>json_c_version_num()
: <a class="el" href="json__c__version_8h.html#a860ee32b09f4faf38d73771a6ed193ed">json_c_version.h</a>
</li>
<li>json_c_visit()
: <a class="el" href="json__visit_8h.html#a0f585e56a5d417381cdf6c28538dbb20">json_visit.h</a>
</li>
<li>json_global_set_string_hash()
: <a class="el" href="linkhash_8h.html#ac8e1d61af44d9c0824d8c7980385bcd3">linkhash.h</a>
</li>
<li>json_object_array_add()
: <a class="el" href="json__object_8h.html#a18cdd9a7455e09f36cdf6e5756b7f586">json_object.h</a>
</li>
<li>json_object_array_bsearch()
: <a class="el" href="json__object_8h.html#aed353084ed3ad84e7b7575afbe7e719d">json_object.h</a>
</li>
<li>json_object_array_del_idx()
: <a class="el" href="json__object_8h.html#a722eca9f578704d3af38b97549242c1f">json_object.h</a>
</li>
<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>
<li>json_object_array_put_idx()
: <a class="el" href="json__object_8h.html#a1ac0ccdbc13a25da7d8b2dc9e421dfad">json_object.h</a>
</li>
<li>json_object_array_shrink()
: <a class="el" href="json__object_8h.html#a95552402a95c9470b230052d92270247">json_object.h</a>
</li>
<li>json_object_array_sort()
: <a class="el" href="json__object_8h.html#a5584e2f2051cd1faa7fafd07ba888fd1">json_object.h</a>
</li>
<li>json_object_deep_copy()
: <a class="el" href="json__object_8h.html#aaac16505f13bc56accfad82604d8bcdc">json_object.h</a>
</li>
<li>json_object_double_to_json_string()
: <a class="el" href="json__object_8h.html#ada262c62364e3819b6a64b1e3a632336">json_object.h</a>
</li>
<li>json_object_equal()
: <a class="el" href="json__object_8h.html#a5a1d4640525e0217059868e312f20579">json_object.h</a>
</li>
<li>json_object_from_fd()
: <a class="el" href="json__util_8h.html#a5b72bf6f3ac8fb03da38d2e2d1e18d1b">json_util.h</a>
</li>
<li>json_object_from_fd_ex()
: <a class="el" href="json__util_8h.html#a88c5c7ce735d95f6c3c81c73475e14aa">json_util.h</a>
</li>
<li>json_object_from_file()
: <a class="el" href="json__util_8h.html#a03119ec0a71af4eee95318e9b2aaf05b">json_util.h</a>
</li>
<li>json_object_get()
: <a class="el" href="json__object_8h.html#a675aa3a9cced685dbfd1c1a770a0c3e4">json_object.h</a>
</li>
<li>json_object_get_array()
: <a class="el" href="json__object_8h.html#a23d20e3f886c1638a7116be66b7b5ec2">json_object.h</a>
</li>
<li>json_object_get_boolean()
: <a class="el" href="json__object_8h.html#ac003fb99db7ecd674bb16d983d2f92ee">json_object.h</a>
</li>
<li>json_object_get_double()
: <a class="el" href="json__object_8h.html#a94a70cff6a14398b581b7b10b0792c5b">json_object.h</a>
</li>
<li>json_object_get_int()
: <a class="el" href="json__object_8h.html#a8c56dc58a02f92cd6789ba5dcb9fe7b1">json_object.h</a>
</li>
<li>json_object_get_int64()
: <a class="el" href="json__object_8h.html#a1a14750b3af4df18ec8dc93b090a8e8a">json_object.h</a>
</li>
<li>json_object_get_object()
: <a class="el" href="json__object_8h.html#a2caa52ae1863bd073444f3737138a4db">json_object.h</a>
</li>
<li>json_object_get_string()
: <a class="el" href="json__object_8h.html#a9ee29ca8d79896e15007131527f6002e">json_object.h</a>
</li>
<li>json_object_get_string_len()
: <a class="el" href="json__object_8h.html#ac1d1f95a27a5e5d93bb66a8adfc1a2f4">json_object.h</a>
</li>
<li>json_object_get_type()
: <a class="el" href="json__object_8h.html#af256a3a7910e271a2b9735e5044c3827">json_object.h</a>
</li>
<li>json_object_get_uint64()
: <a class="el" href="json__object_8h.html#a82c27579b6d25d9d0eb3b72758d8b71d">json_object.h</a>
</li>
<li>json_object_get_userdata()
: <a class="el" href="json__object_8h.html#ae925f3ec0f61cba5ea3dd50e0315f194">json_object.h</a>
</li>
<li>json_object_int_inc()
: <a class="el" href="json__object_8h.html#a25691322b2d1ab24a3797e5752eb659f">json_object.h</a>
</li>
<li>json_object_is_type()
: <a class="el" href="json__object_8h.html#a8ab506a3d8f4ba5eb6a12ce0a6bbd37b">json_object.h</a>
</li>
<li>json_object_iter_begin()
: <a class="el" href="json__object__iterator_8h.html#afdcd32f83dd8f20e25669f197fb7bde9">json_object_iterator.h</a>
</li>
<li>json_object_iter_end()
: <a class="el" href="json__object__iterator_8h.html#a381fbae848a3268013110002d553c32e">json_object_iterator.h</a>
</li>
<li>json_object_iter_equal()
: <a class="el" href="json__object__iterator_8h.html#a9cbb250d185348e8b193a886c35ae39e">json_object_iterator.h</a>
</li>
<li>json_object_iter_init_default()
: <a class="el" href="json__object__iterator_8h.html#ae93958fa755852192553f1686d248cd1">json_object_iterator.h</a>
</li>
<li>json_object_iter_next()
: <a class="el" href="json__object__iterator_8h.html#a8a152d153844f1ec1698419abae8c2e4">json_object_iterator.h</a>
</li>
<li>json_object_iter_peek_name()
: <a class="el" href="json__object__iterator_8h.html#adbbc3583aef14d9416a0fc8dbf750727">json_object_iterator.h</a>
</li>
<li>json_object_iter_peek_value()
: <a class="el" href="json__object__iterator_8h.html#ad8fe9251ca04af4d8e6840a44de7984b">json_object_iterator.h</a>
</li>
<li>json_object_new_array()
: <a class="el" href="json__object_8h.html#a84f7f8c0774c4600d958561d7548d649">json_object.h</a>
</li>
<li>json_object_new_array_ext()
: <a class="el" href="json__object_8h.html#a62af9fb3b02fb153190369d949394b26">json_object.h</a>
</li>
<li>json_object_new_boolean()
: <a class="el" href="json__object_8h.html#a2e290acd80e72cca745f89fb4600fb78">json_object.h</a>
</li>
<li>json_object_new_double()
: <a class="el" href="json__object_8h.html#a594a093bafb9091f843da3197e0638aa">json_object.h</a>
</li>
<li>json_object_new_double_s()
: <a class="el" href="json__object_8h.html#ae49671c026fe1ada370a75321e4e65f6">json_object.h</a>
</li>
<li>json_object_new_int()
: <a class="el" href="json__object_8h.html#ae92f0770fb4b3c884ce35de52d3d7de8">json_object.h</a>
</li>
<li>json_object_new_int64()
: <a class="el" href="json__object_8h.html#a7847f74494645c2b076505c37cc4cb93">json_object.h</a>
</li>
<li>json_object_new_null()
: <a class="el" href="json__object_8h.html#a29e23b5be729c679960242b3b81bcde0">json_object.h</a>
</li>
<li>json_object_new_object()
: <a class="el" href="json__object_8h.html#a68c383f54544fca19b5f2425be397600">json_object.h</a>
</li>
<li>json_object_new_string()
: <a class="el" href="json__object_8h.html#a7b7b5302b3903c9347eeb1f4a64d657b">json_object.h</a>
</li>
<li>json_object_new_string_len()
: <a class="el" href="json__object_8h.html#a778a1aa34a508d08daac3bdb83e24b52">json_object.h</a>
</li>
<li>json_object_new_uint64()
: <a class="el" href="json__object_8h.html#aa602ee5f6182b35f3f75a927320b4efd">json_object.h</a>
</li>
<li>json_object_object_add()
: <a class="el" href="json__object_8h.html#a27bd808a022251059a43f1f6370441cd">json_object.h</a>
</li>
<li>json_object_object_add_ex()
: <a class="el" href="json__object_8h.html#a57d3e444dd7db6b4510d21bf3716a002">json_object.h</a>
</li>
<li>json_object_object_del()
: <a class="el" href="json__object_8h.html#ac6605fdafca20bd5d33c84f4f80a3bda">json_object.h</a>
</li>
<li>json_object_object_get()
: <a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object.h</a>
</li>
<li>json_object_object_get_ex()
: <a class="el" href="json__object_8h.html#a90d5f16d58636f01d2ed1a6030c7366a">json_object.h</a>
</li>
<li>json_object_object_length()
: <a class="el" href="json__object_8h.html#ad59a0ad2ec914a5eef90af53acae06d9">json_object.h</a>
</li>
<li>json_object_put()
: <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object.h</a>
</li>
<li>json_object_set_boolean()
: <a class="el" href="json__object_8h.html#a23863c1503f3a8dd8a460a6405da0a65">json_object.h</a>
</li>
<li>json_object_set_double()
: <a class="el" href="json__object_8h.html#a3a7b7ce585565558cb69dad8d45d7757">json_object.h</a>
</li>
<li>json_object_set_int()
: <a class="el" href="json__object_8h.html#a4ab3568f12e01fd2967e765a72456caa">json_object.h</a>
</li>
<li>json_object_set_int64()
: <a class="el" href="json__object_8h.html#a7d3948600dde732abed0e261264ef53a">json_object.h</a>
</li>
<li>json_object_set_serializer()
: <a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object.h</a>
</li>
<li>json_object_set_string()
: <a class="el" href="json__object_8h.html#ac35013e51cdc0651512801c947df431c">json_object.h</a>
</li>
<li>json_object_set_string_len()
: <a class="el" href="json__object_8h.html#ae48707a0c8689e14aaa3a9b831db27fc">json_object.h</a>
</li>
<li>json_object_set_uint64()
: <a class="el" href="json__object_8h.html#a9900aa9a425e6f14e295b298460b65d4">json_object.h</a>
</li>
<li>json_object_set_userdata()
: <a class="el" href="json__object_8h.html#a4ee4281ccd123c62878e931a0a3bc43b">json_object.h</a>
</li>
<li>json_object_to_fd()
: <a class="el" href="json__util_8h.html#afd492c120e359d2d75b67da96b580661">json_util.h</a>
</li>
<li>json_object_to_file()
: <a class="el" href="json__util_8h.html#a486fc95fafe7cb91c58c7f6487036bc5">json_util.h</a>
</li>
<li>json_object_to_file_ext()
: <a class="el" href="json__util_8h.html#a68a7385c555cf21797e361d1d4de3441">json_util.h</a>
</li>
<li>json_object_to_json_string()
: <a class="el" href="json__object_8h.html#ab7390c22baa1700d977c2af6b22d43a4">json_object.h</a>
</li>
<li>json_object_to_json_string_ext()
: <a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object.h</a>
</li>
<li>json_object_to_json_string_length()
: <a class="el" href="json__object_8h.html#add3770a3ba3d01a8f9adedfcd6bd8dbb">json_object.h</a>
</li>
<li>json_parse_double()
: <a class="el" href="json__util_8h.html#a3f0f0b8f29a41b47d62e6c867707be50">json_util.h</a>
</li>
<li>json_parse_int64()
: <a class="el" href="json__util_8h.html#a9d9a63936cdae6639b9cdd87fdd13506">json_util.h</a>
</li>
<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>
<li>json_tokener_error_desc()
: <a class="el" href="json__tokener_8h.html#af060dd6b593b3b710044bcb97dcec07f">json_tokener.h</a>
</li>
<li>json_tokener_free()
: <a class="el" href="json__tokener_8h.html#a887c4661906fc6b36cc366304e522534">json_tokener.h</a>
</li>
<li>json_tokener_get_error()
: <a class="el" href="json__tokener_8h.html#af5d7ffd95a0f6e5d5bb5994d233b4197">json_tokener.h</a>
</li>
<li>json_tokener_get_parse_end()
: <a class="el" href="json__tokener_8h.html#a4a2fa28d815f8b370cbb00b80ebc0f1d">json_tokener.h</a>
</li>
<li>json_tokener_new()
: <a class="el" href="json__tokener_8h.html#a5ac7e2c350bc592cf2fa7b9935b00ef5">json_tokener.h</a>
</li>
<li>json_tokener_new_ex()
: <a class="el" href="json__tokener_8h.html#a6a1583ddd434e13515d6232de813462e">json_tokener.h</a>
</li>
<li>json_tokener_parse()
: <a class="el" href="json__tokener_8h.html#a236ef64d079822a4411d13eae7190c4d">json_tokener.h</a>
</li>
<li>json_tokener_parse_ex()
: <a class="el" href="json__tokener_8h.html#a61679f178111963a9ffa3c8179553f7a">json_tokener.h</a>
</li>
<li>json_tokener_parse_verbose()
: <a class="el" href="json__tokener_8h.html#a735f2dc755d57ed5c5b807aaaaef3b14">json_tokener.h</a>
</li>
<li>json_tokener_reset()
: <a class="el" href="json__tokener_8h.html#a238649a59737be5152d525aeaf4153ab">json_tokener.h</a>
</li>
<li>json_tokener_set_flags()
: <a class="el" href="json__tokener_8h.html#a7e7a0c0c9dc79e5e47b2608bb8aad7b7">json_tokener.h</a>
</li>
<li>json_type_to_name()
: <a class="el" href="json__util_8h.html#a762aaf3df0a9c7b6919cdc1035348012">json_util.h</a>
</li>
<li>json_util_get_last_err()
: <a class="el" href="json__util_8h.html#a9fe4dbb5fe32850cdc22a97454e4500b">json_util.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
<li>lh_entry_k()
: <a class="el" href="linkhash_8h.html#a82e5d699ba2fd4c520352c003f8554a5">linkhash.h</a>
</li>
<li>lh_entry_k_is_constant()
: <a class="el" href="linkhash_8h.html#a724c308f1c606271ea3deb01ed9e3cc9">linkhash.h</a>
</li>
<li>lh_entry_next()
: <a class="el" href="linkhash_8h.html#a603f6f2cc6d292a160b09b357c7a0a69">linkhash.h</a>
</li>
<li>lh_entry_prev()
: <a class="el" href="linkhash_8h.html#a965145d36d3e00eae825c692205d2f81">linkhash.h</a>
</li>
<li>lh_entry_set_val()
: <a class="el" href="linkhash_8h.html#ad94e87a8ef92ee6371e5314b7241e635">linkhash.h</a>
</li>
<li>lh_entry_v()
: <a class="el" href="linkhash_8h.html#ab163f65568af863f3738ccd05900745e">linkhash.h</a>
</li>
<li>lh_get_hash()
: <a class="el" href="linkhash_8h.html#a33c74c884530d407d0b3baa365238fb4">linkhash.h</a>
</li>
<li>lh_kchar_table_new()
: <a class="el" href="linkhash_8h.html#a6bf630754affe92612639542a6c49c3f">linkhash.h</a>
</li>
<li>lh_kptr_table_new()
: <a class="el" href="linkhash_8h.html#af8108563b961dbf5471fe2c0e51f40a5">linkhash.h</a>
</li>
<li>lh_table_delete()
: <a class="el" href="linkhash_8h.html#a2fed2c78f70d229edb2d00775ffe593c">linkhash.h</a>
</li>
<li>lh_table_delete_entry()
: <a class="el" href="linkhash_8h.html#ae5885a71c3457190fb1dc2d6e20dde3b">linkhash.h</a>
</li>
<li>lh_table_free()
: <a class="el" href="linkhash_8h.html#a81653acf740cf8c9fe672e6cd16df0cf">linkhash.h</a>
</li>
<li>lh_table_head()
: <a class="el" href="linkhash_8h.html#a3bacf1f7c40830c20440fd95d493f35f">linkhash.h</a>
</li>
<li>lh_table_insert()
: <a class="el" href="linkhash_8h.html#a86c0cd547be1e2c2486a73bd58e1352c">linkhash.h</a>
</li>
<li>lh_table_insert_w_hash()
: <a class="el" href="linkhash_8h.html#a4558a9347a422e03a15b0b7a29b82dc3">linkhash.h</a>
</li>
<li>lh_table_length()
: <a class="el" href="linkhash_8h.html#ac9ba631c91fe80fb905f04c7cd526f2b">linkhash.h</a>
</li>
<li>lh_table_lookup_entry()
: <a class="el" href="linkhash_8h.html#ad3b6ca2d967a6c3021ee6c39e014a918">linkhash.h</a>
</li>
<li>lh_table_lookup_entry_w_hash()
: <a class="el" href="linkhash_8h.html#a59ecaf34ef59280952f4459b2de63677">linkhash.h</a>
</li>
<li>lh_table_lookup_ex()
: <a class="el" href="linkhash_8h.html#a81c270bb0dd9d5c8a3e7ae20bc4d67f3">linkhash.h</a>
</li>
<li>lh_table_new()
: <a class="el" href="linkhash_8h.html#a9c4f8a71dbe4d3390d9f7adb331beb0e">linkhash.h</a>
</li>
<li>lh_table_resize()
: <a class="el" href="linkhash_8h.html#a30c8414e31aeee7669acc938116d933f">linkhash.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>printbuf_free()
: <a class="el" href="printbuf_8h.html#a2b744266191ef5e3102fbf910e790a98">printbuf.h</a>
</li>
<li>printbuf_memappend()
: <a class="el" href="printbuf_8h.html#a9c193d30e9ca4936ea28a6c9e8e4f6f0">printbuf.h</a>
</li>
<li>printbuf_memset()
: <a class="el" href="printbuf_8h.html#a93a27f4f8a092c58666724de23ae804d">printbuf.h</a>
</li>
<li>printbuf_new()
: <a class="el" href="printbuf_8h.html#a645670fa132f0ae9a75f43c0b464bdaf">printbuf.h</a>
</li>
<li>printbuf_reset()
: <a class="el" href="printbuf_8h.html#a705c62167df13e65e04de9ae60f6e136">printbuf.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>sprintbuf()
: <a class="el" href="printbuf_8h.html#a61f6bc0b1ca5787f0faca6799d61a0bb">printbuf.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>

129
doc/html/globals_type.html Normal file
View File

@@ -0,0 +1,129 @@
<!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><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 class="current"><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><!-- top -->
<div class="contents">
&#160;<ul>
<li>array_list
: <a class="el" href="arraylist_8h.html#a6d6d32d8b026ea2025df519b9e90f44a">arraylist.h</a>
</li>
<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>
<li>json_c_shallow_copy_fn
: <a class="el" href="json__object_8h.html#af4562514916f62ea56adf752ada10b52">json_object.h</a>
</li>
<li>json_c_visit_userfunc
: <a class="el" href="json__visit_8h.html#a0fadec4abb2befcacfaff7df822f3f8d">json_visit.h</a>
</li>
<li>json_object
: <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_types.h</a>
</li>
<li>json_object_delete_fn
: <a class="el" href="json__types_8h.html#aa647d7c567a06abe1a1a511f6d6860e4">json_types.h</a>
</li>
<li>json_object_iter
: <a class="el" href="json__types_8h.html#af88126730e765f2068968f4b16fd074f">json_types.h</a>
</li>
<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>
<li>json_type
: <a class="el" href="json__types_8h.html#aba5eff84f8638d22f50403175f270c96">json_types.h</a>
</li>
<li>lh_entry_free_fn
: <a class="el" href="linkhash_8h.html#a671553d0ee3c2a123190ba0f8ed2b635">linkhash.h</a>
</li>
<li>lh_equal_fn
: <a class="el" href="linkhash_8h.html#a91fd85fc81b0c7c83c62f00e84729091">linkhash.h</a>
</li>
<li>lh_hash_fn
: <a class="el" href="linkhash_8h.html#a38bae27995dcfb6ee3fb109a9be229b2">linkhash.h</a>
</li>
<li>lh_table
: <a class="el" href="linkhash_8h.html#a766e90057496fc6712d6be0da180a21f">linkhash.h</a>
</li>
<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 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,75 @@
<!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><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li class="current"><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><!-- top -->
<div class="contents">
&#160;<ul>
<li>json_c_shallow_copy_default
: <a class="el" href="json__object_8h.html#a86ea08e75ddf054742bf806a3bc3f983">json_object.h</a>
</li>
<li>json_object_free_userdata
: <a class="el" href="json__object_8h.html#aff3190c34884bea3b4e65e286b973d89">json_object.h</a>
</li>
<li>json_object_userdata_to_json_string
: <a class="el" href="json__object_8h.html#a56091ddbd2ec6d6200558cbeff1b86b8">json_object.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>

271
doc/html/index.html Normal file
View File

@@ -0,0 +1,271 @@
<!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: Main Page</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 class="current"><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><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">json-c Documentation</div> </div>
</div><!--header-->
<div class="contents">
<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>
</ul>
</li>
<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://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://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>
<p>Test Status</p>
<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>
<h3>Prerequisites: <a class="anchor" id="installprereq"></a></h3>
<ul>
<li><code>gcc</code>, <code>clang</code>, or another C compiler</li>
</ul>
<ul>
<li><code>cmake&gt;=2.8</code>, <code>&gt;=3.16</code> recommended, <code>cmake=&gt;3.1</code> for tests</li>
</ul>
<p>To generate docs you'll also need:</p>
<ul>
<li><code>doxygen&gt;=1.8.13</code></li>
</ul>
<p>If you are on a relatively modern system, you'll likely be able to install the prerequisites using your OS's packaging system.</p>
<h3>Install using apt (e.g. Ubuntu 16.04.2 LTS)</h3>
<pre class="fragment">sudo apt install git
sudo apt install cmake
sudo apt install doxygen # optional
sudo apt install valgrind # optional
</pre><h3>Build instructions: <a class="anchor" id="buildcmds"></a></h3>
<p><code>json-c</code> GitHub repo: <a href="https://github.com/json-c/json-c">https://github.com/json-c/json-c</a> </p>
<pre class="fragment">$ git clone https://github.com/json-c/json-c.git
$ mkdir json-c-build
$ cd json-c-build
$ cmake ../json-c # See CMake section below for custom arguments
</pre><p>Note: it's also possible to put your build directory inside the json-c source directory, or even not use a separate build directory at all, but certain things might not work quite right (notably, <code>make distcheck</code>)</p>
<p>Then: </p>
<pre class="fragment">$ make
$ make test
$ make USE_VALGRIND=0 test # optionally skip using valgrind
$ 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
make doc
google-chrome doc/html/index.html
</pre><h2>CMake Options <a class="anchor" id="CMake"></a></h2>
<p>The json-c library is built with <a href="https://cmake.org/cmake-tutorial/">CMake</a>, which can take a few options.</p>
<table class="doxtable">
<tr>
<th>Variable </th><th>Type </th><th>Description</th></tr>
<tr>
<td>CMAKE_INSTALL_PREFIX </td><td>String </td><td>The install location. </td></tr>
<tr>
<td>CMAKE_BUILD_TYPE </td><td>String </td><td>Defaults to "debug". </td></tr>
<tr>
<td>BUILD_SHARED_LIBS </td><td>Bool </td><td>The default build generates a dynamic (dll/so) library. Set this to OFF to create a static library only. </td></tr>
<tr>
<td>BUILD_STATIC_LIBS </td><td>Bool </td><td>The default build generates a static (lib/a) library. Set this to OFF to create a shared library only. </td></tr>
<tr>
<td>DISABLE_STATIC_FPIC </td><td>Bool </td><td>The default builds position independent code. Set this to OFF to create a shared library only. </td></tr>
<tr>
<td>DISABLE_BSYMBOLIC </td><td>Bool </td><td>Disable use of -Bsymbolic-functions. </td></tr>
<tr>
<td>DISABLE_THREAD_LOCAL_STORAGE </td><td>Bool </td><td>Disable use of Thread-Local Storage (HAVE___THREAD). </td></tr>
<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>
<tr>
<td>OVERRIDE_GET_RANDOM_SEED </td><td>String </td><td>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. </td></tr>
</table>
<p>Pass these options as <code>-D</code> on CMake's command-line. </p>
<pre class="fragment"># build a static library only
cmake -DBUILD_SHARED_LIBS=OFF ..
</pre><h3>Building with partial threading support</h3>
<p>Although json-c does not support fully multi-threaded access to object trees, it has some code to help make its use in threaded programs a bit safer. Currently, this is limited to using atomic operations for <a class="el" href="json__object_8h.html#a675aa3a9cced685dbfd1c1a770a0c3e4">json_object_get()</a> and <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a>.</p>
<p>Since this may have a performance impact, of at least 3x slower according to <a href="https://stackoverflow.com/a/11609063,">https://stackoverflow.com/a/11609063,</a> it is disabled by default. You may turn it on by adjusting your cmake command with: -DENABLE_THREADING=ON</p>
<p>Separately, the default hash function used for object field keys, lh_char_hash, uses a compare-and-swap operation to ensure the random seed is only generated once. Because this is a one-time operation, it is always compiled in when the compare-and-swap operation is available.</p>
<h3>cmake-configure wrapper script</h3>
<p>For those familiar with the old autoconf/autogen.sh/configure method, there is a <code>cmake-configure</code> wrapper script to ease the transition to cmake. </p>
<pre class="fragment">mkdir build
cd build
../cmake-configure --prefix=/some/install/path
make
</pre><p>cmake-configure can take a few options.</p>
<table class="doxtable">
<tr>
<th>options </th><th>Description</th></tr>
<tr>
<td>prefix=PREFIX </td><td>install architecture-independent files in PREFIX </td></tr>
<tr>
<td>enable-threading </td><td>Enable code to support partly multi-threaded use </td></tr>
<tr>
<td>enable-rdrand </td><td>Enable RDRAND Hardware RNG Hash Seed generation on supported x86/x64 platforms. </td></tr>
<tr>
<td>enable-shared </td><td>build shared libraries [default=yes] </td></tr>
<tr>
<td>enable-static </td><td>build static libraries [default=yes] </td></tr>
<tr>
<td>disable-Bsymbolic </td><td>Avoid linking with -Bsymbolic-function </td></tr>
<tr>
<td>disable-werror </td><td>Avoid treating compiler warnings as fatal errors </td></tr>
</table>
<h2>Testing: <a class="anchor" id="testing"></a></h2>
<p>By default, if valgrind is available running tests uses it. That can slow the tests down considerably, so to disable it use: </p>
<pre class="fragment">export USE_VALGRIND=0
</pre><p>To run tests a separate build directory is recommended: </p>
<pre class="fragment">mkdir build-test
cd build-test
# VALGRIND=1 causes -DVALGRIND=1 to be passed when compiling code
# which uses slightly slower, but valgrind-safe code.
VALGRIND=1 cmake ..
make
make test
# By default, if valgrind is available running tests uses it.
make USE_VALGRIND=0 test # optionally skip using valgrind
</pre><p>If a test fails, check <code>Testing/Temporary/LastTest.log</code>, <code>tests/testSubDir/${testname}/${testname}.vg.out</code>, and other similar files. If there is insufficient output try: </p>
<pre class="fragment">VERBOSE=1 CTEST_OUTPUT_ON_FAILURE=1 make test
</pre><p>or </p>
<pre class="fragment">JSONC_TEST_TRACE=1 make test
</pre><p>and check the log files again.</p>
<h2>Building on Unix and Windows with <code>vcpkg</code> <a class="anchor" id="buildvcpkg"></a></h2>
<p>You can download and install JSON-C using the <a href="https://github.com/Microsoft/vcpkg/">vcpkg</a> dependency manager: </p>
<pre class="fragment">git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./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>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)
</pre><p>Without <code>pkgconfig</code>, you might do something like this: </p>
<pre class="fragment">JSON_C_DIR=/path/to/json_c/install
CFLAGS += -I$(JSON_C_DIR)/include/json-c
# Or to use lines like: #include &lt;json-c/json_object.h&gt;
#CFLAGS += -I$(JSON_C_DIR)/include
LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
</pre><p>If your project uses cmake:</p>
<ul>
<li><p class="startli">Add to your CMakeLists.txt file:</p>
<p class="startli">find_package(json-c CONFIG) target_link_libraries(${PROJECT_NAME} PRIVATE json-c::json-c)</p>
</li>
</ul>
<ul>
<li><p class="startli">Then you might run in your project:</p>
<p class="startli">cd build cmake -DCMAKE_PREFIX_PATH=/path/to/json_c/install/lib64/cmake ..</p>
</li>
</ul>
<h2>Using json-c <a class="anchor" id="using"></a></h2>
<p>To use json-c you can either include <a class="el" href="json_8h.html" title="A convenience header that may be included instead of other individual ones.">json.h</a>, or preferably, one of the following more specific header files:</p>
<ul>
<li><a class="el" href="json__object_8h.html" title="Core json-c API. Start here, or with json_tokener.h.">json_object.h</a> - Core types and methods.</li>
<li><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> - Methods for parsing and serializing json-c object trees.</li>
<li><a class="el" href="json__pointer_8h.html" title="JSON Pointer (RFC 6901) implementation for retrieving objects from a json-c object tree...">json_pointer.h</a> - JSON Pointer (RFC 6901) implementation for retrieving objects from a json-c object tree.</li>
<li><a class="el" href="json__object__iterator_8h.html" title="An API for iterating over json_type_object objects, styled to be familiar to C++ programmers. Unlike json_object_object_foreach() and json_object_object_foreachC(), this avoids the need to expose json-c internals like lh_entry.">json_object_iterator.h</a> - Methods for iterating over single json_object instances. (See also <code><a class="el" href="json__object_8h.html#acf5f514a9e0061c10fc08055762639ee">json_object_object_foreach()</a></code> in <a class="el" href="json__object_8h.html" title="Core json-c API. Start here, or with json_tokener.h.">json_object.h</a>)</li>
<li><a class="el" href="json__visit_8h.html" title="Methods for walking a tree of objects.">json_visit.h</a> - Methods for walking a tree of json-c objects.</li>
<li><a class="el" href="json__util_8h.html" title="Miscllaneous utility functions and macros.">json_util.h</a> - Miscellaneous utility functions.</li>
</ul>
<p>For a full list of headers see <a href="https://json-c.github.io/json-c/json-c-current-release/doc/html/files.html">files.html</a></p>
<p>The primary type in json-c is json_object. It describes a reference counted tree of json objects which are created by either parsing text with a <a class="el" href="structjson__tokener.html">json_tokener</a> (i.e. <code><a class="el" href="json__tokener_8h.html#a61679f178111963a9ffa3c8179553f7a">json_tokener_parse_ex()</a></code>), or by creating (with <code><a class="el" href="json__object_8h.html#a68c383f54544fca19b5f2425be397600">json_object_new_object()</a></code>, <code><a class="el" href="json__object_8h.html#ae92f0770fb4b3c884ce35de52d3d7de8">json_object_new_int()</a></code>, etc...) and adding (with <code><a class="el" href="json__object_8h.html#a27bd808a022251059a43f1f6370441cd">json_object_object_add()</a></code>, <code><a class="el" href="json__object_8h.html#a18cdd9a7455e09f36cdf6e5756b7f586">json_object_array_add()</a></code>, etc...) them individually. Typically, every object in the tree will have one reference, from its parent. When you are done with the tree of objects, you call <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a> on just the root object to free it, which recurses down through any child objects calling <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a> on each one of those in turn.</p>
<p>You can get a reference to a single child (<code><a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get()</a></code> or <code><a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object_array_get_idx()</a></code>) and use that object as long as its parent is valid. If you need a child object to live longer than its parent, you can increment the child's refcount (<code><a class="el" href="json__object_8h.html#a675aa3a9cced685dbfd1c1a770a0c3e4">json_object_get()</a></code>) to allow it to survive the parent being freed or it being removed from its parent (<code><a class="el" href="json__object_8h.html#ac6605fdafca20bd5d33c84f4f80a3bda">json_object_object_del()</a></code> or <code><a class="el" href="json__object_8h.html#a722eca9f578704d3af38b97549242c1f">json_object_array_del_idx()</a></code>)</p>
<p>When parsing text, the <a class="el" href="structjson__tokener.html">json_tokener</a> object is independent from the json_object that it returns. It can be allocated (<code><a class="el" href="json__tokener_8h.html#a5ac7e2c350bc592cf2fa7b9935b00ef5">json_tokener_new()</a></code>) used one or multiple times (<code><a class="el" href="json__tokener_8h.html#a61679f178111963a9ffa3c8179553f7a">json_tokener_parse_ex()</a></code>, and freed (<code><a class="el" href="json__tokener_8h.html#a887c4661906fc6b36cc366304e522534">json_tokener_free()</a></code>) while the json_object objects live on.</p>
<p>A json_object tree can be serialized back into a string with <code><a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object_to_json_string_ext()</a></code>. The string that is returned is only valid until the next "to_json_string" call on that same object. Also, it is freed when the json_object is freed. </p>
</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

@@ -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.13.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.13.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

@@ -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.14.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.14.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

@@ -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.15.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.15.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

@@ -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.16.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.16.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

@@ -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>

8
doc/html/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

66
doc/html/json_8h.html Normal file
View File

@@ -0,0 +1,66 @@
<!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: /home/erh/distcheck/json.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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_b62156a74b5a818be0c2ef9f85294b95.html">distcheck</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">json.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A convenience header that may be included instead of other individual ones.
<a href="#details">More...</a></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A convenience header that may be included instead of other individual ones. </p>
</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

@@ -0,0 +1,199 @@
<!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_c_version.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="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">json_c_version.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Methods for retrieving the json-c version.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
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;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.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>
</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:a1c42f6f71943775e2696c47951989711"><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__c__version_8h.html#a1c42f6f71943775e2696c47951989711">json_c_version</a> (void)</td></tr>
<tr class="separator:a1c42f6f71943775e2696c47951989711"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a860ee32b09f4faf38d73771a6ed193ed"><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__c__version_8h.html#a860ee32b09f4faf38d73771a6ed193ed">json_c_version_num</a> (void)</td></tr>
<tr class="separator:a860ee32b09f4faf38d73771a6ed193ed"><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>Methods for retrieving the json-c version. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a251c3e1f59a379a4a905382b4e855125"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_C_MAJOR_VERSION&#160;&#160;&#160;0</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a64457730097067ab096906d82e4a51a6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_C_MICRO_VERSION&#160;&#160;&#160;0</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="adc87477fbc1c75848fe6b6feec21c2d6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_C_MINOR_VERSION&#160;&#160;&#160;17</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a894adda66a072bc3fd34ebe91a5aa7f4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_C_VERSION&#160;&#160;&#160;&quot;0.17&quot;</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a78e176eee75ee6aed43c4d65ca4c5b44"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_C_VERSION_NUM&#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>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a2a31d5c00f3a4712f2d5d62aee66344e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define JSON_EXPORT&#160;&#160;&#160;extern</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a1c42f6f71943775e2696c47951989711"></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> const char* json_c_version </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__c__version_8h.html#a894adda66a072bc3fd34ebe91a5aa7f4">JSON_C_VERSION</a> </dd></dl>
<dl class="section return"><dt>Returns</dt><dd>the version of the json-c library as a string </dd></dl>
</div>
</div>
<a class="anchor" id="a860ee32b09f4faf38d73771a6ed193ed"></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_c_version_num </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The json-c version encoded into an int, with the low order 8 bits being the micro version, the next higher 8 bits being the minor version and the next higher 8 bits being the major version. For example, 7.12.99 would be 0x00070B63.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__c__version_8h.html#a78e176eee75ee6aed43c4d65ca4c5b44">JSON_C_VERSION_NUM</a> </dd></dl>
<dl class="section return"><dt>Returns</dt><dd>the version of the json-c library as an int </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

@@ -0,0 +1,172 @@
<!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_inttypes.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="#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-->
<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="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ae372e90b62c1e8b51dc5d95bf7f5ba48"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__inttypes_8h.html#ae372e90b62c1e8b51dc5d95bf7f5ba48">PRId64</a>&#160;&#160;&#160;&quot;I64d&quot;</td></tr>
<tr class="separator:ae372e90b62c1e8b51dc5d95bf7f5ba48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7044b3fb4cc5cde22155d59437c348f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__inttypes_8h.html#ae7044b3fb4cc5cde22155d59437c348f">SCNd64</a>&#160;&#160;&#160;&quot;I64d&quot;</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>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ae372e90b62c1e8b51dc5d95bf7f5ba48"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PRId64&#160;&#160;&#160;&quot;I64d&quot;</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ac582131d7a7c8ee57e73180d1714f9d5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PRIu64&#160;&#160;&#160;&quot;I64u&quot;</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ae7044b3fb4cc5cde22155d59437c348f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SCNd64&#160;&#160;&#160;&quot;I64d&quot;</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 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>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,334 @@
<!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_object_iterator.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_object_iterator.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>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>.
<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__object__iterator.html">json_object_iterator</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:ae93958fa755852192553f1686d248cd1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <br class="typebreak"/>
<a class="el" href="structjson__object__iterator.html">json_object_iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object__iterator_8h.html#ae93958fa755852192553f1686d248cd1">json_object_iter_init_default</a> (void)</td></tr>
<tr class="separator:ae93958fa755852192553f1686d248cd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afdcd32f83dd8f20e25669f197fb7bde9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <br class="typebreak"/>
<a class="el" href="structjson__object__iterator.html">json_object_iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object__iterator_8h.html#afdcd32f83dd8f20e25669f197fb7bde9">json_object_iter_begin</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr>
<tr class="separator:afdcd32f83dd8f20e25669f197fb7bde9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a381fbae848a3268013110002d553c32e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <br class="typebreak"/>
<a class="el" href="structjson__object__iterator.html">json_object_iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object__iterator_8h.html#a381fbae848a3268013110002d553c32e">json_object_iter_end</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr>
<tr class="separator:a381fbae848a3268013110002d553c32e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a152d153844f1ec1698419abae8c2e4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object__iterator_8h.html#a8a152d153844f1ec1698419abae8c2e4">json_object_iter_next</a> (struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *iter)</td></tr>
<tr class="separator:a8a152d153844f1ec1698419abae8c2e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adbbc3583aef14d9416a0fc8dbf750727"><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__object__iterator_8h.html#adbbc3583aef14d9416a0fc8dbf750727">json_object_iter_peek_name</a> (const struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *iter)</td></tr>
<tr class="separator:adbbc3583aef14d9416a0fc8dbf750727"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8fe9251ca04af4d8e6840a44de7984b"><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__iterator_8h.html#ad8fe9251ca04af4d8e6840a44de7984b">json_object_iter_peek_value</a> (const struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *iter)</td></tr>
<tr class="separator:ad8fe9251ca04af4d8e6840a44de7984b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9cbb250d185348e8b193a886c35ae39e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json__object__iterator_8h.html#a9cbb250d185348e8b193a886c35ae39e">json_object_iter_equal</a> (const struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *iter1, const struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *iter2)</td></tr>
<tr class="separator:a9cbb250d185348e8b193a886c35ae39e"><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>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>. </p>
<p>Copyright (c) 2009-2012 Hewlett-Packard Development Company, L.P.</p>
<p>This library is free software; you can redistribute it and/or modify it under the terms of the MIT license. See COPYING for details.</p>
<p>API attributes: <br/>
</p>
<ul>
<li>Thread-safe: NO<br/>
</li>
<li>Reentrant: NO </li>
</ul>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="afdcd32f83dd8f20e25669f197fb7bde9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> json_object_iter_begin </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><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves an iterator to the first pair of the JSON Object.</p>
<dl class="section warning"><dt>Warning</dt><dd>Any modification of the underlying pair invalidates all iterators to that pair.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>JSON Object instance (MUST be of type json_object)</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="structjson__object__iterator.html">json_object_iterator</a> If the JSON Object has at least one pair, on return, the iterator refers to the first pair. If the JSON Object doesn't have any pairs, the returned iterator is equivalent to the "end" iterator for the same JSON Object instance.</dd></dl>
<div class="fragment"><div class="line"><span class="keyword">struct </span><a class="code" href="structjson__object__iterator.html">json_object_iterator</a> it;</div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structjson__object__iterator.html">json_object_iterator</a> itEnd;</div>
<div class="line"><span class="keyword">struct </span><a class="code" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914" title="The core type for all type of JSON objects handled by json-c.">json_object</a>* obj;</div>
<div class="line"></div>
<div class="line">obj = <a class="code" href="json__tokener_8h.html#a236ef64d079822a4411d13eae7190c4d">json_tokener_parse</a>(<span class="stringliteral">&quot;{&#39;first&#39;:&#39;george&#39;, &#39;age&#39;:100}&quot;</span>);</div>
<div class="line">it = <a class="code" href="json__object__iterator_8h.html#afdcd32f83dd8f20e25669f197fb7bde9">json_object_iter_begin</a>(obj);</div>
<div class="line">itEnd = <a class="code" href="json__object__iterator_8h.html#a381fbae848a3268013110002d553c32e">json_object_iter_end</a>(obj);</div>
<div class="line"></div>
<div class="line"><span class="keywordflow">while</span> (!<a class="code" href="json__object__iterator_8h.html#a9cbb250d185348e8b193a886c35ae39e">json_object_iter_equal</a>(&amp;it, &amp;itEnd)) {</div>
<div class="line"> printf(<span class="stringliteral">&quot;%s\n&quot;</span>,</div>
<div class="line"> <a class="code" href="json__object__iterator_8h.html#adbbc3583aef14d9416a0fc8dbf750727">json_object_iter_peek_name</a>(&amp;it));</div>
<div class="line"> <a class="code" href="json__object__iterator_8h.html#a8a152d153844f1ec1698419abae8c2e4">json_object_iter_next</a>(&amp;it);</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a381fbae848a3268013110002d553c32e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> json_object_iter_end </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>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the iterator that represents the position beyond the last pair of the given JSON Object instance.</p>
<dl class="section warning"><dt>Warning</dt><dd>Do NOT write code that assumes that the "end" iterator value is NULL, even if it is so in a particular instance of the implementation.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The reason we do not (and MUST NOT) provide "json_object_iter_is_end(json_object_iterator* iter)" type of API is because it would limit the underlying representation of name/value containment (or force us to add additional, otherwise unnecessary, fields to the iterator structure). The "end" iterator and the equality test method, on the other hand, permit us to cleanly abstract pretty much any reasonable underlying representation without burdening the iterator structure with unnecessary data.</dd>
<dd>
For performance reasons, memorize the "end" iterator prior to any loop.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>JSON Object instance (MUST be of type json_object)</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="structjson__object__iterator.html">json_object_iterator</a> On return, the iterator refers to the "end" of the Object instance's pairs (i.e., NOT the last pair, but "beyond the last
pair" value) </dd></dl>
</div>
</div>
<a class="anchor" id="a9cbb250d185348e8b193a886c35ae39e"></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> <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> json_object_iter_equal </td>
<td>(</td>
<td class="paramtype">const struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *&#160;</td>
<td class="paramname"><em>iter1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *&#160;</td>
<td class="paramname"><em>iter2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tests two iterators for equality. Typically used to test for end of iteration by comparing an iterator to the corresponding "end" iterator (that was derived from the same JSON Object instance).</p>
<dl class="section note"><dt>Note</dt><dd>The reason we do not (and MUST NOT) provide "json_object_iter_is_end(json_object_iterator* iter)" type of API is because it would limit the underlying representation of name/value containment (or force us to add additional, otherwise unnecessary, fields to the iterator structure). The equality test method, on the other hand, permits us to cleanly abstract pretty much any reasonable underlying representation.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">iter1</td><td>Pointer to first valid, non-NULL iterator </td></tr>
<tr><td class="paramname">iter2</td><td>POinter to second valid, non-NULL iterator</td></tr>
</table>
</dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>if a NULL iterator pointer or an uninitialized or invalid iterator, or iterators derived from different JSON Object instances are passed, bad things will happen!</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>json_bool non-zero if iterators are equal (i.e., both reference the same name/value pair or are both at "end"); zero if they are not equal. </dd></dl>
</div>
</div>
<a class="anchor" id="ae93958fa755852192553f1686d248cd1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> json_object_iter_init_default </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes an iterator structure to a "default" value that is convenient for initializing an iterator variable to a default state (e.g., initialization list in a class' constructor).</p>
<div class="fragment"><div class="line"><span class="keyword">struct </span><a class="code" href="structjson__object__iterator.html">json_object_iterator</a> iter = <a class="code" href="json__object__iterator_8h.html#ae93958fa755852192553f1686d248cd1">json_object_iter_init_default</a>();</div>
<div class="line">MyClass() : iter_(<a class="code" href="json__object__iterator_8h.html#ae93958fa755852192553f1686d248cd1">json_object_iter_init_default</a>())</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>The initialized value doesn't reference any specific pair, is considered an invalid iterator, and MUST NOT be passed to any json-c API that expects a valid iterator.</dd>
<dd>
User and internal code MUST NOT make any assumptions about and dependencies on the value of the "default" iterator value.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="structjson__object__iterator.html">json_object_iterator</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a8a152d153844f1ec1698419abae8c2e4"></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> void json_object_iter_next </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *&#160;</td>
<td class="paramname"><em>iter</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns an iterator to the next pair, if any</p>
<dl class="section warning"><dt>Warning</dt><dd>Any modification of the underlying pair invalidates all iterators to that pair.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">iter</td><td>[IN/OUT] Pointer to iterator that references a name/value pair; MUST be a valid, non-end iterator. WARNING: bad things will happen if invalid or "end" iterator is passed. Upon return will contain the reference to the next pair if there is one; if there are no more pairs, will contain the "end" iterator value, which may be compared against the return value of <a class="el" href="json__object__iterator_8h.html#a381fbae848a3268013110002d553c32e">json_object_iter_end()</a> for the same JSON Object instance. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="adbbc3583aef14d9416a0fc8dbf750727"></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> const char* json_object_iter_peek_name </td>
<td>(</td>
<td class="paramtype">const struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *&#160;</td>
<td class="paramname"><em>iter</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a const pointer to the name of the pair referenced by the given iterator.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">iter</td><td>pointer to iterator that references a name/value pair; MUST be a valid, non-end iterator.</td></tr>
</table>
</dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>bad things will happen if an invalid or "end" iterator is passed.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>const char* Pointer to the name of the referenced name/value pair. The name memory belongs to the name/value pair, will be freed when the pair is deleted or modified, and MUST NOT be modified or freed by the user. </dd></dl>
</div>
</div>
<a class="anchor" id="ad8fe9251ca04af4d8e6840a44de7984b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<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_iter_peek_value </td>
<td>(</td>
<td class="paramtype">const struct <a class="el" href="structjson__object__iterator.html">json_object_iterator</a> *&#160;</td>
<td class="paramname"><em>iter</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a pointer to the json-c instance representing the value of the referenced name/value pair, without altering the instance's reference count.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">iter</td><td>pointer to iterator that references a name/value pair; MUST be a valid, non-end iterator.</td></tr>
</table>
</dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>bad things will happen if invalid or "end" iterator is passed.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>struct json_object* Pointer to the json-c value instance of the referenced name/value pair; the value's reference count is not changed by this function: if you plan to hold on to this json-c node, take a look at <a class="el" href="json__object_8h.html#a675aa3a9cced685dbfd1c1a770a0c3e4">json_object_get()</a> and <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a>. IMPORTANT: json-c API represents the JSON Null value as a NULL json_object instance pointer. </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

@@ -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>

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