1 /* Copyright (c) 2002 by Universitaet Karlsruhe (TH). All Rights Reserved */
6 Provides a simple bit set.
17 * the type of a bit set
19 typedef long int bs_t;
21 /** set bit in a bit set */
22 # define bs_set(bs, i) (bs) |= (0x00000001 << i)
24 /** get bit in a bit set */
25 # define bs_get(bs, i) (bs) & (0x00000001 << i)
27 /** logical AND of two bit sets */
28 # define bs_and(bsa, bsb) (bsa) &= (bsb)
30 /** logical OR of two bit sets */
31 # define bs_or(bsa, bsb) (bsa) |= (bsb)
33 /** logical XOR of two bit sets */
34 # define bs_xor(bsa, bsb) (bsa) ^= (bsb)
36 /** returns TRUE if at least one bit is set */
37 # define bs_zro(bs) (0x00000000 != bs)
39 # endif /* ndef _BS_H_ */