HomeFreeBSD

bitstring(3): Add bitstring traversal macros.

Description

bitstring(3): Add bitstring traversal macros.

The macro bit_foreach() traverses all set bits in the bitstring in the
forward direction, assigning each location in turn to variable.

The macro bit_foreach_at() traverses all set bits in the bitstring in
the forward direction at or after the zero-based bit index, assigning
each location in turn to variable.

The bit_foreach_unset() and bit_foreach_unset_at() macros which
traverses unset bits are implemented for completeness.

Reviewed by: asomers, dougm

(cherry picked from commit 14a4d6d01335dd233023834e05897377cb70d52a)

Details

Provenance
wulfAuthored on Aug 16 2021, 8:18 PM
Parents
rG290677c3d6f6: hms(4): Allow attachment to pointer top level collection.
Branches
Unknown
Tags
Unknown