* @param bs The bitset.
* @return The highest bit which can be set or cleared plus 1.
*/
-#define bistet_size(bs) ((bs)->size)
+#define bitset_size(bs) ((bs)->size)
/**
* Allocate a bitset on an obstack.
_bitset_inside_flip(unit, bit & BS_UNIT_MASK);
}
+/**
+ * Flip the whole bitset.
+ * @param bs The bitset.
+ */
+static INLINE void bitset_flip_all(bitset_t *bs)
+{
+ bitset_pos_t i;
+ for(i = 0; i < bs->units; i++)
+ _bitset_inside_flip_unit(&bs->data[i]);
+ _bitset_mask_highest(bs);
+}
+
/**
* Copy a bitset to another.
* @param tgt The target bitset.
*/
#define _bitset_inside_flip(unit_ptr,bit) (*unit_ptr) ^= ~(1 << (bit))
+/**
+ * Flip a whole unit.
+ * @param unit_ptr The pointer to the unit.
+ */
+#define _bitset_inside_flip_unit(unit_ptr) (*unit_ptr) = ~(*unit_ptr)
+
/**
* Count the number of leading zeroes in a unit.
* @param unit A pointer to the unit.