Browse Source

Merge pull request #223 from minaguib/master

Clarify json_object_get_string documentation of NULL handling & return
tags/json-c-0.13-20171207
Eric Haszlakiewicz 9 years ago
parent
commit
02a2151b2b
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      json_object.h

+ 8
- 3
json_object.h View File

@@ -670,14 +670,19 @@ extern struct json_object* json_object_new_string_len(const char *s, int len);

/** Get the string value of a json_object
*
* If the passed object is not of type json_type_string then the JSON
* representation of the object is returned.
* If the passed object is of type json_type_null (i.e. obj == NULL),
* NULL is returned.
*
* If the passed object of type json_type_string, the string contents
* are returned.
*
* Otherwise the JSON representation of the object is returned.
*
* The returned string memory is managed by the json_object and will
* be freed when the reference count of the json_object drops to zero.
*
* @param obj the json_object instance
* @returns a string
* @returns a string or NULL
*/
extern const char* json_object_get_string(struct json_object *obj);



Loading…
Cancel
Save