|
QUARK
0.9.0
QUARK-QUeuingAndRuntimeforKernels
|

Go to the source code of this file.
Data Types | |
| struct | icl_entry_s |
| struct | icl_hash_s |
Macros | |
| #define | icl_hash_foreach(ht, tmpint, tmpent, kp, dp) |
Typedefs | |
| typedef struct icl_entry_s | icl_entry_t |
| typedef struct icl_hash_s | icl_hash_t |
Functions/Subroutines | |
| icl_hash_t * | icl_hash_create (int nbuckets, unsigned int(*hash_function)(void *), int(*hash_key_compare)(void *, void *)) |
| void * | icl_hash_find (icl_hash_t *, void *) |
| icl_entry_t * | icl_hash_insert (icl_hash_t *, void *, void *) |
| icl_entry_t * | icl_hash_update_insert (icl_hash_t *, void *, void *, void **) |
| int | icl_hash_destroy (icl_hash_t *, void(*)(void *), void(*)(void *)) |
| int | icl_hash_dump (FILE *, icl_hash_t *) |
| int | icl_hash_delete (icl_hash_t *ht, void *key, void(*free_key)(void *), void(*free_data)(void *)) |
Header file for icl_hash routines.
Definition in file icl_hash.h.
| #define icl_hash_foreach | ( | ht, | |
| tmpint, | |||
| tmpent, | |||
| kp, | |||
| dp | |||
| ) |
Definition at line 48 of file icl_hash.h.
| typedef struct icl_entry_s icl_entry_t |
| typedef struct icl_hash_s icl_hash_t |
| icl_hash_t* icl_hash_create | ( | int | nbuckets, |
| unsigned int(*)(void *) | hash_function, | ||
| int(*)(void *, void *) | hash_key_compare | ||
| ) |
Create a new hash table.
| [in] | nbuckets | – number of buckets to create |
| [in] | hash_function | – pointer to the hashing function to be used |
| [in] | hash_key_compare | – pointer to the hash key comparison function to be used |
Definition at line 73 of file icl_hash.c.
References icl_hash_s::buckets, icl_hash_s::hash_function, icl_hash_s::hash_key_compare, icl_hash_s::nbuckets, and icl_hash_s::nentries.

| int icl_hash_delete | ( | icl_hash_t * | ht, |
| void * | key, | ||
| void(*)(void *) | free_key, | ||
| void(*)(void *) | free_data | ||
| ) |
Free one hash table entry located by key (key and data are freed using functions).
| ht | – the hash table to be freed |
| key | – the key of the new item |
| free_key | – pointer to function that frees the key |
| free_data | – pointer to function that frees the data |
Definition at line 227 of file icl_hash.c.
References icl_hash_s::buckets, icl_entry_s::data, icl_hash_s::hash_function, icl_hash_s::hash_key_compare, icl_entry_s::key, icl_hash_s::nbuckets, icl_hash_s::nentries, and icl_entry_s::next.
| int icl_hash_destroy | ( | icl_hash_t * | , |
| void(*)(void *) | , | ||
| void(*)(void *) | |||
| ) |
| int icl_hash_dump | ( | FILE * | stream, |
| icl_hash_t * | ht | ||
| ) |
Dump the hash table's contents to the given file pointer.
| stream | – the file to which the hash table should be dumped |
| ht | – the hash table to be dumped |
Definition at line 300 of file icl_hash.c.
References icl_hash_s::buckets, icl_entry_s::data, icl_entry_s::key, icl_hash_s::nbuckets, and icl_entry_s::next.
| void* icl_hash_find | ( | icl_hash_t * | ht, |
| void * | key | ||
| ) |
Search for an entry in a hash table.
| ht | – the hash table to be searched |
| key | – the key of the item to search for |
Definition at line 108 of file icl_hash.c.
References icl_hash_s::buckets, icl_entry_s::data, icl_hash_s::hash_function, icl_hash_s::hash_key_compare, icl_entry_s::key, icl_hash_s::nbuckets, and icl_entry_s::next.

| icl_entry_t* icl_hash_insert | ( | icl_hash_t * | , |
| void * | , | ||
| void * | |||
| ) |
| icl_entry_t * icl_hash_update_insert | ( | icl_hash_t * | ht, |
| void * | key, | ||
| void * | data, | ||
| void ** | olddata | ||
| ) |
Replace entry in hash table with the given entry.
| ht | – the hash table |
| key | – the key of the new item |
| data | – pointer to the new item's data |
| olddata | – pointer to the old item's data (set upon return) |
Definition at line 175 of file icl_hash.c.
References icl_hash_s::buckets, icl_entry_s::data, icl_hash_s::hash_function, icl_hash_s::hash_key_compare, icl_entry_s::key, icl_hash_s::nbuckets, icl_hash_s::nentries, and icl_entry_s::next.