?? sqlite3.h
字號:
#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 *//* end-of-error-codes *//*** CAPI3REF: Extended Result Codes**** In its default configuration, SQLite API routines return one of 26 integer** result codes described at result-codes. However, experience has shown that** many of these result codes are too course-grained. They do not provide as** much information about problems as users might like. In an effort to** address this, newer versions of SQLite (version 3.3.8 and later) include** support for additional result codes that provide more detailed information** about errors. The extended result codes are enabled (or disabled) for ** each database** connection using the [sqlite3_extended_result_codes()] API.** ** Some of the available extended result codes are listed above.** We expect the number of extended result codes will be expand** over time. Software that uses extended result codes should expect** to see new result codes in future releases of SQLite.** ** The symbolic name for an extended result code always contains a related** primary result code as a prefix. Primary result codes contain a single** "_" character. Extended result codes contain two or more "_" characters.** The numeric value of an extended result code can be converted to its** corresponding primary result code by masking off the lower 8 bytes.**** The SQLITE_OK result code will never be extended. It will always** be exactly zero.*/#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))/*** CAPI3REF: Flags For File Open Operations**** Combination of the following bit values are used as the** third argument to the [sqlite3_open_v2()] interface and** as fourth argument to the xOpen method of the** [sqlite3_vfs] object.***/#define SQLITE_OPEN_READONLY 0x00000001#define SQLITE_OPEN_READWRITE 0x00000002#define SQLITE_OPEN_CREATE 0x00000004#define SQLITE_OPEN_DELETEONCLOSE 0x00000008#define SQLITE_OPEN_EXCLUSIVE 0x00000010#define SQLITE_OPEN_MAIN_DB 0x00000100#define SQLITE_OPEN_TEMP_DB 0x00000200#define SQLITE_OPEN_TRANSIENT_DB 0x00000400#define SQLITE_OPEN_MAIN_JOURNAL 0x00000800#define SQLITE_OPEN_TEMP_JOURNAL 0x00001000#define SQLITE_OPEN_SUBJOURNAL 0x00002000#define SQLITE_OPEN_MASTER_JOURNAL 0x00004000/*** CAPI3REF: Device Characteristics**** The xDeviceCapabilities method of the [sqlite3_io_methods]** object returns an integer which is a vector of the following** bit values expressing I/O characteristics of the mass storage** device that holds the file that the [sqlite3_io_methods]** refers to.**** The SQLITE_IOCAP_ATOMIC property means that all writes of** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values** mean that writes of blocks that are nnn bytes in size and** are aligned to an address which is an integer multiple of** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means** that when data is appended to a file, the data is appended** first then the size of the file is extended, never the other** way around. The SQLITE_IOCAP_SEQUENTIAL property means that** information is written to disk in the same order as calls** to xWrite().*/#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/*** CAPI3REF: File Locking Levels**** SQLite uses one of the following integer values as the second** argument to calls it makes to the xLock() and xUnlock() methods** of an [sqlite3_io_methods] object.*/#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/*** CAPI3REF: Synchronization Type Flags**** When SQLite invokes the xSync() method of an [sqlite3_io_methods]** object it uses a combination of the following integer values as** the second argument.**** When the SQLITE_SYNC_DATAONLY flag is used, it means that the** sync operation only needs to flush data to mass storage. Inode** information need not be flushed. The SQLITE_SYNC_NORMAL means ** to use normal fsync() semantics. The SQLITE_SYNC_FULL flag means ** to use Mac OS-X style fullsync instead of fsync().*/#define SQLITE_SYNC_NORMAL 0x00002#define SQLITE_SYNC_FULL 0x00003#define SQLITE_SYNC_DATAONLY 0x00010/*** CAPI3REF: OS Interface Open File Handle**** An [sqlite3_file] object represents an open file in the OS** interface layer. Individual OS interface implementations will** want to subclass this object by appending additional fields** for their own use. The pMethods entry is a pointer to an** [sqlite3_io_methods] object that defines methods for performing** I/O operations on the open file.*/typedef struct sqlite3_file sqlite3_file;struct sqlite3_file { const struct sqlite3_io_methods *pMethods; /* Methods for an open file */};/*** CAPI3REF: OS Interface File Virtual Methods Object**** Every file opened by the [sqlite3_vfs] xOpen method contains a pointer to** an instance of the this object. This object defines the** methods used to perform various operations against the open file.**** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or** [SQLITE_SYNC_FULL]. The first choice is the normal fsync().* The second choice is an** OS-X style fullsync. The SQLITE_SYNC_DATA flag may be ORed in to** indicate that only the data of the file and not its inode needs to be** synced.** ** The integer values to xLock() and xUnlock() are one of** <ul>** <li> [SQLITE_LOCK_NONE],** <li> [SQLITE_LOCK_SHARED],** <li> [SQLITE_LOCK_RESERVED],** <li> [SQLITE_LOCK_PENDING], or** <li> [SQLITE_LOCK_EXCLUSIVE].** </ul>** xLock() increases the lock. xUnlock() decreases the lock. ** The xCheckReservedLock() method looks** to see if any database connection, either in this** process or in some other process, is holding an RESERVED,** PENDING, or EXCLUSIVE lock on the file. It returns true** if such a lock exists and false if not.** ** The xFileControl() method is a generic interface that allows custom** VFS implementations to directly control an open file using the** [sqlite3_file_control()] interface. The second "op" argument** is an integer opcode. The third** argument is a generic pointer which is intended to be a pointer** to a structure that may contain arguments or space in which to** write return values. Potential uses for xFileControl() might be** functions to enable blocking locks with timeouts, to change the** locking strategy (for example to use dot-file locks), to inquire** about the status of a lock, or to break stale locks. The SQLite** core reserves opcodes less than 100 for its own use. ** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available.** Applications that define a custom xFileControl method should use opcodes ** greater than 100 to avoid conflicts.**** The xSectorSize() method returns the sector size of the** device that underlies the file. The sector size is the** minimum write that can be performed without disturbing** other bytes in the file. The xDeviceCharacteristics()** method returns a bit vector describing behaviors of the** underlying device:**** <ul>** <li> [SQLITE_IOCAP_ATOMIC]** <li> [SQLITE_IOCAP_ATOMIC512]** <li> [SQLITE_IOCAP_ATOMIC1K]** <li> [SQLITE_IOCAP_ATOMIC2K]** <li> [SQLITE_IOCAP_ATOMIC4K]** <li> [SQLITE_IOCAP_ATOMIC8K]** <li> [SQLITE_IOCAP_ATOMIC16K]** <li> [SQLITE_IOCAP_ATOMIC32K]** <li> [SQLITE_IOCAP_ATOMIC64K]** <li> [SQLITE_IOCAP_SAFE_APPEND]** <li> [SQLITE_IOCAP_SEQUENTIAL]** </ul>**** The SQLITE_IOCAP_ATOMIC property means that all writes of** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values** mean that writes of blocks that are nnn bytes in size and** are aligned to an address which is an integer multiple of** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means** that when data is appended to a file, the data is appended** first then the size of the file is extended, never the other** way around. The SQLITE_IOCAP_SEQUENTIAL property means that** information is written to disk in the same order as calls** to xWrite().*/typedef struct sqlite3_io_methods sqlite3_io_methods;struct sqlite3_io_methods { int iVersion; int (*xClose)(sqlite3_file*); int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); int (*xSync)(sqlite3_file*, int flags); int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); int (*xLock)(sqlite3_file*, int); int (*xUnlock)(sqlite3_file*, int); int (*xCheckReservedLock)(sqlite3_file*); int (*xFileControl)(sqlite3_file*, int op, void *pArg); int (*xSectorSize)(sqlite3_file*); int (*xDeviceCharacteristics)(sqlite3_file*); /* Additional methods may be added in future releases */};/*** CAPI3REF: Standard File Control Opcodes**** These integer constants are opcodes for the xFileControl method** of the [sqlite3_io_methods] object and to the [sqlite3_file_control()]** interface.**** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This** opcode cases the xFileControl method to write the current state of** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])** into an integer that the pArg argument points to. This capability** is used during testing and only needs to be supported when SQLITE_TEST** is defined.*/#define SQLITE_FCNTL_LOCKSTATE 1/*** CAPI3REF: Mutex Handle**** The mutex module within SQLite defines [sqlite3_mutex] to be an** abstract type for a mutex object. The SQLite core never looks** at the internal representation of an [sqlite3_mutex]. It only** deals with pointers to the [sqlite3_mutex] object.**** Mutexes are created using [sqlite3_mutex_alloc()].*/typedef struct sqlite3_mutex sqlite3_mutex;/*** CAPI3REF: OS Interface Object**** An instance of this object defines the interface between the** SQLite core and the underlying operating system. The "vfs"** in the name of the object stands for "virtual file system".**** The iVersion field is initially 1 but may be larger for future** versions of SQLite. Additional fields may be appended to this** object when the iVersion value is increased.**** The szOsFile field is the size of the subclassed [sqlite3_file]** structure used by this VFS. mxPathname is the maximum length of** a pathname in this VFS.**** Registered vfs modules are kept on a linked list formed by
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -