aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2016-08-31 17:57:23 +0300
committerGitHub <noreply@github.com>2016-08-31 17:57:23 +0300
commit7d1af52ab46bd22c5f7b7e28a8d4dce2f0ef0420 (patch)
tree3810724356c6ce2199b883bdff6fc829de228234 /doc
parent0ffecdbadee9f4541d74f31884300aeb5596de4c (diff)
parent63b9fd055248bcd427fd455ce9623431885b235e (diff)
downloadjansson-7d1af52ab46bd22c5f7b7e28a8d4dce2f0ef0420.zip
jansson-7d1af52ab46bd22c5f7b7e28a8d4dce2f0ef0420.tar.gz
jansson-7d1af52ab46bd22c5f7b7e28a8d4dce2f0ef0420.tar.bz2
Merge pull request #301 from npmccallum/master
Add support for the cleanup attribute in GCC/Clang
Diffstat (limited to 'doc')
-rw-r--r--doc/apiref.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/apiref.rst b/doc/apiref.rst
index a01e352..77578a9 100644
--- a/doc/apiref.rst
+++ b/doc/apiref.rst
@@ -253,6 +253,24 @@ other. Moreover, trying to encode the values with any of the encoding
functions will fail. The encoder detects circular references and
returns an error status.
+Scope Dereferencing
+-------------------
+
+It is possible to use the ``json_auto_t`` type to automatically
+dereference a value at the end of a scope. For example::
+
+ void function(void) {
+ json_auto_t *value = NULL;
+ value = json_string("foo");
+ /* json_decref(value) is automatically called. */
+ }
+
+This feature is only available on GCC and Clang. So if your project
+has a portability requirement for other compilers, you should avoid
+this feature.
+
+Additionally, as always, care should be taken when passing values to
+functions that steal references.
True, False and Null
====================