diff options
| -rw-r--r-- | src/cJSON.c | 12 | ||||
| -rw-r--r-- | src/cJSON.h | 1 | 
2 files changed, 13 insertions, 0 deletions
diff --git a/src/cJSON.c b/src/cJSON.c index 1941d114..cf0cb132 100644 --- a/src/cJSON.c +++ b/src/cJSON.c @@ -1200,6 +1200,18 @@ cJSON_CreateString (const char *string)  }  cJSON * +cJSON_CreateStringConvey (char *string) +{ +  cJSON *item = cJSON_New_Item (); +  if (item) +    { +      item->type = cJSON_String; +      item->valuestring = string; +    } +  return item; +} + +cJSON *  cJSON_CreateArray (void)  {    cJSON *item = cJSON_New_Item (); diff --git a/src/cJSON.h b/src/cJSON.h index 69c3056a..a200c318 100644 --- a/src/cJSON.h +++ b/src/cJSON.h @@ -113,6 +113,7 @@ extern cJSON *cJSON_CreateFalse(void);  extern cJSON *cJSON_CreateBool(int b);  extern cJSON *cJSON_CreateNumber(double num);  extern cJSON *cJSON_CreateString(const char *string); +extern cJSON *cJSON_CreateStringConvey (char *string);  extern cJSON *cJSON_CreateArray(void);  extern cJSON *cJSON_CreateObject(void);  | 
