Lines Matching refs:replacement
1764 …cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON *const parent, cJSON *const item, cJSON *replacement) in cJSON_ReplaceItemViaPointer() argument
1766 if ((parent == NULL) || (replacement == NULL) || (item == NULL)) return false; in cJSON_ReplaceItemViaPointer()
1768 if (replacement == item) return true; in cJSON_ReplaceItemViaPointer()
1770 replacement->next = item->next; in cJSON_ReplaceItemViaPointer()
1771 replacement->prev = item->prev; in cJSON_ReplaceItemViaPointer()
1773 if (replacement->next != NULL) replacement->next->prev = replacement; in cJSON_ReplaceItemViaPointer()
1775 if (parent->child->prev == parent->child) replacement->prev = replacement; in cJSON_ReplaceItemViaPointer()
1776 parent->child = replacement; in cJSON_ReplaceItemViaPointer()
1781 if (replacement->prev != NULL) replacement->prev->next = replacement; in cJSON_ReplaceItemViaPointer()
1782 if (replacement->next == NULL) parent->child->prev = replacement; in cJSON_ReplaceItemViaPointer()
1799 static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJS… in replace_item_in_object() argument
1801 if ((replacement == NULL) || (string == NULL)) return false; in replace_item_in_object()
1804 …if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL)) cJSON_free(replac… in replace_item_in_object()
1805 replacement->string = (char *)cJSON_strdup((const unsigned char *)string, &global_hooks); in replace_item_in_object()
1806 if (replacement->string == NULL) return false; in replace_item_in_object()
1808 replacement->type &= ~cJSON_StringIsConst; in replace_item_in_object()
1810 … cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement); in replace_item_in_object()