Cthulhu  0.2.10
Cthulhu compiler collection
bitset.c File Reference
#include "base/bitset.h"
#include "base/panic.h"
#include "base/util.h"
#include "core/macros.h"
#include <limits.h>
Include dependency graph for bitset.c:

Go to the source code of this file.

Macros

#define BITSET_WORD_MAX   (UCHAR_MAX)
 
#define WORD_SIZE   (sizeof(bitset_word_t) * CHAR_BIT)
 

Typedefs

typedef unsigned char bitset_word_t
 

Functions

STA_DECL bitset_t bitset_of (void *data, size_t words)
 
STA_DECL size_t bitset_set_first (bitset_t set, size_t start)
 scan for the next free bit and set it More...
 
bool bitset_any (bitset_t set, bitset_t mask)
 test if any bits in a given mask are set More...
 
bool bitset_all (bitset_t set, bitset_t mask)
 test if all bits in a given mask are set More...
 
bool bitset_test (bitset_t set, size_t index)
 test if a bit is set More...
 
void bitset_set (bitset_t set, size_t index)
 set a bit More...
 
void bitset_clear (bitset_t set, size_t index)
 clear a bit More...
 
void bitset_reset (bitset_t set)
 reset all bits in a bitset More...
 
size_t bitset_len (bitset_t set)
 get the number of bits in a bitset More...
 

Macro Definition Documentation

◆ BITSET_WORD_MAX

#define BITSET_WORD_MAX   (UCHAR_MAX)

Definition at line 13 of file bitset.c.

◆ WORD_SIZE

#define WORD_SIZE   (sizeof(bitset_word_t) * CHAR_BIT)

Definition at line 14 of file bitset.c.

Typedef Documentation

◆ bitset_word_t

typedef unsigned char bitset_word_t

Definition at line 11 of file bitset.c.

Function Documentation

◆ bitset_of()

STA_DECL bitset_t bitset_of ( void *  data,
size_t  words 
)

Definition at line 41 of file bitset.c.