⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sqlite3.h

📁 SQLite的VS2005封装
💻 H
📖 第 1 页 / 共 5 页
字号:
** 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 (*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>**** {H11191} 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.** {H11192} With SQLITE_ACCESS_EXISTS, the xAccess method** simply checks whether the file exists.** {H11193} With SQLITE_ACCESS_READWRITE, the xAccess method** checks whether the file is both readable and writable.** {H11194} 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 {H10145} <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].*/SQLITE_EXPERIMENTAL int sqlite3_config(int, ...);/*** CAPI3REF: Configure database connections  {H10180} <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.*/SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...);/*** CAPI3REF: Memory Allocation Routines {H10155} <S20120>** EXPERIMENTAL**** An instance of this object defines the interface between SQLite** and low-level memory allocation routines.**** This object is used in only one place in the SQLite interface.** A pointer to an instance of this object is the argument to** [sqlite3_config()] when the configuration option is** [SQLITE_CONFIG_MALLOC].  By creating an instance of this object** and passing it to [sqlite3_config()] during configuration, an** application can specify an alternative memory allocation subsystem** for SQLite to use for all of its dynamic memory needs.**** Note that SQLite comes with a built-in memory allocator that is** perfectly adequate for the overwhelming majority of applications** and that this object is only useful to a tiny minority of applications** with specialized memory allocation requirements.  This object is** also used during testing of SQLite in order to specify an alternative** memory allocator that simulates memory out-of-memory conditions in** order to verify that SQLite recovers gracefully from such** conditions.**** The xMalloc, xFree, and xRealloc methods must work like the** malloc(), free(), and realloc() functions from the standard library.**** xSize should return the allocated size of a memory allocation** previously obtained from xMalloc or xRealloc.  The allocated size** is always at least as big as the requested size but may be larger.**** The xRoundup method returns what would be the allocated size of** a memory allocation given a particular requested size.  Most memory** allocators round up memory allocations at least to the next multiple** of 8.  Some allocators round up to a larger multiple or to a power of 2.**** The xInit method initializes the memory allocator.  (For example,** it might allocate any require mutexes or initialize internal data** structures.  The xShutdown method is invoked (indirectly) by** [sqlite3_shutdown()] and should deallocate any resources acquired** by xInit.  The pAppData pointer is used as the only parameter to** xInit and xShutdown.*/typedef struct sqlite3_mem_methods sqlite3_mem_methods;struct sqlite3_mem_methods {  void *(*xMalloc)(int);         /* Memory allocation function */  void (*xFree)(void*);          /* Free a prior allocation */  void *(*xRealloc)(void*,int);  /* Resize an allocation */  int (*xSize)(void*);           /* Return the size of an allocation */  int (*xRoundup)(int);          /* Round up request size to allocation size */  int (*xInit)(void*);           /* Initialize the memory allocator */  void (*xShutdown)(void*);      /* Deinitialize the memory allocator */  void *pAppData;                /* Argument to xInit() and xShutdown() */};/*** CAPI3REF: Configuration Options {H10160} <S20000>** EXPERIMENTAL**** These constants are the available integer configuration options that** can be passed as the first argument to the [sqlite3_config()] interface.**** New configuration options may be added in future releases of SQLite.** Existing configuration options might be discontinued.  Applications** should check the return code from [sqlite3_config()] to make sure that** the call worked.  The [sqlite3_config()] interface will return a** non-zero [error code] if a discontinued or unsupported configuration option** is invoked.**** <dl>** <dt>SQLITE_CONFIG_SINGLETHREAD</dt>** <dd>There are no arguments to this option.  This option disables** all mutexing and puts SQLite into a mode where it can only be used** by a single thread.</dd>**** <dt>SQLITE_CONFIG_MULTITHREAD</dt>** <dd>There are no arguments to this option.  This option disables** mutexing on [database connection] and [prepared statement] objects.** The application is responsible for serializing access to** [database connections] and [prepared statements].  But other mutexes** are enabled so that SQLite will be safe to use in a multi-threaded** environment as long as no two threads attempt to use the same** [database connection] at the same time.  See the [threading mode]** documentation for additional information.</dd>**** <dt>SQLITE_CONFIG_SERIALIZED</dt>** <dd>There are no arguments to this option.  This option enables** all mutexes including the recursive** mutexes on [database connection] and [prepared statement] objects.** In this mode (which is the default when SQLite is compiled with** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access** to [database connections] and [prepared statements] so that the** application is free to use the same [database connection] or the** same [prepared statement] in different threads at the same time.** See the [threading mode] documentation for additional information.</dd>**** <dt>SQLITE_CONFIG_MALLOC</dt>** <dd>This option takes a single argument which is a pointer to an** instance of the [sqlite3_mem_methods] structure.  The argument specifies** alternative low-level memory allocation routines to be used in place of** the memory allocation routines built into SQLite.</dd>**** <dt>SQLITE_CONFIG_GETMALLOC</dt>** <dd>This option takes a single argument which is a pointer to an** instance of the [sqlite3_mem_methods] structure.  The [sqlite3_mem_methods]** structure is filled with the currently defined memory allocation routines.** This option can be used to overload the default memory allocation** routines with a wrapper that simulations memory allocation failure or** tracks memory usage, for example.</dd>**** <dt>SQLITE_CONFIG_MEMSTATUS</dt>** <dd>This option takes single argument of type int, interpreted as a ** boolean, which enables or disables the collection of memory allocation ** statistics. When disabled, the following SQLite interfaces become ** non-operational:**   <ul>**   <li> [sqlite3_memory_used()]**   <li> [sqlite3_memory_highwater()]**   <li> [sqlite3_soft_heap_limit()]**   <li> [sqlite3_status()]**   </ul>** </dd>**** <dt>SQLITE_CONFIG_SCRATCH</dt>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -