theSq3Lite 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard - theLib - theATL
c - tcl - atl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
Sq3Lite_Setup_libsqlite3_TCL_API

NATIVE - Initialize The SQLite Library libsqlite3More...

+ Collaboration diagram for Sq3Lite_Setup_libsqlite3_TCL_API:

Functions

static OT_ProcRet tclsq3lite_Sq3Lite_Initialize (OtClass_ARGS)
  Tcl: (static) Sq3Lite Initialize C-API
Initialize The SQLite Library …
 
static OT_ProcRet tclsq3lite_Sq3Lite_OsEnd (OtClass_ARGS)
  Tcl: (static) Sq3Lite OsEnd C-API
Initialize The SQLite Library …
 
static OT_ProcRet tclsq3lite_Sq3Lite_OsInit (OtClass_ARGS)
  Tcl: (static) Sq3Lite OsInit C-API
Initialize The SQLite Library …
 
static OT_ProcRet tclsq3lite_Sq3Lite_Shutdown (OtClass_ARGS)
  Tcl: (static) Sq3Lite Shutdown C-API
Initialize The SQLite Library …
 

Detailed Description

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:

#define SQLITE_API
SQLITE_API int sqlite3_os_end(void)
SQLITE_API int sqlite3_initialize(void)
SQLITE_API int sqlite3_os_init(void)
SQLITE_API int sqlite3_shutdown(void)

Function Documentation

◆ tclsq3lite_Sq3Lite_Initialize()

static OT_ProcRet tclsq3lite_Sq3Lite_Initialize ( OtClass_ARGS )
static

Tcl: (static) Sq3Lite Initialize C-API
Initialize The SQLite Library …

Definition at line 5073 of file LibSq3Lite_tcl.c.

5073 {
5079 goto end;
5080 error:
5082 end:
5084}
#define OT_SETUP_NOARG(d)
#define OT_retObj_SET_Error
#define OT_retObj_SET_None
#define OT_retObj_RETURN
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define Initialize_doc
#define OT_SETUP_hdl_static
static enum MkErrorE Sq3Initialize(void)
Initialize The SQLite Library …

◆ tclsq3lite_Sq3Lite_OsEnd()

static OT_ProcRet tclsq3lite_Sq3Lite_OsEnd ( OtClass_ARGS )
static

Tcl: (static) Sq3Lite OsEnd C-API
Initialize The SQLite Library …

Definition at line 5087 of file LibSq3Lite_tcl.c.

5087 {
5091 MkErrorC_Check(hdl,Sq3OsEnd ());
5093 goto end;
5094 error:
5096 end:
5098}
#define OsEnd_doc
static enum MkErrorE Sq3OsEnd(void)
Initialize The SQLite Library …

◆ tclsq3lite_Sq3Lite_OsInit()

static OT_ProcRet tclsq3lite_Sq3Lite_OsInit ( OtClass_ARGS )
static

Tcl: (static) Sq3Lite OsInit C-API
Initialize The SQLite Library …

Definition at line 5101 of file LibSq3Lite_tcl.c.

5101 {
5105 MkErrorC_Check(hdl,Sq3OsInit ());
5107 goto end;
5108 error:
5110 end:
5112}
#define OsInit_doc
static enum MkErrorE Sq3OsInit(void)
Initialize The SQLite Library …

◆ tclsq3lite_Sq3Lite_Shutdown()

static OT_ProcRet tclsq3lite_Sq3Lite_Shutdown ( OtClass_ARGS )
static

Tcl: (static) Sq3Lite Shutdown C-API
Initialize The SQLite Library …

Definition at line 5115 of file LibSq3Lite_tcl.c.

5115 {
5121 goto end;
5122 error:
5124 end:
5126}
#define Shutdown_doc
static enum MkErrorE Sq3Shutdown(void)
Initialize The SQLite Library …