aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-01conformance: remove U+0000 restriction for object keysMaxim Zhukov1-2/+1
Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
2020-09-01introduce new fixed-size key APIMaxim Zhukov9-8/+459
This commit added functions working with fixed-size strings (non null-terminated also). It's helpful for the following cases: * getting key from substring without copying to separate buffer (better perfomance) * using pure UTF-8 keys for the objets * hack: set binary structs as the keys (see test_binary_keys) added functions: * json_object_getn * json_object_setn * json_object_setn_nocheck * json_object_setn_new * json_object_setn_new_nocheck * json_object_deln * json_object_iter_key_len added iterators: * json_object_keylen_foreach * json_object_keylen_foreach_safe Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
2020-08-12pass length of the key to internal APIMaxim Zhukov5-54/+79
Use key length for internal API Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
2020-08-12sort tests by alpha orderMaxim Zhukov2-3/+3
Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
2020-08-09Merge pull request #546 from i-ky/patch-1Petri Lehtinen1-2/+2
Fix couple of typos
2020-08-09Fix couple of typosi-ky1-2/+2
"This sections describes" -> "This section describes"
2020-08-08Merge pull request #544 from i-ky/patch-1Petri Lehtinen1-1/+1
Lift "Depth of nested values" to a higher level
2020-08-08Lift "Depth of nested values" to a higher leveli-ky1-1/+1
Currently this section is under "Numbers" which seems to be wrong.
2020-08-08Merge pull request #543 from ploxiln/sphinx3Petri Lehtinen4-44/+53
doc: compatibility with Sphinx-3
2020-08-07doc: add return types for function-like macrosPierce Lopez1-13/+13
The Sphinx-3.0 c:function:: directive requires the return type. Sphinx-3.0 also adds function-like macro support to the c:macro:: directive, which Sphinx-1.x and Sphinx-2.x do not support, but it is probably a good idea to keep compatibility with slightly older Sphinx for now.
2020-08-07doc: do not use references for standard C types or file namesPierce Lopez3-20/+20
Use double-backtick quoting instead. It has the same effect (because these links had nowhere to link to) but it does not result in loud warnings about broken references by default with Sphinx-3.x.
2020-08-07doc: convert refcounting directive to a classPierce Lopez1-11/+20
Directive functions are no longer supported in Sphinx-3.0 but directive classes have been supported since early 1.x
2020-07-20Merge pull request #540 from smcv/default-symverPetri Lehtinen3-0/+12
build: Add a symbol version to all exported symbols
2020-07-02build: Add a symbol version to all exported symbols for glibcSimon McVittie3-0/+12
The --default-symver linker option attaches a default version definition (the SONAME) to every exported symbol. It is supported since at least GNU binutils 2.22 in 2011 (older versions not tested). With this version definition, newly-linked binaries that depend on the jansson 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-c or json-glib if those libraries appear in dependency search order before jansson, 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 parse_json() calls json_decref(). It does not affect calls from external code into jansson, unless jansson was statically linked into the external caller. This change will also not prevent code that depends on json-c or json-glib from finding jansson's symbols and crashing; to prevent that, a corresponding change in json-c or json-glib would be needed. Adding a symbol-version is a backwards-compatible change, but once added, removing or changing the symbol-version would be an incompatible change that requires a SONAME bump. Resolves: https://github.com/akheron/jansson/issues/523 (when combined with an equivalent change to json-c). Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-05-23Merge pull request #537 from stoeckmann/vsnprintfPetri Lehtinen1-2/+4
Handle vsnprintf corner cases.
2020-05-23Handle vsnprintf corner cases.Tobias Stoeckmann1-2/+4
The function vsnprintf returns a negative value on error, e.g. on an invalid format. It's best to return NULL in such a case. Also avoid a signed integer overflow if vsnprintf returns INT_MAX. This is undefined behaviour in C and has to be avoided. A negative value is returned with a call like: json_sprintf("%111111111111111s", "", ""); INT_MAX is returned with a call like: json_sprintf("%647s%2147483000s", "", "");
2020-05-07jansson 2.13.1v2.13.12.13Petri Lehtinen6-7/+20
2020-05-07Merge pull request #535 from xry111/clang-format-check-dist-fixPetri Lehtinen1-1/+1
add `scripts` directory to EXTRA_DIST
2020-05-07Merge pull request #534 from xry111/shared_lib_interface_fixPetri Lehtinen2-2/+2
add jansson_* to shared library exports
2020-05-06add `scripts` directory to EXTRA_DISTXℹ Ruoyao1-1/+1
2020-05-06add jansson_* to shared library exportsXℹ Ruoyao2-2/+2
2020-05-05jansson 2.13v2.13Petri Lehtinen7-10/+10
2020-01-21Merge pull request #521 from NanXiao/patch-1Petri Lehtinen1-1/+1
Update apiref.rst
2020-01-21Update apiref.rstNan Xiao1-1/+1
2019-10-24Merge pull request #510 from AllenX2018/improve-build-docPetri Lehtinen1-0/+21
add MinGW build guideline and tips to disable building docs
2019-10-24Fix the length of a section headingPetri Lehtinen1-1/+1
2019-10-24Merge pull request #509 from AllenX2018/update-CHANGESPetri Lehtinen1-0/+45
add changes since v2.12
2019-10-24Small modifications to CHANGESPetri Lehtinen1-14/+4
2019-10-22add changes since v2.12allen1-0/+55
2019-10-21Merge pull request #508 from akheron/clang-formatPetri Lehtinen47-2832/+2441
Format code with clang-format
2019-10-21add MinGW build guideline, add new version of Visual StudioAllenX20181-0/+21
2019-10-21Set autoconf bug-report param to point to github issuesPetri Lehtinen1-1/+1
2019-10-21Fix clang-format version checkingPetri Lehtinen2-12/+12
2019-10-21Run clang-format with make checkPetri Lehtinen5-5/+11
2019-10-21Tweak clang-format configuration a bitPetri Lehtinen30-606/+577
Set ColumnLimit to 90, remove AllowShortCaseLabelsOnASingleLine.
2019-10-21Support running a specific clang-format version in CIPetri Lehtinen2-2/+7
2019-10-21Run clang-format in CI, fail the build if everything's not formattedPetri Lehtinen1-0/+6
2019-10-21Add scripts for running clang-formatPetri Lehtinen2-0/+21
2019-10-21Run clang-format on *.c, *.hPetri Lehtinen39-2921/+2516
2019-10-21Add clang-format configurationPetri Lehtinen1-0/+5
2019-10-21Merge pull request #498 from AllenX2018/fix-issue441Petri Lehtinen1-7/+0
fix issue #441: remove strtod definition in strconv.c
2019-10-21remove undef __NO_ISOCEXT for strtod compatiblitywillson-chen1-3/+0
2019-10-18Merge pull request #499 from AllenX2018/fix-issue281Petri Lehtinen3-0/+105
Add json_object_update_new, json_object_update_existing_new and json_object_update_missing_new
2019-10-17Merge branch 'master' into fix-issue281Petri Lehtinen17-50/+239
2019-10-17Merge pull request #505 from AllenX2018/recursive_object_updatePetri Lehtinen5-3/+148
Recursive object update
2019-10-17Merge pull request #500 from AllenX2018/fix-issue426Petri Lehtinen1-0/+4
fix issue #426: fix pipe function in MinGW
2019-10-17Merge pull request #501 from AllenX2018/fix-issue481Petri Lehtinen4-24/+24
fix issue #481
2019-10-17Merge pull request #502 from AllenX2018/fix-issue453Petri Lehtinen1-5/+19
fix issue #453:update FindSphinx.cmake to better align with find sphinx package.
2019-10-17Merge pull request #503 from AllenX2018/loadfd-docPetri Lehtinen1-1/+5
add note for non-blocking file descriptor used for json_loadfd
2019-10-17Merge pull request #506 from AllenX2018/add-json_equal-test-casePetri Lehtinen1-4/+14
fix typo & add negative test case for test_equal_complex