- memset (title, 0, sizeof (title));
- graph_get_title (data.cfg, title, sizeof (title));
- json_escape_buffer (title, sizeof (title));
-
- printf ("{\n");
- printf (" \"title\": \"%s\",\n", title);
- printf (" \"selector\": %s,\n", ident_json);
- printf (" \"instances\":\n");
- printf (" [\n");
- graph_inst_foreach (data.cfg, show_instance_cb, &data);
- printf ("\n ]\n}\n");
-
- free (ident_json);
- ident_destroy (ident);
- return (0);
+ status = graph_to_json (cfg, handler);
+
+ graph_destroy (cfg);
+ yajl_gen_free (handler);
+
+ return (status);