Initial revision

This commit is contained in:
cvs
2000-02-07 10:38:55 +00:00
commit fdc6b051c9
846 changed files with 230218 additions and 0 deletions

17
bit.h Normal file
View File

@ -0,0 +1,17 @@
/*--------------------------------------------------------------------------
Macros for handling bits in a character array. Stolen somewhere on the
internet. Working!
Dr. Mark Koennecke 15.6.1994
----------------------------------------------------------------------------*/
#include <limits.h> /* for CHAR_BIT */
#define BITMASK(bit) (1 << ((bit) % CHAR_BIT))
#define BITSLOT(bit) ((bit) / CHAR_BIT)
#define BITSET(ary, bit) ((ary)[BITSLOT(bit)] |= BITMASK(bit))
#define BITTEST(ary, bit) ((ary)[BITSLOT(bit)] & BITMASK(bit))
#define BITUNSET(ary, bit) ((ary)[BITSLOT(bit)] ^= BITMASK(bit))