MCPcopy Create free account
hub / github.com/antirez/botlib / get_array_item

Function get_array_item

cJSON.c:1847–1864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 4

cJSON_GetArrayItemFunction · 0.85
cJSON_InsertItemInArrayFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected