MCPcopy Create free account
hub / github.com/OpenIPC/firmware / cJSON_PrintPreallocated

Function cJSON_PrintPreallocated

general/package/xmdp/src/cjson/cJSON.c:1286–1303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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