Commit 9341c783 authored by Robert Haas's avatar Robert Haas

Put all the prototypes for hashfn.c into the same header file.

Previously, some of the prototypes for functions in hashfn.c were
in utils/hashutils.h and others were in utils/hsearch.h, but that
is confusing and has no particular benefit.

Patch by me, reviewed by Suraj Kharage and Mark Dilger.

Discussion: http://postgr.es/m/CA+TgmoaRiG4TXND8QuM6JXFRkM_1wL2ZNhzaUKsuec9-4yrkgw@mail.gmail.com
parent 07b95c3d
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "storage/ipc.h" #include "storage/ipc.h"
#include "storage/lwlock.h" #include "storage/lwlock.h"
#include "utils/dsa.h" #include "utils/dsa.h"
#include "utils/hsearch.h" #include "utils/hashutils.h"
#include "utils/memutils.h" #include "utils/memutils.h"
/* /*
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
#include "storage/shmem.h" #include "storage/shmem.h"
#include "storage/spin.h" #include "storage/spin.h"
#include "utils/dynahash.h" #include "utils/dynahash.h"
#include "utils/hashutils.h"
#include "utils/memutils.h" #include "utils/memutils.h"
......
...@@ -26,6 +26,12 @@ extern Datum hash_any_extended(const unsigned char *k, ...@@ -26,6 +26,12 @@ extern Datum hash_any_extended(const unsigned char *k,
extern Datum hash_uint32(uint32 k); extern Datum hash_uint32(uint32 k);
extern Datum hash_uint32_extended(uint32 k, uint64 seed); extern Datum hash_uint32_extended(uint32 k, uint64 seed);
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);
#define oid_hash uint32_hash /* Remove me eventually */
/* /*
* Combine two 32-bit hash values, resulting in another hash value, with * Combine two 32-bit hash values, resulting in another hash value, with
* decent bit mixing. * decent bit mixing.
......
...@@ -118,6 +118,10 @@ typedef struct ...@@ -118,6 +118,10 @@ typedef struct
/* /*
* prototypes for functions in dynahash.c * prototypes for functions in dynahash.c
*
* Note: It is deprecated for callers of hash_create to explicitly specify
* string_hash, tag_hash, uint32_hash, or oid_hash. Just set HASH_BLOBS or
* not. Use HASH_FUNCTION only when you want something other than those.
*/ */
extern HTAB *hash_create(const char *tabname, long nelem, extern HTAB *hash_create(const char *tabname, long nelem,
HASHCTL *info, int flags); HASHCTL *info, int flags);
...@@ -142,17 +146,4 @@ extern Size hash_get_shared_size(HASHCTL *info, int flags); ...@@ -142,17 +146,4 @@ extern Size hash_get_shared_size(HASHCTL *info, int flags);
extern void AtEOXact_HashTables(bool isCommit); extern void AtEOXact_HashTables(bool isCommit);
extern void AtEOSubXact_HashTables(bool isCommit, int nestDepth); extern void AtEOSubXact_HashTables(bool isCommit, int nestDepth);
/*
* prototypes for functions in hashfn.c
*
* Note: It is deprecated for callers of hash_create to explicitly specify
* string_hash, tag_hash, uint32_hash, or oid_hash. Just set HASH_BLOBS or
* not. Use HASH_FUNCTION only when you want something other than those.
*/
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);
#define oid_hash uint32_hash /* Remove me eventually */
#endif /* HSEARCH_H */ #endif /* HSEARCH_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment