Symisc Vedis

An Embeddable Datastore Engine



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

Syntax

int vedis_array_insert(vedis_value *pArray,vedis_value *pValue);


Populate a vedis array.


Description


This routine is used to populate a vedis array object. The given vedis_value (first argument) must be of type array obtained by a prior successful call to vedis_context_new_array(). Otherwise this routine return immediately with an error code.


The second argument to vedis_array_insert() is a vedis_value obtained by a prior successful call to vedis_context_new_scalar(), vedis_context_new_array() or passed as parameter to the foreign command.


The inserted record could be extracted later using vedis_array_fetch() or vedis_array_next_elem(). Note that if you want a null entry value, simply pass NULL.


Note: This routine make its own copy of the given value pair so it's safe to use the same vedis_value for other insertions.


Note: This routine is not thread-safe.


Parameters


pArray

vedis_value which must be of type array.

  pValue
vedis_value to be inserted.


Return value


VEDIS_OK is returned on successful insertion. Any other return value typically (VEDIS_CORRUPT or VEDIS_NOMEM) indicates failure.


Example


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


See also


vedis_array_walk, vedis_array_next_elem, vedis_array_fetch.



Symisc Systems
Copyright © Symisc Systems