Various modules: Use the new "rrd_args_t" structure.
[collection4.git] / src / graph_instance.h
1 #ifndef GRAPH_INSTANCE_H
2 #define GRAPH_INSTANCE_H 1
3
4 #include <time.h>
5
6 #include "graph_types.h"
7 #include "graph_ident.h"
8 #include "rrd_args.h"
9 #include "utils_array.h"
10
11 /*
12  * Methods
13  */
14 graph_instance_t *inst_create (graph_config_t *cfg,
15                 const graph_ident_t *ident);
16
17 void inst_destroy (graph_instance_t *inst);
18
19 int inst_add_file (graph_instance_t *inst, const graph_ident_t *file);
20
21 graph_instance_t *inst_get_selected (graph_config_t *cfg);
22
23 int inst_get_all_selected (graph_config_t *cfg,
24     graph_inst_callback_t callback, void *user_data);
25
26 int inst_get_params (graph_config_t *cfg, graph_instance_t *inst,
27     char *buffer, size_t buffer_size);
28
29 int inst_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,
30     rrd_args_t *args);
31
32 graph_ident_t *inst_get_selector (graph_instance_t *inst);
33
34 int inst_compare_ident (graph_instance_t *inst, const graph_ident_t *ident);
35
36 /* Returns true if "ident" matches the instance's selector. */
37 _Bool inst_ident_matches (graph_instance_t *inst, const graph_ident_t *ident);
38
39 /* Returns true if the instance's selector matches the (more general)
40  * "selector" ident. */
41 _Bool inst_matches_ident (graph_instance_t *inst,
42     const graph_ident_t *selector);
43
44 _Bool inst_matches_string (graph_config_t *cfg, graph_instance_t *inst,
45     const char *term);
46
47 /* Compares the given string with the appropriate field of the selector or, if
48  * the selector field is "/all/", iterates over all the files of the instance
49  * and checks the appropriate field. Returns true if the field of the selector
50  * or of one of the files matches. The string must match entirely but
51  * comparison is done case-insensitive. */
52 _Bool inst_matches_field (graph_instance_t *inst,
53     graph_ident_field_t field, const char *field_value);
54
55 int inst_describe (graph_config_t *cfg, graph_instance_t *inst,
56     char *buffer, size_t buffer_size);
57
58 time_t inst_get_mtime (graph_instance_t *inst);
59
60 #endif /* GRAPH_INSTANCE_H */
61 /* vim: set sw=2 sts=2 et fdm=marker : */