Lines Matching refs:array

1825 CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array)  in cJSON_GetArraySize()  argument
1830 if (array == NULL) in cJSON_GetArraySize()
1835 child = array->child; in cJSON_GetArraySize()
1848 static cJSON* get_array_item(const cJSON *array, size_t index) in get_array_item() argument
1852 if (array == NULL) in get_array_item()
1857 current_child = array->child; in get_array_item()
1867 CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index) in cJSON_GetArrayItem() argument
1874 return get_array_item(array, (size_t)index); in cJSON_GetArrayItem()
1953 static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) in add_item_to_array() argument
1957 if ((item == NULL) || (array == NULL) || (array == item)) in add_item_to_array()
1962 child = array->child; in add_item_to_array()
1969 array->child = item; in add_item_to_array()
1979 array->child->prev = item; in add_item_to_array()
1988 array->child->prev = item; in add_item_to_array()
1996 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item) in cJSON_AddItemToArray() argument
1998 return add_item_to_array(array, item); in cJSON_AddItemToArray()
2065 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) in cJSON_AddItemReferenceToArray() argument
2067 if (array == NULL) in cJSON_AddItemReferenceToArray()
2072 return add_item_to_array(array, create_reference(item, &global_hooks)); in cJSON_AddItemReferenceToArray()
2183 cJSON *array = cJSON_CreateArray(); in cJSON_AddArrayToObject() local
2184 if (add_item_to_object(object, name, array, &global_hooks, false)) in cJSON_AddArrayToObject()
2186 return array; in cJSON_AddArrayToObject()
2189 cJSON_Delete(array); in cJSON_AddArrayToObject()
2223 CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which) in cJSON_DetachItemFromArray() argument
2230 return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which)); in cJSON_DetachItemFromArray()
2233 CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which) in cJSON_DeleteItemFromArray() argument
2235 cJSON_Delete(cJSON_DetachItemFromArray(array, which)); in cJSON_DeleteItemFromArray()
2263 CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) in cJSON_InsertItemInArray() argument
2272 after_inserted = get_array_item(array, (size_t)which); in cJSON_InsertItemInArray()
2275 return add_item_to_array(array, newitem); in cJSON_InsertItemInArray()
2281 if (after_inserted == array->child) in cJSON_InsertItemInArray()
2283 array->child = newitem; in cJSON_InsertItemInArray()
2333 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) in cJSON_ReplaceItemInArray() argument
2340 return cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); in cJSON_ReplaceItemInArray()