graph_list.[ch]: Implement "{graph,inst}_get_selected".
[collection4.git] / graph_list.h
1 #ifndef GRAPH_LIST_H
2 #define GRAPH_LIST_H 1
3
4 struct graph_ident_s;
5 typedef struct graph_ident_s graph_ident_t;
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_instance_get_all (graph_config_t *cfg,
31     gl_inst_callback callback, void *user_data);
32
33 graph_instance_t *inst_get_selected (graph_config_t *cfg);
34
35 int gl_instance_get_all (gl_inst_callback callback,
36     void *user_data);
37
38 int gl_instance_get_params (graph_config_t *cfg, graph_instance_t *inst,
39     char *buffer, size_t buffer_size);
40
41 int gl_graph_get_title (graph_config_t *cfg,
42     char *buffer, size_t buffer_size);
43
44
45 struct graph_list_s
46 {
47   char *host;
48   char *plugin;
49   char *plugin_instance;
50   char *type;
51   char *type_instance;
52 };
53 typedef struct graph_list_s graph_list_t;
54
55 typedef int (*gl_callback) (
56     const graph_list_t *, void *user_data);
57
58 int gl_update (void);
59 int gl_foreach (gl_callback callback, void *user_data);
60
61 #endif /* GRAPH_LIST_H */
62 /* vim: set sw=2 sts=2 et fdm=marker : */