Symisc Vedis

An Embeddable Datastore Engine



Vedis C/C++ API Reference - Array Type Processing.

Syntax


vedis_value * vedis_array_fetch(vedis_value *pArray,unsigned int nIndex);


Extract array entry using its index.


Description


This routine is used to extract an array entry value from a given Vedis array. 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.


If the given index does not refer to a valid entry then NULL is returned. Otherwise the entry value is returned on success. This value can be modified using one these interfaces and the change is immediately seen in the target array:


vedis_value_int()

vedis_value_int64()

vedis_value_bool()

vedis_value_null()

vedis_value_double()

vedis_value_string()

vedis_value_string_format()


Note: This routine is not thread-safe.


Parameters


pArray

vedis_value which must be of type array.

  nIndex

Index of the target record (Zero based indexes).


Return value


If the given key does not refer to a valid array record or the given vedis_value is not of type array then NULL is returned. Otherwise the entry value is returned on success.


Example


Compile this C file for a smart introduction to the array handling interfaces.


See also


vedis_array_insert, vedis_array_next_elem, vedis_array_walk.



Symisc Systems
Copyright © Symisc Systems