1252330Sjeff/* Header file the type CGEN_BITSET.
2252330Sjeff
3252330SjeffCopyright 2002, 2005 Free Software Foundation, Inc.
4252330Sjeff
5252330SjeffThis file is part of GDB, the GNU debugger, and the GNU Binutils.
6252330Sjeff
7252330SjeffThis program is free software; you can redistribute it and/or modify
8252330Sjeffit under the terms of the GNU General Public License as published by
9252330Sjeffthe Free Software Foundation; either version 2 of the License, or
10252330Sjeff(at your option) any later version.
11252330Sjeff
12252330SjeffThis program is distributed in the hope that it will be useful,
13252330Sjeffbut WITHOUT ANY WARRANTY; without even the implied warranty of
14252330SjeffMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15252330SjeffGNU General Public License for more details.
16252330Sjeff
17252330SjeffYou should have received a copy of the GNU General Public License along
18252330Sjeffwith this program; if not, write to the Free Software Foundation, Inc.,
19252330Sjeff59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20252330Sjeff#ifndef CGEN_BITSET_H
21252330Sjeff#define CGEN_BITSET_H
22252330Sjeff
23252330Sjeff#ifdef __cplusplus
24252330Sjeffextern "C" {
25252330Sjeff#endif
26252330Sjeff
27252330Sjeff/* A bitmask represented as a string.
28252330Sjeff   Each member of the set is represented as a bit
29252330Sjeff   in the string. Bytes are indexed from left to right in the string and
30252330Sjeff   bits from most significant to least within each byte.
31252330Sjeff
32252330Sjeff   For example, the bit representing member number 6 is (set->bits[0] & 0x02).
33252330Sjeff*/
34252330Sjefftypedef struct cgen_bitset
35252330Sjeff{
36252330Sjeff  unsigned length;
37252330Sjeff  char *bits;
38252330Sjeff} CGEN_BITSET;
39252330Sjeff
40252330Sjeffextern CGEN_BITSET *cgen_bitset_create PARAMS ((unsigned));
41252330Sjeffextern void cgen_bitset_init PARAMS ((CGEN_BITSET *, unsigned));
42252330Sjeffextern void cgen_bitset_clear PARAMS ((CGEN_BITSET *));
43252330Sjeffextern void cgen_bitset_add PARAMS ((CGEN_BITSET *, unsigned));
44252330Sjeffextern void cgen_bitset_set PARAMS ((CGEN_BITSET *, unsigned));
45252330Sjeffextern int cgen_bitset_compare PARAMS ((CGEN_BITSET *, CGEN_BITSET *));
46252330Sjeffextern void cgen_bitset_union PARAMS ((CGEN_BITSET *, CGEN_BITSET *, CGEN_BITSET *));
47252330Sjeffextern int cgen_bitset_intersect_p PARAMS ((CGEN_BITSET *, CGEN_BITSET *));
48252330Sjeffextern int cgen_bitset_contains PARAMS ((CGEN_BITSET *, unsigned));
49252330Sjeffextern CGEN_BITSET *cgen_bitset_copy PARAMS ((CGEN_BITSET *));
50252330Sjeff
51252330Sjeff#ifdef __cplusplus
52252330Sjeff} // extern "C"
53252330Sjeff#endif
54252330Sjeff
55252330Sjeff#endif
56252330Sjeff