summaryrefslogtreecommitdiff
path: root/json-glib/json-object.c
diff options
context:
space:
mode:
authorMatthew Leeds <mleeds@redhat.com>2016-07-26 16:02:58 -0400
committerEmmanuele Bassi <ebassi@gnome.org>2017-03-18 19:09:26 +0000
commit43001a944a2511532ce4348f5671ead06dc87baa (patch)
tree6cea706ff52da98d5300bf70a386773b27d6d9e5 /json-glib/json-object.c
parenta15dcc4a1be7daa55aed6153a81abc9a49d0f348 (diff)
downloadjson-glib-43001a944a2511532ce4348f5671ead06dc87baa.tar.gz
docs: Clarify when NULL might be returned
If a JsonObject has no members, json_object_get_members() and json_object_get_values() will return NULL, so this commit makes that behavior clear in the docs. It also adds the (nullable) annotation in a few places in the same file. https://bugzilla.gnome.org/show_bug.cgi?id=769206
Diffstat (limited to 'json-glib/json-object.c')
-rw-r--r--json-glib/json-object.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/json-glib/json-object.c b/json-glib/json-object.c
index 4d89cd6..be458ed 100644
--- a/json-glib/json-object.c
+++ b/json-glib/json-object.c
@@ -474,11 +474,11 @@ json_object_set_object_member (JsonObject *object,
* Retrieves all the names of the members of a #JsonObject. You can
* obtain the value for each member using json_object_get_member().
*
- * Return value: (element-type utf8) (transfer container): a #GList
- * of member names. The content of the list is owned by the #JsonObject
- * and should never be modified or freed. When you have finished using
- * the returned list, use g_list_free() to free the resources it has
- * allocated.
+ * Return value: (element-type utf8) (transfer container) (nullable): a
+ * #GList of member names, or %NULL. The content of the list is owned
+ * by the #JsonObject and should never be modified or freed. When you
+ * have finished using the returned list, use g_list_free() to free
+ * the resources it has allocated.
*/
GList *
json_object_get_members (JsonObject *object)
@@ -498,10 +498,11 @@ json_object_get_members (JsonObject *object)
*
* Retrieves all the values of the members of a #JsonObject.
*
- * Return value: (element-type JsonNode) (transfer container): a #GList of
- * #JsonNodes. The content of the list is owned by the #JsonObject
- * and should never be modified or freed. When you have finished using the
- * returned list, use g_list_free() to free the resources it has allocated.
+ * Return value: (element-type JsonNode) (transfer container) (nullable): a
+ * #GList of #JsonNodes, or %NULL. The content of the list is owned by the
+ * #JsonObject and should never be modified or freed. When you have finished
+ * using the returned list, use g_list_free() to free the resources it has
+ * allocated.
*/
GList *
json_object_get_values (JsonObject *object)
@@ -525,8 +526,8 @@ json_object_get_values (JsonObject *object)
* Retrieves a copy of the #JsonNode containing the value of @member_name
* inside a #JsonObject
*
- * Return value: (transfer full): a copy of the node for the requested
- * object member or %NULL. Use json_node_unref() when done.
+ * Return value: (transfer full) (nullable): a copy of the node for the
+ * requested object member or %NULL. Use json_node_unref() when done.
*
* Since: 0.6
*/
@@ -561,8 +562,8 @@ object_get_member_internal (JsonObject *object,
* Retrieves the #JsonNode containing the value of @member_name inside
* a #JsonObject.
*
- * Return value: (transfer none): a pointer to the node for the requested object
- * member, or %NULL
+ * Return value: (transfer none) (nullable): a pointer to the node for the
+ * requested object member, or %NULL
*/
JsonNode *
json_object_get_member (JsonObject *object,