Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

bitstring.c File Reference

#include "base/bitstring.h"

Functions

size_t base_bits2indexTable (const uint32_t *bits, size_t n, cindex_t *table)
 Unpack a bit table to an index table.

Function Documentation

size_t base_bits2indexTable const uint32_t *  bits,
size_t  n,
cindex_t table
 

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.


Generated on Fri Jun 30 00:02:30 2006 for Module base by  doxygen 1.4.2