graph_instance.[ch]: Move the graph_instance_t code into an own module.
[collection4.git] / graph_instance.h
diff --git a/graph_instance.h b/graph_instance.h
new file mode 100644 (file)
index 0000000..f167d23
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef GRAPH_INSTANCE_H
+#define GRAPH_INSTANCE_H 1
+
+/*
+ * Data types
+ */
+struct graph_instance_s;
+typedef struct graph_instance_s graph_instance_t;
+
+typedef int (*inst_callback) (graph_instance_t *inst, void *user_data);
+
+#include "graph_list.h"
+
+/*
+ * Callback types
+ */
+/*
+ * Methods
+ */
+graph_instance_t *inst_create (graph_config_t *cfg,
+               const graph_ident_t *ident);
+
+void inst_destroy (graph_instance_t *inst);
+
+int inst_add_file (graph_instance_t *inst, const graph_ident_t *file);
+
+graph_instance_t *inst_get_selected (graph_config_t *cfg);
+
+int inst_get_params (graph_config_t *cfg, graph_instance_t *inst,
+    char *buffer, size_t buffer_size);
+
+int inst_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,
+    str_array_t *args);
+
+graph_ident_t *inst_get_selector (graph_instance_t *inst);
+
+int inst_append (graph_instance_t *head, graph_instance_t *inst);
+
+int inst_foreach (graph_instance_t *inst,
+               inst_callback cb, void *user_data);
+
+graph_instance_t *inst_find_matching (graph_instance_t *inst,
+    const graph_ident_t *ident);
+
+#endif /* GRAPH_INSTANCE_H */
+/* vim: set sw=2 sts=2 et fdm=marker : */