CACAO
bitvector.hpp
Go to the documentation of this file.
1 /* src/toolbox/bitvector.hpp - bitvector header
2 
3  Copyright (C) 2005-2013
4  CACAOVM - Verein zu Foerderung der freien virtuellen Machine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21  02111-1307, USA.
22 
23  Contact: cacao@complang.tuwien.ac.at
24 
25  Authors: Christian Ullrich
26 
27 
28 */
29 
30 
31 #ifndef BITVECTOR_HPP_
32 #define BITVECTOR_HPP_ 1
33 
34 typedef int *bitvector;
35 
36 /* function prototypes */
37 char *bv_to_string(bitvector bv, char *string, int size);
38 bitvector bv_new(int size); /* Create a new Bitvector for size Bits */
39  /* All bits are reset */
40 void bv_set_bit(bitvector bv, int bit); /* set Bit bit of bitvector */
41 void bv_reset_bit(bitvector bv, int bit); /* reset Bit bit of bitvector */
42 void bv_reset(bitvector bv, int size); /* reset the whole bitvector */
43 bool bv_is_empty(bitvector bv, int size); /* Returns if no Bit is set */
44 bool bv_get_bit(bitvector bv, int bit); /* Returns if Bit bit is set */
45 bool bv_equal(bitvector s1, bitvector s2, int size);
46 
47 /* copy the whole bitvector */
48 
49 void bv_copy(bitvector dst, bitvector src, int size);
50 
51 /* d = s1 \ s2 */
52 
54 
55 /* d = s1 union s2 */
56 
58 
59 #endif // BITVECTOR_HPP
60 
61 
62 /*
63  * These are local overrides for various environment variables in Emacs.
64  * Please do not remove this and leave it at the end of the file, where
65  * Emacs will automagically detect them.
66  * ---------------------------------------------------------------------
67  * Local variables:
68  * mode: c++
69  * indent-tabs-mode: t
70  * c-basic-offset: 4
71  * tab-width: 4
72  * End:
73  */
int * bitvector
Definition: bitvector.hpp:34
bool bv_get_bit(bitvector bv, int bit)
Definition: bitvector.cpp:148
JNIEnv jthread jobject jclass jlong size
Definition: jvmti.h:387
void bv_union(bitvector d, bitvector s1, bitvector s2, int size)
Definition: bitvector.cpp:356
bool bv_is_empty(bitvector bv, int size)
Definition: bitvector.cpp:227
char * bv_to_string(bitvector bv, char *string, int size)
Definition: bitvector.cpp:97
void bv_reset(bitvector bv, int size)
Definition: bitvector.cpp:204
void bv_copy(bitvector dst, bitvector src, int size)
Definition: bitvector.cpp:251
int8_t s1
Definition: types.hpp:39
int16_t s2
Definition: types.hpp:42
bitvector bv_new(int size)
Definition: bitvector.cpp:122
void bv_set_bit(bitvector bv, int bit)
Definition: bitvector.cpp:166
void bv_minus(bitvector d, bitvector s1, bitvector s2, int size)
Definition: bitvector.cpp:330
void bv_reset_bit(bitvector bv, int bit)
Definition: bitvector.cpp:185
bool bv_equal(bitvector s1, bitvector s2, int size)
Definition: bitvector.cpp:277