f167d23480f4a715ca2c3596c2f52da31b256566
[collection4.git] / graph_instance.h
1 #ifndef GRAPH_INSTANCE_H
2 #define GRAPH_INSTANCE_H 1
3
4 /*
5  * Data types
6  */
7 struct graph_instance_s;
8 typedef struct graph_instance_s graph_instance_t;
9
10 typedef int (*inst_callback) (graph_instance_t *inst, void *user_data);
11
12 #include "graph_list.h"
13
14 /*
15  * Callback types
16  */
17 /*
18  * Methods
19  */
20 graph_instance_t *inst_create (graph_config_t *cfg,
21                 const graph_ident_t *ident);
22
23 void inst_destroy (graph_instance_t *inst);
24
25 int inst_add_file (graph_instance_t *inst, const graph_ident_t *file);
26
27 graph_instance_t *inst_get_selected (graph_config_t *cfg);
28
29 int inst_get_params (graph_config_t *cfg, graph_instance_t *inst,
30     char *buffer, size_t buffer_size);
31
32 int inst_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,
33     str_array_t *args);
34
35 graph_ident_t *inst_get_selector (graph_instance_t *inst);
36
37 int inst_append (graph_instance_t *head, graph_instance_t *inst);
38
39 int inst_foreach (graph_instance_t *inst,
40                 inst_callback cb, void *user_data);
41
42 graph_instance_t *inst_find_matching (graph_instance_t *inst,
43     const graph_ident_t *ident);
44
45 #endif /* GRAPH_INSTANCE_H */
46 /* vim: set sw=2 sts=2 et fdm=marker : */