#ifndef CBITFIELD_H #define CBITFIELD_H #define BITSETCHUNKSIZE 32 #define one ((uint32_t)1) struct bitset { uint16_t size; uint32_t bits[BITSET_SIZE/BITSETCHUNKSIZE+1]; }; static inline void bitset_set(struct bitset *bs,uint16_t index, uint8_t value) { uint16_t base=index/BITSETCHUNKSIZE; uint16_t offset=index%BITSETCHUNKSIZE; if(value) { bs->bits[base]|=(one<bits[base]&=~(one<bits[base]^=(one<bits[base]&(one<