Various modules: Use the new "rrd_args_t" structure.
[collection4.git] / src / graph.h
1 #ifndef GRAPH_H
2 #define GRAPH_H 1
3
4 #include "graph_types.h"
5 #include "graph_ident.h"
6 #include "oconfig.h"
7 #include "rrd_args.h"
8 #include "utils_array.h"
9
10 /*
11  * Functions
12  */
13 graph_config_t *graph_create (const graph_ident_t *selector);
14
15 void graph_destroy (graph_config_t *graph);
16
17 int graph_config_add (const oconfig_item_t *ci);
18
19 int graph_add_file (graph_config_t *cfg, const graph_ident_t *file);
20
21 int graph_get_title (graph_config_t *cfg,
22     char *buffer, size_t buffer_size);
23
24 int graph_get_params (graph_config_t *cfg, char *buffer, size_t buffer_size);
25
26 graph_ident_t *graph_get_selector (graph_config_t *cfg);
27
28 graph_def_t *graph_get_defs (graph_config_t *cfg);
29
30 int graph_add_def (graph_config_t *cfg, graph_def_t *def);
31
32 _Bool graph_matches_ident (graph_config_t *cfg, const graph_ident_t *ident);
33
34 /* Compares the given string with the appropriate field of the selector. If the
35  * selector field is "/all/" or "/any/", returns true without checking the
36  * instances. See "graph_inst_search_field" for finding all matching instances.
37  * */
38 _Bool graph_matches_field (graph_config_t *cfg,
39     graph_ident_field_t field, const char *field_value);
40
41 int graph_inst_foreach (graph_config_t *cfg,
42     inst_callback_t cb, void *user_data);
43
44 graph_instance_t *graph_inst_find_exact (graph_config_t *cfg,
45     graph_ident_t *ident);
46
47 graph_instance_t *graph_inst_find_matching (graph_config_t *cfg,
48     const graph_ident_t *ident);
49
50 int graph_inst_find_all_matching (graph_config_t *cfg,
51     const graph_ident_t *ident,
52     graph_inst_callback_t callback, void *user_data);
53
54 int graph_inst_search (graph_config_t *cfg, const char *term,
55     graph_inst_callback_t callback, void *user_data);
56
57 /* Iterates over all instances and calls "inst_matches_field". If that method
58  * returns true, calls the callback with the graph and instance pointers. */
59 int graph_inst_search_field (graph_config_t *cfg,
60     graph_ident_field_t field, const char *field_value,
61     graph_inst_callback_t callback, void *user_data);
62
63 int graph_compare (graph_config_t *cfg, const graph_ident_t *ident);
64
65 int graph_clear_instances (graph_config_t *cfg);
66
67 int graph_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,
68     rrd_args_t *args);
69
70 #endif /* GRAPH_H */
71 /* vim: set sw=2 sts=2 et fdm=marker : */