cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 11fb0d0215bc6b428967712fca7a4dd498769636
parent 1e1de63244938d32086f4e81e20171a744b137de
Author: Kevin Branigan <kbranigan@gmail.com>
Date:   Thu,  1 Oct 2015 11:38:33 -0400

Merge pull request #15 from dieyushi/master

add new macro for iterating over an array

Diffstat:
McJSON.h | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/cJSON.h b/cJSON.h @@ -142,6 +142,9 @@ extern void cJSON_Minify(char *json); #define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) #define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) +/* Macro for iterating over an array */ +#define cJSON_ArrayForEach(pos, head) for(pos = (head)->child; pos != NULL; pos = pos->next) + #ifdef __cplusplus } #endif