+struct json_node *json_parse(const char *json_str, const char **errmsg)
+{
+ return json_parse2(json_str, errmsg, 0);
+}
+
+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)