/* $Id: bitarray.h,v 1.11 1998/10/16 03:15:04 bsmith Exp bsmith $ */ /* BT - Bit array objects: used to compactly store logical arrays of variables. BTCreate(m,bt) - creates a bit array with enough room to hold m values BTDestroy(bt) - destroys the bit array BTMemzero(m,bt) - zeros the entire bit array (sets all values to false) BTSet(bt,index) - sets a particular entry as true BTClear(bt,index) - sets a particular entry as false BTLookup(bt,index) - returns the value BTLookupSet(bt,index) - returns the value and then sets it true BTLength(m) - returns number of bytes in array with m bits BTView(m,bt) - prints all the entries in a bit array These routines do not currently have manual pages. The are all implemented as macros with the trivial data structure for efficiency. These are not thread safe since they use a few global variables. */ #if !defined(__BITARRAY_H) #define __BITARRAY_H #if !defined(BITSPERBYTE) #define BITSPERBYTE 8 #endif typedef char* BT; extern char _BT_mask, _BT_c; extern int _BT_idx; #define BTView(m,bt) {\ int __i; \ for (__i=0; __i