MCPcopy Create free account
hub / github.com/Netis/cloud-probe / cJSONUtils_ApplyPatches

Function cJSONUtils_ApplyPatches

cpworker/src/cJSON/cJSON_Utils.c:1059–1086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057}
1058
1059CJSON_PUBLIC(int) cJSONUtils_ApplyPatches(cJSON *const object, const cJSON *const patches)
1060{
1061 const cJSON *current_patch = NULL;
1062 int status = 0;
1063
1064 if (!cJSON_IsArray(patches))
1065 {
1066 /* malformed patches. */
1067 return 1;
1068 }
1069
1070 if (patches != NULL)
1071 {
1072 current_patch = patches->child;
1073 }
1074
1075 while (current_patch != NULL)
1076 {
1077 status = apply_patch(object, current_patch, false);
1078 if (status != 0)
1079 {
1080 return status;
1081 }
1082 current_patch = current_patch->next;
1083 }
1084
1085 return 0;
1086}
1087
1088CJSON_PUBLIC(int) cJSONUtils_ApplyPatchesCaseSensitive(cJSON *const object, const cJSON *const patches)
1089{

Callers

nothing calls this directly

Calls 2

cJSON_IsArrayFunction · 0.85
apply_patchFunction · 0.85

Tested by

no test coverage detected