+struct bbitset_struct
+{
+ const struct bitset_vtable * vtable;
+ bitset_windex cindex; /* Cache word index. */
+ bitset_windex csize; /* Cache size in words. */
+ bitset_word *cdata; /* Cache data pointer. */
+ /* Perhaps we could sacrifice another word to indicate
+ that the bitset is known to be zero, that a bit has been set
+ in the cache, and that a bit has been cleared in the cache.
+ This would speed up some of the searches but slightly slow down
+ bit set/reset operations of cached bits. */
+};
+
+
+typedef union bitset_union *bitset;
+
+
+/* The contents of this structure should be considered private. */
+struct bitset_vtable
+{
+ void (*set) PARAMS ((bitset, bitset_bindex));
+ void (*reset) PARAMS ((bitset, bitset_bindex));
+ int (*toggle) PARAMS ((bitset, bitset_bindex));
+ int (*test) PARAMS ((bitset, bitset_bindex));
+ bitset_bindex (*size) PARAMS ((bitset));
+ bitset_bindex (*count) PARAMS ((bitset));
+
+ int (*empty_p) PARAMS ((bitset));
+ void (*ones) PARAMS ((bitset));
+ void (*zero) PARAMS ((bitset));
+
+ void (*copy) PARAMS ((bitset, bitset));
+ int (*disjoint_p) PARAMS ((bitset, bitset));
+ int (*equal_p) PARAMS ((bitset, bitset));
+ void (*not) PARAMS ((bitset, bitset));
+ int (*subset_p) PARAMS ((bitset, bitset));
+
+ void (*and) PARAMS ((bitset, bitset, bitset));
+ int (*and_cmp) PARAMS ((bitset, bitset, bitset));
+ void (*andn) PARAMS ((bitset, bitset, bitset));
+ int (*andn_cmp) PARAMS ((bitset, bitset, bitset));
+ void (*or) PARAMS ((bitset, bitset, bitset));
+ int (*or_cmp) PARAMS ((bitset, bitset, bitset));
+ void (*xor) PARAMS ((bitset, bitset, bitset));
+ int (*xor_cmp) PARAMS ((bitset, bitset, bitset));
+
+ void (*and_or) PARAMS ((bitset, bitset, bitset, bitset));
+ int (*and_or_cmp) PARAMS ((bitset, bitset, bitset, bitset));
+ void (*andn_or) PARAMS ((bitset, bitset, bitset, bitset));
+ int (*andn_or_cmp) PARAMS ((bitset, bitset, bitset, bitset));
+ void (*or_and) PARAMS ((bitset, bitset, bitset, bitset));
+ int (*or_and_cmp) PARAMS ((bitset, bitset, bitset, bitset));
+
+ bitset_bindex (*list) PARAMS ((bitset, bitset_bindex *,
+ bitset_bindex, bitset_bindex *));
+ bitset_bindex (*list_reverse) PARAMS ((bitset,
+ bitset_bindex *, bitset_bindex,
+ bitset_bindex *));
+ void (*free) PARAMS ((bitset));
+ enum bitset_type type;
+};
+
+#define BITSET_COMPATIBLE_(BSET1, BSET2) ((BSET1)->b.vtable == (BSET2)->b.vtable)
+
+#define BITSET_CHECK2_(DST, SRC) \
+if (!BITSET_COMPATIBLE_ (DST, SRC)) abort ();
+
+#define BITSET_CHECK3_(DST, SRC1, SRC2) \
+if (!BITSET_COMPATIBLE_ (DST, SRC1) \
+ || !BITSET_COMPATIBLE_ (DST, SRC2)) abort ();
+
+#define BITSET_CHECK4_(DST, SRC1, SRC2, SRC3) \
+if (!BITSET_COMPATIBLE_ (DST, SRC1) || !BITSET_COMPATIBLE_ (DST, SRC2) \
+ || !BITSET_COMPATIBLE_ (DST, SRC3)) abort ();
+
+