X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Faction_graph_def_json.c;h=1ba067892459b7d231a0c7cd872bfa64e44676d0;hb=e0b8e6b3289ee56fba4dbee099f8fd25d5028639;hp=ea30ad9a38a025ef441220627cd52566a8206479;hpb=f3fc23c1262970dab2779d2a6e5dbc1cc5e89def;p=collection4.git diff --git a/src/action_graph_def_json.c b/src/action_graph_def_json.c index ea30ad9..1ba0678 100644 --- a/src/action_graph_def_json.c +++ b/src/action_graph_def_json.c @@ -32,7 +32,6 @@ #include "action_graph_def_json.h" #include "common.h" #include "graph.h" -#include "graph_def.h" #include "graph_list.h" #include "utils_cgi.h" @@ -51,7 +50,6 @@ static void write_callback (__attribute__((unused)) void *ctx, /* {{{ */ int action_graph_def_json (void) /* {{{ */ { graph_config_t *cfg; - graph_def_t *def; yajl_gen_config handler_config; yajl_gen handler; @@ -64,10 +62,6 @@ int action_graph_def_json (void) /* {{{ */ if (cfg == NULL) return (ENOMEM); - def = graph_get_defs (cfg); - if (def == NULL) - return (EINVAL); - memset (&handler_config, 0, sizeof (handler_config)); handler_config.beautify = 1; handler_config.indentString = " "; @@ -77,10 +71,7 @@ int action_graph_def_json (void) /* {{{ */ /* alloc functions = */ NULL, /* context = */ NULL); if (handler == NULL) - { - graph_destroy (cfg); return (-1); - } printf ("Content-Type: application/json\n"); @@ -92,10 +83,8 @@ int action_graph_def_json (void) /* {{{ */ time_buffer); printf ("\n"); - status = def_to_json (def, handler); + status = graph_def_to_json (cfg, handler); - graph_destroy (cfg); - def = NULL; yajl_gen_free (handler); return (status);