| 1206 | } |
| 1207 | |
| 1208 | CJSON_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. */ |
| 1228 | static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) |
nothing calls this directly
no test coverage detected