NATIVE - Initialize The SQLite Library libsqlite3 … More...
Functions | |
static OT_ProcRet | tclsq3lite_Sq3Lite_Initialize (OtClass_ARGS) |
Tcl: → C-API Initialize The SQLite Library … | |
static OT_ProcRet | tclsq3lite_Sq3Lite_OsEnd (OtClass_ARGS) |
Tcl: → C-API Initialize The SQLite Library … | |
static OT_ProcRet | tclsq3lite_Sq3Lite_OsInit (OtClass_ARGS) |
Tcl: → C-API Initialize The SQLite Library … | |
static OT_ProcRet | tclsq3lite_Sq3Lite_Shutdown (OtClass_ARGS) |
Tcl: → C-API Initialize The SQLite Library … | |
NATIVE - Initialize The SQLite Library libsqlite3 …
Initialize The SQLite Library …
The Sq3Initialize() routine initializes the SQLite library. The Sq3Shutdown() routine deallocates any resources that were allocated by Sq3Initialize(). These routines are designed to aid in process initialization and shutdown on embedded systems. Workstation applications using SQLite normally do not need to invoke either of these routines.
A call to Sq3Initialize() is an "effective" call if it is the first time Sq3Initialize() is invoked during the lifetime of the process, or if it is the first time Sq3Initialize() is invoked following a call to Sq3Shutdown(). Only an effective call of Sq3Initialize() does any initialization. All other calls are harmless no-ops.
A call to Sq3Shutdown() is an "effective" call if it is the first call to Sq3Shutdown() since the last Sq3Initialize(). Only an effective call to Sq3Shutdown() does any deinitialization. All other valid calls to Sq3Shutdown() are harmless no-ops.
The Sq3Initialize() interface is threadsafe, but Sq3Shutdown() is not. The Sq3Shutdown() interface must only be called from a single thread. All open database connections must be closed and all other SQLite resources must be deallocated prior to invoking Sq3Shutdown().
Among other things, Sq3Initialize() will invoke Sq3OsInit(). Similarly, Sq3Shutdown() will invoke Sq3OsEnd().
The Sq3Initialize() routine returns SQ3_RESULT_OK on success. If for some reason, Sq3Initialize() 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 SQ3_RESULT_OK.
The Sq3Initialize() routine is called internally by many other SQLite interfaces so that an application usually does not need to invoke Sq3Initialize() directly. For example, sqlite3_open () calls Sq3Initialize() 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 Sq3Initialize() are omitted and the application must call Sq3Initialize() directly prior to using any other SQLite interface. For maximum portability, it is recommended that applications always invoke Sq3Initialize() 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 Sq3OsInit() routine does operating-system specific initialization of the SQLite library. The Sq3OsEnd() routine undoes the effect of Sq3OsInit(). 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 Sq3OsInit() or Sq3OsEnd() directly. The application should only invoke Sq3Initialize() and Sq3Shutdown(). The Sq3OsInit() interface is called automatically by Sq3Initialize() and Sq3OsEnd() is called by Sq3Shutdown(). Appropriate implementations for Sq3OsInit() and Sq3OsEnd() 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 Sq3OsInit() and Sq3OsEnd(). An application-supplied implementation of Sq3OsInit() or Sq3OsEnd() must return SQ3_RESULT_OK on success and some other error code upon failure.
Reference code from sqlite3:
|
static |
Tcl:
→ C-API (static) Sq3Lite Initialize
Initialize The SQLite Library …
Definition at line 5073 of file LibSq3Lite_tcl.c.
|
static |
Tcl:
→ C-API (static) Sq3Lite OsEnd
Initialize The SQLite Library …
Definition at line 5087 of file LibSq3Lite_tcl.c.
|
static |
Tcl:
→ C-API (static) Sq3Lite OsInit
Initialize The SQLite Library …
Definition at line 5101 of file LibSq3Lite_tcl.c.
|
static |
Tcl:
→ C-API (static) Sq3Lite Shutdown
Initialize The SQLite Library …
Definition at line 5115 of file LibSq3Lite_tcl.c.