First working version of the configurable graphlist stuff.
[collection4.git] / graph_list.h
1 #ifndef GRAPH_LIST_H
2 #define GRAPH_LIST_H 1
3
4 #include "utils_array.h"
5
6 struct graph_ident_s;
7 typedef struct graph_ident_s graph_ident_t;
8
9 struct graph_instance_s;
10 typedef struct graph_instance_s graph_instance_t;
11
12 struct graph_config_s;
13 typedef struct graph_config_s graph_config_t;
14
15 /*
16  * Callback types
17  */
18 typedef int (*gl_cfg_callback) (graph_config_t *cfg,
19     void *user_data);
20
21 typedef int (*gl_inst_callback) (graph_config_t *cfg,
22     graph_instance_t *inst, void *user_data);
23
24 /*
25  * Functions
26  */
27 char *ident_to_file (const graph_ident_t *ident);
28
29 int gl_graph_get_all (gl_cfg_callback callback,
30     void *user_data);
31
32 graph_config_t *graph_get_selected (void);
33
34 int gl_graph_get_title (graph_config_t *cfg,
35     char *buffer, size_t buffer_size);
36
37 int gl_graph_instance_get_all (graph_config_t *cfg,
38     gl_inst_callback callback, void *user_data);
39
40 graph_instance_t *inst_get_selected (graph_config_t *cfg);
41
42 int gl_instance_get_all (gl_inst_callback callback,
43     void *user_data);
44
45 int gl_instance_get_params (graph_config_t *cfg, graph_instance_t *inst,
46     char *buffer, size_t buffer_size);
47
48 int gl_instance_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,
49     str_array_t *args);
50
51 struct graph_list_s
52 {
53   char *host;
54   char *plugin;
55   char *plugin_instance;
56   char *type;
57   char *type_instance;
58 };
59 typedef struct graph_list_s graph_list_t;
60
61 typedef int (*gl_callback) (
62     const graph_list_t *, void *user_data);
63
64 int gl_update (void);
65 int gl_foreach (gl_callback callback, void *user_data);
66
67 #endif /* GRAPH_LIST_H */
68 /* vim: set sw=2 sts=2 et fdm=marker : */