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

Function get_object_item

external/cJSON/cJSON.c:1951–1981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1949}
1950
1951static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive)
1952{
1953 cJSON *current_element = NULL;
1954
1955 if ((object == NULL) || (name == NULL))
1956 {
1957 return NULL;
1958 }
1959
1960 current_element = object->child;
1961 if (case_sensitive)
1962 {
1963 while ((current_element != NULL) && (current_element->string != NULL) && (strcmp(name, current_element->string) != 0))
1964 {
1965 current_element = current_element->next;
1966 }
1967 }
1968 else
1969 {
1970 while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0))
1971 {
1972 current_element = current_element->next;
1973 }
1974 }
1975
1976 if ((current_element == NULL) || (current_element->string == NULL)) {
1977 return NULL;
1978 }
1979
1980 return current_element;
1981}
1982
1983CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string)
1984{

Callers 4

cJSON_GetObjectItemFunction · 0.85
replace_item_in_objectFunction · 0.85
cJSON_CompareFunction · 0.85

Calls 1

case_insensitive_strcmpFunction · 0.85

Tested by

no test coverage detected