summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2014-09-13 22:18:51 -0400
committerEric Haszlakiewicz <erh+git@nimenees.com>2014-09-13 22:18:51 -0400
commitec4879ac5b502ae81f6b73450b960ede11ad2560 (patch)
tree26c4e19fa77723770f0fa78ab674278df305eaac
parent6ec6fdaf8c89dc78d2c0f1a3482a93195de110e3 (diff)
parent37f5d8696d2c60d106dbba9fe73a5ead40b8fd19 (diff)
Merge pull request #153 from LeSpocky/doc
improve doc for json_object_to_json_string()
-rw-r--r--json_object.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/json_object.h b/json_object.h
index 0634758..0dca0b1 100644
--- a/json_object.h
+++ b/json_object.h
@@ -161,12 +161,17 @@ extern enum json_type json_object_get_type(struct json_object *obj);
/** Stringify object to json format.
* Equivalent to json_object_to_json_string_ext(obj, JSON_C_TO_STRING_SPACED)
+ * The pointer you get is an internal of your json object. You don't
+ * have to free it, later use of json_object_put() should be sufficient.
+ * If you can not ensure there's no concurrent access to *obj use
+ * strdup().
* @param obj the json_object instance
* @returns a string in JSON format
*/
extern const char* json_object_to_json_string(struct json_object *obj);
/** Stringify object to json format
+ * @see json_object_to_json_string() for details on how to free string.
* @param obj the json_object instance
* @param flags formatting options, see JSON_C_TO_STRING_PRETTY and other constants
* @returns a string in JSON format