Lines Matching refs:case_sensitive

83 static int compare_strings(const unsigned char *string1, const unsigned char *string2, const cJSON_bool case_sensitive)
95 if (case_sensitive)
120 static cJSON_bool compare_pointers(const unsigned char *name, const unsigned char *pointer, const cJSON_bool case_sensitive)
142 else if ((!case_sensitive && (tolower(*name) != tolower(*pointer))) || (case_sensitive && (*name != *pointer)))
301 static cJSON *get_item_from_pointer(cJSON * const object, const char * pointer, const cJSON_bool case_sensitive)
328 while ((current_element != NULL) && !compare_pointers((unsigned char*)current_element->string, (const unsigned char*)pointer, case_sensitive))
430 static cJSON *detach_path(cJSON *object, const unsigned char *path, const cJSON_bool case_sensitive)
452 parent = get_item_from_pointer(object, (char*)parent_pointer, case_sensitive);
484 static cJSON *sort_list(cJSON *list, const cJSON_bool case_sensitive)
498 while ((current_item != NULL) && (current_item->next != NULL) && (compare_strings((unsigned char*)current_item->string, (unsigned char*)current_item->next->string, case_sensitive) < 0))
530 first = sort_list(first, case_sensitive);
531 second = sort_list(second, case_sensitive);
538 if (compare_strings((unsigned char*)first->string, (unsigned char*)second->string, case_sensitive) < 0)
595 static void sort_object(cJSON * const object, const cJSON_bool case_sensitive)
601 object->child = sort_list(object->child, case_sensitive);
604 static cJSON_bool compare_json(cJSON *a, cJSON *b, const cJSON_bool case_sensitive)
655 cJSON_bool identical = compare_json(a, b, case_sensitive);
673 sort_object(a, case_sensitive);
674 sort_object(b, case_sensitive);
679 if (compare_strings((unsigned char*)a->string, (unsigned char*)b->string, case_sensitive))
684 identical = compare_json(a, b, case_sensitive);
747 static cJSON *get_object_item(const cJSON * const object, const char* name, const cJSON_bool case_sensitive)
749 if (case_sensitive)
759 static enum patch_operation decode_patch_operation(const cJSON * const patch, const cJSON_bool case_sensitive)
761 cJSON *operation = get_object_item(patch, "op", case_sensitive);
824 static int apply_patch(cJSON *object, const cJSON *patch, const cJSON_bool case_sensitive)
834 path = get_object_item(patch, "path", case_sensitive);
842 opcode = decode_patch_operation(patch, case_sensitive);
851 status = !compare_json(get_item_from_pointer(object, path->valuestring, case_sensitive), get_object_item(patch, "value", case_sensitive), case_sensitive);
870 value = get_object_item(patch, "value", case_sensitive);
907 cJSON *old_item = detach_path(object, (unsigned char*)path->valuestring, case_sensitive);
925 cJSON *from = get_object_item(patch, "from", case_sensitive);
935 value = detach_path(object, (unsigned char*)from->valuestring, case_sensitive);
939 value = get_item_from_pointer(object, from->valuestring, case_sensitive);
960 value = get_object_item(patch, "value", case_sensitive);
988 parent = get_item_from_pointer(object, (char*)parent_pointer, case_sensitive);
1024 if (case_sensitive)
1158 static void create_patches(cJSON * const patches, const unsigned char * const path, cJSON * const from, cJSON * const to, const cJSON_bool case_sensitive)
1206 create_patches(patches, new_path, from_child, to_child, case_sensitive);
1236 sort_object(from, case_sensitive);
1237 sort_object(to, case_sensitive);
1255 diff = compare_strings((unsigned char*)from_child->string, (unsigned char*)to_child->string, case_sensitive);
1269 create_patches(patches, new_path, from_child, to_child, case_sensitive);
1338 static cJSON *merge_patch(cJSON *target, const cJSON * const patch, const cJSON_bool case_sensitive)
1361 if (case_sensitive)
1375 if (case_sensitive)
1384 replacement = merge_patch(replace_me, patch_child, case_sensitive);
1408 static cJSON *generate_merge_patch(cJSON * const from, cJSON * const to, const cJSON_bool case_sensitive)
1423 sort_object(from, case_sensitive);
1424 sort_object(to, case_sensitive);
1469 if (!compare_json(from_child, to_child, case_sensitive))