MCPcopy Index your code
hub / github.com/antirez/botlib / cJSON_PrintPreallocated

Function cJSON_PrintPreallocated

cJSON.c:1288–1305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1286}
1287
1288CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format)
1289{
1290 printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
1291
1292 if ((length < 0) || (buffer == NULL))
1293 {
1294 return false;
1295 }
1296
1297 p.buffer = (unsigned char*)buffer;
1298 p.length = (size_t)length;
1299 p.offset = 0;
1300 p.noalloc = true;
1301 p.format = format;
1302 p.hooks = global_hooks;
1303
1304 return print_value(item, &p);
1305}
1306
1307/* Parser core - when encountering text, process appropriately. */
1308static 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