Lines Matching refs:newitem
2268 CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) in cJSON_InsertItemInArray() argument
2272 if (which < 0 || newitem == NULL) in cJSON_InsertItemInArray()
2280 return add_item_to_array(array, newitem); in cJSON_InsertItemInArray()
2288 newitem->next = after_inserted; in cJSON_InsertItemInArray()
2289 newitem->prev = after_inserted->prev; in cJSON_InsertItemInArray()
2290 after_inserted->prev = newitem; in cJSON_InsertItemInArray()
2293 array->child = newitem; in cJSON_InsertItemInArray()
2297 newitem->prev->next = newitem; in cJSON_InsertItemInArray()
2351 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) in cJSON_ReplaceItemInArray() argument
2358 return cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); in cJSON_ReplaceItemInArray()
2384 …SON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) in cJSON_ReplaceItemInObject() argument
2386 return replace_item_in_object(object, string, newitem, false); in cJSON_ReplaceItemInObject()
2389 …SON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) in cJSON_ReplaceItemInObjectCaseSensitive() argument
2391 return replace_item_in_object(object, string, newitem, true); in cJSON_ReplaceItemInObjectCaseSensitive()
2718 cJSON *newitem = NULL; in cJSON_Duplicate() local
2729 newitem = cJSON_New_Item(&global_hooks); in cJSON_Duplicate()
2730 if (!newitem) in cJSON_Duplicate()
2735 newitem->type = item->type & (~cJSON_IsReference); in cJSON_Duplicate()
2736 newitem->valueint = item->valueint; in cJSON_Duplicate()
2737 newitem->valuedouble = item->valuedouble; in cJSON_Duplicate()
2740 … newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); in cJSON_Duplicate()
2741 if (!newitem->valuestring) in cJSON_Duplicate()
2748 …newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned … in cJSON_Duplicate()
2749 if (!newitem->string) in cJSON_Duplicate()
2757 return newitem; in cJSON_Duplicate()
2778 newitem->child = newchild; in cJSON_Duplicate()
2783 if (newitem && newitem->child) in cJSON_Duplicate()
2785 newitem->child->prev = newchild; in cJSON_Duplicate()
2788 return newitem; in cJSON_Duplicate()
2791 if (newitem != NULL) in cJSON_Duplicate()
2793 cJSON_Delete(newitem); in cJSON_Duplicate()