| 1303 | } |
| 1304 | |
| 1305 | CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format) |
| 1306 | { |
| 1307 | printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; |
| 1308 | |
| 1309 | if ((length < 0) || (buffer == NULL)) |
| 1310 | { |
| 1311 | return false; |
| 1312 | } |
| 1313 | |
| 1314 | p.buffer = (unsigned char*)buffer; |
| 1315 | p.length = (size_t)length; |
| 1316 | p.offset = 0; |
| 1317 | p.noalloc = true; |
| 1318 | p.format = format; |
| 1319 | p.hooks = global_hooks; |
| 1320 | |
| 1321 | return print_value(item, &p); |
| 1322 | } |
| 1323 | |
| 1324 | /* Parser core - when encountering text, process appropriately. */ |
| 1325 | static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) |
no test coverage detected