|
Unpack a bit table to an index table.
Useful when loading a DBM and computing initial redirection table. May be used for other things than DBMs, e.g., variables. - Parameters:
-
| table,: | index redirection table |
| bits,: | bit array |
| n,: | size in int of the bit array |
- Returns:
- number of bits in bits
- Precondition:
- table is large enough: at least uint32_t[size] where size = index of the highest bit in the bitstring bits.
- bits is at least a uint32_t[n]
- Postcondition:
- returned value == number of bits in bits
- for all bits set in bits at position i, then table[i] is defined and gives the proper indirection ; for other bits, table[i] is untouched.
|