projects
/
collection4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ac3d2a
)
list_hosts_json action: Create an object for each host.
author
Florian Forster
<octo@verplant.org>
Thu, 22 Dec 2011 08:06:20 +0000
(09:06 +0100)
committer
Florian Forster
<octo@verplant.org>
Thu, 22 Dec 2011 08:06:23 +0000
(09:06 +0100)
This should simplify future extensions.
src/action_list_hosts_json.c
patch
|
blob
|
history
diff --git
a/src/action_list_hosts_json.c
b/src/action_list_hosts_json.c
index
029b700
..
419d44c
100644
(file)
--- a/
src/action_list_hosts_json.c
+++ b/
src/action_list_hosts_json.c
@@
-46,10
+46,17
@@
static int print_one_host (const char *host, /* {{{ */
{
yajl_gen handler = user_data;
+ yajl_gen_map_open (handler);
+
+ yajl_gen_string (handler,
+ (unsigned char *) "host",
+ (unsigned int) strlen ("host"));
yajl_gen_string (handler,
(unsigned char *) host,
(unsigned int) strlen (host));
+ yajl_gen_map_close (handler);
+
return (0);
} /* }}} int print_one_host */
@@
-64,8
+71,6
@@
static int print_all_hosts (yajl_gen handler) /* {{{ */
int action_list_hosts_json (void) /* {{{ */
{
- graph_config_t *cfg;
-
yajl_gen_config handler_config;
yajl_gen handler;