libosmocore 1.10.0.58-6cd7a
Osmocom core library
|
Go to the source code of this file.
Macros | |
#define | DEFINE_HASHTABLE(name, bits) |
#define | DECLARE_HASHTABLE(name, bits) struct hlist_head name[1 << (bits)] |
#define | HASH_SIZE(name) (ARRAY_SIZE(name)) |
#define | HASH_BITS(name) ilog2(HASH_SIZE(name)) |
#define | hash_min(val, bits) (sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits)) |
#define | hash_init(hashtable) __hash_init(hashtable, HASH_SIZE(hashtable)) |
hash_init - initialize a hash table @hashtable: hashtable to be initialized More... | |
#define | hash_add(hashtable, node, key) hlist_add_head(node, &hashtable[hash_min(key, HASH_BITS(hashtable))]) |
hash_add - add an object to a hashtable @hashtable: hashtable to add to @node: the &struct hlist_node of the object to be added @key: the key of the object to be added More... | |
#define | hash_empty(hashtable) __hash_empty(hashtable, HASH_SIZE(hashtable)) |
hash_empty - check whether a hashtable is empty @hashtable: hashtable to check More... | |
: hashtable to iterate | |
hash_for_each_possible_safe - iterate over all possible objects hashing to the same bucket safe against removals @obj: the type * to use as a loop cursor for each entry @tmp: a &struct hlist_node used for temporary storage @member: the name of the hlist_node within the struct @key: the key of the objects to iterate over | |
#define | hash_for_each(name, bkt, obj, member) |
#define | hash_for_each_safe(name, bkt, tmp, obj, member) |
#define | hash_for_each_possible(name, obj, member, key) hlist_for_each_entry(obj, &name[hash_min(key, HASH_BITS(name))], member) |
#define | hash_for_each_possible_safe(name, obj, tmp, member, key) |
Functions | |
static void | __hash_init (struct hlist_head *ht, unsigned int sz) |
static bool | hash_hashed (struct hlist_node *node) |
hash_hashed - check whether an object is in any hashtable @node: the &struct hlist_node of the object to be checked More... | |
static bool | __hash_empty (struct hlist_head *ht, unsigned int sz) |
static void | hash_del (struct hlist_node *node) |
hash_del - remove an object from a hashtable @node: &struct hlist_node of the object to remove More... | |
#define DECLARE_HASHTABLE | ( | name, | |
bits | |||
) | struct hlist_head name[1 << (bits)] |
#define DEFINE_HASHTABLE | ( | name, | |
bits | |||
) |
#define hash_add | ( | hashtable, | |
node, | |||
key | |||
) | hlist_add_head(node, &hashtable[hash_min(key, HASH_BITS(hashtable))]) |
hash_add - add an object to a hashtable @hashtable: hashtable to add to @node: the &struct hlist_node of the object to be added @key: the key of the object to be added
#define hash_empty | ( | hashtable | ) | __hash_empty(hashtable, HASH_SIZE(hashtable)) |
hash_empty - check whether a hashtable is empty @hashtable: hashtable to check
This has to be a macro since HASH_BITS() will not work on pointers since it calculates the size during preprocessing.
#define hash_for_each | ( | name, | |
bkt, | |||
obj, | |||
member | |||
) |
#define hash_for_each_possible | ( | name, | |
obj, | |||
member, | |||
key | |||
) | hlist_for_each_entry(obj, &name[hash_min(key, HASH_BITS(name))], member) |
#define hash_for_each_possible_safe | ( | name, | |
obj, | |||
tmp, | |||
member, | |||
key | |||
) |
#define hash_for_each_safe | ( | name, | |
bkt, | |||
tmp, | |||
obj, | |||
member | |||
) |
#define hash_init | ( | hashtable | ) | __hash_init(hashtable, HASH_SIZE(hashtable)) |
hash_init - initialize a hash table @hashtable: hashtable to be initialized
Calculates the size of the hashtable from the given parameter, otherwise same as hash_init_size.
This has to be a macro since HASH_BITS() will not work on pointers since it calculates the size during preprocessing.
#define HASH_SIZE | ( | name | ) | (ARRAY_SIZE(name)) |
|
inlinestatic |
References hlist_empty().
|
inlinestatic |
References INIT_HLIST_HEAD.
|
inlinestatic |
hash_del - remove an object from a hashtable @node: &struct hlist_node of the object to remove
References hlist_del_init(), and node.
|
inlinestatic |
hash_hashed - check whether an object is in any hashtable @node: the &struct hlist_node of the object to be checked
References hlist_unhashed(), and node.