Strophe 0.12
XMPP client library
|
Hash tables. More...
Data Structures | |
struct | hashentry_t |
struct | hash_t |
struct | hash_iterator_t |
hash key iterator functions More... | |
Functions | |
hash_t * | hash_new (xmpp_ctx_t *ctx, int size, hash_free_func free_func) |
allocate and initialize a new hash table | |
hash_t * | hash_clone (hash_t *table) |
obtain a new reference to an existing hash table | |
void | hash_release (hash_t *table) |
release a hash table that is no longer needed | |
static int | _hash_key (hash_t *table, const char *key) |
hash a key for our table lookup | |
hashentry_t * | _hash_entry_find (hash_t *table, const char *key) |
int | hash_add (hash_t *table, const char *key, void *data) |
add a key, value pair to a hash table. | |
void * | hash_get (hash_t *table, const char *key) |
look up a key in a hash table | |
int | hash_drop (hash_t *table, const char *key) |
delete a key from a hash table | |
int | hash_num_keys (hash_t *table) |
return the number of keys in a hash | |
hash_iterator_t * | hash_iter_new (hash_t *table) |
allocate and initialize a new iterator | |
void | hash_iter_release (hash_iterator_t *iter) |
release an iterator that is no longer needed | |
const char * | hash_iter_next (hash_iterator_t *iter) |
return the next hash table key from the iterator. | |
Hash tables.
hash_t * hash_new | ( | xmpp_ctx_t * | ctx, |
int | size, | ||
hash_free_func | free_func | ||
) |
allocate and initialize a new hash table
hash_t * hash_clone | ( | hash_t * | table | ) |
obtain a new reference to an existing hash table
allocate a new reference to an existing hash table
void hash_release | ( | hash_t * | table | ) |
release a hash table that is no longer needed
release a hash table when no longer needed
|
static |
hash a key for our table lookup
hashentry_t * _hash_entry_find | ( | hash_t * | table, |
const char * | key | ||
) |
int hash_add | ( | hash_t * | table, |
const char * | key, | ||
void * | data | ||
) |
add a key, value pair to a hash table.
each key can appear only once; the value of any identical key will be replaced
void * hash_get | ( | hash_t * | table, |
const char * | key | ||
) |
look up a key in a hash table
int hash_drop | ( | hash_t * | table, |
const char * | key | ||
) |
delete a key from a hash table
int hash_num_keys | ( | hash_t * | table | ) |
return the number of keys in a hash
hash_iterator_t * hash_iter_new | ( | hash_t * | table | ) |
allocate and initialize a new iterator
void hash_iter_release | ( | hash_iterator_t * | iter | ) |
release an iterator that is no longer needed
const char * hash_iter_next | ( | hash_iterator_t * | iter | ) |
return the next hash table key from the iterator.
the returned key should not be freed