akheron/jansson — pull request #64 by rogerz (2012-03-29 02:41:20+00:00)
Title: Add deep update functions for json object and array

### json_object_deep_update() ###

behavior is similar to `json_object_update()` except that if the value is object, do json_object_deep_update() recursively.

### flags ###

#define JSON_SKIP_NEW_KEYS 0x01

Don't create new keys.

#define JSON_SKIP_OLD_KEYS 0x02

Don't overwrite old keys, but old keys whose value is object and new value is also object still get updated

#define JSON_SAME_TYPE_ONLY 0x04

Don't overwrite old keys if type changed. Type is divided to `boolean`, `string` and `number`

#define JSON_EXTEND_ARRAY 0x08

If both values are array, extend the origin one instead of replacement

#define JSON_DEEP_IN_ARRAY 0x10

If both values are array, have same size, update the object element one by one using `json_object_deep_update()` and array element one by one using `json_array_deep_update()`, otherwise the original element is kept.

### json_array_deep_update() ###

It applies only for array having same size. The behavior is described as above.