+static void json_indent(WRBUF result, int indent)
+{
+ size_t l = wrbuf_len(result);
+ if (l == 0 || wrbuf_buf(result)[l-1] == '\n')
+ {
+ int i;
+ for (i = 0; i < indent; i++)
+ wrbuf_putc(result, ' ');
+ }
+}
+
+static void json_write_wrbuf_r(struct json_node *node, WRBUF result, int indent)