]>
git.saurik.com Git - bison.git/blob - lib/ebitset.h
1 /* Functions to support ebitsets.
2 Copyright (C) 2002 Free Software Foundation, Inc.
3 Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22 #include "bitset-int.h"
24 /* Number of words to use for each element. */
25 #ifndef EBITSET_ELT_WORDS
26 #define EBITSET_ELT_WORDS 2
29 /* Number of bits stored in each element. */
30 #define EBITSET_ELT_BITS \
31 ((unsigned) (EBITSET_ELT_WORDS * BITSET_WORD_BITS))
33 /* Ebitset element. We use an array of bits. */
34 typedef struct ebitset_elt_struct
38 bitset_word words
[EBITSET_ELT_WORDS
]; /* Bits that are set. */
39 struct ebitset_elt_struct
*next
;
44 typedef ebitset_elt
*ebitset_elts
;
46 /* Head of ebitset linked list. */
47 typedef struct ebitset_struct
49 unsigned int size
; /* Number of elements. */
50 ebitset_elts
*elts
; /* Expanding array of pointers to elements. */
54 extern int ebitset_bytes
PARAMS ((bitset_bindex
));
56 extern void ebitset_release_memory
PARAMS ((void));