Lines Matching refs:string

171 static unsigned char *cJSON_strdup(const unsigned char *string, const internal_hooks *const hooks)  in cJSON_strdup()  argument
176 if (string == NULL) return NULL; in cJSON_strdup()
178 length = strlen((const char *)string) + sizeof(""); in cJSON_strdup()
181 memcpy(copy, string, length); in cJSON_strdup()
224 …if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) global_hooks.deallocate(item->s… in cJSON_Delete()
1303 current_item->string = current_item->valuestring; in parse_object()
1363 if (!print_string_ptr((unsigned char *)current_item->string, output_buffer)) return false; in print_object()
1453 …((current_element != NULL) && (current_element->string != NULL) && (strcmp(name, current_element-> in get_object_item()
1455 …cmp((const unsigned char *)name, (const unsigned char *)current_element->string) != 0)) current_el… in get_object_item()
1458 if ((current_element == NULL) || (current_element->string == NULL)) return NULL; in get_object_item()
1463 CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON *const object, const char *const string) in cJSON_GetObjectItem() argument
1465 return get_object_item(object, string, false); in cJSON_GetObjectItem()
1468 …BLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON *const object, const char *const string) in cJSON_GetObjectItemCaseSensitive() argument
1470 return get_object_item(object, string, true); in cJSON_GetObjectItemCaseSensitive()
1473 CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) in cJSON_HasObjectItem() argument
1475 return cJSON_GetObjectItem(object, string) ? 1 : 0; in cJSON_HasObjectItem()
1495 reference->string = NULL; in create_reference()
1540 static void *cast_away_const(const void *string) in cast_away_const() argument
1542 return (void *)string; in cast_away_const()
1548 static cJSON_bool add_item_to_object(cJSON *const object, const char *const string, cJSON *const it… in add_item_to_object() argument
1553 if ((object == NULL) || (string == NULL) || (item == NULL) || (object == item)) return false; in add_item_to_object()
1556 new_key = (char *)cast_away_const(string); in add_item_to_object()
1559 new_key = (char *)cJSON_strdup((const unsigned char *)string, hooks); in add_item_to_object()
1565 …if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) hooks->deallocate(item->string); in add_item_to_object()
1567 item->string = new_key; in add_item_to_object()
1573 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) in cJSON_AddItemToObject() argument
1575 return add_item_to_object(object, string, item, &global_hooks, false); in cJSON_AddItemToObject()
1579 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) in cJSON_AddItemToObjectCS() argument
1581 return add_item_to_object(object, string, item, &global_hooks, true); in cJSON_AddItemToObjectCS()
1591 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *i… in cJSON_AddItemReferenceToObject() argument
1593 if ((object == NULL) || (string == NULL)) return false; in cJSON_AddItemReferenceToObject()
1595 …return add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, fa… in cJSON_AddItemReferenceToObject()
1643 …N *) cJSON_AddStringToObject(cJSON *const object, const char *const name, const char *const string) in cJSON_AddStringToObject() argument
1645 cJSON *string_item = cJSON_CreateString(string); in cJSON_AddStringToObject()
1719 CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) in cJSON_DetachItemFromObject() argument
1721 cJSON *to_detach = cJSON_GetObjectItem(object, string); in cJSON_DetachItemFromObject()
1726 CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) in cJSON_DetachItemFromObjectCaseSensitive() argument
1728 cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); in cJSON_DetachItemFromObjectCaseSensitive()
1733 CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) in cJSON_DeleteItemFromObject() argument
1735 cJSON_Delete(cJSON_DetachItemFromObject(object, string)); in cJSON_DeleteItemFromObject()
1738 CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) in cJSON_DeleteItemFromObjectCaseSensitive() argument
1740 cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); in cJSON_DeleteItemFromObjectCaseSensitive()
1799 static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJS… in replace_item_in_object() argument
1801 if ((replacement == NULL) || (string == NULL)) return false; in replace_item_in_object()
1804 …cement->type & cJSON_StringIsConst) && (replacement->string != NULL)) cJSON_free(replacement->stri… in replace_item_in_object()
1805 replacement->string = (char *)cJSON_strdup((const unsigned char *)string, &global_hooks); in replace_item_in_object()
1806 if (replacement->string == NULL) return false; in replace_item_in_object()
1810 …return cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replac… in replace_item_in_object()
1813 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newite… in cJSON_ReplaceItemInObject() argument
1815 return replace_item_in_object(object, string, newitem, false); in cJSON_ReplaceItemInObject()
1818 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, … in cJSON_ReplaceItemInObjectCaseSensitive() argument
1820 return replace_item_in_object(object, string, newitem, true); in cJSON_ReplaceItemInObjectCaseSensitive()
1876 CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) in cJSON_CreateString() argument
1881 item->valuestring = (char *)cJSON_strdup((const unsigned char *)string, &global_hooks); in cJSON_CreateString()
1891 CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) in cJSON_CreateStringReference() argument
1896 item->valuestring = (char *)cast_away_const(string); in cJSON_CreateStringReference()
2097 if (item->string) { in cJSON_Duplicate()
2098 …newitem->string = (item->type & cJSON_StringIsConst) ? item->string : (char *)cJSON_strdup((unsign… in cJSON_Duplicate()
2099 if (!newitem->string) goto fail; in cJSON_Duplicate()
2349 b_element = get_object_item(b, a_element->string, case_sensitive); in cJSON_Compare()
2359 a_element = get_object_item(a, b_element->string, case_sensitive); in cJSON_Compare()