#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_hash * | Curl_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 size_t(* comp_function)(void *key1, size_t key1_len, void *key2, size_t key2_len) |
| typedef void(* curl_hash_dtor)(void *) |
| typedef size_t(* hash_function)(void *key, size_t key_length, size_t slots_num) |
| void* Curl_hash_add | ( | struct curl_hash * | h, | |
| void * | key, | |||
| size_t | key_len, | |||
| void * | p | |||
| ) |
Definition at line 143 of file hash.c.
References curl_hash::comp_func, Curl_llist_insert_next(), curl_hash::dtor, FETCH_LIST, free, curl_llist::head, if(), curl_hash_element::key, curl_hash_element::key_len, l, mk_hash_element(), curl_llist_element::next, NULL, curl_hash_element::ptr, curl_llist_element::ptr, curl_hash::size, and curl_llist::tail.
Referenced by Curl_cache_addr(), and sh_addentry().
| 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 | |||
| ) |
Definition at line 242 of file hash.c.
References Curl_llist_remove(), curl_llist::head, curl_llist_element::next, curl_hash_element::ptr, curl_llist_element::ptr, curl_hash::slots, and curl_hash::table.
Referenced by hostcache_prune(), and remove_entry_if_stale().
| int Curl_hash_count | ( | struct curl_hash * | h | ) |
| int Curl_hash_delete | ( | struct curl_hash * | h, | |
| void * | key, | |||
| size_t | key_len | |||
| ) |
Definition at line 177 of file hash.c.
References curl_hash::comp_func, Curl_llist_remove(), FETCH_LIST, curl_llist::head, curl_hash_element::key, curl_hash_element::key_len, l, curl_llist_element::next, and curl_llist_element::ptr.
Referenced by sh_delentry().
| void Curl_hash_destroy | ( | struct curl_hash * | h | ) |
Definition at line 267 of file hash.c.
References Curl_hash_clean(), and free.
Referenced by Curl_close(), curl_easy_perform(), curl_multi_add_handle(), curl_multi_cleanup(), curl_multi_init(), Curl_setopt(), curl_share_cleanup(), and curl_share_setopt().
| int Curl_hash_init | ( | struct curl_hash * | h, | |
| int | slots, | |||
| hash_function | hfunc, | |||
| comp_function | comparator, | |||
| curl_hash_dtor | dtor | |||
| ) |
Definition at line 52 of file hash.c.
References curl_hash::comp_func, Curl_llist_alloc(), Curl_llist_destroy(), curl_hash::dtor, free, hash_element_dtor(), curl_hash::hash_func, malloc, NULL, curl_hash::size, curl_hash::slots, and curl_hash::table.
Referenced by Curl_global_host_cache_init(), and Curl_hash_alloc().
| void* Curl_hash_pick | ( | struct curl_hash * | , | |
| void * | key, | |||
| size_t | key_len | |||
| ) |
Definition at line 194 of file hash.c.
References curl_hash::comp_func, FETCH_LIST, curl_llist::head, curl_hash_element::key, curl_hash_element::key_len, l, curl_llist_element::next, NULL, curl_hash_element::ptr, and curl_llist_element::ptr.
Referenced by curl_multi_assign(), Curl_resolv(), multi_socket(), sh_addentry(), sh_delentry(), and singlesocket().
| 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().
1.5.6