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