hash.cpp File Reference

#include "cddefines.h"
#include "hash.h"

Include dependency graph for hash.cpp:

Go to the source code of this file.

Enumerations

enum  { HASHINIT = 5381, HASHMUL = 33 }

Functions

static unsigned long hashfunction (const void *t, const size_t len)
static entrylookup_key (const void *key, size_t *lkey, const hashtab *table, unsigned long *hk)
static void extend (hashtab *table)
static unsigned long getbin (unsigned long hk, const hashtab *table)
hashtabnewhash (void(*freedata)(void *))
void freehash (hashtab *table)
data_uaddentry (const void *key, size_t lkey, hashtab *table, int *exists)
data_ulookup (const void *key, size_t lkey, const hashtab *table)
int maxchain (const hashtab *table)
unsigned long makelist (const hashtab *table, data_u **list, const unsigned long nlist, int(*maskfun)(data_u *dat))
unsigned long makeplist (const hashtab *table, void **list, const unsigned long nlist, int(*maskfun)(data_u *dat))


Enumeration Type Documentation

anonymous enum

Enumerator:
HASHINIT 
HASHMUL 

Definition at line 155 of file hash.cpp.


Function Documentation

data_u* addentry ( const void *  key,
size_t  lkey,
hashtab table,
int *  exists 
)

Definition at line 77 of file hash.cpp.

References entry::data, DEBUG_ENTRY, DEBUG_EXIT, extend(), getbin(), entry::hashval, data_u::key, data_u::lkey, lookup_key(), MALLOC, hashtab::nelem, entry::next, and hashtab::tab.

Referenced by newelement(), newreact(), and newspecies().

Here is the call graph for this function:

static void extend ( hashtab table  )  [static]

void freehash ( hashtab table  ) 

static unsigned long getbin ( unsigned long  hk,
const hashtab table 
) [static]

Definition at line 248 of file hash.cpp.

References DEBUG_ENTRY, DEBUG_EXIT, hashtab::frontmask, hashtab::fullmask, and hashtab::size.

Referenced by addentry(), and lookup_key().

static unsigned long hashfunction ( const void *  t,
const size_t  len 
) [static]

Definition at line 157 of file hash.cpp.

References DEBUG_ENTRY, DEBUG_EXIT, HASHINIT, and HASHMUL.

Referenced by newhash().

data_u* lookup ( const void *  key,
size_t  lkey,
const hashtab table 
)

Definition at line 114 of file hash.cpp.

References entry::data, lookup_key(), and hashtab::nelem.

Referenced by CO_findrate_s(), findelement(), and findspecies().

Here is the call graph for this function:

static entry * lookup_key ( const void *  key,
size_t *  lkey,
const hashtab table,
unsigned long *  hk 
) [static]

Definition at line 173 of file hash.cpp.

References entry::data, DEBUG_ENTRY, DEBUG_EXIT, getbin(), hashtab::hashfunction, entry::hashval, data_u::key, data_u::lkey, entry::next, and hashtab::tab.

Referenced by addentry(), and lookup().

Here is the call graph for this function:

unsigned long makelist ( const hashtab table,
data_u **  list,
const unsigned long  nlist,
int(*)(data_u *dat)  maskfun 
)

Definition at line 263 of file hash.cpp.

References cdEXIT(), entry::data, DEBUG_ENTRY, DEBUG_EXIT, ioQQQ, entry::next, hashtab::size, and hashtab::tab.

Here is the call graph for this function:

unsigned long makeplist ( const hashtab table,
void **  list,
const unsigned long  nlist,
int(*)(data_u *dat)  maskfun 
)

Definition at line 289 of file hash.cpp.

References cdEXIT(), entry::data, DEBUG_ENTRY, DEBUG_EXIT, ioQQQ, entry::next, data_u::p, hashtab::size, and hashtab::tab.

Referenced by CO_create_react(), and CO_Init().

Here is the call graph for this function:

int maxchain ( const hashtab table  ) 

Definition at line 127 of file hash.cpp.

References DEBUG_ENTRY, DEBUG_EXIT, max(), entry::next, hashtab::size, and hashtab::tab.

Here is the call graph for this function:

hashtab* newhash ( void(*)(void *)  freedata  ) 

Definition at line 28 of file hash.cpp.

References DEBUG_ENTRY, DEBUG_EXIT, hashfunction(), and MALLOC.

Referenced by CO_Init().

Here is the call graph for this function:


Generated for cloudy by doxygen 1.5.9