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

#include "setup.h"
#include <stddef.h>
#include "llist.h"

Go to the source code of this file.

Classes

struct  curl_hash
struct  curl_hash_element

Typedefs

typedef size_t(* hash_function )(void *key, size_t key_length, size_t slots_num)
typedef size_t(* comp_function )(void *key1, size_t key1_len, void *key2, size_t key2_len)
typedef void(* curl_hash_dtor )(void *)

Functions

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)
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 *, void *key, size_t key_len)
void Curl_hash_apply (struct curl_hash *h, void *user, void(*cb)(void *user, void *ptr))
int Curl_hash_count (struct curl_hash *h)
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)


Typedef Documentation

typedef size_t(* comp_function)(void *key1, size_t key1_len, void *key2, size_t key2_len)

Definition at line 18 of file hash.h.

typedef void(* curl_hash_dtor)(void *)

Definition at line 23 of file hash.h.

typedef size_t(* hash_function)(void *key, size_t key_length, size_t slots_num)

Definition at line 14 of file hash.h.


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_apply ( struct curl_hash h,
void *  user,
void(*)(void *user, void *ptr)  cb 
)

Referenced by Curl_disconnect().

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_count ( struct curl_hash h  ) 

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 ,
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().


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