| 2514 | } |
| 2515 | |
| 2516 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2517 | { |
| 2518 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2519 | if(item) |
| 2520 | { |
| 2521 | item->type = cJSON_String; |
| 2522 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2523 | if(!item->valuestring) |
| 2524 | { |
| 2525 | cJSON_Delete(item); |
| 2526 | return NULL; |
| 2527 | } |
| 2528 | } |
| 2529 | |
| 2530 | return item; |
| 2531 | } |
| 2532 | |
| 2533 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2534 | { |
searching dependent graphs…