xref: /openbsd-src/gnu/usr.bin/binutils-2.17/include/opcode/cgen-bitset.h (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiod /* Header file the type CGEN_BITSET.
2*3d8817e4Smiod 
3*3d8817e4Smiod Copyright 2002, 2005 Free Software Foundation, Inc.
4*3d8817e4Smiod 
5*3d8817e4Smiod This file is part of GDB, the GNU debugger, and the GNU Binutils.
6*3d8817e4Smiod 
7*3d8817e4Smiod This program is free software; you can redistribute it and/or modify
8*3d8817e4Smiod it under the terms of the GNU General Public License as published by
9*3d8817e4Smiod the Free Software Foundation; either version 2 of the License, or
10*3d8817e4Smiod (at your option) any later version.
11*3d8817e4Smiod 
12*3d8817e4Smiod This program is distributed in the hope that it will be useful,
13*3d8817e4Smiod but WITHOUT ANY WARRANTY; without even the implied warranty of
14*3d8817e4Smiod MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*3d8817e4Smiod GNU General Public License for more details.
16*3d8817e4Smiod 
17*3d8817e4Smiod You should have received a copy of the GNU General Public License along
18*3d8817e4Smiod with this program; if not, write to the Free Software Foundation, Inc.,
19*3d8817e4Smiod 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20*3d8817e4Smiod #ifndef CGEN_BITSET_H
21*3d8817e4Smiod #define CGEN_BITSET_H
22*3d8817e4Smiod 
23*3d8817e4Smiod #ifdef __cplusplus
24*3d8817e4Smiod extern "C" {
25*3d8817e4Smiod #endif
26*3d8817e4Smiod 
27*3d8817e4Smiod /* A bitmask represented as a string.
28*3d8817e4Smiod    Each member of the set is represented as a bit
29*3d8817e4Smiod    in the string. Bytes are indexed from left to right in the string and
30*3d8817e4Smiod    bits from most significant to least within each byte.
31*3d8817e4Smiod 
32*3d8817e4Smiod    For example, the bit representing member number 6 is (set->bits[0] & 0x02).
33*3d8817e4Smiod */
34*3d8817e4Smiod typedef struct cgen_bitset
35*3d8817e4Smiod {
36*3d8817e4Smiod   unsigned length;
37*3d8817e4Smiod   char *bits;
38*3d8817e4Smiod } CGEN_BITSET;
39*3d8817e4Smiod 
40*3d8817e4Smiod extern CGEN_BITSET *cgen_bitset_create PARAMS ((unsigned));
41*3d8817e4Smiod extern void cgen_bitset_init PARAMS ((CGEN_BITSET *, unsigned));
42*3d8817e4Smiod extern void cgen_bitset_clear PARAMS ((CGEN_BITSET *));
43*3d8817e4Smiod extern void cgen_bitset_add PARAMS ((CGEN_BITSET *, unsigned));
44*3d8817e4Smiod extern void cgen_bitset_set PARAMS ((CGEN_BITSET *, unsigned));
45*3d8817e4Smiod extern int cgen_bitset_compare PARAMS ((CGEN_BITSET *, CGEN_BITSET *));
46*3d8817e4Smiod extern void cgen_bitset_union PARAMS ((CGEN_BITSET *, CGEN_BITSET *, CGEN_BITSET *));
47*3d8817e4Smiod extern int cgen_bitset_intersect_p PARAMS ((CGEN_BITSET *, CGEN_BITSET *));
48*3d8817e4Smiod extern int cgen_bitset_contains PARAMS ((CGEN_BITSET *, unsigned));
49*3d8817e4Smiod extern CGEN_BITSET *cgen_bitset_copy PARAMS ((CGEN_BITSET *));
50*3d8817e4Smiod 
51*3d8817e4Smiod #ifdef __cplusplus
52*3d8817e4Smiod } // extern "C"
53*3d8817e4Smiod #endif
54*3d8817e4Smiod 
55*3d8817e4Smiod #endif
56