src/dp_rrdtool.c: Adapt to new callback prototype.
[collection4.git] / src / graph_def.h
index b2cd228..ed9a24c 100644 (file)
@@ -1,16 +1,35 @@
+/**
+ * collection4 - graph_def.h
+ * Copyright (C) 2010  Florian octo Forster
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ *
+ * Authors:
+ *   Florian octo Forster <ff at octo.it>
+ **/
+
 #ifndef GRAPH_DEF_H
 #define GRAPH_DEF_H 1
 
-struct graph_def_s;
-typedef struct graph_def_s graph_def_t;
-
-typedef int (*def_callback_t) (graph_def_t *def,
-    void *user_data);
+#include <yajl/yajl_gen.h>
 
-#include "graph.h"
-#include "graph_ident.h"
+#include "graph_types.h"
 #include "utils_array.h"
 #include "oconfig.h"
+#include "rrd_args.h"
 
 graph_def_t *def_create (graph_config_t *cfg, graph_ident_t *ident,
     const char *ds_name);
@@ -29,7 +48,9 @@ _Bool def_matches (graph_def_t *def, graph_ident_t *ident);
 int def_foreach (graph_def_t *def, def_callback_t callback, void *user_data);
 
 int def_get_rrdargs (graph_def_t *def, graph_ident_t *ident,
-    str_array_t *args);
+    rrd_args_t *args);
+
+int def_to_json (const graph_def_t *def, yajl_gen handler);
 
 /* vim: set sw=2 sts=2 et fdm=marker : */
 #endif