share/collection.js: Keep visibility when redrawing graphs.
[collection4.git] / src / utils_search.h
1 /**
2  * collection4 - utils_search.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 UTILS_SEARCH_H
25 #define UTILS_SEARCH_H 1
26
27 #include "graph_types.h"
28
29 struct search_info_s;
30 typedef struct search_info_s search_info_t;
31
32 search_info_t *search_parse (const char *search);
33 void search_destroy (search_info_t *si);
34
35 /* Returns true if at least one of the ident fields is defined (not a
36  * wildcard), false otherwise. If no field has been specified, searching is a
37  * lot easier. */
38 _Bool search_has_selector (search_info_t *si);
39
40 graph_ident_t *search_to_ident (search_info_t *si);
41 search_info_t *search_from_ident (const graph_ident_t *ident);
42
43 _Bool search_graph_title_matches (search_info_t *si, const char *title);
44
45 _Bool search_graph_inst_matches (search_info_t *si,
46     graph_config_t *cfg, graph_instance_t *inst,
47     const char *title);
48
49 #endif /* UTILS_SEARCH_H */
50 /* vim: set sw=2 sts=2 et fdm=marker : */
51