/usr/include/yalecad/bitset.h is in libycadgraywolf-dev 0.1.4+20170307gite1bf319-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #ifndef YBITSET_H
#define YBITSET_H
#define BITSET_GET( array, index ) (array[index>>5] & (1 <<(index & 0x1F)))
#define BITSET_SET( array, index ) (array[index>>5] |= (1 << (index & 0x1F)) )
#define BITSET_RESET( array, i ) (array[i>>5] &= (~(1 << (i & 0x1F))) )
#define BITSET_ALLOC( num ) ( YCALLOC( (num>>5) + 1, UNSIGNED_INT) )
#define BITSET_ARRYSIZE( num ) ( (num>>5) + 1 )
#ifdef TEST
main()
{
unsigned int *array ;
int i ;
int max ;
max = 32 ;
array = BITSET_ALLOC( max ) ;
for( i = 0 ; i <= max ; i++ ){
if( i == 1 || i == 2 || i == 5 || i == 11 || i == 13 || i == 69 ){
BITSET_SET( array, i ) ;
} else {
BITSET_RESET( array, i ) ;
}
}
for( i = 0 ; i <= max ; i++ ){
if( BITSET_GET( array, i ) ){
fprintf( stderr, "i:%d T\n", i ) ;
} else {
fprintf( stderr, "i:%d F\n", i ) ;
}
}
}
#endif /* TEST */
#endif /* YBITSET_H */
|