Enable bundling of jansson, require 2.11.

Change-Id: Ib3111b151d37cbda40768cf2a8a9c6cf6c5c7cbd
This commit is contained in:
Corey Farrell
2018-07-16 16:08:20 -04:00
parent c40412bd13
commit d2dace81d4
22 changed files with 642 additions and 354 deletions

View File

@@ -27,7 +27,7 @@
* \since 12.0.0
*
* This is a very thin wrapper around the Jansson API. For more details on it,
* see its docs at http://www.digip.org/jansson/doc/2.4/apiref.html.
* see its docs at http://www.digip.org/jansson/doc/2.11/apiref.html.
*
* Rather than provide the multiple ways of doing things that the Jansson API
* does, the Asterisk wrapper is always reference-stealing, and always NULL
@@ -43,35 +43,6 @@
* wrap them with json_ref() when passing them to other \c ast_json_*()
* functions.
*
* \par Thread Safety
*
* Jansson (as of 2.4) provides fairly weak thread safety guarantees. The
* Asterisk wrapper improves upon that slightly. The remaining refcounting
* problems are issues when slicing/sharing/mixing instances between JSON
* objects and arrays, which we avoid.
*
* The \c ast_json_dump_* functions are thread safe for multiple concurrent
* dumps of the same object, so long as the concurrent dumps start from the same
* \c root object. But if an object is shared by other JSON objects/arrays, then
* concurrent dumps of the outer objects/arrays are not thread safe. This can be
* avoided by using ast_json_deep_copy() when sharing JSON instances between
* objects.
*
* The ast_json_ref() and ast_json_unref() functions are thread safe. Since the
* Asterisk wrapper exclusively uses the reference stealing API, Jansson won't
* be performing many refcount modifications behind our backs. There are a few
* exceptions.
*
* The first is the transitive json_decref() that occurs when \ref
* AST_JSON_OBJECT and \ref AST_JSON_ARRAY instances are deleted. This can be
* avoided by using ast_json_deep_copy() when sharing JSON instances between
* objects.
*
* The second is when using the reference borrowing specifier in
* ast_json_pack() (capital \c O). This can be avoided by using the reference
* stealing specifier (lowercase \c o) and wrapping the JSON object parameter
* with ast_json_ref() for an explicit ref-bump.
*
* \par Example code
*
* \code
@@ -907,7 +878,7 @@ struct ast_json *ast_json_load_new_file(const char *path, struct ast_json_error
* \brief Helper for creating complex JSON values.
* \since 12.0.0
*
* See original Jansson docs at http://www.digip.org/jansson/doc/2.4/apiref.html#apiref-pack
* See original Jansson docs at http://www.digip.org/jansson/doc/2.11/apiref.html#apiref-pack
* for more details.
*/
struct ast_json *ast_json_pack(char const *format, ...);
@@ -916,7 +887,7 @@ struct ast_json *ast_json_pack(char const *format, ...);
* \brief Helper for creating complex JSON values simply.
* \since 12.0.0
*
* See original Jansson docs at http://www.digip.org/jansson/doc/2.4/apiref.html#apiref-pack
* See original Jansson docs at http://www.digip.org/jansson/doc/2.11/apiref.html#apiref-pack
* for more details.
*/
struct ast_json *ast_json_vpack(char const *format, va_list ap);