| 1831 | |
| 1832 | /* Get Array size/item / object item. */ |
| 1833 | CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array) |
| 1834 | { |
| 1835 | cJSON *child = NULL; |
| 1836 | size_t size = 0; |
| 1837 | |
| 1838 | if (array == NULL) |
| 1839 | { |
| 1840 | return 0; |
| 1841 | } |
| 1842 | |
| 1843 | child = array->child; |
| 1844 | |
| 1845 | while(child != NULL) |
| 1846 | { |
| 1847 | size++; |
| 1848 | child = child->next; |
| 1849 | } |
| 1850 | |
| 1851 | /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ |
| 1852 | |
| 1853 | return (int)size; |
| 1854 | } |
| 1855 | |
| 1856 | static cJSON* get_array_item(const cJSON *array, size_t index) |
| 1857 | { |
nothing calls this directly
no outgoing calls
no test coverage detected