Cthulhu
0.2.10
Cthulhu compiler collection
|
Simple bitset. More...
Data Structures | |
struct | bitset_t |
a bitset More... | |
Macros | |
#define | CT_BITSET_ARRAY(arr) { sizeof(arr), arr } |
Functions | |
CT_NODISCARD CT_BASE_API bitset_t | bitset_of (STA_READS(words) void *data, size_t words) |
create a bitset from a buffer More... | |
CT_NODISCARD CT_BASE_API size_t | bitset_set_first (bitset_t set, size_t start) |
scan for the next free bit and set it More... | |
CT_PUREFN CT_BASE_API bool | bitset_any (bitset_t set, bitset_t mask) |
test if any bits in a given mask are set More... | |
CT_PUREFN CT_BASE_API bool | bitset_all (bitset_t set, bitset_t mask) |
test if all bits in a given mask are set More... | |
CT_PUREFN CT_BASE_API bool | bitset_test (bitset_t set, size_t index) |
test if a bit is set More... | |
CT_BASE_API void | bitset_set (bitset_t set, size_t index) |
set a bit More... | |
CT_BASE_API void | bitset_clear (bitset_t set, size_t index) |
clear a bit More... | |
CT_BASE_API void | bitset_reset (bitset_t set) |
reset all bits in a bitset More... | |
CT_PUREFN CT_BASE_API size_t | bitset_len (bitset_t set) |
get the number of bits in a bitset More... | |
Simple bitset.
CT_BASE_API void bitset_clear | ( | bitset_t | set, |
size_t | index | ||
) |
CT_NODISCARD CT_BASE_API bitset_t bitset_of | ( | STA_READS(words) void * | data, |
size_t | words | ||
) |
create a bitset from a buffer
data
is not NULL words
> 0data | the buffer to use for the bitset |
words | the number of bytes in the buffer |
CT_BASE_API void bitset_reset | ( | bitset_t | set | ) |
CT_BASE_API void bitset_set | ( | bitset_t | set, |
size_t | index | ||
) |
CT_NODISCARD CT_BASE_API size_t bitset_set_first | ( | bitset_t | set, |
size_t | start | ||
) |