MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / get_array_item

Function get_array_item

framework/utils/cJSON.c:1743–1760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1741}
1742
1743static cJSON* get_array_item(const cJSON *array, size_t index)
1744{
1745 cJSON *current_child = NULL;
1746
1747 if (array == NULL)
1748 {
1749 return NULL;
1750 }
1751
1752 current_child = array->child;
1753 while ((current_child != NULL) && (index > 0))
1754 {
1755 index--;
1756 current_child = current_child->next;
1757 }
1758
1759 return current_child;
1760}
1761
1762CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index)
1763{

Callers 4

cJSON_GetArrayItemFunction · 0.85
cJSON_InsertItemInArrayFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected