RTS API Documentation
1.10.11
|
#include "switch.h"
Go to the source code of this file.
Macros | |
#define | switch_hashtable_insert(_h, _k, _v, _f) switch_hashtable_insert_destructor(_h, _k, _v, _f, NULL) |
#define | DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) |
#define | DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) |
#define | DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) |
#define | switch_hashtable_first(_h) switch_hashtable_first_iter(_h, NULL) |
Typedefs | |
typedef struct switch_hashtable | switch_hashtable_t |
typedef struct switch_hashtable_iterator | switch_hashtable_iterator_t |
Enumerations | |
enum | hashtable_flag_t { HASHTABLE_FLAG_NONE = 0, HASHTABLE_FLAG_FREE_KEY = (1 << 0), HASHTABLE_FLAG_FREE_VALUE = (1 << 1), HASHTABLE_DUP_CHECK = (1 << 2) } |
#define DEFINE_HASHTABLE_INSERT | ( | fnname, | |
keytype, | |||
valuetype | |||
) |
Definition at line 130 of file switch_hashtable.h.
#define DEFINE_HASHTABLE_REMOVE | ( | fnname, | |
keytype, | |||
valuetype | |||
) |
Definition at line 166 of file switch_hashtable.h.
#define DEFINE_HASHTABLE_SEARCH | ( | fnname, | |
keytype, | |||
valuetype | |||
) |
Definition at line 148 of file switch_hashtable.h.
#define switch_hashtable_first | ( | _h | ) | switch_hashtable_first_iter(_h, NULL) |
Definition at line 196 of file switch_hashtable.h.
#define switch_hashtable_insert | ( | _h, | |
_k, | |||
_v, | |||
_f | |||
) | switch_hashtable_insert_destructor(_h, _k, _v, _f, NULL) |
Definition at line 128 of file switch_hashtable.h.
typedef struct switch_hashtable_iterator switch_hashtable_iterator_t |
Definition at line 25 of file switch_hashtable.h.
typedef struct switch_hashtable switch_hashtable_t |
Definition at line 24 of file switch_hashtable.h.
enum hashtable_flag_t |
Enumerator | |
---|---|
HASHTABLE_FLAG_NONE | |
HASHTABLE_FLAG_FREE_KEY | |
HASHTABLE_FLAG_FREE_VALUE | |
HASHTABLE_DUP_CHECK |
Definition at line 119 of file switch_hashtable.h.
switch_status_t switch_create_hashtable | ( | switch_hashtable_t ** | hp, |
unsigned int | minsize, | ||
unsigned int(*)(void *) | hashfunction, | ||
int(*)(void *, void *) | key_eq_fn | ||
) |
Definition at line 56 of file switch_hashtable.c.
References switch_hashtable::entrycount, switch_hashtable::eqfn, entry::h, switch_frame_geometry::h, switch_hashtable::hashfn, switch_hashtable::loadlimit, memset(), prime_table_length, switch_hashtable::primeindex, primes, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_hashtable::table, and switch_hashtable::tablelength.
Referenced by switch_core_hash_init_case(), and switch_core_inthash_init().
|
inlinestatic |
Definition at line 224 of file switch_hashtable.h.
References hash.
Referenced by switch_core_hash_init_case().
|
inlinestatic |
Definition at line 238 of file switch_hashtable.h.
References hash, and switch_tolower().
Referenced by switch_core_hash_init_case().
|
inlinestatic |
Definition at line 201 of file switch_hashtable.h.
Referenced by switch_core_inthash_init().
|
inlinestatic |
Definition at line 214 of file switch_hashtable.h.
Referenced by switch_core_hash_init_case().
|
inlinestatic |
Definition at line 219 of file switch_hashtable.h.
Referenced by switch_core_hash_init_case().
|
inlinestatic |
Definition at line 209 of file switch_hashtable.h.
Referenced by switch_core_inthash_init().
unsigned int switch_hashtable_count | ( | switch_hashtable_t * | h | ) |
void switch_hashtable_destroy | ( | switch_hashtable_t ** | h | ) |
Definition at line 253 of file switch_hashtable.c.
References entry::destructor, entry::flags, freekey, entry::h, HASHTABLE_FLAG_FREE_KEY, HASHTABLE_FLAG_FREE_VALUE, entry::k, entry::next, switch_safe_free, and entry::v.
Referenced by switch_core_hash_destroy(), and switch_core_inthash_destroy().
switch_hashtable_iterator_t* switch_hashtable_first_iter | ( | switch_hashtable_t * | h, |
switch_hashtable_iterator_t * | it | ||
) |
Definition at line 316 of file switch_hashtable.c.
References switch_hashtable_iterator::e, entry::h, switch_hashtable_iterator::h, switch_hashtable_iterator::pos, switch_assert, switch_hashtable_next(), and switch_zmalloc.
Referenced by switch_core_hash_first_iter().
int switch_hashtable_insert_destructor | ( | switch_hashtable_t * | h, |
void * | k, | ||
void * | v, | ||
hashtable_flag_t | flags, | ||
hashtable_destructor_t | destructor | ||
) |
Definition at line 194 of file switch_hashtable.c.
References _switch_hashtable_remove(), entry::destructor, entry::flags, entry::h, hash, HASHTABLE_DUP_CHECK, hashtable_expand(), index, indexFor(), entry::k, entry::next, SWITCH_DECLARE, and entry::v.
Referenced by switch_core_hash_insert_alloc_destructor(), switch_core_hash_insert_auto_free(), switch_core_hash_insert_destructor(), switch_core_hash_insert_dup_auto_free(), switch_core_hash_insert_dup_destructor(), switch_core_hash_insert_pointer(), and switch_core_inthash_insert().
switch_hashtable_iterator_t* switch_hashtable_next | ( | switch_hashtable_iterator_t ** | iP | ) |
Definition at line 283 of file switch_hashtable.c.
References switch_hashtable_iterator::e, switch_hashtable_iterator::h, entry::next, switch_hashtable_iterator::pos, switch_hashtable::table, and switch_hashtable::tablelength.
Referenced by switch_core_hash_next(), and switch_hashtable_first_iter().
void* switch_hashtable_remove | ( | switch_hashtable_t * | h, |
void * | k | ||
) |
Definition at line 244 of file switch_hashtable.c.
References _switch_hashtable_remove(), entry::h, hash, indexFor(), entry::k, and SWITCH_DECLARE.
Referenced by switch_core_hash_delete(), and switch_core_inthash_delete().
void* switch_hashtable_search | ( | switch_hashtable_t * | h, |
void * | k | ||
) |
Definition at line 227 of file switch_hashtable.c.
References entry::h, hash, index, indexFor(), entry::k, entry::next, SWITCH_DECLARE, and entry::v.
Referenced by switch_core_hash_find(), and switch_core_inthash_find().
void switch_hashtable_this | ( | switch_hashtable_iterator_t * | i, |
const void ** | key, | ||
switch_ssize_t * | klen, | ||
void ** | val | ||
) |
Definition at line 342 of file switch_hashtable.c.
References switch_hashtable_iterator::e, entry::k, and entry::v.
Referenced by switch_core_hash_this().
void switch_hashtable_this_val | ( | switch_hashtable_iterator_t * | i, |
void * | val | ||
) |
Definition at line 335 of file switch_hashtable.c.
References switch_hashtable_iterator::e, and entry::v.
Referenced by switch_core_hash_this_val().