Vedis C/C++ API Reference - Array Type Processing.
int (*xWalk)(vedis_value *pEntry,void *pUserData),
Iterate over the elements of a given array and invoke the supplied callback for each entry.
This routine iterate over the elements of a given array and invokes the supplied walker callback for each entry. The first argument (pArray) must be of type array obtained by a prior successful call to vedis_context_new_array() or passed as parameter to the foreign command. Otherwise, this routine return immediately and the walk process could not be done.
The most interesting parameter is the walker callback (xWalk()) which is a user defined function that is invoked for each array entry. The callback must accept two arguments. The first argument is the entry value which could be any type even others arrays and the last argument is a copy of the third argument to this function which is forwarded verbatim by engine.
The callback must return VEDIS_OK. Otherwise the walk process is aborted and this function return VEDIS_ABORT.
The entry value could be extracted inside the callback using these interfaces:
Note: This routine is not thread-safe.
vedis_value which must be of type array.
Arbitrary user pointer which is forwarded verbatim by the engine to the walker callback as its third argument.
VEDIS_OK is returned on success. Any other return value typically (VEDIS_ABORT) indicates failure.
Compile this C file for a smart introduction to the array handling interfaces.