?? sqlite3.h
字號:
** of good-quality randomness into zOut. The return value is** the actual number of bytes of randomness obtained.** The xSleep() method causes the calling thread to sleep for at** least the number of microseconds given. The xCurrentTime()** method returns a Julian Day Number for the current date and time.***/typedef struct sqlite3_vfs sqlite3_vfs;struct sqlite3_vfs { int iVersion; /* Structure version number */ int szOsFile; /* Size of subclassed sqlite3_file */ int mxPathname; /* Maximum file pathname length */ sqlite3_vfs *pNext; /* Next registered VFS */ const char *zName; /* Name of this virtual file system */ void *pAppData; /* Pointer to application-specific data */ int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, int flags, int *pOutFlags); 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 (*xCurrentTime)(sqlite3_vfs*, double*); int (*xGetLastError)(sqlite3_vfs*, int, char *); /* New fields may be appended in figure versions. The iVersion ** value will increment whenever this happens. */};/*** CAPI3REF: Flags for the xAccess VFS method {H11190} <H11140>**** These integer constants can be used as the third parameter to** the xAccess method of an [sqlite3_vfs] object. {END} They determine** what kind of permissions the xAccess method is looking for.** With SQLITE_ACCESS_EXISTS, the xAccess method** simply checks whether the file exists.** With SQLITE_ACCESS_READWRITE, the xAccess method** checks whether the file is both readable and writable.** With SQLITE_ACCESS_READ, the xAccess method** checks whether the file is readable.*/#define SQLITE_ACCESS_EXISTS 0#define SQLITE_ACCESS_READWRITE 1#define SQLITE_ACCESS_READ 2/*** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100>**** The sqlite3_initialize() routine initializes the** SQLite library. The sqlite3_shutdown() routine** deallocates any resources that were allocated by sqlite3_initialize().**** A call to sqlite3_initialize() is an "effective" call if it is** the first time sqlite3_initialize() is invoked during the lifetime of** the process, or if it is the first time sqlite3_initialize() is invoked** following a call to sqlite3_shutdown(). Only an effective call** of sqlite3_initialize() does any initialization. All other calls** are harmless no-ops.**** Among other things, sqlite3_initialize() shall invoke** sqlite3_os_init(). Similarly, sqlite3_shutdown()** shall invoke sqlite3_os_end().**** The sqlite3_initialize() routine returns [SQLITE_OK] on success.** If for some reason, sqlite3_initialize() is unable to initialize** the library (perhaps it is unable to allocate a needed resource such** as a mutex) it returns an [error code] other than [SQLITE_OK].**** The sqlite3_initialize() routine is called internally by many other** SQLite interfaces so that an application usually does not need to** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]** calls sqlite3_initialize() so the SQLite library will be automatically** initialized when [sqlite3_open()] is called if it has not be initialized** already. However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]** compile-time option, then the automatic calls to sqlite3_initialize()** are omitted and the application must call sqlite3_initialize() directly** prior to using any other SQLite interface. For maximum portability,** it is recommended that applications always invoke sqlite3_initialize()** directly prior to using any other SQLite interface. Future releases** of SQLite may require this. In other words, the behavior exhibited** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the** default behavior in some future release of SQLite.**** The sqlite3_os_init() routine does operating-system specific** initialization of the SQLite library. The sqlite3_os_end()** routine undoes the effect of sqlite3_os_init(). Typical tasks** performed by these routines include allocation or deallocation** of static resources, initialization of global variables,** setting up a default [sqlite3_vfs] module, or setting up** a default configuration using [sqlite3_config()].**** The application should never invoke either sqlite3_os_init()** or sqlite3_os_end() directly. The application should only invoke** sqlite3_initialize() and sqlite3_shutdown(). The sqlite3_os_init()** interface is called automatically by sqlite3_initialize() and** sqlite3_os_end() is called by sqlite3_shutdown(). Appropriate** implementations for sqlite3_os_init() and sqlite3_os_end()** are built into SQLite when it is compiled for unix, windows, or os/2.** When built for other platforms (using the [SQLITE_OS_OTHER=1] compile-time** option) the application must supply a suitable implementation for** sqlite3_os_init() and sqlite3_os_end(). An application-supplied** implementation of sqlite3_os_init() or sqlite3_os_end()** must return [SQLITE_OK] on success and some other [error code] upon** failure.*/int sqlite3_initialize(void);int sqlite3_shutdown(void);int sqlite3_os_init(void);int sqlite3_os_end(void);/*** CAPI3REF: Configuring The SQLite Library {H14100} <S20000><S30200>** EXPERIMENTAL**** The sqlite3_config() interface is used to make global configuration** changes to SQLite in order to tune SQLite to the specific needs of** the application. The default configuration is recommended for most** applications and so this routine is usually not necessary. It is** provided to support rare applications with unusual needs.**** The sqlite3_config() interface is not threadsafe. The application** must insure that no other SQLite interfaces are invoked by other** threads while sqlite3_config() is running. Furthermore, sqlite3_config()** may only be invoked prior to library initialization using** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].** Note, however, that sqlite3_config() can be called as part of the** implementation of an application-defined [sqlite3_os_init()].**** The first argument to sqlite3_config() is an integer** [SQLITE_CONFIG_SINGLETHREAD | configuration option] that determines** what property of SQLite is to be configured. Subsequent arguments** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option]** in the first argument.**** When a configuration option is set, sqlite3_config() returns [SQLITE_OK].** If the option is unknown or SQLite is unable to set the option** then this routine returns a non-zero [error code].**** INVARIANTS:**** {H14103} A successful invocation of [sqlite3_config()] shall return** [SQLITE_OK].**** {H14106} The [sqlite3_config()] interface shall return [SQLITE_MISUSE]** if it is invoked in between calls to [sqlite3_initialize()] and** [sqlite3_shutdown()].**** {H14120} A successful call to [sqlite3_config]([SQLITE_CONFIG_SINGLETHREAD])** shall set the default [threading mode] to Single-thread.**** {H14123} A successful call to [sqlite3_config]([SQLITE_CONFIG_MULTITHREAD])** shall set the default [threading mode] to Multi-thread.**** {H14126} A successful call to [sqlite3_config]([SQLITE_CONFIG_SERIALIZED])** shall set the default [threading mode] to Serialized.**** {H14129} A successful call to [sqlite3_config]([SQLITE_CONFIG_MUTEX],X)** where X is a pointer to an initialized [sqlite3_mutex_methods]** object shall cause all subsequent mutex operations performed** by SQLite to use the mutex methods that were present in X** during the call to [sqlite3_config()].**** {H14132} A successful call to [sqlite3_config]([SQLITE_CONFIG_GETMUTEX],X)** where X is a pointer to an [sqlite3_mutex_methods] object ** shall overwrite the content of [sqlite3_mutex_methods] object** with the mutex methods currently in use by SQLite.**** {H14135} A successful call to [sqlite3_config]([SQLITE_CONFIG_MALLOC],M)** where M is a pointer to an initialized [sqlite3_mem_methods]** object shall cause all subsequent memory allocation operations** performed by SQLite to use the methods that were present in ** M during the call to [sqlite3_config()].**** {H14138} A successful call to [sqlite3_config]([SQLITE_CONFIG_GETMALLOC],M)** where M is a pointer to an [sqlite3_mem_methods] object shall** overwrite the content of [sqlite3_mem_methods] object with ** the memory allocation methods currently in use by** SQLite.**** {H14141} A successful call to [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],1)** shall enable the memory allocation status collection logic.**** {H14144} A successful call to [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],0)** shall disable the memory allocation status collection logic.**** {H14147} The memory allocation status collection logic shall be** enabled by default.**** {H14150} A successful call to [sqlite3_config]([SQLITE_CONFIG_SCRATCH],S,Z,N)** where Z and N are non-negative integers and ** S is a pointer to an aligned memory buffer not less than** Z*N bytes in size shall cause S to be used by the** [scratch memory allocator] for as many as N simulataneous** allocations each of size (Z & ~7).**** {H14153} A successful call to [sqlite3_config]([SQLITE_CONFIG_SCRATCH],S,Z,N)** where S is a NULL pointer shall disable the** [scratch memory allocator].**** {H14156} A successful call to** [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],S,Z,N)** where Z and N are non-negative integers and ** S is a pointer to an aligned memory buffer not less than** Z*N bytes in size shall cause S to be used by the** [pagecache memory allocator] for as many as N simulataneous** allocations each of size (Z & ~7).**** {H14159} A successful call to** [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],S,Z,N)** where S is a NULL pointer shall disable the** [pagecache memory allocator].**** {H14162} A successful call to [sqlite3_config]([SQLITE_CONFIG_HEAP],H,Z,N)** where Z and N are non-negative integers and ** H is a pointer to an aligned memory buffer not less than** Z bytes in size shall enable the [memsys5] memory allocator** and cause it to use buffer S as its memory source and to use** a minimum allocation size of N.**** {H14165} A successful call to [sqlite3_config]([SQLITE_CONFIG_HEAP],H,Z,N)** where H is a NULL pointer shall disable the** [memsys5] memory allocator.**** {H14168} A successful call to [sqlite3_config]([SQLITE_CONFIG_LOOKASIDE],Z,N)** shall cause the default [lookaside memory allocator] configuration** for new [database connections] to be N slots of Z bytes each.*/SQLITE_EXPERIMENTAL int sqlite3_config(int, ...);/*** CAPI3REF: Configure database connections {H14200} <S20000>** EXPERIMENTAL**** The sqlite3_db_config() interface is used to make configuration** changes to a [database connection]. The interface is similar to** [sqlite3_config()] except that the changes apply to a single** [database connection] (specified in the first argument). The** sqlite3_db_config() interface can only be used immediately after** the database connection is created using [sqlite3_open()],** [sqlite3_open16()], or [sqlite3_open_v2()]. **** The second argument to sqlite3_db_config(D,V,...) is the** configuration verb - an integer code that indicates what** aspect of the [database connection] is being configured.** The only choice for this value is [SQLITE_DBCONFIG_LOOKASIDE].** New verbs are likely to be added in future releases of SQLite.** Additional arguments depend on the verb.**** INVARIANTS:**** {H14203} A call to [sqlite3_db_config(D,V,...)] shall return [SQLITE_OK]** if and only if the call is successful.**** {H14206} If one or more slots of the [lookaside memory allocator] for** [database connection] D are in use, then a call to** [sqlite3_db_config](D,[SQLITE_DBCONFIG_LOOKASIDE],...) shall** fail with an [SQLITE_BUSY] return code.**** {H14209} A successful call to ** [sqlite3_db_config](D,[SQLITE_DBCONFIG_LOOKASIDE],B,Z,N) where** D is an open [database connection] and Z and N are positive** integers and B is an aligned buffer at least Z*N bytes in size** shall cause the [lookaside memory allocator] for D to use buffer B ** with N slots of Z bytes each.**** {H14212} A successful call to ** [sqlite3_db_config](D,[SQLITE_DBCONFIG_LOOKASIDE],B,Z,N) where** D is an open [database connection] and Z and N are positive** integers and B is NULL pointer shall cause the** [lookaside memory allocator] for D to a obtain Z*N byte buffer** from the primary memory allocator and use that buffer** with N lookaside slots of Z bytes each.**** {H14215} A successful call to ** [sqlite3_db_config](D,[SQLITE_DBCONFIG_LOOKASIDE],B,Z,N) where** D is an open [database connection] and Z and N are zero shall** disable the [lookaside memory allocator] for D.*****/SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -