diff options
Diffstat (limited to 'hv_func.h')
-rw-r--r-- | hv_func.h | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -28,38 +28,38 @@ #if defined(PERL_HASH_FUNC_SIPHASH) # define PERL_HASH_FUNC "SIPHASH_2_4" # define PERL_HASH_SEED_BYTES 16 -# define PERL_HASH(hash,str,len) (hash)= S_perl_hash_siphash_2_4(PERL_HASH_SEED,(U8*)(str),(len)) +# define PERL_HASH_WITH_SEED(seed,hash,str,len) (hash)= S_perl_hash_siphash_2_4((seed),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_SUPERFAST) # define PERL_HASH_FUNC "SUPERFAST" # define PERL_HASH_SEED_BYTES 4 -# define PERL_HASH(hash,str,len) (hash)= S_perl_hash_superfast(PERL_HASH_SEED,(U8*)(str),(len)) +# define PERL_HASH_WITH_SEED(seed,hash,str,len) (hash)= S_perl_hash_superfast((seed),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_MURMUR3) # define PERL_HASH_FUNC "MURMUR3" # define PERL_HASH_SEED_BYTES 4 -# define PERL_HASH(hash,str,len) (hash)= S_perl_hash_murmur3(PERL_HASH_SEED,(U8*)(str),(len)) +# define PERL_HASH_WITH_SEED(seed,hash,str,len) (hash)= S_perl_hash_murmur3((seed),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_DJB2) # define PERL_HASH_FUNC "DJB2" # define PERL_HASH_SEED_BYTES 4 -# define PERL_HASH(hash,str,len) (hash)= S_perl_hash_djb2(PERL_HASH_SEED,(U8*)(str),(len)) +# define PERL_HASH_WITH_SEED(seed,hash,str,len) (hash)= S_perl_hash_djb2((seed),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_SDBM) # define PERL_HASH_FUNC "SDBM" # define PERL_HASH_SEED_BYTES 4 -# define PERL_HASH(hash,str,len) (hash)= S_perl_hash_sdbm(PERL_HASH_SEED,(U8*)(str),(len)) +# define PERL_HASH_WITH_SEED(seed,hash,str,len) (hash)= S_perl_hash_sdbm((seed),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_ONE_AT_A_TIME_HARD) # define PERL_HASH_FUNC "ONE_AT_A_TIME_HARD" # define PERL_HASH_SEED_BYTES 8 -# define PERL_HASH(hash,str,len) (hash)= S_perl_hash_one_at_a_time_hard(PERL_HASH_SEED,(U8*)(str),(len)) +# define PERL_HASH_WITH_SEED(seed,hash,str,len) (hash)= S_perl_hash_one_at_a_time_hard((seed),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_ONE_AT_A_TIME) # define PERL_HASH_FUNC "ONE_AT_A_TIME" # define PERL_HASH_SEED_BYTES 4 -# define PERL_HASH(hash,str,len) (hash)= S_perl_hash_one_at_a_time(PERL_HASH_SEED,(U8*)(str),(len)) +# define PERL_HASH_WITH_SEED(seed,hash,str,len) (hash)= S_perl_hash_one_at_a_time((seed),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_ONE_AT_A_TIME_OLD) # define PERL_HASH_FUNC "ONE_AT_A_TIME_OLD" # define PERL_HASH_SEED_BYTES 4 -# define PERL_HASH(hash,str,len) (hash)= S_perl_hash_old_one_at_a_time(PERL_HASH_SEED,(U8*)(str),(len)) +# define PERL_HASH_WITH_SEED(seed,hash,str,len) (hash)= S_perl_hash_old_one_at_a_time((seed),(U8*)(str),(len)) #endif -#ifndef PERL_HASH +#ifndef PERL_HASH_WITH_SEED #error "No hash function defined!" #endif #ifndef PERL_HASH_SEED_BYTES @@ -81,6 +81,8 @@ # endif #endif +#define PERL_HASH(hash,str,len) PERL_HASH_WITH_SEED(PERL_HASH_SEED,hash,str,len) + /*----------------------------------------------------------------------------- * Endianess, misalignment capabilities and util macros * |