File hashtable.c


Included Files


Global Variable pd_ht_debug

int pd_ht_debug
Visible in:  hashtable.c
   hashtable.h
Used in: pd_ht_deleteentry()hashtable.c

Global Variable pd_ht_errno

int pd_ht_errno
Visible in:  hashtable.c
   hashtable.h
Used in: findinlist()hashtable.c
  pd_ht_createentry()hashtable.c
  pd_ht_deleteentry()hashtable.c
  pd_ht_fetch()hashtable.c
  pd_ht_init()hashtable.c
  pd_ht_setvalue()hashtable.c
  pd_ht_stash()hashtable.c
  pd_ht_store()hashtable.c
  resizetable()hashtable.c

Local Variables

prev
static struct pd_ht_entry* prev
Used in: findinlist()
  pd_ht_deleteentry()

Global Function defaulthash()

int defaulthash ( void* key, int keylen )
Used in: pd_ht_init()hashtable.c

Global Function findinlist()

struct pd_ht_entry* findinlist ( struct pd_ht_entry* list, void* key )
Calls: pd_ht_keymatch()hashtable.c
Called by: pd_ht_createentry()hashtable.c
  pd_ht_findentry()hashtable.c
References Variables: pd_ht_errnohashtable.c
  prevhashtable.c

Global Function keylength()

size_t keylength ( struct pd_ht* table, void* key )
Calls: strlen()
Called by: pd_ht_createentry()hashtable.c
  pd_ht_findentry()hashtable.c

Global Function pd_ht_createentry()

struct pd_ht_entry* pd_ht_createentry ( struct pd_ht* table, void* key )
Prototyped in: hashtable.h
Calls: findinlist()hashtable.c
  keylength()hashtable.c
  resizetable()hashtable.c
  free(), malloc(), memcpy()
Called by: pd_ht_stash()hashtable.c
References Variables: pd_ht_errnohashtable.c

Global Function pd_ht_deleteentry()

int pd_ht_deleteentry ( struct pd_ht_entry* entry )
Prototyped in: hashtable.h
Calls: pd_ht_exists()hashtable.c
  abort(), fflush(), fprintf(), free()
Called by: pd_ht_keydelete()hashtable.c
References Variables: pd_ht_debughashtable.c
  pd_ht_errnohashtable.c
  prevhashtable.c

Global Function pd_ht_dup()

int pd_ht_dup ( struct pd_ht* dest, struct pd_ht* src )
Prototyped in: hashtable.h
Calls: pd_ht_init()hashtable.c
  pd_ht_stash()hashtable.c
  resizetable()hashtable.c

Global Function pd_ht_exists()

int pd_ht_exists ( struct pd_ht* table, void* key )
Prototyped in: hashtable.h
Calls: pd_ht_findentry()hashtable.c
Called by: pd_ht_deleteentry()hashtable.c

Global Function pd_ht_fetch()

void* pd_ht_fetch ( struct pd_ht* ht, void* key )
Prototyped in: hashtable.h
Calls: pd_ht_findentry()hashtable.c
  pd_ht_getvalue()hashtable.c
References Variables: pd_ht_errnohashtable.c

Global Function pd_ht_findentry()

struct pd_ht_entry* pd_ht_findentry ( struct pd_ht* table, void* key )
Prototyped in: hashtable.h
Calls: findinlist()hashtable.c
  keylength()hashtable.c
Called by: pd_ht_exists()hashtable.c
  pd_ht_fetch()hashtable.c
  pd_ht_keydelete()hashtable.c
  pd_ht_store()hashtable.c

Global Function pd_ht_firstentry()

struct pd_ht_entry* pd_ht_firstentry ( struct pd_ht* table, struct pd_ht_search* search )
Prototyped in: hashtable.h

Global Function pd_ht_getkey()

void* pd_ht_getkey ( struct pd_ht_entry* entry )
Prototyped in: hashtable.h

Global Function pd_ht_getvalue()

void* pd_ht_getvalue ( struct pd_ht_entry* entry )
Prototyped in: hashtable.h
Called by: pd_ht_fetch()hashtable.c

Global Function pd_ht_init()

int pd_ht_init ( struct pd_ht* table, int keylength, int (*hashfunc)(void* key,int length) )
Prototyped in: hashtable.h
Calls: malloc()
Called by: pd_ht_dup()hashtable.c
References Functions: defaulthash()hashtable.c
References Variables: pd_ht_errnohashtable.c

Global Function pd_ht_keydelete()

int pd_ht_keydelete ( struct pd_ht* ht, void* key )
Prototyped in: hashtable.h
Calls: pd_ht_deleteentry()hashtable.c
  pd_ht_findentry()hashtable.c

Global Function pd_ht_nextentry()

struct pd_ht_entry* pd_ht_nextentry ( struct pd_ht_search* search )
Prototyped in: hashtable.h

Global Function pd_ht_setvalue()

int pd_ht_setvalue ( struct pd_ht_entry* entry, void* value )
Prototyped in: hashtable.h
Called by: pd_ht_stash()hashtable.c
  pd_ht_store()hashtable.c
References Variables: pd_ht_errnohashtable.c

Global Function pd_ht_size()

int pd_ht_size ( struct pd_ht* table )
Prototyped in: hashtable.h

Global Function pd_ht_stash()

int pd_ht_stash ( struct pd_ht* ht, void* key, void* value, void (*disp)(void* old) )
Prototyped in: hashtable.h
Calls: pd_ht_createentry()hashtable.c
  pd_ht_setvalue()hashtable.c
  pd_ht_store()hashtable.c
  perror()
Called by: pd_ht_dup()hashtable.c
References Variables: pd_ht_errnohashtable.c

Global Function pd_ht_store()

int pd_ht_store ( struct pd_ht* ht, void* key, void* value, void (*disp)(void* old) )
Prototyped in: hashtable.h
Calls: pd_ht_findentry()hashtable.c
  pd_ht_setvalue()hashtable.c
Called by: pd_ht_stash()hashtable.c
References Variables: pd_ht_errnohashtable.c

Local Function pd_ht_keymatch()

static int pd_ht_keymatch ( size_t keylen, void* key1, void* key2 )
Calls: memcmp(), strcmp()
Called by: findinlist()hashtable.c

Local Function resizetable()

static int resizetable ( struct pd_ht* table, int newmax )
Calls: free(), malloc()
Called by: pd_ht_createentry()hashtable.c
  pd_ht_dup()hashtable.c
References Variables: pd_ht_errnohashtable.c