Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

sfhashfcn.c File Reference

#include "sfhashfcn.h"

Go to the source code of this file.

Functions

static int isPrime (int num)
static int calcNextPrime (int num)
SFHASHFCNsfhashfcn_new (int m)
void sfhashfcn_free (SFHASHFCN *p)
unsigned sfhashfcn_hash (SFHASHFCN *p, unsigned char *d, int n)
int sfhashfcn_set_keyops (SFHASHFCN *h, unsigned(*hash_fcn)(SFHASHFCN *p, unsigned char *d, int n), int(*keycmp_fcn)(const void *s1, const void *s2, size_t n))


Function Documentation

static int calcNextPrime int  num  )  [static]
 

Definition at line 29 of file sfhashfcn.c.

References isPrime().

static int isPrime int  num  )  [static]
 

Definition at line 16 of file sfhashfcn.c.

void sfhashfcn_free SFHASHFCN p  ) 
 

Definition at line 56 of file sfhashfcn.c.

Referenced by sfghash_delete(), and sfxhash_delete().

unsigned sfhashfcn_hash SFHASHFCN p,
unsigned char *  d,
int  n
 

Definition at line 64 of file sfhashfcn.c.

References _SFHASHFCN::hardener, _SFHASHFCN::scale, and _SFHASHFCN::seed.

Referenced by sfhashfcn_new().

SFHASHFCN* sfhashfcn_new int  m  ) 
 

Definition at line 36 of file sfhashfcn.c.

References calcNextPrime(), _SFHASHFCN::hardener, _SFHASHFCN::hash_fcn, _SFHASHFCN::keycmp_fcn, memcmp(), _SFHASHFCN::scale, _SFHASHFCN::seed, and sfhashfcn_hash().

Referenced by sfghash_new(), and sfxhash_new().

int sfhashfcn_set_keyops SFHASHFCN h,
unsigned(*)(SFHASHFCN *p, unsigned char *d, int n)  hash_fcn,
int(*)(const void *s1, const void *s2, size_t n)  keycmp_fcn
 

Make sfhashfcn use a separate set of operators for the backend.

Parameters:
h sfhashfcn ptr
hash_fcn user specified hash function
keycmp_fcn user specified key comparisoin function

Definition at line 84 of file sfhashfcn.c.

References _SFHASHFCN::hash_fcn, and _SFHASHFCN::keycmp_fcn.

Referenced by sfxhash_set_keyops().


Generated on Sun May 14 14:51:26 2006 by  doxygen 1.4.2