An Embeddable Datastore Engine |
Tweet |
Follow @Vedis |
Vedis C/C++ API Reference - Array Type Processing.
int vedis_array_reset(vedis_value *pArray);
vedis_value * vedis_array_next_elem(vedis_value *pArray);
Iterate over the elements of a given array.
Description
vedis_array_next_elem() return the current array entry pointed by the internal cursor and automatically advance it (i.e. the cursor) to the next element. Use the following interfaces to cast the object value returned by this interface to the desired type:
If
the array is empty or the end of the list is reached (i.e. No more entries to return) then this
interfaces return NULL instead. vedis_array_reset()
reset the internal cursor to point to the first array entry.
The vedis_value
must be of type array obtained by a prior successful call to vedis_context_new_array()
or passed as parameter to the foreign command.
Call vedis_value_is_array() to check if the given vedis_value is of the expected type.
Note: This routine is not thread-safe.
Parameters
pArray |
vedis_value to iterate over which must be of type array. |
Return value
Current array entry (vedis_value pointer) on success or NULL when no more entries.
Example
Compile this C file for a smart introduction to the array handling interfaces.
See also