Go to the source code of this file.
Data Structures | |
struct | CHTbl_ |
Data structure that defines a linked hash table. More... | |
struct | CHTbl_handle_ |
Data structure that defines one element within a hash table. This structure is used by the function chtbl_next(). More... | |
Defines | |
#define | REWIND_HASH 0 |
This value is used by the function chtbl_next(). It tells the function to set the hash pointer to the first element of the hash. | |
#define | CURRENT_HASH 1 |
This value is used by the function chtbl_next(). It tells the function to set the hash pointer to the current element of the hash. | |
#define | chtbl_size(htab) ((htab)->taille) |
Typedefs | |
typedef CHTbl_handle_ | CHTbl_handle |
Data structure that defines one element within a hash table. This structure is used by the function chtbl_next(). | |
typedef CHTbl_ | CHTbl |
Data structure that defines a linked hash table. | |
Functions | |
int | chtbl_init (CHTbl *htab, int conteneurs, int(*h)(const void *cle), int(*corresp)(const void *cle1, const void *cle2), void(*detruire)(void *donnee)) |
Initialize the hash table. This function must be called first. | |
void | chtbl_destroy (CHTbl *htab) |
Free all memory allocated for the hash table. | |
int | chtbl_insert (CHTbl *htab, const void *donnee) |
Insert data into the hash table. | |
int | chtbl_remove (CHTbl *htab, void **donnee) |
Remove a record from the hash table. | |
int | chtbl_lookup (const CHTbl *htab, void **donnee) |
Searh the hash table for a given data. | |
int | chtbl_find (const CHTbl *htab, void **donnee) |
Cover the entire hash table in search for an given element. | |
void * | chtbl_next (CHTbl *htab, int rewind) |
Returns the next element of a given linked list. |
Definition in file chtbl.h.
|
Free all memory allocated for the hash table.
Definition at line 66 of file chtbl.c. References CHTbl_::conteneurs, list_destroy(), and CHTbl_::table. Referenced by replace_tags(). |
|
Cover the entire hash table in search for an given element.
Definition at line 255 of file chtbl.c. References CHTbl_::conteneurs, CHTbl_::corresp, list_data, list_head, list_next, and CHTbl_::table. |
|
Initialize the hash table. This function must be called first.
Definition at line 23 of file chtbl.c. References CHTbl_::conteneurs, CHTbl_::corresp, CHTbl_::detruire, CHTbl_::h, list_init(), CHTbl_::table, and CHTbl_::taille. Referenced by replace_tags(). |
|
Insert data into the hash table.
Definition at line 108 of file chtbl.c. References chtbl_lookup(), CHTbl_::conteneurs, CHTbl_::h, list_ins_next(), CHTbl_::table, and CHTbl_::taille. Referenced by replace_tags(). |
|
Searh the hash table for a given data.
Definition at line 203 of file chtbl.c. References CHTbl_::conteneurs, CHTbl_::corresp, CHTbl_::h, list_data, list_head, list_next, and CHTbl_::table. Referenced by chtbl_insert(), and replace_tags(). |
|
Returns the next element of a given linked list.
Definition at line 310 of file chtbl.c. References CHTbl_::conteneurs, list_data, list_head, list_next, CHTbl_::pointer, REWIND_HASH, and CHTbl_::table. |
|
Remove a record from the hash table.
Definition at line 150 of file chtbl.c. References CHTbl_::conteneurs, CHTbl_::h, list_find(), list_rem_next(), CHTbl_::table, and CHTbl_::taille. |