| 520 | void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));} |
| 521 | |
| 522 | cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) { |
| 523 | cJSON *c=array->child; |
| 524 | while (c && which>0) c=c->next,which--; |
| 525 | if (!c) return nullptr; |
| 526 | if (c->prev) c->prev->next=c->next; |
| 527 | if (c->next) c->next->prev=c->prev; |
| 528 | if (c==array->child) array->child=c->next; |
| 529 | c->prev=c->next=nullptr; |
| 530 | return c; |
| 531 | } |
| 532 | void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));} |
| 533 | cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return nullptr;} |
| 534 | void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));} |
no outgoing calls
no test coverage detected