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_C_API

NATIVE - Initialize The SQLite Library libsqlite3More...

+ Collaboration diagram for Sq3Lite_Setup_libsqlite3_C_API:

Functions

static enum MkErrorE Sq3Initialize (void)
 Initialize The SQLite Library …
 
static enum MkErrorE Sq3OsEnd (void)
 Initialize The SQLite Library …
 
static enum MkErrorE Sq3OsInit (void)
 Initialize The SQLite Library …
 
static enum MkErrorE Sq3Shutdown (void)
 Initialize The SQLite Library …
 

Sq3Lite - Sq3Lite_Setup_libsqlite3_C_API - function

enum MkErrorE Sq3InitializeP (void)
 Non-inline replacement for Sq3Initialize
 
enum MkErrorE Sq3OsEndP (void)
 Non-inline replacement for Sq3OsEnd
 
enum MkErrorE Sq3OsInitP (void)
 Non-inline replacement for Sq3OsInit
 
enum MkErrorE Sq3ShutdownP (void)
 Non-inline replacement for Sq3Shutdown
 

Sq3Lite - Sq3Lite_Setup_libsqlite3_C_API - overload

#define Sq3Initialize_E(...)
 
#define Sq3Initialize_C(...)
 
#define Sq3OsEnd_E(...)
 
#define Sq3OsEnd_C(...)
 
#define Sq3OsInit_E(...)
 
#define Sq3OsInit_C(...)
 
#define Sq3Shutdown_E(...)
 
#define Sq3Shutdown_C(...)
 

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)

Macro Definition Documentation

◆ Sq3Initialize_C

#define Sq3Initialize_C ( ...)
Value:
if (MkErrorCheckI(Sq3Initialize(__VA_ARGS__)))
static enum MkErrorE Sq3Initialize(void)
Initialize The SQLite Library …

Definition at line 292 of file sqlite3_overload_sq3.h.

◆ Sq3Initialize_E

#define Sq3Initialize_E ( ...)
Value:
MkErrorCheck(Sq3Initialize(__VA_ARGS__))

Definition at line 291 of file sqlite3_overload_sq3.h.

◆ Sq3OsEnd_C

#define Sq3OsEnd_C ( ...)
Value:
if (MkErrorCheckI(Sq3OsEnd(__VA_ARGS__)))
static enum MkErrorE Sq3OsEnd(void)
Initialize The SQLite Library …

Definition at line 294 of file sqlite3_overload_sq3.h.

◆ Sq3OsEnd_E

#define Sq3OsEnd_E ( ...)
Value:
MkErrorCheck(Sq3OsEnd(__VA_ARGS__))

Definition at line 293 of file sqlite3_overload_sq3.h.

◆ Sq3OsInit_C

#define Sq3OsInit_C ( ...)
Value:
if (MkErrorCheckI(Sq3OsInit(__VA_ARGS__)))
static enum MkErrorE Sq3OsInit(void)
Initialize The SQLite Library …

Definition at line 296 of file sqlite3_overload_sq3.h.

◆ Sq3OsInit_E

#define Sq3OsInit_E ( ...)
Value:
MkErrorCheck(Sq3OsInit(__VA_ARGS__))

Definition at line 295 of file sqlite3_overload_sq3.h.

◆ Sq3Shutdown_C

#define Sq3Shutdown_C ( ...)
Value:
if (MkErrorCheckI(Sq3Shutdown(__VA_ARGS__)))
static enum MkErrorE Sq3Shutdown(void)
Initialize The SQLite Library …

Definition at line 298 of file sqlite3_overload_sq3.h.

◆ Sq3Shutdown_E

#define Sq3Shutdown_E ( ...)
Value:
MkErrorCheck(Sq3Shutdown(__VA_ARGS__))

Definition at line 297 of file sqlite3_overload_sq3.h.

Function Documentation

◆ Sq3Initialize()

static enum MkErrorE Sq3Initialize ( void )
inlinestatic

Initialize The SQLite Library …

read more at 'Sq3Lite_Setup_libsqlite3_C_API'

Definition at line 849 of file LibSq3Lite_sq3.h.

849 {
850 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_initialize();
852 return MK_OK;
853 error:
854 return MK_ERROR;
855 }
MK_ERROR
MK_OK
Sq3ErrorE
Result Codes.
#define Sq3ErrorE_Check_Package(PROC)
+ Here is the caller graph for this function:

◆ Sq3InitializeP()

enum MkErrorE Sq3InitializeP ( void )

Non-inline replacement for Sq3Initialize

◆ Sq3OsEnd()

static enum MkErrorE Sq3OsEnd ( void )
inlinestatic

Initialize The SQLite Library …

read more at 'Sq3Lite_Setup_libsqlite3_C_API'

Definition at line 858 of file LibSq3Lite_sq3.h.

858 {
859 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_os_end();
861 return MK_OK;
862 error:
863 return MK_ERROR;
864 }
+ Here is the caller graph for this function:

◆ Sq3OsEndP()

enum MkErrorE Sq3OsEndP ( void )

Non-inline replacement for Sq3OsEnd

◆ Sq3OsInit()

static enum MkErrorE Sq3OsInit ( void )
inlinestatic

Initialize The SQLite Library …

read more at 'Sq3Lite_Setup_libsqlite3_C_API'

Definition at line 867 of file LibSq3Lite_sq3.h.

867 {
868 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_os_init();
870 return MK_OK;
871 error:
872 return MK_ERROR;
873 }
+ Here is the caller graph for this function:

◆ Sq3OsInitP()

enum MkErrorE Sq3OsInitP ( void )

Non-inline replacement for Sq3OsInit

◆ Sq3Shutdown()

static enum MkErrorE Sq3Shutdown ( void )
inlinestatic

Initialize The SQLite Library …

read more at 'Sq3Lite_Setup_libsqlite3_C_API'

Definition at line 876 of file LibSq3Lite_sq3.h.

876 {
877 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_shutdown();
879 return MK_OK;
880 error:
881 return MK_ERROR;
882 }
+ Here is the caller graph for this function:

◆ Sq3ShutdownP()

enum MkErrorE Sq3ShutdownP ( void )

Non-inline replacement for Sq3Shutdown