Various modules: Use the new "rrd_args_t" structure.
[collection4.git] / src / graph_instance.h
index f0425d2..61d5ea4 100644 (file)
@@ -4,6 +4,8 @@
 #include <time.h>
 
 #include "graph_types.h"
+#include "graph_ident.h"
+#include "rrd_args.h"
 #include "utils_array.h"
 
 /*
@@ -18,21 +20,38 @@ 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_all_selected (graph_config_t *cfg,
+    graph_inst_callback_t callback, void *user_data);
+
 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);
+    rrd_args_t *args);
 
 graph_ident_t *inst_get_selector (graph_instance_t *inst);
 
 int inst_compare_ident (graph_instance_t *inst, const graph_ident_t *ident);
 
-_Bool inst_matches_ident (graph_instance_t *inst, const graph_ident_t *ident);
+/* Returns true if "ident" matches the instance's selector. */
+_Bool inst_ident_matches (graph_instance_t *inst, const graph_ident_t *ident);
+
+/* Returns true if the instance's selector matches the (more general)
+ * "selector" ident. */
+_Bool inst_matches_ident (graph_instance_t *inst,
+    const graph_ident_t *selector);
 
 _Bool inst_matches_string (graph_config_t *cfg, graph_instance_t *inst,
     const char *term);
 
+/* Compares the given string with the appropriate field of the selector or, if
+ * the selector field is "/all/", iterates over all the files of the instance
+ * and checks the appropriate field. Returns true if the field of the selector
+ * or of one of the files matches. The string must match entirely but
+ * comparison is done case-insensitive. */
+_Bool inst_matches_field (graph_instance_t *inst,
+    graph_ident_field_t field, const char *field_value);
+
 int inst_describe (graph_config_t *cfg, graph_instance_t *inst,
     char *buffer, size_t buffer_size);