RNAlib-2.6.3
 
Loading...
Searching...
No Matches
hash_tables.h File Reference

Implementations of hash table functions. More...

Go to the source code of this file.

Data Structures

struct  vrna_ht_entry_db_t
 Default hash table entry. More...
 

Functions

Dot-Bracket / Free Energy entries
int vrna_ht_db_comp (void *x, void *y)
 Default hash table entry comparison.
 
unsigned int vrna_ht_db_hash_func (void *x, unsigned long hashtable_size)
 Default hash function.
 
int vrna_ht_db_free_entry (void *hash_entry)
 Default function to free memory occupied by a hash entry.
 

Abstract interface

typedef struct vrna_hash_table_s * vrna_hash_table_t
 A hash table object.
 
typedef int(* vrna_ht_cmp_f) (void *x, void *y)
 Callback function to compare two hash table entries.
 
typedef unsigned int(* vrna_ht_hashfunc_f) (void *x, unsigned long hashtable_size)
 Callback function to generate a hash key, i.e. hash function.
 
typedef int(* vrna_ht_free_f) (void *x)
 Callback function to free a hash table entry.
 
vrna_hash_table_t vrna_ht_init (unsigned int b, vrna_ht_cmp_f compare_function, vrna_ht_hashfunc_f hash_function, vrna_ht_free_f free_hash_entry)
 Get an initialized hash table.
 
unsigned long vrna_ht_size (vrna_hash_table_t ht)
 Get the size of the hash table.
 
unsigned long vrna_ht_collisions (struct vrna_hash_table_s *ht)
 Get the number of collisions in the hash table.
 
void * vrna_ht_get (vrna_hash_table_t ht, void *x)
 Get an element from the hash table.
 
int vrna_ht_insert (vrna_hash_table_t ht, void *x)
 Insert an object into a hash table.
 
void vrna_ht_remove (vrna_hash_table_t ht, void *x)
 Remove an object from the hash table.
 
void vrna_ht_clear (vrna_hash_table_t ht)
 Clear the hash table.
 
void vrna_ht_free (vrna_hash_table_t ht)
 Free all memory occupied by the hash table.
 

Detailed Description

Implementations of hash table functions.