/*
**  Bit set, clear, and test operations
**
**  public domain snippet by Bob Stout
*/

typedef enum {ERROR = -1, FALSE, TRUE} LOGICAL;

#define BOOL(x) (!(!(x)))


#define BitSet(arg,posn) ((arg) | (1L << (posn)))

#define BitClr(arg,posn) ((arg) & ~(1L << (posn)))

#define BitTst(arg,posn) BOOL((arg) & (1L << (posn)))



syntax highlighted by Code2HTML, v. 0.9.1