mirror of
https://github.com/json-c/json-c.git
synced 2026-03-22 22:49:06 +08:00
Clarify json_object_get_string documentation of NULL handling & returning
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user