From: Florian Forster Date: Tue, 4 Dec 2012 13:01:00 +0000 (+0100) Subject: graph_to_json: Export graph title. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=33e56e5052a805658254653ea7721bbd95a7fd51;p=collection4.git graph_to_json: Export graph title. --- diff --git a/src/graph.c b/src/graph.c index 713d45f..544a606 100644 --- a/src/graph.c +++ b/src/graph.c @@ -633,10 +633,19 @@ int graph_to_json (const graph_config_t *cfg, /* {{{ */ return (EINVAL); yajl_gen_map_open (handler); + + yajl_gen_string (handler, + (unsigned char *) "title", + (unsigned int) strlen ("title")); + yajl_gen_string (handler, + (unsigned char *) cfg->title, + (unsigned int) strlen (cfg->title)); + yajl_gen_string (handler, (unsigned char *) "select", (unsigned int) strlen ("select")); ident_to_json (cfg->select, handler); + yajl_gen_string (handler, (unsigned char *) "instances", (unsigned int) strlen ("instances")); @@ -644,6 +653,7 @@ int graph_to_json (const graph_config_t *cfg, /* {{{ */ for (i = 0; i < cfg->instances_num; i++) inst_to_json (cfg->instances[i], handler); yajl_gen_array_close (handler); + yajl_gen_map_close (handler); return (0);