projects
/
collection4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
share/collection.js: Keep visibility when redrawing graphs.
[collection4.git]
/
src
/
action_graph_def_json.c
diff --git
a/src/action_graph_def_json.c
b/src/action_graph_def_json.c
index
ea30ad9
..
2003d2f
100644
(file)
--- a/
src/action_graph_def_json.c
+++ b/
src/action_graph_def_json.c
@@
-32,7
+32,7
@@
#include "action_graph_def_json.h"
#include "common.h"
#include "graph.h"
#include "action_graph_def_json.h"
#include "common.h"
#include "graph.h"
-#include "graph_
def
.h"
+#include "graph_
instance
.h"
#include "graph_list.h"
#include "utils_cgi.h"
#include "graph_list.h"
#include "utils_cgi.h"
@@
-51,7
+51,7
@@
static void write_callback (__attribute__((unused)) void *ctx, /* {{{ */
int action_graph_def_json (void) /* {{{ */
{
graph_config_t *cfg;
int action_graph_def_json (void) /* {{{ */
{
graph_config_t *cfg;
- graph_
def_t *def
;
+ graph_
instance_t *inst
;
yajl_gen_config handler_config;
yajl_gen handler;
yajl_gen_config handler_config;
yajl_gen handler;
@@
-64,8
+64,8
@@
int action_graph_def_json (void) /* {{{ */
if (cfg == NULL)
return (ENOMEM);
if (cfg == NULL)
return (ENOMEM);
-
def = graph_get_defs
(cfg);
- if (
def
== NULL)
+
inst = inst_get_selected
(cfg);
+ if (
inst
== NULL)
return (EINVAL);
memset (&handler_config, 0, sizeof (handler_config));
return (EINVAL);
memset (&handler_config, 0, sizeof (handler_config));
@@
-77,10
+77,7
@@
int action_graph_def_json (void) /* {{{ */
/* alloc functions = */ NULL,
/* context = */ NULL);
if (handler == NULL)
/* alloc functions = */ NULL,
/* context = */ NULL);
if (handler == NULL)
- {
- graph_destroy (cfg);
return (-1);
return (-1);
- }
printf ("Content-Type: application/json\n");
printf ("Content-Type: application/json\n");
@@
-92,10
+89,8
@@
int action_graph_def_json (void) /* {{{ */
time_buffer);
printf ("\n");
time_buffer);
printf ("\n");
- status =
def_to_json (def
, handler);
+ status =
graph_def_to_json (cfg, inst
, handler);
- graph_destroy (cfg);
- def = NULL;
yajl_gen_free (handler);
return (status);
yajl_gen_free (handler);
return (status);