| 35 | } |
| 36 | |
| 37 | struct json_stream *new_json_stream(const tal_t *ctx, |
| 38 | struct command *writer, |
| 39 | struct log *log) |
| 40 | { |
| 41 | struct json_stream *js = tal(ctx, struct json_stream); |
| 42 | |
| 43 | /* FIXME: Add magic so tal_resize can fail! */ |
| 44 | js->jout = json_out_new(js); |
| 45 | json_out_call_on_move(js->jout, adjust_io_write, js); |
| 46 | js->writer = writer; |
| 47 | js->reader = NULL; |
| 48 | js->log = log; |
| 49 | return js; |
| 50 | } |
| 51 | |
| 52 | struct json_stream *json_stream_dup(const tal_t *ctx, |
| 53 | struct json_stream *original, |