| 1036 | } |
| 1037 | |
| 1038 | CJSON_PUBLIC(int) cJSONUtils_ApplyPatches(cJSON * const object, const cJSON * const patches) |
| 1039 | { |
| 1040 | const cJSON *current_patch = NULL; |
| 1041 | int status = 0; |
| 1042 | |
| 1043 | if (!cJSON_IsArray(patches)) |
| 1044 | { |
| 1045 | /* malformed patches. */ |
| 1046 | return 1; |
| 1047 | } |
| 1048 | |
| 1049 | if (patches != NULL) |
| 1050 | { |
| 1051 | current_patch = patches->child; |
| 1052 | } |
| 1053 | |
| 1054 | while (current_patch != NULL) |
| 1055 | { |
| 1056 | status = apply_patch(object, current_patch, false); |
| 1057 | if (status != 0) |
| 1058 | { |
| 1059 | return status; |
| 1060 | } |
| 1061 | current_patch = current_patch->next; |
| 1062 | } |
| 1063 | |
| 1064 | return 0; |
| 1065 | } |
| 1066 | |
| 1067 | CJSON_PUBLIC(int) cJSONUtils_ApplyPatchesCaseSensitive(cJSON * const object, const cJSON * const patches) |
| 1068 | { |
searching dependent graphs…