| 1341 | } |
| 1342 | |
| 1343 | CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format) |
| 1344 | { |
| 1345 | printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; |
| 1346 | |
| 1347 | if ((length < 0) || (buffer == NULL)) |
| 1348 | { |
| 1349 | return false; |
| 1350 | } |
| 1351 | |
| 1352 | p.buffer = (unsigned char*)buffer; |
| 1353 | p.length = (size_t)length; |
| 1354 | p.offset = 0; |
| 1355 | p.noalloc = true; |
| 1356 | p.format = format; |
| 1357 | p.hooks = global_hooks; |
| 1358 | |
| 1359 | return print_value(item, &p); |
| 1360 | } |
| 1361 | |
| 1362 | /* Parser core - when encountering text, process appropriately. */ |
| 1363 | static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) |
searching dependent graphs…