| 311 | } |
| 312 | |
| 313 | struct json_out *json_out_obj(const tal_t *ctx, |
| 314 | const char *fieldname, |
| 315 | const char *str) |
| 316 | { |
| 317 | struct json_out *jout = json_out_new(ctx); |
| 318 | json_out_start(jout, NULL, '{'); |
| 319 | if (str) |
| 320 | json_out_addstr(jout, fieldname, str); |
| 321 | json_out_end(jout, '}'); |
| 322 | json_out_finished(jout); |
| 323 | |
| 324 | return jout; |
| 325 | } |
| 326 | |
| 327 | /* Realloc helper for tal membufs */ |
| 328 | static void *membuf_tal_realloc(struct membuf *mb, void *rawelems, |