1#ifndef __LIB_KERNEL_HASH_H
2#define __LIB_KERNEL_HASH_H
38#define hash_entry(HASH_ELEM, STRUCT, MEMBER) \
39 ((STRUCT *) ((uint8_t *) &(HASH_ELEM)->list_elem \
40 - offsetof (STRUCT, MEMBER.list_elem)))
struct hash_elem * hash_find(struct hash *, struct hash_elem *)
Definition: hash.c:125
struct hash_elem * hash_insert(struct hash *, struct hash_elem *)
Definition: hash.c:94
bool hash_less_func(const struct hash_elem *a, const struct hash_elem *b, void *aux)
Definition: hash.h:49
void hash_destroy(struct hash *, hash_action_func *)
Definition: hash.c:81
size_t hash_size(struct hash *)
Definition: hash.c:230
void hash_first(struct hash_iterator *, struct hash *)
Definition: hash.c:187
struct hash_elem * hash_delete(struct hash *, struct hash_elem *)
Definition: hash.c:137
void hash_apply(struct hash *, hash_action_func *)
Definition: hash.c:153
uint64_t hash_hash_func(const struct hash_elem *e, void *aux)
Definition: hash.h:44
bool hash_init(struct hash *, hash_hash_func *, hash_less_func *, void *aux)
Definition: hash.c:25
uint64_t hash_int(int)
Definition: hash.c:277
struct hash_elem * hash_replace(struct hash *, struct hash_elem *)
Definition: hash.c:109
struct hash_elem * hash_cur(struct hash_iterator *)
Definition: hash.c:224
uint64_t hash_string(const char *)
Definition: hash.c:262
bool hash_empty(struct hash *)
Definition: hash.c:236
void hash_action_func(struct hash_elem *e, void *aux)
Definition: hash.h:55
struct hash_elem * hash_next(struct hash_iterator *)
Definition: hash.c:205
uint64_t hash_bytes(const void *, size_t)
Definition: hash.c:246
void hash_clear(struct hash *, hash_action_func *)
Definition: hash.c:51
unsigned long long int uint64_t
Definition: stdint.h:29
struct hash * hash
Definition: hash.h:69
struct list * bucket
Definition: hash.h:70
struct hash_elem * elem
Definition: hash.h:71
hash_less_func * less
Definition: hash.h:63
hash_hash_func * hash
Definition: hash.h:62
void * aux
Definition: hash.h:64
size_t bucket_cnt
Definition: hash.h:60
struct list * buckets
Definition: hash.h:61
size_t elem_cnt
Definition: hash.h:59