Commit | Line | Data |
---|---|---|
ea5ca089 | 1 | /* Header file the type CGEN_BITSET. |
2571583a | 2 | Copyright (C) 2002-2017 Free Software Foundation, Inc. |
ea5ca089 | 3 | |
ac1e9eca | 4 | This file is part of the GNU opcodes library. |
ea5ca089 | 5 | |
ac1e9eca DE |
6 | This library is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 3, or (at your option) | |
9 | any later version. | |
ea5ca089 | 10 | |
ac1e9eca DE |
11 | It is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
ea5ca089 | 15 | |
ac1e9eca DE |
16 | You should have received a copy of the GNU General Public License |
17 | along with this library; see the file COPYING3. If not, write to the | |
18 | Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA | |
19 | 02110-1301, USA. */ | |
ea5ca089 | 20 | |
ea5ca089 DB |
21 | #ifndef CGEN_BITSET_H |
22 | #define CGEN_BITSET_H | |
23 | ||
24 | #ifdef __cplusplus | |
25 | extern "C" { | |
26 | #endif | |
27 | ||
28 | /* A bitmask represented as a string. | |
29 | Each member of the set is represented as a bit | |
30 | in the string. Bytes are indexed from left to right in the string and | |
31 | bits from most significant to least within each byte. | |
32 | ||
33 | For example, the bit representing member number 6 is (set->bits[0] & 0x02). | |
34 | */ | |
35 | typedef struct cgen_bitset | |
36 | { | |
37 | unsigned length; | |
38 | char *bits; | |
39 | } CGEN_BITSET; | |
40 | ||
1f635d20 TT |
41 | extern CGEN_BITSET *cgen_bitset_create (unsigned); |
42 | extern void cgen_bitset_init (CGEN_BITSET *, unsigned); | |
43 | extern void cgen_bitset_clear (CGEN_BITSET *); | |
44 | extern void cgen_bitset_add (CGEN_BITSET *, unsigned); | |
45 | extern void cgen_bitset_set (CGEN_BITSET *, unsigned); | |
46 | extern int cgen_bitset_compare (CGEN_BITSET *, CGEN_BITSET *); | |
47 | extern void cgen_bitset_union (CGEN_BITSET *, CGEN_BITSET *, CGEN_BITSET *); | |
48 | extern int cgen_bitset_intersect_p (CGEN_BITSET *, CGEN_BITSET *); | |
49 | extern int cgen_bitset_contains (CGEN_BITSET *, unsigned); | |
50 | extern CGEN_BITSET *cgen_bitset_copy (CGEN_BITSET *); | |
ea5ca089 DB |
51 | |
52 | #ifdef __cplusplus | |
53 | } // extern "C" | |
54 | #endif | |
55 | ||
56 | #endif |