aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2019-03-08 12:57:59 -0500
committerSean Bright <sean.bright@gmail.com>2019-03-12 13:03:34 -0400
commit76300601d9cb3f8756dd94f0f8a354ff844ae686 (patch)
tree90decc41adc484e6ec9cf7d4e106cc4630876319 /doc
parentf4498d2856fff130366e1dacc74d66d3502e0e5c (diff)
downloadjansson-76300601d9cb3f8756dd94f0f8a354ff844ae686.zip
jansson-76300601d9cb3f8756dd94f0f8a354ff844ae686.tar.gz
jansson-76300601d9cb3f8756dd94f0f8a354ff844ae686.tar.bz2
Add runtime version checking functions
This patch adds two new exported functions: * `jansson_version_str` - Returns a human-readable version number * `jansson_version_cmp` - Returns an integer less than, equal to, or greater than zero if the runtime version of Jansson is found, respectively, to be less than, to match, or be greater than the provided major, minor, and micro.
Diffstat (limited to 'doc')
-rw-r--r--doc/apiref.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/apiref.rst b/doc/apiref.rst
index 3945c11..1b305f5 100644
--- a/doc/apiref.rst
+++ b/doc/apiref.rst
@@ -58,6 +58,25 @@ the library:
/* Code specific to version 1.3 and above */
#endif
+Additionally, there are functions to determine the version of Jansson at
+runtime:
+
+.. function:: const char *jansson_version_str()
+
+ Return the version of the Jansson library, in the same format as
+ the ``JANSSON_VERSION`` preprocessor constant.
+
+ .. versionadded:: 2.13
+
+.. function:: int jansson_version_cmp(int major, int minor, int micro)
+
+ Returns an integer less than, equal to, or greater than zero if
+ the runtime version of Jansson is found, respectively, to be less
+ than, to match, or be greater than the provided *major*, *minor*, and
+ *micro*.
+
+ .. versionadded:: 2.13
+
``JANSSON_THREAD_SAFE_REFCOUNT``
If this value is defined all read-only operations and reference counting in
Jansson are thread safe. This value is not defined for versions older than