Explorar o código

Merge pull request #15 from dieyushi/master

add new macro for iterating over an array
Kevin Branigan %!s(int64=9) %!d(string=hai) anos
pai
achega
11fb0d0215
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      cJSON.h

+ 3 - 0
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