echash_next

March 26, 2020 Contributors

Name

echash_next — Move to the next item in the hash table

Synopsis

#include "echash.h"

| int **echash_next** ( | h, |   |
|   | iter, |   |
|   | k, |   |
|   | klen, |   |
|   | data); |   |

ec_hash_table * <var class="pdparam">h</var>;
ec_hash_iter * <var class="pdparam">iter</var>;
const char ** <var class="pdparam">k</var>;
int * <var class="pdparam">klen</var>;
void ** <var class="pdparam">data</var>;

Description

Move to the next item found after the specified key. If a next item exists, the data associated with this position is found in * data.

Note

Do not write to a hash table while iterating over its contents.

Parameters

h

The hash table

iter

The hash iterator. For a description of this struct see ec_hash_iter.

k

The key.

klen

The length of the key k.

data

Upon successful execution data * contains the the data associated with the next key.

Return Values

On success this function returns 1.

Threading

It is legal to call this function in any thread.

Warning

When a key or value is returned, the memory is owned by the hash table. Your memory can become invalid if something else removes an entry from the table after you have queried it.

The hash table data structure is not thread safe; any simultaneous access needs to be coordinated by the API consumer.

See Also

“ec_hash_iter”