Symisc UnQLite

An Embeddable NoSQL Database Engine



UnQLite C/C++ API Reference - Output a message inside a foreign function.

Syntax


int unqlite_context_output(unqlite_context *pCtx,const char *zString,int nLen);

int unqlite_context_output_format(unqlite_context *pCtx,const char *zFormat,...);


Output a message inside a foreign function.


Description


These routines when invoked redirects the desired message to the installed VM Output Consumer Callback. That is, these routines emulate the Jx9 print language construct inside foreign functions.


Note that unqlite_context_output() accepts a third argument which is the length of the string to output. If the nLen argument is less than zero, then zString is read up to the first zero terminator. If nLen is non-negative, then it is the maximum number of bytes read from zString.


unqlite_context_output_format() is a work-alike of the "printf()" family of functions from the standard C library which is used to output a formatted string.


These routines accepts as their first argument a pointer to a unqlite_context which mean that they are designed to be invoked only from a foreign function.


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


Parameters


pCtx

Foreign function Call Context.


Return value


UNQLITE_OK is returned on success. Any other return value indicates failure.


Example


Compile this C file for a smart introduction to these interfaces.


See also


Installing Foreign Functions.



Symisc Systems
Copyright © Symisc Systems