Lines Matching defs:bitvec
352 * bitvec (which is assumed to be large enough to include bits base
356 set_bits(unsigned char *bitvec, unsigned int base, unsigned int n)
362 bitvec[base >> 3] |= (~((~0U) << n)) << (base & 7);
365 bitvec[base >> 3] |= (~0U) << (base & 7);
370 memset(bitvec + (base >> 3), 0xff, n >> 3);
375 bitvec[base >> 3] |= ~((~0U) << n);
380 * bitvec (which is assumed to be large enough to include bits base
384 clr_bits(unsigned char *bitvec, int base, int n)
390 bitvec[base >> 3] &= ~((~((~0U) << n)) << (base & 7));
393 bitvec[base >> 3] &= ~((~0U) << (base & 7));
398 memset(bitvec + (base >> 3), 0, n >> 3);
403 bitvec[base >> 3] &= (~0U) << n;
407 * Test whether bit #bit is set in the bitmap pointed to by bitvec.
410 bit_is_set(unsigned char *bitvec, int bit)
412 return (bitvec[bit >> 3] & (1 << (bit & 7)));
415 * Test whether bit #bit is clear in the bitmap pointed to by bitvec.
418 bit_is_clr(unsigned char *bitvec, int bit)
420 return (!bit_is_set(bitvec, bit));
431 blk_is_set(unsigned char *bitvec, int blkbase, int blkfrags)
436 return ((bitvec[blkbase >> 3] & mask) == mask);
445 blk_is_clr(unsigned char *bitvec, int blkbase, int blkfrags)
450 return ((bitvec[blkbase >> 3] & mask) == 0);