Cthulhu  0.2.10
Cthulhu compiler collection
bitset.h File Reference
#include <ctu_base_api.h>
#include "core/analyze.h"
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
Include dependency graph for bitset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...