| 1874 | } |
| 1875 | |
| 1876 | static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive) |
| 1877 | { |
| 1878 | cJSON *current_element = NULL; |
| 1879 | |
| 1880 | if ((object == NULL) || (name == NULL)) |
| 1881 | { |
| 1882 | return NULL; |
| 1883 | } |
| 1884 | |
| 1885 | current_element = object->child; |
| 1886 | if (case_sensitive) |
| 1887 | { |
| 1888 | while ((current_element != NULL) && (current_element->string != NULL) && (strcmp(name, current_element->string) != 0)) |
| 1889 | { |
| 1890 | current_element = current_element->next; |
| 1891 | } |
| 1892 | } |
| 1893 | else |
| 1894 | { |
| 1895 | while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0)) |
| 1896 | { |
| 1897 | current_element = current_element->next; |
| 1898 | } |
| 1899 | } |
| 1900 | |
| 1901 | if ((current_element == NULL) || (current_element->string == NULL)) { |
| 1902 | return NULL; |
| 1903 | } |
| 1904 | |
| 1905 | return current_element; |
| 1906 | } |
| 1907 | |
| 1908 | CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string) |
| 1909 | { |
no test coverage detected