typedef sqlite_int64 i64;
/* 8-byte signed
integer */typedef sqlite_uint64 u64;
/* 8-byte unsigned
integer */typedef UINT32_TYPE u32;
/* 4-byte unsigned
integer */typedef UINT16_TYPE u16;
/* 2-byte unsigned
integer */typedef INT16_TYPE i16;
/* 2-byte signed
integer */typedef UINT8_TYPE u8;
/* 1-byte unsigned
integer */typedef INT8_TYPE i8;
struct CollSeq {
char
*zName;
/* Name of the collating sequence
, UTF
-8 encoded
*/ u8 enc; /* Text encoding handled by xCmp() */
void
*pUser;
/* First argument
to xCmp
() */ void
(*xDel
)(void
*);
/* Destructor
for pUser
*/};
typedef void (*sqlite3_syscall_ptr)(void);
#ifdef SQLITE_INT64_TYPE
typedef SQLITE_INT64_TYPE sqlite_int64;
# ifdef SQLITE_UINT64_TYPE
typedef SQLITE_UINT64_TYPE sqlite_uint64;
typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
#elif defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 sqlite_int64;
typedef unsigned __int64 sqlite_uint64;
#else
#endif
typedef sqlite_int64 sqlite3_int64;
typedef sqlite_uint64 sqlite3_uint64;
struct sqlite3_file {
const struct sqlite3_io_methods
*pMethods;
/* Methods
for an
open file
*/ };
struct sqlite3_vfs {
int iVersion;
/* Structure version number
(currently
3) */ int szOsFile;
/* Size of subclassed sqlite3_file
*/ int mxPathname;
/* Maximum file pathname length
*/ sqlite3_vfs
*pNext;
/* Next registered VFS
*/ void
*pAppData;
/* Pointer
to application
-specific
data */ int (*xOpen
)(sqlite3_vfs
*, const char
*zName
, sqlite3_file
*, int (*xDelete
)(sqlite3_vfs
*, const char
*zName
, int syncDir
);
int (*xAccess
)(sqlite3_vfs
*, const char
*zName
, int flags
, int *pResOut
);
int (*xFullPathname
)(sqlite3_vfs
*, const char
*zName
, int nOut
, char
*zOut
);
void
*(*xDlOpen
)(sqlite3_vfs
*, const char
*zFilename
);
void
(*xDlError
)(sqlite3_vfs
*, int nByte
, char
*zErrMsg
);
void
(*(*xDlSym
)(sqlite3_vfs
*,void
*, const char
*zSymbol
))(void
);
void (*xDlClose)(sqlite3_vfs*, void*);
int (*xRandomness
)(sqlite3_vfs
*, int nByte
, char
*zOut
);
int (*xSleep
)(sqlite3_vfs
*, int microseconds
);
int (*xGetLastError
)(sqlite3_vfs
*, int, char
*);
/*
** The methods above are in version 1 of the sqlite_vfs object
** definition. Those that follow are added in version
2 or later
*/
int (*xCurrentTimeInt64
)(sqlite3_vfs
*, sqlite3_int64
*);
/*
** The methods above are in versions
1 and 2 of the sqlite_vfs object.
** Those below are
for version
3 and greater.
*/
int (*xSetSystemCall
)(sqlite3_vfs
*, const char
*zName
, sqlite3_syscall_ptr
);
sqlite3_syscall_ptr
(*xGetSystemCall
)(sqlite3_vfs
*, const char
*zName
);
const char
*(*xNextSystemCall
)(sqlite3_vfs
*, const char
*zName
);
/*
** The methods above are in versions 1 through 3 of the sqlite_vfs object.
** New fields may be appended in future versions. The iVersion
** value will increment whenever this happens.
*/
};
struct sqlite3 {
sqlite3_vfs *pVfs; /* OS Interface */
struct Vdbe
*pVdbe;
/* List of active virtual machines
*/ CollSeq
*pDfltColl;
/* The default collating sequence
(BINARY) */ sqlite3_mutex *mutex; /* Connection mutex */
Db *aDb; /* All backends */
int nDb;
/* Number of backends currently in use
*/ u32 mDbFlags; /* flags recording internal state */
u32 flags; /* flags settable by pragmas. See below */
i64 lastRowid; /* ROWID of most recent insert (see above) */
i64 szMmap; /* Default mmap_size setting */
u32 nSchemaLock;
/* Do not reset the schema when non
-zero
*/ unsigned
int openFlags;
/* Flags passed
to sqlite3_vfs.xOpen
() */ int errCode;
/* Most recent
error code
(SQLITE_
*) */ int errMask;
/* & result codes with this before returning
*/ u16 dbOptFlags;
/* Flags
to enable
/disable optimizations
*/ u8 enc; /* Text encoding */
u8 autoCommit; /* The auto-commit flag. */
u8 temp_store; /* 1: file 2: memory 0: default */
u8 mallocFailed;
/* True
if we have seen a malloc failure
*/ u8 bBenignMalloc;
/* Do not require OOMs
if true
*/ u8 dfltLockMode;
/* Default locking
-mode
for attached dbs
*/ signed char nextAutovac;
/* Autovac setting after VACUUM
if >=0 */ u8 vtabOnConflict;
/* Value
to return for s3_vtab_on_conflict
() */ u8 isTransactionSavepoint;
/* True
if the outermost savepoint
is a TS
*/ u8 mTrace;
/* zero
or more SQLITE_TRACE flags
*/ u8 noSharedCache;
/* True
if no shared
-cache backends
*/ u8 nSqlExec; /* Number of pending OP_SqlExec opcodes */
int nextPagesize;
/* Pagesize after VACUUM
if >0 */ u32 magic;
/* Magic number
for detect
library misuse
*/ int nChange;
/* Value returned by sqlite3_changes
() */ int nTotalChange;
/* Value returned by sqlite3_total_changes
() */ int aLimit
[SQLITE_N_LIMIT
];
/* Limits
*/ int nMaxSorterMmap;
/* Maximum size of regions mapped by sorter
*/ struct sqlite3InitInfo { /* Information used during initialization */
int newTnum;
/* Rootpage of table being initialized
*/ u8 iDb;
/* Which db file
is being initialized
*/ u8 busy;
/* TRUE
if currently initializing
*/ unsigned orphanTrigger :
1;
/* Last statement
is orphaned TEMP trigger
*/ unsigned imposterTable : 1; /* Building an imposter table */
unsigned reopenMemdb :
1;
/* ATTACH
is really a reopen
using MemDB
*/ } init;
int nVdbeActive;
/* Number of VDBEs currently running
*/ int nVdbeExec;
/* Number of nested
calls to VdbeExec
() */ int nVDestroy;
/* Number of active OP_VDestroy operations
*/ int nExtension;
/* Number of loaded extensions
*/ int (*xTrace
)(u32
,void
*,void
*,void
*);
/* Trace
function */ void
*pTraceArg;
/* Argument
to the trace
function */ void
(*xProfile
)(void
*,const char
*,u64
);
/* Profiling
function */ void
*pProfileArg;
/* Argument
to profile
function */ void
*pCommitArg;
/* Argument
to xCommitCallback
() */ int (*xCommitCallback
)(void
*);
/* Invoked at every commit.
*/ void
*pRollbackArg;
/* Argument
to xRollbackCallback
() */ void (*xRollbackCallback)(void*); /* Invoked at every commit. */
void *pUpdateArg;
void
(*xUpdateCallback
)(void
*,int, const char
*,const char
*,sqlite_int64
);
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
void
*pPreUpdateArg;
/* First argument
to xPreUpdateCallback
*/ void
(*xPreUpdateCallback
)( /* Registered
using sqlite3_preupdate_hook
() */ void
*,sqlite3
*,int,char
const*,char
const*,sqlite3_int64
,sqlite3_int64
);
PreUpdate
*pPreUpdate;
/* Context
for active pre
-update callback
*/#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
#ifndef SQLITE_OMIT_WAL
int (*xWalCallback
)(void
*, sqlite3
*, const char
*, int);
void *pWalArg;
#endif
void
(*xCollNeeded
)(void
*,sqlite3
*,int eTextRep
,const char
*);
void
(*xCollNeeded16
)(void
*,sqlite3
*,int eTextRep
,const void
*);
void *pCollNeededArg;
sqlite3_value
*pErr;
/* Most recent
error message
*/ union {
volatile
int isInterrupted;
/* True
if sqlite3_interrupt has been called
*/ } u1;
Lookaside lookaside; /* Lookaside malloc configuration */
#ifndef SQLITE_OMIT_AUTHORIZATION
#endif
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
int (*xProgress
)(void
*);
/* The progress callback
*/ void
*pProgressArg;
/* Argument
to the progress callback
*/ unsigned nProgressOps;
/* Number of opcodes
for progress callback
*/#endif
#ifndef SQLITE_OMIT_VIRTUALTABLE
int nVTrans;
/* Allocated size of aVTrans
*/ Hash aModule; /* populated by sqlite3_create_module() */
VtabCtx
*pVtabCtx;
/* Context
for active vtab connect
/create
*/ VTable
**aVTrans;
/* Virtual tables with
open transactions
*/ VTable
*pDisconnect;
/* Disconnect these in
next sqlite3_prepare
() */#endif
Hash aFunc; /* Hash table of connection functions */
Hash aCollSeq; /* All collating sequences */
BusyHandler busyHandler; /* Busy callback */
Db aDbStatic
[2];
/* Static space
for the
2 default backends
*/ Savepoint
*pSavepoint;
/* List of active savepoints
*/ int busyTimeout;
/* Busy handler timeout
, in msec
*/ int nSavepoint;
/* Number of non
-transaction savepoints
*/ int nStatement;
/* Number of nested statement
-transactions
*/ i64 nDeferredCons; /* Net deferred constraints this transaction. */
i64 nDeferredImmCons; /* Net deferred immediate constraints */
int *pnBytesFreed;
/* If not NULL
, increment this in DbFree
() */ #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
/* The following variables are all protected by the STATIC_MASTER
** mutex
, not by sqlite3.mutex. They are used by code in notify.c.
**
** When X.pUnlockConnection
==Y
, that means that X
is waiting
for Y
to ** unlock so that it can proceed.
**
** When X.pBlockingConnection==Y, that means that something that X tried
** tried
to do recently failed with an SQLITE_LOCKED
error due
to locks
** held by Y.
*/
sqlite3 *pBlockingConnection; /* Connection that caused SQLITE_LOCKED */
sqlite3
*pUnlockConnection;
/* Connection
to watch
for unlock */ void
*pUnlockArg;
/* Argument
to xUnlockNotify
*/ void
(*xUnlockNotify
)(void
**, int);
/* Unlock notify callback
*/ sqlite3
*pNextBlocked;
/* Next in
list of all blocked connections
*/#endif
#ifdef SQLITE_USER_AUTHENTICATION
sqlite3_userauth auth; /* User authentication information */
#endif
};
/* ------------------------------------------------------------------------------------------------------------------------------------*/
struct Instancia sqlite3;
}