+ if ((inst == NULL) || (handler == NULL))
+ return (EINVAL);
+
+ /* TODO: error handling */
+ yajl_gen_map_open (handler);
+ yajl_gen_string (handler,
+ (unsigned char *) "select",
+ (unsigned int) strlen ("select"));
+ ident_to_json (inst->select, handler);
+ yajl_gen_string (handler,
+ (unsigned char *) "files",
+ (unsigned int) strlen ("files"));
+ yajl_gen_array_open (handler);
+ for (i = 0; i < inst->files_num; i++)
+ ident_to_json (inst->files[i], handler);
+ yajl_gen_array_close (handler);
+ yajl_gen_map_close (handler);
+
+ return (0);
+} /* }}} int inst_to_json */
+
+int inst_data_to_json (const graph_instance_t *inst, /* {{{ */
+ dp_time_t begin, dp_time_t end,
+ yajl_gen handler)
+{
+ size_t i;