From ea29df4d93b1b7b384c15f39a4ee20be3e0991ac Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Tue, 16 Jul 2013 18:09:55 -0400 Subject: Clarify and improve k5_json_object_set Document that k5_json_object_set can be used to overwrite an existing key, and make it possible to remove a key by setting it to NULL. --- src/include/k5-json.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/include/k5-json.h') diff --git a/src/include/k5-json.h b/src/include/k5-json.h index b01b8b847e..8b22cd39d3 100644 --- a/src/include/k5-json.h +++ b/src/include/k5-json.h @@ -168,7 +168,11 @@ void k5_json_object_iterate(k5_json_object obj, /* Return the number of mappings in an object. */ size_t k5_json_object_count(k5_json_object obj); -/* Store val into object at key, incrementing val's reference count. */ +/* + * Store val into object at key, incrementing val's reference count and + * releasing any previous value at key. If val is NULL, key is removed from + * obj if it exists, and obj remains unchanged if it does not. + */ int k5_json_object_set(k5_json_object obj, const char *key, k5_json_value val); /* Get an alias to the object's value for key, without incrementing the -- cgit