Lines Matching defs:newitem

2525 CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem)
2529 if (which < 0 || newitem == NULL)
2537 return add_item_to_array(array, newitem);
2545 newitem->next = after_inserted;
2546 newitem->prev = after_inserted->prev;
2547 after_inserted->prev = newitem;
2550 array->child = newitem;
2554 newitem->prev->next = newitem;
2608 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem)
2615 return cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem);
2641 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem)
2643 return replace_item_in_object(object, string, newitem, false);
2646 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem)
2648 return replace_item_in_object(object, string, newitem, true);
3019 cJSON *newitem = NULL;
3030 newitem = cJSON_New_Item(&global_hooks);
3031 if (!newitem)
3036 newitem->type = item->type & (~cJSON_IsReference);
3037 newitem->valueint = item->valueint;
3038 newitem->valuedouble = item->valuedouble;
3041 newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks);
3042 if (!newitem->valuestring)
3049 newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks);
3050 if (!newitem->string)
3058 return newitem;
3071 /* If newitem->child already set, then crosswire ->prev and ->next and move on */
3078 /* Set newitem->child and move to it */
3079 newitem->child = newchild;
3084 if (newitem && newitem->child)
3086 newitem->child->prev = newchild;
3089 return newitem;
3092 if (newitem != NULL)
3094 cJSON_Delete(newitem);