MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / cJSON_ReplaceItemInObject

Function cJSON_ReplaceItemInObject

modules/freeswitch/esl/src/esl_json.c:527–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525 newitem->next=c->next;newitem->prev=c->prev;if (newitem->next) newitem->next->prev=newitem;
526 if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;c->next=c->prev=0;cJSON_Delete(c);}
527ESL_DECLARE(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem){int i=0;cJSON *c=object->child;while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;if(c){newitem->string=cJSON_strdup(string);cJSON_ReplaceItemInArray(object,i,newitem);}}
528
529/* Create basic types: */
530ESL_DECLARE(cJSON *)cJSON_CreateNull(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_NULL;return item;}

Callers

nothing calls this directly

Calls 3

cJSON_strcasecmpFunction · 0.70
cJSON_strdupFunction · 0.70
cJSON_ReplaceItemInArrayFunction · 0.70

Tested by

no test coverage detected