?? sqlite3.h
字號(hào):
/*** 2001 September 15**** The author disclaims copyright to this source code. In place of** a legal notice, here is a blessing:**** May you do good and not evil.** May you find forgiveness for yourself and forgive others.** May you share freely, never taking more than you give.***************************************************************************** This header file defines the interface that the SQLite library** presents to client programs. If a C-function, structure, datatype,** or constant definition does not appear in this file, then it is** not a published API of SQLite, is subject to change without** notice, and should not be referenced by programs that use SQLite.**** Some of the definitions that are in this file are marked as** "experimental". Experimental interfaces are normally new** features recently added to SQLite. We do not anticipate changes** to experimental interfaces but reserve to make minor changes if** experience from use "in the wild" suggest such changes are prudent.**** The official C-language API documentation for SQLite is derived** from comments in this file. This file is the authoritative source** on how SQLite interfaces are suppose to operate.**** The name of this file under configuration management is "sqlite.h.in".** The makefile makes some minor changes to this file (such as inserting** the version number) and changes its name to "sqlite3.h" as** part of the build process.**** @(#) $Id: sqlite.h.in,v 1.432 2009/02/12 17:07:35 drh Exp $*/#ifndef _SQLITE3_H_#define _SQLITE3_H_#include <stdarg.h> /* Needed for the definition of va_list *//*** Make sure we can call this stuff from C++.*/#ifdef __cplusplusextern "C" {#endif/*** Add the ability to override 'extern'*/#ifndef SQLITE_EXTERN# define SQLITE_EXTERN extern#endif/*** These no-op macros are used in front of interfaces to mark those** interfaces as either deprecated or experimental. New applications** should not use deprecated intrfaces - they are support for backwards** compatibility only. Application writers should be aware that** experimental interfaces are subject to change in point releases.**** These macros used to resolve to various kinds of compiler magic that** would generate warning messages when they were used. But that** compiler magic ended up generating such a flurry of bug reports** that we have taken it all out and gone back to using simple** noop macros.*/#define SQLITE_DEPRECATED#define SQLITE_EXPERIMENTAL/*** Ensure these symbols were not defined by some previous header file.*/#ifdef SQLITE_VERSION# undef SQLITE_VERSION#endif#ifdef SQLITE_VERSION_NUMBER# undef SQLITE_VERSION_NUMBER#endif/*** CAPI3REF: Compile-Time Library Version Numbers {H10010} <S60100>**** The SQLITE_VERSION and SQLITE_VERSION_NUMBER #defines in** the sqlite3.h file specify the version of SQLite with which** that header file is associated.**** The "version" of SQLite is a string of the form "X.Y.Z".** The phrase "alpha" or "beta" might be appended after the Z.** The X value is major version number always 3 in SQLite3.** The X value only changes when backwards compatibility is** broken and we intend to never break backwards compatibility.** The Y value is the minor version number and only changes when** there are major feature enhancements that are forwards compatible** but not backwards compatible.** The Z value is the release number and is incremented with** each release but resets back to 0 whenever Y is incremented.**** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].**** INVARIANTS:**** {H10011} The SQLITE_VERSION #define in the sqlite3.h header file shall** evaluate to a string literal that is the SQLite version** with which the header file is associated.**** {H10014} The SQLITE_VERSION_NUMBER #define shall resolve to an integer** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z** are the major version, minor version, and release number.*/#define SQLITE_VERSION "3.6.11"#define SQLITE_VERSION_NUMBER 3006011/*** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>** KEYWORDS: sqlite3_version**** These features provide the same information as the [SQLITE_VERSION]** and [SQLITE_VERSION_NUMBER] #defines in the header, but are associated** with the library instead of the header file. Cautious programmers might** include a check in their application to verify that** sqlite3_libversion_number() always returns the value** [SQLITE_VERSION_NUMBER].**** The sqlite3_libversion() function returns the same information as is** in the sqlite3_version[] string constant. The function is provided** for use in DLLs since DLL users usually do not have direct access to string** constants within the DLL.**** INVARIANTS:**** {H10021} The [sqlite3_libversion_number()] interface shall return** an integer equal to [SQLITE_VERSION_NUMBER].**** {H10022} The [sqlite3_version] string constant shall contain** the text of the [SQLITE_VERSION] string.**** {H10023} The [sqlite3_libversion()] function shall return** a pointer to the [sqlite3_version] string constant.*/SQLITE_EXTERN const char sqlite3_version[];const char *sqlite3_libversion(void);int sqlite3_libversion_number(void);/*** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} <S60100>**** SQLite can be compiled with or without mutexes. When** the [SQLITE_THREADSAFE] C preprocessor macro 1 or 2, mutexes** are enabled and SQLite is threadsafe. When the** [SQLITE_THREADSAFE] macro is 0, ** the mutexes are omitted. Without the mutexes, it is not safe** to use SQLite concurrently from more than one thread.**** Enabling mutexes incurs a measurable performance penalty.** So if speed is of utmost importance, it makes sense to disable** the mutexes. But for maximum safety, mutexes should be enabled.** The default behavior is for mutexes to be enabled.**** This interface can be used by a program to make sure that the** version of SQLite that it is linking against was compiled with** the desired setting of the [SQLITE_THREADSAFE] macro.**** This interface only reports on the compile-time mutex setting** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with** SQLITE_THREADSAFE=1 then mutexes are enabled by default but** can be fully or partially disabled using a call to [sqlite3_config()]** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],** or [SQLITE_CONFIG_MUTEX]. The return value of this function shows** only the default compile-time setting, not any run-time changes** to that setting.**** See the [threading mode] documentation for additional information.**** INVARIANTS:**** {H10101} The [sqlite3_threadsafe()] function shall return zero if** and only if SQLite was compiled with mutexing code omitted.**** {H10102} The value returned by the [sqlite3_threadsafe()] function** shall remain the same across calls to [sqlite3_config()].*/int sqlite3_threadsafe(void);/*** CAPI3REF: Database Connection Handle {H12000} <S40200>** KEYWORDS: {database connection} {database connections}**** Each open SQLite database is represented by a pointer to an instance of** the opaque structure named "sqlite3". It is useful to think of an sqlite3** pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]** is its destructor. There are many other interfaces (such as** [sqlite3_prepare_v2()], [sqlite3_create_function()], and** [sqlite3_busy_timeout()] to name but three) that are methods on an** sqlite3 object.*/typedef struct sqlite3 sqlite3;/*** CAPI3REF: 64-Bit Integer Types {H10200} <S10110>** KEYWORDS: sqlite_int64 sqlite_uint64**** Because there is no cross-platform way to specify 64-bit integer types** SQLite includes typedefs for 64-bit signed and unsigned integers.**** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.** The sqlite_int64 and sqlite_uint64 types are supported for backwards** compatibility only.**** INVARIANTS:**** {H10201} The [sqlite_int64] and [sqlite3_int64] type shall specify** a 64-bit signed integer.**** {H10202} The [sqlite_uint64] and [sqlite3_uint64] type shall specify** a 64-bit unsigned integer.*/#ifdef SQLITE_INT64_TYPE typedef SQLITE_INT64_TYPE sqlite_int64; typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;#elif defined(_MSC_VER) || defined(__BORLANDC__) typedef __int64 sqlite_int64; typedef unsigned __int64 sqlite_uint64;#else typedef long long int sqlite_int64; typedef unsigned long long int sqlite_uint64;#endiftypedef sqlite_int64 sqlite3_int64;typedef sqlite_uint64 sqlite3_uint64;/*** If compiling for a processor that lacks floating point support,** substitute integer for floating-point.*/#ifdef SQLITE_OMIT_FLOATING_POINT# define double sqlite3_int64#endif/*** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200>**** This routine is the destructor for the [sqlite3] object.**** Applications should [sqlite3_finalize | finalize] all [prepared statements]** and [sqlite3_blob_close | close] all [BLOB handles] associated with** the [sqlite3] object prior to attempting to close the object.** The [sqlite3_next_stmt()] interface can be used to locate all** [prepared statements] associated with a [database connection] if desired.** Typical code might look like this:**** <blockquote><pre>** sqlite3_stmt *pStmt;** while( (pStmt = sqlite3_next_stmt(db, 0))!=0 ){** sqlite3_finalize(pStmt);** }** </pre></blockquote>**** If [sqlite3_close()] is invoked while a transaction is open,** the transaction is automatically rolled back.**** INVARIANTS:**** {H12011} A successful call to [sqlite3_close(C)] shall destroy the** [database connection] object C.**** {H12012} A successful call to [sqlite3_close(C)] shall return SQLITE_OK.**** {H12013} A successful call to [sqlite3_close(C)] shall release all** memory and system resources associated with [database connection]** C.**** {H12014} A call to [sqlite3_close(C)] on a [database connection] C that** has one or more open [prepared statements] shall fail with** an [SQLITE_BUSY] error code.**** {H12015} A call to [sqlite3_close(C)] where C is a NULL pointer shall** be a harmless no-op returning SQLITE_OK.**** {H12019} When [sqlite3_close(C)] is invoked on a [database connection] C** that has a pending transaction, the transaction shall be** rolled back.**** ASSUMPTIONS:**** {A12016} The C parameter to [sqlite3_close(C)] must be either a NULL
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -