This module bring a set of macros to manipulates a byte array as a bit one.
The bitfield module header is lapin/container/bitfield.h.
Parameters
-
size_t bit:
  The amount of bits to reserve.
Return value
-
On success, the function returns the address of the first
byte of the bitfield.
-
On failure, it returns NULL.
Error values and logs
On error, bunny_errno is set to:
-
ENOMEM:
  Out of memory.
Logs written by this function are tagged with the "allocator" label.
INDEX
Description
  Create a bitfield with a length matching the sent value in bits.
The allocation is made with bunny_alloca on the system stack,
so it is destroyed when leaving the function.
Bits are not initialized.
The returned memory space must not be freed.
Parameters
-
size_t bit:
  The amount of bits to reserve.
Return value
-
The function returns the address of the first
byte of the bitfield.
INDEX
Logs
Logs written by this function are tagged with the "allocator" label.
INDEX
Description
  Set to true the bit at position idx inside bitfield.
INDEX
Description
  Set to false the bit at position idx inside bitfield.
INDEX
Description
  Get the bit at position idx inside bitfield.
Return value
The bit status: true or false.
INDEX
Description
  Set to true the bit at position idx inside bitfield.
Parameters
-
t_bunny_auto_bitfieldX bitfield:
  The bitfield to edit. It must be a direct instance of
t_bunny_auto_bitfield8, 16, 32 or 64.
-
size_t idx:
  The position in bit of the bit to set to true.
INDEX
Description
  Set to false the bit at position idx inside bitfield.
Parameters
-
t_bunny_auto_bitfieldX bitfield:
  The bitfield to edit. It must be a direct instance of
t_bunny_auto_bitfield8, 16, 32 or 64.
-
size_t idx:
  The position in bit of the bit to set to false.
INDEX
Description
  Get the bit at position idx inside bitfield.
Return value
The bit status: true or false.
INDEX