Back to index

cell-binutils  2.17cvs20070401
cgen-bitset.h
Go to the documentation of this file.
00001 /* Header file the type CGEN_BITSET.
00002 
00003 Copyright 2002, 2005 Free Software Foundation, Inc.
00004 
00005 This file is part of GDB, the GNU debugger, and the GNU Binutils.
00006 
00007 This program is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011 
00012 This program is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License along
00018 with this program; if not, write to the Free Software Foundation, Inc.,
00019 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00020 #ifndef CGEN_BITSET_H
00021 #define CGEN_BITSET_H
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 /* A bitmask represented as a string.
00028    Each member of the set is represented as a bit
00029    in the string. Bytes are indexed from left to right in the string and
00030    bits from most significant to least within each byte.
00031 
00032    For example, the bit representing member number 6 is (set->bits[0] & 0x02).
00033 */
00034 typedef struct cgen_bitset
00035 {
00036   unsigned length;
00037   char *bits;
00038 } CGEN_BITSET;
00039 
00040 extern CGEN_BITSET *cgen_bitset_create PARAMS ((unsigned));
00041 extern void cgen_bitset_init PARAMS ((CGEN_BITSET *, unsigned));
00042 extern void cgen_bitset_clear PARAMS ((CGEN_BITSET *));
00043 extern void cgen_bitset_add PARAMS ((CGEN_BITSET *, unsigned));
00044 extern void cgen_bitset_set PARAMS ((CGEN_BITSET *, unsigned));
00045 extern int cgen_bitset_compare PARAMS ((CGEN_BITSET *, CGEN_BITSET *));
00046 extern void cgen_bitset_union PARAMS ((CGEN_BITSET *, CGEN_BITSET *, CGEN_BITSET *));
00047 extern int cgen_bitset_intersect_p PARAMS ((CGEN_BITSET *, CGEN_BITSET *));
00048 extern int cgen_bitset_contains PARAMS ((CGEN_BITSET *, unsigned));
00049 extern CGEN_BITSET *cgen_bitset_copy PARAMS ((CGEN_BITSET *));
00050 
00051 #ifdef __cplusplus
00052 } // extern "C"
00053 #endif
00054 
00055 #endif