MCPcopy Create free account
hub / github.com/ByConity/ByConity / cJSON_PrintPreallocated

Function cJSON_PrintPreallocated

contrib/cJSON/cJSON.cpp:1208–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1206}
1207
1208CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const int len, const cJSON_bool fmt)
1209{
1210 printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
1211
1212 if ((len < 0) || (buf == NULL))
1213 {
1214 return false;
1215 }
1216
1217 p.buffer = (unsigned char*)buf;
1218 p.length = (size_t)len;
1219 p.offset = 0;
1220 p.noalloc = true;
1221 p.format = fmt;
1222 p.hooks = global_hooks;
1223
1224 return print_value(item, &p);
1225}
1226
1227/* Parser core - when encountering text, process appropriately. */
1228static 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