Lines Matching defs:bset
24 void nsd_bitset_zero(struct nsd_bitset *bset)
28 assert(bset != NULL);
30 sz = nsd_bitset_size(bset->size) - sizeof(bset->size);
32 memset(bset->bits, 0, sz);
35 void nsd_bitset_init(struct nsd_bitset *bset, size_t bits)
37 assert(bset != NULL);
41 bset->size = bits;
42 nsd_bitset_zero(bset);
45 int nsd_bitset_isset(struct nsd_bitset *bset, size_t bit)
47 assert(bset != NULL);
48 if(bit >= bset->size)
51 return (bset->bits[ (bit / CHAR_BIT) ] & (1 << (bit % CHAR_BIT))) != 0;
54 void nsd_bitset_set(struct nsd_bitset *bset, size_t bit)
56 assert(bset != NULL);
57 assert(bset->size > bit);
58 bset->bits[ (bit / CHAR_BIT) ] |= (1 << (bit % CHAR_BIT));
61 void nsd_bitset_unset(struct nsd_bitset *bset, size_t bit)
63 assert(bset != NULL);
64 assert(bset->size > bit);
65 bset->bits[ (bit / CHAR_BIT) ] &= ~(1 << (bit % CHAR_BIT));