Code

First working version of the configurable graphlist stuff.
[collection4.git] / graph_list.h
1 #ifndef GRAPH_LIST_H
2 #define GRAPH_LIST_H 1
4 #include "utils_array.h"
6 struct graph_ident_s;
7 typedef struct graph_ident_s graph_ident_t;
9 struct graph_instance_s;
10 typedef struct graph_instance_s graph_instance_t;
12 struct graph_config_s;
13 typedef struct graph_config_s graph_config_t;
15 /*
16  * Callback types
17  */
18 typedef int (*gl_cfg_callback) (graph_config_t *cfg,
19     void *user_data);
21 typedef int (*gl_inst_callback) (graph_config_t *cfg,
22     graph_instance_t *inst, void *user_data);
24 /*
25  * Functions
26  */
27 char *ident_to_file (const graph_ident_t *ident);
29 int gl_graph_get_all (gl_cfg_callback callback,
30     void *user_data);
32 graph_config_t *graph_get_selected (void);
34 int gl_graph_get_title (graph_config_t *cfg,
35     char *buffer, size_t buffer_size);
37 int gl_graph_instance_get_all (graph_config_t *cfg,
38     gl_inst_callback callback, void *user_data);
40 graph_instance_t *inst_get_selected (graph_config_t *cfg);
42 int gl_instance_get_all (gl_inst_callback callback,
43     void *user_data);
45 int gl_instance_get_params (graph_config_t *cfg, graph_instance_t *inst,
46     char *buffer, size_t buffer_size);
48 int gl_instance_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,
49     str_array_t *args);
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;
61 typedef int (*gl_callback) (
62     const graph_list_t *, void *user_data);
64 int gl_update (void);
65 int gl_foreach (gl_callback callback, void *user_data);
67 #endif /* GRAPH_LIST_H */
68 /* vim: set sw=2 sts=2 et fdm=marker : */