# define BITSPERCELL 32

/* In the code that accompanies this, "CELL" should be replaced with "UINT" */
/* This code and the declarations for "nm" and "pm" in the front of "bv.c"  */
/* depend upon the size of a UINT, or "unsigned int".  Byte order is not
   important. */

/* ITOY(#bits) converts an allocation request of #bits into an
   allocation request for #CELLs; that is, ITOY(n) returns enough
   CELLs to hold n bits.
   YTOI(#CELLs) tells how many bits are contained in #CELLs.
*/
# define ITOY(x) (((x) + BITSPERCELL - 1) >> 5)
# define YTOI(x) ((x) << 5)

/* CELL(x) tells which CELL contains the x'th bit */
/* BIT(x) tells which bit in the CELL(x)'th CELL corresponds to bit x */
/* these are used in a somewhat machine-independent way to set and
   clear bits in bit vectors (ordering of bits within the vector is not
   specified--see bv.c or macros below for details).
*/
# define which_CELL(x) ((x) >> 5)
# define BIT(x) ((x) & 0x1f)

typedef struct {
  int length;
  unsigned int * vector;
} * BV;

extern BV bv_new(/* #bits */);
extern BV bv_copy();
extern BV bv_and();
extern    bv_free();
extern UINT bv_hash();
extern     bv_eq();

extern BV bv_assign();
extern BV bv_andto();
extern BV bv_orto();
extern BV bv_diffto();
extern    bv_intersects();
extern BV bv_ins();
extern    bv_in();

extern unsigned int pm[32];
extern unsigned int nm[32];
