libdict
Data Structure C Library
Loading...
Searching...
No Matches
hashtable2.c File Reference
#include "hashtable2.h"
#include <string.h>
#include "dict_private.h"
#include "hashtable_common.h"
Include dependency graph for hashtable2.c:

Go to the source code of this file.

Data Structures

struct  hash_node
 
struct  hashtable2
 
struct  hashtable2_itor
 

Macros

#define LOADFACTOR_NUMERATOR   2
 
#define LOADFACTOR_DENOMINATOR   3
 

Functions

hashtable2hashtable2_new (dict_compare_func cmp_func, dict_hash_func hash_func, unsigned initial_size)
 
dicthashtable2_dict_new (dict_compare_func cmp_func, dict_hash_func hash_func, unsigned initial_size)
 
size_t hashtable2_free (hashtable2 *table, dict_delete_func delete_func)
 
dict_insert_result hashtable2_insert (hashtable2 *table, void *key)
 
void ** hashtable2_search (hashtable2 *table, const void *key)
 
dict_remove_result hashtable2_remove (hashtable2 *table, const void *key)
 
size_t hashtable2_clear (hashtable2 *table, dict_delete_func delete_func)
 
size_t hashtable2_traverse (hashtable2 *table, dict_visit_func visit, void *user_data)
 
size_t hashtable2_count (const hashtable2 *table)
 
size_t hashtable2_size (const hashtable2 *table)
 
size_t hashtable2_slots_used (const hashtable2 *table)
 
bool hashtable2_resize (hashtable2 *table, unsigned new_size)
 
bool hashtable2_verify (const hashtable2 *table)
 
hashtable2_itorhashtable2_itor_new (hashtable2 *table)
 
dict_itorhashtable2_dict_itor_new (hashtable2 *table)
 
void hashtable2_itor_free (hashtable2_itor *itor)
 
bool hashtable2_itor_valid (const hashtable2_itor *itor)
 
void hashtable2_itor_invalidate (hashtable2_itor *itor)
 
bool hashtable2_itor_next (hashtable2_itor *itor)
 
bool hashtable2_itor_prev (hashtable2_itor *itor)
 
bool hashtable2_itor_nextn (hashtable2_itor *itor, size_t count)
 
bool hashtable2_itor_prevn (hashtable2_itor *itor, size_t count)
 
bool hashtable2_itor_first (hashtable2_itor *itor)
 
bool hashtable2_itor_last (hashtable2_itor *itor)
 
bool hashtable2_itor_search (hashtable2_itor *itor, const void *key)
 
const void * hashtable2_itor_key (const hashtable2_itor *itor)
 
void ** hashtable2_itor_datum (hashtable2_itor *itor)
 
bool hashtable2_itor_remove (hashtable2_itor *itor)
 

Macro Definition Documentation

◆ LOADFACTOR_DENOMINATOR

#define LOADFACTOR_DENOMINATOR   3

Definition at line 40 of file hashtable2.c.

◆ LOADFACTOR_NUMERATOR

#define LOADFACTOR_NUMERATOR   2

Definition at line 39 of file hashtable2.c.

Function Documentation

◆ hashtable2_clear()

size_t hashtable2_clear ( hashtable2 * table,
dict_delete_func delete_func )

Definition at line 305 of file hashtable2.c.

◆ hashtable2_count()

size_t hashtable2_count ( const hashtable2 * table)

Definition at line 337 of file hashtable2.c.

◆ hashtable2_dict_itor_new()

dict_itor * hashtable2_dict_itor_new ( hashtable2 * table)

Definition at line 427 of file hashtable2.c.

Here is the call graph for this function:

◆ hashtable2_dict_new()

dict * hashtable2_dict_new ( dict_compare_func cmp_func,
dict_hash_func hash_func,
unsigned initial_size )

Definition at line 129 of file hashtable2.c.

Here is the call graph for this function:

◆ hashtable2_free()

size_t hashtable2_free ( hashtable2 * table,
dict_delete_func delete_func )

Definition at line 147 of file hashtable2.c.

Here is the call graph for this function:

◆ hashtable2_insert()

dict_insert_result hashtable2_insert ( hashtable2 * table,
void * key )

Definition at line 187 of file hashtable2.c.

Here is the call graph for this function:

◆ hashtable2_itor_datum()

void ** hashtable2_itor_datum ( hashtable2_itor * itor)

Definition at line 561 of file hashtable2.c.

◆ hashtable2_itor_first()

bool hashtable2_itor_first ( hashtable2_itor * itor)

Definition at line 508 of file hashtable2.c.

◆ hashtable2_itor_free()

void hashtable2_itor_free ( hashtable2_itor * itor)

Definition at line 441 of file hashtable2.c.

◆ hashtable2_itor_invalidate()

void hashtable2_itor_invalidate ( hashtable2_itor * itor)

Definition at line 456 of file hashtable2.c.

◆ hashtable2_itor_key()

const void * hashtable2_itor_key ( const hashtable2_itor * itor)

Definition at line 555 of file hashtable2.c.

◆ hashtable2_itor_last()

bool hashtable2_itor_last ( hashtable2_itor * itor)

Definition at line 521 of file hashtable2.c.

◆ hashtable2_itor_new()

hashtable2_itor * hashtable2_itor_new ( hashtable2 * table)

Definition at line 416 of file hashtable2.c.

◆ hashtable2_itor_next()

bool hashtable2_itor_next ( hashtable2_itor * itor)

Definition at line 462 of file hashtable2.c.

◆ hashtable2_itor_nextn()

bool hashtable2_itor_nextn ( hashtable2_itor * itor,
size_t count )

Definition at line 490 of file hashtable2.c.

Here is the call graph for this function:

◆ hashtable2_itor_prev()

bool hashtable2_itor_prev ( hashtable2_itor * itor)

Definition at line 476 of file hashtable2.c.

◆ hashtable2_itor_prevn()

bool hashtable2_itor_prevn ( hashtable2_itor * itor,
size_t count )

Definition at line 499 of file hashtable2.c.

Here is the call graph for this function:

◆ hashtable2_itor_remove()

bool hashtable2_itor_remove ( hashtable2_itor * itor)

Definition at line 567 of file hashtable2.c.

◆ hashtable2_itor_search()

bool hashtable2_itor_search ( hashtable2_itor * itor,
const void * key )

Definition at line 534 of file hashtable2.c.

◆ hashtable2_itor_valid()

bool hashtable2_itor_valid ( const hashtable2_itor * itor)

Definition at line 447 of file hashtable2.c.

◆ hashtable2_new()

hashtable2 * hashtable2_new ( dict_compare_func cmp_func,
dict_hash_func hash_func,
unsigned initial_size )

Definition at line 106 of file hashtable2.c.

Here is the call graph for this function:

◆ hashtable2_remove()

dict_remove_result hashtable2_remove ( hashtable2 * table,
const void * key )

Definition at line 282 of file hashtable2.c.

◆ hashtable2_resize()

bool hashtable2_resize ( hashtable2 * table,
unsigned new_size )

Definition at line 355 of file hashtable2.c.

Here is the call graph for this function:

◆ hashtable2_search()

void ** hashtable2_search ( hashtable2 * table,
const void * key )

Definition at line 203 of file hashtable2.c.

◆ hashtable2_size()

size_t hashtable2_size ( const hashtable2 * table)

Definition at line 343 of file hashtable2.c.

◆ hashtable2_slots_used()

size_t hashtable2_slots_used ( const hashtable2 * table)

Definition at line 349 of file hashtable2.c.

◆ hashtable2_traverse()

size_t hashtable2_traverse ( hashtable2 * table,
dict_visit_func visit,
void * user_data )

Definition at line 323 of file hashtable2.c.

◆ hashtable2_verify()

bool hashtable2_verify ( const hashtable2 * table)

Definition at line 399 of file hashtable2.c.