mirror of
https://github.com/akheron/jansson.git
synced 2025-04-06 05:55:05 +00:00
Add json_array_foreach() #define, parallelling json_object_foreach()
This commit is contained in:
parent
d3bd463897
commit
6950cd203b
1 changed files with 5 additions and 0 deletions
|
@ -148,6 +148,11 @@ int json_object_iter_set_new(json_t *object, void *iter, json_t *value);
|
|||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); \
|
||||
key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key))))
|
||||
|
||||
#define json_array_foreach(array, index, value) \
|
||||
for(index = 0; \
|
||||
index < json_array_size(array) && (value = json_array_get(array, index)); \
|
||||
index++)
|
||||
|
||||
static JSON_INLINE
|
||||
int json_object_set(json_t *object, const char *key, json_t *value)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue