Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions | Variables
sqlite3.h File Reference
#include <stdarg.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sqlite3_file
struct  sqlite3_io_methods
struct  sqlite3_vfs
struct  sqlite3_mem_methods
struct  sqlite3_module
struct  sqlite3_index_info
struct  sqlite3_index_info::sqlite3_index_constraint
struct  sqlite3_index_info::sqlite3_index_orderby
struct  sqlite3_index_info::sqlite3_index_constraint_usage
struct  sqlite3_vtab
struct  sqlite3_vtab_cursor
struct  sqlite3_mutex_methods
struct  sqlite3_pcache_methods
struct  sqlite3_rtree_geometry

Defines

#define SQLITE_EXTERN   extern
#define SQLITE_API
#define SQLITE_DEPRECATED
#define SQLITE_EXPERIMENTAL
#define SQLITE_VERSION   "3.7.7.1"
#define SQLITE_VERSION_NUMBER   3007007
#define SQLITE_SOURCE_ID   "2011-06-28 17:39:05 af0d91adf497f5f36ec3813f04235a6e195a605f"
#define SQLITE_OK   0 /* Successful result */
#define SQLITE_ERROR   1 /* SQL error or missing database */
#define SQLITE_INTERNAL   2 /* Internal logic error in SQLite */
#define SQLITE_PERM   3 /* Access permission denied */
#define SQLITE_ABORT   4 /* Callback routine requested an abort */
#define SQLITE_BUSY   5 /* The database file is locked */
#define SQLITE_LOCKED   6 /* A table in the database is locked */
#define SQLITE_NOMEM   7 /* A malloc() failed */
#define SQLITE_READONLY   8 /* Attempt to write a readonly database */
#define SQLITE_INTERRUPT   9 /* Operation terminated by sqlite3_interrupt()*/
#define SQLITE_IOERR   10 /* Some kind of disk I/O error occurred */
#define SQLITE_CORRUPT   11 /* The database disk image is malformed */
#define SQLITE_NOTFOUND   12 /* Unknown opcode in sqlite3_file_control() */
#define SQLITE_FULL   13 /* Insertion failed because database is full */
#define SQLITE_CANTOPEN   14 /* Unable to open the database file */
#define SQLITE_PROTOCOL   15 /* Database lock protocol error */
#define SQLITE_EMPTY   16 /* Database is empty */
#define SQLITE_SCHEMA   17 /* The database schema changed */
#define SQLITE_TOOBIG   18 /* String or BLOB exceeds size limit */
#define SQLITE_CONSTRAINT   19 /* Abort due to constraint violation */
#define SQLITE_MISMATCH   20 /* Data type mismatch */
#define SQLITE_MISUSE   21 /* Library used incorrectly */
#define SQLITE_NOLFS   22 /* Uses OS features not supported on host */
#define SQLITE_AUTH   23 /* Authorization denied */
#define SQLITE_FORMAT   24 /* Auxiliary database format error */
#define SQLITE_RANGE   25 /* 2nd parameter to sqlite3_bind out of range */
#define SQLITE_NOTADB   26 /* File opened that is not a database file */
#define SQLITE_ROW   100 /* sqlite3_step() has another row ready */
#define SQLITE_DONE   101 /* sqlite3_step() has finished executing */
#define SQLITE_IOERR_READ   (SQLITE_IOERR | (1<<8))
#define SQLITE_IOERR_SHORT_READ   (SQLITE_IOERR | (2<<8))
#define SQLITE_IOERR_WRITE   (SQLITE_IOERR | (3<<8))
#define SQLITE_IOERR_FSYNC   (SQLITE_IOERR | (4<<8))
#define SQLITE_IOERR_DIR_FSYNC   (SQLITE_IOERR | (5<<8))
#define SQLITE_IOERR_TRUNCATE   (SQLITE_IOERR | (6<<8))
#define SQLITE_IOERR_FSTAT   (SQLITE_IOERR | (7<<8))
#define SQLITE_IOERR_UNLOCK   (SQLITE_IOERR | (8<<8))
#define SQLITE_IOERR_RDLOCK   (SQLITE_IOERR | (9<<8))
#define SQLITE_IOERR_DELETE   (SQLITE_IOERR | (10<<8))
#define SQLITE_IOERR_BLOCKED   (SQLITE_IOERR | (11<<8))
#define SQLITE_IOERR_NOMEM   (SQLITE_IOERR | (12<<8))
#define SQLITE_IOERR_ACCESS   (SQLITE_IOERR | (13<<8))
#define SQLITE_IOERR_CHECKRESERVEDLOCK   (SQLITE_IOERR | (14<<8))
#define SQLITE_IOERR_LOCK   (SQLITE_IOERR | (15<<8))
#define SQLITE_IOERR_CLOSE   (SQLITE_IOERR | (16<<8))
#define SQLITE_IOERR_DIR_CLOSE   (SQLITE_IOERR | (17<<8))
#define SQLITE_IOERR_SHMOPEN   (SQLITE_IOERR | (18<<8))
#define SQLITE_IOERR_SHMSIZE   (SQLITE_IOERR | (19<<8))
#define SQLITE_IOERR_SHMLOCK   (SQLITE_IOERR | (20<<8))
#define SQLITE_IOERR_SHMMAP   (SQLITE_IOERR | (21<<8))
#define SQLITE_IOERR_SEEK   (SQLITE_IOERR | (22<<8))
#define SQLITE_LOCKED_SHAREDCACHE   (SQLITE_LOCKED | (1<<8))
#define SQLITE_BUSY_RECOVERY   (SQLITE_BUSY | (1<<8))
#define SQLITE_CANTOPEN_NOTEMPDIR   (SQLITE_CANTOPEN | (1<<8))
#define SQLITE_CORRUPT_VTAB   (SQLITE_CORRUPT | (1<<8))
#define SQLITE_READONLY_RECOVERY   (SQLITE_READONLY | (1<<8))
#define SQLITE_READONLY_CANTLOCK   (SQLITE_READONLY | (2<<8))
#define SQLITE_OPEN_READONLY   0x00000001 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_READWRITE   0x00000002 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_CREATE   0x00000004 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_DELETEONCLOSE   0x00000008 /* VFS only */
#define SQLITE_OPEN_EXCLUSIVE   0x00000010 /* VFS only */
#define SQLITE_OPEN_AUTOPROXY   0x00000020 /* VFS only */
#define SQLITE_OPEN_URI   0x00000040 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_MAIN_DB   0x00000100 /* VFS only */
#define SQLITE_OPEN_TEMP_DB   0x00000200 /* VFS only */
#define SQLITE_OPEN_TRANSIENT_DB   0x00000400 /* VFS only */
#define SQLITE_OPEN_MAIN_JOURNAL   0x00000800 /* VFS only */
#define SQLITE_OPEN_TEMP_JOURNAL   0x00001000 /* VFS only */
#define SQLITE_OPEN_SUBJOURNAL   0x00002000 /* VFS only */
#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000 /* VFS only */
#define SQLITE_OPEN_NOMUTEX   0x00008000 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_FULLMUTEX   0x00010000 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_SHAREDCACHE   0x00020000 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_PRIVATECACHE   0x00040000 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_WAL   0x00080000 /* VFS only */
#define SQLITE_IOCAP_ATOMIC   0x00000001
#define SQLITE_IOCAP_ATOMIC512   0x00000002
#define SQLITE_IOCAP_ATOMIC1K   0x00000004
#define SQLITE_IOCAP_ATOMIC2K   0x00000008
#define SQLITE_IOCAP_ATOMIC4K   0x00000010
#define SQLITE_IOCAP_ATOMIC8K   0x00000020
#define SQLITE_IOCAP_ATOMIC16K   0x00000040
#define SQLITE_IOCAP_ATOMIC32K   0x00000080
#define SQLITE_IOCAP_ATOMIC64K   0x00000100
#define SQLITE_IOCAP_SAFE_APPEND   0x00000200
#define SQLITE_IOCAP_SEQUENTIAL   0x00000400
#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN   0x00000800
#define SQLITE_LOCK_NONE   0
#define SQLITE_LOCK_SHARED   1
#define SQLITE_LOCK_RESERVED   2
#define SQLITE_LOCK_PENDING   3
#define SQLITE_LOCK_EXCLUSIVE   4
#define SQLITE_SYNC_NORMAL   0x00002
#define SQLITE_SYNC_FULL   0x00003
#define SQLITE_SYNC_DATAONLY   0x00010
#define SQLITE_FCNTL_LOCKSTATE   1
#define SQLITE_GET_LOCKPROXYFILE   2
#define SQLITE_SET_LOCKPROXYFILE   3
#define SQLITE_LAST_ERRNO   4
#define SQLITE_FCNTL_SIZE_HINT   5
#define SQLITE_FCNTL_CHUNK_SIZE   6
#define SQLITE_FCNTL_FILE_POINTER   7
#define SQLITE_FCNTL_SYNC_OMITTED   8
#define SQLITE_ACCESS_EXISTS   0
#define SQLITE_ACCESS_READWRITE   1 /* Used by PRAGMA temp_store_directory */
#define SQLITE_ACCESS_READ   2 /* Unused */
#define SQLITE_SHM_UNLOCK   1
#define SQLITE_SHM_LOCK   2
#define SQLITE_SHM_SHARED   4
#define SQLITE_SHM_EXCLUSIVE   8
#define SQLITE_SHM_NLOCK   8
#define SQLITE_CONFIG_SINGLETHREAD   1 /* nil */
#define SQLITE_CONFIG_MULTITHREAD   2 /* nil */
#define SQLITE_CONFIG_SERIALIZED   3 /* nil */
#define SQLITE_CONFIG_MALLOC   4 /* sqlite3_mem_methods* */
#define SQLITE_CONFIG_GETMALLOC   5 /* sqlite3_mem_methods* */
#define SQLITE_CONFIG_SCRATCH   6 /* void*, int sz, int N */
#define SQLITE_CONFIG_PAGECACHE   7 /* void*, int sz, int N */
#define SQLITE_CONFIG_HEAP   8 /* void*, int nByte, int min */
#define SQLITE_CONFIG_MEMSTATUS   9 /* boolean */
#define SQLITE_CONFIG_MUTEX   10 /* sqlite3_mutex_methods* */
#define SQLITE_CONFIG_GETMUTEX   11 /* sqlite3_mutex_methods* */
#define SQLITE_CONFIG_LOOKASIDE   13 /* int int */
#define SQLITE_CONFIG_PCACHE   14 /* sqlite3_pcache_methods* */
#define SQLITE_CONFIG_GETPCACHE   15 /* sqlite3_pcache_methods* */
#define SQLITE_CONFIG_LOG   16 /* xFunc, void* */
#define SQLITE_CONFIG_URI   17 /* int */
#define SQLITE_DBCONFIG_LOOKASIDE   1001 /* void* int int */
#define SQLITE_DBCONFIG_ENABLE_FKEY   1002 /* int int* */
#define SQLITE_DBCONFIG_ENABLE_TRIGGER   1003 /* int int* */
#define SQLITE_DENY   1 /* Abort the SQL statement with an error */
#define SQLITE_IGNORE   2 /* Don't allow access, but don't generate an error */
#define SQLITE_CREATE_INDEX   1 /* Index Name Table Name */
#define SQLITE_CREATE_TABLE   2 /* Table Name NULL */
#define SQLITE_CREATE_TEMP_INDEX   3 /* Index Name Table Name */
#define SQLITE_CREATE_TEMP_TABLE   4 /* Table Name NULL */
#define SQLITE_CREATE_TEMP_TRIGGER   5 /* Trigger Name Table Name */
#define SQLITE_CREATE_TEMP_VIEW   6 /* View Name NULL */
#define SQLITE_CREATE_TRIGGER   7 /* Trigger Name Table Name */
#define SQLITE_CREATE_VIEW   8 /* View Name NULL */
#define SQLITE_DELETE   9 /* Table Name NULL */
#define SQLITE_DROP_INDEX   10 /* Index Name Table Name */
#define SQLITE_DROP_TABLE   11 /* Table Name NULL */
#define SQLITE_DROP_TEMP_INDEX   12 /* Index Name Table Name */
#define SQLITE_DROP_TEMP_TABLE   13 /* Table Name NULL */
#define SQLITE_DROP_TEMP_TRIGGER   14 /* Trigger Name Table Name */
#define SQLITE_DROP_TEMP_VIEW   15 /* View Name NULL */
#define SQLITE_DROP_TRIGGER   16 /* Trigger Name Table Name */
#define SQLITE_DROP_VIEW   17 /* View Name NULL */
#define SQLITE_INSERT   18 /* Table Name NULL */
#define SQLITE_PRAGMA   19 /* Pragma Name 1st arg or NULL */
#define SQLITE_READ   20 /* Table Name Column Name */
#define SQLITE_SELECT   21 /* NULL NULL */
#define SQLITE_TRANSACTION   22 /* Operation NULL */
#define SQLITE_UPDATE   23 /* Table Name Column Name */
#define SQLITE_ATTACH   24 /* Filename NULL */
#define SQLITE_DETACH   25 /* Database Name NULL */
#define SQLITE_ALTER_TABLE   26 /* Database Name Table Name */
#define SQLITE_REINDEX   27 /* Index Name NULL */
#define SQLITE_ANALYZE   28 /* Table Name NULL */
#define SQLITE_CREATE_VTABLE   29 /* Table Name Module Name */
#define SQLITE_DROP_VTABLE   30 /* Table Name Module Name */
#define SQLITE_FUNCTION   31 /* NULL Function Name */
#define SQLITE_SAVEPOINT   32 /* Operation Savepoint Name */
#define SQLITE_COPY   0 /* No longer used */
#define SQLITE_LIMIT_LENGTH   0
#define SQLITE_LIMIT_SQL_LENGTH   1
#define SQLITE_LIMIT_COLUMN   2
#define SQLITE_LIMIT_EXPR_DEPTH   3
#define SQLITE_LIMIT_COMPOUND_SELECT   4
#define SQLITE_LIMIT_VDBE_OP   5
#define SQLITE_LIMIT_FUNCTION_ARG   6
#define SQLITE_LIMIT_ATTACHED   7
#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH   8
#define SQLITE_LIMIT_VARIABLE_NUMBER   9
#define SQLITE_LIMIT_TRIGGER_DEPTH   10
#define SQLITE_INTEGER   1
#define SQLITE_FLOAT   2
#define SQLITE_BLOB   4
#define SQLITE_NULL   5
#define SQLITE_TEXT   3
#define SQLITE3_TEXT   3
#define SQLITE_UTF8   1
#define SQLITE_UTF16LE   2
#define SQLITE_UTF16BE   3
#define SQLITE_UTF16   4 /* Use native byte order */
#define SQLITE_ANY   5 /* sqlite3_create_function only */
#define SQLITE_UTF16_ALIGNED   8 /* sqlite3_create_collation only */
#define SQLITE_STATIC   ((sqlite3_destructor_type)0)
#define SQLITE_TRANSIENT   ((sqlite3_destructor_type)-1)
#define SQLITE_INDEX_CONSTRAINT_EQ   2
#define SQLITE_INDEX_CONSTRAINT_GT   4
#define SQLITE_INDEX_CONSTRAINT_LE   8
#define SQLITE_INDEX_CONSTRAINT_LT   16
#define SQLITE_INDEX_CONSTRAINT_GE   32
#define SQLITE_INDEX_CONSTRAINT_MATCH   64
#define SQLITE_MUTEX_FAST   0
#define SQLITE_MUTEX_RECURSIVE   1
#define SQLITE_MUTEX_STATIC_MASTER   2
#define SQLITE_MUTEX_STATIC_MEM   3 /* sqlite3_malloc() */
#define SQLITE_MUTEX_STATIC_MEM2   4 /* NOT USED */
#define SQLITE_MUTEX_STATIC_OPEN   4 /* sqlite3BtreeOpen() */
#define SQLITE_MUTEX_STATIC_PRNG   5 /* sqlite3_random() */
#define SQLITE_MUTEX_STATIC_LRU   6 /* lru page list */
#define SQLITE_MUTEX_STATIC_LRU2   7 /* NOT USED */
#define SQLITE_MUTEX_STATIC_PMEM   7 /* sqlite3PageMalloc() */
#define SQLITE_TESTCTRL_FIRST   5
#define SQLITE_TESTCTRL_PRNG_SAVE   5
#define SQLITE_TESTCTRL_PRNG_RESTORE   6
#define SQLITE_TESTCTRL_PRNG_RESET   7
#define SQLITE_TESTCTRL_BITVEC_TEST   8
#define SQLITE_TESTCTRL_FAULT_INSTALL   9
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS   10
#define SQLITE_TESTCTRL_PENDING_BYTE   11
#define SQLITE_TESTCTRL_ASSERT   12
#define SQLITE_TESTCTRL_ALWAYS   13
#define SQLITE_TESTCTRL_RESERVE   14
#define SQLITE_TESTCTRL_OPTIMIZATIONS   15
#define SQLITE_TESTCTRL_ISKEYWORD   16
#define SQLITE_TESTCTRL_PGHDRSZ   17
#define SQLITE_TESTCTRL_SCRATCHMALLOC   18
#define SQLITE_TESTCTRL_LOCALTIME_FAULT   19
#define SQLITE_TESTCTRL_LAST   19
#define SQLITE_STATUS_MEMORY_USED   0
#define SQLITE_STATUS_PAGECACHE_USED   1
#define SQLITE_STATUS_PAGECACHE_OVERFLOW   2
#define SQLITE_STATUS_SCRATCH_USED   3
#define SQLITE_STATUS_SCRATCH_OVERFLOW   4
#define SQLITE_STATUS_MALLOC_SIZE   5
#define SQLITE_STATUS_PARSER_STACK   6
#define SQLITE_STATUS_PAGECACHE_SIZE   7
#define SQLITE_STATUS_SCRATCH_SIZE   8
#define SQLITE_STATUS_MALLOC_COUNT   9
#define SQLITE_DBSTATUS_LOOKASIDE_USED   0
#define SQLITE_DBSTATUS_CACHE_USED   1
#define SQLITE_DBSTATUS_SCHEMA_USED   2
#define SQLITE_DBSTATUS_STMT_USED   3
#define SQLITE_DBSTATUS_LOOKASIDE_HIT   4
#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE   5
#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL   6
#define SQLITE_DBSTATUS_MAX   6 /* Largest defined DBSTATUS */
#define SQLITE_STMTSTATUS_FULLSCAN_STEP   1
#define SQLITE_STMTSTATUS_SORT   2
#define SQLITE_STMTSTATUS_AUTOINDEX   3
#define SQLITE_CHECKPOINT_PASSIVE   0
#define SQLITE_CHECKPOINT_FULL   1
#define SQLITE_CHECKPOINT_RESTART   2
#define SQLITE_VTAB_CONSTRAINT_SUPPORT   1
#define SQLITE_ROLLBACK   1
#define SQLITE_FAIL   3
#define SQLITE_REPLACE   5
#define _SQLITE3RTREE_H_

Typedefs

typedef struct sqlite3
typedef long long int sqlite_int64
typedef unsigned long long int sqlite_uint64
typedef sqlite_int64 sqlite3_int64
typedef sqlite_uint64 sqlite3_uint64
typedef int(* sqlite3_callback )(void *, int, char **, char **)
typedef struct sqlite3_file
typedef struct sqlite3_io_methods
typedef struct sqlite3_mutex
typedef struct sqlite3_vfs
typedef void(* sqlite3_syscall_ptr )(void)
typedef struct sqlite3_mem_methods
typedef struct sqlite3_stmt
typedef struct Mem
typedef struct sqlite3_context
typedef void(* sqlite3_destructor_type )(void *)
typedef struct sqlite3_vtab
typedef struct sqlite3_index_info
typedef struct sqlite3_vtab_cursor
typedef struct sqlite3_module
typedef struct sqlite3_blob
typedef struct sqlite3_mutex_methods
typedef struct sqlite3_pcache
typedef struct sqlite3_pcache_methods
typedef struct sqlite3_backup
typedef struct sqlite3_rtree_geometry

Functions

SQLITE_API const char * sqlite3_libversion (void)
SQLITE_API const char * sqlite3_sourceid (void)
SQLITE_API int sqlite3_libversion_number (void)
SQLITE_API int sqlite3_compileoption_used (const char *zOptName)
SQLITE_API const char * sqlite3_compileoption_get (int N)
SQLITE_API int sqlite3_threadsafe (void)
SQLITE_API int sqlite3_close (sqlite3 *)
SQLITE_API int sqlite3_exec (sqlite3 *, const char *sql, int(*callback)(void *, int, char **, char **), void *, char **errmsg)
SQLITE_API int sqlite3_initialize (void)
SQLITE_API int sqlite3_shutdown (void)
SQLITE_API int sqlite3_os_init (void)
SQLITE_API int sqlite3_os_end (void)
SQLITE_API int sqlite3_config (int,...)
SQLITE_API int sqlite3_db_config (sqlite3 *, int op,...)
SQLITE_API int sqlite3_extended_result_codes (sqlite3 *, int onoff)
SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid (sqlite3 *)
SQLITE_API int sqlite3_changes (sqlite3 *)
SQLITE_API int sqlite3_total_changes (sqlite3 *)
SQLITE_API void sqlite3_interrupt (sqlite3 *)
SQLITE_API int sqlite3_complete (const char *sql)
SQLITE_API int sqlite3_complete16 (const void *sql)
SQLITE_API int sqlite3_busy_handler (sqlite3 *, int(*)(void *, int), void *)
SQLITE_API int sqlite3_busy_timeout (sqlite3 *, int ms)
SQLITE_API int sqlite3_get_table (sqlite3 *db, const char *zSql, char ***pazResult, int *pnRow, int *pnColumn, char **pzErrmsg)
SQLITE_API void sqlite3_free_table (char **result)
SQLITE_API char * sqlite3_mprintf (const char *,...)
SQLITE_API char * sqlite3_vmprintf (const char *, va_list)
SQLITE_API char * sqlite3_snprintf (int, char *, const char *,...)
SQLITE_API char * sqlite3_vsnprintf (int, char *, const char *, va_list)
SQLITE_API void * sqlite3_malloc (int)
SQLITE_API void * sqlite3_realloc (void *, int)
SQLITE_API void sqlite3_free (void *)
SQLITE_API sqlite3_int64 sqlite3_memory_used (void)
SQLITE_API sqlite3_int64 sqlite3_memory_highwater (int resetFlag)
SQLITE_API void sqlite3_randomness (int N, void *P)
SQLITE_API int sqlite3_set_authorizer (sqlite3 *, int(*xAuth)(void *, int, const char *, const char *, const char *, const char *), void *pUserData)
SQLITE_API void * sqlite3_trace (sqlite3 *, void(*xTrace)(void *, const char *), void *)
SQLITE_API SQLITE_EXPERIMENTAL
void * 
sqlite3_profile (sqlite3 *, void(*xProfile)(void *, const char *, sqlite3_uint64), void *)
SQLITE_API void sqlite3_progress_handler (sqlite3 *, int, int(*)(void *), void *)
SQLITE_API int sqlite3_open (const char *filename, sqlite3 **ppDb)
SQLITE_API int sqlite3_open16 (const void *filename, sqlite3 **ppDb)
SQLITE_API int sqlite3_open_v2 (const char *filename, sqlite3 **ppDb, int flags, const char *zVfs)
SQLITE_API const char * sqlite3_uri_parameter (const char *zFilename, const char *zParam)
SQLITE_API int sqlite3_errcode (sqlite3 *db)
SQLITE_API int sqlite3_extended_errcode (sqlite3 *db)
SQLITE_API const char * sqlite3_errmsg (sqlite3 *)
SQLITE_API const void * sqlite3_errmsg16 (sqlite3 *)
SQLITE_API int sqlite3_limit (sqlite3 *, int id, int newVal)
SQLITE_API int sqlite3_prepare (sqlite3 *db, const char *zSql, int nByte, sqlite3_stmt **ppStmt, const char **pzTail)
SQLITE_API int sqlite3_prepare_v2 (sqlite3 *db, const char *zSql, int nByte, sqlite3_stmt **ppStmt, const char **pzTail)
SQLITE_API int sqlite3_prepare16 (sqlite3 *db, const void *zSql, int nByte, sqlite3_stmt **ppStmt, const void **pzTail)
SQLITE_API int sqlite3_prepare16_v2 (sqlite3 *db, const void *zSql, int nByte, sqlite3_stmt **ppStmt, const void **pzTail)
SQLITE_API const char * sqlite3_sql (sqlite3_stmt *pStmt)
SQLITE_API int sqlite3_stmt_readonly (sqlite3_stmt *pStmt)
SQLITE_API int sqlite3_bind_blob (sqlite3_stmt *, int, const void *, int n, void(*)(void *))
SQLITE_API int sqlite3_bind_double (sqlite3_stmt *, int, double)
SQLITE_API int sqlite3_bind_int (sqlite3_stmt *, int, int)
SQLITE_API int sqlite3_bind_int64 (sqlite3_stmt *, int, sqlite3_int64)
SQLITE_API int sqlite3_bind_null (sqlite3_stmt *, int)
SQLITE_API int sqlite3_bind_text (sqlite3_stmt *, int, const char *, int n, void(*)(void *))
SQLITE_API int sqlite3_bind_text16 (sqlite3_stmt *, int, const void *, int, void(*)(void *))
SQLITE_API int sqlite3_bind_value (sqlite3_stmt *, int, const sqlite3_value *)
SQLITE_API int sqlite3_bind_zeroblob (sqlite3_stmt *, int, int n)
SQLITE_API int sqlite3_bind_parameter_count (sqlite3_stmt *)
SQLITE_API const char * sqlite3_bind_parameter_name (sqlite3_stmt *, int)
SQLITE_API int sqlite3_bind_parameter_index (sqlite3_stmt *, const char *zName)
SQLITE_API int sqlite3_clear_bindings (sqlite3_stmt *)
SQLITE_API int sqlite3_column_count (sqlite3_stmt *pStmt)
SQLITE_API const char * sqlite3_column_name (sqlite3_stmt *, int N)
SQLITE_API const void * sqlite3_column_name16 (sqlite3_stmt *, int N)
SQLITE_API const char * sqlite3_column_database_name (sqlite3_stmt *, int)
SQLITE_API const void * sqlite3_column_database_name16 (sqlite3_stmt *, int)
SQLITE_API const char * sqlite3_column_table_name (sqlite3_stmt *, int)
SQLITE_API const void * sqlite3_column_table_name16 (sqlite3_stmt *, int)
SQLITE_API const char * sqlite3_column_origin_name (sqlite3_stmt *, int)
SQLITE_API const void * sqlite3_column_origin_name16 (sqlite3_stmt *, int)
SQLITE_API const char * sqlite3_column_decltype (sqlite3_stmt *, int)
SQLITE_API const void * sqlite3_column_decltype16 (sqlite3_stmt *, int)
SQLITE_API int sqlite3_step (sqlite3_stmt *)
SQLITE_API int sqlite3_data_count (sqlite3_stmt *pStmt)
SQLITE_API const void * sqlite3_column_blob (sqlite3_stmt *, int iCol)
SQLITE_API int sqlite3_column_bytes (sqlite3_stmt *, int iCol)
SQLITE_API int sqlite3_column_bytes16 (sqlite3_stmt *, int iCol)
SQLITE_API double sqlite3_column_double (sqlite3_stmt *, int iCol)
SQLITE_API int sqlite3_column_int (sqlite3_stmt *, int iCol)
SQLITE_API sqlite3_int64 sqlite3_column_int64 (sqlite3_stmt *, int iCol)
SQLITE_API const unsigned char * sqlite3_column_text (sqlite3_stmt *, int iCol)
SQLITE_API const void * sqlite3_column_text16 (sqlite3_stmt *, int iCol)
SQLITE_API int sqlite3_column_type (sqlite3_stmt *, int iCol)
SQLITE_API sqlite3_value * sqlite3_column_value (sqlite3_stmt *, int iCol)
SQLITE_API int sqlite3_finalize (sqlite3_stmt *pStmt)
SQLITE_API int sqlite3_reset (sqlite3_stmt *pStmt)
SQLITE_API int sqlite3_create_function (sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *))
SQLITE_API int sqlite3_create_function16 (sqlite3 *db, const void *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *))
SQLITE_API int sqlite3_create_function_v2 (sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *), void(*xDestroy)(void *))
SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count (sqlite3_context *)
SQLITE_API SQLITE_DEPRECATED int sqlite3_expired (sqlite3_stmt *)
SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings (sqlite3_stmt *, sqlite3_stmt *)
SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover (void)
SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup (void)
SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm (void(*)(void *, sqlite3_int64, int), void *, sqlite3_int64)
SQLITE_API const void * sqlite3_value_blob (sqlite3_value *)
SQLITE_API int sqlite3_value_bytes (sqlite3_value *)
SQLITE_API int sqlite3_value_bytes16 (sqlite3_value *)
SQLITE_API double sqlite3_value_double (sqlite3_value *)
SQLITE_API int sqlite3_value_int (sqlite3_value *)
SQLITE_API sqlite3_int64 sqlite3_value_int64 (sqlite3_value *)
SQLITE_API const unsigned char * sqlite3_value_text (sqlite3_value *)
SQLITE_API const void * sqlite3_value_text16 (sqlite3_value *)
SQLITE_API const void * sqlite3_value_text16le (sqlite3_value *)
SQLITE_API const void * sqlite3_value_text16be (sqlite3_value *)
SQLITE_API int sqlite3_value_type (sqlite3_value *)
SQLITE_API int sqlite3_value_numeric_type (sqlite3_value *)
SQLITE_API void * sqlite3_aggregate_context (sqlite3_context *, int nBytes)
SQLITE_API void * sqlite3_user_data (sqlite3_context *)
SQLITE_API sqlite3sqlite3_context_db_handle (sqlite3_context *)
SQLITE_API void * sqlite3_get_auxdata (sqlite3_context *, int N)
SQLITE_API void sqlite3_set_auxdata (sqlite3_context *, int N, void *, void(*)(void *))
SQLITE_API void sqlite3_result_blob (sqlite3_context *, const void *, int, void(*)(void *))
SQLITE_API void sqlite3_result_double (sqlite3_context *, double)
SQLITE_API void sqlite3_result_error (sqlite3_context *, const char *, int)
SQLITE_API void sqlite3_result_error16 (sqlite3_context *, const void *, int)
SQLITE_API void sqlite3_result_error_toobig (sqlite3_context *)
SQLITE_API void sqlite3_result_error_nomem (sqlite3_context *)
SQLITE_API void sqlite3_result_error_code (sqlite3_context *, int)
SQLITE_API void sqlite3_result_int (sqlite3_context *, int)
SQLITE_API void sqlite3_result_int64 (sqlite3_context *, sqlite3_int64)
SQLITE_API void sqlite3_result_null (sqlite3_context *)
SQLITE_API void sqlite3_result_text (sqlite3_context *, const char *, int, void(*)(void *))
SQLITE_API void sqlite3_result_text16 (sqlite3_context *, const void *, int, void(*)(void *))
SQLITE_API void sqlite3_result_text16le (sqlite3_context *, const void *, int, void(*)(void *))
SQLITE_API void sqlite3_result_text16be (sqlite3_context *, const void *, int, void(*)(void *))
SQLITE_API void sqlite3_result_value (sqlite3_context *, sqlite3_value *)
SQLITE_API void sqlite3_result_zeroblob (sqlite3_context *, int n)
SQLITE_API int sqlite3_create_collation (sqlite3 *, const char *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *))
SQLITE_API int sqlite3_create_collation_v2 (sqlite3 *, const char *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *), void(*xDestroy)(void *))
SQLITE_API int sqlite3_create_collation16 (sqlite3 *, const void *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *))
SQLITE_API int sqlite3_collation_needed (sqlite3 *, void *, void(*)(void *, sqlite3 *, int eTextRep, const char *))
SQLITE_API int sqlite3_collation_needed16 (sqlite3 *, void *, void(*)(void *, sqlite3 *, int eTextRep, const void *))
SQLITE_API int sqlite3_sleep (int)
SQLITE_API int sqlite3_get_autocommit (sqlite3 *)
SQLITE_API sqlite3sqlite3_db_handle (sqlite3_stmt *)
SQLITE_API sqlite3_stmtsqlite3_next_stmt (sqlite3 *pDb, sqlite3_stmt *pStmt)
SQLITE_API void * sqlite3_commit_hook (sqlite3 *, int(*)(void *), void *)
SQLITE_API void * sqlite3_rollback_hook (sqlite3 *, void(*)(void *), void *)
SQLITE_API void * sqlite3_update_hook (sqlite3 *, void(*)(void *, int, char const *, char const *, sqlite3_int64), void *)
SQLITE_API int sqlite3_enable_shared_cache (int)
SQLITE_API int sqlite3_release_memory (int)
SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64 (sqlite3_int64 N)
SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit (int N)
SQLITE_API int sqlite3_table_column_metadata (sqlite3 *db, const char *zDbName, const char *zTableName, const char *zColumnName, char const **pzDataType, char const **pzCollSeq, int *pNotNull, int *pPrimaryKey, int *pAutoinc)
SQLITE_API int sqlite3_load_extension (sqlite3 *db, const char *zFile, const char *zProc, char **pzErrMsg)
SQLITE_API int sqlite3_enable_load_extension (sqlite3 *db, int onoff)
SQLITE_API int sqlite3_auto_extension (void(*xEntryPoint)(void))
SQLITE_API void sqlite3_reset_auto_extension (void)
SQLITE_API int sqlite3_create_module (sqlite3 *db, const char *zName, const sqlite3_module *p, void *pClientData)
SQLITE_API int sqlite3_create_module_v2 (sqlite3 *db, const char *zName, const sqlite3_module *p, void *pClientData, void(*xDestroy)(void *))
SQLITE_API int sqlite3_declare_vtab (sqlite3 *, const char *zSQL)
SQLITE_API int sqlite3_overload_function (sqlite3 *, const char *zFuncName, int nArg)
SQLITE_API int sqlite3_blob_open (sqlite3 *, const char *zDb, const char *zTable, const char *zColumn, sqlite3_int64 iRow, int flags, sqlite3_blob **ppBlob)
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_blob_reopen (sqlite3_blob *, sqlite3_int64)
SQLITE_API int sqlite3_blob_close (sqlite3_blob *)
SQLITE_API int sqlite3_blob_bytes (sqlite3_blob *)
SQLITE_API int sqlite3_blob_read (sqlite3_blob *, void *Z, int N, int iOffset)
SQLITE_API int sqlite3_blob_write (sqlite3_blob *, const void *z, int n, int iOffset)
SQLITE_API sqlite3_vfssqlite3_vfs_find (const char *zVfsName)
SQLITE_API int sqlite3_vfs_register (sqlite3_vfs *, int makeDflt)
SQLITE_API int sqlite3_vfs_unregister (sqlite3_vfs *)
SQLITE_API sqlite3_mutexsqlite3_mutex_alloc (int)
SQLITE_API void sqlite3_mutex_free (sqlite3_mutex *)
SQLITE_API void sqlite3_mutex_enter (sqlite3_mutex *)
SQLITE_API int sqlite3_mutex_try (sqlite3_mutex *)
SQLITE_API void sqlite3_mutex_leave (sqlite3_mutex *)
SQLITE_API int sqlite3_mutex_held (sqlite3_mutex *)
SQLITE_API int sqlite3_mutex_notheld (sqlite3_mutex *)
SQLITE_API sqlite3_mutexsqlite3_db_mutex (sqlite3 *)
SQLITE_API int sqlite3_file_control (sqlite3 *, const char *zDbName, int op, void *)
SQLITE_API int sqlite3_test_control (int op,...)
SQLITE_API int sqlite3_status (int op, int *pCurrent, int *pHighwater, int resetFlag)
SQLITE_API int sqlite3_db_status (sqlite3 *, int op, int *pCur, int *pHiwtr, int resetFlg)
SQLITE_API int sqlite3_stmt_status (sqlite3_stmt *, int op, int resetFlg)
SQLITE_API sqlite3_backupsqlite3_backup_init (sqlite3 *pDest, const char *zDestName, sqlite3 *pSource, const char *zSourceName)
SQLITE_API int sqlite3_backup_step (sqlite3_backup *p, int nPage)
SQLITE_API int sqlite3_backup_finish (sqlite3_backup *p)
SQLITE_API int sqlite3_backup_remaining (sqlite3_backup *p)
SQLITE_API int sqlite3_backup_pagecount (sqlite3_backup *p)
SQLITE_API int sqlite3_unlock_notify (sqlite3 *pBlocked, void(*xNotify)(void **apArg, int nArg), void *pNotifyArg)
SQLITE_API int sqlite3_strnicmp (const char *, const char *, int)
SQLITE_API void sqlite3_log (int iErrCode, const char *zFormat,...)
SQLITE_API void * sqlite3_wal_hook (sqlite3 *, int(*)(void *, sqlite3 *, const char *, int), void *)
SQLITE_API int sqlite3_wal_autocheckpoint (sqlite3 *db, int N)
SQLITE_API int sqlite3_wal_checkpoint (sqlite3 *db, const char *zDb)
SQLITE_API int sqlite3_wal_checkpoint_v2 (sqlite3 *db, const char *zDb, int eMode, int *pnLog, int *pnCkpt)
SQLITE_API int sqlite3_vtab_config (sqlite3 *, int op,...)
SQLITE_API int sqlite3_vtab_on_conflict (sqlite3 *)
SQLITE_API int sqlite3_rtree_geometry_callback (sqlite3 *db, const char *zGeom, int(*xGeom)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes), void *pContext)

Variables

SQLITE_API SQLITE_EXTERN const char sqlite3_version []
SQLITE_API SQLITE_EXTERN char * sqlite3_temp_directory

Class Documentation

struct sqlite3_file

Definition at line 1129 of file sqlite3.c.

Collaboration diagram for sqlite3_file:
Class Members
struct sqlite3_io_methods * pMethods
struct sqlite3_index_info

Definition at line 5378 of file sqlite3.c.

Collaboration diagram for sqlite3_index_info:
Class Members
struct sqlite3_index_constraint * aConstraint
struct
sqlite3_index_constraint_usage *
aConstraintUsage
struct sqlite3_index_orderby * aOrderBy
double estimatedCost
int idxNum
char * idxStr
int nConstraint
int needToFreeIdxStr
int nOrderBy
int orderByConsumed
struct sqlite3_index_info::sqlite3_index_constraint

Definition at line 5381 of file sqlite3.c.

Class Members
int iColumn
int iTermOffset
unsigned char op
unsigned char usable
struct sqlite3_index_info::sqlite3_index_orderby

Definition at line 5388 of file sqlite3.c.

Class Members
unsigned char desc
int iColumn
struct sqlite3_index_info::sqlite3_index_constraint_usage

Definition at line 5393 of file sqlite3.c.

Class Members
int argvIndex
unsigned char omit
struct sqlite3_vtab

Definition at line 5476 of file sqlite3.c.

Collaboration diagram for sqlite3_vtab:
Class Members
int nRef
const sqlite3_module * pModule
char * zErrMsg
struct sqlite3_vtab_cursor

Definition at line 5500 of file sqlite3.c.

Collaboration diagram for sqlite3_vtab_cursor:
Class Members
sqlite3_vtab * pVtab

Define Documentation

Definition at line 6690 of file sqlite3.h.

#define SQLITE3_TEXT   3

Definition at line 3365 of file sqlite3.h.

#define SQLITE_ABORT   4 /* Callback routine requested an abort */

Definition at line 386 of file sqlite3.h.

#define SQLITE_ACCESS_EXISTS   0

Definition at line 985 of file sqlite3.h.

#define SQLITE_ACCESS_READ   2 /* Unused */

Definition at line 987 of file sqlite3.h.

#define SQLITE_ACCESS_READWRITE   1 /* Used by PRAGMA temp_store_directory */

Definition at line 986 of file sqlite3.h.

#define SQLITE_ALTER_TABLE   26 /* Database Name Table Name */

Definition at line 2284 of file sqlite3.h.

#define SQLITE_ANALYZE   28 /* Table Name NULL */

Definition at line 2286 of file sqlite3.h.

#define SQLITE_ANY   5 /* sqlite3_create_function only */

Definition at line 3723 of file sqlite3.h.

#define SQLITE_API

Definition at line 53 of file sqlite3.h.

#define SQLITE_ATTACH   24 /* Filename NULL */

Definition at line 2282 of file sqlite3.h.

#define SQLITE_AUTH   23 /* Authorization denied */

Definition at line 405 of file sqlite3.h.

#define SQLITE_BLOB   4

Definition at line 3358 of file sqlite3.h.

#define SQLITE_BUSY   5 /* The database file is locked */

Definition at line 387 of file sqlite3.h.

#define SQLITE_BUSY_RECOVERY   (SQLITE_BUSY | (1<<8))

Definition at line 459 of file sqlite3.h.

#define SQLITE_CANTOPEN   14 /* Unable to open the database file */

Definition at line 396 of file sqlite3.h.

#define SQLITE_CANTOPEN_NOTEMPDIR   (SQLITE_CANTOPEN | (1<<8))

Definition at line 460 of file sqlite3.h.

#define SQLITE_CHECKPOINT_FULL   1

Definition at line 6572 of file sqlite3.h.

#define SQLITE_CHECKPOINT_PASSIVE   0

Definition at line 6571 of file sqlite3.h.

#define SQLITE_CHECKPOINT_RESTART   2

Definition at line 6573 of file sqlite3.h.

Definition at line 1461 of file sqlite3.h.

Definition at line 1467 of file sqlite3.h.

Definition at line 1471 of file sqlite3.h.

#define SQLITE_CONFIG_HEAP   8 /* void*, int nByte, int min */

Definition at line 1464 of file sqlite3.h.

#define SQLITE_CONFIG_LOG   16 /* xFunc, void* */

Definition at line 1472 of file sqlite3.h.

#define SQLITE_CONFIG_LOOKASIDE   13 /* int int */

Definition at line 1469 of file sqlite3.h.

Definition at line 1460 of file sqlite3.h.

#define SQLITE_CONFIG_MEMSTATUS   9 /* boolean */

Definition at line 1465 of file sqlite3.h.

#define SQLITE_CONFIG_MULTITHREAD   2 /* nil */

Definition at line 1458 of file sqlite3.h.

Definition at line 1466 of file sqlite3.h.

#define SQLITE_CONFIG_PAGECACHE   7 /* void*, int sz, int N */

Definition at line 1463 of file sqlite3.h.

Definition at line 1470 of file sqlite3.h.

#define SQLITE_CONFIG_SCRATCH   6 /* void*, int sz, int N */

Definition at line 1462 of file sqlite3.h.

#define SQLITE_CONFIG_SERIALIZED   3 /* nil */

Definition at line 1459 of file sqlite3.h.

#define SQLITE_CONFIG_SINGLETHREAD   1 /* nil */

Definition at line 1457 of file sqlite3.h.

#define SQLITE_CONFIG_URI   17 /* int */

Definition at line 1473 of file sqlite3.h.

#define SQLITE_CONSTRAINT   19 /* Abort due to constraint violation */

Definition at line 401 of file sqlite3.h.

#define SQLITE_COPY   0 /* No longer used */

Definition at line 2291 of file sqlite3.h.

#define SQLITE_CORRUPT   11 /* The database disk image is malformed */

Definition at line 393 of file sqlite3.h.

#define SQLITE_CORRUPT_VTAB   (SQLITE_CORRUPT | (1<<8))

Definition at line 461 of file sqlite3.h.

#define SQLITE_CREATE_INDEX   1 /* Index Name Table Name */

Definition at line 2259 of file sqlite3.h.

#define SQLITE_CREATE_TABLE   2 /* Table Name NULL */

Definition at line 2260 of file sqlite3.h.

#define SQLITE_CREATE_TEMP_INDEX   3 /* Index Name Table Name */

Definition at line 2261 of file sqlite3.h.

#define SQLITE_CREATE_TEMP_TABLE   4 /* Table Name NULL */

Definition at line 2262 of file sqlite3.h.

#define SQLITE_CREATE_TEMP_TRIGGER   5 /* Trigger Name Table Name */

Definition at line 2263 of file sqlite3.h.

#define SQLITE_CREATE_TEMP_VIEW   6 /* View Name NULL */

Definition at line 2264 of file sqlite3.h.

#define SQLITE_CREATE_TRIGGER   7 /* Trigger Name Table Name */

Definition at line 2265 of file sqlite3.h.

#define SQLITE_CREATE_VIEW   8 /* View Name NULL */

Definition at line 2266 of file sqlite3.h.

#define SQLITE_CREATE_VTABLE   29 /* Table Name Module Name */

Definition at line 2287 of file sqlite3.h.

#define SQLITE_DBCONFIG_ENABLE_FKEY   1002 /* int int* */

Definition at line 1534 of file sqlite3.h.

#define SQLITE_DBCONFIG_ENABLE_TRIGGER   1003 /* int int* */

Definition at line 1535 of file sqlite3.h.

#define SQLITE_DBCONFIG_LOOKASIDE   1001 /* void* int int */

Definition at line 1533 of file sqlite3.h.

Definition at line 5795 of file sqlite3.h.

Definition at line 5798 of file sqlite3.h.

Definition at line 5800 of file sqlite3.h.

Definition at line 5799 of file sqlite3.h.

Definition at line 5794 of file sqlite3.h.

#define SQLITE_DBSTATUS_MAX   6 /* Largest defined DBSTATUS */

Definition at line 5801 of file sqlite3.h.

Definition at line 5796 of file sqlite3.h.

#define SQLITE_DBSTATUS_STMT_USED   3

Definition at line 5797 of file sqlite3.h.

#define SQLITE_DELETE   9 /* Table Name NULL */

Definition at line 2267 of file sqlite3.h.

#define SQLITE_DENY   1 /* Abort the SQL statement with an error */

Definition at line 2236 of file sqlite3.h.

Definition at line 70 of file sqlite3.h.

#define SQLITE_DETACH   25 /* Database Name NULL */

Definition at line 2283 of file sqlite3.h.

#define SQLITE_DONE   101 /* sqlite3_step() has finished executing */

Definition at line 410 of file sqlite3.h.

#define SQLITE_DROP_INDEX   10 /* Index Name Table Name */

Definition at line 2268 of file sqlite3.h.

#define SQLITE_DROP_TABLE   11 /* Table Name NULL */

Definition at line 2269 of file sqlite3.h.

#define SQLITE_DROP_TEMP_INDEX   12 /* Index Name Table Name */

Definition at line 2270 of file sqlite3.h.

#define SQLITE_DROP_TEMP_TABLE   13 /* Table Name NULL */

Definition at line 2271 of file sqlite3.h.

#define SQLITE_DROP_TEMP_TRIGGER   14 /* Trigger Name Table Name */

Definition at line 2272 of file sqlite3.h.

#define SQLITE_DROP_TEMP_VIEW   15 /* View Name NULL */

Definition at line 2273 of file sqlite3.h.

#define SQLITE_DROP_TRIGGER   16 /* Trigger Name Table Name */

Definition at line 2274 of file sqlite3.h.

#define SQLITE_DROP_VIEW   17 /* View Name NULL */

Definition at line 2275 of file sqlite3.h.

#define SQLITE_DROP_VTABLE   30 /* Table Name Module Name */

Definition at line 2288 of file sqlite3.h.

#define SQLITE_EMPTY   16 /* Database is empty */

Definition at line 398 of file sqlite3.h.

#define SQLITE_ERROR   1 /* SQL error or missing database */

Definition at line 383 of file sqlite3.h.

Definition at line 71 of file sqlite3.h.

#define SQLITE_EXTERN   extern

Definition at line 49 of file sqlite3.h.

#define SQLITE_FAIL   3

Definition at line 6657 of file sqlite3.h.

#define SQLITE_FCNTL_CHUNK_SIZE   6

Definition at line 750 of file sqlite3.h.

#define SQLITE_FCNTL_FILE_POINTER   7

Definition at line 751 of file sqlite3.h.

#define SQLITE_FCNTL_LOCKSTATE   1

Definition at line 745 of file sqlite3.h.

#define SQLITE_FCNTL_SIZE_HINT   5

Definition at line 749 of file sqlite3.h.

#define SQLITE_FCNTL_SYNC_OMITTED   8

Definition at line 752 of file sqlite3.h.

#define SQLITE_FLOAT   2

Definition at line 3357 of file sqlite3.h.

#define SQLITE_FORMAT   24 /* Auxiliary database format error */

Definition at line 406 of file sqlite3.h.

#define SQLITE_FULL   13 /* Insertion failed because database is full */

Definition at line 395 of file sqlite3.h.

#define SQLITE_FUNCTION   31 /* NULL Function Name */

Definition at line 2289 of file sqlite3.h.

#define SQLITE_GET_LOCKPROXYFILE   2

Definition at line 746 of file sqlite3.h.

#define SQLITE_IGNORE   2 /* Don't allow access, but don't generate an error */

Definition at line 2237 of file sqlite3.h.

Definition at line 4865 of file sqlite3.h.

#define SQLITE_INDEX_CONSTRAINT_GE   32

Definition at line 4869 of file sqlite3.h.

Definition at line 4866 of file sqlite3.h.

Definition at line 4867 of file sqlite3.h.

#define SQLITE_INDEX_CONSTRAINT_LT   16

Definition at line 4868 of file sqlite3.h.

Definition at line 4870 of file sqlite3.h.

#define SQLITE_INSERT   18 /* Table Name NULL */

Definition at line 2276 of file sqlite3.h.

#define SQLITE_INTEGER   1

Definition at line 3356 of file sqlite3.h.

#define SQLITE_INTERNAL   2 /* Internal logic error in SQLite */

Definition at line 384 of file sqlite3.h.

#define SQLITE_INTERRUPT   9 /* Operation terminated by sqlite3_interrupt()*/

Definition at line 391 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC   0x00000001

Definition at line 514 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC16K   0x00000040

Definition at line 520 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC1K   0x00000004

Definition at line 516 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC2K   0x00000008

Definition at line 517 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC32K   0x00000080

Definition at line 521 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC4K   0x00000010

Definition at line 518 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC512   0x00000002

Definition at line 515 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC64K   0x00000100

Definition at line 522 of file sqlite3.h.

#define SQLITE_IOCAP_ATOMIC8K   0x00000020

Definition at line 519 of file sqlite3.h.

#define SQLITE_IOCAP_SAFE_APPEND   0x00000200

Definition at line 523 of file sqlite3.h.

#define SQLITE_IOCAP_SEQUENTIAL   0x00000400

Definition at line 524 of file sqlite3.h.

#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN   0x00000800

Definition at line 525 of file sqlite3.h.

#define SQLITE_IOERR   10 /* Some kind of disk I/O error occurred */

Definition at line 392 of file sqlite3.h.

#define SQLITE_IOERR_ACCESS   (SQLITE_IOERR | (13<<8))

Definition at line 448 of file sqlite3.h.

#define SQLITE_IOERR_BLOCKED   (SQLITE_IOERR | (11<<8))

Definition at line 446 of file sqlite3.h.

#define SQLITE_IOERR_CHECKRESERVEDLOCK   (SQLITE_IOERR | (14<<8))

Definition at line 449 of file sqlite3.h.

#define SQLITE_IOERR_CLOSE   (SQLITE_IOERR | (16<<8))

Definition at line 451 of file sqlite3.h.

#define SQLITE_IOERR_DELETE   (SQLITE_IOERR | (10<<8))

Definition at line 445 of file sqlite3.h.

#define SQLITE_IOERR_DIR_CLOSE   (SQLITE_IOERR | (17<<8))

Definition at line 452 of file sqlite3.h.

#define SQLITE_IOERR_DIR_FSYNC   (SQLITE_IOERR | (5<<8))

Definition at line 440 of file sqlite3.h.

#define SQLITE_IOERR_FSTAT   (SQLITE_IOERR | (7<<8))

Definition at line 442 of file sqlite3.h.

#define SQLITE_IOERR_FSYNC   (SQLITE_IOERR | (4<<8))

Definition at line 439 of file sqlite3.h.

#define SQLITE_IOERR_LOCK   (SQLITE_IOERR | (15<<8))

Definition at line 450 of file sqlite3.h.

#define SQLITE_IOERR_NOMEM   (SQLITE_IOERR | (12<<8))

Definition at line 447 of file sqlite3.h.

#define SQLITE_IOERR_RDLOCK   (SQLITE_IOERR | (9<<8))

Definition at line 444 of file sqlite3.h.

#define SQLITE_IOERR_READ   (SQLITE_IOERR | (1<<8))

Definition at line 436 of file sqlite3.h.

#define SQLITE_IOERR_SEEK   (SQLITE_IOERR | (22<<8))

Definition at line 457 of file sqlite3.h.

#define SQLITE_IOERR_SHMLOCK   (SQLITE_IOERR | (20<<8))

Definition at line 455 of file sqlite3.h.

#define SQLITE_IOERR_SHMMAP   (SQLITE_IOERR | (21<<8))

Definition at line 456 of file sqlite3.h.

#define SQLITE_IOERR_SHMOPEN   (SQLITE_IOERR | (18<<8))

Definition at line 453 of file sqlite3.h.

#define SQLITE_IOERR_SHMSIZE   (SQLITE_IOERR | (19<<8))

Definition at line 454 of file sqlite3.h.

#define SQLITE_IOERR_SHORT_READ   (SQLITE_IOERR | (2<<8))

Definition at line 437 of file sqlite3.h.

#define SQLITE_IOERR_TRUNCATE   (SQLITE_IOERR | (6<<8))

Definition at line 441 of file sqlite3.h.

#define SQLITE_IOERR_UNLOCK   (SQLITE_IOERR | (8<<8))

Definition at line 443 of file sqlite3.h.

#define SQLITE_IOERR_WRITE   (SQLITE_IOERR | (3<<8))

Definition at line 438 of file sqlite3.h.

#define SQLITE_LAST_ERRNO   4

Definition at line 748 of file sqlite3.h.

#define SQLITE_LIMIT_ATTACHED   7

Definition at line 2747 of file sqlite3.h.

#define SQLITE_LIMIT_COLUMN   2

Definition at line 2742 of file sqlite3.h.

Definition at line 2744 of file sqlite3.h.

#define SQLITE_LIMIT_EXPR_DEPTH   3

Definition at line 2743 of file sqlite3.h.

#define SQLITE_LIMIT_FUNCTION_ARG   6

Definition at line 2746 of file sqlite3.h.

#define SQLITE_LIMIT_LENGTH   0

Definition at line 2740 of file sqlite3.h.

Definition at line 2748 of file sqlite3.h.

#define SQLITE_LIMIT_SQL_LENGTH   1

Definition at line 2741 of file sqlite3.h.

#define SQLITE_LIMIT_TRIGGER_DEPTH   10

Definition at line 2750 of file sqlite3.h.

Definition at line 2749 of file sqlite3.h.

#define SQLITE_LIMIT_VDBE_OP   5

Definition at line 2745 of file sqlite3.h.

#define SQLITE_LOCK_EXCLUSIVE   4

Definition at line 538 of file sqlite3.h.

#define SQLITE_LOCK_NONE   0

Definition at line 534 of file sqlite3.h.

#define SQLITE_LOCK_PENDING   3

Definition at line 537 of file sqlite3.h.

#define SQLITE_LOCK_RESERVED   2

Definition at line 536 of file sqlite3.h.

#define SQLITE_LOCK_SHARED   1

Definition at line 535 of file sqlite3.h.

#define SQLITE_LOCKED   6 /* A table in the database is locked */

Definition at line 388 of file sqlite3.h.

#define SQLITE_LOCKED_SHAREDCACHE   (SQLITE_LOCKED | (1<<8))

Definition at line 458 of file sqlite3.h.

#define SQLITE_MISMATCH   20 /* Data type mismatch */

Definition at line 402 of file sqlite3.h.

#define SQLITE_MISUSE   21 /* Library used incorrectly */

Definition at line 403 of file sqlite3.h.

#define SQLITE_MUTEX_FAST   0

Definition at line 5480 of file sqlite3.h.

#define SQLITE_MUTEX_RECURSIVE   1

Definition at line 5481 of file sqlite3.h.

#define SQLITE_MUTEX_STATIC_LRU   6 /* lru page list */

Definition at line 5487 of file sqlite3.h.

#define SQLITE_MUTEX_STATIC_LRU2   7 /* NOT USED */

Definition at line 5488 of file sqlite3.h.

Definition at line 5482 of file sqlite3.h.

#define SQLITE_MUTEX_STATIC_MEM   3 /* sqlite3_malloc() */

Definition at line 5483 of file sqlite3.h.

#define SQLITE_MUTEX_STATIC_MEM2   4 /* NOT USED */

Definition at line 5484 of file sqlite3.h.

Definition at line 5485 of file sqlite3.h.

Definition at line 5489 of file sqlite3.h.

#define SQLITE_MUTEX_STATIC_PRNG   5 /* sqlite3_random() */

Definition at line 5486 of file sqlite3.h.

#define SQLITE_NOLFS   22 /* Uses OS features not supported on host */

Definition at line 404 of file sqlite3.h.

#define SQLITE_NOMEM   7 /* A malloc() failed */

Definition at line 389 of file sqlite3.h.

#define SQLITE_NOTADB   26 /* File opened that is not a database file */

Definition at line 408 of file sqlite3.h.

#define SQLITE_NOTFOUND   12 /* Unknown opcode in sqlite3_file_control() */

Definition at line 394 of file sqlite3.h.

#define SQLITE_NULL   5

Definition at line 3359 of file sqlite3.h.

#define SQLITE_OK   0 /* Successful result */

Definition at line 381 of file sqlite3.h.

#define SQLITE_OPEN_AUTOPROXY   0x00000020 /* VFS only */

Definition at line 477 of file sqlite3.h.

#define SQLITE_OPEN_CREATE   0x00000004 /* Ok for sqlite3_open_v2() */

Definition at line 474 of file sqlite3.h.

#define SQLITE_OPEN_DELETEONCLOSE   0x00000008 /* VFS only */

Definition at line 475 of file sqlite3.h.

#define SQLITE_OPEN_EXCLUSIVE   0x00000010 /* VFS only */

Definition at line 476 of file sqlite3.h.

#define SQLITE_OPEN_FULLMUTEX   0x00010000 /* Ok for sqlite3_open_v2() */

Definition at line 487 of file sqlite3.h.

#define SQLITE_OPEN_MAIN_DB   0x00000100 /* VFS only */

Definition at line 479 of file sqlite3.h.

#define SQLITE_OPEN_MAIN_JOURNAL   0x00000800 /* VFS only */

Definition at line 482 of file sqlite3.h.

#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000 /* VFS only */

Definition at line 485 of file sqlite3.h.

#define SQLITE_OPEN_NOMUTEX   0x00008000 /* Ok for sqlite3_open_v2() */

Definition at line 486 of file sqlite3.h.

#define SQLITE_OPEN_PRIVATECACHE   0x00040000 /* Ok for sqlite3_open_v2() */

Definition at line 489 of file sqlite3.h.

#define SQLITE_OPEN_READONLY   0x00000001 /* Ok for sqlite3_open_v2() */

Definition at line 472 of file sqlite3.h.

#define SQLITE_OPEN_READWRITE   0x00000002 /* Ok for sqlite3_open_v2() */

Definition at line 473 of file sqlite3.h.

#define SQLITE_OPEN_SHAREDCACHE   0x00020000 /* Ok for sqlite3_open_v2() */

Definition at line 488 of file sqlite3.h.

#define SQLITE_OPEN_SUBJOURNAL   0x00002000 /* VFS only */

Definition at line 484 of file sqlite3.h.

#define SQLITE_OPEN_TEMP_DB   0x00000200 /* VFS only */

Definition at line 480 of file sqlite3.h.

#define SQLITE_OPEN_TEMP_JOURNAL   0x00001000 /* VFS only */

Definition at line 483 of file sqlite3.h.

#define SQLITE_OPEN_TRANSIENT_DB   0x00000400 /* VFS only */

Definition at line 481 of file sqlite3.h.

#define SQLITE_OPEN_URI   0x00000040 /* Ok for sqlite3_open_v2() */

Definition at line 478 of file sqlite3.h.

#define SQLITE_OPEN_WAL   0x00080000 /* VFS only */

Definition at line 490 of file sqlite3.h.

#define SQLITE_PERM   3 /* Access permission denied */

Definition at line 385 of file sqlite3.h.

#define SQLITE_PRAGMA   19 /* Pragma Name 1st arg or NULL */

Definition at line 2277 of file sqlite3.h.

#define SQLITE_PROTOCOL   15 /* Database lock protocol error */

Definition at line 397 of file sqlite3.h.

#define SQLITE_RANGE   25 /* 2nd parameter to sqlite3_bind out of range */

Definition at line 407 of file sqlite3.h.

#define SQLITE_READ   20 /* Table Name Column Name */

Definition at line 2278 of file sqlite3.h.

#define SQLITE_READONLY   8 /* Attempt to write a readonly database */

Definition at line 390 of file sqlite3.h.

#define SQLITE_READONLY_CANTLOCK   (SQLITE_READONLY | (2<<8))

Definition at line 463 of file sqlite3.h.

#define SQLITE_READONLY_RECOVERY   (SQLITE_READONLY | (1<<8))

Definition at line 462 of file sqlite3.h.

#define SQLITE_REINDEX   27 /* Index Name NULL */

Definition at line 2285 of file sqlite3.h.

#define SQLITE_REPLACE   5

Definition at line 6659 of file sqlite3.h.

#define SQLITE_ROLLBACK   1

Definition at line 6655 of file sqlite3.h.

#define SQLITE_ROW   100 /* sqlite3_step() has another row ready */

Definition at line 409 of file sqlite3.h.

#define SQLITE_SAVEPOINT   32 /* Operation Savepoint Name */

Definition at line 2290 of file sqlite3.h.

#define SQLITE_SCHEMA   17 /* The database schema changed */

Definition at line 399 of file sqlite3.h.

#define SQLITE_SELECT   21 /* NULL NULL */

Definition at line 2279 of file sqlite3.h.

#define SQLITE_SET_LOCKPROXYFILE   3

Definition at line 747 of file sqlite3.h.

#define SQLITE_SHM_EXCLUSIVE   8

Definition at line 1014 of file sqlite3.h.

#define SQLITE_SHM_LOCK   2

Definition at line 1012 of file sqlite3.h.

#define SQLITE_SHM_NLOCK   8

Definition at line 1024 of file sqlite3.h.

#define SQLITE_SHM_SHARED   4

Definition at line 1013 of file sqlite3.h.

#define SQLITE_SHM_UNLOCK   1

Definition at line 1011 of file sqlite3.h.

#define SQLITE_SOURCE_ID   "2011-06-28 17:39:05 af0d91adf497f5f36ec3813f04235a6e195a605f"

Definition at line 112 of file sqlite3.h.

Definition at line 3930 of file sqlite3.h.

Definition at line 5707 of file sqlite3.h.

#define SQLITE_STATUS_MALLOC_SIZE   5

Definition at line 5703 of file sqlite3.h.

#define SQLITE_STATUS_MEMORY_USED   0

Definition at line 5698 of file sqlite3.h.

Definition at line 5700 of file sqlite3.h.

Definition at line 5705 of file sqlite3.h.

Definition at line 5699 of file sqlite3.h.

Definition at line 5704 of file sqlite3.h.

Definition at line 5702 of file sqlite3.h.

Definition at line 5706 of file sqlite3.h.

Definition at line 5701 of file sqlite3.h.

Definition at line 5860 of file sqlite3.h.

Definition at line 5858 of file sqlite3.h.

#define SQLITE_STMTSTATUS_SORT   2

Definition at line 5859 of file sqlite3.h.

#define SQLITE_SYNC_DATAONLY   0x00010

Definition at line 568 of file sqlite3.h.

#define SQLITE_SYNC_FULL   0x00003

Definition at line 567 of file sqlite3.h.

#define SQLITE_SYNC_NORMAL   0x00002

Definition at line 566 of file sqlite3.h.

#define SQLITE_TESTCTRL_ALWAYS   13

Definition at line 5575 of file sqlite3.h.

#define SQLITE_TESTCTRL_ASSERT   12

Definition at line 5574 of file sqlite3.h.

Definition at line 5572 of file sqlite3.h.

Definition at line 5570 of file sqlite3.h.

Definition at line 5571 of file sqlite3.h.

#define SQLITE_TESTCTRL_FIRST   5

Definition at line 5566 of file sqlite3.h.

#define SQLITE_TESTCTRL_ISKEYWORD   16

Definition at line 5578 of file sqlite3.h.

#define SQLITE_TESTCTRL_LAST   19

Definition at line 5582 of file sqlite3.h.

Definition at line 5581 of file sqlite3.h.

Definition at line 5577 of file sqlite3.h.

Definition at line 5573 of file sqlite3.h.

#define SQLITE_TESTCTRL_PGHDRSZ   17

Definition at line 5579 of file sqlite3.h.

Definition at line 5569 of file sqlite3.h.

Definition at line 5568 of file sqlite3.h.

#define SQLITE_TESTCTRL_PRNG_SAVE   5

Definition at line 5567 of file sqlite3.h.

#define SQLITE_TESTCTRL_RESERVE   14

Definition at line 5576 of file sqlite3.h.

Definition at line 5580 of file sqlite3.h.

#define SQLITE_TEXT   3

Definition at line 3363 of file sqlite3.h.

#define SQLITE_TOOBIG   18 /* String or BLOB exceeds size limit */

Definition at line 400 of file sqlite3.h.

#define SQLITE_TRANSACTION   22 /* Operation NULL */

Definition at line 2280 of file sqlite3.h.

Definition at line 3931 of file sqlite3.h.

#define SQLITE_UPDATE   23 /* Table Name Column Name */

Definition at line 2281 of file sqlite3.h.

#define SQLITE_UTF16   4 /* Use native byte order */

Definition at line 3722 of file sqlite3.h.

Definition at line 3724 of file sqlite3.h.

#define SQLITE_UTF16BE   3

Definition at line 3721 of file sqlite3.h.

#define SQLITE_UTF16LE   2

Definition at line 3720 of file sqlite3.h.

#define SQLITE_UTF8   1

Definition at line 3719 of file sqlite3.h.

#define SQLITE_VERSION   "3.7.7.1"

Definition at line 110 of file sqlite3.h.

#define SQLITE_VERSION_NUMBER   3007007

Definition at line 111 of file sqlite3.h.

Definition at line 6630 of file sqlite3.h.


Typedef Documentation

typedef struct Mem

Definition at line 2938 of file sqlite3.h.

typedef struct sqlite3

Definition at line 227 of file sqlite3.h.

typedef struct sqlite3_backup

Definition at line 6050 of file sqlite3.h.

typedef struct sqlite3_blob

Definition at line 5008 of file sqlite3.h.

typedef int(* sqlite3_callback)(void *, int, char **, char **)

Definition at line 297 of file sqlite3.h.

typedef struct sqlite3_context

Definition at line 2952 of file sqlite3.h.

typedef void(* sqlite3_destructor_type)(void *)

Definition at line 3929 of file sqlite3.h.

typedef struct sqlite3_file

Definition at line 581 of file sqlite3.h.

typedef struct sqlite3_index_info

Definition at line 4723 of file sqlite3.h.

Definition at line 255 of file sqlite3.h.

typedef struct sqlite3_io_methods

Definition at line 676 of file sqlite3.h.

typedef struct sqlite3_mem_methods

Definition at line 1225 of file sqlite3.h.

typedef struct sqlite3_module

Definition at line 4725 of file sqlite3.h.

typedef struct sqlite3_mutex

Definition at line 765 of file sqlite3.h.

typedef struct sqlite3_mutex_methods

Definition at line 5423 of file sqlite3.h.

typedef struct sqlite3_pcache

Definition at line 5873 of file sqlite3.h.

typedef struct sqlite3_pcache_methods

Definition at line 6025 of file sqlite3.h.

typedef struct sqlite3_rtree_geometry

Definition at line 6697 of file sqlite3.h.

typedef struct sqlite3_stmt

Definition at line 2645 of file sqlite3.h.

typedef void(* sqlite3_syscall_ptr)(void)

Definition at line 925 of file sqlite3.h.

Definition at line 256 of file sqlite3.h.

typedef struct sqlite3_vfs

Definition at line 924 of file sqlite3.h.

typedef struct sqlite3_vtab

Definition at line 4722 of file sqlite3.h.

typedef struct sqlite3_vtab_cursor

Definition at line 4724 of file sqlite3.h.

typedef long long int sqlite_int64

Definition at line 252 of file sqlite3.h.

typedef unsigned long long int sqlite_uint64

Definition at line 253 of file sqlite3.h.


Function Documentation

Definition at line 61359 of file sqlite3.c.

                                                                         {
  Mem *pMem;
  assert( p && p->pFunc && p->pFunc->xStep );
  assert( sqlite3_mutex_held(p->s.db->mutex) );
  pMem = p->pMem;
  testcase( nByte<0 );
  if( (pMem->flags & MEM_Agg)==0 ){
    if( nByte<=0 ){
      sqlite3VdbeMemReleaseExternal(pMem);
      pMem->flags = MEM_Null;
      pMem->z = 0;
    }else{
      sqlite3VdbeMemGrow(pMem, nByte, 0);
      pMem->flags = MEM_Agg;
      pMem->u.pDef = p->pFunc;
      if( pMem->z ){
        memset(pMem->z, 0, nByte);
      }
    }

Here is the call graph for this function:

Definition at line 61451 of file sqlite3.c.

                                                          {
SQLITE_API int sqlite3_auto_extension ( void(*)(void)  xEntryPoint)

Definition at line 87984 of file sqlite3.c.

                                                          {
  int rc = SQLITE_OK;
#ifndef SQLITE_OMIT_AUTOINIT
  rc = sqlite3_initialize();
  if( rc ){
    return rc;
  }else
#endif
  {
    int i;
#if SQLITE_THREADSAFE
    sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
#endif
    wsdAutoextInit;
    sqlite3_mutex_enter(mutex);
    for(i=0; i<wsdAutoext.nExt; i++){
      if( wsdAutoext.aExt[i]==xInit ) break;
    }
    if( i==wsdAutoext.nExt ){
      int nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
      void (**aNew)(void);
      aNew = sqlite3_realloc(wsdAutoext.aExt, nByte);
      if( aNew==0 ){
        rc = SQLITE_NOMEM;
      }else{
        wsdAutoext.aExt = aNew;
        wsdAutoext.aExt[wsdAutoext.nExt] = xInit;
        wsdAutoext.nExt++;
      }
    }
    sqlite3_mutex_leave(mutex);
    assert( (rc&0xff)==rc );

Here is the call graph for this function:

Definition at line 56223 of file sqlite3.c.

                                                       {
  sqlite3_backup **pp;                 /* Ptr to head of pagers backup list */
  sqlite3_mutex *mutex;                /* Mutex to protect source database */
  int rc;                              /* Value to return */

  /* Enter the mutexes */
  if( p==0 ) return SQLITE_OK;
  sqlite3_mutex_enter(p->pSrcDb->mutex);
  sqlite3BtreeEnter(p->pSrc);
  mutex = p->pSrcDb->mutex;
  if( p->pDestDb ){
    sqlite3_mutex_enter(p->pDestDb->mutex);
  }

  /* Detach this backup from the source pager. */
  if( p->pDestDb ){
    p->pSrc->nBackup--;
  }
  if( p->isAttached ){
    pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
    while( *pp!=p ){
      pp = &(*pp)->pNext;
    }
    *pp = p->pNext;
  }

  /* If a transaction is still open on the Btree, roll it back. */
  sqlite3BtreeRollback(p->pDest);

  /* Set the error code of the destination database handle. */
  rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc;
  sqlite3Error(p->pDestDb, rc, 0);

  /* Exit the mutexes and free the backup context structure. */
  if( p->pDestDb ){
    sqlite3_mutex_leave(p->pDestDb->mutex);
  }
  sqlite3BtreeLeave(p->pSrc);
  if( p->pDestDb ){
    /* EVIDENCE-OF: R-64852-21591 The sqlite3_backup object is created by a
    ** call to sqlite3_backup_init() and is destroyed by a call to
    ** sqlite3_backup_finish(). */
    sqlite3_free(p);
  }

Here is the call graph for this function:

SQLITE_API sqlite3_backup* sqlite3_backup_init ( sqlite3 pDest,
const char *  zDestName,
sqlite3 pSource,
const char *  zSourceName 
)

Definition at line 55821 of file sqlite3.c.

 {
  sqlite3_backup *p;                    /* Value to return */

  /* Lock the source database handle. The destination database
  ** handle is not locked in this routine, but it is locked in
  ** sqlite3_backup_step(). The user is required to ensure that no
  ** other thread accesses the destination handle for the duration
  ** of the backup operation.  Any attempt to use the destination
  ** database connection while a backup is in progress may cause
  ** a malfunction or a deadlock.
  */
  sqlite3_mutex_enter(pSrcDb->mutex);
  sqlite3_mutex_enter(pDestDb->mutex);

  if( pSrcDb==pDestDb ){
    sqlite3Error(
        pDestDb, SQLITE_ERROR, "source and destination must be distinct"
    );
    p = 0;
  }else {
    /* Allocate space for a new sqlite3_backup object...
    ** EVIDENCE-OF: R-64852-21591 The sqlite3_backup object is created by a
    ** call to sqlite3_backup_init() and is destroyed by a call to
    ** sqlite3_backup_finish(). */
    p = (sqlite3_backup *)sqlite3_malloc(sizeof(sqlite3_backup));
    if( !p ){
      sqlite3Error(pDestDb, SQLITE_NOMEM, 0);
    }
  }

  /* If the allocation succeeded, populate the new object. */
  if( p ){
    memset(p, 0, sizeof(sqlite3_backup));
    p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);
    p->pDest = findBtree(pDestDb, pDestDb, zDestDb);
    p->pDestDb = pDestDb;
    p->pSrcDb = pSrcDb;
    p->iNext = 1;
    p->isAttached = 0;

    if( 0==p->pSrc || 0==p->pDest || setDestPgsz(p)==SQLITE_NOMEM ){
      /* One (or both) of the named databases did not exist or an OOM
      ** error was hit.  The error has already been written into the
      ** pDestDb handle.  All that is left to do here is free the
      ** sqlite3_backup structure.
      */
      sqlite3_free(p);
      p = 0;
    }
  }
  if( p ){
    p->pSrc->nBackup++;
  }

  sqlite3_mutex_leave(pDestDb->mutex);

Here is the call graph for this function:

Definition at line 56283 of file sqlite3.c.

                                                          {

Definition at line 56275 of file sqlite3.c.

                                                          {

Definition at line 56009 of file sqlite3.c.

                                                                {
  int rc;
  int destMode;       /* Destination journal mode */
  int pgszSrc = 0;    /* Source page size */
  int pgszDest = 0;   /* Destination page size */

  sqlite3_mutex_enter(p->pSrcDb->mutex);
  sqlite3BtreeEnter(p->pSrc);
  if( p->pDestDb ){
    sqlite3_mutex_enter(p->pDestDb->mutex);
  }

  rc = p->rc;
  if( !isFatalError(rc) ){
    Pager * const pSrcPager = sqlite3BtreePager(p->pSrc);     /* Source pager */
    Pager * const pDestPager = sqlite3BtreePager(p->pDest);   /* Dest pager */
    int ii;                            /* Iterator variable */
    int nSrcPage = -1;                 /* Size of source db in pages */
    int bCloseTrans = 0;               /* True if src db requires unlocking */

    /* If the source pager is currently in a write-transaction, return
    ** SQLITE_BUSY immediately.
    */
    if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){
      rc = SQLITE_BUSY;
    }else{
      rc = SQLITE_OK;
    }

    /* Lock the destination database, if it is not locked already. */
    if( SQLITE_OK==rc && p->bDestLocked==0
     && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2)) 
    ){
      p->bDestLocked = 1;
      sqlite3BtreeGetMeta(p->pDest, BTREE_SCHEMA_VERSION, &p->iDestSchema);
    }

    /* If there is no open read-transaction on the source database, open
    ** one now. If a transaction is opened here, then it will be closed
    ** before this function exits.
    */
    if( rc==SQLITE_OK && 0==sqlite3BtreeIsInReadTrans(p->pSrc) ){
      rc = sqlite3BtreeBeginTrans(p->pSrc, 0);
      bCloseTrans = 1;
    }

    /* Do not allow backup if the destination database is in WAL mode
    ** and the page sizes are different between source and destination */
    pgszSrc = sqlite3BtreeGetPageSize(p->pSrc);
    pgszDest = sqlite3BtreeGetPageSize(p->pDest);
    destMode = sqlite3PagerGetJournalMode(sqlite3BtreePager(p->pDest));
    if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){
      rc = SQLITE_READONLY;
    }
  
    /* Now that there is a read-lock on the source database, query the
    ** source pager for the number of pages in the database.
    */
    nSrcPage = (int)sqlite3BtreeLastPage(p->pSrc);
    assert( nSrcPage>=0 );
    for(ii=0; (nPage<0 || ii<nPage) && p->iNext<=(Pgno)nSrcPage && !rc; ii++){
      const Pgno iSrcPg = p->iNext;                 /* Source page number */
      if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){
        DbPage *pSrcPg;                             /* Source page object */
        rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg);
        if( rc==SQLITE_OK ){
          rc = backupOnePage(p, iSrcPg, sqlite3PagerGetData(pSrcPg));
          sqlite3PagerUnref(pSrcPg);
        }
      }
      p->iNext++;
    }
    if( rc==SQLITE_OK ){
      p->nPagecount = nSrcPage;
      p->nRemaining = nSrcPage+1-p->iNext;
      if( p->iNext>(Pgno)nSrcPage ){
        rc = SQLITE_DONE;
      }else if( !p->isAttached ){
        attachBackupObject(p);
      }
    }
  
    /* Update the schema version field in the destination database. This
    ** is to make sure that the schema-version really does change in
    ** the case where the source and destination databases have the
    ** same schema version.
    */
    if( rc==SQLITE_DONE 
     && (rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1))==SQLITE_OK
    ){
      int nDestTruncate;
  
      if( p->pDestDb ){
        sqlite3ResetInternalSchema(p->pDestDb, -1);
      }

      /* Set nDestTruncate to the final number of pages in the destination
      ** database. The complication here is that the destination page
      ** size may be different to the source page size. 
      **
      ** If the source page size is smaller than the destination page size, 
      ** round up. In this case the call to sqlite3OsTruncate() below will
      ** fix the size of the file. However it is important to call
      ** sqlite3PagerTruncateImage() here so that any pages in the 
      ** destination file that lie beyond the nDestTruncate page mark are
      ** journalled by PagerCommitPhaseOne() before they are destroyed
      ** by the file truncation.
      */
      assert( pgszSrc==sqlite3BtreeGetPageSize(p->pSrc) );
      assert( pgszDest==sqlite3BtreeGetPageSize(p->pDest) );
      if( pgszSrc<pgszDest ){
        int ratio = pgszDest/pgszSrc;
        nDestTruncate = (nSrcPage+ratio-1)/ratio;
        if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){
          nDestTruncate--;
        }
      }else{
        nDestTruncate = nSrcPage * (pgszSrc/pgszDest);
      }
      sqlite3PagerTruncateImage(pDestPager, nDestTruncate);

      if( pgszSrc<pgszDest ){
        /* If the source page-size is smaller than the destination page-size,
        ** two extra things may need to happen:
        **
        **   * The destination may need to be truncated, and
        **
        **   * Data stored on the pages immediately following the 
        **     pending-byte page in the source database may need to be
        **     copied into the destination database.
        */
        const i64 iSize = (i64)pgszSrc * (i64)nSrcPage;
        sqlite3_file * const pFile = sqlite3PagerFile(pDestPager);
        i64 iOff;
        i64 iEnd;

        assert( pFile );
        assert( (i64)nDestTruncate*(i64)pgszDest >= iSize || (
              nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1)
           && iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+pgszDest
        ));

        /* This call ensures that all data required to recreate the original
        ** database has been stored in the journal for pDestPager and the
        ** journal synced to disk. So at this point we may safely modify
        ** the database file in any way, knowing that if a power failure
        ** occurs, the original database will be reconstructed from the 
        ** journal file.  */
        rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 1);

        /* Write the extra pages and truncate the database file as required. */
        iEnd = MIN(PENDING_BYTE + pgszDest, iSize);
        for(
          iOff=PENDING_BYTE+pgszSrc; 
          rc==SQLITE_OK && iOff<iEnd; 
          iOff+=pgszSrc
        ){
          PgHdr *pSrcPg = 0;
          const Pgno iSrcPg = (Pgno)((iOff/pgszSrc)+1);
          rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg);
          if( rc==SQLITE_OK ){
            u8 *zData = sqlite3PagerGetData(pSrcPg);
            rc = sqlite3OsWrite(pFile, zData, pgszSrc, iOff);
          }
          sqlite3PagerUnref(pSrcPg);
        }
        if( rc==SQLITE_OK ){
          rc = backupTruncateFile(pFile, iSize);
        }

        /* Sync the database file to disk. */
        if( rc==SQLITE_OK ){
          rc = sqlite3PagerSync(pDestPager);
        }
      }else{
        rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 0);
      }
  
      /* Finish committing the transaction to the destination database. */
      if( SQLITE_OK==rc
       && SQLITE_OK==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0))
      ){
        rc = SQLITE_DONE;
      }
    }
  
    /* If bCloseTrans is true, then this function opened a read transaction
    ** on the source database. Close the read transaction here. There is
    ** no need to check the return values of the btree methods here, as
    ** "committing" a read-only transaction cannot fail.
    */
    if( bCloseTrans ){
      TESTONLY( int rc2 );
      TESTONLY( rc2  = ) sqlite3BtreeCommitPhaseOne(p->pSrc, 0);
      TESTONLY( rc2 |= ) sqlite3BtreeCommitPhaseTwo(p->pSrc, 0);
      assert( rc2==SQLITE_OK );
    }
  
    if( rc==SQLITE_IOERR_NOMEM ){
      rc = SQLITE_NOMEM;
    }
    p->rc = rc;
  }
  if( p->pDestDb ){
    sqlite3_mutex_leave(p->pDestDb->mutex);
  }
  sqlite3BtreeLeave(p->pSrc);

Here is the call graph for this function:

SQLITE_API int sqlite3_bind_blob ( sqlite3_stmt ,
int  ,
const void *  ,
int  n,
void(*)(void *)   
)

Definition at line 61857 of file sqlite3.c.

 {
SQLITE_API int sqlite3_bind_double ( sqlite3_stmt ,
int  ,
double   
)

Definition at line 61866 of file sqlite3.c.

 {
  return bindText(pStmt, i, zData, nData, xDel, 0);
}
SQLITE_API int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
  int rc;
  Vdbe *p = (Vdbe *)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
    sqlite3_mutex_leave(p->db->mutex);

Here is the call graph for this function:

Definition at line 61876 of file sqlite3.c.

                                                                   {

Definition at line 61879 of file sqlite3.c.

                                                                   {
  return sqlite3_bind_int64(p, i, (i64)iValue);
}
SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
  int rc;
  Vdbe *p = (Vdbe *)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
    sqlite3_mutex_leave(p->db->mutex);

Definition at line 61889 of file sqlite3.c.

                                                            {
  int rc;
  Vdbe *p = (Vdbe*)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3_mutex_leave(p->db->mutex);

Definition at line 61964 of file sqlite3.c.

                                                                {
SQLITE_API int sqlite3_bind_parameter_index ( sqlite3_stmt ,
const char *  zName 
)

Definition at line 62003 of file sqlite3.c.

                                                                                   {

Definition at line 61975 of file sqlite3.c.

                                                                              {
  Vdbe *p = (Vdbe*)pStmt;
  if( p==0 || i<1 || i>p->nzVar ){
    return 0;
SQLITE_API int sqlite3_bind_text ( sqlite3_stmt ,
int  ,
const char *  ,
int  n,
void(*)(void *)   
)

Definition at line 61898 of file sqlite3.c.

 {
SQLITE_API int sqlite3_bind_text16 ( sqlite3_stmt ,
int  ,
const void *  ,
int  ,
void(*)(void *)   
)

Definition at line 61908 of file sqlite3.c.

 {
SQLITE_API int sqlite3_bind_value ( sqlite3_stmt ,
int  ,
const sqlite3_value *   
)

Definition at line 61918 of file sqlite3.c.

                                                                                          {
  int rc;
  switch( pValue->type ){
    case SQLITE_INTEGER: {
      rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
      break;
    }
    case SQLITE_FLOAT: {
      rc = sqlite3_bind_double(pStmt, i, pValue->r);
      break;
    }
    case SQLITE_BLOB: {
      if( pValue->flags & MEM_Zero ){
        rc = sqlite3_bind_zeroblob(pStmt, i, pValue->u.nZero);
      }else{
        rc = sqlite3_bind_blob(pStmt, i, pValue->z, pValue->n,SQLITE_TRANSIENT);
      }
      break;
    }
    case SQLITE_TEXT: {
      rc = bindText(pStmt,i,  pValue->z, pValue->n, SQLITE_TRANSIENT,
                              pValue->enc);
      break;
    }
    default: {
      rc = sqlite3_bind_null(pStmt, i);
      break;
    }

Definition at line 61949 of file sqlite3.c.

                                                                       {
  int rc;
  Vdbe *p = (Vdbe *)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
    sqlite3_mutex_leave(p->db->mutex);

Definition at line 69331 of file sqlite3.c.

                                                      {

Definition at line 69244 of file sqlite3.c.

                                                      {
  Incrblob *p = (Incrblob *)pBlob;
  int rc;
  sqlite3 *db;

  if( p ){
    db = p->db;
    sqlite3_mutex_enter(db->mutex);
    rc = sqlite3_finalize(p->pStmt);
    sqlite3DbFree(db, p);
    sqlite3_mutex_leave(db->mutex);
  }else{
    rc = SQLITE_OK;

Here is the call graph for this function:

SQLITE_API int sqlite3_blob_open ( sqlite3 ,
const char *  zDb,
const char *  zTable,
const char *  zColumn,
sqlite3_int64  iRow,
int  flags,
sqlite3_blob **  ppBlob 
)

Definition at line 69015 of file sqlite3.c.

 {
  int nAttempt = 0;
  int iCol;               /* Index of zColumn in row-record */

  /* This VDBE program seeks a btree cursor to the identified 
  ** db/table/row entry. The reason for using a vdbe program instead
  ** of writing code to use the b-tree layer directly is that the
  ** vdbe program will take advantage of the various transaction,
  ** locking and error handling infrastructure built into the vdbe.
  **
  ** After seeking the cursor, the vdbe executes an OP_ResultRow.
  ** Code external to the Vdbe then "borrows" the b-tree cursor and
  ** uses it to implement the blob_read(), blob_write() and 
  ** blob_bytes() functions.
  **
  ** The sqlite3_blob_close() function finalizes the vdbe program,
  ** which closes the b-tree cursor and (possibly) commits the 
  ** transaction.
  */
  static const VdbeOpList openBlob[] = {
    {OP_Transaction, 0, 0, 0},     /* 0: Start a transaction */
    {OP_VerifyCookie, 0, 0, 0},    /* 1: Check the schema cookie */
    {OP_TableLock, 0, 0, 0},       /* 2: Acquire a read or write lock */

    /* One of the following two instructions is replaced by an OP_Noop. */
    {OP_OpenRead, 0, 0, 0},        /* 3: Open cursor 0 for reading */
    {OP_OpenWrite, 0, 0, 0},       /* 4: Open cursor 0 for read/write */

    {OP_Variable, 1, 1, 1},        /* 5: Push the rowid to the stack */
    {OP_NotExists, 0, 10, 1},      /* 6: Seek the cursor */
    {OP_Column, 0, 0, 1},          /* 7  */
    {OP_ResultRow, 1, 0, 0},       /* 8  */
    {OP_Goto, 0, 5, 0},            /* 9  */
    {OP_Close, 0, 0, 0},           /* 10 */
    {OP_Halt, 0, 0, 0},            /* 11 */
  };

  int rc = SQLITE_OK;
  char *zErr = 0;
  Table *pTab;
  Parse *pParse = 0;
  Incrblob *pBlob = 0;

  flags = !!flags;                /* flags = (flags ? 1 : 0); */
  *ppBlob = 0;

  sqlite3_mutex_enter(db->mutex);

  pBlob = (Incrblob *)sqlite3DbMallocZero(db, sizeof(Incrblob));
  if( !pBlob ) goto blob_open_out;
  pParse = sqlite3StackAllocRaw(db, sizeof(*pParse));
  if( !pParse ) goto blob_open_out;

  do {
    memset(pParse, 0, sizeof(Parse));
    pParse->db = db;
    sqlite3DbFree(db, zErr);
    zErr = 0;

    sqlite3BtreeEnterAll(db);
    pTab = sqlite3LocateTable(pParse, 0, zTable, zDb);
    if( pTab && IsVirtual(pTab) ){
      pTab = 0;
      sqlite3ErrorMsg(pParse, "cannot open virtual table: %s", zTable);
    }
#ifndef SQLITE_OMIT_VIEW
    if( pTab && pTab->pSelect ){
      pTab = 0;
      sqlite3ErrorMsg(pParse, "cannot open view: %s", zTable);
    }
#endif
    if( !pTab ){
      if( pParse->zErrMsg ){
        sqlite3DbFree(db, zErr);
        zErr = pParse->zErrMsg;
        pParse->zErrMsg = 0;
      }
      rc = SQLITE_ERROR;
      sqlite3BtreeLeaveAll(db);
      goto blob_open_out;
    }

    /* Now search pTab for the exact column. */
    for(iCol=0; iCol<pTab->nCol; iCol++) {
      if( sqlite3StrICmp(pTab->aCol[iCol].zName, zColumn)==0 ){
        break;
      }
    }
    if( iCol==pTab->nCol ){
      sqlite3DbFree(db, zErr);
      zErr = sqlite3MPrintf(db, "no such column: \"%s\"", zColumn);
      rc = SQLITE_ERROR;
      sqlite3BtreeLeaveAll(db);
      goto blob_open_out;
    }

    /* If the value is being opened for writing, check that the
    ** column is not indexed, and that it is not part of a foreign key. 
    ** It is against the rules to open a column to which either of these
    ** descriptions applies for writing.  */
    if( flags ){
      const char *zFault = 0;
      Index *pIdx;
#ifndef SQLITE_OMIT_FOREIGN_KEY
      if( db->flags&SQLITE_ForeignKeys ){
        /* Check that the column is not part of an FK child key definition. It
        ** is not necessary to check if it is part of a parent key, as parent
        ** key columns must be indexed. The check below will pick up this 
        ** case.  */
        FKey *pFKey;
        for(pFKey=pTab->pFKey; pFKey; pFKey=pFKey->pNextFrom){
          int j;
          for(j=0; j<pFKey->nCol; j++){
            if( pFKey->aCol[j].iFrom==iCol ){
              zFault = "foreign key";
            }
          }
        }
      }
#endif
      for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
        int j;
        for(j=0; j<pIdx->nColumn; j++){
          if( pIdx->aiColumn[j]==iCol ){
            zFault = "indexed";
          }
        }
      }
      if( zFault ){
        sqlite3DbFree(db, zErr);
        zErr = sqlite3MPrintf(db, "cannot open %s column for writing", zFault);
        rc = SQLITE_ERROR;
        sqlite3BtreeLeaveAll(db);
        goto blob_open_out;
      }
    }

    pBlob->pStmt = (sqlite3_stmt *)sqlite3VdbeCreate(db);
    assert( pBlob->pStmt || db->mallocFailed );
    if( pBlob->pStmt ){
      Vdbe *v = (Vdbe *)pBlob->pStmt;
      int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);

      sqlite3VdbeAddOpList(v, sizeof(openBlob)/sizeof(VdbeOpList), openBlob);


      /* Configure the OP_Transaction */
      sqlite3VdbeChangeP1(v, 0, iDb);
      sqlite3VdbeChangeP2(v, 0, flags);

      /* Configure the OP_VerifyCookie */
      sqlite3VdbeChangeP1(v, 1, iDb);
      sqlite3VdbeChangeP2(v, 1, pTab->pSchema->schema_cookie);
      sqlite3VdbeChangeP3(v, 1, pTab->pSchema->iGeneration);

      /* Make sure a mutex is held on the table to be accessed */
      sqlite3VdbeUsesBtree(v, iDb); 

      /* Configure the OP_TableLock instruction */
#ifdef SQLITE_OMIT_SHARED_CACHE
      sqlite3VdbeChangeToNoop(v, 2, 1);
#else
      sqlite3VdbeChangeP1(v, 2, iDb);
      sqlite3VdbeChangeP2(v, 2, pTab->tnum);
      sqlite3VdbeChangeP3(v, 2, flags);
      sqlite3VdbeChangeP4(v, 2, pTab->zName, P4_TRANSIENT);
#endif

      /* Remove either the OP_OpenWrite or OpenRead. Set the P2 
      ** parameter of the other to pTab->tnum.  */
      sqlite3VdbeChangeToNoop(v, 4 - flags, 1);
      sqlite3VdbeChangeP2(v, 3 + flags, pTab->tnum);
      sqlite3VdbeChangeP3(v, 3 + flags, iDb);

      /* Configure the number of columns. Configure the cursor to
      ** think that the table has one more column than it really
      ** does. An OP_Column to retrieve this imaginary column will
      ** always return an SQL NULL. This is useful because it means
      ** we can invoke OP_Column to fill in the vdbe cursors type 
      ** and offset cache without causing any IO.
      */
      sqlite3VdbeChangeP4(v, 3+flags, SQLITE_INT_TO_PTR(pTab->nCol+1),P4_INT32);
      sqlite3VdbeChangeP2(v, 7, pTab->nCol);
      if( !db->mallocFailed ){
        pParse->nVar = 1;
        pParse->nMem = 1;
        pParse->nTab = 1;
        sqlite3VdbeMakeReady(v, pParse);
      }
    }
   
    pBlob->flags = flags;
    pBlob->iCol = iCol;
    pBlob->db = db;
    sqlite3BtreeLeaveAll(db);
    if( db->mallocFailed ){
      goto blob_open_out;
    }
    sqlite3_bind_int64(pBlob->pStmt, 1, iRow);
    rc = blobSeekToRow(pBlob, iRow, &zErr);
  } while( (++nAttempt)<5 && rc==SQLITE_SCHEMA );

blob_open_out:
  if( rc==SQLITE_OK && db->mallocFailed==0 ){
    *ppBlob = (sqlite3_blob *)pBlob;
  }else{
    if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt);
    sqlite3DbFree(db, pBlob);
  }
  sqlite3Error(db, rc, (zErr ? "%s" : 0), zErr);
  sqlite3DbFree(db, zErr);
  sqlite3StackFree(db, pParse);
  rc = sqlite3ApiExit(db, rc);

Here is the call graph for this function:

SQLITE_API int sqlite3_blob_read ( sqlite3_blob ,
void *  Z,
int  N,
int  iOffset 
)

Definition at line 69314 of file sqlite3.c.

                                                                                  {

Here is the call graph for this function:

Definition at line 69346 of file sqlite3.c.

                                                                           {
  int rc;
  Incrblob *p = (Incrblob *)pBlob;
  sqlite3 *db;

  if( p==0 ) return SQLITE_MISUSE_BKPT;
  db = p->db;
  sqlite3_mutex_enter(db->mutex);

  if( p->pStmt==0 ){
    /* If there is no statement handle, then the blob-handle has
    ** already been invalidated. Return SQLITE_ABORT in this case.
    */
    rc = SQLITE_ABORT;
  }else{
    char *zErr;
    rc = blobSeekToRow(p, iRow, &zErr);
    if( rc!=SQLITE_OK ){
      sqlite3Error(db, rc, (zErr ? "%s" : 0), zErr);
      sqlite3DbFree(db, zErr);
    }
    assert( rc!=SQLITE_SCHEMA );
  }

  rc = sqlite3ApiExit(db, rc);
  assert( rc==SQLITE_OK || p->pStmt==0 );

Here is the call graph for this function:

SQLITE_API int sqlite3_blob_write ( sqlite3_blob ,
const void *  z,
int  n,
int  iOffset 
)

Definition at line 69321 of file sqlite3.c.

                                                                                         {

Here is the call graph for this function:

SQLITE_API int sqlite3_busy_handler ( sqlite3 ,
int(*)(void *, int ,
void *   
)

Definition at line 108871 of file sqlite3.c.

 {
  sqlite3_mutex_enter(db->mutex);
  db->busyHandler.xFunc = xBusy;
  db->busyHandler.pArg = pArg;
  db->busyHandler.nBusy = 0;

Definition at line 108915 of file sqlite3.c.

                                                        {
  if( ms>0 ){
    db->busyTimeout = ms;
    sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
  }else{
    sqlite3_busy_handler(db, 0, 0);

Here is the call graph for this function:

Definition at line 108555 of file sqlite3.c.

                                           {

Definition at line 60907 of file sqlite3.c.

                                                          {
  int i;
  int rc = SQLITE_OK;
  Vdbe *p = (Vdbe*)pStmt;
#if SQLITE_THREADSAFE
  sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
#endif
  sqlite3_mutex_enter(mutex);
  for(i=0; i<p->nVar; i++){
    sqlite3VdbeMemRelease(&p->aVar[i]);
    p->aVar[i].flags = MEM_Null;
  }
  if( p->isPrepareV2 && p->expmask ){
    p->expired = 1;
  }

Here is the call graph for this function:

Definition at line 108602 of file sqlite3.c.

                                         {
  HashElem *i;                    /* Hash table iterator */
  int j;

  if( !db ){
    return SQLITE_OK;
  }
  if( !sqlite3SafetyCheckSickOrOk(db) ){
    return SQLITE_MISUSE_BKPT;
  }
  sqlite3_mutex_enter(db->mutex);

  /* Force xDestroy calls on all virtual tables */
  sqlite3ResetInternalSchema(db, -1);

  /* If a transaction is open, the ResetInternalSchema() call above
  ** will not have called the xDisconnect() method on any virtual
  ** tables in the db->aVTrans[] array. The following sqlite3VtabRollback()
  ** call will do so. We need to do this before the check for active
  ** SQL statements below, as the v-table implementation may be storing
  ** some prepared statements internally.
  */
  sqlite3VtabRollback(db);

  /* If there are any outstanding VMs, return SQLITE_BUSY. */
  if( db->pVdbe ){
    sqlite3Error(db, SQLITE_BUSY, 
        "unable to close due to unfinalised statements");
    sqlite3_mutex_leave(db->mutex);
    return SQLITE_BUSY;
  }
  assert( sqlite3SafetyCheckSickOrOk(db) );

  for(j=0; j<db->nDb; j++){
    Btree *pBt = db->aDb[j].pBt;
    if( pBt && sqlite3BtreeIsInBackup(pBt) ){
      sqlite3Error(db, SQLITE_BUSY, 
          "unable to close due to unfinished backup operation");
      sqlite3_mutex_leave(db->mutex);
      return SQLITE_BUSY;
    }
  }

  /* Free any outstanding Savepoint structures. */
  sqlite3CloseSavepoints(db);

  for(j=0; j<db->nDb; j++){
    struct Db *pDb = &db->aDb[j];
    if( pDb->pBt ){
      sqlite3BtreeClose(pDb->pBt);
      pDb->pBt = 0;
      if( j!=1 ){
        pDb->pSchema = 0;
      }
    }
  }
  sqlite3ResetInternalSchema(db, -1);

  /* Tell the code in notify.c that the connection no longer holds any
  ** locks and does not require any further unlock-notify callbacks.
  */
  sqlite3ConnectionClosed(db);

  assert( db->nDb<=2 );
  assert( db->aDb==db->aDbStatic );
  for(j=0; j<ArraySize(db->aFunc.a); j++){
    FuncDef *pNext, *pHash, *p;
    for(p=db->aFunc.a[j]; p; p=pHash){
      pHash = p->pHash;
      while( p ){
        functionDestroy(db, p);
        pNext = p->pNext;
        sqlite3DbFree(db, p);
        p = pNext;
      }
    }
  }
  for(i=sqliteHashFirst(&db->aCollSeq); i; i=sqliteHashNext(i)){
    CollSeq *pColl = (CollSeq *)sqliteHashData(i);
    /* Invoke any destructors registered for collation sequence user data. */
    for(j=0; j<3; j++){
      if( pColl[j].xDel ){
        pColl[j].xDel(pColl[j].pUser);
      }
    }
    sqlite3DbFree(db, pColl);
  }
  sqlite3HashClear(&db->aCollSeq);
#ifndef SQLITE_OMIT_VIRTUALTABLE
  for(i=sqliteHashFirst(&db->aModule); i; i=sqliteHashNext(i)){
    Module *pMod = (Module *)sqliteHashData(i);
    if( pMod->xDestroy ){
      pMod->xDestroy(pMod->pAux);
    }
    sqlite3DbFree(db, pMod);
  }
  sqlite3HashClear(&db->aModule);
#endif

  sqlite3Error(db, SQLITE_OK, 0); /* Deallocates any cached error strings. */
  if( db->pErr ){
    sqlite3ValueFree(db->pErr);
  }
  sqlite3CloseExtensions(db);

  db->magic = SQLITE_MAGIC_ERROR;

  /* The temp-database schema is allocated differently from the other schema
  ** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()).
  ** So it needs to be freed here. Todo: Why not roll the temp schema into
  ** the same sqliteMalloc() as the one that allocates the database 
  ** structure?
  */
  sqlite3DbFree(db, db->aDb[1].pSchema);
  sqlite3_mutex_leave(db->mutex);
  db->magic = SQLITE_MAGIC_CLOSED;
  sqlite3_mutex_free(db->mutex);
  assert( db->lookaside.nOut==0 );  /* Fails on a lookaside memory leak */
  if( db->lookaside.bMalloced ){
    sqlite3_free(db->lookaside.pStart);
  }

Here is the call graph for this function:

SQLITE_API int sqlite3_collation_needed ( sqlite3 ,
void *  ,
void(*)(void *, sqlite3 *, int eTextRep, const char *)   
)

Definition at line 110330 of file sqlite3.c.

 {
  sqlite3_mutex_enter(db->mutex);
  db->xCollNeeded = xCollNeeded;
  db->xCollNeeded16 = 0;
  db->pCollNeededArg = pCollNeededArg;
SQLITE_API int sqlite3_collation_needed16 ( sqlite3 ,
void *  ,
void(*)(void *, sqlite3 *, int eTextRep, const void *)   
)

Definition at line 110348 of file sqlite3.c.

 {
  sqlite3_mutex_enter(db->mutex);
  db->xCollNeeded = 0;
  db->xCollNeeded16 = xCollNeeded16;
  db->pCollNeededArg = pCollNeededArg;
SQLITE_API const void* sqlite3_column_blob ( sqlite3_stmt ,
int  iCol 
)

Definition at line 61557 of file sqlite3.c.

                                                                      {
  const void *val;
  val = sqlite3_value_blob( columnMem(pStmt,i) );
  /* Even though there is no encoding conversion, value_blob() might
  ** need to call malloc() to expand the result of a zeroblob() 
  ** expression. 
  */

Here is the call graph for this function:

Definition at line 61567 of file sqlite3.c.

                                                               {
  int val = sqlite3_value_bytes( columnMem(pStmt,i) );

Definition at line 61572 of file sqlite3.c.

                                                                 {
  int val = sqlite3_value_bytes16( columnMem(pStmt,i) );

Definition at line 61460 of file sqlite3.c.

                                                        {
SQLITE_API const char* sqlite3_column_decltype ( sqlite3_stmt ,
int   
)

Definition at line 61701 of file sqlite3.c.

                                                                          {

Here is the call graph for this function:

Definition at line 61706 of file sqlite3.c.

                                                                            {
SQLITE_API double sqlite3_column_double ( sqlite3_stmt ,
int  iCol 
)

Definition at line 61577 of file sqlite3.c.

                                                                   {
  double val = sqlite3_value_double( columnMem(pStmt,i) );

Definition at line 61582 of file sqlite3.c.

                                                             {
  int val = sqlite3_value_int( columnMem(pStmt,i) );

Definition at line 61587 of file sqlite3.c.

SQLITE_API const char* sqlite3_column_name ( sqlite3_stmt ,
int  N 
)

Definition at line 61676 of file sqlite3.c.

                                                                      {

Here is the call graph for this function:

SQLITE_API const void* sqlite3_column_name16 ( sqlite3_stmt ,
int  N 
)

Definition at line 61681 of file sqlite3.c.

                                                                        {
SQLITE_API const unsigned char* sqlite3_column_text ( sqlite3_stmt ,
int  iCol 
)

Definition at line 61592 of file sqlite3.c.

                                                                               {
  const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
SQLITE_API const void* sqlite3_column_text16 ( sqlite3_stmt ,
int  iCol 
)

Definition at line 61607 of file sqlite3.c.

                                                                        {
  const void *val = sqlite3_value_text16( columnMem(pStmt,i) );

Definition at line 61613 of file sqlite3.c.

                                                              {
  int iType = sqlite3_value_type( columnMem(pStmt,i) );
SQLITE_API sqlite3_value* sqlite3_column_value ( sqlite3_stmt ,
int  iCol 
)

Definition at line 61597 of file sqlite3.c.

                                                                          {
  Mem *pOut = columnMem(pStmt, i);
  if( pOut->flags&MEM_Static ){
    pOut->flags &= ~MEM_Static;
    pOut->flags |= MEM_Ephem;
  }
SQLITE_API void* sqlite3_commit_hook ( sqlite3 ,
int(*)(void *)  ,
void *   
)

Definition at line 109184 of file sqlite3.c.

 {
  void *pOld;
  sqlite3_mutex_enter(db->mutex);
  pOld = db->pCommitArg;
  db->xCommitCallback = xCallback;
  db->pCommitArg = pArg;

Definition at line 12459 of file sqlite3.c.

                                                       {
  if( N>=0 && N<ArraySize(azCompileOpt) ){
    return azCompileOpt[N];
  }
SQLITE_API int sqlite3_compileoption_used ( const char *  zOptName)

Definition at line 12441 of file sqlite3.c.

                                                               {
  int i, n;
  if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7;
  n = sqlite3Strlen30(zOptName);

  /* Since ArraySize(azCompileOpt) is normally in single digits, a
  ** linear search is adequate.  No need for a binary search. */
  for(i=0; i<ArraySize(azCompileOpt); i++){
    if(   (sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0)
       && ( (azCompileOpt[i][n]==0) || (azCompileOpt[i][n]=='=') ) ) return 1;
  }

Here is the call graph for this function:

SQLITE_API int sqlite3_complete ( const char *  sql)

Definition at line 107650 of file sqlite3.c.

                                                 {
  u8 state = 0;   /* Current state, using numbers defined in header comment */
  u8 token;       /* Value of the next token */

#ifndef SQLITE_OMIT_TRIGGER
  /* A complex statement machine used to detect the end of a CREATE TRIGGER
  ** statement.  This is the normal case.
  */
  static const u8 trans[8][8] = {
                     /* Token:                                                */
     /* State:       **  SEMI  WS  OTHER  EXPLAIN  CREATE  TEMP  TRIGGER  END */
     /* 0 INVALID: */ {    1,  0,     2,       3,      4,    2,       2,   2, },
     /* 1   START: */ {    1,  1,     2,       3,      4,    2,       2,   2, },
     /* 2  NORMAL: */ {    1,  2,     2,       2,      2,    2,       2,   2, },
     /* 3 EXPLAIN: */ {    1,  3,     3,       2,      4,    2,       2,   2, },
     /* 4  CREATE: */ {    1,  4,     2,       2,      2,    4,       5,   2, },
     /* 5 TRIGGER: */ {    6,  5,     5,       5,      5,    5,       5,   5, },
     /* 6    SEMI: */ {    6,  6,     5,       5,      5,    5,       5,   7, },
     /* 7     END: */ {    1,  7,     5,       5,      5,    5,       5,   5, },
  };
#else
  /* If triggers are not supported by this compile then the statement machine
  ** used to detect the end of a statement is much simplier
  */
  static const u8 trans[3][3] = {
                     /* Token:           */
     /* State:       **  SEMI  WS  OTHER */
     /* 0 INVALID: */ {    1,  0,     2, },
     /* 1   START: */ {    1,  1,     2, },
     /* 2  NORMAL: */ {    1,  2,     2, },
  };
#endif /* SQLITE_OMIT_TRIGGER */

  while( *zSql ){
    switch( *zSql ){
      case ';': {  /* A semicolon */
        token = tkSEMI;
        break;
      }
      case ' ':
      case '\r':
      case '\t':
      case '\n':
      case '\f': {  /* White space is ignored */
        token = tkWS;
        break;
      }
      case '/': {   /* C-style comments */
        if( zSql[1]!='*' ){
          token = tkOTHER;
          break;
        }
        zSql += 2;
        while( zSql[0] && (zSql[0]!='*' || zSql[1]!='/') ){ zSql++; }
        if( zSql[0]==0 ) return 0;
        zSql++;
        token = tkWS;
        break;
      }
      case '-': {   /* SQL-style comments from "--" to end of line */
        if( zSql[1]!='-' ){
          token = tkOTHER;
          break;
        }
        while( *zSql && *zSql!='\n' ){ zSql++; }
        if( *zSql==0 ) return state==1;
        token = tkWS;
        break;
      }
      case '[': {   /* Microsoft-style identifiers in [...] */
        zSql++;
        while( *zSql && *zSql!=']' ){ zSql++; }
        if( *zSql==0 ) return 0;
        token = tkOTHER;
        break;
      }
      case '`':     /* Grave-accent quoted symbols used by MySQL */
      case '"':     /* single- and double-quoted strings */
      case '\'': {
        int c = *zSql;
        zSql++;
        while( *zSql && *zSql!=c ){ zSql++; }
        if( *zSql==0 ) return 0;
        token = tkOTHER;
        break;
      }
      default: {
#ifdef SQLITE_EBCDIC
        unsigned char c;
#endif
        if( IdChar((u8)*zSql) ){
          /* Keywords and unquoted identifiers */
          int nId;
          for(nId=1; IdChar(zSql[nId]); nId++){}
#ifdef SQLITE_OMIT_TRIGGER
          token = tkOTHER;
#else
          switch( *zSql ){
            case 'c': case 'C': {
              if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){
                token = tkCREATE;
              }else{
                token = tkOTHER;
              }
              break;
            }
            case 't': case 'T': {
              if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){
                token = tkTRIGGER;
              }else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){
                token = tkTEMP;
              }else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){
                token = tkTEMP;
              }else{
                token = tkOTHER;
              }
              break;
            }
            case 'e':  case 'E': {
              if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){
                token = tkEND;
              }else
#ifndef SQLITE_OMIT_EXPLAIN
              if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){
                token = tkEXPLAIN;
              }else
#endif
              {
                token = tkOTHER;
              }
              break;
            }
            default: {
              token = tkOTHER;
              break;
            }
          }
#endif /* SQLITE_OMIT_TRIGGER */
          zSql += nId-1;
        }else{
          /* Operators and special symbols */
          token = tkOTHER;
        }
        break;
      }
    }
    state = trans[state][token];
    zSql++;
SQLITE_API int sqlite3_complete16 ( const void *  sql)

Definition at line 107808 of file sqlite3.c.

                                                   {
  sqlite3_value *pVal;
  char const *zSql8;
  int rc = SQLITE_NOMEM;

#ifndef SQLITE_OMIT_AUTOINIT
  rc = sqlite3_initialize();
  if( rc ) return rc;
#endif
  pVal = sqlite3ValueNew(0);
  sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
  zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
  if( zSql8 ){
    rc = sqlite3_complete(zSql8);
  }else{
    rc = SQLITE_NOMEM;
  }

Here is the call graph for this function:

SQLITE_API int sqlite3_config ( int  ,
  ... 
)

Definition at line 108198 of file sqlite3.c.

                                          {
  va_list ap;
  int rc = SQLITE_OK;

  /* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
  ** the SQLite library is in use. */
  if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT;

  va_start(ap, op);
  switch( op ){

    /* Mutex configuration options are only available in a threadsafe
    ** compile. 
    */
#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0
    case SQLITE_CONFIG_SINGLETHREAD: {
      /* Disable all mutexing */
      sqlite3GlobalConfig.bCoreMutex = 0;
      sqlite3GlobalConfig.bFullMutex = 0;
      break;
    }
    case SQLITE_CONFIG_MULTITHREAD: {
      /* Disable mutexing of database connections */
      /* Enable mutexing of core data structures */
      sqlite3GlobalConfig.bCoreMutex = 1;
      sqlite3GlobalConfig.bFullMutex = 0;
      break;
    }
    case SQLITE_CONFIG_SERIALIZED: {
      /* Enable all mutexing */
      sqlite3GlobalConfig.bCoreMutex = 1;
      sqlite3GlobalConfig.bFullMutex = 1;
      break;
    }
    case SQLITE_CONFIG_MUTEX: {
      /* Specify an alternative mutex implementation */
      sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*);
      break;
    }
    case SQLITE_CONFIG_GETMUTEX: {
      /* Retrieve the current mutex implementation */
      *va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex;
      break;
    }
#endif


    case SQLITE_CONFIG_MALLOC: {
      /* Specify an alternative malloc implementation */
      sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*);
      break;
    }
    case SQLITE_CONFIG_GETMALLOC: {
      /* Retrieve the current malloc() implementation */
      if( sqlite3GlobalConfig.m.xMalloc==0 ) sqlite3MemSetDefault();
      *va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m;
      break;
    }
    case SQLITE_CONFIG_MEMSTATUS: {
      /* Enable or disable the malloc status collection */
      sqlite3GlobalConfig.bMemstat = va_arg(ap, int);
      break;
    }
    case SQLITE_CONFIG_SCRATCH: {
      /* Designate a buffer for scratch memory space */
      sqlite3GlobalConfig.pScratch = va_arg(ap, void*);
      sqlite3GlobalConfig.szScratch = va_arg(ap, int);
      sqlite3GlobalConfig.nScratch = va_arg(ap, int);
      break;
    }
    case SQLITE_CONFIG_PAGECACHE: {
      /* Designate a buffer for page cache memory space */
      sqlite3GlobalConfig.pPage = va_arg(ap, void*);
      sqlite3GlobalConfig.szPage = va_arg(ap, int);
      sqlite3GlobalConfig.nPage = va_arg(ap, int);
      break;
    }

    case SQLITE_CONFIG_PCACHE: {
      /* Specify an alternative page cache implementation */
      sqlite3GlobalConfig.pcache = *va_arg(ap, sqlite3_pcache_methods*);
      break;
    }

    case SQLITE_CONFIG_GETPCACHE: {
      if( sqlite3GlobalConfig.pcache.xInit==0 ){
        sqlite3PCacheSetDefault();
      }
      *va_arg(ap, sqlite3_pcache_methods*) = sqlite3GlobalConfig.pcache;
      break;
    }

#if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5)
    case SQLITE_CONFIG_HEAP: {
      /* Designate a buffer for heap memory space */
      sqlite3GlobalConfig.pHeap = va_arg(ap, void*);
      sqlite3GlobalConfig.nHeap = va_arg(ap, int);
      sqlite3GlobalConfig.mnReq = va_arg(ap, int);

      if( sqlite3GlobalConfig.mnReq<1 ){
        sqlite3GlobalConfig.mnReq = 1;
      }else if( sqlite3GlobalConfig.mnReq>(1<<12) ){
        /* cap min request size at 2^12 */
        sqlite3GlobalConfig.mnReq = (1<<12);
      }

      if( sqlite3GlobalConfig.pHeap==0 ){
        /* If the heap pointer is NULL, then restore the malloc implementation
        ** back to NULL pointers too.  This will cause the malloc to go
        ** back to its default implementation when sqlite3_initialize() is
        ** run.
        */
        memset(&sqlite3GlobalConfig.m, 0, sizeof(sqlite3GlobalConfig.m));
      }else{
        /* The heap pointer is not NULL, then install one of the
        ** mem5.c/mem3.c methods. If neither ENABLE_MEMSYS3 nor
        ** ENABLE_MEMSYS5 is defined, return an error.
        */
#ifdef SQLITE_ENABLE_MEMSYS3
        sqlite3GlobalConfig.m = *sqlite3MemGetMemsys3();
#endif
#ifdef SQLITE_ENABLE_MEMSYS5
        sqlite3GlobalConfig.m = *sqlite3MemGetMemsys5();
#endif
      }
      break;
    }
#endif

    case SQLITE_CONFIG_LOOKASIDE: {
      sqlite3GlobalConfig.szLookaside = va_arg(ap, int);
      sqlite3GlobalConfig.nLookaside = va_arg(ap, int);
      break;
    }
    
    /* Record a pointer to the logger funcction and its first argument.
    ** The default is NULL.  Logging is disabled if the function pointer is
    ** NULL.
    */
    case SQLITE_CONFIG_LOG: {
      /* MSVC is picky about pulling func ptrs from va lists.
      ** http://support.microsoft.com/kb/47961
      ** sqlite3GlobalConfig.xLog = va_arg(ap, void(*)(void*,int,const char*));
      */
      typedef void(*LOGFUNC_t)(void*,int,const char*);
      sqlite3GlobalConfig.xLog = va_arg(ap, LOGFUNC_t);
      sqlite3GlobalConfig.pLogArg = va_arg(ap, void*);
      break;
    }

    case SQLITE_CONFIG_URI: {
      sqlite3GlobalConfig.bOpenUri = va_arg(ap, int);
      break;
    }

    default: {
      rc = SQLITE_ERROR;
      break;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 61327 of file sqlite3.c.

                                                                 {
SQLITE_API int sqlite3_create_collation ( sqlite3 ,
const char *  zName,
int  eTextRep,
void *  pArg,
int(*)(void *, int, const void *, int, const void *)  xCompare 
)

Definition at line 110264 of file sqlite3.c.

 {
  int rc;
  sqlite3_mutex_enter(db->mutex);
  assert( !db->mallocFailed );
  rc = createCollation(db, zName, (u8)enc, SQLITE_COLL_USER, pCtx, xCompare, 0);
  rc = sqlite3ApiExit(db, rc);

Here is the call graph for this function:

SQLITE_API int sqlite3_create_collation16 ( sqlite3 ,
const void *  zName,
int  eTextRep,
void *  pArg,
int(*)(void *, int, const void *, int, const void *)  xCompare 
)

Definition at line 110304 of file sqlite3.c.

 {
  int rc = SQLITE_OK;
  char *zName8;
  sqlite3_mutex_enter(db->mutex);
  assert( !db->mallocFailed );
  zName8 = sqlite3Utf16to8(db, zName, -1, SQLITE_UTF16NATIVE);
  if( zName8 ){
    rc = createCollation(db, zName8, (u8)enc, SQLITE_COLL_USER, pCtx, xCompare, 0);
    sqlite3DbFree(db, zName8);
  }
  rc = sqlite3ApiExit(db, rc);

Here is the call graph for this function:

SQLITE_API int sqlite3_create_collation_v2 ( sqlite3 ,
const char *  zName,
int  eTextRep,
void *  pArg,
int(*)(void *, int, const void *, int, const void *)  xCompare,
void(*)(void *)  xDestroy 
)

Definition at line 110283 of file sqlite3.c.

 {
  int rc;
  sqlite3_mutex_enter(db->mutex);
  assert( !db->mallocFailed );
  rc = createCollation(db, zName, (u8)enc, SQLITE_COLL_USER, pCtx, xCompare, xDel);
  rc = sqlite3ApiExit(db, rc);

Here is the call graph for this function:

SQLITE_API int sqlite3_create_function ( sqlite3 db,
const char *  zFunctionName,
int  nArg,
int  eTextRep,
void *  pApp,
void(*)(sqlite3_context *, int, sqlite3_value **)  xFunc,
void(*)(sqlite3_context *, int, sqlite3_value **)  xStep,
void(*)(sqlite3_context *)  xFinal 
)

Definition at line 109033 of file sqlite3.c.

 {
SQLITE_API int sqlite3_create_function16 ( sqlite3 db,
const void *  zFunctionName,
int  nArg,
int  eTextRep,
void *  pApp,
void(*)(sqlite3_context *, int, sqlite3_value **)  xFunc,
void(*)(sqlite3_context *, int, sqlite3_value **)  xStep,
void(*)(sqlite3_context *)  xFinal 
)

Definition at line 109084 of file sqlite3.c.

 {
  int rc;
  char *zFunc8;
  sqlite3_mutex_enter(db->mutex);
  assert( !db->mallocFailed );
  zFunc8 = sqlite3Utf16to8(db, zFunctionName, -1, SQLITE_UTF16NATIVE);
  rc = sqlite3CreateFunc(db, zFunc8, nArg, eTextRep, p, xFunc, xStep, xFinal,0);
  sqlite3DbFree(db, zFunc8);
  rc = sqlite3ApiExit(db, rc);
SQLITE_API int sqlite3_create_function_v2 ( sqlite3 db,
const char *  zFunctionName,
int  nArg,
int  eTextRep,
void *  pApp,
void(*)(sqlite3_context *, int, sqlite3_value **)  xFunc,
void(*)(sqlite3_context *, int, sqlite3_value **)  xStep,
void(*)(sqlite3_context *)  xFinal,
void(*)(void *)  xDestroy 
)

Definition at line 109047 of file sqlite3.c.

 {
  int rc = SQLITE_ERROR;
  FuncDestructor *pArg = 0;
  sqlite3_mutex_enter(db->mutex);
  if( xDestroy ){
    pArg = (FuncDestructor *)sqlite3DbMallocZero(db, sizeof(FuncDestructor));
    if( !pArg ){
      xDestroy(p);
      goto out;
    }
    pArg->xDestroy = xDestroy;
    pArg->pUserData = p;
  }
  rc = sqlite3CreateFunc(db, zFunc, nArg, enc, p, xFunc, xStep, xFinal, pArg);
  if( pArg && pArg->nRef==0 ){
    assert( rc!=SQLITE_OK );
    xDestroy(p);
    sqlite3DbFree(db, pArg);
  }

 out:
  rc = sqlite3ApiExit(db, rc);
SQLITE_API int sqlite3_create_module ( sqlite3 db,
const char *  zName,
const sqlite3_module p,
void *  pClientData 
)

Definition at line 97337 of file sqlite3.c.

 {

Here is the call graph for this function:

SQLITE_API int sqlite3_create_module_v2 ( sqlite3 db,
const char *  zName,
const sqlite3_module p,
void *  pClientData,
void(*)(void *)  xDestroy 
)

Definition at line 97349 of file sqlite3.c.

 {

Here is the call graph for this function:

Definition at line 61469 of file sqlite3.c.

                                                      {
  Vdbe *pVm = (Vdbe *)pStmt;
SQLITE_API int sqlite3_db_config ( sqlite3 ,
int  op,
  ... 
)

Definition at line 108436 of file sqlite3.c.

                                                          {
  va_list ap;
  int rc;
  va_start(ap, op);
  switch( op ){
    case SQLITE_DBCONFIG_LOOKASIDE: {
      void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */
      int sz = va_arg(ap, int);       /* IMP: R-47871-25994 */
      int cnt = va_arg(ap, int);      /* IMP: R-04460-53386 */
      rc = setupLookaside(db, pBuf, sz, cnt);
      break;
    }
    default: {
      static const struct {
        int op;      /* The opcode */
        u32 mask;    /* Mask of the bit in sqlite3.flags to set/clear */
      } aFlagOp[] = {
        { SQLITE_DBCONFIG_ENABLE_FKEY,    SQLITE_ForeignKeys    },
        { SQLITE_DBCONFIG_ENABLE_TRIGGER, SQLITE_EnableTrigger  },
      };
      unsigned int i;
      rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
      for(i=0; i<ArraySize(aFlagOp); i++){
        if( aFlagOp[i].op==op ){
          int onoff = va_arg(ap, int);
          int *pRes = va_arg(ap, int*);
          int oldFlags = db->flags;
          if( onoff>0 ){
            db->flags |= aFlagOp[i].mask;
          }else if( onoff==0 ){
            db->flags &= ~aFlagOp[i].mask;
          }
          if( oldFlags!=db->flags ){
            sqlite3ExpirePreparedStatements(db);
          }
          if( pRes ){
            *pRes = (db->flags & aFlagOp[i].mask)!=0;
          }
          rc = SQLITE_OK;
          break;
        }
      }
      break;
    }
  }

Here is the call graph for this function:

Definition at line 62059 of file sqlite3.c.

                                                          {

Definition at line 108429 of file sqlite3.c.

                                                       {
SQLITE_API int sqlite3_db_status ( sqlite3 ,
int  op,
int pCur,
int pHiwtr,
int  resetFlg 
)

Definition at line 12994 of file sqlite3.c.

 {
  int rc = SQLITE_OK;   /* Return code */
  sqlite3_mutex_enter(db->mutex);
  switch( op ){
    case SQLITE_DBSTATUS_LOOKASIDE_USED: {
      *pCurrent = db->lookaside.nOut;
      *pHighwater = db->lookaside.mxOut;
      if( resetFlag ){
        db->lookaside.mxOut = db->lookaside.nOut;
      }
      break;
    }

    case SQLITE_DBSTATUS_LOOKASIDE_HIT:
    case SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE:
    case SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL: {
      testcase( op==SQLITE_DBSTATUS_LOOKASIDE_HIT );
      testcase( op==SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE );
      testcase( op==SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL );
      assert( (op-SQLITE_DBSTATUS_LOOKASIDE_HIT)>=0 );
      assert( (op-SQLITE_DBSTATUS_LOOKASIDE_HIT)<3 );
      *pCurrent = 0;
      *pHighwater = db->lookaside.anStat[op - SQLITE_DBSTATUS_LOOKASIDE_HIT];
      if( resetFlag ){
        db->lookaside.anStat[op - SQLITE_DBSTATUS_LOOKASIDE_HIT] = 0;
      }
      break;
    }

    /* 
    ** Return an approximation for the amount of memory currently used
    ** by all pagers associated with the given database connection.  The
    ** highwater mark is meaningless and is returned as zero.
    */
    case SQLITE_DBSTATUS_CACHE_USED: {
      int totalUsed = 0;
      int i;
      sqlite3BtreeEnterAll(db);
      for(i=0; i<db->nDb; i++){
        Btree *pBt = db->aDb[i].pBt;
        if( pBt ){
          Pager *pPager = sqlite3BtreePager(pBt);
          totalUsed += sqlite3PagerMemUsed(pPager);
        }
      }
      sqlite3BtreeLeaveAll(db);
      *pCurrent = totalUsed;
      *pHighwater = 0;
      break;
    }

    /*
    ** *pCurrent gets an accurate estimate of the amount of memory used
    ** to store the schema for all databases (main, temp, and any ATTACHed
    ** databases.  *pHighwater is set to zero.
    */
    case SQLITE_DBSTATUS_SCHEMA_USED: {
      int i;                      /* Used to iterate through schemas */
      int nByte = 0;              /* Used to accumulate return value */

      sqlite3BtreeEnterAll(db);
      db->pnBytesFreed = &nByte;
      for(i=0; i<db->nDb; i++){
        Schema *pSchema = db->aDb[i].pSchema;
        if( ALWAYS(pSchema!=0) ){
          HashElem *p;

          nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * (
              pSchema->tblHash.count 
            + pSchema->trigHash.count
            + pSchema->idxHash.count
            + pSchema->fkeyHash.count
          );
          nByte += sqlite3MallocSize(pSchema->tblHash.ht);
          nByte += sqlite3MallocSize(pSchema->trigHash.ht);
          nByte += sqlite3MallocSize(pSchema->idxHash.ht);
          nByte += sqlite3MallocSize(pSchema->fkeyHash.ht);

          for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){
            sqlite3DeleteTrigger(db, (Trigger*)sqliteHashData(p));
          }
          for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
            sqlite3DeleteTable(db, (Table *)sqliteHashData(p));
          }
        }
      }
      db->pnBytesFreed = 0;
      sqlite3BtreeLeaveAll(db);

      *pHighwater = 0;
      *pCurrent = nByte;
      break;
    }

    /*
    ** *pCurrent gets an accurate estimate of the amount of memory used
    ** to store all prepared statements.
    ** *pHighwater is set to zero.
    */
    case SQLITE_DBSTATUS_STMT_USED: {
      struct Vdbe *pVdbe;         /* Used to iterate through VMs */
      int nByte = 0;              /* Used to accumulate return value */

      db->pnBytesFreed = &nByte;
      for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){
        sqlite3VdbeDeleteObject(db, pVdbe);
      }
      db->pnBytesFreed = 0;

      *pHighwater = 0;
      *pCurrent = nByte;

      break;
    }

    default: {
      rc = SQLITE_ERROR;
    }
  }
  sqlite3_mutex_leave(db->mutex);

Here is the call graph for this function:

SQLITE_API int sqlite3_declare_vtab ( sqlite3 ,
const char *  zSQL 
)

Definition at line 97922 of file sqlite3.c.

                                                                          {
  Parse *pParse;

  int rc = SQLITE_OK;
  Table *pTab;
  char *zErr = 0;

  sqlite3_mutex_enter(db->mutex);
  if( !db->pVtabCtx || !(pTab = db->pVtabCtx->pTab) ){
    sqlite3Error(db, SQLITE_MISUSE, 0);
    sqlite3_mutex_leave(db->mutex);
    return SQLITE_MISUSE_BKPT;
  }
  assert( (pTab->tabFlags & TF_Virtual)!=0 );

  pParse = sqlite3StackAllocZero(db, sizeof(*pParse));
  if( pParse==0 ){
    rc = SQLITE_NOMEM;
  }else{
    pParse->declareVtab = 1;
    pParse->db = db;
    pParse->nQueryLoop = 1;
  
    if( SQLITE_OK==sqlite3RunParser(pParse, zCreateTable, &zErr) 
     && pParse->pNewTable
     && !db->mallocFailed
     && !pParse->pNewTable->pSelect
     && (pParse->pNewTable->tabFlags & TF_Virtual)==0
    ){
      if( !pTab->aCol ){
        pTab->aCol = pParse->pNewTable->aCol;
        pTab->nCol = pParse->pNewTable->nCol;
        pParse->pNewTable->nCol = 0;
        pParse->pNewTable->aCol = 0;
      }
      db->pVtabCtx->pTab = 0;
    }else{
      sqlite3Error(db, SQLITE_ERROR, (zErr ? "%s" : 0), zErr);
      sqlite3DbFree(db, zErr);
      rc = SQLITE_ERROR;
    }
    pParse->declareVtab = 0;
  
    if( pParse->pVdbe ){
      sqlite3VdbeFinalize(pParse->pVdbe);
    }
    sqlite3DeleteTable(db, pParse->pNewTable);
    sqlite3StackFree(db, pParse);
  }

  assert( (rc&0xff)==rc );
  rc = sqlite3ApiExit(db, rc);

Here is the call graph for this function:

Definition at line 87927 of file sqlite3.c.

                                                                    {
  sqlite3_mutex_enter(db->mutex);
  if( onoff ){
    db->flags |= SQLITE_LoadExtension;
  }else{
    db->flags &= ~SQLITE_LoadExtension;
  }

Here is the caller graph for this function:

Definition at line 47582 of file sqlite3.c.

                                                      {

Definition at line 109513 of file sqlite3.c.

                                           {
  if( db && !sqlite3SafetyCheckSickOrOk(db) ){
    return SQLITE_MISUSE_BKPT;
  }
  if( !db || db->mallocFailed ){
    return SQLITE_NOMEM;

Here is the call graph for this function:

SQLITE_API const char* sqlite3_errmsg ( sqlite3 )

Definition at line 109440 of file sqlite3.c.

                                                  {
  const char *z;
  if( !db ){
    return sqlite3ErrStr(SQLITE_NOMEM);
  }
  if( !sqlite3SafetyCheckSickOrOk(db) ){
    return sqlite3ErrStr(SQLITE_MISUSE_BKPT);
  }
  sqlite3_mutex_enter(db->mutex);
  if( db->mallocFailed ){
    z = sqlite3ErrStr(SQLITE_NOMEM);
  }else{
    z = (char*)sqlite3_value_text(db->pErr);
    assert( !db->mallocFailed );
    if( z==0 ){
      z = sqlite3ErrStr(db->errCode);
    }
  }

Here is the call graph for this function:

SQLITE_API const void* sqlite3_errmsg16 ( sqlite3 )

Definition at line 109467 of file sqlite3.c.

                                                    {
  static const u16 outOfMem[] = {
    'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
  };
  static const u16 misuse[] = {
    'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', 
    'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', 
    'c', 'a', 'l', 'l', 'e', 'd', ' ', 
    'o', 'u', 't', ' ', 
    'o', 'f', ' ', 
    's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0
  };

  const void *z;
  if( !db ){
    return (void *)outOfMem;
  }
  if( !sqlite3SafetyCheckSickOrOk(db) ){
    return (void *)misuse;
  }
  sqlite3_mutex_enter(db->mutex);
  if( db->mallocFailed ){
    z = (void *)outOfMem;
  }else{
    z = sqlite3_value_text16(db->pErr);
    if( z==0 ){
      sqlite3ValueSetStr(db->pErr, -1, sqlite3ErrStr(db->errCode),
           SQLITE_UTF8, SQLITE_STATIC);
      z = sqlite3_value_text16(db->pErr);
    }
    /* A malloc() may have failed within the call to sqlite3_value_text16()
    ** above. If this is the case, then the db->mallocFailed flag needs to
    ** be cleared before returning. Do this directly, instead of via
    ** sqlite3ApiExit(), to avoid setting the database handle error message.
    */
    db->mallocFailed = 0;
  }

Here is the call graph for this function:

SQLITE_API int sqlite3_exec ( sqlite3 ,
const char *  sql,
int(*)(void *, int, char **, char **)  callback,
void *  ,
char **  errmsg 
)

Definition at line 86888 of file sqlite3.c.

 {
  int rc = SQLITE_OK;         /* Return code */
  const char *zLeftover;      /* Tail of unprocessed SQL */
  sqlite3_stmt *pStmt = 0;    /* The current SQL statement */
  char **azCols = 0;          /* Names of result columns */
  int nRetry = 0;             /* Number of retry attempts */
  int callbackIsInit;         /* True if callback data is initialized */

  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
  if( zSql==0 ) zSql = "";

  sqlite3_mutex_enter(db->mutex);
  sqlite3Error(db, SQLITE_OK, 0);
  while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){
    int nCol;
    char **azVals = 0;

    pStmt = 0;
    rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover);
    assert( rc==SQLITE_OK || pStmt==0 );
    if( rc!=SQLITE_OK ){
      continue;
    }
    if( !pStmt ){
      /* this happens for a comment or white-space */
      zSql = zLeftover;
      continue;
    }

    callbackIsInit = 0;
    nCol = sqlite3_column_count(pStmt);

    while( 1 ){
      int i;
      rc = sqlite3_step(pStmt);

      /* Invoke the callback function if required */
      if( xCallback && (SQLITE_ROW==rc || 
          (SQLITE_DONE==rc && !callbackIsInit
                           && db->flags&SQLITE_NullCallback)) ){
        if( !callbackIsInit ){
          azCols = sqlite3DbMallocZero(db, 2*nCol*sizeof(const char*) + 1);
          if( azCols==0 ){
            goto exec_out;
          }
          for(i=0; i<nCol; i++){
            azCols[i] = (char *)sqlite3_column_name(pStmt, i);
            /* sqlite3VdbeSetColName() installs column names as UTF8
            ** strings so there is no way for sqlite3_column_name() to fail. */
            assert( azCols[i]!=0 );
          }
          callbackIsInit = 1;
        }
        if( rc==SQLITE_ROW ){
          azVals = &azCols[nCol];
          for(i=0; i<nCol; i++){
            azVals[i] = (char *)sqlite3_column_text(pStmt, i);
            if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){
              db->mallocFailed = 1;
              goto exec_out;
            }
          }
        }
        if( xCallback(pArg, nCol, azVals, azCols) ){
          rc = SQLITE_ABORT;
          sqlite3VdbeFinalize((Vdbe *)pStmt);
          pStmt = 0;
          sqlite3Error(db, SQLITE_ABORT, 0);
          goto exec_out;
        }
      }

      if( rc!=SQLITE_ROW ){
        rc = sqlite3VdbeFinalize((Vdbe *)pStmt);
        pStmt = 0;
        if( rc!=SQLITE_SCHEMA ){
          nRetry = 0;
          zSql = zLeftover;
          while( sqlite3Isspace(zSql[0]) ) zSql++;
        }
        break;
      }
    }

    sqlite3DbFree(db, azCols);
    azCols = 0;
  }

exec_out:
  if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt);
  sqlite3DbFree(db, azCols);

  rc = sqlite3ApiExit(db, rc);
  if( rc!=SQLITE_OK && ALWAYS(rc==sqlite3_errcode(db)) && pzErrMsg ){
    int nErrMsg = 1 + sqlite3Strlen30(sqlite3_errmsg(db));
    *pzErrMsg = sqlite3Malloc(nErrMsg);
    if( *pzErrMsg ){
      memcpy(*pzErrMsg, sqlite3_errmsg(db), nErrMsg);
    }else{
      rc = SQLITE_NOMEM;
      sqlite3Error(db, SQLITE_NOMEM, 0);
    }
  }else if( pzErrMsg ){
    *pzErrMsg = 0;
  }

  assert( (rc&db->errMask)==rc );

Here is the call graph for this function:

Definition at line 60819 of file sqlite3.c.

                                                   {

Definition at line 109522 of file sqlite3.c.

                                                    {
  if( db && !sqlite3SafetyCheckSickOrOk(db) ){
    return SQLITE_MISUSE_BKPT;
  }
  if( !db || db->mallocFailed ){
    return SQLITE_NOMEM;

Definition at line 110562 of file sqlite3.c.

                                                                    {
  sqlite3_mutex_enter(db->mutex);
  db->errMask = onoff ? 0xffffffff : 0xff;
SQLITE_API int sqlite3_file_control ( sqlite3 ,
const char *  zDbName,
int  op,
void *   
)

Definition at line 110572 of file sqlite3.c.

                                                                                         {
  int rc = SQLITE_ERROR;
  int iDb;
  sqlite3_mutex_enter(db->mutex);
  if( zDbName==0 ){
    iDb = 0;
  }else{
    for(iDb=0; iDb<db->nDb; iDb++){
      if( strcmp(db->aDb[iDb].zName, zDbName)==0 ) break;
    }
  }
  if( iDb<db->nDb ){
    Btree *pBtree = db->aDb[iDb].pBt;
    if( pBtree ){
      Pager *pPager;
      sqlite3_file *fd;
      sqlite3BtreeEnter(pBtree);
      pPager = sqlite3BtreePager(pBtree);
      assert( pPager!=0 );
      fd = sqlite3PagerFile(pPager);
      assert( fd!=0 );
      if( op==SQLITE_FCNTL_FILE_POINTER ){
        *(sqlite3_file**)pArg = fd;
        rc = SQLITE_OK;
      }else if( fd->pMethods ){
        rc = sqlite3OsFileControl(fd, op, pArg);
      }else{
        rc = SQLITE_NOTFOUND;
      }
      sqlite3BtreeLeave(pBtree);
    }
  }

Here is the call graph for this function:

Definition at line 60856 of file sqlite3.c.

                                                    {
  int rc;
  if( pStmt==0 ){
    /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
    ** pointer is a harmless no-op. */
    rc = SQLITE_OK;
  }else{
    Vdbe *v = (Vdbe*)pStmt;
    sqlite3 *db = v->db;
#if SQLITE_THREADSAFE
    sqlite3_mutex *mutex;
#endif
    if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT;
#if SQLITE_THREADSAFE
    mutex = v->db->mutex;
#endif
    sqlite3_mutex_enter(mutex);
    rc = sqlite3VdbeFinalize(v);
    rc = sqlite3ApiExit(db, rc);
    sqlite3_mutex_leave(mutex);

Here is the call graph for this function:

SQLITE_API void sqlite3_free ( void *  )

Definition at line 18472 of file sqlite3.c.

Here is the call graph for this function:

SQLITE_API void sqlite3_free_table ( char **  result)

Definition at line 95118 of file sqlite3.c.

 {
  if( azResult ){
    int i, n;
    azResult--;
    assert( azResult!=0 );
    n = SQLITE_PTR_TO_INT(azResult[0]);
    for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); }

Definition at line 110380 of file sqlite3.c.

                                                  {

Definition at line 61386 of file sqlite3.c.

                                                                     {
  VdbeFunc *pVdbeFunc;

  assert( sqlite3_mutex_held(pCtx->s.db->mutex) );
  pVdbeFunc = pCtx->pVdbeFunc;
  if( !pVdbeFunc || iArg>=pVdbeFunc->nAux || iArg<0 ){
    return 0;

Here is the call graph for this function:

SQLITE_API int sqlite3_get_table ( sqlite3 db,
const char *  zSql,
char ***  pazResult,
int pnRow,
int pnColumn,
char **  pzErrmsg 
)

Definition at line 95052 of file sqlite3.c.

 {
  int rc;
  TabResult res;

  *pazResult = 0;
  if( pnColumn ) *pnColumn = 0;
  if( pnRow ) *pnRow = 0;
  if( pzErrMsg ) *pzErrMsg = 0;
  res.zErrMsg = 0;
  res.nRow = 0;
  res.nColumn = 0;
  res.nData = 1;
  res.nAlloc = 20;
  res.rc = SQLITE_OK;
  res.azResult = sqlite3_malloc(sizeof(char*)*res.nAlloc );
  if( res.azResult==0 ){
     db->errCode = SQLITE_NOMEM;
     return SQLITE_NOMEM;
  }
  res.azResult[0] = 0;
  rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg);
  assert( sizeof(res.azResult[0])>= sizeof(res.nData) );
  res.azResult[0] = SQLITE_INT_TO_PTR(res.nData);
  if( (rc&0xff)==SQLITE_ABORT ){
    sqlite3_free_table(&res.azResult[1]);
    if( res.zErrMsg ){
      if( pzErrMsg ){
        sqlite3_free(*pzErrMsg);
        *pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg);
      }
      sqlite3_free(res.zErrMsg);
    }
    db->errCode = res.rc;  /* Assume 32-bit assignment is atomic */
    return res.rc;
  }
  sqlite3_free(res.zErrMsg);
  if( rc!=SQLITE_OK ){
    sqlite3_free_table(&res.azResult[1]);
    return rc;
  }
  if( res.nAlloc>res.nData ){
    char **azNew;
    azNew = sqlite3_realloc( res.azResult, sizeof(char*)*res.nData );
    if( azNew==0 ){
      sqlite3_free_table(&res.azResult[1]);
      db->errCode = SQLITE_NOMEM;
      return SQLITE_NOMEM;
    }
    res.azResult = azNew;
  }
  *pazResult = &res.azResult[1];
  if( pnColumn ) *pnColumn = res.nColumn;

Here is the call graph for this function:

Definition at line 110367 of file sqlite3.c.

                                           {

Definition at line 108027 of file sqlite3.c.

                                       {
  sqlite3_mutex *pMaster;                      /* The main static mutex */
  int rc;                                      /* Result code */

#ifdef SQLITE_OMIT_WSD
  rc = sqlite3_wsd_init(4096, 24);
  if( rc!=SQLITE_OK ){
    return rc;
  }
#endif

  /* If SQLite is already completely initialized, then this call
  ** to sqlite3_initialize() should be a no-op.  But the initialization
  ** must be complete.  So isInit must not be set until the very end
  ** of this routine.
  */
  if( sqlite3GlobalConfig.isInit ) return SQLITE_OK;

  /* Make sure the mutex subsystem is initialized.  If unable to 
  ** initialize the mutex subsystem, return early with the error.
  ** If the system is so sick that we are unable to allocate a mutex,
  ** there is not much SQLite is going to be able to do.
  **
  ** The mutex subsystem must take care of serializing its own
  ** initialization.
  */
  rc = sqlite3MutexInit();
  if( rc ) return rc;

  /* Initialize the malloc() system and the recursive pInitMutex mutex.
  ** This operation is protected by the STATIC_MASTER mutex.  Note that
  ** MutexAlloc() is called for a static mutex prior to initializing the
  ** malloc subsystem - this implies that the allocation of a static
  ** mutex must not require support from the malloc subsystem.
  */
  pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
  sqlite3_mutex_enter(pMaster);
  sqlite3GlobalConfig.isMutexInit = 1;
  if( !sqlite3GlobalConfig.isMallocInit ){
    rc = sqlite3MallocInit();
  }
  if( rc==SQLITE_OK ){
    sqlite3GlobalConfig.isMallocInit = 1;
    if( !sqlite3GlobalConfig.pInitMutex ){
      sqlite3GlobalConfig.pInitMutex =
           sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
      if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){
        rc = SQLITE_NOMEM;
      }
    }
  }
  if( rc==SQLITE_OK ){
    sqlite3GlobalConfig.nRefInitMutex++;
  }
  sqlite3_mutex_leave(pMaster);

  /* If rc is not SQLITE_OK at this point, then either the malloc
  ** subsystem could not be initialized or the system failed to allocate
  ** the pInitMutex mutex. Return an error in either case.  */
  if( rc!=SQLITE_OK ){
    return rc;
  }

  /* Do the rest of the initialization under the recursive mutex so
  ** that we will be able to handle recursive calls into
  ** sqlite3_initialize().  The recursive calls normally come through
  ** sqlite3_os_init() when it invokes sqlite3_vfs_register(), but other
  ** recursive calls might also be possible.
  **
  ** IMPLEMENTATION-OF: R-00140-37445 SQLite automatically serializes calls
  ** to the xInit method, so the xInit method need not be threadsafe.
  **
  ** The following mutex is what serializes access to the appdef pcache xInit
  ** methods.  The sqlite3_pcache_methods.xInit() all is embedded in the
  ** call to sqlite3PcacheInitialize().
  */
  sqlite3_mutex_enter(sqlite3GlobalConfig.pInitMutex);
  if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){
    FuncDefHash *pHash = &GLOBAL(FuncDefHash, sqlite3GlobalFunctions);
    sqlite3GlobalConfig.inProgress = 1;
    memset(pHash, 0, sizeof(sqlite3GlobalFunctions));
    sqlite3RegisterGlobalFunctions();
    if( sqlite3GlobalConfig.isPCacheInit==0 ){
      rc = sqlite3PcacheInitialize();
    }
    if( rc==SQLITE_OK ){
      sqlite3GlobalConfig.isPCacheInit = 1;
      rc = sqlite3OsInit();
    }
    if( rc==SQLITE_OK ){
      sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, 
          sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
      sqlite3GlobalConfig.isInit = 1;
    }
    sqlite3GlobalConfig.inProgress = 0;
  }
  sqlite3_mutex_leave(sqlite3GlobalConfig.pInitMutex);

  /* Go back under the static mutex and clean up the recursive
  ** mutex to prevent a resource leak.
  */
  sqlite3_mutex_enter(pMaster);
  sqlite3GlobalConfig.nRefInitMutex--;
  if( sqlite3GlobalConfig.nRefInitMutex<=0 ){
    assert( sqlite3GlobalConfig.nRefInitMutex==0 );
    sqlite3_mutex_free(sqlite3GlobalConfig.pInitMutex);
    sqlite3GlobalConfig.pInitMutex = 0;
  }
  sqlite3_mutex_leave(pMaster);

  /* The following is just a sanity check to make sure SQLite has
  ** been compiled correctly.  It is important to run this code, but
  ** we don't want to run it too often and soak up CPU cycles for no
  ** reason.  So we run it once during initialization.
  */
#ifndef NDEBUG
#ifndef SQLITE_OMIT_FLOATING_POINT
  /* This section of code's only "output" is via assert() statements. */
  if ( rc==SQLITE_OK ){
    u64 x = (((u64)1)<<63)-1;
    double y;
    assert(sizeof(x)==8);
    assert(sizeof(x)==sizeof(y));
    memcpy(&y, &x, 8);
    assert( sqlite3IsNaN(y) );
  }
#endif
#endif

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 108928 of file sqlite3.c.

                                              {

Definition at line 108548 of file sqlite3.c.

                                                              {
SQLITE_API const char* sqlite3_libversion ( void  )

Definition at line 107958 of file sqlite3.c.

{ return sqlite3_version; }

Definition at line 107969 of file sqlite3.c.

SQLITE_API int sqlite3_limit ( sqlite3 ,
int  id,
int  newVal 
)

Definition at line 109675 of file sqlite3.c.

                                                                    {
  int oldLimit;


  /* EVIDENCE-OF: R-30189-54097 For each limit category SQLITE_LIMIT_NAME
  ** there is a hard upper bound set at compile-time by a C preprocessor
  ** macro called SQLITE_MAX_NAME. (The "_LIMIT_" in the name is changed to
  ** "_MAX_".)
  */
  assert( aHardLimit[SQLITE_LIMIT_LENGTH]==SQLITE_MAX_LENGTH );
  assert( aHardLimit[SQLITE_LIMIT_SQL_LENGTH]==SQLITE_MAX_SQL_LENGTH );
  assert( aHardLimit[SQLITE_LIMIT_COLUMN]==SQLITE_MAX_COLUMN );
  assert( aHardLimit[SQLITE_LIMIT_EXPR_DEPTH]==SQLITE_MAX_EXPR_DEPTH );
  assert( aHardLimit[SQLITE_LIMIT_COMPOUND_SELECT]==SQLITE_MAX_COMPOUND_SELECT);
  assert( aHardLimit[SQLITE_LIMIT_VDBE_OP]==SQLITE_MAX_VDBE_OP );
  assert( aHardLimit[SQLITE_LIMIT_FUNCTION_ARG]==SQLITE_MAX_FUNCTION_ARG );
  assert( aHardLimit[SQLITE_LIMIT_ATTACHED]==SQLITE_MAX_ATTACHED );
  assert( aHardLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]==
                                               SQLITE_MAX_LIKE_PATTERN_LENGTH );
  assert( aHardLimit[SQLITE_LIMIT_VARIABLE_NUMBER]==SQLITE_MAX_VARIABLE_NUMBER);
  assert( aHardLimit[SQLITE_LIMIT_TRIGGER_DEPTH]==SQLITE_MAX_TRIGGER_DEPTH );
  assert( SQLITE_LIMIT_TRIGGER_DEPTH==(SQLITE_N_LIMIT-1) );


  if( limitId<0 || limitId>=SQLITE_N_LIMIT ){
    return -1;
  }
  oldLimit = db->aLimit[limitId];
  if( newLimit>=0 ){                   /* IMP: R-52476-28732 */
    if( newLimit>aHardLimit[limitId] ){
      newLimit = aHardLimit[limitId];  /* IMP: R-51463-25634 */
    }
    db->aLimit[limitId] = newLimit;
SQLITE_API int sqlite3_load_extension ( sqlite3 db,
const char *  zFile,
const char *  zProc,
char **  pzErrMsg 
)

Definition at line 87896 of file sqlite3.c.

 {
  int rc;
  sqlite3_mutex_enter(db->mutex);
  rc = sqlite3LoadExtension(db, zFile, zProc, pzErrMsg);
  rc = sqlite3ApiExit(db, rc);

Here is the caller graph for this function:

SQLITE_API void sqlite3_log ( int  iErrCode,
const char *  zFormat,
  ... 
)

Definition at line 19774 of file sqlite3.c.

                                                                   {
  va_list ap;                             /* Vararg list */
  if( sqlite3GlobalConfig.xLog ){
    va_start(ap, zFormat);
    renderLogMsg(iErrCode, zFormat, ap);

Here is the call graph for this function:

Definition at line 18330 of file sqlite3.c.

                                      {
#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize() ) return 0;
#endif

Here is the call graph for this function:

Definition at line 18237 of file sqlite3.c.

                                                                {
  int n, mx;
  sqlite3_int64 res;
  sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, resetFlag);
  res = (sqlite3_int64)mx;  /* Work around bug in Borland C. Ticket #3216 */

Definition at line 18224 of file sqlite3.c.

                                                  {
  int n, mx;
  sqlite3_int64 res;
  sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, 0);
  res = (sqlite3_int64)n;  /* Work around bug in Borland C. Ticket #3216 */
SQLITE_API char* sqlite3_mprintf ( const char *  ,
  ... 
)

Definition at line 19709 of file sqlite3.c.

                                                          {
  va_list ap;
  char *z;
#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize() ) return 0;
#endif
  va_start(ap, zFormat);
  z = sqlite3_vmprintf(zFormat, ap);

Here is the call graph for this function:

Definition at line 16764 of file sqlite3.c.

                                                     {
#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize() ) return 0;
#endif

Here is the call graph for this function:

Definition at line 16792 of file sqlite3.c.

                                                     {
  if( p ){
    sqlite3GlobalConfig.mutex.xMutexEnter(p);

Definition at line 16782 of file sqlite3.c.

                                                    {
  if( p ){
    sqlite3GlobalConfig.mutex.xMutexFree(p);

Definition at line 16816 of file sqlite3.c.

                                                     {
  if( p ){
    sqlite3GlobalConfig.mutex.xMutexLeave(p);

Here is the caller graph for this function:

Definition at line 16802 of file sqlite3.c.

                                                  {
  int rc = SQLITE_OK;
  if( p ){
    return sqlite3GlobalConfig.mutex.xMutexTry(p);
  }

Definition at line 62077 of file sqlite3.c.

                                                                             {
  sqlite3_stmt *pNext;
  sqlite3_mutex_enter(pDb->mutex);
  if( pStmt==0 ){
    pNext = (sqlite3_stmt*)pDb->pVdbe;
  }else{
    pNext = (sqlite3_stmt*)((Vdbe*)pStmt)->pNext;
  }
SQLITE_API int sqlite3_open ( const char *  filename,
sqlite3 **  ppDb 
)

Definition at line 110207 of file sqlite3.c.

 {
SQLITE_API int sqlite3_open16 ( const void *  filename,
sqlite3 **  ppDb 
)

Definition at line 110227 of file sqlite3.c.

 {
  char const *zFilename8;   /* zFilename encoded in UTF-8 instead of UTF-16 */
  sqlite3_value *pVal;
  int rc;

  assert( zFilename );
  assert( ppDb );
  *ppDb = 0;
#ifndef SQLITE_OMIT_AUTOINIT
  rc = sqlite3_initialize();
  if( rc ) return rc;
#endif
  pVal = sqlite3ValueNew(0);
  sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
  zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
  if( zFilename8 ){
    rc = openDatabase(zFilename8, ppDb,
                      SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
    assert( *ppDb || rc==SQLITE_NOMEM );
    if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){
      ENC(*ppDb) = SQLITE_UTF16NATIVE;
    }
  }else{
    rc = SQLITE_NOMEM;
  }
  sqlite3ValueFree(pVal);

Here is the call graph for this function:

SQLITE_API int sqlite3_open_v2 ( const char *  filename,
sqlite3 **  ppDb,
int  flags,
const char *  zVfs 
)

Definition at line 110214 of file sqlite3.c.

 {

Definition at line 31209 of file sqlite3.c.

                                   { 

Here is the caller graph for this function:

Definition at line 31112 of file sqlite3.c.

                                    { 
  /* 
  ** The following macro defines an initializer for an sqlite3_vfs object.
  ** The name of the VFS is NAME.  The pAppData is a pointer to a pointer
  ** to the "finder" function.  (pAppData is a pointer to a pointer because
  ** silly C90 rules prohibit a void* from being cast to a function pointer
  ** and so we have to go through the intermediate pointer to avoid problems
  ** when compiling with -pedantic-errors on GCC.)
  **
  ** The FINDER parameter to this macro is the name of the pointer to the
  ** finder-function.  The finder-function returns a pointer to the
  ** sqlite_io_methods object that implements the desired locking
  ** behaviors.  See the division above that contains the IOMETHODS
  ** macro for addition information on finder-functions.
  **
  ** Most finders simply return a pointer to a fixed sqlite3_io_methods
  ** object.  But the "autolockIoFinder" available on MacOSX does a little
  ** more than that; it looks at the filesystem type that hosts the 
  ** database file and tries to choose an locking method appropriate for
  ** that filesystem time.
  */
  #define UNIXVFS(VFSNAME, FINDER) {                        \
    3,                    /* iVersion */                    \
    sizeof(unixFile),     /* szOsFile */                    \
    MAX_PATHNAME,         /* mxPathname */                  \
    0,                    /* pNext */                       \
    VFSNAME,              /* zName */                       \
    (void*)&FINDER,       /* pAppData */                    \
    unixOpen,             /* xOpen */                       \
    unixDelete,           /* xDelete */                     \
    unixAccess,           /* xAccess */                     \
    unixFullPathname,     /* xFullPathname */               \
    unixDlOpen,           /* xDlOpen */                     \
    unixDlError,          /* xDlError */                    \
    unixDlSym,            /* xDlSym */                      \
    unixDlClose,          /* xDlClose */                    \
    unixRandomness,       /* xRandomness */                 \
    unixSleep,            /* xSleep */                      \
    unixCurrentTime,      /* xCurrentTime */                \
    unixGetLastError,     /* xGetLastError */               \
    unixCurrentTimeInt64, /* xCurrentTimeInt64 */           \
    unixSetSystemCall,    /* xSetSystemCall */              \
    unixGetSystemCall,    /* xGetSystemCall */              \
    unixNextSystemCall,   /* xNextSystemCall */             \
  }

  /*
  ** All default VFSes for unix are contained in the following array.
  **
  ** Note that the sqlite3_vfs.pNext field of the VFS object is modified
  ** by the SQLite core when the VFS is registered.  So the following
  ** array cannot be const.
  */
  static sqlite3_vfs aVfs[] = {
#if SQLITE_ENABLE_LOCKING_STYLE && (OS_VXWORKS || defined(__APPLE__))
    UNIXVFS("unix",          autolockIoFinder ),
#else
    UNIXVFS("unix",          posixIoFinder ),
#endif
    UNIXVFS("unix-none",     nolockIoFinder ),
    UNIXVFS("unix-dotfile",  dotlockIoFinder ),
    UNIXVFS("unix-excl",     posixIoFinder ),
#if OS_VXWORKS
    UNIXVFS("unix-namedsem", semIoFinder ),
#endif
#if SQLITE_ENABLE_LOCKING_STYLE
    UNIXVFS("unix-posix",    posixIoFinder ),
#if !OS_VXWORKS
    UNIXVFS("unix-flock",    flockIoFinder ),
#endif
#endif
#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
    UNIXVFS("unix-afp",      afpIoFinder ),
    UNIXVFS("unix-nfs",      nfsIoFinder ),
    UNIXVFS("unix-proxy",    proxyIoFinder ),
#endif
  };
  unsigned int i;          /* Loop counter */

  /* Double-check that the aSyscall[] array has been constructed
  ** correctly.  See ticket [bb3a86e890c8e96ab] */
  assert( ArraySize(aSyscall)==16 );

  /* Register all VFSes defined in the aVfs[] array */
  for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){
    sqlite3_vfs_register(&aVfs[i], i==0);

Here is the caller graph for this function:

SQLITE_API int sqlite3_overload_function ( sqlite3 ,
const char *  zFuncName,
int  nArg 
)

Definition at line 109120 of file sqlite3.c.

 {
  int nName = sqlite3Strlen30(zName);
  int rc;
  sqlite3_mutex_enter(db->mutex);
  if( sqlite3FindFunction(db, zName, nName, nArg, SQLITE_UTF8, 0)==0 ){
    sqlite3CreateFunc(db, zName, nArg, SQLITE_UTF8,
                      0, sqlite3InvalidFunction, 0, 0, 0);
  }
  rc = sqlite3ApiExit(db, SQLITE_OK);

Here is the call graph for this function:

SQLITE_API int sqlite3_prepare ( sqlite3 db,
const char *  zSql,
int  nByte,
sqlite3_stmt **  ppStmt,
const char **  pzTail 
)

Definition at line 90360 of file sqlite3.c.

 {
  int rc;
  rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);

Here is the call graph for this function:

SQLITE_API int sqlite3_prepare16 ( sqlite3 db,
const void *  zSql,
int  nByte,
sqlite3_stmt **  ppStmt,
const void **  pzTail 
)

Definition at line 90440 of file sqlite3.c.

 {
  int rc;
  rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);

Here is the call graph for this function:

SQLITE_API int sqlite3_prepare16_v2 ( sqlite3 db,
const void *  zSql,
int  nByte,
sqlite3_stmt **  ppStmt,
const void **  pzTail 
)

Definition at line 90452 of file sqlite3.c.

 {
  int rc;
  rc = sqlite3Prepare16(db,zSql,nBytes,1,ppStmt,pzTail);
SQLITE_API int sqlite3_prepare_v2 ( sqlite3 db,
const char *  zSql,
int  nByte,
sqlite3_stmt **  ppStmt,
const char **  pzTail 
)

Definition at line 90372 of file sqlite3.c.

 {
  int rc;
  rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,0,ppStmt,pzTail);
SQLITE_API SQLITE_EXPERIMENTAL void* sqlite3_profile ( sqlite3 ,
void(*)(void *, const char *, sqlite3_uint64 xProfile,
void *   
)

Definition at line 109163 of file sqlite3.c.

 {
  void *pOld;
  sqlite3_mutex_enter(db->mutex);
  pOld = db->pProfileArg;
  db->xProfile = xProfile;
  db->pProfileArg = pArg;
SQLITE_API void sqlite3_progress_handler ( sqlite3 ,
int  ,
int(*)(void *)  ,
void *   
)

Definition at line 108890 of file sqlite3.c.

 {
  sqlite3_mutex_enter(db->mutex);
  if( nOps>0 ){
    db->xProgress = xProgress;
    db->nProgressOps = nOps;
    db->pProgressArg = pArg;
  }else{
    db->xProgress = 0;
    db->nProgressOps = 0;
    db->pProgressArg = 0;
SQLITE_API void sqlite3_randomness ( int  N,
void *  P 
)

Definition at line 19921 of file sqlite3.c.

                                                     {
  unsigned char *zBuf = pBuf;
#if SQLITE_THREADSAFE
  sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG);
#endif
  sqlite3_mutex_enter(mutex);
  while( N-- ){
    *(zBuf++) = randomByte();

Here is the call graph for this function:

SQLITE_API void* sqlite3_realloc ( void *  ,
int   
)

Definition at line 18568 of file sqlite3.c.

                                                   {
#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize() ) return 0;
#endif

Here is the call graph for this function:

Definition at line 18030 of file sqlite3.c.

                                            {
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
  return sqlite3PcacheReleaseMemory(n);
#else
  /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
  ** is a no-op returning zero if SQLite is not compiled with
  ** SQLITE_ENABLE_MEMORY_MANAGEMENT. */
  UNUSED_PARAMETER(n);
  return 0;

Definition at line 60888 of file sqlite3.c.

                                                 {
  int rc;
  if( pStmt==0 ){
    rc = SQLITE_OK;
  }else{
    Vdbe *v = (Vdbe*)pStmt;
    sqlite3_mutex_enter(v->db->mutex);
    rc = sqlite3VdbeReset(v);
    sqlite3VdbeRewind(v);
    assert( (rc & (v->db->errMask))==rc );
    rc = sqlite3ApiExit(v->db, rc);
    sqlite3_mutex_leave(v->db->mutex);

Here is the call graph for this function:

Definition at line 88023 of file sqlite3.c.

                                                  {
#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize()==SQLITE_OK )
#endif
  {
#if SQLITE_THREADSAFE
    sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
#endif
    wsdAutoextInit;
    sqlite3_mutex_enter(mutex);
    sqlite3_free(wsdAutoext.aExt);
    wsdAutoext.aExt = 0;
    wsdAutoext.nExt = 0;

Here is the call graph for this function:

Here is the caller graph for this function:

SQLITE_API void sqlite3_result_blob ( sqlite3_context ,
const void *  ,
int  ,
void(*)(void *)   
)

Definition at line 60994 of file sqlite3.c.

 {
  assert( n>=0 );
SQLITE_API void sqlite3_result_double ( sqlite3_context ,
double   
)

Definition at line 61004 of file sqlite3.c.

                                                                         {
SQLITE_API void sqlite3_result_error ( sqlite3_context ,
const char *  ,
int   
)

Definition at line 61008 of file sqlite3.c.

                                                                                 {
  assert( sqlite3_mutex_held(pCtx->s.db->mutex) );
SQLITE_API void sqlite3_result_error16 ( sqlite3_context ,
const void *  ,
int   
)

Definition at line 61014 of file sqlite3.c.

                                                                                   {
  assert( sqlite3_mutex_held(pCtx->s.db->mutex) );

Definition at line 61078 of file sqlite3.c.

                                                                             {
  pCtx->isError = errCode;
  if( pCtx->s.flags & MEM_Null ){
    sqlite3VdbeMemSetStr(&pCtx->s, sqlite3ErrStr(errCode), -1, 

Definition at line 61095 of file sqlite3.c.

                                                                 {
  assert( sqlite3_mutex_held(pCtx->s.db->mutex) );
  sqlite3VdbeMemSetNull(&pCtx->s);

Definition at line 61087 of file sqlite3.c.

                                                                  {
  assert( sqlite3_mutex_held(pCtx->s.db->mutex) );
  pCtx->isError = SQLITE_TOOBIG;

Definition at line 61020 of file sqlite3.c.

                                                                   {

Definition at line 61024 of file sqlite3.c.

                                                                     {

Definition at line 61028 of file sqlite3.c.

                                                          {
SQLITE_API void sqlite3_result_text ( sqlite3_context ,
const char *  ,
int  ,
void(*)(void *)   
)

Definition at line 61032 of file sqlite3.c.

 {
SQLITE_API void sqlite3_result_text16 ( sqlite3_context ,
const void *  ,
int  ,
void(*)(void *)   
)

Definition at line 61042 of file sqlite3.c.

 {
SQLITE_API void sqlite3_result_text16be ( sqlite3_context ,
const void *  ,
int  ,
void(*)(void *)   
)

Definition at line 61051 of file sqlite3.c.

 {
SQLITE_API void sqlite3_result_text16le ( sqlite3_context ,
const void *  ,
int  ,
void(*)(void *)   
)

Definition at line 61060 of file sqlite3.c.

 {
SQLITE_API void sqlite3_result_value ( sqlite3_context ,
sqlite3_value *   
)

Definition at line 61070 of file sqlite3.c.

                                                                                  {

Definition at line 61074 of file sqlite3.c.

                                                                     {
SQLITE_API void* sqlite3_rollback_hook ( sqlite3 ,
void(*)(void *)  ,
void *   
)

Definition at line 109220 of file sqlite3.c.

 {
  void *pRet;
  sqlite3_mutex_enter(db->mutex);
  pRet = db->pRollbackArg;
  db->xRollbackCallback = xCallback;
  db->pRollbackArg = pArg;
SQLITE_API int sqlite3_rtree_geometry_callback ( sqlite3 db,
const char *  zGeom,
int(*)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes)  xGeom,
void *  pContext 
)
SQLITE_API int sqlite3_set_authorizer ( sqlite3 ,
int(*)(void *, int, const char *, const char *, const char *, const char *)  xAuth,
void *  pUserData 
)

Definition at line 77156 of file sqlite3.c.

Here is the call graph for this function:

SQLITE_API void sqlite3_set_auxdata ( sqlite3_context ,
int  N,
void *  ,
void(*)(void *)   
)

Definition at line 61402 of file sqlite3.c.

 {
  struct AuxData *pAuxData;
  VdbeFunc *pVdbeFunc;
  if( iArg<0 ) goto failed;

  assert( sqlite3_mutex_held(pCtx->s.db->mutex) );
  pVdbeFunc = pCtx->pVdbeFunc;
  if( !pVdbeFunc || pVdbeFunc->nAux<=iArg ){
    int nAux = (pVdbeFunc ? pVdbeFunc->nAux : 0);
    int nMalloc = sizeof(VdbeFunc) + sizeof(struct AuxData)*iArg;
    pVdbeFunc = sqlite3DbRealloc(pCtx->s.db, pVdbeFunc, nMalloc);
    if( !pVdbeFunc ){
      goto failed;
    }
    pCtx->pVdbeFunc = pVdbeFunc;
    memset(&pVdbeFunc->apAux[nAux], 0, sizeof(struct AuxData)*(iArg+1-nAux));
    pVdbeFunc->nAux = iArg+1;
    pVdbeFunc->pFunc = pCtx->pFunc;
  }

  pAuxData = &pVdbeFunc->apAux[iArg];
  if( pAuxData->pAux && pAuxData->xDelete ){
    pAuxData->xDelete(pAuxData->pAux);
  }
  pAuxData->pAux = pAux;
  pAuxData->xDelete = xDelete;
  return;

failed:
  if( xDelete ){

Here is the call graph for this function:

Definition at line 108167 of file sqlite3.c.

                                     {
  if( sqlite3GlobalConfig.isInit ){
    sqlite3_os_end();
    sqlite3_reset_auto_extension();
    sqlite3GlobalConfig.isInit = 0;
  }
  if( sqlite3GlobalConfig.isPCacheInit ){
    sqlite3PcacheShutdown();
    sqlite3GlobalConfig.isPCacheInit = 0;
  }
  if( sqlite3GlobalConfig.isMallocInit ){
    sqlite3MallocEnd();
    sqlite3GlobalConfig.isMallocInit = 0;
  }
  if( sqlite3GlobalConfig.isMutexInit ){
    sqlite3MutexEnd();
    sqlite3GlobalConfig.isMutexInit = 0;
  }

Here is the call graph for this function:

Definition at line 110546 of file sqlite3.c.

                                    {
  sqlite3_vfs *pVfs;
  int rc;
  pVfs = sqlite3_vfs_find(0);
  if( pVfs==0 ) return 0;

  /* This function works in milliseconds, but the underlying OsSleep() 
  ** API uses microseconds. Hence the 1000's.
  */

Here is the call graph for this function:

SQLITE_API char* sqlite3_snprintf ( int  ,
char *  ,
const char *  ,
  ... 
)

Definition at line 19742 of file sqlite3.c.

                                                                              {
  char *z;
  va_list ap;
  va_start(ap,zFormat);
  z = sqlite3_vsnprintf(n, zBuf, zFormat, ap);

Definition at line 18155 of file sqlite3.c.

                                              {
  if( n<0 ) n = 0;

Definition at line 18136 of file sqlite3.c.

                                                                   {
  sqlite3_int64 priorLimit;
  sqlite3_int64 excess;
#ifndef SQLITE_OMIT_AUTOINIT
  sqlite3_initialize();
#endif
  sqlite3_mutex_enter(mem0.mutex);
  priorLimit = mem0.alarmThreshold;
  sqlite3_mutex_leave(mem0.mutex);
  if( n<0 ) return priorLimit;
  if( n>0 ){
    sqlite3MemoryAlarm(softHeapLimitEnforcer, 0, n);
  }else{
    sqlite3MemoryAlarm(0, 0, 0);
  }
  excess = sqlite3_memory_used() - n;
  if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));

Here is the call graph for this function: