Utility for handling references. */
| 1844 | |
| 1845 | /* Utility for handling references. */ |
| 1846 | static cJSON *create_reference(const cJSON *item) |
| 1847 | { |
| 1848 | cJSON *ref = cJSON_New_Item(); |
| 1849 | if (!ref) |
| 1850 | { |
| 1851 | return NULL; |
| 1852 | } |
| 1853 | memcpy(ref, item, sizeof(cJSON)); |
| 1854 | ref->string = NULL; |
| 1855 | ref->type |= cJSON_IsReference; |
| 1856 | ref->next = ref->prev = NULL; |
| 1857 | return ref; |
| 1858 | } |
| 1859 | |
| 1860 | /* Add item to array/object. */ |
| 1861 | void cJSON_AddItemToArray(cJSON *array, cJSON *item) |
no test coverage detected