Hash table. More...
Go to the source code of this file.
Defines | |
#define | DATA(ht, p) ((void *)((p) + 1)) |
#define | KEY(ht, p) ((unsigned char *)((p) + 1) + ht->item_size) |
#define | CHECKHTE(ht, hte) ((uintptr_t)((hte)->priv[1]) == ~(uintptr_t)(ht)) |
#define | MARKHTE(ht, hte) ((hte)->priv[1] = (void*)~(uintptr_t)(ht)) |
#define | MAX_ENUMERATORS 30 |
Functions | |
size_t | hashtb_hash (const unsigned char *key, size_t key_size) |
struct hashtb * | hashtb_create (size_t item_size, const struct hashtb_param *param) |
void * | hashtb_get_param (struct hashtb *ht, struct hashtb_param *param) |
void | hashtb_destroy (struct hashtb **htp) |
int | hashtb_n (struct hashtb *ht) |
void * | hashtb_lookup (struct hashtb *ht, const void *key, size_t keysize) |
static void | setpos (struct hashtb_enumerator *hte, struct node **pp) |
static struct node ** | scan_buckets (struct hashtb *ht, unsigned b) |
struct hashtb_enumerator * | hashtb_start (struct hashtb *ht, struct hashtb_enumerator *hte) |
void | hashtb_end (struct hashtb_enumerator *hte) |
void | hashtb_next (struct hashtb_enumerator *hte) |
int | hashtb_seek (struct hashtb_enumerator *hte, const void *key, size_t keysize, size_t extsize) |
void | hashtb_delete (struct hashtb_enumerator *hte) |
void | hashtb_rehash (struct hashtb *ht, unsigned n_buckets) |
Hash table.
Part of the CCNx C Library.
Copyright (C) 2009 Palo Alto Research Center, Inc.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Definition in file hashtb.c.
#define CHECKHTE | ( | ht, | |||
hte | ) | ((uintptr_t)((hte)->priv[1]) == ~(uintptr_t)(ht)) |
Definition at line 38 of file hashtb.c.
Referenced by hashtb_delete(), and hashtb_end().
#define DATA | ( | ht, | |||
p | ) | ((void *)((p) + 1)) |
Definition at line 35 of file hashtb.c.
Referenced by hashtb_lookup(), and setpos().
#define KEY | ( | ht, | |||
p | ) | ((unsigned char *)((p) + 1) + ht->item_size) |
Definition at line 36 of file hashtb.c.
Referenced by hashtb_delete(), hashtb_lookup(), hashtb_seek(), and setpos().
#define MARKHTE | ( | ht, | |||
hte | ) | ((hte)->priv[1] = (void*)~(uintptr_t)(ht)) |
Definition at line 39 of file hashtb.c.
Referenced by hashtb_start().
#define MAX_ENUMERATORS 30 |
Definition at line 164 of file hashtb.c.
Referenced by hashtb_start().
struct hashtb* hashtb_create | ( | size_t | item_size, | |
const struct hashtb_param * | param | |||
) | [read] |
Definition at line 62 of file hashtb.c.
Referenced by ccn_create(), ccn_express_interest(), ccn_matrix_create(), ccn_set_interest_filter_with_flags(), ccnd_create(), and main().
void hashtb_delete | ( | struct hashtb_enumerator * | hte | ) |
Definition at line 261 of file hashtb.c.
Referenced by ccn_cache_key(), ccn_clean_all_interests(), ccn_get_public_key(), ccn_matrix_getbounds(), ccn_set_interest_filter_with_flags(), ccn_sign_content(), ccnd_destroy_face(), ccnd_shutdown_listeners(), check_dgram_faces(), check_nameprefix_entries(), check_propagating(), finalize_content(), get_dgram_source(), hashtb_destroy(), main(), process_incoming_content(), propagate_interest(), record_connection(), remove_content(), and shutdown_client_fd().
void hashtb_destroy | ( | struct hashtb ** | htp | ) |
Definition at line 90 of file hashtb.c.
Referenced by ccn_destroy(), ccn_matrix_destroy(), ccnd_destroy(), and main().
void hashtb_end | ( | struct hashtb_enumerator * | hte | ) |
Definition at line 179 of file hashtb.c.
Referenced by age_forwarding(), ccn_cache_key(), ccn_clean_all_interests(), ccn_destroy(), ccn_express_interest(), ccn_get_public_key(), ccn_load_private_key(), ccn_locate_key(), ccn_matrix_destroy(), ccn_matrix_getbounds(), ccn_notify_ccndid_changed(), ccn_process_scheduled_operations(), ccn_set_interest_filter_with_flags(), ccn_sign_content(), ccn_stuff_interest(), ccnd_collect_stats(), ccnd_destroy_face(), ccnd_getboundsocket(), ccnd_reg_prefix(), ccnd_shutdown_listeners(), check_dgram_faces(), check_nameprefix_entries(), check_propagating(), cleanout_stragglers(), collect_forwarding_html(), collect_forwarding_xml(), Dump(), finalize_content(), get_dgram_source(), hashtb_destroy(), is_duplicate_flooded(), main(), make_connection(), prepare_poll_fds(), process_incoming_content(), process_incoming_interest(), propagate_interest(), record_connection(), remove_content(), setup_multicast(), and shutdown_client_fd().
void* hashtb_get_param | ( | struct hashtb * | ht, | |
struct hashtb_param * | param | |||
) |
Definition at line 82 of file hashtb.c.
Referenced by finalize_content(), finalize_face(), finalize_nameprefix(), finalize_propagating(), and finally().
size_t hashtb_hash | ( | const unsigned char * | key, | |
size_t | key_size | |||
) |
Definition at line 52 of file hashtb.c.
Referenced by hashtb_lookup(), and hashtb_seek().
void* hashtb_lookup | ( | struct hashtb * | ht, | |
const void * | key, | |||
size_t | keysize | |||
) |
Definition at line 115 of file hashtb.c.
Referenced by ccn_check_pub_arrival(), ccn_dispatch_message(), ccn_locate_key(), ccn_matrix_fetch(), ccnd_req_unreg(), content_from_accession(), do_deferred_write(), faceid_from_fd(), main(), match_interests(), nameprefix_longest_match(), and process_input().
int hashtb_n | ( | struct hashtb * | ht | ) |
Definition at line 109 of file hashtb.c.
Referenced by ccn_matrix_getbounds(), clean_deamon(), cleanout_stragglers(), collect_stats_html(), collect_stats_xml(), Dump(), expire_content(), and prepare_poll_fds().
void hashtb_next | ( | struct hashtb_enumerator * | hte | ) |
Definition at line 203 of file hashtb.c.
Referenced by age_forwarding(), ccn_clean_all_interests(), ccn_destroy(), ccn_matrix_getbounds(), ccn_notify_ccndid_changed(), ccn_process_scheduled_operations(), ccn_stuff_interest(), ccnd_collect_stats(), ccnd_getboundsocket(), ccnd_shutdown_listeners(), check_dgram_faces(), check_nameprefix_entries(), check_propagating(), collect_forwarding_html(), collect_forwarding_xml(), Dump(), make_connection(), prepare_poll_fds(), and setup_multicast().
void hashtb_rehash | ( | struct hashtb * | ht, | |
unsigned | n_buckets | |||
) |
Definition at line 286 of file hashtb.c.
Referenced by hashtb_seek().
int hashtb_seek | ( | struct hashtb_enumerator * | hte, | |
const void * | key, | |||
size_t | keysize, | |||
size_t | extsize | |||
) |
Definition at line 217 of file hashtb.c.
Referenced by ccn_cache_key(), ccn_express_interest(), ccn_get_public_key(), ccn_load_private_key(), ccn_locate_key(), ccn_matrix_store(), ccn_set_interest_filter_with_flags(), ccn_sign_content(), ccnd_destroy_face(), cleanout_stragglers(), finalize_content(), get_dgram_source(), is_duplicate_flooded(), main(), nameprefix_seek(), process_incoming_content(), propagate_interest(), record_connection(), remove_content(), and shutdown_client_fd().
struct hashtb_enumerator* hashtb_start | ( | struct hashtb * | ht, | |
struct hashtb_enumerator * | hte | |||
) | [read] |
Definition at line 166 of file hashtb.c.
Referenced by age_forwarding(), ccn_cache_key(), ccn_clean_all_interests(), ccn_destroy(), ccn_express_interest(), ccn_get_public_key(), ccn_load_private_key(), ccn_locate_key(), ccn_matrix_create(), ccn_matrix_getbounds(), ccn_notify_ccndid_changed(), ccn_process_scheduled_operations(), ccn_set_interest_filter_with_flags(), ccn_sign_content(), ccn_stuff_interest(), ccnd_collect_stats(), ccnd_destroy_face(), ccnd_getboundsocket(), ccnd_reg_prefix(), ccnd_shutdown_listeners(), check_dgram_faces(), check_nameprefix_entries(), check_propagating(), cleanout_stragglers(), collect_forwarding_html(), collect_forwarding_xml(), Dump(), finalize_content(), get_dgram_source(), hashtb_destroy(), is_duplicate_flooded(), main(), make_connection(), prepare_poll_fds(), process_incoming_content(), process_incoming_interest(), propagate_interest(), record_connection(), remove_content(), setup_multicast(), and shutdown_client_fd().
static struct node** scan_buckets | ( | struct hashtb * | ht, | |
unsigned | b | |||
) | [static, read] |
Definition at line 156 of file hashtb.c.
Referenced by hashtb_delete(), hashtb_next(), and hashtb_start().
static void setpos | ( | struct hashtb_enumerator * | hte, | |
struct node ** | pp | |||
) | [static] |
Definition at line 134 of file hashtb.c.
Referenced by hashtb_delete(), hashtb_end(), hashtb_next(), hashtb_seek(), and hashtb_start().