[json-glib/wip/ordered-iter] Document json_from_string() nullability



commit ca1feef35c86226fd92266443c58dcedd2bff5e4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Aug 24 15:18:10 2020 +0100

    Document json_from_string() nullability
    
    The function can return NULL even without setting an error, so we need
    to add a `nullable` annotation. While at it, document the handling of
    empty strings more explicitly.
    
    Fixes: #46

 json-glib/json-utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/json-glib/json-utils.c b/json-glib/json-utils.c
index 2ba3690..5fc8496 100644
--- a/json-glib/json-utils.c
+++ b/json-glib/json-utils.c
@@ -37,12 +37,12 @@
  * @error: return location for a #GError
  *
  * Parses the string in @str and returns a #JsonNode representing
- * the JSON tree.
+ * the JSON tree. If @str is empty, this function will return %NULL.
  *
  * In case of parsing error, this function returns %NULL and sets
  * @error appropriately.
  *
- * Returns: (transfer full): a #JsonNode, or %NULL
+ * Returns: (transfer full) (nullable): a #JsonNode, or %NULL
  *
  * Since: 1.2
  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]