| 25 | } |
| 26 | |
| 27 | struct json_stream *new_json_stream(const tal_t *ctx, |
| 28 | struct command *writer, |
| 29 | struct logger *log) |
| 30 | { |
| 31 | struct json_stream *js = tal(ctx, struct json_stream); |
| 32 | |
| 33 | /* FIXME: Add magic so tal_resize can fail! */ |
| 34 | js->jout = json_out_new(js); |
| 35 | json_out_call_on_move(js->jout, adjust_io_write, js); |
| 36 | js->writer = writer; |
| 37 | js->reader = NULL; |
| 38 | js->log = log; |
| 39 | js->filter = NULL; |
| 40 | return js; |
| 41 | } |
| 42 | |
| 43 | void json_stream_attach_filter(struct json_stream *js, |
| 44 | struct json_filter *filter STEALS) |