Lines Matching defs:from
470 /* Couldn't find object to remove child from. */
922 /* Copy/Move uses "from". */
925 cJSON *from = get_object_item(patch, "from", case_sensitive);
926 if (from == NULL)
928 /* missing "from" for copy/move. */
935 value = detach_path(object, (unsigned char*)from->valuestring, case_sensitive);
939 value = get_item_from_pointer(object, from->valuestring, case_sensitive);
943 /* missing "from" for copy/move. */
1158 static void create_patches(cJSON * const patches, const unsigned char * const path, cJSON * const from, cJSON * const to, const cJSON_bool case_sensitive)
1160 if ((from == NULL) || (to == NULL))
1165 if ((from->type & 0xFF) != (to->type & 0xFF))
1171 switch (from->type & 0xFF)
1174 if ((from->valueint != to->valueint) || !compare_double(from->valuedouble, to->valuedouble))
1181 if (strcmp(from->valuestring, to->valuestring) != 0)
1190 cJSON *from_child = from->child;
1194 /* generate patches for all array elements that exist in both "from" and "to" */
1209 /* remove leftover elements from 'from' that are not in 'to' */
1223 /* add new elements in 'to' that were not in 'from' */
1236 sort_object(from, case_sensitive);
1239 from_child = from->child;
1284 /* object element doesn't exist in 'from' --> add it */
1298 CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * const to)
1302 if ((from == NULL) || (to == NULL))
1308 create_patches(patches, (const unsigned char*)"", from, to, false);
1313 CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatchesCaseSensitive(cJSON * const from, cJSON * const to)
1317 if ((from == NULL) || (to == NULL))
1323 create_patches(patches, (const unsigned char*)"", from, to, true);
1408 static cJSON *generate_merge_patch(cJSON * const from, cJSON * const to, const cJSON_bool case_sensitive)
1418 if (!cJSON_IsObject(to) || !cJSON_IsObject(from))
1423 sort_object(from, case_sensitive);
1426 from_child = from->child;
1454 /* from has a value that to doesn't have -> remove */
1461 /* to has a value that from doesn't have -> add to patch */
1490 CJSON_PUBLIC(cJSON *) cJSONUtils_GenerateMergePatch(cJSON * const from, cJSON * const to)
1492 return generate_merge_patch(from, to, false);
1495 CJSON_PUBLIC(cJSON *) cJSONUtils_GenerateMergePatchCaseSensitive(cJSON * const from, cJSON * const to)
1497 return generate_merge_patch(from, to, true);