]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/igen/filter.h
Initial creation of sourceware repository
[thirdparty/binutils-gdb.git] / sim / igen / filter.h
1 /* This file is part of the program psim.
2
3 Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (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
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 */
20
21
22 /* NB, an empty filter is NULL */
23 typedef struct _filter filter;
24
25
26 /* parse the list merging any flags into the filter */
27
28 extern void filter_parse
29 (filter **filters,
30 const char *filt);
31
32
33 /* add the second filter to the first */
34
35 extern void filter_add
36 (filter **filters,
37 filter *add);
38
39
40
41 /* returns true if SUB is a strict subset of SUPER. For an empty set
42 is a member of any set */
43
44 extern int filter_is_subset
45 (filter *superset,
46 filter *subset);
47
48
49 /* return true if there is at least one member common to the two
50 filters */
51
52 extern int filter_is_common
53 (filter *l,
54 filter *r);
55
56
57 /* returns the index (pos + 1) if the name is in the filter. */
58
59 extern int filter_is_member
60 (filter *set,
61 const char *flag);
62
63
64 /* returns true if one of the flags is not present in the filter.
65 === !filter_is_subset (filter_parse (NULL, flags), filters) */
66 int is_filtered_out
67 (filter *filters,
68 const char *flags);
69
70
71 /* returns the next member of the filter set that follows MEMBER.
72 Member does not need to be an elememt of the filter set. Next of
73 "" is the first non-empty member */
74 char *filter_next
75 (filter *set,
76 char *member);
77
78
79
80 /* for debugging */
81
82 extern void dump_filter
83 (lf *file,
84 char *prefix,
85 filter *filt,
86 char *suffix);