replaced malloc.h by stdlib.h
[libfirm] / ir / st / bs.h
1 /* Copyright (c) 2002 by Universitaet Karlsruhe (TH).  All Rights Reserved */
2
3 /**
4    @file bs.h
5
6    Provides a simple bit set.
7
8    Not quite complete
9 */
10
11 /* $Id$ */
12
13 # ifndef _BS_H_
14 # define _BS_H_
15
16 /**
17  * the type of a bit set
18  */
19 typedef long int bs_t;
20
21 /** set bit in a bit set */
22 # define bs_set(bs, i) (bs) |= (0x00000001 << i)
23
24 /** get bit in a bit set */
25 # define bs_get(bs, i) (bs) &  (0x00000001 << i)
26
27 /** logical AND of two bit sets */
28 # define bs_and(bsa, bsb) (bsa) &= (bsb)
29
30 /** logical OR of two bit sets */
31 # define bs_or(bsa, bsb)  (bsa) |= (bsb)
32
33 /** logical XOR of two bit sets */
34 # define bs_xor(bsa, bsb) (bsa) ^= (bsb)
35
36 /** returns TRUE if at least one bit is set */
37 # define bs_zro(bs) (0x00000000 != bs)
38
39 # endif /* ndef _BS_H_ */