graph_list: Implement better iterator functions.
[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 int gl_graph_instance_get_all (graph_config_t *cfg,
29     gl_inst_callback callback, void *user_data);
30
31 int gl_instance_get_all (gl_inst_callback callback,
32     void *user_data);
33
34 int gl_instance_get_ident (graph_instance_t *inst,
35     char *buffer, size_t buffer_size);
36
37
38
39
40 struct graph_list_s
41 {
42   char *host;
43   char *plugin;
44   char *plugin_instance;
45   char *type;
46   char *type_instance;
47 };
48 typedef struct graph_list_s graph_list_t;
49
50 typedef int (*gl_callback) (
51     const graph_list_t *, void *user_data);
52
53 int gl_update (void);
54 int gl_foreach (gl_callback callback, void *user_data);
55
56 #endif /* GRAPH_LIST_H */
57 /* vim: set sw=2 sts=2 et fdm=marker : */