+ printf (",\n%s", json);
+
+ *first = 0;
+
+ ident_destroy (ident);
+ return (0);
+} /* }}} int print_graph_inst_json */
+
+static int print_graph_json (graph_config_t *cfg, /* {{{ */
+ void *user_data)
+{
+ return (gl_graph_instance_get_all (cfg, print_graph_inst_json, user_data));
+} /* }}} int print_graph_json */
+
+static int list_graphs_json (void) /* {{{ */
+{
+ _Bool first = 1;
+
+ printf ("Content-Type: application/json\n\n");
+
+ printf ("[\n");
+ gl_graph_get_all (print_graph_json, /* user_data = */ &first);
+ printf ("\n]");
+
+ return (0);
+} /* }}} int list_graphs_json */
+
+struct callback_data_s
+{
+ graph_config_t *cfg;
+};
+typedef struct callback_data_s callback_data_t;
+
+static int print_graph_inst_html (graph_config_t *cfg, /* {{{ */
+ graph_instance_t *inst,
+ void *user_data)
+{
+ callback_data_t *data = user_data;
+ char params[1024];
+ char desc[1024];
+
+ if (data->cfg != cfg)
+ {
+ if (data->cfg != NULL)
+ printf (" </ul></li>\n");
+
+ memset (desc, 0, sizeof (desc));
+ graph_get_title (cfg, desc, sizeof (desc));
+
+ printf (" <li>%s\n <ul>\n", desc);