_BITSTR_BITS
(_BITSTR_MASK >> (_BITSTR_BITS - _bit_offset(_stop) - 1)));
#define bitstr_size(_nbits) (_bit_roundup2((_nbits), _BITSTR_BITS) / 8)
_bit_make_mask(_start, _BITSTR_BITS - 1)))
if (_bit_offset(_stop) == _BITSTR_BITS - 1)
return (_bit_offset(_stop) == _BITSTR_BITS - 1 ||
*_bitstr++ |= _bit_make_mask(_start, _BITSTR_BITS - 1);
if (_bit_offset(_stop) == _BITSTR_BITS - 1)
if (_bit_offset(_stop) != _BITSTR_BITS - 1)
*_bitstr++ &= ~_bit_make_mask(_start, _BITSTR_BITS - 1);
if (_bit_offset(_stop) == _BITSTR_BITS - 1)
if (_bit_offset(_stop) != _BITSTR_BITS - 1)
_test &= _bit_make_mask(_start, _BITSTR_BITS - 1);
_value = ((_curbitstr - _bitstr) * _BITSTR_BITS) + ffsl(_test) - 1;
_maxshft = _bit_idx(_size - 1) == 0 ? _size : (int)_BITSTR_BITS;
_last -= _BITSTR_BITS, _test = _mask ^ *++_curbitstr) {
_value = (_curbitstr - _bitstr) * _BITSTR_BITS + _last;
_nbits -= _BITSTR_BITS * _bit_idx(_start);
_start -= _BITSTR_BITS * _bit_idx(_start);
curbitstr_len = (int)_BITSTR_BITS < _nbits ?
(int)_BITSTR_BITS : _nbits;
if (_nbits < _BITSTR_BITS)
_nbits -= _BITSTR_BITS;
while (_nbits >= (int)_BITSTR_BITS) {
_nbits -= _BITSTR_BITS;
return (_bit / _BITSTR_BITS);
return (_bit % _BITSTR_BITS);
if (nbits % _BITSTR_BITS != 0)
bit_nset(bitstr, nbits, roundup2(nbits, _BITSTR_BITS) - 1);
if (nbits % _BITSTR_BITS != 0)
bit_nclear(bitstr, nbits, roundup2(nbits, _BITSTR_BITS) - 1);
if (nbits % _BITSTR_BITS != 0)
bit_nset(bitstr, nbits, roundup2(nbits, _BITSTR_BITS) - 1);
if (nbits % _BITSTR_BITS != 0)
bit_nclear(bitstr, nbits, roundup2(nbits, _BITSTR_BITS) - 1);
_BITSTR_BITS - 1,
_BITSTR_BITS,
_BITSTR_BITS + 1,
2 * _BITSTR_BITS - 1,
2 * _BITSTR_BITS,