MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / cJSON_PrintPreallocated

Function cJSON_PrintPreallocated

libapp2sys/src/main/cpp/cjson/cJSON.c:1195–1212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1193}
1194
1195CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const int len, const cJSON_bool fmt)
1196{
1197 printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
1198
1199 if ((len < 0) || (buf == NULL))
1200 {
1201 return false;
1202 }
1203
1204 p.buffer = (unsigned char*)buf;
1205 p.length = (size_t)len;
1206 p.offset = 0;
1207 p.noalloc = true;
1208 p.format = fmt;
1209 p.hooks = global_hooks;
1210
1211 return print_value(item, &p);
1212}
1213
1214/* Parser core - when encountering text, process appropriately. */
1215static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer)

Callers

nothing calls this directly

Calls 1

print_valueFunction · 0.85

Tested by

no test coverage detected