D:/opendownloadmanager/ODM-1.x/InetFile/cURL_lib/hash.c File Reference

#include "setup.h"
#include <string.h>
#include <stdlib.h>
#include "hash.h"
#include "llist.h"
#include "memory.h"
#include "memdebug.h"

Go to the source code of this file.

Defines

#define FETCH_LIST(x, y, z)   x->table[x->hash_func(y, z, x->slots)]

Functions

static void hash_element_dtor (void *user, void *element)
int Curl_hash_init (struct curl_hash *h, int slots, hash_function hfunc, comp_function comparator, curl_hash_dtor dtor)
struct curl_hashCurl_hash_alloc (int slots, hash_function hfunc, comp_function comparator, curl_hash_dtor dtor)
static struct curl_hash_elementmk_hash_element (void *key, size_t key_len, const void *p)
void * Curl_hash_add (struct curl_hash *h, void *key, size_t key_len, void *p)
int Curl_hash_delete (struct curl_hash *h, void *key, size_t key_len)
void * Curl_hash_pick (struct curl_hash *h, void *key, size_t key_len)
void Curl_hash_clean (struct curl_hash *h)
void Curl_hash_clean_with_criterium (struct curl_hash *h, void *user, int(*comp)(void *, void *))
void Curl_hash_destroy (struct curl_hash *h)
size_t Curl_hash_str (void *key, size_t key_length, size_t slots_num)
size_t Curl_str_key_compare (void *k1, size_t key1_len, void *k2, size_t key2_len)


Define Documentation

#define FETCH_LIST ( x,
y,
 )     x->table[x->hash_func(y, z, x->slots)]

Definition at line 138 of file hash.c.

Referenced by Curl_hash_add(), Curl_hash_delete(), and Curl_hash_pick().


Function Documentation

void* Curl_hash_add ( struct curl_hash h,
void *  key,
size_t  key_len,
void *  p 
)

struct curl_hash* Curl_hash_alloc ( int  slots,
hash_function  hfunc,
comp_function  comparator,
curl_hash_dtor  dtor 
) [read]

Definition at line 88 of file hash.c.

References Curl_hash_init(), free, simple_client::h, malloc, and NULL.

Referenced by Curl_mk_dnscache(), and sh_init().

void Curl_hash_clean ( struct curl_hash h  ) 

Definition at line 230 of file hash.c.

References Curl_llist_destroy(), free, curl_hash::slots, and curl_hash::table.

Referenced by Curl_global_host_cache_dtor(), and Curl_hash_destroy().

void Curl_hash_clean_with_criterium ( struct curl_hash h,
void *  user,
int(*)(void *, void *)  comp 
)

int Curl_hash_delete ( struct curl_hash h,
void *  key,
size_t  key_len 
)

void Curl_hash_destroy ( struct curl_hash h  ) 

int Curl_hash_init ( struct curl_hash h,
int  slots,
hash_function  hfunc,
comp_function  comparator,
curl_hash_dtor  dtor 
)

void* Curl_hash_pick ( struct curl_hash h,
void *  key,
size_t  key_len 
)

size_t Curl_hash_str ( void *  key,
size_t  key_length,
size_t  slots_num 
)

Definition at line 276 of file hash.c.

Referenced by Curl_global_host_cache_init(), and Curl_mk_dnscache().

size_t Curl_str_key_compare ( void *  k1,
size_t  key1_len,
void *  k2,
size_t  key2_len 
)

Definition at line 290 of file hash.c.

Referenced by Curl_global_host_cache_init(), and Curl_mk_dnscache().

static void hash_element_dtor ( void *  user,
void *  element 
) [static]

static struct curl_hash_element* mk_hash_element ( void *  key,
size_t  key_len,
const void *  p 
) [static, read]

Definition at line 114 of file hash.c.

References free, curl_hash_element::key, curl_hash_element::key_len, malloc, NULL, and curl_hash_element::ptr.

Referenced by Curl_hash_add().


Generated on Sun May 25 00:20:06 2008 by  doxygen 1.5.6