MCPcopy Create free account
hub / github.com/Bwar/CJsonObject / cJSON_CreateString

Function cJSON_CreateString

cJSON.c:1021–1030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019 return item;
1020}
1021cJSON *cJSON_CreateString(const char *string)
1022{
1023 cJSON *item = cJSON_New_Item();
1024 if (item)
1025 {
1026 item->type = cJSON_String;
1027 item->valuestring = cJSON_strdup(string);
1028 }
1029 return item;
1030}
1031cJSON *cJSON_CreateArray()
1032{
1033 cJSON *item = cJSON_New_Item();

Callers 4

AddMethod · 0.85
ReplaceMethod · 0.85
AddAsFirstMethod · 0.85
cJSON_CreateStringArrayFunction · 0.85

Calls 2

cJSON_New_ItemFunction · 0.85
cJSON_strdupFunction · 0.85

Tested by

no test coverage detected