Lines Matching defs:replacement
2559 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement)
2561 if ((parent == NULL) || (parent->child == NULL) || (replacement == NULL) || (item == NULL))
2566 if (replacement == item)
2571 replacement->next = item->next;
2572 replacement->prev = item->prev;
2574 if (replacement->next != NULL)
2576 replacement->next->prev = replacement;
2582 replacement->prev = replacement;
2584 parent->child = replacement;
2591 if (replacement->prev != NULL)
2593 replacement->prev->next = replacement;
2595 if (replacement->next == NULL)
2597 parent->child->prev = replacement;
2618 static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive)
2620 if ((replacement == NULL) || (string == NULL))
2625 /* replace the name in the replacement */
2626 if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL))
2628 cJSON_free(replacement->string);
2630 replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2631 if (replacement->string == NULL)
2636 replacement->type &= ~cJSON_StringIsConst;
2638 return cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement);