Start splitting struct json_object into multiple sub-types, as descibed at https://github.com/json-c/json-c/wiki/Proposal:-struct-json_object-split

The current changes split out _only_ json_type_object, and thus have a number of hacks
 to allow the code to continue to build and work.

Originally  mentioned in issue #535.
When complete, this will probably invalidate #552.
This is likely to cause notable conflicts in any other significant un-merged
changes, such as PR#620.
This commit is contained in:
Eric Haszlakiewicz
2020-05-25 03:14:06 +00:00
parent 4a546e7b2f
commit 853b4b5dee
5 changed files with 406 additions and 52 deletions

View File

@@ -490,8 +490,9 @@ JSON_EXPORT void json_object_object_del(struct json_object *obj, const char *key
* @param obj the json_object instance
* @param iter the object iterator, use type json_object_iter
*/
// XAX temporary workaround during code conversion:
#define json_object_object_foreachC(obj, iter) \
for (iter.entry = json_object_get_object(obj)->head; \
for (iter.entry = json_object_get_object(PUBLIC(obj))->head; \
(iter.entry ? (iter.key = (char *)lh_entry_k(iter.entry), \
iter.val = (struct json_object *)lh_entry_v(iter.entry), iter.entry) \
: 0); \