src/action_show_graph_json.c: Fix memory corruption.
[collection4.git] / src / graph_list.h
1 /**
2  * collection4 - graph_list.h
3  * Copyright (C) 2010  Florian octo Forster
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  * 
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA  02110-1301  USA
19  *
20  * Authors:
21  *   Florian octo Forster <ff at octo.it>
22  **/
23
24 #ifndef GRAPH_LIST_H
25 #define GRAPH_LIST_H 1
26
27 #include "graph_types.h"
28 #include "graph_ident.h"
29 #include "utils_search.h"
30 #include "data_provider.h"
31
32 /*
33  * Functions
34  */
35 int gl_add_graph (graph_config_t *cfg);
36
37 int gl_config_submit (void);
38
39 int gl_register_data_provider (const char *name, data_provider_t *p);
40
41 /*
42  * Returns the currently "selected" graph config.
43  *
44  * This function evaluates the HTTP query parameters and searches for a
45  * matching graph config structure. If a matching graph config is found, it
46  * will return a pointer to the graph config. Do *not* free or call
47  * graph_destroy() on this pointer. If no graph is found or parameters are
48  * incomplete, NULL is returned.
49  */
50 graph_config_t *gl_graph_get_selected (void);
51
52 int gl_graph_get_all (_Bool include_dynamic,
53     graph_callback_t callback, void *user_data);
54
55 int gl_graph_instance_get_all (graph_config_t *cfg, graph_inst_callback_t callback,
56     void *user_data);
57
58 int gl_instance_get_all (graph_inst_callback_t callback, void *user_data);
59
60 int gl_search (search_info_t *si, graph_inst_callback_t callback,
61     void *user_data);
62
63 int gl_search_string (const char *search, graph_inst_callback_t callback,
64     void *user_data);
65
66 int gl_search_field (graph_ident_field_t field, const char *field_value,
67     graph_inst_callback_t callback, void *user_data);
68
69 int gl_foreach_host (int (*callback) (const char *host, void *user_data),
70     void *user_data);
71
72 int gl_update (_Bool request_served);
73
74 #endif /* GRAPH_LIST_H */
75 /* vim: set sw=2 sts=2 et fdm=marker : */