hashtable.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "hashtable.h"
#include "linked_list.h"
#include "log.h"
#include "common.h"
#include "collection.h"
#include "thread.h"
#include "util.h"
#include "config.h"

Go to the source code of this file.

Defines

#define CP_HASHTABLE_MULTIPLE_VALUES   1
#define CP_CHAR_UC(x)   ((x) >= 'a' && (x) <= 'z' ? ((x) - 'a' + 'A') : (x))

Functions

unsigned long cp_hashtable_choose_size (unsigned long size_request)
cp_hashtablecp_hashtable_create (unsigned long size_hint, cp_hashfunction hash_fn, cp_compare_fn compare_fn)
cp_hashtablecp_hashtable_create_copy_mode (unsigned long size_hint, cp_hashfunction hash_fn, cp_compare_fn compare_fn, cp_copy_fn copy_key, cp_destructor_fn free_key, cp_copy_fn copy_value, cp_destructor_fn free_value)
cp_hashtablecp_hashtable_create_by_option (int mode, unsigned long size_hint, cp_hashfunction hash_fn, cp_compare_fn compare_fn, cp_copy_fn copy_key, cp_destructor_fn free_key, cp_copy_fn copy_value, cp_destructor_fn free_value)
cp_hashtable_entrycp_hashtable_create_entry (cp_hashtable *table, int mode, void *key, void *value, long hashcode)
void cp_hashtable_destroy (cp_hashtable *table)
void cp_hashtable_destroy_deep (cp_hashtable *table)
void cp_hashtable_destroy_custom (cp_hashtable *table, cp_destructor_fn dk, cp_destructor_fn dv)
void cp_hashtable_destroy_shallow (cp_hashtable *table)
int cp_hashtable_lock_internal (cp_hashtable *table, int type)
int cp_hashtable_unlock_internal (cp_hashtable *table)
int cp_hashtable_txlock (cp_hashtable *table, int type)
int cp_hashtable_txunlock (cp_hashtable *table)
int cp_hashtable_lock (cp_hashtable *table, int type)
int cp_hashtable_unlock (cp_hashtable *table)
int cp_hashtable_set_mode (cp_hashtable *table, int mode)
int cp_hashtable_get_mode (cp_hashtable *table)
int cp_hashtable_unset_mode (cp_hashtable *table, int mode)
void * lookup_internal (cp_hashtable *table, void *key, long code, int option, int resize)
void * cp_hashtable_get_by_option (cp_hashtable *table, void *key, int option)
void * cp_hashtable_resize_thread (void *tbl)
int cp_hashtable_set_min_size (cp_hashtable *table, int min_size)
int cp_hashtable_set_max_fill_factor (cp_hashtable *table, int fill_factor)
int cp_hashtable_set_min_fill_factor (cp_hashtable *table, int fill_factor)
void * cp_hashtable_resize (cp_hashtable *table, long new_size)
void * cp_hashtable_resize_nosync (cp_hashtable *table, unsigned long new_size)
void * cp_hashtable_put (cp_hashtable *table, void *key, void *value)
void * cp_hashtable_put_safe (cp_hashtable *table, void *key, void *value)
void * cp_hashtable_put_copy (cp_hashtable *table, void *key, void *value)
void * cp_hashtable_put_by_option (cp_hashtable *table, void *key, void *value, int option)
void * cp_hashtable_remove_internal (cp_hashtable *table, void *key, long code, int mode, int resize)
void * cp_hashtable_remove_by_mode (cp_hashtable *table, void *key, int mode)
int cp_hashtable_remove_all (cp_hashtable *table)
void * cp_hashtable_remove (cp_hashtable *table, void *key)
int cp_hashtable_remove_deep (cp_hashtable *table, void *key)
int cp_hashtable_contains (cp_hashtable *table, void *key)
void * cp_hashtable_get (cp_hashtable *table, void *key)
void ** cp_hashtable_get_keys (cp_hashtable *table)
unsigned long cp_hashtable_count (cp_hashtable *table)
void ** cp_hashtable_get_values (cp_hashtable *table)
unsigned long cp_hash_int (void *i)
int cp_hash_compare_int (void *i, void *j)
unsigned long cp_hash_long (void *l)
int cp_hash_compare_long (void *i, void *j)
unsigned long cp_hash_addr (void *addr)
int cp_hash_compare_addr (void *a1, void *a2)
unsigned long cp_hash_string (void *str)
int cp_hash_compare_string (void *s1, void *s2)
unsigned long cp_hash_istring (void *str)
int cp_hash_compare_istring (void *s1, void *s2)
void * cp_hash_copy_string (void *element)
unsigned long cp_hash_float (void *addr)
int cp_hash_compare_float (void *a1, void *a2)
unsigned long cp_hash_double (void *d)
int cp_hash_compare_double (void *a1, void *a2)


Detailed Description

Implementation of generic synchronized cp_hashtable.

The elements are stored in cp_list_entry objects.

Definition in file hashtable.c.


Generated on Mon Dec 5 23:00:22 2011 for cprops by  doxygen 1.4.7