#ifndef _UNQLITE_H_
#define _UNQLITE_H_
#include <stdarg.h>
#define UNQLITE_VERSION "1.1.7"
#define UNQLITE_VERSION_NUMBER 1001007
#define UNQLITE_SIG "unqlite/1.1.7"
#define UNQLITE_IDENT "unqlite:b172a1e2c3f62fb35c8e1fb2795121f82356cad6"
#define UNQLITE_COPYRIGHT "Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine <chm@symisc.net>] 2012-2016, http://unqlite.org/"
typedef struct unqlite_io_methods unqlite_io_methods;
typedef struct unqlite_kv_methods unqlite_kv_methods;
typedef struct unqlite_kv_engine unqlite_kv_engine;
typedef struct jx9_io_stream unqlite_io_stream;
typedef struct jx9_context unqlite_context;
typedef struct jx9_value unqlite_value;
typedef struct unqlite_vfs unqlite_vfs;
typedef struct unqlite_vm unqlite_vm;
typedef struct unqlite unqlite;
#if !defined(SYMISC_STANDARD_DEFS)
#define SYMISC_STANDARD_DEFS
#if defined (_WIN32) || defined (WIN32) || defined(__MINGW32__) || defined (_MSC_VER) || defined (_WIN32_WCE)
#if !defined(__WINNT__)
#define __WINNT__
#endif
#if defined(_WIN32_WCE)
#ifndef __WIN_CE__
#define __WIN_CE__
#endif
#endif
#else
#if !defined(OS_OTHER)
#if !defined(__UNIXES__)
#define __UNIXES__
#endif
#else
#endif
#endif
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef signed __int64 sxi64;
typedef unsigned __int64 sxu64;
#else
typedef signed long long int sxi64;
typedef unsigned long long int sxu64;
#endif
typedef int (*ProcConsumer)(const void *, unsigned int, void *);
typedef struct SyMutexMethods SyMutexMethods;
typedef struct SyMemMethods SyMemMethods;
typedef struct SyString SyString;
typedef struct syiovec syiovec;
typedef struct SyMutex SyMutex;
typedef struct Sytm Sytm;
struct syiovec
{
#if defined (__WINNT__)
unsigned long nLen;
char *pBase;
#else
void *pBase;
unsigned long nLen;
#endif
};
struct SyString
{
const char *zString;
unsigned int nByte;
};
struct Sytm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
char *tm_zone;
long tm_gmtoff;
};
#define STRUCT_TM_TO_SYTM(pTM, pSYTM) \
(pSYTM)->tm_hour = (pTM)->tm_hour;\
(pSYTM)->tm_min = (pTM)->tm_min;\
(pSYTM)->tm_sec = (pTM)->tm_sec;\
(pSYTM)->tm_mon = (pTM)->tm_mon;\
(pSYTM)->tm_mday = (pTM)->tm_mday;\
(pSYTM)->tm_year = (pTM)->tm_year + 1900;\
(pSYTM)->tm_yday = (pTM)->tm_yday;\
(pSYTM)->tm_wday = (pTM)->tm_wday;\
(pSYTM)->tm_isdst = (pTM)->tm_isdst;\
(pSYTM)->tm_gmtoff = 0;\
(pSYTM)->tm_zone = 0;
#define SYSTEMTIME_TO_SYTM(pSYSTIME, pSYTM) \
(pSYTM)->tm_hour = (pSYSTIME)->wHour;\
(pSYTM)->tm_min = (pSYSTIME)->wMinute;\
(pSYTM)->tm_sec = (pSYSTIME)->wSecond;\
(pSYTM)->tm_mon = (pSYSTIME)->wMonth - 1;\
(pSYTM)->tm_mday = (pSYSTIME)->wDay;\
(pSYTM)->tm_year = (pSYSTIME)->wYear;\
(pSYTM)->tm_yday = 0;\
(pSYTM)->tm_wday = (pSYSTIME)->wDayOfWeek;\
(pSYTM)->tm_gmtoff = 0;\
(pSYTM)->tm_isdst = -1;\
(pSYTM)->tm_zone = 0;
struct SyMemMethods
{
void * (*xAlloc)(unsigned int);
void * (*xRealloc)(void *, unsigned int);
void (*xFree)(void *);
unsigned int (*xChunkSize)(void *);
int (*xInit)(void *);
void (*xRelease)(void *);
void *pUserData;
};
typedef int (*ProcMemError)(void *);
struct SyMutexMethods
{
int (*xGlobalInit)(void);
void (*xGlobalRelease)(void);
SyMutex * (*xNew)(int);
void (*xRelease)(SyMutex *);
void (*xEnter)(SyMutex *);
int (*xTryEnter)(SyMutex *);
void (*xLeave)(SyMutex *);
};
#if defined (_MSC_VER) || defined (__MINGW32__) || defined (__GNUC__) && defined (__declspec)
#define SX_APIIMPORT __declspec(dllimport)
#define SX_APIEXPORT __declspec(dllexport)
#else
#define SX_APIIMPORT
#define SX_APIEXPORT
#endif
#define SXRET_OK 0
#define SXERR_MEM (-1)
#define SXERR_IO (-2)
#define SXERR_EMPTY (-3)
#define SXERR_LOCKED (-4)
#define SXERR_ORANGE (-5)
#define SXERR_NOTFOUND (-6)
#define SXERR_LIMIT (-7)
#define SXERR_MORE (-8)
#define SXERR_INVALID (-9)
#define SXERR_ABORT (-10)
#define SXERR_EXISTS (-11)
#define SXERR_SYNTAX (-12)
#define SXERR_UNKNOWN (-13)
#define SXERR_BUSY (-14)
#define SXERR_OVERFLOW (-15)
#define SXERR_WILLBLOCK (-16)
#define SXERR_NOTIMPLEMENTED (-17)
#define SXERR_EOF (-18)
#define SXERR_PERM (-19)
#define SXERR_NOOP (-20)
#define SXERR_FORMAT (-21)
#define SXERR_NEXT (-22)
#define SXERR_OS (-23)
#define SXERR_CORRUPT (-24)
#define SXERR_CONTINUE (-25)
#define SXERR_NOMATCH (-26)
#define SXERR_RESET (-27)
#define SXERR_DONE (-28)
#define SXERR_SHORT (-29)
#define SXERR_PATH (-30)
#define SXERR_TIMEOUT (-31)
#define SXERR_BIG (-32)
#define SXERR_RETRY (-33)
#define SXERR_IGNORE (-63)
#endif
#define UNQLITE_APIEXPORT SX_APIEXPORT
#ifdef UNQLITE_OMIT_FLOATING_POINT
typedef sxi64 uqlite_real;
#else
typedef double unqlite_real;
#endif
typedef sxi64 unqlite_int64;
#define UNQLITE_OK SXRET_OK
#define UNQLITE_NOMEM SXERR_MEM
#define UNQLITE_ABORT SXERR_ABORT
#define UNQLITE_IOERR SXERR_IO
#define UNQLITE_CORRUPT SXERR_CORRUPT
#define UNQLITE_LOCKED SXERR_LOCKED
#define UNQLITE_BUSY SXERR_BUSY
#define UNQLITE_DONE SXERR_DONE
#define UNQLITE_PERM SXERR_PERM
#define UNQLITE_NOTIMPLEMENTED SXERR_NOTIMPLEMENTED
#define UNQLITE_NOTFOUND SXERR_NOTFOUND
#define UNQLITE_NOOP SXERR_NOOP
#define UNQLITE_INVALID SXERR_INVALID
#define UNQLITE_EOF SXERR_EOF
#define UNQLITE_UNKNOWN SXERR_UNKNOWN
#define UNQLITE_LIMIT SXERR_LIMIT
#define UNQLITE_EXISTS SXERR_EXISTS
#define UNQLITE_EMPTY SXERR_EMPTY
#define UNQLITE_COMPILE_ERR (-70)
#define UNQLITE_VM_ERR (-71)
#define UNQLITE_FULL (-73)
#define UNQLITE_CANTOPEN (-74)
#define UNQLITE_READ_ONLY (-75)
#define UNQLITE_LOCKERR (-76)
#define UNQLITE_CONFIG_JX9_ERR_LOG 1
#define UNQLITE_CONFIG_MAX_PAGE_CACHE 2
#define UNQLITE_CONFIG_ERR_LOG 3
#define UNQLITE_CONFIG_KV_ENGINE 4
#define UNQLITE_CONFIG_DISABLE_AUTO_COMMIT 5
#define UNQLITE_CONFIG_GET_KV_NAME 6
#define UNQLITE_VM_CONFIG_OUTPUT 1
#define UNQLITE_VM_CONFIG_IMPORT_PATH 2
#define UNQLITE_VM_CONFIG_ERR_REPORT 3
#define UNQLITE_VM_CONFIG_RECURSION_DEPTH 4
#define UNQLITE_VM_OUTPUT_LENGTH 5
#define UNQLITE_VM_CONFIG_CREATE_VAR 6
#define UNQLITE_VM_CONFIG_HTTP_REQUEST 7
#define UNQLITE_VM_CONFIG_SERVER_ATTR 8
#define UNQLITE_VM_CONFIG_ENV_ATTR 9
#define UNQLITE_VM_CONFIG_EXEC_VALUE 10
#define UNQLITE_VM_CONFIG_IO_STREAM 11
#define UNQLITE_VM_CONFIG_ARGV_ENTRY 12
#define UNQLITE_VM_CONFIG_EXTRACT_OUTPUT 13
#define UNQLITE_KV_CONFIG_HASH_FUNC 1
#define UNQLITE_KV_CONFIG_CMP_FUNC 2
#define UNQLITE_LIB_CONFIG_USER_MALLOC 1
#define UNQLITE_LIB_CONFIG_MEM_ERR_CALLBACK 2
#define UNQLITE_LIB_CONFIG_USER_MUTEX 3
#define UNQLITE_LIB_CONFIG_THREAD_LEVEL_SINGLE 4
#define UNQLITE_LIB_CONFIG_THREAD_LEVEL_MULTI 5
#define UNQLITE_LIB_CONFIG_VFS 6
#define UNQLITE_LIB_CONFIG_STORAGE_ENGINE 7
#define UNQLITE_LIB_CONFIG_PAGE_SIZE 8
#define UNQLITE_OPEN_READONLY 0x00000001
#define UNQLITE_OPEN_READWRITE 0x00000002
#define UNQLITE_OPEN_CREATE 0x00000004
#define UNQLITE_OPEN_EXCLUSIVE 0x00000008
#define UNQLITE_OPEN_TEMP_DB 0x00000010
#define UNQLITE_OPEN_NOMUTEX 0x00000020
#define UNQLITE_OPEN_OMIT_JOURNALING 0x00000040
#define UNQLITE_OPEN_IN_MEMORY 0x00000080
#define UNQLITE_OPEN_MMAP 0x00000100
#define UNQLITE_SYNC_NORMAL 0x00002
#define UNQLITE_SYNC_FULL 0x00003
#define UNQLITE_SYNC_DATAONLY 0x00010
#define UNQLITE_LOCK_NONE 0
#define UNQLITE_LOCK_SHARED 1
#define UNQLITE_LOCK_RESERVED 2
#define UNQLITE_LOCK_PENDING 3
#define UNQLITE_LOCK_EXCLUSIVE 4
typedef struct unqlite_file unqlite_file;
struct unqlite_file {
const unqlite_io_methods *pMethods;
};
struct unqlite_io_methods {
int iVersion;
int (*xClose)(unqlite_file*);
int (*xRead)(unqlite_file*, void*, unqlite_int64 iAmt, unqlite_int64 iOfst);
int (*xWrite)(unqlite_file*, const void*, unqlite_int64 iAmt, unqlite_int64 iOfst);
int (*xTruncate)(unqlite_file*, unqlite_int64 size);
int (*xSync)(unqlite_file*, int flags);
int (*xFileSize)(unqlite_file*, unqlite_int64 *pSize);
int (*xLock)(unqlite_file*, int);
int (*xUnlock)(unqlite_file*, int);
int (*xCheckReservedLock)(unqlite_file*, int *pResOut);
int (*xSectorSize)(unqlite_file*);
};
struct unqlite_vfs {
const char *zName;
int iVersion;
int szOsFile;
int mxPathname;
int (*xOpen)(unqlite_vfs*, const char *zName, unqlite_file*,unsigned int flags);
int (*xDelete)(unqlite_vfs*, const char *zName, int syncDir);
int (*xAccess)(unqlite_vfs*, const char *zName, int flags, int *pResOut);
int (*xFullPathname)(unqlite_vfs*, const char *zName,int buf_len,char *zBuf);
int (*xTmpDir)(unqlite_vfs*,char *zBuf,int buf_len);
int (*xSleep)(unqlite_vfs*, int microseconds);
int (*xCurrentTime)(unqlite_vfs*,Sytm *pOut);
int (*xGetLastError)(unqlite_vfs*, int, char *);
};
#define UNQLITE_ACCESS_EXISTS 0
#define UNQLITE_ACCESS_READWRITE 1
#define UNQLITE_ACCESS_READ 2
typedef sxu64 pgno;
typedef struct unqlite_page unqlite_page;
struct unqlite_page
{
unsigned char *zData;
void *pUserData;
pgno pgno;
};
typedef void * unqlite_kv_handle;
typedef struct unqlite_kv_io unqlite_kv_io;
struct unqlite_kv_io
{
unqlite_kv_handle pHandle;
unqlite_kv_methods *pMethods;
int (*xGet)(unqlite_kv_handle,pgno,unqlite_page **);
int (*xLookup)(unqlite_kv_handle,pgno,unqlite_page **);
int (*xNew)(unqlite_kv_handle,unqlite_page **);
int (*xWrite)(unqlite_page *);
int (*xDontWrite)(unqlite_page *);
int (*xDontJournal)(unqlite_page *);
int (*xDontMkHot)(unqlite_page *);
int (*xPageRef)(unqlite_page *);
int (*xPageUnref)(unqlite_page *);
int (*xPageSize)(unqlite_kv_handle);
int (*xReadOnly)(unqlite_kv_handle);
unsigned char * (*xTmpPage)(unqlite_kv_handle);
void (*xSetUnpin)(unqlite_kv_handle,void (*xPageUnpin)(void *));
void (*xSetReload)(unqlite_kv_handle,void (*xPageReload)(void *));
void (*xErr)(unqlite_kv_handle,const char *);
};
typedef struct unqlite_kv_cursor unqlite_kv_cursor;
struct unqlite_kv_cursor
{
unqlite_kv_engine *pStore;
};
#define UNQLITE_CURSOR_MATCH_EXACT 1
#define UNQLITE_CURSOR_MATCH_LE 2
#define UNQLITE_CURSOR_MATCH_GE 3
struct unqlite_kv_engine
{
const unqlite_kv_io *pIo;
};
struct unqlite_kv_methods
{
const char *zName;
int szKv;
int szCursor;
int iVersion;
int (*xInit)(unqlite_kv_engine *,int iPageSize);
void (*xRelease)(unqlite_kv_engine *);
int (*xConfig)(unqlite_kv_engine *,int op,va_list ap);
int (*xOpen)(unqlite_kv_engine *,pgno);
int (*xReplace)(
unqlite_kv_engine *,
const void *pKey,int nKeyLen,
const void *pData,unqlite_int64 nDataLen
);
int (*xAppend)(
unqlite_kv_engine *,
const void *pKey,int nKeyLen,
const void *pData,unqlite_int64 nDataLen
);
void (*xCursorInit)(unqlite_kv_cursor *);
int (*xSeek)(unqlite_kv_cursor *,const void *pKey,int nByte,int iPos);
int (*xFirst)(unqlite_kv_cursor *);
int (*xLast)(unqlite_kv_cursor *);
int (*xValid)(unqlite_kv_cursor *);
int (*xNext)(unqlite_kv_cursor *);
int (*xPrev)(unqlite_kv_cursor *);
int (*xDelete)(unqlite_kv_cursor *);
int (*xKeyLength)(unqlite_kv_cursor *,int *);
int (*xKey)(unqlite_kv_cursor *,int (*xConsumer)(const void *,unsigned int,void *),void *pUserData);
int (*xDataLength)(unqlite_kv_cursor *,unqlite_int64 *);
int (*xData)(unqlite_kv_cursor *,int (*xConsumer)(const void *,unsigned int,void *),void *pUserData);
void (*xReset)(unqlite_kv_cursor *);
void (*xCursorRelease)(unqlite_kv_cursor *);
};
#ifndef UNQLITE_JOURNAL_FILE_SUFFIX
#define UNQLITE_JOURNAL_FILE_SUFFIX "_unqlite_journal"
#endif
#define UNQLITE_CTX_ERR 1
#define UNQLITE_CTX_WARNING 2
#define UNQLITE_CTX_NOTICE 3
UNQLITE_APIEXPORT int unqlite_open(unqlite **ppDB,const char *zFilename,unsigned int iMode);
UNQLITE_APIEXPORT int unqlite_config(unqlite *pDb,int nOp,...);
UNQLITE_APIEXPORT int unqlite_close(unqlite *pDb);
UNQLITE_APIEXPORT int unqlite_kv_store(unqlite *pDb,const void *pKey,int nKeyLen,const void *pData,unqlite_int64 nDataLen);
UNQLITE_APIEXPORT int unqlite_kv_append(unqlite *pDb,const void *pKey,int nKeyLen,const void *pData,unqlite_int64 nDataLen);
UNQLITE_APIEXPORT int unqlite_kv_store_fmt(unqlite *pDb,const void *pKey,int nKeyLen,const char *zFormat,...);
UNQLITE_APIEXPORT int unqlite_kv_append_fmt(unqlite *pDb,const void *pKey,int nKeyLen,const char *zFormat,...);
UNQLITE_APIEXPORT int unqlite_kv_fetch(unqlite *pDb,const void *pKey,int nKeyLen,void *pBuf,unqlite_int64 *pBufLen);
UNQLITE_APIEXPORT int unqlite_kv_fetch_callback(unqlite *pDb,const void *pKey,
int nKeyLen,int (*xConsumer)(const void *,unsigned int,void *),void *pUserData);
UNQLITE_APIEXPORT int unqlite_kv_delete(unqlite *pDb,const void *pKey,int nKeyLen);
UNQLITE_APIEXPORT int unqlite_kv_config(unqlite *pDb,int iOp,...);
UNQLITE_APIEXPORT int unqlite_compile(unqlite *pDb,const char *zJx9,int nByte,unqlite_vm **ppOut);
UNQLITE_APIEXPORT int unqlite_compile_file(unqlite *pDb,const char *zPath,unqlite_vm **ppOut);
UNQLITE_APIEXPORT int unqlite_vm_config(unqlite_vm *pVm,int iOp,...);
UNQLITE_APIEXPORT int unqlite_vm_exec(unqlite_vm *pVm);
UNQLITE_APIEXPORT int unqlite_vm_reset(unqlite_vm *pVm);
UNQLITE_APIEXPORT int unqlite_vm_release(unqlite_vm *pVm);
UNQLITE_APIEXPORT int unqlite_vm_dump(unqlite_vm *pVm, int (*xConsumer)(const void *, unsigned int, void *), void *pUserData);
UNQLITE_APIEXPORT unqlite_value * unqlite_vm_extract_variable(unqlite_vm *pVm,const char *zVarname);
UNQLITE_APIEXPORT int unqlite_kv_cursor_init(unqlite *pDb,unqlite_kv_cursor **ppOut);
UNQLITE_APIEXPORT int unqlite_kv_cursor_release(unqlite *pDb,unqlite_kv_cursor *pCur);
UNQLITE_APIEXPORT int unqlite_kv_cursor_seek(unqlite_kv_cursor *pCursor,const void *pKey,int nKeyLen,int iPos);
UNQLITE_APIEXPORT int unqlite_kv_cursor_first_entry(unqlite_kv_cursor *pCursor);
UNQLITE_APIEXPORT int unqlite_kv_cursor_last_entry(unqlite_kv_cursor *pCursor);
UNQLITE_APIEXPORT int unqlite_kv_cursor_valid_entry(unqlite_kv_cursor *pCursor);
UNQLITE_APIEXPORT int unqlite_kv_cursor_next_entry(unqlite_kv_cursor *pCursor);
UNQLITE_APIEXPORT int unqlite_kv_cursor_prev_entry(unqlite_kv_cursor *pCursor);
UNQLITE_APIEXPORT int unqlite_kv_cursor_key(unqlite_kv_cursor *pCursor,void *pBuf,int *pnByte);
UNQLITE_APIEXPORT int unqlite_kv_cursor_key_callback(unqlite_kv_cursor *pCursor,int (*xConsumer)(const void *,unsigned int,void *),void *pUserData);
UNQLITE_APIEXPORT int unqlite_kv_cursor_data(unqlite_kv_cursor *pCursor,void *pBuf,unqlite_int64 *pnData);
UNQLITE_APIEXPORT int unqlite_kv_cursor_data_callback(unqlite_kv_cursor *pCursor,int (*xConsumer)(const void *,unsigned int,void *),void *pUserData);
UNQLITE_APIEXPORT int unqlite_kv_cursor_delete_entry(unqlite_kv_cursor *pCursor);
UNQLITE_APIEXPORT int unqlite_kv_cursor_reset(unqlite_kv_cursor *pCursor);
UNQLITE_APIEXPORT int unqlite_begin(unqlite *pDb);
UNQLITE_APIEXPORT int unqlite_commit(unqlite *pDb);
UNQLITE_APIEXPORT int unqlite_rollback(unqlite *pDb);
UNQLITE_APIEXPORT int unqlite_util_load_mmaped_file(const char *zFile,void **ppMap,unqlite_int64 *pFileSize);
UNQLITE_APIEXPORT int unqlite_util_release_mmaped_file(void *pMap,unqlite_int64 iFileSize);
UNQLITE_APIEXPORT int unqlite_util_random_string(unqlite *pDb,char *zBuf,unsigned int buf_size);
UNQLITE_APIEXPORT unsigned int unqlite_util_random_num(unqlite *pDb);
UNQLITE_APIEXPORT int unqlite_create_function(unqlite_vm *pVm,const char *zName,int (*xFunc)(unqlite_context *,int,unqlite_value **),void *pUserData);
UNQLITE_APIEXPORT int unqlite_delete_function(unqlite_vm *pVm, const char *zName);
UNQLITE_APIEXPORT int unqlite_create_constant(unqlite_vm *pVm,const char *zName,void (*xExpand)(unqlite_value *, void *),void *pUserData);
UNQLITE_APIEXPORT int unqlite_delete_constant(unqlite_vm *pVm, const char *zName);
UNQLITE_APIEXPORT unqlite_value * unqlite_vm_new_scalar(unqlite_vm *pVm);
UNQLITE_APIEXPORT unqlite_value * unqlite_vm_new_array(unqlite_vm *pVm);
UNQLITE_APIEXPORT int unqlite_vm_release_value(unqlite_vm *pVm,unqlite_value *pValue);
UNQLITE_APIEXPORT unqlite_value * unqlite_context_new_scalar(unqlite_context *pCtx);
UNQLITE_APIEXPORT unqlite_value * unqlite_context_new_array(unqlite_context *pCtx);
UNQLITE_APIEXPORT void unqlite_context_release_value(unqlite_context *pCtx,unqlite_value *pValue);
UNQLITE_APIEXPORT int unqlite_value_int(unqlite_value *pVal, int iValue);
UNQLITE_APIEXPORT int unqlite_value_int64(unqlite_value *pVal, unqlite_int64 iValue);
UNQLITE_APIEXPORT int unqlite_value_bool(unqlite_value *pVal, int iBool);
UNQLITE_APIEXPORT int unqlite_value_null(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_double(unqlite_value *pVal, double Value);
UNQLITE_APIEXPORT int unqlite_value_string(unqlite_value *pVal, const char *zString, int nLen);
UNQLITE_APIEXPORT int unqlite_value_string_format(unqlite_value *pVal, const char *zFormat,...);
UNQLITE_APIEXPORT int unqlite_value_reset_string_cursor(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_resource(unqlite_value *pVal, void *pUserData);
UNQLITE_APIEXPORT int unqlite_value_release(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_to_int(unqlite_value *pValue);
UNQLITE_APIEXPORT int unqlite_value_to_bool(unqlite_value *pValue);
UNQLITE_APIEXPORT unqlite_int64 unqlite_value_to_int64(unqlite_value *pValue);
UNQLITE_APIEXPORT double unqlite_value_to_double(unqlite_value *pValue);
UNQLITE_APIEXPORT const char * unqlite_value_to_string(unqlite_value *pValue, int *pLen);
UNQLITE_APIEXPORT void * unqlite_value_to_resource(unqlite_value *pValue);
UNQLITE_APIEXPORT int unqlite_value_compare(unqlite_value *pLeft, unqlite_value *pRight, int bStrict);
UNQLITE_APIEXPORT int unqlite_result_int(unqlite_context *pCtx, int iValue);
UNQLITE_APIEXPORT int unqlite_result_int64(unqlite_context *pCtx, unqlite_int64 iValue);
UNQLITE_APIEXPORT int unqlite_result_bool(unqlite_context *pCtx, int iBool);
UNQLITE_APIEXPORT int unqlite_result_double(unqlite_context *pCtx, double Value);
UNQLITE_APIEXPORT int unqlite_result_null(unqlite_context *pCtx);
UNQLITE_APIEXPORT int unqlite_result_string(unqlite_context *pCtx, const char *zString, int nLen);
UNQLITE_APIEXPORT int unqlite_result_string_format(unqlite_context *pCtx, const char *zFormat, ...);
UNQLITE_APIEXPORT int unqlite_result_value(unqlite_context *pCtx, unqlite_value *pValue);
UNQLITE_APIEXPORT int unqlite_result_resource(unqlite_context *pCtx, void *pUserData);
UNQLITE_APIEXPORT int unqlite_value_is_int(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_float(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_bool(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_string(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_null(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_numeric(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_callable(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_scalar(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_json_array(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_json_object(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_resource(unqlite_value *pVal);
UNQLITE_APIEXPORT int unqlite_value_is_empty(unqlite_value *pVal);
UNQLITE_APIEXPORT unqlite_value * unqlite_array_fetch(unqlite_value *pArray, const char *zKey, int nByte);
UNQLITE_APIEXPORT int unqlite_array_walk(unqlite_value *pArray, int (*xWalk)(unqlite_value *, unqlite_value *, void *), void *pUserData);
UNQLITE_APIEXPORT int unqlite_array_add_elem(unqlite_value *pArray, unqlite_value *pKey, unqlite_value *pValue);
UNQLITE_APIEXPORT int unqlite_array_add_strkey_elem(unqlite_value *pArray, const char *zKey, unqlite_value *pValue);
UNQLITE_APIEXPORT int unqlite_array_count(unqlite_value *pArray);
UNQLITE_APIEXPORT int unqlite_context_output(unqlite_context *pCtx, const char *zString, int nLen);
UNQLITE_APIEXPORT int unqlite_context_output_format(unqlite_context *pCtx,const char *zFormat, ...);
UNQLITE_APIEXPORT int unqlite_context_throw_error(unqlite_context *pCtx, int iErr, const char *zErr);
UNQLITE_APIEXPORT int unqlite_context_throw_error_format(unqlite_context *pCtx, int iErr, const char *zFormat, ...);
UNQLITE_APIEXPORT unsigned int unqlite_context_random_num(unqlite_context *pCtx);
UNQLITE_APIEXPORT int unqlite_context_random_string(unqlite_context *pCtx, char *zBuf, int nBuflen);
UNQLITE_APIEXPORT void * unqlite_context_user_data(unqlite_context *pCtx);
UNQLITE_APIEXPORT int unqlite_context_push_aux_data(unqlite_context *pCtx, void *pUserData);
UNQLITE_APIEXPORT void * unqlite_context_peek_aux_data(unqlite_context *pCtx);
UNQLITE_APIEXPORT unsigned int unqlite_context_result_buf_length(unqlite_context *pCtx);
UNQLITE_APIEXPORT const char * unqlite_function_name(unqlite_context *pCtx);
UNQLITE_APIEXPORT void * unqlite_context_alloc_chunk(unqlite_context *pCtx,unsigned int nByte,int ZeroChunk,int AutoRelease);
UNQLITE_APIEXPORT void * unqlite_context_realloc_chunk(unqlite_context *pCtx,void *pChunk,unsigned int nByte);
UNQLITE_APIEXPORT void unqlite_context_free_chunk(unqlite_context *pCtx,void *pChunk);
UNQLITE_APIEXPORT int unqlite_lib_config(int nConfigOp,...);
UNQLITE_APIEXPORT int unqlite_lib_init(void);
UNQLITE_APIEXPORT int unqlite_lib_shutdown(void);
UNQLITE_APIEXPORT int unqlite_lib_is_threadsafe(void);
UNQLITE_APIEXPORT const char * unqlite_lib_version(void);
UNQLITE_APIEXPORT const char * unqlite_lib_signature(void);
UNQLITE_APIEXPORT const char * unqlite_lib_ident(void);
UNQLITE_APIEXPORT const char * unqlite_lib_copyright(void);
#endif