MCPcopy Create free account
hub / github.com/DaveGamble/cJSON / reset

Function reset

tests/common.h:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28void reset(cJSON *item);
29void reset(cJSON *item) {
30 if ((item != NULL) && (item->child != NULL))
31 {
32 cJSON_Delete(item->child);
33 }
34 if ((item->valuestring != NULL) && !(item->type & cJSON_IsReference))
35 {
36 global_hooks.deallocate(item->valuestring);
37 }
38 if ((item->string != NULL) && !(item->type & cJSON_StringIsConst))
39 {
40 global_hooks.deallocate(item->string);
41 }
42
43 memset(item, 0, sizeof(cJSON));
44}
45
46char* read_file(const char *filename);
47char* read_file(const char *filename) {

Calls 1

cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…