aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-14GitHub ActionsPetri Lehtinen2-38/+92
2020-11-19doc: Hoist a sectionPetri Lehtinen1-1/+1
2020-11-19doc: Rename "Portability" to "Thread-safety"Petri Lehtinen3-10/+6
Fixes #545
2020-11-19Merge pull request #520 from Mephistophiles/getnPetri Lehtinen14-90/+594
Add support getn, setn functions
2020-11-15Merge pull request #555 from kiyolee/size_t-warningsPetri Lehtinen3-6/+6
Fix size_t related MSVC compiler warnings
2020-11-06C11 %zd is bit overkill here. Especially requiring conditional compile.Kelvin Lee1-8/+0
2020-11-06Fix hashsize() should return size_t.Kelvin Lee1-1/+1
2020-11-05Use size_t to receive result from fread()/ftell().Kelvin Lee1-1/+1
2020-11-05Print size_t properly with C11 %zd support.Kelvin Lee1-4/+12
2020-09-01reuse key len from loop check for better performanceMaxim Zhukov4-33/+62
Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
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