typedef struct vent {  /* This is a hash bucket */
    UINT hval;         /* The un-mod'd hash value */
    UINT index;	       /* This entry's index (integer returned by lookup) */
    BV ent;	       /* The entry itself */
    union {
      BV bv;
      UINT * is;
      UINT urp;
    }  other;	       /* Any user-chosen related information */
    struct vent * next;/* Next bucket */
    } * VENT;	       

# define VENT_POOL_SIZE 16

typedef struct vent_pool { /* This is used to speed up allocation */
    struct vent lotsa_vents[VENT_POOL_SIZE]; /* The  pool */
    UINT next;				     /* Index of next one to allocate */
    struct vent_pool * lastpool;             /* Pointer to a previously allocated pool */
    } * VENTPOOL;

typedef struct {	/* A hash table */
    UINT calls;		/* Number of lookups and insertions */
    UINT probes;	/* Number of buckets examined since last expansion */
    UINT nelts;		/* Number of elements in the table */
    UINT nslots;	/* Number of hash table slots */
    UINT max_elts;	/* Size of inverse */
    VENT * slots;	/* Hash table slots (array of pointers to buckets) */
    VENT * inverse;	/* Inverse map from indices to buckets */
    VENTPOOL cache;	/* Memory pool for this hash table */
    UINT last;		/* The index returned by the last call */
    } * VMAP;		

extern UINT v_map(/* vmap, bv */);
extern VMAP v_map_2(/* vmap, bv */);
extern UINT v_inmap(/* vmap, bv */);
extern VMAP v_new_map();
extern UINT v_map_last;

# define v_unmap(m,i) ((m)->inverse[i]->ent)
# define v_other(m,i) ((m)->inverse[i]->other)
# define t_unmap(m,i) ((m)->slots[(m)->inverse[i]])
# define t_hash_unmap(m,i) ((m)->hashes[(m)->inverse[i]])
# define v_map_size(m) ((m)->nelts)

extern UINT vadds;
extern UINT vadds2;
extern UINT vlooks;
extern UINT vswaps;
