MCPcopy Create free account
hub / github.com/OpenIPC/firmware / get_array_item

Function get_array_item

general/package/xmdp/src/cjson/cJSON.c:1845–1862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1843}
1844
1845static cJSON* get_array_item(const cJSON *array, size_t index)
1846{
1847 cJSON *current_child = NULL;
1848
1849 if (array == NULL)
1850 {
1851 return NULL;
1852 }
1853
1854 current_child = array->child;
1855 while ((current_child != NULL) && (index > 0))
1856 {
1857 index--;
1858 current_child = current_child->next;
1859 }
1860
1861 return current_child;
1862}
1863
1864CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index)
1865{

Callers 4

cJSON_GetArrayItemFunction · 0.85
cJSON_InsertItemInArrayFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected