18 #include <sys/types.h>
34 if (size <= (bit >> 3))
37 *(vec + (bit >> 3)) |= (uint8_t)(1 << (bit & 0x07));
54 if (size <= (bit >> 3))
57 *(vec + (bit >> 3)) &= (uint8_t)(~(1 << (bit & 0x07)));
72 bits_getb(
const uint8_t *vec,
size_t size, uint8_t bit) {
73 if (size <= (bit >> 3))
76 return (*(vec + (bit >> 3)) & (1 << (bit & 0x07))) != 0;
static int bits_setb(uint8_t *vec, size_t size, uint8_t bit)
Sets the bit bit in bit-vector vec.
static int bits_getb(const uint8_t *vec, size_t size, uint8_t bit)
Gets the status of bit bit from bit-vector vec.
static int bits_clrb(uint8_t *vec, size_t size, uint8_t bit)
Clears the bit bit from bit-vector vec.