graph_list.[ch]: Implement "gl_graph_get_selector".
[collection4.git] / graph_list.h
1 #ifndef GRAPH_LIST_H
2 #define GRAPH_LIST_H 1
3
4 #include "utils_array.h"
5 #include "graph_ident.h"
6
7 struct graph_instance_s;
8 typedef struct graph_instance_s graph_instance_t;
9
10 struct graph_config_s;
11 typedef struct graph_config_s graph_config_t;
12
13 /*
14  * Callback types
15  */
16 typedef int (*gl_cfg_callback) (graph_config_t *cfg,
17     void *user_data);
18
19 typedef int (*gl_inst_callback) (graph_config_t *cfg,
20     graph_instance_t *inst, void *user_data);
21
22 /*
23  * Functions
24  */
25 int gl_graph_get_all (gl_cfg_callback callback,
26     void *user_data);
27
28 graph_config_t *graph_get_selected (void);
29
30 int gl_graph_get_title (graph_config_t *cfg,
31     char *buffer, size_t buffer_size);
32
33 graph_ident_t *gl_graph_get_selector (graph_config_t *cfg);
34
35 int gl_graph_instance_get_all (graph_config_t *cfg,
36     gl_inst_callback callback, void *user_data);
37
38 graph_instance_t *inst_get_selected (graph_config_t *cfg);
39
40 int gl_instance_get_all (gl_inst_callback callback,
41     void *user_data);
42
43 int gl_instance_get_params (graph_config_t *cfg, graph_instance_t *inst,
44     char *buffer, size_t buffer_size);
45
46 int gl_instance_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,
47     str_array_t *args);
48
49 graph_ident_t *gl_instance_get_selector (graph_instance_t *inst);
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
66 #endif /* GRAPH_LIST_H */
67 /* vim: set sw=2 sts=2 et fdm=marker : */