Symisc Vedis

An Embeddable Datastore Engine



Vedis C/C++ API Reference - Foreign Command auxiliary private data.

Syntax

int vedis_context_push_aux_data(vedis_context *pCtx,void *pUserData);

void * vedis_context_peek_aux_data(vedis_context *pCtx);

void * vedis_context_pop_aux_data(vedis_context *pCtx);


Push, Peek and Pop auxiliary private data of a user installed command.


Description


These interfaces are available to foreign commands in the case they need a stack for an arbitrary number of auxiliary private data perhaps to keep some state information.


The vedis_context_push_aux_data() routine pushes an arbitrary pointer in the auxiliary data stack.

The vedis_context_peek_aux_data() routine return the last pushed user pointer in the auxiliary data stack.

The vedis_context_pop_aux_data() pops and returns the last pushed user pointer in the auxiliary data stack.


These interfaces accepts as their first argument a pointer to a vedis_context which mean that they are designed to be invoked only from a foreign command. Also note that each registered foreign function have its own auxiliary data stack.


These routines must be called from the same thread in which the application-defined function is running.


Parameters


pCtx

 Foreign command call context.


Return value


vedis_context_push_aux_data() return VEDIS_OK if the pointer was successfully pushed on the stack. Any other return value indicates failure (Out of memory).


vedis_context_peek_aux_data() and vedis_context_pop_aux_data() return the last pushed user pointer in the auxiliary data stack or NULL if the stack is empty.


See also


vedis_register_command.



Symisc Systems
Copyright © Symisc Systems