Name
dict_next — Fetch the next key/value pair
Synopsis
#include "ecdict.h"
| int **dict_next** (
| a, | |
| | i, | |
| | key, | |
| | val)
; | |
ECDict <var class="pdparam">a</var>
;
ECDict_Iterator * <var class="pdparam">i</var>
;
const char ** <var class="pdparam">key</var>
;
const char ** <var class="pdparam">val</var>
;
Description
If there is another key/value pair in the dictionary, fetch it.
- a
-
The ECDict. An ECDict is a typedef of an ec_hash_table.
- i
-
The iterator. An ECDict_Iterator is a typedef of an ec_hash_iter.
- key
-
The current key.
- val
-
The value associated with the
key
.
Returns 1
if there is a next key. Otherwise, 0
is returned. * key
points to the next key and * val
to the associated value.
Warning
When a key or value is returned, the memory is owned by the dictionary. Your memory can become invalid if something else removes an entry from the dictionary after you have queried it.
It is legal to call this function in any thread.