Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Hash Functions
[Core Library]


Functions

switch_status_t switch_core_hash_init (_Out_ switch_hash_t **hash, _In_ switch_memory_pool_t *pool)
 Initilize a hash table.
switch_status_t switch_core_hash_destroy (_Inout_ switch_hash_t **hash)
 Destroy an existing hash table.
switch_status_t switch_core_hash_insert (_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ const void *data)
 Insert data into a hash.
switch_status_t switch_core_hash_insert_locked (_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ const void *data, _In_ switch_mutex_t *mutex)
 Insert data into a hash.
switch_status_t switch_core_hash_delete (_In_ switch_hash_t *hash, _In_z_ const char *key)
 Delete data from a hash based on desired key.
switch_status_t switch_core_hash_delete_locked (_In_ switch_hash_t *hash, _In_z_ const char *key, _In_ switch_mutex_t *mutex)
 Delete data from a hash based on desired key.
void * switch_core_hash_find (_In_ switch_hash_t *hash, _In_z_ const char *key)
 Retrieve data from a given hash.
void * switch_core_hash_find_locked (_In_ switch_hash_t *hash, _In_z_ const char *key, _In_ switch_mutex_t *mutex)
 Retrieve data from a given hash.
switch_hash_index_tswitch_hash_first (char *depricate_me, _In_ switch_hash_t *hash)
switch_hash_index_tswitch_hash_next (_In_ switch_hash_index_t *hi)
void switch_hash_this (_In_ switch_hash_index_t *hi, _Out_opt_ptrdiff_cap_(klen) const void **key, _Out_opt_ switch_ssize_t *klen, _Out_ void **val)


Function Documentation

switch_status_t switch_core_hash_delete _In_ switch_hash_t hash,
_In_z_ const char *  key
 

Delete data from a hash based on desired key.

Parameters:
hash the hash to delete from
key the key from which to delete the data
Returns:
SWITCH_STATUS_SUCCESS if the data is deleted

switch_status_t switch_core_hash_delete_locked _In_ switch_hash_t hash,
_In_z_ const char *  key,
_In_ switch_mutex_t mutex
 

Delete data from a hash based on desired key.

Parameters:
hash the hash to delete from
key the key from which to delete the data
mutex optional mutex to lock
Returns:
SWITCH_STATUS_SUCCESS if the data is deleted

switch_status_t switch_core_hash_destroy _Inout_ switch_hash_t **  hash  ) 
 

Destroy an existing hash table.

Parameters:
hash the hash to destroy
Returns:
SWITCH_STATUS_SUCCESS if the hash is destroyed

void* switch_core_hash_find _In_ switch_hash_t hash,
_In_z_ const char *  key
 

Retrieve data from a given hash.

Parameters:
hash the hash to retrieve from
key the key to retrieve
Returns:
a pointer to the data held in the key

void* switch_core_hash_find_locked _In_ switch_hash_t hash,
_In_z_ const char *  key,
_In_ switch_mutex_t mutex
 

Retrieve data from a given hash.

Parameters:
hash the hash to retrieve from
key the key to retrieve
mutex optional mutex to lock
Returns:
a pointer to the data held in the key

switch_status_t switch_core_hash_init _Out_ switch_hash_t **  hash,
_In_ switch_memory_pool_t pool
 

Initilize a hash table.

Parameters:
hash a NULL pointer to a hash table to aim at the new hash
pool the pool to use for the new hash
Returns:
SWITCH_STATUS_SUCCESS if the hash is created

switch_status_t switch_core_hash_insert _In_ switch_hash_t hash,
_In_z_ const char *  key,
_In_opt_ const void *  data
 

Insert data into a hash.

Parameters:
hash the hash to add data to
key the name of the key to add the data to
data the data to add
Returns:
SWITCH_STATUS_SUCCESS if the data is added
Note:
the string key must be a constant or a dynamic string

switch_status_t switch_core_hash_insert_locked _In_ switch_hash_t hash,
_In_z_ const char *  key,
_In_opt_ const void *  data,
_In_ switch_mutex_t mutex
 

Insert data into a hash.

Parameters:
hash the hash to add data to
key the name of the key to add the data to
data the data to add
mutex optional mutex to lock
Returns:
SWITCH_STATUS_SUCCESS if the data is added
Note:
the string key must be a constant or a dynamic string

switch_hash_index_t* switch_hash_first char *  depricate_me,
_In_ switch_hash_t hash
 

switch_hash_index_t* switch_hash_next _In_ switch_hash_index_t hi  ) 
 

void switch_hash_this _In_ switch_hash_index_t hi,
_Out_opt_ptrdiff_cap_(klen) const void **  key,
_Out_opt_ switch_ssize_t klen,
_Out_ void **  val
 


Generated on Fri Oct 10 11:24:33 2008 for FreeSWITCH by  doxygen 1.3.9.1