MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / cJSON_GetArraySize

Function cJSON_GetArraySize

external/cJSON/cJSON.c:1899–1920  ·  view source on GitHub ↗

Get Array size/item / object item. */

Source from the content-addressed store, hash-verified

1897
1898/* Get Array size/item / object item. */
1899CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array)
1900{
1901 cJSON *child = NULL;
1902 size_t size = 0;
1903
1904 if (array == NULL)
1905 {
1906 return 0;
1907 }
1908
1909 child = array->child;
1910
1911 while(child != NULL)
1912 {
1913 size++;
1914 child = child->next;
1915 }
1916
1917 /* FIXME: Can overflow here. Cannot be fixed without breaking the API */
1918
1919 return (int)size;
1920}
1921
1922static cJSON* get_array_item(const cJSON *array, size_t index)
1923{

Callers 1

convert_cjsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected