3 * File name: ir/st/bs.h
4 * Purpose: Provides a simple bit set.
5 * Author: Florian Liekweg
9 * Copyright: (c) 2002-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 Provides a simple bit set.
26 * the type of a bit set
28 typedef long int bs_t;
30 /** set bit in a bit set */
31 # define bs_set(bs, i) (bs) |= (0x00000001 << i)
33 /** get bit in a bit set */
34 # define bs_get(bs, i) (bs) & (0x00000001 << i)
36 /** logical AND of two bit sets */
37 # define bs_and(bsa, bsb) (bsa) &= (bsb)
39 /** logical OR of two bit sets */
40 # define bs_or(bsa, bsb) (bsa) |= (bsb)
42 /** logical XOR of two bit sets */
43 # define bs_xor(bsa, bsb) (bsa) ^= (bsb)
45 /** returns TRUE if at least one bit is set */
46 # define bs_zro(bs) (0x00000000 != bs)
48 # endif /* ndef _BS_H_ */