return DatumGetUInt32(hash_any((const unsigned char *) a->words,
(lastword + 1) * sizeof(bitmapword)));
}
+
+/*
+ * bitmap_hash - hash function for keys that are (pointers to) Bitmapsets
+ *
+ * Note: don't forget to specify bitmap_match as the match function!
+ */
+uint32
+bitmap_hash(const void *key, Size keysize)
+{
+ Assert(keysize == sizeof(Bitmapset *));
+ return bms_hash_value(*((const Bitmapset *const *) key));
+}
+
+/*
+ * bitmap_match - match function to use with bitmap_hash
+ */
+int
+bitmap_match(const void *key1, const void *key2, Size keysize)
+{
+ Assert(keysize == sizeof(Bitmapset *));
+ return !bms_equal(*((const Bitmapset *const *) key1),
+ *((const Bitmapset *const *) key2));
+}
#include "postgres.h"
#include "fmgr.h"
-#include "nodes/bitmapset.h"
#include "utils/hashutils.h"
#include "utils/hsearch.h"
Assert(keysize == sizeof(uint32));
return DatumGetUInt32(hash_uint32(*((const uint32 *) key)));
}
-
-/*
- * bitmap_hash: hash function for keys that are (pointers to) Bitmapsets
- *
- * Note: don't forget to specify bitmap_match as the match function!
- */
-uint32
-bitmap_hash(const void *key, Size keysize)
-{
- Assert(keysize == sizeof(Bitmapset *));
- return bms_hash_value(*((const Bitmapset *const *) key));
-}
-
-/*
- * bitmap_match: match function to use with bitmap_hash
- */
-int
-bitmap_match(const void *key1, const void *key2, Size keysize)
-{
- Assert(keysize == sizeof(Bitmapset *));
- return !bms_equal(*((const Bitmapset *const *) key1),
- *((const Bitmapset *const *) key2));
-}
/* support for hashtables using Bitmapsets as keys: */
extern uint32 bms_hash_value(const Bitmapset *a);
+extern uint32 bitmap_hash(const void *key, Size keysize);
+extern int bitmap_match(const void *key1, const void *key2, Size keysize);
#endif /* BITMAPSET_H */
extern uint32 string_hash(const void *key, Size keysize);
extern uint32 tag_hash(const void *key, Size keysize);
extern uint32 uint32_hash(const void *key, Size keysize);
-extern uint32 bitmap_hash(const void *key, Size keysize);
-extern int bitmap_match(const void *key1, const void *key2, Size keysize);
#define oid_hash uint32_hash /* Remove me eventually */