projects
/
collection4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c08cfbb
)
list_graphs_json action: Export the selector rather than a parameter string.
author
Florian Forster
<octo@verplant.org>
Thu, 22 Dec 2011 08:07:04 +0000
(09:07 +0100)
committer
Florian Forster
<octo@verplant.org>
Thu, 22 Dec 2011 08:07:21 +0000
(09:07 +0100)
src/action_list_graphs_json.c
patch
|
blob
|
history
diff --git
a/src/action_list_graphs_json.c
b/src/action_list_graphs_json.c
index
120e419
..
f8485ce
100644
(file)
--- a/
src/action_list_graphs_json.c
+++ b/
src/action_list_graphs_json.c
@@
-44,9
+44,9
@@
static void write_callback (__attribute__((unused)) void *ctx, /* {{{ */
static int print_one_graph (graph_config_t *cfg, /* {{{ */
void *user_data)
{
static int print_one_graph (graph_config_t *cfg, /* {{{ */
void *user_data)
{
- char params[1024];
char title[1024];
size_t num_instances;
char title[1024];
size_t num_instances;
+ graph_ident_t *selector;
yajl_gen handler = user_data;
yajl_gen handler = user_data;
@@
-54,14
+54,18
@@
static int print_one_graph (graph_config_t *cfg, /* {{{ */
if (num_instances < 1)
return (0);
if (num_instances < 1)
return (0);
+ selector = graph_get_selector (cfg);
+ if (selector == NULL)
+ {
+ /* TODO: Print error. */
+ return (0);
+ }
+
yajl_gen_map_open (handler);
memset (title, 0, sizeof (title));
graph_get_title (cfg, title, sizeof (title));
yajl_gen_map_open (handler);
memset (title, 0, sizeof (title));
graph_get_title (cfg, title, sizeof (title));
- memset (params, 0, sizeof (params));
- graph_get_params (cfg, params, sizeof (params));
-
yajl_gen_string (handler,
(unsigned char *) "title",
(unsigned int) strlen ("title"));
yajl_gen_string (handler,
(unsigned char *) "title",
(unsigned int) strlen ("title"));
@@
-70,11
+74,9
@@
static int print_one_graph (graph_config_t *cfg, /* {{{ */
(unsigned int) strlen (title));
yajl_gen_string (handler,
(unsigned int) strlen (title));
yajl_gen_string (handler,
- (unsigned char *) "params",
- (unsigned int) strlen ("params"));
- yajl_gen_string (handler,
- (unsigned char *) params,
- (unsigned int) strlen (params));
+ (unsigned char *) "selector",
+ (unsigned int) strlen ("selector"));
+ ident_to_json (selector, handler);
yajl_gen_string (handler,
(unsigned char *) "num_instances",
yajl_gen_string (handler,
(unsigned char *) "num_instances",
@@
-83,6
+85,8
@@
static int print_one_graph (graph_config_t *cfg, /* {{{ */
yajl_gen_map_close (handler);
yajl_gen_map_close (handler);
+ ident_destroy (selector);
+
return (0);
} /* }}} int print_one_graph */
return (0);
} /* }}} int print_one_graph */