Commit Graph

247 Commits

Author SHA1 Message Date
Corey Farrell
744fe5ed44 jansson 2.11 2018-02-09 12:31:18 -05:00
Petri Lehtinen
03620980cf
Merge pull request #395 from akheron/doc-utf-8
Document encoding requirements for callbacks
2018-02-09 10:10:34 +02:00
Petri Lehtinen
fa0b5ece9e
Merge pull request #380 from phst/doc-error-code
document that json_error_code will be added in version 2.11
2018-02-09 09:39:38 +02:00
Petri Lehtinen
a6138a07b6 Document encoding requirements for callbacks
Original patch by @phst.

Fixes #369.
2018-02-09 09:35:53 +02:00
Petri Lehtinen
efe6c7b3f2 Add json_sprintf and json_vsprintf
Fixes #392
2018-02-09 07:37:33 +02:00
Petri Lehtinen
f44921e176 Clarify thread safety docs, rename JANSSON_THREAD_SAFE 2018-02-08 12:38:14 +02:00
Corey Farrell
3aee856d7b Docs: Update information on thread safety.
Fixes #387
2018-02-01 15:54:35 -05:00
Philipp Stephani
24d45272a7 document that json_error_code will be added in version 2.11 2017-12-18 23:51:32 +01:00
Corey Farrell
6c78910011 apiref: Clarify documentation for unpack O format.
The `O` format causes reference counts to increase, but in an error they
are not released.  Callers to unpack functions that use the `O` format
should use pointers pre-initialized to NULL so they can safely release
the reference on error.

Also corrected typo which said this was like `O` (itself).

Fixes #135
2017-12-13 14:04:07 -05:00
Philipp Stephani
3951d39b40 Document that length-aware string functions have been added in 2.7 2017-12-10 16:53:01 +01:00
Philipp Stephani
112ccbd820 Use last byte of error text as numeric error code
Fixes #352
2017-10-03 11:42:07 +02:00
최재원
ad6c1e37ad Fix typo 2017-07-16 19:16:34 +09:00
Nathaniel McCallum
28666cead0 Enable optional object/array members in json_pack() 2017-04-19 07:19:29 -04:00
Nathaniel McCallum
b23201bb1a jansson 2.10 2017-03-02 20:49:42 +02:00
Nathaniel McCallum
b8bb078cc2 Add JSON_EMBED encoding flag
The JSON_EMBED encoding flag causes the opening and closing characters
of the top-level array ('[', ']') or object ('{', '}') to be omitted
during encoding. This feature makes it possible to concatenate multiple
arrays or objects in the stream output. It also makes it possible to
perform outputs of partial composes.

One such example of a partial compose is when outputting a JWE object.
The output is a JSON object. But it has one top-level attribute
("ciphertext") that can grow out of proportion with the rest of the
metadata. With the JSON_EMBED flag, the other metadata can be composed
ahead of time and dumped during the beginning of output, where the
"ciphertext" and "tag" attributes can be streamed out in chunks. Thus,
the header material can be composed with Jansson and the ciphertext
itself can be composed manually.
2017-02-27 15:09:03 -05:00
Nathaniel McCallum
1672bb5a65 Implement json_dumpfd() and json_loadfd()
The primary use of these functions is easy loading
and dumping from stream sockets.

Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
2017-01-27 09:15:18 +01:00
Nathaniel McCallum
b900967f6f Implement json_dumpb()
This function encodes the json_t object to a pre-allocated buffer.
It compliments the already existing json_loadb() function and is
useful for parsing JSON-RPC (among other protocols) when sent over
datagram sockets.

Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
2017-01-26 16:16:24 +01:00
Petri Lehtinen
98be7da3e2 doc: Change version to 2.10-dev 2016-09-18 14:52:26 +03:00
Petri Lehtinen
08cb7b6d6f doc: Change version to 2.9 2016-09-18 14:52:17 +03:00
Petri Lehtinen
b02db47881 jansson 2.9 2016-09-18 14:35:05 +03:00
Petri Lehtinen
074bb3838f Update copyrights for 2016 2016-09-18 14:17:03 +03:00
Petri Lehtinen
7d1af52ab4 Merge pull request #301 from npmccallum/master
Add support for the cleanup attribute in GCC/Clang
2016-08-31 17:57:23 +03:00
Nathaniel McCallum
63b9fd0552 Add support for the cleanup attribute in GCC/Clang
The new json_auto_t macro allows easy declaration of json_t types that
automatically decrement at the end of their scope.
2016-08-31 08:57:57 -04:00
Petri Lehtinen
0ffecdbade doc: Fix json_error_t::position type
Fixes #300
2016-08-31 12:17:03 +03:00
Petri Lehtinen
ab1ba69027 Set documentation version to 2.9-dev 2016-08-30 21:19:51 +03:00
Petri Lehtinen
012c5f0eca jansson 2.8 2016-08-30 21:09:28 +03:00
Petri Lehtinen
7daffabf07 Fix a typo 2016-06-24 06:55:49 +03:00
Petri Lehtinen
9df267054f Always preserve insertion order of object items 2016-06-20 21:10:23 +03:00
Steve Dougherty
603fdc9154 doc: fix code block formatting 2016-06-17 10:45:47 -04:00
Steve Dougherty
a8c834c882 doc: improve conciseness
The object_to_key_iter() example is now formatted like
json_object_foreach() and json_object_foreach(). The edited descriptions were
redundant, and the removed headers didn't add useful information.
2016-06-01 11:27:22 -04:00
Steve Dougherty
7438cc8ba8 doc: correct argument names
The function signatures use "json", not "root".
2016-06-01 11:27:22 -04:00
Dmitry Janushkevich
64ce0ad373 Fix for issue #282
The fix limits recursion depths when parsing arrays and objects.
The limit is configurable via the `JSON_PARSER_MAX_DEPTH` setting
within `jansson_config.h` and is set by default to 2048.

Update the RFC conformance document to note the limit; the RFC
allows limits to be set by the implementation so nothing has
actually changed w.r.t. conformance state.

Reported by Gustavo Grieco.
2016-05-03 10:22:06 +02:00
Petri Lehtinen
006638a6a2 Merge pull request #275 from Mephistophiles/master
Fix proto in doc
2016-03-03 07:26:20 +02:00
Maxim Zhukov
130c2fff31 Fix proto in doc 2016-03-02 17:40:49 +03:00
Petri Lehtinen
cfd817895a doc: Fix a typo 2016-02-25 07:29:28 +02:00
Petri Lehtinen
ac97e0bf79 json_pack(): Document s?, o?, O? 2016-02-25 07:23:53 +02:00
Petri Lehtinen
89f4c15e6d Change doc version to 2.8-dev
It's shown in the front page of readthedocs/latest.
2015-12-23 07:40:58 +02:00
Petri Lehtinen
581d5b899c Add versionadded to json_get_alloc_funcs doc 2015-12-22 13:05:28 +02:00
Nathaniel McCallum
245e532934 Add json_get_alloc_funcs() to allow alloc function fetching
This is particularly useful in modular situations where the allocation
functions are either unknown or private. For instance, in such cases,
the caller of json_dumps() has no way to free the returned buffer.
2015-12-21 11:46:32 -05:00
Petri Lehtinen
e44b2231b5 doc: Fix a broken link
Fixes #258
2015-10-20 10:21:08 +03:00
Petri Lehtinen
4c4f692bd6 Add json_object_foreach_safe
Fixes #230.
2015-08-26 17:32:55 +03:00
Petri Lehtinen
69678aaa35 doc: Copying doesn't preserve key insertion order
Fixes #237.
2015-05-19 08:49:10 +03:00
Petri Lehtinen
76760011ff Don't crash when building documentation man pages
Fixes #207.
2015-03-07 09:14:06 +02:00
Petri Lehtinen
d799ee11b4 doc: Update the Getting Started chapter
- It's not true anymore that there are no configure options that modify
  Jansson's behaviour

- Remove trailing whitespace
2014-12-18 14:47:08 +02:00
david bigagli
82a55ef205 doc patch for jansson 2014-12-15 07:47:19 +02:00
Petri Lehtinen
ee27b7e3dd jansson 2.7 2014-10-02 13:10:45 +03:00
Petri Lehtinen
391d9101a8 Update CHANGES for 2.7 2014-10-02 08:57:07 +03:00
Petri Lehtinen
a6229a2d3e doc: Enhance string overview 2014-07-21 08:15:34 +03:00
Petri Lehtinen
c8d017bd88 Merge branch '2.6' 2014-07-12 06:43:07 +03:00
Petri Lehtinen
23b1b7ba9a Document JANSSON_BUILD_SHARED_LIBS CMake option
Fixes #187.
2014-07-12 06:42:36 +03:00