Skip to main content

Module bits

Module bits 

Source
Expand description

Big-endian (MSB-first) allocation-bitmap helpers, as used by HFS, HFS+ and ProDOS.

Functions§

bitmap_clear_bit_be
Clear the bit at index in a big-endian bitmap.
bitmap_collect_clear_runs_be
Collect every contiguous run of clear bits in a big-endian bitmap as (start, length) pairs. Used by the HFS+ multi-extent allocator (largest-run-first) — see allocate_extents in src/fs/hfsplus.rs.
bitmap_find_clear_bit_be
Find the first clear (0) bit in a big-endian bitmap within max_bits.
bitmap_find_clear_run_be
Find a contiguous run of count clear bits in a big-endian bitmap. Returns the starting bit index, or None if no such run exists.
bitmap_find_set_bit_be
Find the first set (1) bit in a big-endian bitmap within max_bits. ProDOS uses bit=1 for FREE blocks, so this finds the first free block.
bitmap_set_bit_be
Set the bit at index in a big-endian bitmap.
bitmap_test_bit_be
Test whether the bit at index is set in a big-endian bitmap.