diff options
author | Emmanuele Bassi <ebassi@openedhand.com> | 2007-10-07 00:47:32 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@openedhand.com> | 2007-10-07 00:47:32 +0100 |
commit | b12efcec57fff6e7637fc924fc50333b97eb2594 (patch) | |
tree | 18237f208f9287dc305be278f9b691eee37a22ba /json-glib/json-array.c | |
parent | bd5a60ca658257752993ccea47950b97cdc45246 (diff) | |
download | json-glib-b12efcec57fff6e7637fc924fc50333b97eb2594.tar.gz |
Fix documentation about the ownership of the nodes
When adding a JsonNode to a JsonObject or a JsonArray, the containers
take ownership of the node.
Diffstat (limited to 'json-glib/json-array.c')
-rw-r--r-- | json-glib/json-array.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/json-glib/json-array.c b/json-glib/json-array.c index e9727e8..70b82dd 100644 --- a/json-glib/json-array.c +++ b/json-glib/json-array.c @@ -32,6 +32,7 @@ * Since arrays can be expensive, they are reference counted. You can control * the lifetime of a #JsonArray using json_array_ref() and json_array_unref(). * + * To append an element, use json_array_add_element(). * To extract an element at a given index, use json_array_get_element(). * To retrieve the entire array in list form, use json_array_get_elements(). * To retrieve the length of the array, use json_array_get_length(). @@ -183,7 +184,8 @@ json_array_get_elements (JsonArray *array) * @array: a #JsonArray * @index_: the index of the element to retrieve * - * Retrieves the element at @index_ inside a #JsonArray. + * Retrieves the #JsonNode containing the value of the element at @index_ + * inside a #JsonArray. * * Return value: a pointer to the #JsonNode at the requested index */ @@ -218,7 +220,8 @@ json_array_get_length (JsonArray *array) * @array: a #JsonArray * @node: a #JsonNode * - * Appends @node inside @array. + * Appends @node inside @array. The array will take ownership of the + * #JsonNode. */ void json_array_add_element (JsonArray *array, |