diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-11-15 19:27:45 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-11-15 19:27:45 +0100 |
commit | 84ffcb82e917579f7f4e9df336c1fc3d52d38846 (patch) | |
tree | 0dbc25c78980a2c94eb5dcfbd6b9ff316267b679 /depends/cJSON.h | |
parent | 1c96d1bb874fb7908a0594bcde971a772a80bcfb (diff) |
Update cJSON to v1.7.18
Diffstat (limited to 'depends/cJSON.h')
-rw-r--r-- | depends/cJSON.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/depends/cJSON.h b/depends/cJSON.h index e97e5f4..a37d69e 100644 --- a/depends/cJSON.h +++ b/depends/cJSON.h @@ -81,7 +81,7 @@ then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJ /* project version */ #define CJSON_VERSION_MAJOR 1 #define CJSON_VERSION_MINOR 7 -#define CJSON_VERSION_PATCH 14 +#define CJSON_VERSION_PATCH 18 #include <stddef.h> @@ -256,7 +256,7 @@ CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * cons /* Minify a strings, remove blank characters(such as ' ', '\t', '\r', '\n') from strings. * The input pointer json cannot point to a read-only address area, such as a string constant, - * but should point to a readable and writable adress area. */ + * but should point to a readable and writable address area. */ CJSON_PUBLIC(void) cJSON_Minify(char *json); /* Helper functions for creating and adding items to an object at the same time. @@ -279,6 +279,13 @@ CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); /* Change the valuestring of a cJSON_String object, only takes effect when type of object is cJSON_String */ CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring); +/* If the object is not a boolean type this does nothing and returns cJSON_Invalid else it returns the new type*/ +#define cJSON_SetBoolValue(object, boolValue) ( \ + (object != NULL && ((object)->type & (cJSON_False|cJSON_True))) ? \ + (object)->type=((object)->type &(~(cJSON_False|cJSON_True)))|((boolValue)?cJSON_True:cJSON_False) : \ + cJSON_Invalid\ +) + /* Macro for iterating over an array or object */ #define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) @@ -290,4 +297,4 @@ CJSON_PUBLIC(void) cJSON_free(void *object); } #endif -#endif +#endif
\ No newline at end of file |