nemea-common 1.6.3
Data Structures | Macros | Functions
cuckoo_hash_v2.h File Reference

Generic hash table with Cuckoo hashing support – header file. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  index_array_t
 
struct  cc_hash_table_v2_t
 

Macros

#define REHASH_FAILURE   -1
 
#define NOT_FOUND   -1
 

Functions

int ht_init_v2 (cc_hash_table_v2_t *new_table, unsigned int table_size, unsigned int data_size, unsigned int key_length)
 
int rehash_v2 (cc_hash_table_v2_t *ht)
 
void * ht_insert_v2 (cc_hash_table_v2_t *ht, char *key, const void *new_data)
 
void * ht_lock_insert_v2 (cc_hash_table_v2_t *ht, char *key, const void *new_data, void(*lock)(int), void(*unlock)(int))
 
void * ht_get_v2 (cc_hash_table_v2_t *ht, char *key)
 
int ht_get_index_v2 (cc_hash_table_v2_t *ht, char *key)
 
int ht_is_valid_v2 (cc_hash_table_v2_t *ht, char *key, int index)
 
void ht_remove_by_key_v2 (cc_hash_table_v2_t *ht, char *key)
 
void ht_remove_precomp_v2 (cc_hash_table_v2_t *ht, char *key, unsigned int h1, unsigned int h2, unsigned int h3)
 
void ht_clear_v2 (cc_hash_table_v2_t *ht)
 
void ht_destroy_v2 (cc_hash_table_v2_t *ht)
 

Detailed Description

Generic hash table with Cuckoo hashing support – header file.

Author
Roman Vrana, xvran.nosp@m.a20@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
Date
2013

Definition in file cuckoo_hash_v2.h.

Macro Definition Documentation

◆ NOT_FOUND

#define NOT_FOUND   -1

Constant return by index getter when an item is not found.

Definition at line 25 of file cuckoo_hash_v2.h.

◆ REHASH_FAILURE

#define REHASH_FAILURE   -1

Error constant returned by rehashing function when failing.

Definition at line 20 of file cuckoo_hash_v2.h.

Function Documentation

◆ ht_clear_v2()

void ht_clear_v2 ( cc_hash_table_v2_t * ht)

◆ ht_destroy_v2()

void ht_destroy_v2 ( cc_hash_table_v2_t * ht)

◆ ht_get_index_v2()

int ht_get_index_v2 ( cc_hash_table_v2_t * ht,
char * key )

◆ ht_get_v2()

void * ht_get_v2 ( cc_hash_table_v2_t * ht,
char * key )

◆ ht_init_v2()

int ht_init_v2 ( cc_hash_table_v2_t * new_table,
unsigned int table_size,
unsigned int data_size,
unsigned int key_length )

◆ ht_insert_v2()

void * ht_insert_v2 ( cc_hash_table_v2_t * ht,
char * key,
const void * new_data )

◆ ht_is_valid_v2()

int ht_is_valid_v2 ( cc_hash_table_v2_t * ht,
char * key,
int index )

◆ ht_lock_insert_v2()

void * ht_lock_insert_v2 ( cc_hash_table_v2_t * ht,
char * key,
const void * new_data,
void(*)(int) lock,
void(*)(int) unlock )

◆ ht_remove_by_key_v2()

void ht_remove_by_key_v2 ( cc_hash_table_v2_t * ht,
char * key )

◆ ht_remove_precomp_v2()

void ht_remove_precomp_v2 ( cc_hash_table_v2_t * ht,
char * key,
unsigned int h1,
unsigned int h2,
unsigned int h3 )

◆ rehash_v2()

int rehash_v2 ( cc_hash_table_v2_t * ht)