{ +-------------------------------------------------------------+ }
{ |                                                             | }
{ |   GM-Software                                               | }
{ |   ===========                                               | }
{ |                                                             | }
{ |   Project: All Projects                                     | }
{ |                                                             | }
{ |   Description: SQLite3 call level API.                      | }
{ |                                                             | }
{ |                                                             | }
{ |   Copyright (C) - 2021 - Gerrit Moeller.                    | }
{ |                                                             | }
{ |   Source code dstributed under MIT license.                 | }
{ |                                                             | }
{ |   See: https://www.gm-software.de                           | }
{ |                                                             | }
{ +-------------------------------------------------------------+ }

{
  Automatically converted by GMh2Pas 1.0.0 from sqlite3.i
  The following command line parameters were used:

    "GMh2pas.exe" -T -S -p -w -d -u GMSqlite3Api sqlite3.i

  Montag, 28. Juni 2021 20:01:46
}

{$DEFINE DELAY_LOAD_SQLITE3_DLL}

{$IFDEF DELAY_LOAD_WIN_DLLs}
  {$DEFINE DELAY_LOAD_SQLITE3_DLL}
{$ENDIF DELAY_LOAD_WIN_DLLs}

{$INCLUDE GMCompilerSettings.inc}

{$IFDEF FPC}
{$PACKRECORDS C}
{$ENDIF}

unit GMSQLite3Api;

interface

uses SysUtils;

const
{$IFDEF MSWINDOWS}
  {$IFDEF CPU64}
   cStrSqlite3RuntimeLibName = 'sqlite3_64.dll';
  {$ELSE}
   cStrSqlite3RuntimeLibName = 'sqlite3_32.dll';
  {$ENDIF}
{$ENDIF}
{$IFDEF UNIX}
  cStrSqlite3RuntimeLibName = 'sqlite3.so';
{$ENDIF}
{$IFDEF DARWIN}
  cStrSqlite3RuntimeLibName = 'libsqlite3.dylib';
{$ENDIF}

  SQLITE_VERSION        = '3.37.2';
  SQLITE_VERSION_NUMBER = 3037002;
  SQLITE_SOURCE_ID      = '2022-01-06 13:25:41 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5d17a0';


{ ------------------------- }
{ ----  Pointer types  ---- }
{ ------------------------- }

const

  SQLITE_OK = 0;	// Successful result
  // beginning-of-error-codes
  SQLITE_ERROR = 1;	// Generic error
  SQLITE_INTERNAL = 2;	// Internal logic error in SQLite
  SQLITE_PERM = 3;	// Access permission denied
  SQLITE_ABORT = 4;	// Callback routine requested an abort
  SQLITE_BUSY = 5;	// The database file is locked
  SQLITE_LOCKED = 6;	// A table in the database is locked
  SQLITE_NOMEM = 7;	// A malloc() failed
  SQLITE_READONLY = 8;	// Attempt to write a readonly database
  SQLITE_INTERRUPT = 9;	// Operation terminated by sqlite3_interrupt()
  SQLITE_IOERR = 10;	// Some kind of disk I/O error occurred
  SQLITE_CORRUPT = 11;	// The database disk image is malformed
  SQLITE_NOTFOUND = 12;	// Unknown opcode in sqlite3_file_control()
  SQLITE_FULL = 13;	// Insertion failed because database is full
  SQLITE_CANTOPEN = 14;	// Unable to open the database file
  SQLITE_PROTOCOL = 15;	// Database lock protocol error
  SQLITE_EMPTY = 16;	// Internal use only
  SQLITE_SCHEMA = 17;	// The database schema changed
  SQLITE_TOOBIG = 18;	// String or BLOB exceeds size limit
  SQLITE_CONSTRAINT = 19; // Abort due to constraint violation
  SQLITE_MISMATCH = 20;	// Data type mismatch
  SQLITE_MISUSE = 21;	// Library used incorrectly
  SQLITE_NOLFS = 22;	// Uses OS features not supported on host
  SQLITE_AUTH = 23;	// Authorization denied
  SQLITE_FORMAT = 24;	// Not used
  SQLITE_RANGE = 25;	// 2nd parameter to sqlite3_bind out of range
  SQLITE_NOTADB = 26;	// File opened that is not a database file
  SQLITE_NOTICE = 27;	// Notifications from sqlite3_log()
  SQLITE_WARNING = 28;	// Warnings from sqlite3_log()
  SQLITE_ROW = 100;	// sqlite3_step() has another row ready
  SQLITE_DONE = 101;	// sqlite3_step() has finished executing


const

  SQLITE_IOERR_READ              = SQLITE_IOERR or (1 shl 8);
  SQLITE_IOERR_SHORT_READ        = SQLITE_IOERR or (2 shl 8);
  SQLITE_IOERR_WRITE             = SQLITE_IOERR or (3 shl 8);
  SQLITE_IOERR_FSYNC             = SQLITE_IOERR or (4 shl 8);
  SQLITE_IOERR_DIR_FSYNC         = SQLITE_IOERR or (5 shl 8);
  SQLITE_IOERR_TRUNCATE          = SQLITE_IOERR or (6 shl 8);
  SQLITE_IOERR_FSTAT             = SQLITE_IOERR or (7 shl 8);
  SQLITE_IOERR_UNLOCK            = SQLITE_IOERR or (8 shl 8);
  SQLITE_IOERR_RDLOCK            = SQLITE_IOERR or (9 shl 8);
  SQLITE_IOERR_DELETE            = SQLITE_IOERR or (10 shl 8);
  SQLITE_IOERR_BLOCKED           = SQLITE_IOERR or (11 shl 8);
  SQLITE_IOERR_NOMEM             = SQLITE_IOERR or (12 shl 8);
  SQLITE_IOERR_ACCESS            = SQLITE_IOERR or (13 shl 8);
  SQLITE_IOERR_CHECKRESERVEDLOCK = SQLITE_IOERR or (14 shl 8);
  SQLITE_IOERR_LOCK              = SQLITE_IOERR or (15 shl 8);
  SQLITE_IOERR_CLOSE             = SQLITE_IOERR or (16 shl 8);
  SQLITE_IOERR_DIR_CLOSE         = SQLITE_IOERR or (17 shl 8);
  SQLITE_IOERR_SHMOPEN           = (SQLITE_IOERR or (18 shl 8));
  SQLITE_IOERR_SHMSIZE           = (SQLITE_IOERR or (19 shl 8));
  SQLITE_IOERR_SHMLOCK           = (SQLITE_IOERR or (20 shl 8));
  SQLITE_IOERR_SHMMAP            = (SQLITE_IOERR or (21 shl 8));
  SQLITE_IOERR_SEEK              = (SQLITE_IOERR or (22 shl 8));
  SQLITE_IOERR_DELETE_NOENT      = (SQLITE_IOERR or (23 shl 8));
  SQLITE_IOERR_MMAP              = (SQLITE_IOERR or (24 shl 8));
  SQLITE_IOERR_GETTEMPPATH       = (SQLITE_IOERR or (25 shl 8));
  SQLITE_IOERR_CONVPATH          = (SQLITE_IOERR or (26 shl 8));
  SQLITE_IOERR_VNODE             = (SQLITE_IOERR or (27 shl 8));
  SQLITE_IOERR_AUTH              = (SQLITE_IOERR or (28 shl 8));
  SQLITE_IOERR_BEGIN_ATOMIC      = (SQLITE_IOERR or (29 shl 8));
  SQLITE_IOERR_COMMIT_ATOMIC     = (SQLITE_IOERR or (30 shl 8));
  SQLITE_IOERR_ROLLBACK_ATOMIC   = (SQLITE_IOERR or (31 shl 8));
  SQLITE_IOERR_DATA              = (SQLITE_IOERR or (32 shl 8));
  SQLITE_IOERR_CORRUPTFS         = (SQLITE_IOERR or (33 shl 8));
  SQLITE_LOCKED_SHAREDCACHE      = SQLITE_LOCKED or (1 shl 8);
  SQLITE_LOCKED_VTAB             = (SQLITE_LOCKED or  (2 shl 8));
  SQLITE_BUSY_RECOVERY           = (SQLITE_BUSY   or  (1 shl 8));
  SQLITE_BUSY_SNAPSHOT           = (SQLITE_BUSY   or  (2 shl 8));
  SQLITE_BUSY_TIMEOUT            = (SQLITE_BUSY   or  (3 shl 8));
  SQLITE_CANTOPEN_NOTEMPDIR      = (SQLITE_CANTOPEN or (1 shl 8));
  SQLITE_CANTOPEN_ISDIR          = (SQLITE_CANTOPEN or (2 shl 8));
  SQLITE_CANTOPEN_FULLPATH       = (SQLITE_CANTOPEN or (3 shl 8));
  SQLITE_CANTOPEN_CONVPATH       = (SQLITE_CANTOPEN or (4 shl 8));
  SQLITE_CANTOPEN_DIRTYWAL       = (SQLITE_CANTOPEN or (5 shl 8)); // Not Used
  SQLITE_CANTOPEN_SYMLINK        = (SQLITE_CANTOPEN or (6 shl 8));
  SQLITE_CORRUPT_VTAB            = (SQLITE_CORRUPT or (1 shl 8));
  SQLITE_CORRUPT_SEQUENCE        = (SQLITE_CORRUPT or (2 shl 8));
  SQLITE_CORRUPT_INDEX           = (SQLITE_CORRUPT or (3 shl 8));
  SQLITE_READONLY_RECOVERY       = (SQLITE_READONLY or (1 shl 8));
  SQLITE_READONLY_CANTLOCK       = (SQLITE_READONLY or (2 shl 8));
  SQLITE_READONLY_ROLLBACK       = (SQLITE_READONLY or (3 shl 8));
  SQLITE_READONLY_DBMOVED        = (SQLITE_READONLY or (4 shl 8));
  SQLITE_READONLY_CANTINIT       = (SQLITE_READONLY or (5 shl 8));
  SQLITE_READONLY_DIRECTORY      = (SQLITE_READONLY or (6 shl 8));
  SQLITE_ABORT_ROLLBACK          = (SQLITE_ABORT or (2 shl 8));
  SQLITE_CONSTRAINT_CHECK        = (SQLITE_CONSTRAINT or (1 shl 8));
  SQLITE_CONSTRAINT_COMMITHOOK   = (SQLITE_CONSTRAINT or (2 shl 8));
  SQLITE_CONSTRAINT_FOREIGNKEY   = (SQLITE_CONSTRAINT or (3 shl 8));
  SQLITE_CONSTRAINT_FUNCTION     = (SQLITE_CONSTRAINT or (4 shl 8));
  SQLITE_CONSTRAINT_NOTNULL      = (SQLITE_CONSTRAINT or (5 shl 8));
  SQLITE_CONSTRAINT_PRIMARYKEY   = (SQLITE_CONSTRAINT or (6 shl 8));
  SQLITE_CONSTRAINT_TRIGGER      = (SQLITE_CONSTRAINT or (7 shl 8));
  SQLITE_CONSTRAINT_UNIQUE       = (SQLITE_CONSTRAINT or (8 shl 8));
  SQLITE_CONSTRAINT_VTAB         = (SQLITE_CONSTRAINT or (9 shl 8));
  SQLITE_CONSTRAINT_ROWID        = (SQLITE_CONSTRAINT or (10 shl 8));
  SQLITE_CONSTRAINT_PINNED       = (SQLITE_CONSTRAINT or (11 shl 8));
  SQLITE_CONSTRAINT_DATATYPE     = (SQLITE_CONSTRAINT or (12 shl 8));
  SQLITE_NOTICE_RECOVER_WAL      = (SQLITE_NOTICE or (1 shl 8));
  SQLITE_NOTICE_RECOVER_ROLLBACK = (SQLITE_NOTICE or (2 shl 8));
  SQLITE_WARNING_AUTOINDEX       = (SQLITE_WARNING or (1 shl 8));
  SQLITE_AUTH_USER               = (SQLITE_AUTH or (1 shl 8));
  SQLITE_OK_LOAD_PERMANENTLY     = (SQLITE_OK or (1 shl 8));
  SQLITE_OK_SYMLINK              = (SQLITE_OK or (2 shl 8));


const

  SQLITE_OPEN_READONLY         = $00000001; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_READWRITE        = $00000002; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_CREATE           = $00000004; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_DELETEONCLOSE    = $00000008; // VFS only
  SQLITE_OPEN_EXCLUSIVE        = $00000010; // VFS only
  SQLITE_OPEN_AUTOPROXY        = $00000020; // VFS only
  SQLITE_OPEN_URI              = $00000040; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_MEMORY           = $00000080; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_MAIN_DB          = $00000100; // VFS only
  SQLITE_OPEN_TEMP_DB          = $00000200; // VFS only
  SQLITE_OPEN_TRANSIENT_DB     = $00000400; // VFS only
  SQLITE_OPEN_MAIN_JOURNAL     = $00000800; // VFS only
  SQLITE_OPEN_TEMP_JOURNAL     = $00001000; // VFS only
  SQLITE_OPEN_SUBJOURNAL       = $00002000; // VFS only
  SQLITE_OPEN_SUPER_JOURNAL    = $00004000; // VFS only
  SQLITE_OPEN_NOMUTEX          = $00008000; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_FULLMUTEX        = $00010000; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_SHAREDCACHE      = $00020000; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_PRIVATECACHE     = $00040000; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_WAL              = $00080000; // VFS only
  SQLITE_OPEN_NOFOLLOW         = $01000000; // Ok for sqlite3_open_v2()
  SQLITE_OPEN_EXRESCODE        = $02000000; // Extended result codes


const

  SQLITE_IOCAP_ATOMIC      = $00000001;
  SQLITE_IOCAP_ATOMIC512   = $00000002;
  SQLITE_IOCAP_ATOMIC1K    = $00000004;
  SQLITE_IOCAP_ATOMIC2K    = $00000008;
  SQLITE_IOCAP_ATOMIC4K    = $00000010;
  SQLITE_IOCAP_ATOMIC8K    = $00000020;
  SQLITE_IOCAP_ATOMIC16K   = $00000040;
  SQLITE_IOCAP_ATOMIC32K   = $00000080;
  SQLITE_IOCAP_ATOMIC64K   = $00000100;
  SQLITE_IOCAP_SAFE_APPEND = $00000200;
  SQLITE_IOCAP_SEQUENTIAL  = $00000400;
  SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = $00000800;
  SQLITE_IOCAP_POWERSAFE_OVERWRITE   = $00001000;
  SQLITE_IOCAP_IMMUTABLE             = $00002000;
  SQLITE_IOCAP_BATCH_ATOMIC          = $00004000;



const

  SQLITE_LOCK_NONE      = 0;
  SQLITE_LOCK_SHARED    = 1;
  SQLITE_LOCK_RESERVED  = 2;
  SQLITE_LOCK_PENDING   = 3;
  SQLITE_LOCK_EXCLUSIVE = 4;


const

  SQLITE_SYNC_NORMAL   = $00002;
  SQLITE_SYNC_FULL     = $00003;
  SQLITE_SYNC_DATAONLY = $00010;


type

  TSQLite3Int = LongInt;

  Tsqlite3Ptr = Pointer;

  // Pointer types to opaque records/objects/data
  Psqlite3  = type Tsqlite3Ptr;
  Psqlite3_backup  = type Tsqlite3Ptr;
  Psqlite3_blob  = type Tsqlite3Ptr;
  Psqlite3_context  = type Tsqlite3Ptr;
  PFts5Context  = type Tsqlite3Ptr;
  Psqlite3_mutex  = type Tsqlite3Ptr;
  Psqlite3_pcache  = type Tsqlite3Ptr;
  Psqlite3_stmt  = type Tsqlite3Ptr;
  Psqlite3_str  = type Tsqlite3Ptr;
  Psqlite3_value  = type Tsqlite3Ptr;
  PPsqlite3_value  = ^Psqlite3_value;

  Psqlite_int64 = ^Tsqlite_int64;
  Tsqlite_int64 = Int64;

  Psqlite_uint64 = ^Tsqlite_uint64;
  Tsqlite_uint64 = QWord;

  Psqlite3_int64 = ^Tsqlite3_int64;
  Tsqlite3_int64 = Tsqlite_int64;

  Psqlite3_uint64 = ^Tsqlite3_uint64;
  Tsqlite3_uint64 = Tsqlite_uint64;


{ ------------------------------------ }
{ ----  function/procedure types  ---- }
{ ------------------------------------ }

  TSQLite3_one_ptr_arg_proc = procedure (param1: Pointer); cdecl;
  TSQLite3_one_ptr_arg_func = function (param1: Pointer): LongInt; cdecl;
  TSQLite3ContextProc = procedure (param1: Psqlite3_context); cdecl;
  TSQLite3MutexProc = procedure (param1: Psqlite3_mutex); cdecl;
  TSQLite3ContextValueProc = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  TSQLiteCompareFunc = function (param1: Pointer; param2: LongInt; param3: Pointer; param4: LongInt; param5: Pointer): LongInt; cdecl;


  T_0168B598_ = function (param1: Pointer; param2: LongInt; param3: PPAnsiChar; param4: PPAnsiChar): LongInt; cdecl;
  T_0168B8F8_Callback = function (param1: Pointer; param2: LongInt; param3: PPAnsiChar; param4: PPAnsiChar): LongInt; cdecl;
  //T_016D20C0_xMalloc = function (param1: LongInt): Pointer; cdecl;
  //T_016D1DF0_xFree = procedure (param1: Pointer); cdecl;
  //T_016D1070_xRealloc = function (param1: Pointer; param2: LongInt): Pointer; cdecl;
  //T_016D0E30_xSize = function (param1: Pointer): LongInt; cdecl;
  //T_016D09B0_xRoundup = function (param1: LongInt): LongInt; cdecl;
  //T_0168CEE8_xInit = function (param1: Pointer): LongInt; cdecl;
  //T_0168C558_xShutdown = procedure (param1: Pointer); cdecl;
  T_0168B988_Param2 = function (param1: Pointer; param2: LongInt): LongInt; cdecl;
  T_0168C828_XAuth = function (param1: Pointer; param2: LongInt; param3: PAnsiChar; param4: PAnsiChar; param5: PAnsiChar;
                               param6: PAnsiChar): LongInt; cdecl;
  T_016D0A40_XTrace = procedure (param1: Pointer; param2: PAnsiChar); cdecl;
  T_0168C318_XProfile = procedure (param1: Pointer; param2: PAnsiChar; param3: Tsqlite3_uint64); cdecl;
  T_0168CF78_XCallback = function (param1: DWord; param2: Pointer; param3: Pointer; param4: Pointer): LongInt; cdecl;
  //T_0168C318_Param3 = function (param1: Pointer): LongInt; cdecl;
  //T_0168BA18_Param5 = procedure (param1: Pointer); cdecl;
  //T_0168BD78_Param5 = procedure (param1: Pointer); cdecl;
  //T_016D2150_Param5 = procedure (param1: Pointer); cdecl;
  //T_0168CD38_Param5 = procedure (param1: Pointer); cdecl;
  //T_0168BB38_Param5 = procedure (param1: Pointer); cdecl;
  //T_0168B598_Param5 = procedure (param1: Pointer); cdecl;
  //T_0168B2C8_XFunc = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  //T_016D0AD0_XStep = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  //T_016D1610_XFinal = procedure (param1: Psqlite3_context); cdecl;
  //T_016D0FE0_XFunc = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  //T_016D0B60_XStep = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  //T_0168BCE8_XFinal = procedure (param1: Psqlite3_context); cdecl;
  //T_0168BC58_XFunc = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  //T_0168C948_XStep = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  //T_016D1850_XFinal = procedure (param1: Psqlite3_context); cdecl;
  //T_016D1B20_XDestroy = procedure (param1: Pointer); cdecl;
  //T_016D1610_XStep = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  //T_016D0EC0_XFinal = procedure (param1: Psqlite3_context); cdecl;
  //T_016D18E0_XValue = procedure (param1: Psqlite3_context); cdecl;
  //T_0168C5E8_XInverse = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  //T_0168D008_XDestroy = procedure (param1: Pointer); cdecl;
  T_0168D488_Param1 = procedure (param1: Pointer; param2: Tsqlite3_int64; param3: LongInt); cdecl;
  //T_0168AFF8_Param4 = procedure (param1: Pointer); cdecl;
  //T_0168D758_ = procedure (param1: Pointer); cdecl;
  //T_016D1D60_Param4 = procedure (param1: Pointer); cdecl;
  //T_0168C168_Param4 = procedure (param1: Pointer); cdecl;
  //T_0168BD78_Param4 = procedure (param1: Pointer); cdecl;
  //T_0168BE08_Param4 = procedure (param1: Pointer); cdecl;
  //T_0168B3E8_Param4 = procedure (param1: Pointer); cdecl;
  //T_016D2030_Param4 = procedure (param1: Pointer); cdecl;
  //T_0168CD38_Param4 = procedure (param1: Pointer); cdecl;
  //T_0168BD78_XCompare = function (param1: Pointer; param2: LongInt; param3: Pointer; param4: LongInt; param5: Pointer): LongInt; cdecl;
  //T_0168BB38_XCompare = function (param1: Pointer; param2: LongInt; param3: Pointer; param4: LongInt; param5: Pointer): LongInt; cdecl;
  //T_016D0A40_XDestroy = procedure (param1: Pointer); cdecl;
  T_0168C1F8_Param3 = procedure (param1: Pointer; param2: Psqlite3; eTextRep: LongInt; param4: PAnsiChar); cdecl;
  T_0168D3F8_Param3 = procedure (param1: Pointer; param2: Psqlite3; eTextRep: LongInt; param4: Pointer); cdecl;
  //T_0168C558_Param2 = function (param1: Pointer): LongInt; cdecl;
  //T_0168D3F8_Param2 = procedure (param1: Pointer); cdecl;
  T_0168C798_Param2 = procedure (param1: Pointer; param2: LongInt; param3: PAnsiChar; param4: PAnsiChar; param5: Tsqlite3_int64); cdecl;
  T_0168CF78_XEntryPoint = procedure ; cdecl;
  //T_0171CDC8_xShadowName = function (param1: PAnsiChar): LongInt; cdecl;
  //T_016CFDE0_XDestroy = procedure (param1: Pointer); cdecl;
  T_016CF840_xMutexInit = function: LongInt; cdecl;
  T_016CE6D0_xMutexEnd = function: LongInt; cdecl;
  T_016CFC30_xMutexAlloc = function (param1: LongInt): Psqlite3_mutex; cdecl;
  //T_0168CE58_xMutexFree = procedure (param1: Psqlite3_mutex); cdecl;
  //T_016CF9F0_xMutexEnter = procedure (param1: Psqlite3_mutex); cdecl;
  T_016D06E0_xMutexTry = function (param1: Psqlite3_mutex): LongInt; cdecl;
  //T_0171B088_xMutexLeave = procedure (param1: Psqlite3_mutex); cdecl;
  T_0171C0D8_xMutexHeld = function (param1: Psqlite3_mutex): LongInt; cdecl;
  T_0171C708_xMutexNotheld = function (param1: Psqlite3_mutex): LongInt; cdecl;
  //T_0171CEE8_xInit = function (param1: Pointer): LongInt; cdecl;
  //T_0171C0D8_xShutdown = procedure (param1: Pointer); cdecl;
  T_0171BCE8_xCreate = function (szPage: LongInt; szExtra: LongInt; bPurgeable: LongInt): Psqlite3_pcache; cdecl;
  T_016CF9F0_xCachesize = procedure (param1: Psqlite3_pcache; nCachesize: LongInt); cdecl;
  T_016CFF90_xPagecount = function (param1: Psqlite3_pcache): LongInt; cdecl;
  T_016CF600_xTruncate = procedure (param1: Psqlite3_pcache; iLimit: DWord); cdecl;
  T_016CD950_xDestroy = procedure (param1: Psqlite3_pcache); cdecl;
  T_016CCCF0_xShrink = procedure (param1: Psqlite3_pcache); cdecl;
  //T_016CC510_xInit = function (param1: Pointer): LongInt; cdecl;
  //T_016CC2D0_xShutdown = procedure (param1: Pointer); cdecl;
  T_016CD200_xCreate = function (szPage: LongInt; bPurgeable: LongInt): Psqlite3_pcache; cdecl;
  T_016CE1C0_xCachesize = procedure (param1: Psqlite3_pcache; nCachesize: LongInt); cdecl;
  T_016CEAC0_xPagecount = function (param1: Psqlite3_pcache): LongInt; cdecl;
  T_0171D7E8_xFetch = function (param1: Psqlite3_pcache; key: DWord; createFlag: LongInt): Pointer; cdecl;
  T_0171D518_xUnpin = procedure (param1: Psqlite3_pcache; param2: Pointer; discard: LongInt); cdecl;
  T_016CEEB0_xRekey = procedure (param1: Psqlite3_pcache; param2: Pointer; oldKey: DWord; newKey: DWord); cdecl;
  T_016D29C0_xTruncate = procedure (param1: Psqlite3_pcache; iLimit: DWord); cdecl;
  T_0171B358_xDestroy = procedure (param1: Psqlite3_pcache); cdecl;
  T_016D06E0_XNotify = procedure (apArg: PPointer; nArg: LongInt); cdecl;
  T_016CAE90_Param2 = function (param1: Pointer; param2: Psqlite3; param3: PAnsiChar; param4: LongInt): LongInt; cdecl;
  //T_016D0530_xDelUser = procedure (param1: Pointer); cdecl;
  //T_016D0410_XDestructor = procedure (param1: Pointer); cdecl;
  //T_0171C798_xDelUser = procedure (param1: Pointer); cdecl;
  T_0171D5A8_xUserData = function (param1: PFts5Context): Pointer; cdecl;
  T_0171DC68_xColumnCount = function (param1: PFts5Context): LongInt; cdecl;
  T_0171D7E8_xRowCount = function (param1: PFts5Context; var pnRow: Tsqlite3_int64): LongInt; cdecl;
  T_016CE640_xColumnTotalSize = function (param1: PFts5Context; iCol: LongInt; var pnToken: Tsqlite3_int64): LongInt; cdecl;
  T_016CEEB0_XToken = function (param1: Pointer; param2: LongInt; param3: PAnsiChar; param4: LongInt; param5: LongInt;
                                      param6: LongInt): LongInt; cdecl;
  T_016D02F0_xTokenize = function (param1: PFts5Context; pText: PAnsiChar; nText: LongInt; pCtx: Pointer; xToken: T_016CEEB0_XToken): LongInt; cdecl;
  T_016CD830_xPhraseCount = function (param1: PFts5Context): LongInt; cdecl;
  T_016CDE60_xPhraseSize = function (param1: PFts5Context; iPhrase: LongInt): LongInt; cdecl;
  T_016CCF30_xInstCount = function (param1: PFts5Context; var pnInst: LongInt): LongInt; cdecl;
  T_0171C828_xInst = function (param1: PFts5Context; iIdx: LongInt; var piPhrase: LongInt; var piCol: LongInt; var piOff: LongInt): LongInt; cdecl;
  T_016CB670_xRowid = function (param1: PFts5Context): Tsqlite3_int64; cdecl;
  T_016CAC50_xColumnText = function (param1: PFts5Context; iCol: LongInt; pz: PPAnsiChar; var pn: LongInt): LongInt; cdecl;
  T_01691B68_xColumnSize = function (param1: PFts5Context; iCol: LongInt; var pnToken: LongInt): LongInt; cdecl;
  //T_0168F138_XDelete = procedure (param1: Pointer); cdecl;
  T_0168F648_xSetAuxdata = function (param1: PFts5Context; pAux: Pointer; xDelete: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;
  T_0168DE18_xGetAuxdata = function (param1: PFts5Context; bClear: LongInt): Pointer; cdecl;
  T_0168BC58_XToken = function (pCtx: Pointer; tflags: LongInt; pToken: PAnsiChar; nToken: LongInt; iStart: LongInt;
                                      iEnd: LongInt): LongInt; cdecl;
  //T_016D0AD0_XDestroy = procedure (param1: Pointer); cdecl;
  //T_0168B478_XDestroy = procedure (param1: Pointer); cdecl;


// error
//#line 1 "sqlite3.h"
// error
//#line 1 "sqlite3.h"
//in declaration at line 87

  Pva_list = ^Tva_list;
  Tva_list = record end; // Tgnuc_va_list;

// error
//#line 36 "sqlite3.h"
// error
//#line 36 "sqlite3.h"
//in declaration at line 309

function sqlite3_libversion: PAnsiChar; cdecl;

function sqlite3_sourceid: PAnsiChar; cdecl;

function sqlite3_libversion_number: LongInt; cdecl;

function sqlite3_compileoption_used(zOptName: PAnsiChar): LongInt; cdecl;

function sqlite3_compileoption_get(N: LongInt): PAnsiChar; cdecl;

function sqlite3_threadsafe: LongInt; cdecl;


function sqlite3_close(param1: Psqlite3): LongInt; cdecl;

function sqlite3_close_v2(param1: Psqlite3): LongInt; cdecl;


function sqlite3_exec(param1: Psqlite3; sql: PAnsiChar; callback: T_0168B8F8_Callback; param4: Pointer; errmsg: PPAnsiChar): LongInt; cdecl;


type

// error
//int //xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile*;
// in declarator_list
  Psqlite3_io_methods = ^Tsqlite3_io_methods;
  Psqlite3_vfs = ^Tsqlite3_vfs;

  Psqlite3_file = ^Tsqlite3_file;
  Tsqlite3_file = record
    pMethods: Psqlite3_io_methods;
  end;

  //T_0168CCA8_xClose = function (param1: Psqlite3_file): LongInt; cdecl;
  //T_0168C798_xRead = function (param1: Psqlite3_file; param2: Pointer; iAmt: LongInt; iOfst: Tsqlite3_int64): LongInt; cdecl;
  //T_0168BE98_xWrite = function (param1: Psqlite3_file; param2: Pointer; iAmt: LongInt; iOfst: Tsqlite3_int64): LongInt; cdecl;
  //T_0168DEA8_xTruncate = function (param1: Psqlite3_file; size: Tsqlite3_int64): LongInt; cdecl;
  //T_0168E838_xSync = function (param1: Psqlite3_file; flags: LongInt): LongInt; cdecl;
  //T_0168F1C8_xFileSize = function (param1: Psqlite3_file; var pSize: Tsqlite3_int64): LongInt; cdecl;
  //T_0168FBE8_xLock = function (param1: Psqlite3_file; param2: LongInt): LongInt; cdecl;
  //T_016904E8_xUnlock = function (param1: Psqlite3_file; param2: LongInt): LongInt; cdecl;
  //T_01690DE8_xCheckReservedLock = function (param1: Psqlite3_file; var pResOut: LongInt): LongInt; cdecl;
  //T_01691808_xFileControl = function (param1: Psqlite3_file; op: LongInt; pArg: Pointer): LongInt; cdecl;
  //T_016924F8_xSectorSize = function (param1: Psqlite3_file): LongInt; cdecl;
  //T_016CAE00_xDeviceCharacteristics = function (param1: Psqlite3_file): LongInt; cdecl;
  //T_016CC120_xShmLock = function (param1: Psqlite3_file; offset: LongInt; n: LongInt; flags: LongInt): LongInt; cdecl;
  //T_016CD050_xShmBarrier = procedure (param1: Psqlite3_file); cdecl;
  //T_016CD710_xShmUnmap = function (param1: Psqlite3_file; deleteFlag: LongInt): LongInt; cdecl;
  //T_016CE0A0_xFetch = function (param1: Psqlite3_file; iOfst: Tsqlite3_int64; iAmt: LongInt; pp: PPointer): LongInt; cdecl;
  //T_016CF0F0_xUnfetch = function (param1: Psqlite3_file; iOfst: Tsqlite3_int64; p: Pointer): LongInt; cdecl;
  //T_016CF570_xOpen = function (param1: Psqlite3_vfs; zName: PAnsiChar; param3: Psqlite3_file; flags: LongInt; var pOutFlags: LongInt): LongInt; cdecl;

  Tsqlite3_io_methods = record
      iVersion: LongInt;
      xClose: function (param1: Psqlite3_file): LongInt; cdecl; // T_0168CCA8_xClose;
      xRead: function (param1: Psqlite3_file; param2: Pointer; iAmt: LongInt; iOfst: Tsqlite3_int64): LongInt; cdecl; // T_0168C798_xRead;
      xWrite: function (param1: Psqlite3_file; param2: Pointer; iAmt: LongInt; iOfst: Tsqlite3_int64): LongInt; cdecl; // T_0168BE98_xWrite;
      xTruncate: function (param1: Psqlite3_file; size: Tsqlite3_int64): LongInt; cdecl; // T_0168DEA8_xTruncate;
      xSync: function (param1: Psqlite3_file; flags: LongInt): LongInt; cdecl; // T_0168E838_xSync;
      xFileSize: function (param1: Psqlite3_file; var pSize: Tsqlite3_int64): LongInt; cdecl; // T_0168F1C8_xFileSize;
      xLock: function (param1: Psqlite3_file; param2: LongInt): LongInt; cdecl; // T_0168FBE8_xLock;
      xUnlock: function (param1: Psqlite3_file; param2: LongInt): LongInt; cdecl; // T_016904E8_xUnlock;
      xCheckReservedLock: function (param1: Psqlite3_file; var pResOut: LongInt): LongInt; cdecl; // T_01690DE8_xCheckReservedLock;
      xFileControl: function (param1: Psqlite3_file; op: LongInt; pArg: Pointer): LongInt; cdecl; // T_01691808_xFileControl;
      xSectorSize: function (param1: Psqlite3_file): LongInt; cdecl;// T_016924F8_xSectorSize;
      xDeviceCharacteristics: function (param1: Psqlite3_file): LongInt; cdecl; // T_016CAE00_xDeviceCharacteristics;
      // Methods above are valid for version 1
      xShmLock: function (param1: Psqlite3_file; offset: LongInt; n: LongInt; flags: LongInt): LongInt; cdecl; // T_016CC120_xShmLock;
      xShmBarrier: procedure (param1: Psqlite3_file); cdecl; // T_016CD050_xShmBarrier;
      xShmUnmap: function (param1: Psqlite3_file; deleteFlag: LongInt): LongInt; cdecl; // T_016CD710_xShmUnmap;
      // Methods above are valid for version 2
      xFetch: function (param1: Psqlite3_file; iOfst: Tsqlite3_int64; iAmt: LongInt; pp: PPointer): LongInt; cdecl; // T_016CE0A0_xFetch;
      xUnfetch: function (param1: Psqlite3_file; iOfst: Tsqlite3_int64; p: Pointer): LongInt; cdecl; // T_016CF0F0_xUnfetch;
      // Methods above are valid for version 3
    end;


  //T_0168C3A8_xSetSystemCall = function (param1: Psqlite3_vfs; zName: PAnsiChar; param3: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;
  //T_0168D128_xGetSystemCall = function (param1: Psqlite3_vfs; zName: PAnsiChar): TSQLite3_one_ptr_arg_proc; cdecl;


  //T_016CD8C0_xDelete = function (param1: Psqlite3_vfs; zName: PAnsiChar; syncDir: LongInt): LongInt; cdecl;
  //T_016CD440_xAccess = function (param1: Psqlite3_vfs; zName: PAnsiChar; flags: LongInt; var pResOut: LongInt): LongInt; cdecl;
  //T_016CC5A0_xFullPathname = function (param1: Psqlite3_vfs; zName: PAnsiChar; nOut: LongInt; zOut: PAnsiChar): LongInt; cdecl;
  //T_01692858_xDlOpen = function (param1: Psqlite3_vfs; zFilename: PAnsiChar): Pointer; cdecl;
  //T_01691EC8_xDlError = procedure (param1: Psqlite3_vfs; nByte: LongInt; zErrMsg: PAnsiChar); cdecl;
  T_01690578_ = procedure ; cdecl;
  //T_016910B8_xDlSym = function (param1: Psqlite3_vfs; param2: Pointer; zSymbol: PAnsiChar): T_01690578_; cdecl;
  //T_0168FAC8_xDlClose = procedure (param1: Psqlite3_vfs; param2: Pointer); cdecl;
  //T_0168F1C8_xRandomness = function (param1: Psqlite3_vfs; nByte: LongInt; zOut: PAnsiChar): LongInt; cdecl;
  //T_0168EC28_xSleep = function (param1: Psqlite3_vfs; microseconds: LongInt): LongInt; cdecl;
  //T_0168E058_xCurrentTime = function (param1: Psqlite3_vfs; param2: Pdouble): LongInt; cdecl;
  //T_0168D908_xGetLastError = function (param1: Psqlite3_vfs; param2: LongInt; param3: PAnsiChar): LongInt; cdecl;
  //T_0168B8F8_xCurrentTimeInt64 = function (param1: Psqlite3_vfs; param2: Psqlite3_int64): LongInt; cdecl;
  //T_016D1100_xNextSystemCall = function (param1: Psqlite3_vfs; zName: PAnsiChar): PAnsiChar; cdecl;


  Tsqlite3_vfs = record
      iVersion: LongInt;
      szOsFile: LongInt;
      mxPathname: LongInt;
      pNext: Psqlite3_vfs;
      zName: PAnsiChar;
      pAppData: Pointer;
      xOpen: function (param1: Psqlite3_vfs; zName: PAnsiChar; param3: Psqlite3_file; flags: LongInt; var pOutFlags: LongInt): LongInt; cdecl; // T_016CF570_xOpen
      xDelete: function (param1: Psqlite3_vfs; zName: PAnsiChar; syncDir: LongInt): LongInt; cdecl; // T_016CD8C0_xDelete;
      xAccess: function (param1: Psqlite3_vfs; zName: PAnsiChar; flags: LongInt; var pResOut: LongInt): LongInt; cdecl; // T_016CD440_xAccess;
      xFullPathname: function (param1: Psqlite3_vfs; zName: PAnsiChar; nOut: LongInt; zOut: PAnsiChar): LongInt; cdecl; // T_016CC5A0_xFullPathname;
      xDlOpen: function (param1: Psqlite3_vfs; zFilename: PAnsiChar): Pointer; cdecl; // T_01692858_xDlOpen;
      xDlError: procedure (param1: Psqlite3_vfs; nByte: LongInt; zErrMsg: PAnsiChar); cdecl; // T_01691EC8_xDlError;
      xDlSym: function (param1: Psqlite3_vfs; param2: Pointer; zSymbol: PAnsiChar): T_01690578_; cdecl; // T_016910B8_xDlSym;
      xDlClose: procedure (param1: Psqlite3_vfs; param2: Pointer); cdecl; // T_0168FAC8_xDlClose;
      xRandomness: function (param1: Psqlite3_vfs; nByte: LongInt; zOut: PAnsiChar): LongInt; cdecl; // T_0168F1C8_xRandomness;
      xSleep: function (param1: Psqlite3_vfs; microseconds: LongInt): LongInt; cdecl; // T_0168EC28_xSleep;
      xCurrentTime: function (param1: Psqlite3_vfs; param2: Pdouble): LongInt; cdecl; // T_0168E058_xCurrentTime;
      xGetLastError: function (param1: Psqlite3_vfs; param2: LongInt; param3: PAnsiChar): LongInt; cdecl; // T_0168D908_xGetLastError;
      xCurrentTimeInt64: function (param1: Psqlite3_vfs; param2: Psqlite3_int64): LongInt; cdecl; // T_0168B8F8_xCurrentTimeInt64;
      xSetSystemCall: function (param1: Psqlite3_vfs; zName: PAnsiChar; param3: TSQLite3_one_ptr_arg_proc): LongInt; cdecl; // T_0168C3A8_xSetSystemCall;
      xGetSystemCall: function (param1: Psqlite3_vfs; zName: PAnsiChar): TSQLite3_one_ptr_arg_proc; cdecl; // T_0168D128_xGetSystemCall;
      xNextSystemCall: function (param1: Psqlite3_vfs; zName: PAnsiChar): PAnsiChar; cdecl; // T_016D1100_xNextSystemCall;
    end;

const

  SQLITE_FCNTL_LOCKSTATE               = 1;
  SQLITE_FCNTL_GET_LOCKPROXYFILE       = 2;
  SQLITE_FCNTL_SET_LOCKPROXYFILE       = 3;
  SQLITE_FCNTL_LAST_ERRNO              = 4;
  SQLITE_FCNTL_SIZE_HINT               = 5;
  SQLITE_FCNTL_CHUNK_SIZE              = 6;
  SQLITE_FCNTL_FILE_POINTER            = 7;
  SQLITE_FCNTL_SYNC_OMITTED            = 8;
  SQLITE_FCNTL_WIN32_AV_RETRY          = 9;
  SQLITE_FCNTL_PERSIST_WAL             = 10;
  SQLITE_FCNTL_OVERWRITE               = 11;
  SQLITE_FCNTL_VFSNAME                 = 12;
  SQLITE_FCNTL_POWERSAFE_OVERWRITE     = 13;
  SQLITE_FCNTL_PRAGMA                  = 14;
  SQLITE_FCNTL_BUSYHANDLER             = 15;
  SQLITE_FCNTL_TEMPFILENAME            = 16;
  SQLITE_FCNTL_MMAP_SIZE               = 18;
  SQLITE_FCNTL_TRACE                   = 19;
  SQLITE_FCNTL_HAS_MOVED               = 20;
  SQLITE_FCNTL_SYNC                    = 21;
  SQLITE_FCNTL_COMMIT_PHASETWO         = 22;
  SQLITE_FCNTL_WIN32_SET_HANDLE        = 23;
  SQLITE_FCNTL_WAL_BLOCK               = 24;
  SQLITE_FCNTL_ZIPVFS                  = 25;
  SQLITE_FCNTL_RBU                     = 26;
  SQLITE_FCNTL_VFS_POINTER             = 27;
  SQLITE_FCNTL_JOURNAL_POINTER         = 28;
  SQLITE_FCNTL_WIN32_GET_HANDLE        = 29;
  SQLITE_FCNTL_PDB                     = 30;
  SQLITE_FCNTL_BEGIN_ATOMIC_WRITE      = 31;
  SQLITE_FCNTL_COMMIT_ATOMIC_WRITE     = 32;
  SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE   = 33;
  SQLITE_FCNTL_LOCK_TIMEOUT            = 34;
  SQLITE_FCNTL_DATA_VERSION            = 35;
  SQLITE_FCNTL_SIZE_LIMIT              = 36;
  SQLITE_FCNTL_CKPT_DONE               = 37;
  SQLITE_FCNTL_RESERVE_BYTES           = 38;
  SQLITE_FCNTL_CKPT_START              = 39;
  SQLITE_FCNTL_EXTERNAL_READER         = 40;
  SQLITE_FCNTL_CKSM_FILE               = 41;


const

  SQLITE_ACCESS_EXISTS    = 0;
  SQLITE_ACCESS_READWRITE = 1;
  SQLITE_ACCESS_READ      = 2;

const

  SQLITE_SHM_UNLOCK       = 1;
  SQLITE_SHM_LOCK         = 2;
  SQLITE_SHM_SHARED       = 4;
  SQLITE_SHM_EXCLUSIVE    = 8;

  SQLITE_SHM_NLOCK        = 8;



function sqlite3_initialize: LongInt; cdecl;

function sqlite3_shutdown: LongInt; cdecl;

function sqlite3_os_init: LongInt; cdecl;

function sqlite3_os_end: LongInt; cdecl;

const

  SQLITE_CONFIG_SINGLETHREAD = 1;
  SQLITE_CONFIG_MULTITHREAD  = 2;
  SQLITE_CONFIG_SERIALIZED   = 3;
  SQLITE_CONFIG_MALLOC       = 4; // sqlite3_mem_methods*
  SQLITE_CONFIG_GETMALLOC    = 5; // sqlite3_mem_methods*
  SQLITE_CONFIG_SCRATCH      = 6; // No longer used
  SQLITE_CONFIG_PAGECACHE    = 7; // void*, int sz, int N
  SQLITE_CONFIG_HEAP         = 8;
  SQLITE_CONFIG_MEMSTATUS    = 9;
  SQLITE_CONFIG_MUTEX        = 10;
  SQLITE_CONFIG_GETMUTEX     = 11;
  //SQLITE_CONFIG_CHUNKALLOC   = 12;
  SQLITE_CONFIG_LOOKASIDE    = 13;
  SQLITE_CONFIG_PCACHE       = 14;
  SQLITE_CONFIG_GETPCACHE    = 15;
  SQLITE_CONFIG_LOG          = 16;  // xFunc, void*
  SQLITE_CONFIG_URI          = 17;  // int
  SQLITE_CONFIG_PCACHE2      = 18;  // sqlite3_pcache_methods2*
  SQLITE_CONFIG_GETPCACHE2   = 19;  // sqlite3_pcache_methods2*
  SQLITE_CONFIG_COVERING_INDEX_SCAN = 20;  // int
  SQLITE_CONFIG_SQLLOG       = 21;  // xSqllog, void*
  SQLITE_CONFIG_MMAP_SIZE    = 22;  // sqlite3_int64, sqlite3_int64
  SQLITE_CONFIG_WIN32_HEAPSIZE      = 23;  // int nByte
  SQLITE_CONFIG_PCACHE_HDRSZ        = 24;  // int *psz
  SQLITE_CONFIG_PMASZ               = 25;  // unsigned int szPma
  SQLITE_CONFIG_STMTJRNL_SPILL      = 26;  // int nByte
  SQLITE_CONFIG_SMALL_MALLOC        = 27;  // boolean
  SQLITE_CONFIG_SORTERREF_SIZE      = 28;  // int nByte
  SQLITE_CONFIG_MEMDB_MAXSIZE       = 29;  // sqlite3_int64

//function sqlite3_config(param1: LongInt): LongInt; cdecl; varargs; // <- This works! But ignores optional arguments when delay loading ..
{$IFDEF DELAY_LOAD_SQLITE3_DLL}
function sqlite3_config(param1: LongInt; args: array of const): LongInt; // cdecl; // <- Sadly Compiler does not allow "cdecl" here, That would be very helpful in implementation
{$ELSE}
function sqlite3_config(param1: LongInt; args: array of const): LongInt; cdecl; external cStrSqlite3RuntimeLibName;
{$ENDIF}


const

  SQLITE_DBCONFIG_MAINDBNAME            = 1000; // const char*
  SQLITE_DBCONFIG_LOOKASIDE             = 1001; // void* int int
  SQLITE_DBCONFIG_ENABLE_FKEY           = 1002; // int int*
  SQLITE_DBCONFIG_ENABLE_TRIGGER        = 1003; // int int*
  SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004; // int int*
  SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005; // int int*
  SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE      = 1006; // int int*
  SQLITE_DBCONFIG_ENABLE_QPSG           = 1007; // int int*
  SQLITE_DBCONFIG_TRIGGER_EQP           = 1008; // int int*
  SQLITE_DBCONFIG_RESET_DATABASE        = 1009; // int int*
  SQLITE_DBCONFIG_DEFENSIVE             = 1010; // int int*
  SQLITE_DBCONFIG_WRITABLE_SCHEMA       = 1011; // int int*
  SQLITE_DBCONFIG_LEGACY_ALTER_TABLE    = 1012; // int int*
  SQLITE_DBCONFIG_DQS_DML               = 1013; // int int*
  SQLITE_DBCONFIG_DQS_DDL               = 1014; // int int*
  SQLITE_DBCONFIG_ENABLE_VIEW           = 1015; // int int*
  SQLITE_DBCONFIG_LEGACY_FILE_FORMAT    = 1016; // int int*
  SQLITE_DBCONFIG_TRUSTED_SCHEMA        = 1017; // int int*
  SQLITE_DBCONFIG_MAX                   = 1017; // Largest DBCONFIG

//function sqlite3_db_config(param1: Psqlite3; op: LongInt): LongInt; cdecl; varargs; // <- This works! But ignores optional arguments when delay loading ..
{$IFDEF DELAY_LOAD_SQLITE3_DLL}
function sqlite3_db_config(param1: Psqlite3; op: LongInt; args: array of const): LongInt; //cdecl; // <- Sadly Compiler does not allow "cdecl" here, That would be very helpful in implementation
{$ELSE}
function sqlite3_db_config(param1: Psqlite3; op: LongInt; args: array of const): LongInt; cdecl; external cStrSqlite3RuntimeLibName;
{$ENDIF}


type

  Psqlite3_mem_methods = ^Tsqlite3_mem_methods;
  Tsqlite3_mem_methods = record
      xMalloc: function (param1: LongInt): Pointer; cdecl;// T_016D20C0_xMalloc;
      xFree: TSQLite3_one_ptr_arg_proc;
      xRealloc: function (param1: Pointer; param2: LongInt): Pointer; cdecl; // T_016D1070_xRealloc;
      xSize: TSQLite3_one_ptr_arg_func; // T_016D0E30_xSize;
      xRoundup: function (param1: LongInt): LongInt; cdecl; // T_016D09B0_xRoundup;
      xInit: TSQLite3_one_ptr_arg_func; // T_0168CEE8_xInit;
      xShutdown: TSQLite3_one_ptr_arg_proc;
      pAppData: Pointer;
    end;

function sqlite3_extended_result_codes(param1: Psqlite3; onoff: LongInt): LongInt; cdecl;

function sqlite3_last_insert_rowid(param1: Psqlite3): Tsqlite3_int64; cdecl;

procedure sqlite3_set_last_insert_rowid(param1: Psqlite3; param2: Tsqlite3_int64); cdecl;

function sqlite3_changes(param1: Psqlite3): LongInt; cdecl;
function sqlite3_changes64(param1: Psqlite3): Tsqlite3_int64; cdecl;

function sqlite3_total_changes(param1: Psqlite3): LongInt; cdecl;
function sqlite3_total_changes64(param1: Psqlite3): Tsqlite3_int64; cdecl;

procedure sqlite3_interrupt(param1: Psqlite3); cdecl;

function sqlite3_complete(sql: PAnsiChar): LongInt; cdecl;

function sqlite3_complete16(sql: Pointer): LongInt; cdecl;

function sqlite3_busy_handler(param1: Psqlite3; param2: T_0168B988_Param2; param3: Pointer): LongInt; cdecl;

function sqlite3_busy_timeout(param1: Psqlite3; ms: LongInt): LongInt; cdecl;

function sqlite3_get_table(pDb: Psqlite3; zSql: PAnsiChar; pazResult: PPPAnsiChar; var pnRow: LongInt; var pnColumn: LongInt;
           pzErrmsg: PPAnsiChar): LongInt; cdecl;

procedure sqlite3_free_table(result: PPAnsiChar); cdecl;

function sqlite3_mprintf(param1: PAnsiChar; args: PVa_List {array of const}): PAnsiChar; cdecl;

function sqlite3_vmprintf(param1: PAnsiChar; param2: Tva_list): PAnsiChar; cdecl;

function sqlite3_snprintf(param1: LongInt; param2: PAnsiChar; param3: PAnsiChar; args: PVa_List {array of const}): PAnsiChar; cdecl;

function sqlite3_vsnprintf(param1: LongInt; param2: PAnsiChar; param3: PAnsiChar; param4: Tva_list): PAnsiChar; cdecl;

function sqlite3_malloc(param1: LongInt): Pointer; cdecl;

function sqlite3_malloc64(param1: Tsqlite3_uint64): Pointer; cdecl;

function sqlite3_realloc(param1: Pointer; param2: LongInt): Pointer; cdecl;

function sqlite3_realloc64(param1: Pointer; param2: Tsqlite3_uint64): Pointer; cdecl;

procedure sqlite3_free(param1: Pointer); cdecl;

function sqlite3_msize(param1: Pointer): Tsqlite3_uint64; cdecl;

function sqlite3_memory_used: Tsqlite3_int64; cdecl;

function sqlite3_memory_highwater(resetFlag: LongInt): Tsqlite3_int64; cdecl;

procedure sqlite3_randomness(N: LongInt; P: Pointer); cdecl;

function sqlite3_set_authorizer(param1: Psqlite3; xAuth: T_0168C828_XAuth; pUserData: Pointer): LongInt; cdecl;

const

  SQLITE_DENY   = 1; // Abort the SQL statement with an error
  SQLITE_IGNORE = 2; // Don't allow access, but don't generate an error


const

  // ****************************************** 3rd ************ 4th **********
    SQLITE_CREATE_INDEX = 1;           //  Index Name      Table Name
    SQLITE_CREATE_TABLE = 2;           //  Table Name      NULL
    SQLITE_CREATE_TEMP_INDEX = 3;      //  Index Name      Table Name
    SQLITE_CREATE_TEMP_TABLE = 4;      //  Table Name      NULL
    SQLITE_CREATE_TEMP_TRIGGER = 5;    //  Trigger Name    Table Name
    SQLITE_CREATE_TEMP_VIEW = 6;       //  View Name       NULL
    SQLITE_CREATE_TRIGGER = 7;         //  Trigger Name    Table Name
    SQLITE_CREATE_VIEW = 8;            //  View Name       NULL
    SQLITE_DELETE = 9;                 //  Table Name      NULL
    SQLITE_DROP_INDEX = 10;            //  Index Name      Table Name
    SQLITE_DROP_TABLE = 11;            //  Table Name      NULL
    SQLITE_DROP_TEMP_INDEX = 12;       //  Index Name      Table Name
    SQLITE_DROP_TEMP_TABLE = 13;       //  Table Name      NULL
    SQLITE_DROP_TEMP_TRIGGER = 14;     //  Trigger Name    Table Name
    SQLITE_DROP_TEMP_VIEW = 15;        //  View Name       NULL
    SQLITE_DROP_TRIGGER = 16;          //  Trigger Name    Table Name
    SQLITE_DROP_VIEW = 17;             //  View Name       NULL
    SQLITE_INSERT = 18;                //  Table Name      NULL
    SQLITE_PRAGMA = 19;                //  Pragma Name     1st arg or NULL
    SQLITE_READ = 20;                  //  Table Name      Column Name
    SQLITE_SELECT = 21;                //  NULL            NULL
    SQLITE_TRANSACTION = 22;           //  Operation       NULL
    SQLITE_UPDATE = 23;                //  Table Name      Column Name
    SQLITE_ATTACH = 24;                //  Filename        NULL
    SQLITE_DETACH = 25;                //  Database Name   NULL
    SQLITE_ALTER_TABLE = 26;           //  Database Name   Table Name
    SQLITE_REINDEX = 27;               //  Index Name      NULL
    SQLITE_ANALYZE = 28;               //  Table Name      NULL
    SQLITE_CREATE_VTABLE = 29;         //  Table Name      Module Name
    SQLITE_DROP_VTABLE = 30;           //  Table Name      Module Name
    SQLITE_FUNCTION = 31;              //  NULL            Function Name
    SQLITE_SAVEPOINT = 32;             //  Operation       Savepoint Name
    SQLITE_COPY = 0;                   //  No longer used
    SQLITE_RECURSIVE = 33;             //  NULL            NULL

function sqlite3_trace(param1: Psqlite3; xTrace: T_016D0A40_XTrace; param3: Pointer): Pointer; cdecl; deprecated;

function sqlite3_profile(param1: Psqlite3; xProfile: T_0168C318_XProfile; param3: Pointer): Pointer; cdecl; deprecated;

const

  SQLITE_TRACE_STMT       = $01;
  SQLITE_TRACE_PROFILE    = $02;
  SQLITE_TRACE_ROW        = $04;
  SQLITE_TRACE_CLOSE      = $08;

function sqlite3_trace_v2(param1: Psqlite3; uMask: DWord; xCallback: T_0168CF78_XCallback; pCtx: Pointer): LongInt; cdecl;

procedure sqlite3_progress_handler(param1: Psqlite3; param2: LongInt; param3: TSQLite3_one_ptr_arg_func; param4: Pointer); cdecl;

function sqlite3_open(filename: PAnsiChar; var ppDb: Psqlite3): LongInt; cdecl;

function sqlite3_open16(filename: Pointer; var ppDb: Psqlite3): LongInt; cdecl;

function sqlite3_open_v2(filename: PAnsiChar; var ppdb: Psqlite3; flags: LongInt; zVfs: PAnsiChar): LongInt; cdecl;

function sqlite3_uri_parameter(zFilename: PAnsiChar; zParam: PAnsiChar): PAnsiChar; cdecl;

function sqlite3_uri_boolean(zFile: PAnsiChar; zParam: PAnsiChar; bDefault: LongInt): LongInt; cdecl;

function sqlite3_uri_int64(param1: PAnsiChar; param2: PAnsiChar; param3: Tsqlite3_int64): Tsqlite3_int64; cdecl;

function sqlite3_uri_key(zFilename: PAnsiChar; N: LongInt): PAnsiChar; cdecl;

function sqlite3_filename_database(param1: PAnsiChar): PAnsiChar; cdecl;

function sqlite3_filename_journal(param1: PAnsiChar): PAnsiChar; cdecl;

function sqlite3_filename_wal(param1: PAnsiChar): PAnsiChar; cdecl;

function sqlite3_database_file_object(param1: PAnsiChar): Psqlite3_file; cdecl;

function sqlite3_create_filename(zDatabase: PAnsiChar; zJournal: PAnsiChar; zWal: PAnsiChar; nParam: LongInt; azParam: PPAnsiChar): PAnsiChar; cdecl;

procedure sqlite3_free_filename(param1: PAnsiChar); cdecl;

function sqlite3_errcode(db: Psqlite3): LongInt; cdecl;

function sqlite3_extended_errcode(db: Psqlite3): LongInt; cdecl;

function sqlite3_errmsg(param1: Psqlite3): PAnsiChar; cdecl;

function sqlite3_errmsg16(param1: Psqlite3): Pointer; cdecl;

function sqlite3_errstr(param1: LongInt): PAnsiChar; cdecl;

function sqlite3_limit(param1: Psqlite3; id: LongInt; newVal: LongInt): LongInt; cdecl;

const

  SQLITE_LIMIT_LENGTH              = 0;
  SQLITE_LIMIT_SQL_LENGTH          = 1;
  SQLITE_LIMIT_COLUMN              = 2;
  SQLITE_LIMIT_EXPR_DEPTH          = 3;
  SQLITE_LIMIT_COMPOUND_SELECT     = 4;
  SQLITE_LIMIT_VDBE_OP             = 5;
  SQLITE_LIMIT_FUNCTION_ARG        = 6;
  SQLITE_LIMIT_ATTACHED            = 7;
  SQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8;
  SQLITE_LIMIT_VARIABLE_NUMBER     = 9;
  SQLITE_LIMIT_TRIGGER_DEPTH       = 10;
  SQLITE_LIMIT_WORKER_THREADS      = 11;

const

  SQLITE_PREPARE_PERSISTENT             = $01;
  SQLITE_PREPARE_NORMALIZE              = $02;
  SQLITE_PREPARE_NO_VTAB                = $04;


function sqlite3_prepare(pDb: Psqlite3; zSql: PAnsiChar; nByte: LongInt; var ppStmt: Psqlite3_stmt; pzTail: PPAnsiChar): LongInt; cdecl;

function sqlite3_prepare_v2(pDb: Psqlite3; zSql: PAnsiChar; nByte: LongInt; var ppStmt: Psqlite3_stmt; pzTail: PPAnsiChar): LongInt; cdecl;

function sqlite3_prepare_v3(pDb: Psqlite3; zSql: PAnsiChar; nByte: LongInt; prepFlags: DWord; var ppStmt: Psqlite3_stmt;
           pzTail: PPAnsiChar): LongInt; cdecl;

function sqlite3_prepare16(pDb: Psqlite3; zSql: PWideChar; nByte: LongInt; var ppStmt: Psqlite3_stmt; pzTail: PPWideChar): LongInt; cdecl;

function sqlite3_prepare16_v2(pDb: Psqlite3; zSql: PWideChar; nByte: LongInt; var ppStmt: Psqlite3_stmt; pzTail: PPWideChar): LongInt; cdecl;

function sqlite3_prepare16_v3(pDb: Psqlite3; zSql: PWideChar; nByte: LongInt; prepFlags: DWord; var ppStmt: Psqlite3_stmt;
           pzTail: PPWideChar): LongInt; cdecl;

function sqlite3_sql(pStmt: Psqlite3_stmt): PAnsiChar; cdecl;

function sqlite3_expanded_sql(pStmt: Psqlite3_stmt): PAnsiChar; cdecl;

function sqlite3_normalized_sql(pStmt: Psqlite3_stmt): PAnsiChar; cdecl;

function sqlite3_stmt_readonly(pStmt: Psqlite3_stmt): LongInt; cdecl;

function sqlite3_stmt_isexplain(pStmt: Psqlite3_stmt): LongInt; cdecl;

function sqlite3_stmt_busy(param1: Psqlite3_stmt): LongInt; cdecl;

const

  SQLITE_STATIC    = Pointer(0);
  SQLITE_TRANSIENT = Pointer(-1);

function sqlite3_bind_blob(param1: Psqlite3_stmt; param2: LongInt; param3: Pointer; n: LongInt; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

function sqlite3_bind_blob64(param1: Psqlite3_stmt; param2: LongInt; param3: Pointer; param4: Tsqlite3_uint64; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

function sqlite3_bind_double(param1: Psqlite3_stmt; param2: LongInt; param3: Double): LongInt; cdecl;

function sqlite3_bind_int(param1: Psqlite3_stmt; param2: LongInt; param3: LongInt): LongInt; cdecl;

function sqlite3_bind_int64(param1: Psqlite3_stmt; param2: LongInt; param3: Tsqlite3_int64): LongInt; cdecl;

function sqlite3_bind_null(param1: Psqlite3_stmt; param2: LongInt): LongInt; cdecl;

function sqlite3_bind_text(param1: Psqlite3_stmt; param2: LongInt; param3: PAnsiChar; param4: LongInt; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

function sqlite3_bind_text16(param1: Psqlite3_stmt; param2: LongInt; param3: Pointer; param4: LongInt; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

function sqlite3_bind_text64(param1: Psqlite3_stmt; param2: LongInt; param3: PAnsiChar; param4: Tsqlite3_uint64; param5: TSQLite3_one_ptr_arg_proc;
           encoding: Byte): LongInt; cdecl;

function sqlite3_bind_value(param1: Psqlite3_stmt; param2: LongInt; param3: Psqlite3_value): LongInt; cdecl;

function sqlite3_bind_pointer(param1: Psqlite3_stmt; param2: LongInt; param3: Pointer; param4: PAnsiChar; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

function sqlite3_bind_zeroblob(param1: Psqlite3_stmt; param2: LongInt; n: LongInt): LongInt; cdecl;

function sqlite3_bind_zeroblob64(param1: Psqlite3_stmt; param2: LongInt; param3: Tsqlite3_uint64): LongInt; cdecl;

function sqlite3_bind_parameter_count(param1: Psqlite3_stmt): LongInt; cdecl;

function sqlite3_bind_parameter_name(param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl;

function sqlite3_bind_parameter_index(param1: Psqlite3_stmt; zName: PAnsiChar): LongInt; cdecl;

function sqlite3_clear_bindings(param1: Psqlite3_stmt): LongInt; cdecl;

function sqlite3_column_count(pStmt: Psqlite3_stmt): LongInt; cdecl;

function sqlite3_column_name(param1: Psqlite3_stmt; N: LongInt): PAnsiChar; cdecl;

function sqlite3_column_name16(param1: Psqlite3_stmt; N: LongInt): Pointer; cdecl;

function sqlite3_column_database_name(param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl;

function sqlite3_column_database_name16(param1: Psqlite3_stmt; param2: LongInt): Pointer; cdecl;

function sqlite3_column_table_name(param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl;

function sqlite3_column_table_name16(param1: Psqlite3_stmt; param2: LongInt): Pointer; cdecl;

function sqlite3_column_origin_name(param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl;

function sqlite3_column_origin_name16(param1: Psqlite3_stmt; param2: LongInt): Pointer; cdecl;

function sqlite3_column_decltype(param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl;

function sqlite3_column_decltype16(param1: Psqlite3_stmt; param2: LongInt): Pointer; cdecl;

function sqlite3_step(param1: Psqlite3_stmt): LongInt; cdecl;

function sqlite3_data_count(pStmt: Psqlite3_stmt): LongInt; cdecl;

const

  SQLITE_INTEGER = 1;
  SQLITE_FLOAT   = 2;
  SQLITE_BLOB    = 4;
  SQLITE_NULL    = 5;
  SQLITE_TEXT    = 3;
  SQLITE3_TEXT   = 3;

function sqlite3_column_blob(param1: Psqlite3_stmt; iCol: LongInt): Pointer; cdecl;

function sqlite3_column_double(param1: Psqlite3_stmt; iCol: LongInt): Double; cdecl;

function sqlite3_column_int(param1: Psqlite3_stmt; iCol: LongInt): LongInt; cdecl;

function sqlite3_column_int64(param1: Psqlite3_stmt; iCol: LongInt): Tsqlite3_int64; cdecl;

function sqlite3_column_text(param1: Psqlite3_stmt; iCol: LongInt): PByte; cdecl;

function sqlite3_column_text16(param1: Psqlite3_stmt; iCol: LongInt): Pointer; cdecl;

function sqlite3_column_value(param1: Psqlite3_stmt; iCol: LongInt): Psqlite3_value; cdecl;

function sqlite3_column_bytes(param1: Psqlite3_stmt; iCol: LongInt): LongInt; cdecl;

function sqlite3_column_bytes16(param1: Psqlite3_stmt; iCol: LongInt): LongInt; cdecl;

function sqlite3_column_type(param1: Psqlite3_stmt; iCol: LongInt): LongInt; cdecl;

function sqlite3_finalize(pStmt: Psqlite3_stmt): LongInt; cdecl;

function sqlite3_reset(pStmt: Psqlite3_stmt): LongInt; cdecl;

function sqlite3_create_function(pDb: Psqlite3; zFunctionName: PAnsiChar; nArg: LongInt; eTextRep: LongInt; pApp: Pointer;
           xFunc: TSQLite3ContextValueProc; xStep: TSQLite3ContextValueProc; xFinal: TSQLite3ContextProc): LongInt; cdecl;

function sqlite3_create_function16(pDb: Psqlite3; zFunctionName: Pointer; nArg: LongInt; eTextRep: LongInt; pApp: Pointer;
           xFunc: TSQLite3ContextValueProc; xStep: TSQLite3ContextValueProc; xFinal: TSQLite3ContextProc): LongInt; cdecl;

function sqlite3_create_function_v2(pDb: Psqlite3; zFunctionName: PAnsiChar; nArg: LongInt; eTextRep: LongInt; pApp: Pointer;
           xFunc: TSQLite3ContextValueProc; xStep: TSQLite3ContextValueProc; xFinal: TSQLite3ContextProc; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

function sqlite3_create_window_function(pDb: Psqlite3; zFunctionName: PAnsiChar; nArg: LongInt; eTextRep: LongInt; pApp: Pointer;
           xStep: TSQLite3ContextValueProc; xFinal: TSQLite3ContextProc; xValue: TSQLite3ContextProc; xInverse: TSQLite3ContextValueProc; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

const

  SQLITE_UTF8          = 1;
  SQLITE_UTF16LE       = 2;
  SQLITE_UTF16BE       = 3;
  SQLITE_UTF16         = 4;
  SQLITE_ANY           = 5;
  SQLITE_UTF16_ALIGNED = 8;

const

  SQLITE_DETERMINISTIC   = $000000800;
  SQLITE_DIRECTONLY      = $000080000;
  SQLITE_SUBTYPE         = $000100000;
  SQLITE_INNOCUOUS       = $000200000;


function sqlite3_aggregate_count(param1: Psqlite3_context): LongInt; cdecl; deprecated;

function sqlite3_expired(param1: Psqlite3_stmt): LongInt; cdecl; deprecated;

function sqlite3_transfer_bindings(param1: Psqlite3_stmt; param2: Psqlite3_stmt): LongInt; cdecl; deprecated;

function sqlite3_global_recover: LongInt; cdecl; deprecated;

procedure sqlite3_thread_cleanup; cdecl; deprecated;

function sqlite3_memory_alarm(param1: T_0168D488_Param1; param2: Pointer; param3: Tsqlite3_int64): LongInt; cdecl; deprecated;

function sqlite3_value_blob(param1: Psqlite3_value): Pointer; cdecl;

function sqlite3_value_double(param1: Psqlite3_value): Double; cdecl;

function sqlite3_value_int(param1: Psqlite3_value): LongInt; cdecl;

function sqlite3_value_int64(param1: Psqlite3_value): Tsqlite3_int64; cdecl;

function sqlite3_value_pointer(param1: Psqlite3_value; param2: PAnsiChar): Pointer; cdecl;

function sqlite3_value_text(param1: Psqlite3_value): PByte; cdecl;

function sqlite3_value_text16(param1: Psqlite3_value): Pointer; cdecl;

function sqlite3_value_text16le(param1: Psqlite3_value): Pointer; cdecl;

function sqlite3_value_text16be(param1: Psqlite3_value): Pointer; cdecl;

function sqlite3_value_bytes(param1: Psqlite3_value): LongInt; cdecl;

function sqlite3_value_bytes16(param1: Psqlite3_value): LongInt; cdecl;

function sqlite3_value_type(param1: Psqlite3_value): LongInt; cdecl;

function sqlite3_value_numeric_type(param1: Psqlite3_value): LongInt; cdecl;

function sqlite3_value_nochange(param1: Psqlite3_value): LongInt; cdecl;

function sqlite3_value_frombind(param1: Psqlite3_value): LongInt; cdecl;

function sqlite3_value_subtype(param1: Psqlite3_value): DWord; cdecl;

function sqlite3_value_dup(param1: Psqlite3_value): Psqlite3_value; cdecl;

procedure sqlite3_value_free(param1: Psqlite3_value); cdecl;

function sqlite3_aggregate_context(param1: Psqlite3_context; nBytes: LongInt): Pointer; cdecl;

function sqlite3_user_data(param1: Psqlite3_context): Pointer; cdecl;

function sqlite3_context_db_handle(param1: Psqlite3_context): Psqlite3; cdecl;

function sqlite3_get_auxdata(param1: Psqlite3_context; N: LongInt): Pointer; cdecl;

procedure sqlite3_set_auxdata(param1: Psqlite3_context; N: LongInt; param3: Pointer; param4: TSQLite3_one_ptr_arg_proc); cdecl;


//type
//
//
//  Tsqlite3_destructor_type = TSQLite3_one_ptr_arg_proc;


procedure sqlite3_result_blob(param1: Psqlite3_context; param2: Pointer; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl;

procedure sqlite3_result_blob64(param1: Psqlite3_context; param2: Pointer; param3: Tsqlite3_uint64; param4: TSQLite3_one_ptr_arg_proc); cdecl;

procedure sqlite3_result_double(param1: Psqlite3_context; param2: Double); cdecl;

procedure sqlite3_result_error(param1: Psqlite3_context; param2: PAnsiChar; param3: LongInt); cdecl;

procedure sqlite3_result_error16(param1: Psqlite3_context; param2: Pointer; param3: LongInt); cdecl;

procedure sqlite3_result_error_toobig(param1: Psqlite3_context); cdecl;

procedure sqlite3_result_error_nomem(param1: Psqlite3_context); cdecl;

procedure sqlite3_result_error_code(param1: Psqlite3_context; param2: LongInt); cdecl;

procedure sqlite3_result_int(param1: Psqlite3_context; param2: LongInt); cdecl;

procedure sqlite3_result_int64(param1: Psqlite3_context; param2: Tsqlite3_int64); cdecl;

procedure sqlite3_result_null(param1: Psqlite3_context); cdecl;

procedure sqlite3_result_text(param1: Psqlite3_context; param2: PAnsiChar; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl;

procedure sqlite3_result_text64(param1: Psqlite3_context; param2: PAnsiChar; param3: Tsqlite3_uint64; param4: TSQLite3_one_ptr_arg_proc; encoding: Byte); cdecl;

procedure sqlite3_result_text16(param1: Psqlite3_context; param2: Pointer; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl;

procedure sqlite3_result_text16le(param1: Psqlite3_context; param2: Pointer; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl;

procedure sqlite3_result_text16be(param1: Psqlite3_context; param2: Pointer; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl;

procedure sqlite3_result_value(param1: Psqlite3_context; param2: Psqlite3_value); cdecl;

procedure sqlite3_result_pointer(param1: Psqlite3_context; param2: Pointer; param3: PAnsiChar; param4: TSQLite3_one_ptr_arg_proc); cdecl;

procedure sqlite3_result_zeroblob(param1: Psqlite3_context; n: LongInt); cdecl;

function sqlite3_result_zeroblob64(param1: Psqlite3_context; n: Tsqlite3_uint64): LongInt; cdecl;

procedure sqlite3_result_subtype(param1: Psqlite3_context; param2: DWord); cdecl;

function sqlite3_create_collation(param1: Psqlite3; zName: PAnsiChar; eTextRep: LongInt; pArg: Pointer; xCompare: TSQLiteCompareFunc): LongInt; cdecl;

function sqlite3_create_collation_v2(param1: Psqlite3; zName: PAnsiChar; eTextRep: LongInt; pArg: Pointer; xCompare: TSQLiteCompareFunc;
           xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

function sqlite3_create_collation16(param1: Psqlite3; zName: Pointer; eTextRep: LongInt; pArg: Pointer; xCompare: TSQLiteCompareFunc): LongInt; cdecl;

function sqlite3_collation_needed(param1: Psqlite3; param2: Pointer; param3: T_0168C1F8_Param3): LongInt; cdecl;

function sqlite3_collation_needed16(param1: Psqlite3; param2: Pointer; param3: T_0168D3F8_Param3): LongInt; cdecl;

function sqlite3_sleep(param1: LongInt): LongInt; cdecl;


  var
    sqlite3_temp_directory: PAnsiChar;
    sqlite3_data_directory: PAnsiChar;

function sqlite3_win32_set_directory(_type: DWord; zValue: Pointer): LongInt; cdecl;

function sqlite3_win32_set_directory8(_type: DWord; zValue: PAnsiChar): LongInt; cdecl;

function sqlite3_win32_set_directory16(_type: DWord; zValue: Pointer): LongInt; cdecl;

const

  SQLITE_WIN32_DATA_DIRECTORY_TYPE  = 1;
  SQLITE_WIN32_TEMP_DIRECTORY_TYPE  = 2;


function sqlite3_get_autocommit(param1: Psqlite3): LongInt; cdecl;

function sqlite3_db_handle(param1: Psqlite3_stmt): Psqlite3; cdecl;

function sqlite3_db_filename(pDb: Psqlite3; zDbName: PAnsiChar): PAnsiChar; cdecl;

function sqlite3_db_readonly(pDb: Psqlite3; zDbName: PAnsiChar): LongInt; cdecl;

function sqlite3_txn_state(param1: Psqlite3; zSchema: PAnsiChar): LongInt; cdecl;

const

  SQLITE_TXN_NONE  = 0;
  SQLITE_TXN_READ  = 1;
  SQLITE_TXN_WRITE = 2;


function sqlite3_next_stmt(pDb: Psqlite3; pStmt: Psqlite3_stmt): Psqlite3_stmt; cdecl;

function sqlite3_commit_hook(param1: Psqlite3; param2: TSQLite3_one_ptr_arg_func; param3: Pointer): Pointer; cdecl;

function sqlite3_rollback_hook(param1: Psqlite3; param2: TSQLite3_one_ptr_arg_proc; param3: Pointer): Pointer; cdecl;

type
  T_0163D188_Param2 = function (param1: Pointer; param2: PAnsiChar; param3: DWord; param4: DWord; param5: DWord): DWord; cdecl;
  T_01680858_Param4 = function (param1: Pointer): Pointer; cdecl;

function sqlite3_autovacuum_pages(db: Psqlite3; param2: T_0163D188_Param2; param3: Pointer; param4: T_01680858_Param4): LongInt; cdecl;

function sqlite3_update_hook(param1: Psqlite3; param2: T_0168C798_Param2; param3: Pointer): Pointer; cdecl;

function sqlite3_enable_shared_cache(param1: LongInt): LongInt; cdecl;

function sqlite3_release_memory(param1: LongInt): LongInt; cdecl;

function sqlite3_db_release_memory(param1: Psqlite3): LongInt; cdecl;

function sqlite3_soft_heap_limit64(N: Tsqlite3_int64): Tsqlite3_int64; cdecl; deprecated;

function sqlite3_hard_heap_limit64(N: Tsqlite3_int64): Tsqlite3_int64; cdecl;

procedure sqlite3_soft_heap_limit(N: LongInt); cdecl;

function sqlite3_table_column_metadata(pDb: Psqlite3; zDbName: PAnsiChar; zTableName: PAnsiChar; zColumnName: PAnsiChar; pzDataType: PPAnsiChar;
           pzCollSeq: PPAnsiChar; var pNotNull: LongInt; var pPrimaryKey: LongInt; var pAutoinc: LongInt): LongInt; cdecl;

function sqlite3_load_extension(pDb: Psqlite3; zFile: PAnsiChar; zProc: PAnsiChar; pzErrMsg: PPAnsiChar): LongInt; cdecl;

function sqlite3_enable_load_extension(pDb: Psqlite3; onoff: LongInt): LongInt; cdecl;

function sqlite3_auto_extension(xEntryPoint: T_0168CF78_XEntryPoint): LongInt; cdecl;

function sqlite3_cancel_auto_extension(xEntryPoint: T_0168CF78_XEntryPoint): LongInt; cdecl;

procedure sqlite3_reset_auto_extension; cdecl;


type

  Psqlite3_module = ^Tsqlite3_module;
  Psqlite3_vtab = ^Tsqlite3_vtab;
  Psqlite3_vtab_cursor = ^Tsqlite3_vtab_cursor;
  Psqlite3_index_info = ^Tsqlite3_index_info;

  Tsqlite3_vtab = record
      pModule: Psqlite3_module;
      nRef: LongInt;
      zErrMsg: PAnsiChar;
  end;


  //T_016D2150_xCreate = function (param1: Psqlite3; pAux: Pointer; argc: LongInt; argv: PPAnsiChar; var ppVTab: Psqlite3_vtab; param6: PPAnsiChar): LongInt; cdecl;
  //T_016D0C80_xConnect = function (param1: Psqlite3; pAux: Pointer; argc: LongInt; argv: PPAnsiChar; var ppVTab: Psqlite3_vtab; param6: PPAnsiChar): LongInt; cdecl;
  T_0168EEF8_xClose = function (param1: Psqlite3_vtab_cursor): LongInt; cdecl;
  T_0168F888_xFilter = function (param1: Psqlite3_vtab_cursor; idxNum: LongInt; idxStr: PAnsiChar; argc: LongInt; var argv: Psqlite3_value): LongInt; cdecl;
  T_01690458_xNext = function (param1: Psqlite3_vtab_cursor): LongInt; cdecl;
  T_01691388_xEof = function (param1: Psqlite3_vtab_cursor): LongInt; cdecl;
  T_01691928_xColumn = function (param1: Psqlite3_vtab_cursor; param2: Psqlite3_context; param3: LongInt): LongInt; cdecl;
  T_01692228_xRowid = function (param1: Psqlite3_vtab_cursor; var pRowid: Tsqlite3_int64): LongInt; cdecl;
  T_016CB0D0_xUpdate = function (param1: Psqlite3_vtab; param2: LongInt; param3: PPsqlite3_value; param4: Psqlite3_int64): LongInt; cdecl;
  T_016CEF40_ = procedure (param1: Psqlite3_context; param2: LongInt; param3: PPsqlite3_value); cdecl;
  PT_016CEF40_ = ^T_016CEF40_;
  //T_016CE6D0_xFindFunction = function (var pVtab: Tsqlite3_vtab; nArg: LongInt; zName: PAnsiChar; pxFunc: PT_016CEF40_; ppArg: PPointer): LongInt; cdecl;
  //T_016D04A0_xRename = function (var pVtab: Tsqlite3_vtab; zNew: PAnsiChar): LongInt; cdecl;

  Tsqlite3_module_func2 = function (var pVTab: Tsqlite3_vtab; param2: LongInt): LongInt; cdecl;
  //T_0171B118_xSavepoint = function (var pVTab: Tsqlite3_vtab; param2: LongInt): LongInt; cdecl;
  //T_0171BAA8_xRelease = function (var pVTab: Tsqlite3_vtab; param2: LongInt): LongInt; cdecl;
  //T_0171C438_xRollbackTo = function (var pVTab: Tsqlite3_vtab; param2: LongInt): LongInt; cdecl;

  //T_016D1BB0_xBestIndex = function (var pVTab: Tsqlite3_vtab; param2: Psqlite3_index_info): LongInt; cdecl;
  //T_016D1F10_xDisconnect = function (var pVTab: Tsqlite3_vtab): LongInt; cdecl;
  //T_0168DC68_xDestroy = function (var pVTab: Tsqlite3_vtab): LongInt; cdecl;
  //T_0168EC28_xOpen = function (var pVTab: Tsqlite3_vtab; var ppCursor: Psqlite3_vtab_cursor): LongInt; cdecl;
  Tsqlite3_module_func1 = function (var pVTab: Tsqlite3_vtab): LongInt; cdecl;
  //T_016CCAB0_xBegin = function (var pVTab: Tsqlite3_vtab): LongInt; cdecl;
  //T_016CD290_xSync = function (var pVTab: Tsqlite3_vtab): LongInt; cdecl;
  //T_016CD7A0_xCommit = function (var pVTab: Tsqlite3_vtab): LongInt; cdecl;
  //T_016CDE60_xRollback = function (var pVTab: Tsqlite3_vtab): LongInt; cdecl;

  Tsqlite3_module = record
      iVersion: LongInt;
      xCreate: function (param1: Psqlite3; pAux: Pointer; argc: LongInt; argv: PPAnsiChar; var ppVTab: Psqlite3_vtab; param6: PPAnsiChar): LongInt; cdecl; // T_016D2150_xCreate;
      xConnect: function (param1: Psqlite3; pAux: Pointer; argc: LongInt; argv: PPAnsiChar; var ppVTab: Psqlite3_vtab; param6: PPAnsiChar): LongInt; cdecl; // T_016D0C80_xConnect;
      xBestIndex: function (var pVTab: Tsqlite3_vtab; param2: Psqlite3_index_info): LongInt; cdecl; // T_016D1BB0_xBestIndex;
      xDisconnect: Tsqlite3_module_func1; // function (var pVTab: Tsqlite3_vtab): LongInt; cdecl; // T_016D1F10_xDisconnect;
      xDestroy: Tsqlite3_module_func1; // function (var pVTab: Tsqlite3_vtab): LongInt; cdecl; // T_0168DC68_xDestroy;
      xOpen: function (var pVTab: Tsqlite3_vtab; var ppCursor: Psqlite3_vtab_cursor): LongInt; cdecl; // T_0168EC28_xOpen;
      xClose: T_0168EEF8_xClose;
      xFilter: T_0168F888_xFilter;
      xNext: T_01690458_xNext;
      xEof: T_01691388_xEof;
      xColumn: T_01691928_xColumn;
      xRowid: T_01692228_xRowid;
      xUpdate: T_016CB0D0_xUpdate;
      xBegin: Tsqlite3_module_func1; // T_016CCAB0_xBegin;
      xSync: Tsqlite3_module_func1; // T_016CD290_xSync;
      xCommit: Tsqlite3_module_func1; // T_016CD7A0_xCommit;
      xRollback: Tsqlite3_module_func1; // T_016CDE60_xRollback;
      xFindFunction: function (var pVtab: Tsqlite3_vtab; nArg: LongInt; zName: PAnsiChar; pxFunc: PT_016CEF40_; ppArg: PPointer): LongInt; cdecl; // T_016CE6D0_xFindFunction;
      xRename: function (var pVtab: Tsqlite3_vtab; zNew: PAnsiChar): LongInt; cdecl; // T_016D04A0_xRename;
      xSavepoint: Tsqlite3_module_func2; // T_0171B118_xSavepoint;
      xRelease: Tsqlite3_module_func2; // T_0171BAA8_xRelease;
      xRollbackTo: Tsqlite3_module_func2; // T_0171C438_xRollbackTo;
      xShadowName: function (param1: PAnsiChar): LongInt; cdecl; // T_0171CDC8_xShadowName;
    end;


  Psqlite3_index_constraint = ^sqlite3_index_constraint;
  sqlite3_index_constraint = record
          iColumn: LongInt;
          op: Byte;
          usable: Byte;
          iTermOffset: LongInt;
        end;


  Psqlite3_index_orderby = ^sqlite3_index_orderby;
  sqlite3_index_orderby = record
          iColumn: LongInt;
          desc: Byte;
        end;

  Psqlite3_index_constraint_usage = ^sqlite3_index_constraint_usage;
  sqlite3_index_constraint_usage = record
          argvIndex: LongInt;
          omit: Byte;
        end;


  Tsqlite3_index_info = record
      nConstraint: LongInt;
      aConstraint: Psqlite3_index_constraint;
      nOrderBy: LongInt;
      aOrderBy: Psqlite3_index_orderby;
      aConstraintUsage: Psqlite3_index_constraint_usage;
      idxNum: LongInt;
      idxStr: PAnsiChar;
      needToFreeIdxStr: LongInt;
      orderByConsumed: LongInt;
      estimatedCost: Double;
      estimatedRows: Tsqlite3_int64;
      idxFlags: LongInt;
      colUsed: Tsqlite3_uint64;
    end;


  Tsqlite3_vtab_cursor = record
      pVtab: Psqlite3_vtab;
  end;


const

  SQLITE_INDEX_CONSTRAINT_EQ         = 2;
  SQLITE_INDEX_CONSTRAINT_GT         = 4;
  SQLITE_INDEX_CONSTRAINT_LE         = 8;
  SQLITE_INDEX_CONSTRAINT_LT         = 16;
  SQLITE_INDEX_CONSTRAINT_GE         = 32;
  SQLITE_INDEX_CONSTRAINT_MATCH      = 64;
  SQLITE_INDEX_CONSTRAINT_LIKE       = 65;
  SQLITE_INDEX_CONSTRAINT_GLOB       = 66;
  SQLITE_INDEX_CONSTRAINT_REGEXP     = 67;
  SQLITE_INDEX_CONSTRAINT_NE         = 68;
  SQLITE_INDEX_CONSTRAINT_ISNOT      = 69;
  SQLITE_INDEX_CONSTRAINT_ISNOTNULL  = 70;
  SQLITE_INDEX_CONSTRAINT_ISNULL     = 71;
  SQLITE_INDEX_CONSTRAINT_IS         = 72;
  SQLITE_INDEX_CONSTRAINT_FUNCTION   = 150;

function sqlite3_create_module(pDb: Psqlite3; zName: PAnsiChar; var p: Tsqlite3_module; pClientData: Pointer): LongInt; cdecl;

function sqlite3_create_module_v2(pDb: Psqlite3; zName: PAnsiChar; var p: Tsqlite3_module; pClientData: Pointer; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;

function sqlite3_drop_modules(pDb: Psqlite3; azKeep: PPAnsiChar): LongInt; cdecl;




function sqlite3_declare_vtab(param1: Psqlite3; zSQL: PAnsiChar): LongInt; cdecl;

function sqlite3_overload_function(param1: Psqlite3; zFuncName: PAnsiChar; nArg: LongInt): LongInt; cdecl;




function sqlite3_blob_open(param1: Psqlite3; zDb: PAnsiChar; zTable: PAnsiChar; zColumn: PAnsiChar; iRow: Tsqlite3_int64;
           flags: LongInt; var ppBlob: Psqlite3_blob): LongInt; cdecl;

function sqlite3_blob_reopen(param1: Psqlite3_blob; param2: Tsqlite3_int64): LongInt; cdecl;

function sqlite3_blob_close(param1: Psqlite3_blob): LongInt; cdecl;

function sqlite3_blob_bytes(param1: Psqlite3_blob): LongInt; cdecl;

function sqlite3_blob_read(param1: Psqlite3_blob; Z: Pointer; N: LongInt; iOffset: LongInt): LongInt; cdecl;

function sqlite3_blob_write(param1: Psqlite3_blob; z: Pointer; n: LongInt; iOffset: LongInt): LongInt; cdecl;

function sqlite3_vfs_find(zVfsName: PAnsiChar): Psqlite3_vfs; cdecl;

function sqlite3_vfs_register(param1: Psqlite3_vfs; makeDflt: LongInt): LongInt; cdecl;

function sqlite3_vfs_unregister(param1: Psqlite3_vfs): LongInt; cdecl;


const

  SQLITE_MUTEX_FAST             = 0;
  SQLITE_MUTEX_RECURSIVE        = 1;
  SQLITE_MUTEX_STATIC_MAIN      = 2;
  SQLITE_MUTEX_STATIC_MEM       = 3;  // sqlite3_malloc()
  SQLITE_MUTEX_STATIC_MEM2      = 4;  // NOT USED
  SQLITE_MUTEX_STATIC_OPEN      = 4;  // sqlite3BtreeOpen()
  SQLITE_MUTEX_STATIC_PRNG      = 5;  // sqlite3_randomness()
  SQLITE_MUTEX_STATIC_LRU       = 6;  // lru page list
  SQLITE_MUTEX_STATIC_LRU2      = 7;  // NOT USED
  SQLITE_MUTEX_STATIC_PMEM      = 7;  // sqlite3PageMalloc()
  SQLITE_MUTEX_STATIC_APP1      = 8;  // For use by application
  SQLITE_MUTEX_STATIC_APP2      = 9;  // For use by application
  SQLITE_MUTEX_STATIC_APP3      = 10;  // For use by application
  SQLITE_MUTEX_STATIC_VFS1      = 11;  // For use by built-in VFS
  SQLITE_MUTEX_STATIC_VFS2      = 12;  // For use by extension VFS
  SQLITE_MUTEX_STATIC_VFS3      = 13;  // For use by application VFS

  SQLITE_MUTEX_STATIC_MASTER    = 2; // Legacy compatibility


function sqlite3_mutex_alloc(param1: LongInt): Psqlite3_mutex; cdecl;

procedure sqlite3_mutex_free(param1: Psqlite3_mutex); cdecl;

procedure sqlite3_mutex_enter(param1: Psqlite3_mutex); cdecl;

function sqlite3_mutex_try(param1: Psqlite3_mutex): LongInt; cdecl;

procedure sqlite3_mutex_leave(param1: Psqlite3_mutex); cdecl;

function sqlite3_mutex_held(param1: Psqlite3_mutex): LongInt; cdecl;

function sqlite3_mutex_notheld(param1: Psqlite3_mutex): LongInt; cdecl;

type

  Psqlite3_mutex_methods = ^Tsqlite3_mutex_methods;
  Tsqlite3_mutex_methods = record
      xMutexInit: T_016CF840_xMutexInit;
      xMutexEnd: T_016CE6D0_xMutexEnd;
      xMutexAlloc: T_016CFC30_xMutexAlloc;
      xMutexFree: TSQLite3MutexProc;
      xMutexEnter: TSQLite3MutexProc;
      xMutexTry: T_016D06E0_xMutexTry;
      xMutexLeave: TSQLite3MutexProc;
      xMutexHeld: T_0171C0D8_xMutexHeld;
      xMutexNotheld: T_0171C708_xMutexNotheld;
    end;

function sqlite3_db_mutex(param1: Psqlite3): Psqlite3_mutex; cdecl;

function sqlite3_file_control(param1: Psqlite3; zDbName: PAnsiChar; op: LongInt; param4: Pointer): LongInt; cdecl;

function sqlite3_test_control(op: LongInt; args: PVa_List {array of const}): LongInt; cdecl;

function sqlite3_keyword_count: LongInt; cdecl;

function sqlite3_keyword_name(param1: LongInt; param2: PPAnsiChar; param3: PLongInt): LongInt; cdecl;

function sqlite3_keyword_check(param1: PAnsiChar; param2: LongInt): LongInt; cdecl;




function sqlite3_str_new(param1: Psqlite3): Psqlite3_str; cdecl;

function sqlite3_str_finish(param1: Psqlite3_str): PAnsiChar; cdecl;

procedure sqlite3_str_appendf(param1: Psqlite3_str; zFormat: PAnsiChar; args: PVa_List {array of const}); cdecl;

procedure sqlite3_str_vappendf(param1: Psqlite3_str; zFormat: PAnsiChar; param3: Tva_list); cdecl;

procedure sqlite3_str_append(param1: Psqlite3_str; zIn: PAnsiChar; N: LongInt); cdecl;

procedure sqlite3_str_appendall(param1: Psqlite3_str; zIn: PAnsiChar); cdecl;

procedure sqlite3_str_appendchar(param1: Psqlite3_str; N: LongInt; C: AnsiChar); cdecl;

procedure sqlite3_str_reset(param1: Psqlite3_str); cdecl;

function sqlite3_str_errcode(param1: Psqlite3_str): LongInt; cdecl;

function sqlite3_str_length(param1: Psqlite3_str): LongInt; cdecl;

function sqlite3_str_value(param1: Psqlite3_str): PAnsiChar; cdecl;


const

  SQLITE_TESTCTRL_FIRST                    = 5;
  SQLITE_TESTCTRL_PRNG_SAVE                = 5;
  SQLITE_TESTCTRL_PRNG_RESTORE             = 6;
  SQLITE_TESTCTRL_PRNG_RESET               = 7;  // NOT USED
  SQLITE_TESTCTRL_BITVEC_TEST              = 8;
  SQLITE_TESTCTRL_FAULT_INSTALL            = 9;
  SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS      = 10;
  SQLITE_TESTCTRL_PENDING_BYTE             = 11;
  SQLITE_TESTCTRL_ASSERT                   = 12;
  SQLITE_TESTCTRL_ALWAYS                   = 13;
  SQLITE_TESTCTRL_RESERVE                  = 14;  // NOT USED
  SQLITE_TESTCTRL_OPTIMIZATIONS            = 15;
  SQLITE_TESTCTRL_ISKEYWORD                = 16;  // NOT USED
  SQLITE_TESTCTRL_SCRATCHMALLOC            = 17;  // NOT USED
  SQLITE_TESTCTRL_INTERNAL_FUNCTIONS       = 17;
  SQLITE_TESTCTRL_LOCALTIME_FAULT          = 18;
  SQLITE_TESTCTRL_EXPLAIN_STMT             = 19;  // NOT USED
  SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD     = 19;
  SQLITE_TESTCTRL_NEVER_CORRUPT            = 20;
  SQLITE_TESTCTRL_VDBE_COVERAGE            = 21;
  SQLITE_TESTCTRL_BYTEORDER                = 22;
  SQLITE_TESTCTRL_ISINIT                   = 23;
  SQLITE_TESTCTRL_SORTER_MMAP              = 24;
  SQLITE_TESTCTRL_IMPOSTER                 = 25;
  SQLITE_TESTCTRL_PARSER_COVERAGE          = 26;
  SQLITE_TESTCTRL_RESULT_INTREAL           = 27;
  SQLITE_TESTCTRL_PRNG_SEED                = 28;
  SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS      = 29;
  SQLITE_TESTCTRL_SEEK_COUNT               = 30;
  SQLITE_TESTCTRL_TRACEFLAGS               = 31;
  SQLITE_TESTCTRL_TUNE                     = 32;
  SQLITE_TESTCTRL_LAST                     = 32;  // Largest TESTCTRL

function sqlite3_status(op: LongInt; var pCurrent: LongInt; var pHighwater: LongInt; resetFlag: LongInt): LongInt; cdecl;

function sqlite3_status64(op: LongInt; var pCurrent: Tsqlite3_int64; var pHighwater: Tsqlite3_int64; resetFlag: LongInt): LongInt; cdecl;


const

  SQLITE_STATUS_MEMORY_USED        = 0;
  SQLITE_STATUS_PAGECACHE_USED     = 1;
  SQLITE_STATUS_PAGECACHE_OVERFLOW = 2;
  SQLITE_STATUS_SCRATCH_USED       = 3; // NOT USED
  SQLITE_STATUS_SCRATCH_OVERFLOW   = 4; // NOT USED
  SQLITE_STATUS_MALLOC_SIZE        = 5;
  SQLITE_STATUS_PARSER_STACK       = 6;
  SQLITE_STATUS_PAGECACHE_SIZE     = 7;
  SQLITE_STATUS_SCRATCH_SIZE       = 8; // NOT USED
  SQLITE_STATUS_MALLOC_COUNT       = 9;

function sqlite3_db_status(param1: Psqlite3; op: LongInt; var pCur: LongInt; var pHiwtr: LongInt; resetFlg: LongInt): LongInt; cdecl;

const

  SQLITE_DBSTATUS_LOOKASIDE_USED       = 0;
  SQLITE_DBSTATUS_CACHE_USED           = 1;
  SQLITE_DBSTATUS_SCHEMA_USED          = 2;
  SQLITE_DBSTATUS_STMT_USED            = 3;
  SQLITE_DBSTATUS_LOOKASIDE_HIT        = 4;
  SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE  = 5;
  SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL  = 6;
  SQLITE_DBSTATUS_CACHE_HIT            = 7;
  SQLITE_DBSTATUS_CACHE_MISS           = 8;
  SQLITE_DBSTATUS_CACHE_WRITE          = 9;
  SQLITE_DBSTATUS_DEFERRED_FKS         = 10;
  SQLITE_DBSTATUS_CACHE_USED_SHARED    = 11;
  SQLITE_DBSTATUS_CACHE_SPILL          = 12;
  SQLITE_DBSTATUS_MAX                  = 12;   // Largest defined DBSTATUS

function sqlite3_stmt_status(param1: Psqlite3_stmt; op: LongInt; resetFlg: LongInt): LongInt; cdecl;


const

  SQLITE_STMTSTATUS_FULLSCAN_STEP     = 1;
  SQLITE_STMTSTATUS_SORT              = 2;
  SQLITE_STMTSTATUS_AUTOINDEX         = 3;
  SQLITE_STMTSTATUS_VM_STEP           = 4;
  SQLITE_STMTSTATUS_REPREPARE         = 5;
  SQLITE_STMTSTATUS_RUN               = 6;
  SQLITE_STMTSTATUS_MEMUSED           = 99;


type

  Psqlite3_pcache_page = ^Tsqlite3_pcache_page;
  Tsqlite3_pcache_page = record
      pBuf: Pointer;
      pExtra: Pointer;
    end;

  T_0171E058_xFetch = function (param1: Psqlite3_pcache; key: DWord; createFlag: LongInt): Psqlite3_pcache_page; cdecl;
  T_0171D2D8_xUnpin = procedure (param1: Psqlite3_pcache; param2: Psqlite3_pcache_page; discard: LongInt); cdecl;
  T_016CF3C0_xRekey = procedure (param1: Psqlite3_pcache; param2: Psqlite3_pcache_page; oldKey: DWord; newKey: DWord); cdecl;

  Psqlite3_pcache_methods2 = ^Tsqlite3_pcache_methods2;
  Tsqlite3_pcache_methods2 = record
      iVersion: LongInt;
      pArg: Pointer;
      xInit: TSQLite3_one_ptr_arg_func;
      xShutdown: TSQLite3_one_ptr_arg_proc;
      xCreate: T_0171BCE8_xCreate;
      xCachesize: T_016CF9F0_xCachesize;
      xPagecount: T_016CFF90_xPagecount;
      xFetch: T_0171E058_xFetch;
      xUnpin: T_0171D2D8_xUnpin;
      xRekey: T_016CF3C0_xRekey;
      xTruncate: T_016CF600_xTruncate;
      xDestroy: T_016CD950_xDestroy;
      xShrink: T_016CCCF0_xShrink;
    end;

  Psqlite3_pcache_methods = ^Tsqlite3_pcache_methods;
  Tsqlite3_pcache_methods = record
      pArg: Pointer;
      xInit: TSQLite3_one_ptr_arg_func;
      xShutdown: TSQLite3_one_ptr_arg_proc;
      xCreate: T_016CD200_xCreate;
      xCachesize: T_016CE1C0_xCachesize;
      xPagecount: T_016CEAC0_xPagecount;
      xFetch: T_0171D7E8_xFetch;
      xUnpin: T_0171D518_xUnpin;
      xRekey: T_016CEEB0_xRekey;
      xTruncate: T_016D29C0_xTruncate;
      xDestroy: T_0171B358_xDestroy;
    end;



function sqlite3_backup_init(pDest: Psqlite3; zDestName: PAnsiChar; pSource: Psqlite3; zSourceName: PAnsiChar): Psqlite3_backup; cdecl;

function sqlite3_backup_step(pBackup: Psqlite3_backup; nPage: LongInt): LongInt; cdecl;

function sqlite3_backup_finish(pBackup: Psqlite3_backup): LongInt; cdecl;

function sqlite3_backup_remaining(pBackup: Psqlite3_backup): LongInt; cdecl;

function sqlite3_backup_pagecount(pBackup: Psqlite3_backup): LongInt; cdecl;

function sqlite3_unlock_notify(pBlocked: Psqlite3; xNotify: T_016D06E0_XNotify; pNotifyArg: Pointer): LongInt; cdecl;

function sqlite3_stricmp(param1: PAnsiChar; param2: PAnsiChar): LongInt; cdecl;

function sqlite3_strnicmp(param1: PAnsiChar; param2: PAnsiChar; param3: LongInt): LongInt; cdecl;

function sqlite3_strglob(zGlob: PAnsiChar; zStr: PAnsiChar): LongInt; cdecl;

function sqlite3_strlike(zGlob: PAnsiChar; zStr: PAnsiChar; cEsc: DWord): LongInt; cdecl;

procedure sqlite3_log(iErrCode: LongInt; zFormat: PAnsiChar; args: PVa_List {array of const}); cdecl;

function sqlite3_wal_hook(param1: Psqlite3; param2: T_016CAE90_Param2; param3: Pointer): Pointer; cdecl;

function sqlite3_wal_autocheckpoint(pDb: Psqlite3; N: LongInt): LongInt; cdecl;

function sqlite3_wal_checkpoint(pDb: Psqlite3; zDb: PAnsiChar): LongInt; cdecl;

function sqlite3_wal_checkpoint_v2(pDb: Psqlite3; zDb: PAnsiChar; eMode: LongInt; var pnLog: LongInt; var pnCkpt: LongInt): LongInt; cdecl;

const

  SQLITE_CHECKPOINT_PASSIVE  = 0;  // Do as much as possible w/o blocking
  SQLITE_CHECKPOINT_FULL     = 1;  // Wait for writers, then checkpoint
  SQLITE_CHECKPOINT_RESTART  = 2;  // Like FULL but wait for for readers
  SQLITE_CHECKPOINT_TRUNCATE = 3;  // Like RESTART but also truncate WAL

const

  SQLITE_VTAB_CONSTRAINT_SUPPORT = 1;
  SQLITE_VTAB_INNOCUOUS          = 2;
  SQLITE_VTAB_DIRECTONLY         = 3;

function sqlite3_vtab_config(param1: Psqlite3; op: LongInt; args: PVa_List {array of const}): LongInt; cdecl;

function sqlite3_vtab_on_conflict(param1: Psqlite3): LongInt; cdecl;

function sqlite3_vtab_nochange(param1: Psqlite3_context): LongInt; cdecl;

function sqlite3_vtab_collation(param1: Psqlite3_index_info; param2: LongInt): PAnsiChar; cdecl;

const

  SQLITE_ROLLBACK = 1;
  // SQLITE_IGNORE = 2; // Also used by sqlite3_authorizer() callback
  SQLITE_FAIL     = 3;
  // SQLITE_ABORT = 4;  // Also an error code
  SQLITE_REPLACE  = 5;

const

  SQLITE_SCANSTAT_NLOOP    = 0;
  SQLITE_SCANSTAT_NVISIT   = 1;
  SQLITE_SCANSTAT_EST      = 2;
  SQLITE_SCANSTAT_NAME     = 3;
  SQLITE_SCANSTAT_EXPLAIN  = 4;
  SQLITE_SCANSTAT_SELECTID = 5;

function sqlite3_stmt_scanstatus(pStmt: Psqlite3_stmt; idx: LongInt; iScanStatusOp: LongInt; pOut: Pointer): LongInt; cdecl;

procedure sqlite3_stmt_scanstatus_reset(param1: Psqlite3_stmt); cdecl;

function sqlite3_db_cacheflush(param1: Psqlite3): LongInt; cdecl;

function sqlite3_system_errno(param1: Psqlite3): LongInt; cdecl;


type

  Psqlite3_snapshot = ^Tsqlite3_snapshot;
  Tsqlite3_snapshot = record
      hidden: array[0..47] of Byte;
    end;

function sqlite3_snapshot_get(pDb: Psqlite3; zSchema: PAnsiChar; var ppSnapshot: Psqlite3_snapshot): LongInt; cdecl;

function sqlite3_snapshot_open(pDb: Psqlite3; zSchema: PAnsiChar; var pSnapshot: Tsqlite3_snapshot): LongInt; cdecl;

procedure sqlite3_snapshot_free(param1: Psqlite3_snapshot); cdecl;

function sqlite3_snapshot_cmp(var p1: Tsqlite3_snapshot; var p2: Tsqlite3_snapshot): LongInt; cdecl;

function sqlite3_snapshot_recover(pDb: Psqlite3; zDb: PAnsiChar): LongInt; cdecl;

function sqlite3_serialize(pDb: Psqlite3; zSchema: PAnsiChar; var piSize: Tsqlite3_int64; mFlags: DWord): PByte; cdecl;

const

  SQLITE_DESERIALIZE_FREEONCLOSE = 1; // Call sqlite3_free() on close
  SQLITE_DESERIALIZE_RESIZEABLE  = 2; // Resize using sqlite3_realloc64()
  SQLITE_DESERIALIZE_READONLY    = 4; // Database is read-only

function sqlite3_deserialize(pDb: Psqlite3; zSchema: PAnsiChar; var pData: Byte; szDb: Tsqlite3_int64; szBuf: Tsqlite3_int64;
           mFlags: DWord): LongInt; cdecl;


type


  Psqlite3_rtree_dbl = ^Tsqlite3_rtree_dbl;
  Tsqlite3_rtree_dbl = Double;


  Psqlite3_rtree_geometry = ^Tsqlite3_rtree_geometry;
  Tsqlite3_rtree_geometry = record
      pContext: Pointer;
      nParam: LongInt;
      aParam: Psqlite3_rtree_dbl;
      pUser: Pointer;
      xDelUser: TSQLite3_one_ptr_arg_proc;
    end;

  T_0171DD88_XGeom = function (param1: Psqlite3_rtree_geometry; param2: LongInt; param3: Psqlite3_rtree_dbl; param4: PLongInt): LongInt; cdecl;

function sqlite3_rtree_geometry_callback(pDb: Psqlite3; zGeom: PAnsiChar; xGeom: T_0171DD88_XGeom; pContext: Pointer): LongInt; cdecl;


type

  Psqlite3_rtree_query_info = ^Tsqlite3_rtree_query_info;
  Tsqlite3_rtree_query_info = record
      pContext: Pointer;
      nParam: LongInt;
      aParam: Psqlite3_rtree_dbl;
      pUser: Pointer;
      xDelUser: TSQLite3_one_ptr_arg_proc;
      aCoord: Psqlite3_rtree_dbl;
      anQueue: PDWord;
      nCoord: LongInt;
      iLevel: LongInt;
      mxLevel: LongInt;
      iRowid: Tsqlite3_int64;
      rParentScore: Tsqlite3_rtree_dbl;
      eParentWithin: LongInt;
      eWithin: LongInt;
      rScore: Tsqlite3_rtree_dbl;
      apSqlParam: ^Psqlite3_value;
    end;

  T_0171B358_XQueryFunc = function (param1: Psqlite3_rtree_query_info): LongInt; cdecl;

  function sqlite3_rtree_query_callback(pDb: Psqlite3; zQueryFunc: PAnsiChar; xQueryFunc: T_0171B358_XQueryFunc; pContext: Pointer; xDestructor: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;


  type

  PFts5PhraseIter = ^TFts5PhraseIter;
  TFts5PhraseIter = record
      a: PByte;
      b: PByte;
    end;


  PFts5ExtensionApi = ^TFts5ExtensionApi;

  T_016D24B0_xPhraseFirst = function (param1: PFts5Context; iPhrase: LongInt; param3: PFts5PhraseIter; param4: PLongInt; param5: PLongInt): LongInt; cdecl;
  T_016D1970_xPhraseNext = procedure (param1: PFts5Context; param2: PFts5PhraseIter; var piCol: LongInt; var piOff: LongInt); cdecl;
  T_0168CD38_xPhraseFirstColumn = function (param1: PFts5Context; iPhrase: LongInt; param3: PFts5PhraseIter; param4: PLongInt): LongInt; cdecl;
  T_016D18E0_xPhraseNextColumn = procedure (param1: PFts5Context; param2: PFts5PhraseIter; var piCol: LongInt); cdecl;
  T_016907B8_Param4 = function (param1: PFts5ExtensionApi; param2: PFts5Context; param3: Pointer): LongInt; cdecl;
  T_016909F8_xQueryPhrase = function (param1: PFts5Context; iPhrase: LongInt; pUserData: Pointer; param4: T_016907B8_Param4): LongInt; cdecl;


  TFts5ExtensionApi = record
      iVersion: LongInt;
      xUserData: T_0171D5A8_xUserData;
      xColumnCount: T_0171DC68_xColumnCount;
      xRowCount: T_0171D7E8_xRowCount;
      xColumnTotalSize: T_016CE640_xColumnTotalSize;
      xTokenize: T_016D02F0_xTokenize;
      xPhraseCount: T_016CD830_xPhraseCount;
      xPhraseSize: T_016CDE60_xPhraseSize;
      xInstCount: T_016CCF30_xInstCount;
      xInst: T_0171C828_xInst;
      xRowid: T_016CB670_xRowid;
      xColumnText: T_016CAC50_xColumnText;
      xColumnSize: T_01691B68_xColumnSize;
      xQueryPhrase: T_016909F8_xQueryPhrase;
      xSetAuxdata: T_0168F648_xSetAuxdata;
      xGetAuxdata: T_0168DE18_xGetAuxdata;
      xPhraseFirst: T_016D24B0_xPhraseFirst;
      xPhraseNext: T_016D1970_xPhraseNext;
      xPhraseFirstColumn: T_0168CD38_xPhraseFirstColumn;
      xPhraseNextColumn: T_016D18E0_xPhraseNextColumn;
    end;


  PFts5Tokenizer = ^Tfts5_tokenizer;

  T_0171E7A8_xCreate = function (param1: Pointer; azArg: PPAnsiChar; nArg: LongInt; var ppOut: PFts5Tokenizer): LongInt; cdecl;
  T_016D0F50_xDelete = procedure (param1: PFts5Tokenizer); cdecl;
  T_0168D2D8_xTokenize = function (param1: PFts5Tokenizer; pCtx: Pointer; flags: LongInt; pText: PAnsiChar; nText: LongInt;
                            xToken: T_0168BC58_XToken): LongInt; cdecl;
  Tfts5_tokenizer = record
      xCreate: T_0171E7A8_xCreate;
      xDelete: T_016D0F50_xDelete;
      xTokenize: T_0168D2D8_xTokenize;
    end;

  Pfts5_api = ^Tfts5_api;

  Tfts5_extension_function = procedure (pApi: PFts5ExtensionApi; pFts: PFts5Context; pCtx: Psqlite3_context; nVal: LongInt; var apVal: Psqlite3_value); cdecl;
  //T_0168C558_xCreateFunction = function (pApi: Pfts5_api; zName: PAnsiChar; pContext: Pointer; xFunction: Tfts5_extension_function; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;
  //T_0168AED8_xCreateTokenizer = function (pApi: Pfts5_api; zName: PAnsiChar; pContext: Pointer; var pTokenizer: Tfts5_tokenizer; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl;
  //T_016D1970_xFindTokenizer = function (pApi: Pfts5_api; zName: PAnsiChar; ppContext: PPointer; var pTokenizer: Tfts5_tokenizer): LongInt; cdecl;

  Tfts5_api = record
      iVersion: LongInt;
      xCreateTokenizer: function (pApi: Pfts5_api; zName: PAnsiChar; pContext: Pointer; var pTokenizer: Tfts5_tokenizer; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl; // T_0168AED8_xCreateTokenizer;
      xFindTokenizer: function (pApi: Pfts5_api; zName: PAnsiChar; ppContext: PPointer; var pTokenizer: Tfts5_tokenizer): LongInt; cdecl; // T_016D1970_xFindTokenizer;
      xCreateFunction: function (pApi: Pfts5_api; zName: PAnsiChar; pContext: Pointer; xFunction: Tfts5_extension_function; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl; // T_0168C558_xCreateFunction;
    end;


  ESqliteError = class (Exception);



implementation

uses {$IFDEF JEDIAPI}JwaWinBase,{$ELSE}Windowss,{$ENDIF}
     GMStrDef, GMCommon;


resourcestring

  RStrRoutineNotFound = 'Routine "%s" not found in DLL "%s"';


var

  gShouldCallSQLiteShutdown: Boolean = {$IFDEF DELAY_LOAD_SQLITE3_DLL}False{$ELSE}True{$ENDIF};


{ --------------------------- }
{ ----  Helper Routines  ---- }
{ --------------------------- }

function LoadProcAddress(const AModuleName: TGMString; const AProcName: AnsiString; const ACheck: Boolean = True): Pointer;
var moduleHandle: HMODULE; lastErr: DWORD; moduleFullePath: TGMString;
begin
  moduleFullePath := GMAppendPath(GMExtractPath(GMThisModuleFileName), AModuleName);
  moduleHandle := GetModuleHandle(PGMChar(moduleFullePath));
  if moduleHandle = 0 then
   begin
    moduleHandle := LoadLibrary(PGMChar(moduleFullePath));
    if (moduleHandle = 0) and ACheck then
     begin
      lastErr := GetLastError;
      GMAPICheckObjParams('LoadLibrary("'+moduleFullePath+'")', '', lastErr, moduleHandle <> 0, [PGMChar(moduleFullePath)]);
     end;
   end;
  if moduleHandle = 0 then Result := nil else Result := GetProcAddress(moduleHandle, PAnsiChar(AProcName));
  if not Assigned(Result) and ACheck then raise ESqliteError.Create(GMFormat(RStrRoutineNotFound, [AProcName, moduleFullePath]));
  gShouldCallSQLiteShutdown := True;
end;


{ ------------------------------------ }
{ ----  External Implementations  ---- }
{ ------------------------------------ }

{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_libversion: function : PAnsiChar; cdecl = nil;

function sqlite3_libversion;
begin
  if not Assigned(vf_sqlite3_libversion) then vf_sqlite3_libversion := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_libversion');
  Result := vf_sqlite3_libversion();
end;
{$ELSE}
function sqlite3_libversion; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_sourceid: function : PAnsiChar; cdecl = nil;

function sqlite3_sourceid;
begin
  if not Assigned(vf_sqlite3_sourceid) then vf_sqlite3_sourceid := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_sourceid');
  Result := vf_sqlite3_sourceid();
end;
{$ELSE}
function sqlite3_sourceid; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_libversion_number: function : LongInt; cdecl = nil;

function sqlite3_libversion_number;
begin
  if not Assigned(vf_sqlite3_libversion_number) then vf_sqlite3_libversion_number := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_libversion_number');
  Result := vf_sqlite3_libversion_number();
end;
{$ELSE}
function sqlite3_libversion_number; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_compileoption_used: function (zOptName: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_compileoption_used;
begin
  if not Assigned(vf_sqlite3_compileoption_used) then vf_sqlite3_compileoption_used := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_compileoption_used');
  Result := vf_sqlite3_compileoption_used(zOptName);
end;
{$ELSE}
function sqlite3_compileoption_used; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_compileoption_get: function (N: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_compileoption_get;
begin
  if not Assigned(vf_sqlite3_compileoption_get) then vf_sqlite3_compileoption_get := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_compileoption_get');
  Result := vf_sqlite3_compileoption_get(N);
end;
{$ELSE}
function sqlite3_compileoption_get; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_threadsafe: function : LongInt; cdecl = nil;

function sqlite3_threadsafe;
begin
  if not Assigned(vf_sqlite3_threadsafe) then vf_sqlite3_threadsafe := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_threadsafe');
  Result := vf_sqlite3_threadsafe();
end;
{$ELSE}
function sqlite3_threadsafe; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_close: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_close;
begin
  if not Assigned(vf_sqlite3_close) then vf_sqlite3_close := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_close');
  Result := vf_sqlite3_close(param1);
end;
{$ELSE}
function sqlite3_close; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_close_v2: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_close_v2;
begin
  if not Assigned(vf_sqlite3_close_v2) then vf_sqlite3_close_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_close_v2');
  Result := vf_sqlite3_close_v2(param1);
end;
{$ELSE}
function sqlite3_close_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_exec: function (param1: Psqlite3; sql: PAnsiChar; callback: T_0168B8F8_Callback; param4: Pointer; errmsg: PPAnsiChar): LongInt; cdecl = nil;

function sqlite3_exec;
begin
  if not Assigned(vf_sqlite3_exec) then vf_sqlite3_exec := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_exec');
  Result := vf_sqlite3_exec(param1, sql, callback, param4, errmsg);
end;
{$ELSE}
function sqlite3_exec; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_initialize: function : LongInt; cdecl = nil;

function sqlite3_initialize;
begin
  if not Assigned(vf_sqlite3_initialize) then vf_sqlite3_initialize := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_initialize');
  Result := vf_sqlite3_initialize();
end;
{$ELSE}
function sqlite3_initialize; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_shutdown: function : LongInt; cdecl = nil;

function sqlite3_shutdown;
begin
  if not Assigned(vf_sqlite3_shutdown) then vf_sqlite3_shutdown := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_shutdown');
  Result := vf_sqlite3_shutdown();
end;
{$ELSE}
function sqlite3_shutdown; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_os_init: function : LongInt; cdecl = nil;

function sqlite3_os_init;
begin
  if not Assigned(vf_sqlite3_os_init) then vf_sqlite3_os_init := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_os_init');
  Result := vf_sqlite3_os_init();
end;
{$ELSE}
function sqlite3_os_init; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_os_end: function : LongInt; cdecl = nil;

function sqlite3_os_end;
begin
  if not Assigned(vf_sqlite3_os_end) then vf_sqlite3_os_end := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_os_end');
  Result := vf_sqlite3_os_end();
end;
{$ELSE}
function sqlite3_os_end; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


procedure NumParamError(const ARoutineName: TGMString; const AParamCount: LongInt);
begin
  raise ESqliteError.Create(GMFormat('%s: Unsupported number of argument %d', [ARoutineName, AParamCount]));
end;

procedure ParamTypeError(const ARoutineName: TGMString);
begin
  raise ESqliteError.Create(GMFormat('%s: Unsupported argument combination', [ARoutineName]));
end;

{$IFDEF DELAY_LOAD_SQLITE3_DLL}
//var vf_sqlite3_config: function (param1: LongInt): LongInt; cdecl; varargs; = nil;
var vf_sqlite3_config: function (param1: LongInt; args: array of const): LongInt; cdecl; = nil;

function sqlite3_config;
const cStrRoutineName = 'sqlite3_config';
begin
  if not Assigned(vf_sqlite3_config) then vf_sqlite3_config := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_config');

  case Length(args) of
   0:  Result := vf_sqlite3_config(param1, []);
   1:  case args[0].vtype of
        vtInteger: Result := vf_sqlite3_config(param1, [args[0].vInteger]);
        vtPointer: Result := vf_sqlite3_config(param1, [args[0].vPointer]);
        vtPChar: Result :=   vf_sqlite3_config(param1, [args[0].VPChar]);
        else ParamTypeError(cStrRoutineName);
       end;
   2:  case args[0].vtype of
        vtInteger: case args[1].vtype of
                    vtInteger: Result := vf_sqlite3_config(param1, [args[0].vInteger, args[1].vInteger]);
                    vtPointer: Result := vf_sqlite3_config(param1, [args[0].vInteger, args[1].vPointer]);
                    else ParamTypeError(cStrRoutineName);
                   end;

        vtPointer: case args[1].vtype of
                    vtInteger: Result := vf_sqlite3_config(param1, [args[0].vPointer, args[1].vInteger]);
                    vtPointer: Result := vf_sqlite3_config(param1, [args[0].vPointer, args[1].vPointer]);
                    else ParamTypeError(cStrRoutineName);
                   end;
        else ParamTypeError(cStrRoutineName);
       end;
   else NumParamError(cStrRoutineName, Length(args));
  end;
  //Result := vf_sqlite3_config(param1, args); // <- would be so easy ..
end;
{$ELSE}
//function sqlite3_config; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
//var vf_sqlite3_db_config: function (param1: Psqlite3; op: LongInt): LongInt; cdecl; varargs;
var vf_sqlite3_db_config: function (param1: Psqlite3; op: LongInt; args: array of const): LongInt; cdecl; = nil;

function sqlite3_db_config;
const cStrRoutineName = 'sqlite3_db_config';
begin
  if not Assigned(vf_sqlite3_db_config) then vf_sqlite3_db_config := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_db_config');

  //
  // if sqlite3_db_config could be defined "cdecl" in interface part all this argument stuff could be eliminated ..
  //
  case Length(args) of
   0:  Result := vf_sqlite3_db_config(param1, op, []);
   1:  case args[0].vtype of
        vtInteger: Result := vf_sqlite3_db_config(param1, op, [args[0].vInteger]);
        vtPointer: Result := vf_sqlite3_db_config(param1, op, [args[0].vPointer]);
        vtPChar: Result :=   vf_sqlite3_db_config(param1, op, [args[0].VPChar]);
        else ParamTypeError(cStrRoutineName);
       end;
   2:  case args[0].vtype of
        vtInteger: case args[1].vtype of
                    vtInteger: Result := vf_sqlite3_db_config(param1, op, [args[0].vInteger, args[1].vInteger]);
                    vtPointer: Result := vf_sqlite3_db_config(param1, op, [args[0].vInteger, args[1].vPointer]);
                    else ParamTypeError(cStrRoutineName);
                   end;

        vtPointer: case args[1].vtype of
                    vtInteger: Result := vf_sqlite3_db_config(param1, op, [args[0].vPointer, args[1].vInteger]);
                    vtPointer: Result := vf_sqlite3_db_config(param1, op, [args[0].vPointer, args[1].vPointer]);
                    else ParamTypeError(cStrRoutineName);
                   end;
        else ParamTypeError(cStrRoutineName);
       end;
   else NumParamError(cStrRoutineName, Length(args));
  end;
  //Result := vf_sqlite3_db_config(param1, op, args); // <- would be so easy ..
end;
{$ELSE}
//function sqlite3_db_config; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_extended_result_codes: function (param1: Psqlite3; onoff: LongInt): LongInt; cdecl = nil;

function sqlite3_extended_result_codes;
begin
  if not Assigned(vf_sqlite3_extended_result_codes) then vf_sqlite3_extended_result_codes := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_extended_result_codes');
  Result := vf_sqlite3_extended_result_codes(param1, onoff);
end;
{$ELSE}
function sqlite3_extended_result_codes; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_last_insert_rowid: function (param1: Psqlite3): Tsqlite3_int64; cdecl = nil;

function sqlite3_last_insert_rowid;
begin
  if not Assigned(vf_sqlite3_last_insert_rowid) then vf_sqlite3_last_insert_rowid := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_last_insert_rowid');
  Result := vf_sqlite3_last_insert_rowid(param1);
end;
{$ELSE}
function sqlite3_last_insert_rowid; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_set_last_insert_rowid: procedure (param1: Psqlite3; param2: Tsqlite3_int64); cdecl = nil;

procedure sqlite3_set_last_insert_rowid;
begin
  if not Assigned(vf_sqlite3_set_last_insert_rowid) then vf_sqlite3_set_last_insert_rowid := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_set_last_insert_rowid');
  vf_sqlite3_set_last_insert_rowid(param1, param2);
end;
{$ELSE}
procedure sqlite3_set_last_insert_rowid; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_changes: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_changes;
begin
  if not Assigned(vf_sqlite3_changes) then vf_sqlite3_changes := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_changes');
  Result := vf_sqlite3_changes(param1);
end;
{$ELSE}
function sqlite3_changes; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_changes64: function (param1: Psqlite3): Tsqlite3_int64; cdecl = nil;
    vSqlite3Changes64Supported: Boolean = True;

function sqlite3_changes64;
begin
  if not Assigned(vf_sqlite3_changes64) and vSqlite3Changes64Supported then
   begin
    vf_sqlite3_changes64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_changes64', False);
    vSqlite3Changes64Supported := Assigned(vf_sqlite3_changes64);
   end;

  if vSqlite3Changes64Supported then Result := vf_sqlite3_changes64(param1) else Result := sqlite3_changes(param1);
end;
{$ELSE}
function sqlite3_changes64; external cStrSqlite3LibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_total_changes: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_total_changes;
begin
  if not Assigned(vf_sqlite3_total_changes) then vf_sqlite3_total_changes := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_total_changes');
  Result := vf_sqlite3_total_changes(param1);
end;
{$ELSE}
function sqlite3_total_changes; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_total_changes64: function (param1: Psqlite3): Tsqlite3_int64; cdecl = nil;
    vSqlite3TotalChanges64Supported: Boolean = True;

function sqlite3_total_changes64;
begin
  if not Assigned(vf_sqlite3_total_changes64) then
   begin
    vf_sqlite3_total_changes64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_total_changes64', False);
    vSqlite3TotalChanges64Supported := Assigned(vf_sqlite3_total_changes64);
   end;
  if vSqlite3TotalChanges64Supported then Result := vf_sqlite3_total_changes64(param1) else Result := sqlite3_total_changes(param1);
end;
{$ELSE}
function sqlite3_total_changes64; external cStrSqlite3LibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_interrupt: procedure (param1: Psqlite3); cdecl = nil;

procedure sqlite3_interrupt;
begin
  if not Assigned(vf_sqlite3_interrupt) then vf_sqlite3_interrupt := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_interrupt');
  vf_sqlite3_interrupt(param1);
end;
{$ELSE}
procedure sqlite3_interrupt; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_complete: function (sql: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_complete;
begin
  if not Assigned(vf_sqlite3_complete) then vf_sqlite3_complete := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_complete');
  Result := vf_sqlite3_complete(sql);
end;
{$ELSE}
function sqlite3_complete; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_complete16: function (sql: Pointer): LongInt; cdecl = nil;

function sqlite3_complete16;
begin
  if not Assigned(vf_sqlite3_complete16) then vf_sqlite3_complete16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_complete16');
  Result := vf_sqlite3_complete16(sql);
end;
{$ELSE}
function sqlite3_complete16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_busy_handler: function (param1: Psqlite3; param2: T_0168B988_Param2; param3: Pointer): LongInt; cdecl = nil;

function sqlite3_busy_handler;
begin
  if not Assigned(vf_sqlite3_busy_handler) then vf_sqlite3_busy_handler := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_busy_handler');
  Result := vf_sqlite3_busy_handler(param1, param2, param3);
end;
{$ELSE}
function sqlite3_busy_handler; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_busy_timeout: function (param1: Psqlite3; ms: LongInt): LongInt; cdecl = nil;

function sqlite3_busy_timeout;
begin
  if not Assigned(vf_sqlite3_busy_timeout) then vf_sqlite3_busy_timeout := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_busy_timeout');
  Result := vf_sqlite3_busy_timeout(param1, ms);
end;
{$ELSE}
function sqlite3_busy_timeout; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_get_table: function (pDb: Psqlite3; zSql: PAnsiChar; pazResult: PPPAnsiChar; var pnRow: LongInt; var pnColumn: LongInt; 
               pzErrmsg: PPAnsiChar): LongInt; cdecl = nil;

function sqlite3_get_table;
begin
  if not Assigned(vf_sqlite3_get_table) then vf_sqlite3_get_table := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_get_table');
  Result := vf_sqlite3_get_table(pDb, zSql, pazResult, pnRow, pnColumn, pzErrmsg);
end;
{$ELSE}
function sqlite3_get_table; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_free_table: procedure (result: PPAnsiChar); cdecl = nil;

procedure sqlite3_free_table;
begin
  if not Assigned(vf_sqlite3_free_table) then vf_sqlite3_free_table := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_free_table');
  vf_sqlite3_free_table(result);
end;
{$ELSE}
procedure sqlite3_free_table; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_mprintf: function (param1: PAnsiChar; args: PVa_List {array of const}): PAnsiChar; cdecl = nil;

function sqlite3_mprintf;
begin
  if not Assigned(vf_sqlite3_mprintf) then vf_sqlite3_mprintf := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_mprintf');
  Result := vf_sqlite3_mprintf(param1, args);
end;
{$ELSE}
function sqlite3_mprintf; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vmprintf: function (param1: PAnsiChar; param2: Tva_list): PAnsiChar; cdecl = nil;

function sqlite3_vmprintf;
begin
  if not Assigned(vf_sqlite3_vmprintf) then vf_sqlite3_vmprintf := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vmprintf');
  Result := vf_sqlite3_vmprintf(param1, param2);
end;
{$ELSE}
function sqlite3_vmprintf; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_snprintf: function (param1: LongInt; param2: PAnsiChar; param3: PAnsiChar; args: PVa_List {array of const}): PAnsiChar; cdecl = nil;

function sqlite3_snprintf;
begin
  if not Assigned(vf_sqlite3_snprintf) then vf_sqlite3_snprintf := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_snprintf');
  Result := vf_sqlite3_snprintf(param1, param2, param3, args);
end;
{$ELSE}
function sqlite3_snprintf; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vsnprintf: function (param1: LongInt; param2: PAnsiChar; param3: PAnsiChar; param4: Tva_list): PAnsiChar; cdecl = nil;

function sqlite3_vsnprintf;
begin
  if not Assigned(vf_sqlite3_vsnprintf) then vf_sqlite3_vsnprintf := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vsnprintf');
  Result := vf_sqlite3_vsnprintf(param1, param2, param3, param4);
end;
{$ELSE}
function sqlite3_vsnprintf; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_malloc: function (param1: LongInt): Pointer; cdecl = nil;

function sqlite3_malloc;
begin
  if not Assigned(vf_sqlite3_malloc) then vf_sqlite3_malloc := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_malloc');
  Result := vf_sqlite3_malloc(param1);
end;
{$ELSE}
function sqlite3_malloc; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_malloc64: function (param1: Tsqlite3_uint64): Pointer; cdecl = nil;

function sqlite3_malloc64;
begin
  if not Assigned(vf_sqlite3_malloc64) then vf_sqlite3_malloc64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_malloc64');
  Result := vf_sqlite3_malloc64(param1);
end;
{$ELSE}
function sqlite3_malloc64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_realloc: function (param1: Pointer; param2: LongInt): Pointer; cdecl = nil;

function sqlite3_realloc;
begin
  if not Assigned(vf_sqlite3_realloc) then vf_sqlite3_realloc := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_realloc');
  Result := vf_sqlite3_realloc(param1, param2);
end;
{$ELSE}
function sqlite3_realloc; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_realloc64: function (param1: Pointer; param2: Tsqlite3_uint64): Pointer; cdecl = nil;

function sqlite3_realloc64;
begin
  if not Assigned(vf_sqlite3_realloc64) then vf_sqlite3_realloc64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_realloc64');
  Result := vf_sqlite3_realloc64(param1, param2);
end;
{$ELSE}
function sqlite3_realloc64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_free: procedure (param1: Pointer); cdecl = nil;

procedure sqlite3_free;
begin
  if not Assigned(vf_sqlite3_free) then vf_sqlite3_free := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_free');
  vf_sqlite3_free(param1);
end;
{$ELSE}
procedure sqlite3_free; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_msize: function (param1: Pointer): Tsqlite3_uint64; cdecl = nil;

function sqlite3_msize;
begin
  if not Assigned(vf_sqlite3_msize) then vf_sqlite3_msize := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_msize');
  Result := vf_sqlite3_msize(param1);
end;
{$ELSE}
function sqlite3_msize; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_memory_used: function : Tsqlite3_int64; cdecl = nil;

function sqlite3_memory_used;
begin
  if not Assigned(vf_sqlite3_memory_used) then vf_sqlite3_memory_used := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_memory_used');
  Result := vf_sqlite3_memory_used();
end;
{$ELSE}
function sqlite3_memory_used; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_memory_highwater: function (resetFlag: LongInt): Tsqlite3_int64; cdecl = nil;

function sqlite3_memory_highwater;
begin
  if not Assigned(vf_sqlite3_memory_highwater) then vf_sqlite3_memory_highwater := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_memory_highwater');
  Result := vf_sqlite3_memory_highwater(resetFlag);
end;
{$ELSE}
function sqlite3_memory_highwater; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_randomness: procedure (N: LongInt; P: Pointer); cdecl = nil;

procedure sqlite3_randomness;
begin
  if not Assigned(vf_sqlite3_randomness) then vf_sqlite3_randomness := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_randomness');
  vf_sqlite3_randomness(N, P);
end;
{$ELSE}
procedure sqlite3_randomness; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_set_authorizer: function (param1: Psqlite3; xAuth: T_0168C828_XAuth; pUserData: Pointer): LongInt; cdecl = nil;

function sqlite3_set_authorizer;
begin
  if not Assigned(vf_sqlite3_set_authorizer) then vf_sqlite3_set_authorizer := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_set_authorizer');
  Result := vf_sqlite3_set_authorizer(param1, xAuth, pUserData);
end;
{$ELSE}
function sqlite3_set_authorizer; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_trace: function (param1: Psqlite3; xTrace: T_016D0A40_XTrace; param3: Pointer): Pointer; cdecl = nil;

function sqlite3_trace;
begin
  if not Assigned(vf_sqlite3_trace) then vf_sqlite3_trace := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_trace');
  Result := vf_sqlite3_trace(param1, xTrace, param3);
end;
{$ELSE}
function sqlite3_trace; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_profile: function (param1: Psqlite3; xProfile: T_0168C318_XProfile; param3: Pointer): Pointer; cdecl = nil;

function sqlite3_profile;
begin
  if not Assigned(vf_sqlite3_profile) then vf_sqlite3_profile := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_profile');
  Result := vf_sqlite3_profile(param1, xProfile, param3);
end;
{$ELSE}
function sqlite3_profile; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_trace_v2: function (param1: Psqlite3; uMask: DWord; xCallback: T_0168CF78_XCallback; pCtx: Pointer): LongInt; cdecl = nil;

function sqlite3_trace_v2;
begin
  if not Assigned(vf_sqlite3_trace_v2) then vf_sqlite3_trace_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_trace_v2');
  Result := vf_sqlite3_trace_v2(param1, uMask, xCallback, pCtx);
end;
{$ELSE}
function sqlite3_trace_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_progress_handler: procedure (param1: Psqlite3; param2: LongInt; param3: TSQLite3_one_ptr_arg_func; param4: Pointer); cdecl = nil;

procedure sqlite3_progress_handler;
begin
  if not Assigned(vf_sqlite3_progress_handler) then vf_sqlite3_progress_handler := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_progress_handler');
  vf_sqlite3_progress_handler(param1, param2, param3, param4);
end;
{$ELSE}
procedure sqlite3_progress_handler; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_open: function (filename: PAnsiChar; var ppDb: Psqlite3): LongInt; cdecl = nil;

function sqlite3_open;
begin
  if not Assigned(vf_sqlite3_open) then vf_sqlite3_open := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_open');
  Result := vf_sqlite3_open(filename, ppDb);
end;
{$ELSE}
function sqlite3_open; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_open16: function (filename: Pointer; var ppDb: Psqlite3): LongInt; cdecl = nil;

function sqlite3_open16;
begin
  if not Assigned(vf_sqlite3_open16) then vf_sqlite3_open16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_open16');
  Result := vf_sqlite3_open16(filename, ppDb);
end;
{$ELSE}
function sqlite3_open16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_open_v2: function (filename: PAnsiChar; var ppdb: Psqlite3; flags: LongInt; zVfs: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_open_v2;
begin
  if not Assigned(vf_sqlite3_open_v2) then vf_sqlite3_open_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_open_v2');
  Result := vf_sqlite3_open_v2(filename, ppDb, flags, zVfs);
end;
{$ELSE}
function sqlite3_open_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_uri_parameter: function (zFilename: PAnsiChar; zParam: PAnsiChar): PAnsiChar; cdecl = nil;

function sqlite3_uri_parameter;
begin
  if not Assigned(vf_sqlite3_uri_parameter) then vf_sqlite3_uri_parameter := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_uri_parameter');
  Result := vf_sqlite3_uri_parameter(zFilename, zParam);
end;
{$ELSE}
function sqlite3_uri_parameter; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_uri_boolean: function (zFile: PAnsiChar; zParam: PAnsiChar; bDefault: LongInt): LongInt; cdecl = nil;

function sqlite3_uri_boolean;
begin
  if not Assigned(vf_sqlite3_uri_boolean) then vf_sqlite3_uri_boolean := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_uri_boolean');
  Result := vf_sqlite3_uri_boolean(zFile, zParam, bDefault);
end;
{$ELSE}
function sqlite3_uri_boolean; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_uri_int64: function (param1: PAnsiChar; param2: PAnsiChar; param3: Tsqlite3_int64): Tsqlite3_int64; cdecl = nil;

function sqlite3_uri_int64;
begin
  if not Assigned(vf_sqlite3_uri_int64) then vf_sqlite3_uri_int64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_uri_int64');
  Result := vf_sqlite3_uri_int64(param1, param2, param3);
end;
{$ELSE}
function sqlite3_uri_int64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_uri_key: function (zFilename: PAnsiChar; N: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_uri_key;
begin
  if not Assigned(vf_sqlite3_uri_key) then vf_sqlite3_uri_key := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_uri_key');
  Result := vf_sqlite3_uri_key(zFilename, N);
end;
{$ELSE}
function sqlite3_uri_key; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_filename_database: function (param1: PAnsiChar): PAnsiChar; cdecl = nil;

function sqlite3_filename_database;
begin
  if not Assigned(vf_sqlite3_filename_database) then vf_sqlite3_filename_database := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_filename_database');
  Result := vf_sqlite3_filename_database(param1);
end;
{$ELSE}
function sqlite3_filename_database; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_filename_journal: function (param1: PAnsiChar): PAnsiChar; cdecl = nil;

function sqlite3_filename_journal;
begin
  if not Assigned(vf_sqlite3_filename_journal) then vf_sqlite3_filename_journal := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_filename_journal');
  Result := vf_sqlite3_filename_journal(param1);
end;
{$ELSE}
function sqlite3_filename_journal; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_filename_wal: function (param1: PAnsiChar): PAnsiChar; cdecl = nil;

function sqlite3_filename_wal;
begin
  if not Assigned(vf_sqlite3_filename_wal) then vf_sqlite3_filename_wal := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_filename_wal');
  Result := vf_sqlite3_filename_wal(param1);
end;
{$ELSE}
function sqlite3_filename_wal; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_database_file_object: function (param1: PAnsiChar): Psqlite3_file; cdecl = nil;

function sqlite3_database_file_object;
begin
  if not Assigned(vf_sqlite3_database_file_object) then vf_sqlite3_database_file_object := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_database_file_object');
  Result := vf_sqlite3_database_file_object(param1);
end;
{$ELSE}
function sqlite3_database_file_object; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_filename: function (zDatabase: PAnsiChar; zJournal: PAnsiChar; zWal: PAnsiChar; nParam: LongInt; azParam: PPAnsiChar): PAnsiChar; cdecl = nil;

function sqlite3_create_filename;
begin
  if not Assigned(vf_sqlite3_create_filename) then vf_sqlite3_create_filename := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_filename');
  Result := vf_sqlite3_create_filename(zDatabase, zJournal, zWal, nParam, azParam);
end;
{$ELSE}
function sqlite3_create_filename; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_free_filename: procedure (param1: PAnsiChar); cdecl = nil;

procedure sqlite3_free_filename;
begin
  if not Assigned(vf_sqlite3_free_filename) then vf_sqlite3_free_filename := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_free_filename');
  vf_sqlite3_free_filename(param1);
end;
{$ELSE}
procedure sqlite3_free_filename; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_errcode: function (db: Psqlite3): LongInt; cdecl = nil;

function sqlite3_errcode;
begin
  if not Assigned(vf_sqlite3_errcode) then vf_sqlite3_errcode := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_errcode');
  Result := vf_sqlite3_errcode(db);
end;
{$ELSE}
function sqlite3_errcode; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_extended_errcode: function (db: Psqlite3): LongInt; cdecl = nil;

function sqlite3_extended_errcode;
begin
  if not Assigned(vf_sqlite3_extended_errcode) then vf_sqlite3_extended_errcode := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_extended_errcode');
  Result := vf_sqlite3_extended_errcode(db);
end;
{$ELSE}
function sqlite3_extended_errcode; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_errmsg: function (param1: Psqlite3): PAnsiChar; cdecl = nil;

function sqlite3_errmsg;
begin
  if not Assigned(vf_sqlite3_errmsg) then vf_sqlite3_errmsg := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_errmsg');
  Result := vf_sqlite3_errmsg(param1);
end;
{$ELSE}
function sqlite3_errmsg; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_errmsg16: function (param1: Psqlite3): Pointer; cdecl = nil;

function sqlite3_errmsg16;
begin
  if not Assigned(vf_sqlite3_errmsg16) then vf_sqlite3_errmsg16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_errmsg16');
  Result := vf_sqlite3_errmsg16(param1);
end;
{$ELSE}
function sqlite3_errmsg16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_errstr: function (param1: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_errstr;
begin
  if not Assigned(vf_sqlite3_errstr) then vf_sqlite3_errstr := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_errstr');
  Result := vf_sqlite3_errstr(param1);
end;
{$ELSE}
function sqlite3_errstr; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_limit: function (param1: Psqlite3; id: LongInt; newVal: LongInt): LongInt; cdecl = nil;

function sqlite3_limit;
begin
  if not Assigned(vf_sqlite3_limit) then vf_sqlite3_limit := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_limit');
  Result := vf_sqlite3_limit(param1, id, newVal);
end;
{$ELSE}
function sqlite3_limit; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_prepare: function (pDb: Psqlite3; zSql: PAnsiChar; nByte: LongInt; var ppStmt: Psqlite3_stmt; pzTail: PPAnsiChar): LongInt; cdecl = nil;

function sqlite3_prepare;
begin
  if not Assigned(vf_sqlite3_prepare) then vf_sqlite3_prepare := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_prepare');
  Result := vf_sqlite3_prepare(pDb, zSql, nByte, ppStmt, pzTail);
end;
{$ELSE}
function sqlite3_prepare; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_prepare_v2: function (pDb: Psqlite3; zSql: PAnsiChar; nByte: LongInt; var ppStmt: Psqlite3_stmt; pzTail: PPAnsiChar): LongInt; cdecl = nil;

function sqlite3_prepare_v2;
begin
  if not Assigned(vf_sqlite3_prepare_v2) then vf_sqlite3_prepare_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_prepare_v2');
  Result := vf_sqlite3_prepare_v2(pDb, zSql, nByte, ppStmt, pzTail);
end;
{$ELSE}
function sqlite3_prepare_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_prepare_v3: function (pDb: Psqlite3; zSql: PAnsiChar; nByte: LongInt; prepFlags: DWord; var ppStmt: Psqlite3_stmt; 
               pzTail: PPAnsiChar): LongInt; cdecl = nil;

function sqlite3_prepare_v3;
begin
  if not Assigned(vf_sqlite3_prepare_v3) then vf_sqlite3_prepare_v3 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_prepare_v3');
  Result := vf_sqlite3_prepare_v3(pDb, zSql, nByte, prepFlags, ppStmt, pzTail);
end;
{$ELSE}
function sqlite3_prepare_v3; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_prepare16: function (pDb: Psqlite3; zSql: PWideChar; nByte: LongInt; var ppStmt: Psqlite3_stmt; pzTail: PPWideChar): LongInt; cdecl = nil;

function sqlite3_prepare16;
begin
  if not Assigned(vf_sqlite3_prepare16) then vf_sqlite3_prepare16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_prepare16');
  Result := vf_sqlite3_prepare16(pDb, zSql, nByte, ppStmt, pzTail);
end;
{$ELSE}
function sqlite3_prepare16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_prepare16_v2: function (pDb: Psqlite3; zSql: PWideChar; nByte: LongInt; var ppStmt: Psqlite3_stmt; pzTail: PPWideChar): LongInt; cdecl = nil;

function sqlite3_prepare16_v2;
begin
  if not Assigned(vf_sqlite3_prepare16_v2) then vf_sqlite3_prepare16_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_prepare16_v2');
  Result := vf_sqlite3_prepare16_v2(pDb, zSql, nByte, ppStmt, pzTail);
end;
{$ELSE}
function sqlite3_prepare16_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_prepare16_v3: function (pDb: Psqlite3; zSql: PWideChar; nByte: LongInt; prepFlags: DWord; var ppStmt: Psqlite3_stmt;
               pzTail: PPWideChar): LongInt; cdecl = nil;

function sqlite3_prepare16_v3;
begin
  if not Assigned(vf_sqlite3_prepare16_v3) then vf_sqlite3_prepare16_v3 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_prepare16_v3');
  Result := vf_sqlite3_prepare16_v3(pDb, zSql, nByte, prepFlags, ppStmt, pzTail);
end;
{$ELSE}
function sqlite3_prepare16_v3; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_sql: function (pStmt: Psqlite3_stmt): PAnsiChar; cdecl = nil;

function sqlite3_sql;
begin
  if not Assigned(vf_sqlite3_sql) then vf_sqlite3_sql := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_sql');
  Result := vf_sqlite3_sql(pStmt);
end;
{$ELSE}
function sqlite3_sql; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_expanded_sql: function (pStmt: Psqlite3_stmt): PAnsiChar; cdecl = nil;

function sqlite3_expanded_sql;
begin
  if not Assigned(vf_sqlite3_expanded_sql) then vf_sqlite3_expanded_sql := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_expanded_sql');
  Result := vf_sqlite3_expanded_sql(pStmt);
end;
{$ELSE}
function sqlite3_expanded_sql; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_normalized_sql: function (pStmt: Psqlite3_stmt): PAnsiChar; cdecl = nil;

function sqlite3_normalized_sql;
begin
  if not Assigned(vf_sqlite3_normalized_sql) then vf_sqlite3_normalized_sql := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_normalized_sql');
  Result := vf_sqlite3_normalized_sql(pStmt);
end;
{$ELSE}
function sqlite3_normalized_sql; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_stmt_readonly: function (pStmt: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_stmt_readonly;
begin
  if not Assigned(vf_sqlite3_stmt_readonly) then vf_sqlite3_stmt_readonly := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_stmt_readonly');
  Result := vf_sqlite3_stmt_readonly(pStmt);
end;
{$ELSE}
function sqlite3_stmt_readonly; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_stmt_isexplain: function (pStmt: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_stmt_isexplain;
begin
  if not Assigned(vf_sqlite3_stmt_isexplain) then vf_sqlite3_stmt_isexplain := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_stmt_isexplain');
  Result := vf_sqlite3_stmt_isexplain(pStmt);
end;
{$ELSE}
function sqlite3_stmt_isexplain; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_stmt_busy: function (param1: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_stmt_busy;
begin
  if not Assigned(vf_sqlite3_stmt_busy) then vf_sqlite3_stmt_busy := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_stmt_busy');
  Result := vf_sqlite3_stmt_busy(param1);
end;
{$ELSE}
function sqlite3_stmt_busy; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_blob: function (param1: Psqlite3_stmt; param2: LongInt; param3: Pointer; n: LongInt; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_bind_blob;
begin
  if not Assigned(vf_sqlite3_bind_blob) then vf_sqlite3_bind_blob := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_blob');
  Result := vf_sqlite3_bind_blob(param1, param2, param3, n, param5);
end;
{$ELSE}
function sqlite3_bind_blob; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_blob64: function (param1: Psqlite3_stmt; param2: LongInt; param3: Pointer; param4: Tsqlite3_uint64; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_bind_blob64;
begin
  if not Assigned(vf_sqlite3_bind_blob64) then vf_sqlite3_bind_blob64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_blob64');
  Result := vf_sqlite3_bind_blob64(param1, param2, param3, param4, param5);
end;
{$ELSE}
function sqlite3_bind_blob64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_double: function (param1: Psqlite3_stmt; param2: LongInt; param3: Double): LongInt; cdecl = nil;

function sqlite3_bind_double;
begin
  if not Assigned(vf_sqlite3_bind_double) then vf_sqlite3_bind_double := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_double');
  Result := vf_sqlite3_bind_double(param1, param2, param3);
end;
{$ELSE}
function sqlite3_bind_double; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_int: function (param1: Psqlite3_stmt; param2: LongInt; param3: LongInt): LongInt; cdecl = nil;

function sqlite3_bind_int;
begin
  if not Assigned(vf_sqlite3_bind_int) then vf_sqlite3_bind_int := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_int');
  Result := vf_sqlite3_bind_int(param1, param2, param3);
end;
{$ELSE}
function sqlite3_bind_int; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_int64: function (param1: Psqlite3_stmt; param2: LongInt; param3: Tsqlite3_int64): LongInt; cdecl = nil;

function sqlite3_bind_int64;
begin
  if not Assigned(vf_sqlite3_bind_int64) then vf_sqlite3_bind_int64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_int64');
  Result := vf_sqlite3_bind_int64(param1, param2, param3);
end;
{$ELSE}
function sqlite3_bind_int64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_null: function (param1: Psqlite3_stmt; param2: LongInt): LongInt; cdecl = nil;

function sqlite3_bind_null;
begin
  if not Assigned(vf_sqlite3_bind_null) then vf_sqlite3_bind_null := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_null');
  Result := vf_sqlite3_bind_null(param1, param2);
end;
{$ELSE}
function sqlite3_bind_null; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_text: function (param1: Psqlite3_stmt; param2: LongInt; param3: PAnsiChar; param4: LongInt; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_bind_text;
begin
  if not Assigned(vf_sqlite3_bind_text) then vf_sqlite3_bind_text := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_text');
  Result := vf_sqlite3_bind_text(param1, param2, param3, param4, param5);
end;
{$ELSE}
function sqlite3_bind_text; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_text16: function (param1: Psqlite3_stmt; param2: LongInt; param3: Pointer; param4: LongInt; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_bind_text16;
begin
  if not Assigned(vf_sqlite3_bind_text16) then vf_sqlite3_bind_text16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_text16');
  Result := vf_sqlite3_bind_text16(param1, param2, param3, param4, param5);
end;
{$ELSE}
function sqlite3_bind_text16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_text64: function (param1: Psqlite3_stmt; param2: LongInt; param3: PAnsiChar; param4: Tsqlite3_uint64; param5: TSQLite3_one_ptr_arg_proc;
               encoding: Byte): LongInt; cdecl = nil;

function sqlite3_bind_text64;
begin
  if not Assigned(vf_sqlite3_bind_text64) then vf_sqlite3_bind_text64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_text64');
  Result := vf_sqlite3_bind_text64(param1, param2, param3, param4, param5, encoding);
end;
{$ELSE}
function sqlite3_bind_text64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_value: function (param1: Psqlite3_stmt; param2: LongInt; param3: Psqlite3_value): LongInt; cdecl = nil;

function sqlite3_bind_value;
begin
  if not Assigned(vf_sqlite3_bind_value) then vf_sqlite3_bind_value := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_value');
  Result := vf_sqlite3_bind_value(param1, param2, param3);
end;
{$ELSE}
function sqlite3_bind_value; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_pointer: function (param1: Psqlite3_stmt; param2: LongInt; param3: Pointer; param4: PAnsiChar; param5: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_bind_pointer;
begin
  if not Assigned(vf_sqlite3_bind_pointer) then vf_sqlite3_bind_pointer := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_pointer');
  Result := vf_sqlite3_bind_pointer(param1, param2, param3, param4, param5);
end;
{$ELSE}
function sqlite3_bind_pointer; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_zeroblob: function (param1: Psqlite3_stmt; param2: LongInt; n: LongInt): LongInt; cdecl = nil;

function sqlite3_bind_zeroblob;
begin
  if not Assigned(vf_sqlite3_bind_zeroblob) then vf_sqlite3_bind_zeroblob := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_zeroblob');
  Result := vf_sqlite3_bind_zeroblob(param1, param2, n);
end;
{$ELSE}
function sqlite3_bind_zeroblob; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_zeroblob64: function (param1: Psqlite3_stmt; param2: LongInt; param3: Tsqlite3_uint64): LongInt; cdecl = nil;

function sqlite3_bind_zeroblob64;
begin
  if not Assigned(vf_sqlite3_bind_zeroblob64) then vf_sqlite3_bind_zeroblob64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_zeroblob64');
  Result := vf_sqlite3_bind_zeroblob64(param1, param2, param3);
end;
{$ELSE}
function sqlite3_bind_zeroblob64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_parameter_count: function (param1: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_bind_parameter_count;
begin
  if not Assigned(vf_sqlite3_bind_parameter_count) then vf_sqlite3_bind_parameter_count := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_parameter_count');
  Result := vf_sqlite3_bind_parameter_count(param1);
end;
{$ELSE}
function sqlite3_bind_parameter_count; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_parameter_name: function (param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_bind_parameter_name;
begin
  if not Assigned(vf_sqlite3_bind_parameter_name) then vf_sqlite3_bind_parameter_name := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_parameter_name');
  Result := vf_sqlite3_bind_parameter_name(param1, param2);
end;
{$ELSE}
function sqlite3_bind_parameter_name; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_bind_parameter_index: function (param1: Psqlite3_stmt; zName: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_bind_parameter_index;
begin
  if not Assigned(vf_sqlite3_bind_parameter_index) then vf_sqlite3_bind_parameter_index := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_bind_parameter_index');
  Result := vf_sqlite3_bind_parameter_index(param1, zName);
end;
{$ELSE}
function sqlite3_bind_parameter_index; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_clear_bindings: function (param1: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_clear_bindings;
begin
  if not Assigned(vf_sqlite3_clear_bindings) then vf_sqlite3_clear_bindings := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_clear_bindings');
  Result := vf_sqlite3_clear_bindings(param1);
end;
{$ELSE}
function sqlite3_clear_bindings; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_count: function (pStmt: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_column_count;
begin
  if not Assigned(vf_sqlite3_column_count) then vf_sqlite3_column_count := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_count');
  Result := vf_sqlite3_column_count(pStmt);
end;
{$ELSE}
function sqlite3_column_count; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_name: function (param1: Psqlite3_stmt; N: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_column_name;
begin
  if not Assigned(vf_sqlite3_column_name) then vf_sqlite3_column_name := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_name');
  Result := vf_sqlite3_column_name(param1, N);
end;
{$ELSE}
function sqlite3_column_name; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_name16: function (param1: Psqlite3_stmt; N: LongInt): Pointer; cdecl = nil;

function sqlite3_column_name16;
begin
  if not Assigned(vf_sqlite3_column_name16) then vf_sqlite3_column_name16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_name16');
  Result := vf_sqlite3_column_name16(param1, N);
end;
{$ELSE}
function sqlite3_column_name16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_database_name: function (param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_column_database_name;
begin
  if not Assigned(vf_sqlite3_column_database_name) then vf_sqlite3_column_database_name := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_database_name');
  Result := vf_sqlite3_column_database_name(param1, param2);
end;
{$ELSE}
function sqlite3_column_database_name; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_database_name16: function (param1: Psqlite3_stmt; param2: LongInt): Pointer; cdecl = nil;

function sqlite3_column_database_name16;
begin
  if not Assigned(vf_sqlite3_column_database_name16) then vf_sqlite3_column_database_name16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_database_name16');
  Result := vf_sqlite3_column_database_name16(param1, param2);
end;
{$ELSE}
function sqlite3_column_database_name16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_table_name: function (param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_column_table_name;
begin
  if not Assigned(vf_sqlite3_column_table_name) then vf_sqlite3_column_table_name := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_table_name');
  Result := vf_sqlite3_column_table_name(param1, param2);
end;
{$ELSE}
function sqlite3_column_table_name; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_table_name16: function (param1: Psqlite3_stmt; param2: LongInt): Pointer; cdecl = nil;

function sqlite3_column_table_name16;
begin
  if not Assigned(vf_sqlite3_column_table_name16) then vf_sqlite3_column_table_name16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_table_name16');
  Result := vf_sqlite3_column_table_name16(param1, param2);
end;
{$ELSE}
function sqlite3_column_table_name16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_origin_name: function (param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_column_origin_name;
begin
  if not Assigned(vf_sqlite3_column_origin_name) then vf_sqlite3_column_origin_name := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_origin_name');
  Result := vf_sqlite3_column_origin_name(param1, param2);
end;
{$ELSE}
function sqlite3_column_origin_name; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_origin_name16: function (param1: Psqlite3_stmt; param2: LongInt): Pointer; cdecl = nil;

function sqlite3_column_origin_name16;
begin
  if not Assigned(vf_sqlite3_column_origin_name16) then vf_sqlite3_column_origin_name16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_origin_name16');
  Result := vf_sqlite3_column_origin_name16(param1, param2);
end;
{$ELSE}
function sqlite3_column_origin_name16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_decltype: function (param1: Psqlite3_stmt; param2: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_column_decltype;
begin
  if not Assigned(vf_sqlite3_column_decltype) then vf_sqlite3_column_decltype := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_decltype');
  Result := vf_sqlite3_column_decltype(param1, param2);
end;
{$ELSE}
function sqlite3_column_decltype; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_decltype16: function (param1: Psqlite3_stmt; param2: LongInt): Pointer; cdecl = nil;

function sqlite3_column_decltype16;
begin
  if not Assigned(vf_sqlite3_column_decltype16) then vf_sqlite3_column_decltype16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_decltype16');
  Result := vf_sqlite3_column_decltype16(param1, param2);
end;
{$ELSE}
function sqlite3_column_decltype16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_step: function (param1: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_step;
begin
  if not Assigned(vf_sqlite3_step) then vf_sqlite3_step := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_step');
  Result := vf_sqlite3_step(param1);
end;
{$ELSE}
function sqlite3_step; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_data_count: function (pStmt: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_data_count;
begin
  if not Assigned(vf_sqlite3_data_count) then vf_sqlite3_data_count := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_data_count');
  Result := vf_sqlite3_data_count(pStmt);
end;
{$ELSE}
function sqlite3_data_count; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_blob: function (param1: Psqlite3_stmt; iCol: LongInt): Pointer; cdecl = nil;

function sqlite3_column_blob;
begin
  if not Assigned(vf_sqlite3_column_blob) then vf_sqlite3_column_blob := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_blob');
  Result := vf_sqlite3_column_blob(param1, iCol);
end;
{$ELSE}
function sqlite3_column_blob; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_double: function (param1: Psqlite3_stmt; iCol: LongInt): Double; cdecl = nil;

function sqlite3_column_double;
begin
  if not Assigned(vf_sqlite3_column_double) then vf_sqlite3_column_double := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_double');
  Result := vf_sqlite3_column_double(param1, iCol);
end;
{$ELSE}
function sqlite3_column_double; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_int: function (param1: Psqlite3_stmt; iCol: LongInt): LongInt; cdecl = nil;

function sqlite3_column_int;
begin
  if not Assigned(vf_sqlite3_column_int) then vf_sqlite3_column_int := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_int');
  Result := vf_sqlite3_column_int(param1, iCol);
end;
{$ELSE}
function sqlite3_column_int; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_int64: function (param1: Psqlite3_stmt; iCol: LongInt): Tsqlite3_int64; cdecl = nil;

function sqlite3_column_int64;
begin
  if not Assigned(vf_sqlite3_column_int64) then vf_sqlite3_column_int64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_int64');
  Result := vf_sqlite3_column_int64(param1, iCol);
end;
{$ELSE}
function sqlite3_column_int64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_text: function (param1: Psqlite3_stmt; iCol: LongInt): PByte; cdecl = nil;

function sqlite3_column_text;
begin
  if not Assigned(vf_sqlite3_column_text) then vf_sqlite3_column_text := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_text');
  Result := vf_sqlite3_column_text(param1, iCol);
end;
{$ELSE}
function sqlite3_column_text; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_text16: function (param1: Psqlite3_stmt; iCol: LongInt): Pointer; cdecl = nil;

function sqlite3_column_text16;
begin
  if not Assigned(vf_sqlite3_column_text16) then vf_sqlite3_column_text16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_text16');
  Result := vf_sqlite3_column_text16(param1, iCol);
end;
{$ELSE}
function sqlite3_column_text16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_value: function (param1: Psqlite3_stmt; iCol: LongInt): Psqlite3_value; cdecl = nil;

function sqlite3_column_value;
begin
  if not Assigned(vf_sqlite3_column_value) then vf_sqlite3_column_value := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_value');
  Result := vf_sqlite3_column_value(param1, iCol);
end;
{$ELSE}
function sqlite3_column_value; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_bytes: function (param1: Psqlite3_stmt; iCol: LongInt): LongInt; cdecl = nil;

function sqlite3_column_bytes;
begin
  if not Assigned(vf_sqlite3_column_bytes) then vf_sqlite3_column_bytes := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_bytes');
  Result := vf_sqlite3_column_bytes(param1, iCol);
end;
{$ELSE}
function sqlite3_column_bytes; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_bytes16: function (param1: Psqlite3_stmt; iCol: LongInt): LongInt; cdecl = nil;

function sqlite3_column_bytes16;
begin
  if not Assigned(vf_sqlite3_column_bytes16) then vf_sqlite3_column_bytes16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_bytes16');
  Result := vf_sqlite3_column_bytes16(param1, iCol);
end;
{$ELSE}
function sqlite3_column_bytes16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_column_type: function (param1: Psqlite3_stmt; iCol: LongInt): LongInt; cdecl = nil;

function sqlite3_column_type;
begin
  if not Assigned(vf_sqlite3_column_type) then vf_sqlite3_column_type := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_column_type');
  Result := vf_sqlite3_column_type(param1, iCol);
end;
{$ELSE}
function sqlite3_column_type; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_finalize: function (pStmt: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_finalize;
begin
  if not Assigned(vf_sqlite3_finalize) then vf_sqlite3_finalize := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_finalize');
  Result := vf_sqlite3_finalize(pStmt);
end;
{$ELSE}
function sqlite3_finalize; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_reset: function (pStmt: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_reset;
begin
  if not Assigned(vf_sqlite3_reset) then vf_sqlite3_reset := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_reset');
  Result := vf_sqlite3_reset(pStmt);
end;
{$ELSE}
function sqlite3_reset; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_function: function (pDb: Psqlite3; zFunctionName: PAnsiChar; nArg: LongInt; eTextRep: LongInt; pApp: Pointer; 
               xFunc: TSQLite3ContextValueProc; xStep: TSQLite3ContextValueProc; xFinal: TSQLite3ContextProc): LongInt; cdecl = nil;

function sqlite3_create_function;
begin
  if not Assigned(vf_sqlite3_create_function) then vf_sqlite3_create_function := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_function');
  Result := vf_sqlite3_create_function(pDb, zFunctionName, nArg, eTextRep, pApp, xFunc, xStep, xFinal);
end;
{$ELSE}
function sqlite3_create_function; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_function16: function (pDb: Psqlite3; zFunctionName: Pointer; nArg: LongInt; eTextRep: LongInt; pApp: Pointer; 
               xFunc: TSQLite3ContextValueProc; xStep: TSQLite3ContextValueProc; xFinal: TSQLite3ContextProc): LongInt; cdecl = nil;

function sqlite3_create_function16;
begin
  if not Assigned(vf_sqlite3_create_function16) then vf_sqlite3_create_function16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_function16');
  Result := vf_sqlite3_create_function16(pDb, zFunctionName, nArg, eTextRep, pApp, xFunc, xStep, xFinal);
end;
{$ELSE}
function sqlite3_create_function16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_function_v2: function (pDb: Psqlite3; zFunctionName: PAnsiChar; nArg: LongInt; eTextRep: LongInt; pApp: Pointer; 
               xFunc: TSQLite3ContextValueProc; xStep: TSQLite3ContextValueProc; xFinal: TSQLite3ContextProc; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_create_function_v2;
begin
  if not Assigned(vf_sqlite3_create_function_v2) then vf_sqlite3_create_function_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_function_v2');
  Result := vf_sqlite3_create_function_v2(pDb, zFunctionName, nArg, eTextRep, pApp, xFunc, xStep, xFinal, xDestroy);
end;
{$ELSE}
function sqlite3_create_function_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_window_function: function (pDb: Psqlite3; zFunctionName: PAnsiChar; nArg: LongInt; eTextRep: LongInt; pApp: Pointer; 
               xStep: TSQLite3ContextValueProc; xFinal: TSQLite3ContextProc; xValue: TSQLite3ContextProc; xInverse: TSQLite3ContextValueProc; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_create_window_function;
begin
  if not Assigned(vf_sqlite3_create_window_function) then vf_sqlite3_create_window_function := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_window_function');
  Result := vf_sqlite3_create_window_function(pDb, zFunctionName, nArg, eTextRep, pApp, xStep, xFinal, xValue, xInverse, xDestroy);
end;
{$ELSE}
function sqlite3_create_window_function; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_aggregate_count: function (param1: Psqlite3_context): LongInt; cdecl = nil;

function sqlite3_aggregate_count;
begin
  if not Assigned(vf_sqlite3_aggregate_count) then vf_sqlite3_aggregate_count := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_aggregate_count');
  Result := vf_sqlite3_aggregate_count(param1);
end;
{$ELSE}
function sqlite3_aggregate_count; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_expired: function (param1: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_expired;
begin
  if not Assigned(vf_sqlite3_expired) then vf_sqlite3_expired := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_expired');
  Result := vf_sqlite3_expired(param1);
end;
{$ELSE}
function sqlite3_expired; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_transfer_bindings: function (param1: Psqlite3_stmt; param2: Psqlite3_stmt): LongInt; cdecl = nil;

function sqlite3_transfer_bindings;
begin
  if not Assigned(vf_sqlite3_transfer_bindings) then vf_sqlite3_transfer_bindings := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_transfer_bindings');
  Result := vf_sqlite3_transfer_bindings(param1, param2);
end;
{$ELSE}
function sqlite3_transfer_bindings; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_global_recover: function : LongInt; cdecl = nil;

function sqlite3_global_recover;
begin
  if not Assigned(vf_sqlite3_global_recover) then vf_sqlite3_global_recover := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_global_recover');
  Result := vf_sqlite3_global_recover();
end;
{$ELSE}
function sqlite3_global_recover; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_thread_cleanup: procedure ; cdecl = nil;

procedure sqlite3_thread_cleanup;
begin
  if not Assigned(vf_sqlite3_thread_cleanup) then vf_sqlite3_thread_cleanup := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_thread_cleanup');
  vf_sqlite3_thread_cleanup();
end;
{$ELSE}
procedure sqlite3_thread_cleanup; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_memory_alarm: function (param1: T_0168D488_Param1; param2: Pointer; param3: Tsqlite3_int64): LongInt; cdecl = nil;

function sqlite3_memory_alarm;
begin
  if not Assigned(vf_sqlite3_memory_alarm) then vf_sqlite3_memory_alarm := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_memory_alarm');
  Result := vf_sqlite3_memory_alarm(param1, param2, param3);
end;
{$ELSE}
function sqlite3_memory_alarm; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_blob: function (param1: Psqlite3_value): Pointer; cdecl = nil;

function sqlite3_value_blob;
begin
  if not Assigned(vf_sqlite3_value_blob) then vf_sqlite3_value_blob := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_blob');
  Result := vf_sqlite3_value_blob(param1);
end;
{$ELSE}
function sqlite3_value_blob; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_double: function (param1: Psqlite3_value): Double; cdecl = nil;

function sqlite3_value_double;
begin
  if not Assigned(vf_sqlite3_value_double) then vf_sqlite3_value_double := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_double');
  Result := vf_sqlite3_value_double(param1);
end;
{$ELSE}
function sqlite3_value_double; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_int: function (param1: Psqlite3_value): LongInt; cdecl = nil;

function sqlite3_value_int;
begin
  if not Assigned(vf_sqlite3_value_int) then vf_sqlite3_value_int := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_int');
  Result := vf_sqlite3_value_int(param1);
end;
{$ELSE}
function sqlite3_value_int; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_int64: function (param1: Psqlite3_value): Tsqlite3_int64; cdecl = nil;

function sqlite3_value_int64;
begin
  if not Assigned(vf_sqlite3_value_int64) then vf_sqlite3_value_int64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_int64');
  Result := vf_sqlite3_value_int64(param1);
end;
{$ELSE}
function sqlite3_value_int64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_pointer: function (param1: Psqlite3_value; param2: PAnsiChar): Pointer; cdecl = nil;

function sqlite3_value_pointer;
begin
  if not Assigned(vf_sqlite3_value_pointer) then vf_sqlite3_value_pointer := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_pointer');
  Result := vf_sqlite3_value_pointer(param1, param2);
end;
{$ELSE}
function sqlite3_value_pointer; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_text: function (param1: Psqlite3_value): PByte; cdecl = nil;

function sqlite3_value_text;
begin
  if not Assigned(vf_sqlite3_value_text) then vf_sqlite3_value_text := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_text');
  Result := vf_sqlite3_value_text(param1);
end;
{$ELSE}
function sqlite3_value_text; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_text16: function (param1: Psqlite3_value): Pointer; cdecl = nil;

function sqlite3_value_text16;
begin
  if not Assigned(vf_sqlite3_value_text16) then vf_sqlite3_value_text16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_text16');
  Result := vf_sqlite3_value_text16(param1);
end;
{$ELSE}
function sqlite3_value_text16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_text16le: function (param1: Psqlite3_value): Pointer; cdecl = nil;

function sqlite3_value_text16le;
begin
  if not Assigned(vf_sqlite3_value_text16le) then vf_sqlite3_value_text16le := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_text16le');
  Result := vf_sqlite3_value_text16le(param1);
end;
{$ELSE}
function sqlite3_value_text16le; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_text16be: function (param1: Psqlite3_value): Pointer; cdecl = nil;

function sqlite3_value_text16be;
begin
  if not Assigned(vf_sqlite3_value_text16be) then vf_sqlite3_value_text16be := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_text16be');
  Result := vf_sqlite3_value_text16be(param1);
end;
{$ELSE}
function sqlite3_value_text16be; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_bytes: function (param1: Psqlite3_value): LongInt; cdecl = nil;

function sqlite3_value_bytes;
begin
  if not Assigned(vf_sqlite3_value_bytes) then vf_sqlite3_value_bytes := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_bytes');
  Result := vf_sqlite3_value_bytes(param1);
end;
{$ELSE}
function sqlite3_value_bytes; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_bytes16: function (param1: Psqlite3_value): LongInt; cdecl = nil;

function sqlite3_value_bytes16;
begin
  if not Assigned(vf_sqlite3_value_bytes16) then vf_sqlite3_value_bytes16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_bytes16');
  Result := vf_sqlite3_value_bytes16(param1);
end;
{$ELSE}
function sqlite3_value_bytes16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_type: function (param1: Psqlite3_value): LongInt; cdecl = nil;

function sqlite3_value_type;
begin
  if not Assigned(vf_sqlite3_value_type) then vf_sqlite3_value_type := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_type');
  Result := vf_sqlite3_value_type(param1);
end;
{$ELSE}
function sqlite3_value_type; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_numeric_type: function (param1: Psqlite3_value): LongInt; cdecl = nil;

function sqlite3_value_numeric_type;
begin
  if not Assigned(vf_sqlite3_value_numeric_type) then vf_sqlite3_value_numeric_type := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_numeric_type');
  Result := vf_sqlite3_value_numeric_type(param1);
end;
{$ELSE}
function sqlite3_value_numeric_type; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_nochange: function (param1: Psqlite3_value): LongInt; cdecl = nil;

function sqlite3_value_nochange;
begin
  if not Assigned(vf_sqlite3_value_nochange) then vf_sqlite3_value_nochange := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_nochange');
  Result := vf_sqlite3_value_nochange(param1);
end;
{$ELSE}
function sqlite3_value_nochange; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_frombind: function (param1: Psqlite3_value): LongInt; cdecl = nil;

function sqlite3_value_frombind;
begin
  if not Assigned(vf_sqlite3_value_frombind) then vf_sqlite3_value_frombind := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_frombind');
  Result := vf_sqlite3_value_frombind(param1);
end;
{$ELSE}
function sqlite3_value_frombind; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_subtype: function (param1: Psqlite3_value): DWord; cdecl = nil;

function sqlite3_value_subtype;
begin
  if not Assigned(vf_sqlite3_value_subtype) then vf_sqlite3_value_subtype := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_subtype');
  Result := vf_sqlite3_value_subtype(param1);
end;
{$ELSE}
function sqlite3_value_subtype; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_dup: function (param1: Psqlite3_value): Psqlite3_value; cdecl = nil;

function sqlite3_value_dup;
begin
  if not Assigned(vf_sqlite3_value_dup) then vf_sqlite3_value_dup := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_dup');
  Result := vf_sqlite3_value_dup(param1);
end;
{$ELSE}
function sqlite3_value_dup; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_value_free: procedure (param1: Psqlite3_value); cdecl = nil;

procedure sqlite3_value_free;
begin
  if not Assigned(vf_sqlite3_value_free) then vf_sqlite3_value_free := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_value_free');
  vf_sqlite3_value_free(param1);
end;
{$ELSE}
procedure sqlite3_value_free; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_aggregate_context: function (param1: Psqlite3_context; nBytes: LongInt): Pointer; cdecl = nil;

function sqlite3_aggregate_context;
begin
  if not Assigned(vf_sqlite3_aggregate_context) then vf_sqlite3_aggregate_context := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_aggregate_context');
  Result := vf_sqlite3_aggregate_context(param1, nBytes);
end;
{$ELSE}
function sqlite3_aggregate_context; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_user_data: function (param1: Psqlite3_context): Pointer; cdecl = nil;

function sqlite3_user_data;
begin
  if not Assigned(vf_sqlite3_user_data) then vf_sqlite3_user_data := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_user_data');
  Result := vf_sqlite3_user_data(param1);
end;
{$ELSE}
function sqlite3_user_data; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_context_db_handle: function (param1: Psqlite3_context): Psqlite3; cdecl = nil;

function sqlite3_context_db_handle;
begin
  if not Assigned(vf_sqlite3_context_db_handle) then vf_sqlite3_context_db_handle := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_context_db_handle');
  Result := vf_sqlite3_context_db_handle(param1);
end;
{$ELSE}
function sqlite3_context_db_handle; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_get_auxdata: function (param1: Psqlite3_context; N: LongInt): Pointer; cdecl = nil;

function sqlite3_get_auxdata;
begin
  if not Assigned(vf_sqlite3_get_auxdata) then vf_sqlite3_get_auxdata := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_get_auxdata');
  Result := vf_sqlite3_get_auxdata(param1, N);
end;
{$ELSE}
function sqlite3_get_auxdata; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_set_auxdata: procedure (param1: Psqlite3_context; N: LongInt; param3: Pointer; param4: TSQLite3_one_ptr_arg_proc); cdecl = nil;

procedure sqlite3_set_auxdata;
begin
  if not Assigned(vf_sqlite3_set_auxdata) then vf_sqlite3_set_auxdata := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_set_auxdata');
  vf_sqlite3_set_auxdata(param1, N, param3, param4);
end;
{$ELSE}
procedure sqlite3_set_auxdata; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_blob: procedure (param1: Psqlite3_context; param2: Pointer; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl = nil;

procedure sqlite3_result_blob;
begin
  if not Assigned(vf_sqlite3_result_blob) then vf_sqlite3_result_blob := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_blob');
  vf_sqlite3_result_blob(param1, param2, param3, param4);
end;
{$ELSE}
procedure sqlite3_result_blob; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_blob64: procedure (param1: Psqlite3_context; param2: Pointer; param3: Tsqlite3_uint64; param4: TSQLite3_one_ptr_arg_proc); cdecl = nil;

procedure sqlite3_result_blob64;
begin
  if not Assigned(vf_sqlite3_result_blob64) then vf_sqlite3_result_blob64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_blob64');
  vf_sqlite3_result_blob64(param1, param2, param3, param4);
end;
{$ELSE}
procedure sqlite3_result_blob64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_double: procedure (param1: Psqlite3_context; param2: Double); cdecl = nil;

procedure sqlite3_result_double;
begin
  if not Assigned(vf_sqlite3_result_double) then vf_sqlite3_result_double := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_double');
  vf_sqlite3_result_double(param1, param2);
end;
{$ELSE}
procedure sqlite3_result_double; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_error: procedure (param1: Psqlite3_context; param2: PAnsiChar; param3: LongInt); cdecl = nil;

procedure sqlite3_result_error;
begin
  if not Assigned(vf_sqlite3_result_error) then vf_sqlite3_result_error := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_error');
  vf_sqlite3_result_error(param1, param2, param3);
end;
{$ELSE}
procedure sqlite3_result_error; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_error16: procedure (param1: Psqlite3_context; param2: Pointer; param3: LongInt); cdecl = nil;

procedure sqlite3_result_error16;
begin
  if not Assigned(vf_sqlite3_result_error16) then vf_sqlite3_result_error16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_error16');
  vf_sqlite3_result_error16(param1, param2, param3);
end;
{$ELSE}
procedure sqlite3_result_error16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_error_toobig: procedure (param1: Psqlite3_context); cdecl = nil;

procedure sqlite3_result_error_toobig;
begin
  if not Assigned(vf_sqlite3_result_error_toobig) then vf_sqlite3_result_error_toobig := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_error_toobig');
  vf_sqlite3_result_error_toobig(param1);
end;
{$ELSE}
procedure sqlite3_result_error_toobig; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_error_nomem: procedure (param1: Psqlite3_context); cdecl = nil;

procedure sqlite3_result_error_nomem;
begin
  if not Assigned(vf_sqlite3_result_error_nomem) then vf_sqlite3_result_error_nomem := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_error_nomem');
  vf_sqlite3_result_error_nomem(param1);
end;
{$ELSE}
procedure sqlite3_result_error_nomem; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_error_code: procedure (param1: Psqlite3_context; param2: LongInt); cdecl = nil;

procedure sqlite3_result_error_code;
begin
  if not Assigned(vf_sqlite3_result_error_code) then vf_sqlite3_result_error_code := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_error_code');
  vf_sqlite3_result_error_code(param1, param2);
end;
{$ELSE}
procedure sqlite3_result_error_code; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_int: procedure (param1: Psqlite3_context; param2: LongInt); cdecl = nil;

procedure sqlite3_result_int;
begin
  if not Assigned(vf_sqlite3_result_int) then vf_sqlite3_result_int := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_int');
  vf_sqlite3_result_int(param1, param2);
end;
{$ELSE}
procedure sqlite3_result_int; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_int64: procedure (param1: Psqlite3_context; param2: Tsqlite3_int64); cdecl = nil;

procedure sqlite3_result_int64;
begin
  if not Assigned(vf_sqlite3_result_int64) then vf_sqlite3_result_int64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_int64');
  vf_sqlite3_result_int64(param1, param2);
end;
{$ELSE}
procedure sqlite3_result_int64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_null: procedure (param1: Psqlite3_context); cdecl = nil;

procedure sqlite3_result_null;
begin
  if not Assigned(vf_sqlite3_result_null) then vf_sqlite3_result_null := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_null');
  vf_sqlite3_result_null(param1);
end;
{$ELSE}
procedure sqlite3_result_null; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_text: procedure (param1: Psqlite3_context; param2: PAnsiChar; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl = nil;

procedure sqlite3_result_text;
begin
  if not Assigned(vf_sqlite3_result_text) then vf_sqlite3_result_text := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_text');
  vf_sqlite3_result_text(param1, param2, param3, param4);
end;
{$ELSE}
procedure sqlite3_result_text; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_text64: procedure (param1: Psqlite3_context; param2: PAnsiChar; param3: Tsqlite3_uint64; param4: TSQLite3_one_ptr_arg_proc; encoding: Byte); cdecl = nil;

procedure sqlite3_result_text64;
begin
  if not Assigned(vf_sqlite3_result_text64) then vf_sqlite3_result_text64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_text64');
  vf_sqlite3_result_text64(param1, param2, param3, param4, encoding);
end;
{$ELSE}
procedure sqlite3_result_text64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_text16: procedure (param1: Psqlite3_context; param2: Pointer; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl = nil;

procedure sqlite3_result_text16;
begin
  if not Assigned(vf_sqlite3_result_text16) then vf_sqlite3_result_text16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_text16');
  vf_sqlite3_result_text16(param1, param2, param3, param4);
end;
{$ELSE}
procedure sqlite3_result_text16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_text16le: procedure (param1: Psqlite3_context; param2: Pointer; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl = nil;

procedure sqlite3_result_text16le;
begin
  if not Assigned(vf_sqlite3_result_text16le) then vf_sqlite3_result_text16le := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_text16le');
  vf_sqlite3_result_text16le(param1, param2, param3, param4);
end;
{$ELSE}
procedure sqlite3_result_text16le; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_text16be: procedure (param1: Psqlite3_context; param2: Pointer; param3: LongInt; param4: TSQLite3_one_ptr_arg_proc); cdecl = nil;

procedure sqlite3_result_text16be;
begin
  if not Assigned(vf_sqlite3_result_text16be) then vf_sqlite3_result_text16be := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_text16be');
  vf_sqlite3_result_text16be(param1, param2, param3, param4);
end;
{$ELSE}
procedure sqlite3_result_text16be; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_value: procedure (param1: Psqlite3_context; param2: Psqlite3_value); cdecl = nil;

procedure sqlite3_result_value;
begin
  if not Assigned(vf_sqlite3_result_value) then vf_sqlite3_result_value := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_value');
  vf_sqlite3_result_value(param1, param2);
end;
{$ELSE}
procedure sqlite3_result_value; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_pointer: procedure (param1: Psqlite3_context; param2: Pointer; param3: PAnsiChar; param4: TSQLite3_one_ptr_arg_proc); cdecl = nil;

procedure sqlite3_result_pointer;
begin
  if not Assigned(vf_sqlite3_result_pointer) then vf_sqlite3_result_pointer := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_pointer');
  vf_sqlite3_result_pointer(param1, param2, param3, param4);
end;
{$ELSE}
procedure sqlite3_result_pointer; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_zeroblob: procedure (param1: Psqlite3_context; n: LongInt); cdecl = nil;

procedure sqlite3_result_zeroblob;
begin
  if not Assigned(vf_sqlite3_result_zeroblob) then vf_sqlite3_result_zeroblob := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_zeroblob');
  vf_sqlite3_result_zeroblob(param1, n);
end;
{$ELSE}
procedure sqlite3_result_zeroblob; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_zeroblob64: function (param1: Psqlite3_context; n: Tsqlite3_uint64): LongInt; cdecl = nil;

function sqlite3_result_zeroblob64;
begin
  if not Assigned(vf_sqlite3_result_zeroblob64) then vf_sqlite3_result_zeroblob64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_zeroblob64');
  Result := vf_sqlite3_result_zeroblob64(param1, n);
end;
{$ELSE}
function sqlite3_result_zeroblob64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_result_subtype: procedure (param1: Psqlite3_context; param2: DWord); cdecl = nil;

procedure sqlite3_result_subtype;
begin
  if not Assigned(vf_sqlite3_result_subtype) then vf_sqlite3_result_subtype := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_result_subtype');
  vf_sqlite3_result_subtype(param1, param2);
end;
{$ELSE}
procedure sqlite3_result_subtype; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_collation: function (param1: Psqlite3; zName: PAnsiChar; eTextRep: LongInt; pArg: Pointer; xCompare: TSQLiteCompareFunc): LongInt; cdecl = nil;

function sqlite3_create_collation;
begin
  if not Assigned(vf_sqlite3_create_collation) then vf_sqlite3_create_collation := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_collation');
  Result := vf_sqlite3_create_collation(param1, zName, eTextRep, pArg, xCompare);
end;
{$ELSE}
function sqlite3_create_collation; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_collation_v2: function (param1: Psqlite3; zName: PAnsiChar; eTextRep: LongInt; pArg: Pointer; xCompare: TSQLiteCompareFunc;
               xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_create_collation_v2;
begin
  if not Assigned(vf_sqlite3_create_collation_v2) then vf_sqlite3_create_collation_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_collation_v2');
  Result := vf_sqlite3_create_collation_v2(param1, zName, eTextRep, pArg, xCompare, xDestroy);
end;
{$ELSE}
function sqlite3_create_collation_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_collation16: function (param1: Psqlite3; zName: Pointer; eTextRep: LongInt; pArg: Pointer; xCompare: TSQLiteCompareFunc): LongInt; cdecl = nil;

function sqlite3_create_collation16;
begin
  if not Assigned(vf_sqlite3_create_collation16) then vf_sqlite3_create_collation16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_collation16');
  Result := vf_sqlite3_create_collation16(param1, zName, eTextRep, pArg, xCompare);
end;
{$ELSE}
function sqlite3_create_collation16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_collation_needed: function (param1: Psqlite3; param2: Pointer; param3: T_0168C1F8_Param3): LongInt; cdecl = nil;

function sqlite3_collation_needed;
begin
  if not Assigned(vf_sqlite3_collation_needed) then vf_sqlite3_collation_needed := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_collation_needed');
  Result := vf_sqlite3_collation_needed(param1, param2, param3);
end;
{$ELSE}
function sqlite3_collation_needed; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_collation_needed16: function (param1: Psqlite3; param2: Pointer; param3: T_0168D3F8_Param3): LongInt; cdecl = nil;

function sqlite3_collation_needed16;
begin
  if not Assigned(vf_sqlite3_collation_needed16) then vf_sqlite3_collation_needed16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_collation_needed16');
  Result := vf_sqlite3_collation_needed16(param1, param2, param3);
end;
{$ELSE}
function sqlite3_collation_needed16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_sleep: function (param1: LongInt): LongInt; cdecl = nil;

function sqlite3_sleep;
begin
  if not Assigned(vf_sqlite3_sleep) then vf_sqlite3_sleep := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_sleep');
  Result := vf_sqlite3_sleep(param1);
end;
{$ELSE}
function sqlite3_sleep; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_win32_set_directory: function (_type: DWord; zValue: Pointer): LongInt; cdecl = nil;

function sqlite3_win32_set_directory;
begin
  if not Assigned(vf_sqlite3_win32_set_directory) then vf_sqlite3_win32_set_directory := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_win32_set_directory');
  Result := vf_sqlite3_win32_set_directory(_type, zValue);
end;
{$ELSE}
function sqlite3_win32_set_directory; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_win32_set_directory8: function (_type: DWord; zValue: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_win32_set_directory8;
begin
  if not Assigned(vf_sqlite3_win32_set_directory8) then vf_sqlite3_win32_set_directory8 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_win32_set_directory8');
  Result := vf_sqlite3_win32_set_directory8(_type, zValue);
end;
{$ELSE}
function sqlite3_win32_set_directory8; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_win32_set_directory16: function (_type: DWord; zValue: Pointer): LongInt; cdecl = nil;

function sqlite3_win32_set_directory16;
begin
  if not Assigned(vf_sqlite3_win32_set_directory16) then vf_sqlite3_win32_set_directory16 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_win32_set_directory16');
  Result := vf_sqlite3_win32_set_directory16(_type, zValue);
end;
{$ELSE}
function sqlite3_win32_set_directory16; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_get_autocommit: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_get_autocommit;
begin
  if not Assigned(vf_sqlite3_get_autocommit) then vf_sqlite3_get_autocommit := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_get_autocommit');
  Result := vf_sqlite3_get_autocommit(param1);
end;
{$ELSE}
function sqlite3_get_autocommit; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_db_handle: function (param1: Psqlite3_stmt): Psqlite3; cdecl = nil;

function sqlite3_db_handle;
begin
  if not Assigned(vf_sqlite3_db_handle) then vf_sqlite3_db_handle := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_db_handle');
  Result := vf_sqlite3_db_handle(param1);
end;
{$ELSE}
function sqlite3_db_handle; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_db_filename: function (pDb: Psqlite3; zDbName: PAnsiChar): PAnsiChar; cdecl = nil;

function sqlite3_db_filename;
begin
  if not Assigned(vf_sqlite3_db_filename) then vf_sqlite3_db_filename := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_db_filename');
  Result := vf_sqlite3_db_filename(pDb, zDbName);
end;
{$ELSE}
function sqlite3_db_filename; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_db_readonly: function (pDb: Psqlite3; zDbName: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_db_readonly;
begin
  if not Assigned(vf_sqlite3_db_readonly) then vf_sqlite3_db_readonly := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_db_readonly');
  Result := vf_sqlite3_db_readonly(pDb, zDbName);
end;
{$ELSE}
function sqlite3_db_readonly; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_txn_state: function (param1: Psqlite3; zSchema: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_txn_state;
begin
  if not Assigned(vf_sqlite3_txn_state) then vf_sqlite3_txn_state := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_txn_state');
  Result := vf_sqlite3_txn_state(param1, zSchema);
end;
{$ELSE}
function sqlite3_txn_state; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_next_stmt: function (pDb: Psqlite3; pStmt: Psqlite3_stmt): Psqlite3_stmt; cdecl = nil;

function sqlite3_next_stmt;
begin
  if not Assigned(vf_sqlite3_next_stmt) then vf_sqlite3_next_stmt := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_next_stmt');
  Result := vf_sqlite3_next_stmt(pDb, pStmt);
end;
{$ELSE}
function sqlite3_next_stmt; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_commit_hook: function (param1: Psqlite3; param2: TSQLite3_one_ptr_arg_func; param3: Pointer): Pointer; cdecl = nil;

function sqlite3_commit_hook;
begin
  if not Assigned(vf_sqlite3_commit_hook) then vf_sqlite3_commit_hook := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_commit_hook');
  Result := vf_sqlite3_commit_hook(param1, param2, param3);
end;
{$ELSE}
function sqlite3_commit_hook; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_rollback_hook: function (param1: Psqlite3; param2: TSQLite3_one_ptr_arg_proc; param3: Pointer): Pointer; cdecl = nil;

function sqlite3_rollback_hook;
begin
  if not Assigned(vf_sqlite3_rollback_hook) then vf_sqlite3_rollback_hook := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_rollback_hook');
  Result := vf_sqlite3_rollback_hook(param1, param2, param3);
end;
{$ELSE}
function sqlite3_rollback_hook; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_autovacuum_pages: function (db: Psqlite3; param2: T_0163D188_Param2; param3: Pointer; param4: T_01680858_Param4): LongInt; cdecl = nil;

function sqlite3_autovacuum_pages;
begin
  if not Assigned(vf_sqlite3_autovacuum_pages) then vf_sqlite3_autovacuum_pages := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_autovacuum_pages');
  Result := vf_sqlite3_autovacuum_pages(db, param2, param3, param4);
end;
{$ELSE}
function sqlite3_autovacuum_pages; external cStrSqlite3LibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_update_hook: function (param1: Psqlite3; param2: T_0168C798_Param2; param3: Pointer): Pointer; cdecl = nil;

function sqlite3_update_hook;
begin
  if not Assigned(vf_sqlite3_update_hook) then vf_sqlite3_update_hook := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_update_hook');
  Result := vf_sqlite3_update_hook(param1, param2, param3);
end;
{$ELSE}
function sqlite3_update_hook; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_enable_shared_cache: function (param1: LongInt): LongInt; cdecl = nil;

function sqlite3_enable_shared_cache;
begin
  if not Assigned(vf_sqlite3_enable_shared_cache) then vf_sqlite3_enable_shared_cache := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_enable_shared_cache');
  Result := vf_sqlite3_enable_shared_cache(param1);
end;
{$ELSE}
function sqlite3_enable_shared_cache; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_release_memory: function (param1: LongInt): LongInt; cdecl = nil;

function sqlite3_release_memory;
begin
  if not Assigned(vf_sqlite3_release_memory) then vf_sqlite3_release_memory := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_release_memory');
  Result := vf_sqlite3_release_memory(param1);
end;
{$ELSE}
function sqlite3_release_memory; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_db_release_memory: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_db_release_memory;
begin
  if not Assigned(vf_sqlite3_db_release_memory) then vf_sqlite3_db_release_memory := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_db_release_memory');
  Result := vf_sqlite3_db_release_memory(param1);
end;
{$ELSE}
function sqlite3_db_release_memory; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_soft_heap_limit64: function (N: Tsqlite3_int64): Tsqlite3_int64; cdecl = nil;

function sqlite3_soft_heap_limit64;
begin
  if not Assigned(vf_sqlite3_soft_heap_limit64) then vf_sqlite3_soft_heap_limit64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_soft_heap_limit64');
  Result := vf_sqlite3_soft_heap_limit64(N);
end;
{$ELSE}
function sqlite3_soft_heap_limit64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_hard_heap_limit64: function (N: Tsqlite3_int64): Tsqlite3_int64; cdecl = nil;

function sqlite3_hard_heap_limit64;
begin
  if not Assigned(vf_sqlite3_hard_heap_limit64) then vf_sqlite3_hard_heap_limit64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_hard_heap_limit64');
  Result := vf_sqlite3_hard_heap_limit64(N);
end;
{$ELSE}
function sqlite3_hard_heap_limit64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_soft_heap_limit: procedure (N: LongInt); cdecl = nil;

procedure sqlite3_soft_heap_limit;
begin
  if not Assigned(vf_sqlite3_soft_heap_limit) then vf_sqlite3_soft_heap_limit := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_soft_heap_limit');
  vf_sqlite3_soft_heap_limit(N);
end;
{$ELSE}
procedure sqlite3_soft_heap_limit; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_table_column_metadata: function (pDb: Psqlite3; zDbName: PAnsiChar; zTableName: PAnsiChar; zColumnName: PAnsiChar; pzDataType: PPAnsiChar; 
               pzCollSeq: PPAnsiChar; var pNotNull: LongInt; var pPrimaryKey: LongInt; var pAutoinc: LongInt): LongInt; cdecl = nil;

function sqlite3_table_column_metadata;
begin
  if not Assigned(vf_sqlite3_table_column_metadata) then vf_sqlite3_table_column_metadata := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_table_column_metadata');
  Result := vf_sqlite3_table_column_metadata(pDb, zDbName, zTableName, zColumnName, pzDataType, pzCollSeq, pNotNull, pPrimaryKey, pAutoinc);
end;
{$ELSE}
function sqlite3_table_column_metadata; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_load_extension: function (pDb: Psqlite3; zFile: PAnsiChar; zProc: PAnsiChar; pzErrMsg: PPAnsiChar): LongInt; cdecl = nil;

function sqlite3_load_extension;
begin
  if not Assigned(vf_sqlite3_load_extension) then vf_sqlite3_load_extension := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_load_extension');
  Result := vf_sqlite3_load_extension(pDb, zFile, zProc, pzErrMsg);
end;
{$ELSE}
function sqlite3_load_extension; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_enable_load_extension: function (pDb: Psqlite3; onoff: LongInt): LongInt; cdecl = nil;

function sqlite3_enable_load_extension;
begin
  if not Assigned(vf_sqlite3_enable_load_extension) then vf_sqlite3_enable_load_extension := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_enable_load_extension');
  Result := vf_sqlite3_enable_load_extension(pDb, onoff);
end;
{$ELSE}
function sqlite3_enable_load_extension; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_auto_extension: function (xEntryPoint: T_0168CF78_XEntryPoint): LongInt; cdecl = nil;

function sqlite3_auto_extension;
begin
  if not Assigned(vf_sqlite3_auto_extension) then vf_sqlite3_auto_extension := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_auto_extension');
  Result := vf_sqlite3_auto_extension(xEntryPoint);
end;
{$ELSE}
function sqlite3_auto_extension; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_cancel_auto_extension: function (xEntryPoint: T_0168CF78_XEntryPoint): LongInt; cdecl = nil;

function sqlite3_cancel_auto_extension;
begin
  if not Assigned(vf_sqlite3_cancel_auto_extension) then vf_sqlite3_cancel_auto_extension := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_cancel_auto_extension');
  Result := vf_sqlite3_cancel_auto_extension(xEntryPoint);
end;
{$ELSE}
function sqlite3_cancel_auto_extension; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_reset_auto_extension: procedure ; cdecl = nil;

procedure sqlite3_reset_auto_extension;
begin
  if not Assigned(vf_sqlite3_reset_auto_extension) then vf_sqlite3_reset_auto_extension := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_reset_auto_extension');
  vf_sqlite3_reset_auto_extension();
end;
{$ELSE}
procedure sqlite3_reset_auto_extension; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_module: function (pDb: Psqlite3; zName: PAnsiChar; var p: Tsqlite3_module; pClientData: Pointer): LongInt; cdecl = nil;

function sqlite3_create_module;
begin
  if not Assigned(vf_sqlite3_create_module) then vf_sqlite3_create_module := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_module');
  Result := vf_sqlite3_create_module(pDb, zName, p, pClientData);
end;
{$ELSE}
function sqlite3_create_module; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_create_module_v2: function (pDb: Psqlite3; zName: PAnsiChar; var p: Tsqlite3_module; pClientData: Pointer; xDestroy: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_create_module_v2;
begin
  if not Assigned(vf_sqlite3_create_module_v2) then vf_sqlite3_create_module_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_create_module_v2');
  Result := vf_sqlite3_create_module_v2(pDb, zName, p, pClientData, xDestroy);
end;
{$ELSE}
function sqlite3_create_module_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_drop_modules: function (pDb: Psqlite3; azKeep: PPAnsiChar): LongInt; cdecl = nil;

function sqlite3_drop_modules;
begin
  if not Assigned(vf_sqlite3_drop_modules) then vf_sqlite3_drop_modules := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_drop_modules');
  Result := vf_sqlite3_drop_modules(pDb, azKeep);
end;
{$ELSE}
function sqlite3_drop_modules; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_declare_vtab: function (param1: Psqlite3; zSQL: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_declare_vtab;
begin
  if not Assigned(vf_sqlite3_declare_vtab) then vf_sqlite3_declare_vtab := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_declare_vtab');
  Result := vf_sqlite3_declare_vtab(param1, zSQL);
end;
{$ELSE}
function sqlite3_declare_vtab; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_overload_function: function (param1: Psqlite3; zFuncName: PAnsiChar; nArg: LongInt): LongInt; cdecl = nil;

function sqlite3_overload_function;
begin
  if not Assigned(vf_sqlite3_overload_function) then vf_sqlite3_overload_function := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_overload_function');
  Result := vf_sqlite3_overload_function(param1, zFuncName, nArg);
end;
{$ELSE}
function sqlite3_overload_function; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_blob_open: function (param1: Psqlite3; zDb: PAnsiChar; zTable: PAnsiChar; zColumn: PAnsiChar; iRow: Tsqlite3_int64; 
               flags: LongInt; var ppBlob: Psqlite3_blob): LongInt; cdecl = nil;

function sqlite3_blob_open;
begin
  if not Assigned(vf_sqlite3_blob_open) then vf_sqlite3_blob_open := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_blob_open');
  Result := vf_sqlite3_blob_open(param1, zDb, zTable, zColumn, iRow, flags, ppBlob);
end;
{$ELSE}
function sqlite3_blob_open; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_blob_reopen: function (param1: Psqlite3_blob; param2: Tsqlite3_int64): LongInt; cdecl = nil;

function sqlite3_blob_reopen;
begin
  if not Assigned(vf_sqlite3_blob_reopen) then vf_sqlite3_blob_reopen := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_blob_reopen');
  Result := vf_sqlite3_blob_reopen(param1, param2);
end;
{$ELSE}
function sqlite3_blob_reopen; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_blob_close: function (param1: Psqlite3_blob): LongInt; cdecl = nil;

function sqlite3_blob_close;
begin
  if not Assigned(vf_sqlite3_blob_close) then vf_sqlite3_blob_close := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_blob_close');
  Result := vf_sqlite3_blob_close(param1);
end;
{$ELSE}
function sqlite3_blob_close; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_blob_bytes: function (param1: Psqlite3_blob): LongInt; cdecl = nil;

function sqlite3_blob_bytes;
begin
  if not Assigned(vf_sqlite3_blob_bytes) then vf_sqlite3_blob_bytes := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_blob_bytes');
  Result := vf_sqlite3_blob_bytes(param1);
end;
{$ELSE}
function sqlite3_blob_bytes; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_blob_read: function (param1: Psqlite3_blob; Z: Pointer; N: LongInt; iOffset: LongInt): LongInt; cdecl = nil;

function sqlite3_blob_read;
begin
  if not Assigned(vf_sqlite3_blob_read) then vf_sqlite3_blob_read := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_blob_read');
  Result := vf_sqlite3_blob_read(param1, Z, N, iOffset);
end;
{$ELSE}
function sqlite3_blob_read; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_blob_write: function (param1: Psqlite3_blob; z: Pointer; n: LongInt; iOffset: LongInt): LongInt; cdecl = nil;

function sqlite3_blob_write;
begin
  if not Assigned(vf_sqlite3_blob_write) then vf_sqlite3_blob_write := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_blob_write');
  Result := vf_sqlite3_blob_write(param1, z, n, iOffset);
end;
{$ELSE}
function sqlite3_blob_write; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vfs_find: function (zVfsName: PAnsiChar): Psqlite3_vfs; cdecl = nil;

function sqlite3_vfs_find;
begin
  if not Assigned(vf_sqlite3_vfs_find) then vf_sqlite3_vfs_find := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vfs_find');
  Result := vf_sqlite3_vfs_find(zVfsName);
end;
{$ELSE}
function sqlite3_vfs_find; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vfs_register: function (param1: Psqlite3_vfs; makeDflt: LongInt): LongInt; cdecl = nil;

function sqlite3_vfs_register;
begin
  if not Assigned(vf_sqlite3_vfs_register) then vf_sqlite3_vfs_register := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vfs_register');
  Result := vf_sqlite3_vfs_register(param1, makeDflt);
end;
{$ELSE}
function sqlite3_vfs_register; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vfs_unregister: function (param1: Psqlite3_vfs): LongInt; cdecl = nil;

function sqlite3_vfs_unregister;
begin
  if not Assigned(vf_sqlite3_vfs_unregister) then vf_sqlite3_vfs_unregister := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vfs_unregister');
  Result := vf_sqlite3_vfs_unregister(param1);
end;
{$ELSE}
function sqlite3_vfs_unregister; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_mutex_alloc: function (param1: LongInt): Psqlite3_mutex; cdecl = nil;

function sqlite3_mutex_alloc;
begin
  if not Assigned(vf_sqlite3_mutex_alloc) then vf_sqlite3_mutex_alloc := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_mutex_alloc');
  Result := vf_sqlite3_mutex_alloc(param1);
end;
{$ELSE}
function sqlite3_mutex_alloc; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_mutex_free: procedure (param1: Psqlite3_mutex); cdecl = nil;

procedure sqlite3_mutex_free;
begin
  if not Assigned(vf_sqlite3_mutex_free) then vf_sqlite3_mutex_free := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_mutex_free');
  vf_sqlite3_mutex_free(param1);
end;
{$ELSE}
procedure sqlite3_mutex_free; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_mutex_enter: procedure (param1: Psqlite3_mutex); cdecl = nil;

procedure sqlite3_mutex_enter;
begin
  if not Assigned(vf_sqlite3_mutex_enter) then vf_sqlite3_mutex_enter := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_mutex_enter');
  vf_sqlite3_mutex_enter(param1);
end;
{$ELSE}
procedure sqlite3_mutex_enter; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_mutex_try: function (param1: Psqlite3_mutex): LongInt; cdecl = nil;

function sqlite3_mutex_try;
begin
  if not Assigned(vf_sqlite3_mutex_try) then vf_sqlite3_mutex_try := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_mutex_try');
  Result := vf_sqlite3_mutex_try(param1);
end;
{$ELSE}
function sqlite3_mutex_try; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_mutex_leave: procedure (param1: Psqlite3_mutex); cdecl = nil;

procedure sqlite3_mutex_leave;
begin
  if not Assigned(vf_sqlite3_mutex_leave) then vf_sqlite3_mutex_leave := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_mutex_leave');
  vf_sqlite3_mutex_leave(param1);
end;
{$ELSE}
procedure sqlite3_mutex_leave; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_mutex_held: function (param1: Psqlite3_mutex): LongInt; cdecl = nil;

function sqlite3_mutex_held;
begin
  if not Assigned(vf_sqlite3_mutex_held) then vf_sqlite3_mutex_held := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_mutex_held');
  Result := vf_sqlite3_mutex_held(param1);
end;
{$ELSE}
function sqlite3_mutex_held; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_mutex_notheld: function (param1: Psqlite3_mutex): LongInt; cdecl = nil;

function sqlite3_mutex_notheld;
begin
  if not Assigned(vf_sqlite3_mutex_notheld) then vf_sqlite3_mutex_notheld := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_mutex_notheld');
  Result := vf_sqlite3_mutex_notheld(param1);
end;
{$ELSE}
function sqlite3_mutex_notheld; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_db_mutex: function (param1: Psqlite3): Psqlite3_mutex; cdecl = nil;

function sqlite3_db_mutex;
begin
  if not Assigned(vf_sqlite3_db_mutex) then vf_sqlite3_db_mutex := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_db_mutex');
  Result := vf_sqlite3_db_mutex(param1);
end;
{$ELSE}
function sqlite3_db_mutex; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_file_control: function (param1: Psqlite3; zDbName: PAnsiChar; op: LongInt; param4: Pointer): LongInt; cdecl = nil;

function sqlite3_file_control;
begin
  if not Assigned(vf_sqlite3_file_control) then vf_sqlite3_file_control := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_file_control');
  Result := vf_sqlite3_file_control(param1, zDbName, op, param4);
end;
{$ELSE}
function sqlite3_file_control; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_test_control: function (op: LongInt; args: PVa_List {array of const}): LongInt; cdecl = nil;

function sqlite3_test_control;
begin
  if not Assigned(vf_sqlite3_test_control) then vf_sqlite3_test_control := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_test_control');
  Result := vf_sqlite3_test_control(op, args);
end;
{$ELSE}
function sqlite3_test_control; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_keyword_count: function : LongInt; cdecl = nil;

function sqlite3_keyword_count;
begin
  if not Assigned(vf_sqlite3_keyword_count) then vf_sqlite3_keyword_count := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_keyword_count');
  Result := vf_sqlite3_keyword_count();
end;
{$ELSE}
function sqlite3_keyword_count; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_keyword_name: function (param1: LongInt; param2: PPAnsiChar; param3: PLongInt): LongInt; cdecl = nil;

function sqlite3_keyword_name;
begin
  if not Assigned(vf_sqlite3_keyword_name) then vf_sqlite3_keyword_name := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_keyword_name');
  Result := vf_sqlite3_keyword_name(param1, param2, param3);
end;
{$ELSE}
function sqlite3_keyword_name; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_keyword_check: function (param1: PAnsiChar; param2: LongInt): LongInt; cdecl = nil;

function sqlite3_keyword_check;
begin
  if not Assigned(vf_sqlite3_keyword_check) then vf_sqlite3_keyword_check := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_keyword_check');
  Result := vf_sqlite3_keyword_check(param1, param2);
end;
{$ELSE}
function sqlite3_keyword_check; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_new: function (param1: Psqlite3): Psqlite3_str; cdecl = nil;

function sqlite3_str_new;
begin
  if not Assigned(vf_sqlite3_str_new) then vf_sqlite3_str_new := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_new');
  Result := vf_sqlite3_str_new(param1);
end;
{$ELSE}
function sqlite3_str_new; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_finish: function (param1: Psqlite3_str): PAnsiChar; cdecl = nil;

function sqlite3_str_finish;
begin
  if not Assigned(vf_sqlite3_str_finish) then vf_sqlite3_str_finish := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_finish');
  Result := vf_sqlite3_str_finish(param1);
end;
{$ELSE}
function sqlite3_str_finish; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_appendf: procedure (param1: Psqlite3_str; zFormat: PAnsiChar; args: PVa_List {array of const}); cdecl = nil;

procedure sqlite3_str_appendf;
begin
  if not Assigned(vf_sqlite3_str_appendf) then vf_sqlite3_str_appendf := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_appendf');
  vf_sqlite3_str_appendf(param1, zFormat, args);
end;
{$ELSE}
procedure sqlite3_str_appendf; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_vappendf: procedure (param1: Psqlite3_str; zFormat: PAnsiChar; param3: Tva_list); cdecl = nil;

procedure sqlite3_str_vappendf;
begin
  if not Assigned(vf_sqlite3_str_vappendf) then vf_sqlite3_str_vappendf := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_vappendf');
  vf_sqlite3_str_vappendf(param1, zFormat, param3);
end;
{$ELSE}
procedure sqlite3_str_vappendf; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_append: procedure (param1: Psqlite3_str; zIn: PAnsiChar; N: LongInt); cdecl = nil;

procedure sqlite3_str_append;
begin
  if not Assigned(vf_sqlite3_str_append) then vf_sqlite3_str_append := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_append');
  vf_sqlite3_str_append(param1, zIn, N);
end;
{$ELSE}
procedure sqlite3_str_append; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_appendall: procedure (param1: Psqlite3_str; zIn: PAnsiChar); cdecl = nil;

procedure sqlite3_str_appendall;
begin
  if not Assigned(vf_sqlite3_str_appendall) then vf_sqlite3_str_appendall := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_appendall');
  vf_sqlite3_str_appendall(param1, zIn);
end;
{$ELSE}
procedure sqlite3_str_appendall; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_appendchar: procedure (param1: Psqlite3_str; N: LongInt; C: AnsiChar); cdecl = nil;

procedure sqlite3_str_appendchar;
begin
  if not Assigned(vf_sqlite3_str_appendchar) then vf_sqlite3_str_appendchar := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_appendchar');
  vf_sqlite3_str_appendchar(param1, N, C);
end;
{$ELSE}
procedure sqlite3_str_appendchar; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_reset: procedure (param1: Psqlite3_str); cdecl = nil;

procedure sqlite3_str_reset;
begin
  if not Assigned(vf_sqlite3_str_reset) then vf_sqlite3_str_reset := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_reset');
  vf_sqlite3_str_reset(param1);
end;
{$ELSE}
procedure sqlite3_str_reset; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_errcode: function (param1: Psqlite3_str): LongInt; cdecl = nil;

function sqlite3_str_errcode;
begin
  if not Assigned(vf_sqlite3_str_errcode) then vf_sqlite3_str_errcode := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_errcode');
  Result := vf_sqlite3_str_errcode(param1);
end;
{$ELSE}
function sqlite3_str_errcode; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_length: function (param1: Psqlite3_str): LongInt; cdecl = nil;

function sqlite3_str_length;
begin
  if not Assigned(vf_sqlite3_str_length) then vf_sqlite3_str_length := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_length');
  Result := vf_sqlite3_str_length(param1);
end;
{$ELSE}
function sqlite3_str_length; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_str_value: function (param1: Psqlite3_str): PAnsiChar; cdecl = nil;

function sqlite3_str_value;
begin
  if not Assigned(vf_sqlite3_str_value) then vf_sqlite3_str_value := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_str_value');
  Result := vf_sqlite3_str_value(param1);
end;
{$ELSE}
function sqlite3_str_value; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_status: function (op: LongInt; var pCurrent: LongInt; var pHighwater: LongInt; resetFlag: LongInt): LongInt; cdecl = nil;

function sqlite3_status;
begin
  if not Assigned(vf_sqlite3_status) then vf_sqlite3_status := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_status');
  Result := vf_sqlite3_status(op, pCurrent, pHighwater, resetFlag);
end;
{$ELSE}
function sqlite3_status; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_status64: function (op: LongInt; var pCurrent: Tsqlite3_int64; var pHighwater: Tsqlite3_int64; resetFlag: LongInt): LongInt; cdecl = nil;

function sqlite3_status64;
begin
  if not Assigned(vf_sqlite3_status64) then vf_sqlite3_status64 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_status64');
  Result := vf_sqlite3_status64(op, pCurrent, pHighwater, resetFlag);
end;
{$ELSE}
function sqlite3_status64; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_db_status: function (param1: Psqlite3; op: LongInt; var pCur: LongInt; var pHiwtr: LongInt; resetFlg: LongInt): LongInt; cdecl = nil;

function sqlite3_db_status;
begin
  if not Assigned(vf_sqlite3_db_status) then vf_sqlite3_db_status := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_db_status');
  Result := vf_sqlite3_db_status(param1, op, pCur, pHiwtr, resetFlg);
end;
{$ELSE}
function sqlite3_db_status; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_stmt_status: function (param1: Psqlite3_stmt; op: LongInt; resetFlg: LongInt): LongInt; cdecl = nil;

function sqlite3_stmt_status;
begin
  if not Assigned(vf_sqlite3_stmt_status) then vf_sqlite3_stmt_status := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_stmt_status');
  Result := vf_sqlite3_stmt_status(param1, op, resetFlg);
end;
{$ELSE}
function sqlite3_stmt_status; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_backup_init: function (pDest: Psqlite3; zDestName: PAnsiChar; pSource: Psqlite3; zSourceName: PAnsiChar): Psqlite3_backup; cdecl = nil;

function sqlite3_backup_init;
begin
  if not Assigned(vf_sqlite3_backup_init) then vf_sqlite3_backup_init := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_backup_init');
  Result := vf_sqlite3_backup_init(pDest, zDestName, pSource, zSourceName);
end;
{$ELSE}
function sqlite3_backup_init; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_backup_step: function (pBackup: Psqlite3_backup; nPage: LongInt): LongInt; cdecl = nil;

function sqlite3_backup_step;
begin
  if not Assigned(vf_sqlite3_backup_step) then vf_sqlite3_backup_step := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_backup_step');
  Result := vf_sqlite3_backup_step(pBackup, nPage);
end;
{$ELSE}
function sqlite3_backup_step; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_backup_finish: function (pBackup: Psqlite3_backup): LongInt; cdecl = nil;

function sqlite3_backup_finish;
begin
  if not Assigned(vf_sqlite3_backup_finish) then vf_sqlite3_backup_finish := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_backup_finish');
  Result := vf_sqlite3_backup_finish(pBackup);
end;
{$ELSE}
function sqlite3_backup_finish; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_backup_remaining: function (pBackup: Psqlite3_backup): LongInt; cdecl = nil;

function sqlite3_backup_remaining;
begin
  if not Assigned(vf_sqlite3_backup_remaining) then vf_sqlite3_backup_remaining := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_backup_remaining');
  Result := vf_sqlite3_backup_remaining(pBackup);
end;
{$ELSE}
function sqlite3_backup_remaining; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_backup_pagecount: function (pBackup: Psqlite3_backup): LongInt; cdecl = nil;

function sqlite3_backup_pagecount;
begin
  if not Assigned(vf_sqlite3_backup_pagecount) then vf_sqlite3_backup_pagecount := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_backup_pagecount');
  Result := vf_sqlite3_backup_pagecount(pBackup);
end;
{$ELSE}
function sqlite3_backup_pagecount; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_unlock_notify: function (pBlocked: Psqlite3; xNotify: T_016D06E0_XNotify; pNotifyArg: Pointer): LongInt; cdecl = nil;

function sqlite3_unlock_notify;
begin
  if not Assigned(vf_sqlite3_unlock_notify) then vf_sqlite3_unlock_notify := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_unlock_notify');
  Result := vf_sqlite3_unlock_notify(pBlocked, xNotify, pNotifyArg);
end;
{$ELSE}
function sqlite3_unlock_notify; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_stricmp: function (param1: PAnsiChar; param2: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_stricmp;
begin
  if not Assigned(vf_sqlite3_stricmp) then vf_sqlite3_stricmp := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_stricmp');
  Result := vf_sqlite3_stricmp(param1, param2);
end;
{$ELSE}
function sqlite3_stricmp; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_strnicmp: function (param1: PAnsiChar; param2: PAnsiChar; param3: LongInt): LongInt; cdecl = nil;

function sqlite3_strnicmp;
begin
  if not Assigned(vf_sqlite3_strnicmp) then vf_sqlite3_strnicmp := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_strnicmp');
  Result := vf_sqlite3_strnicmp(param1, param2, param3);
end;
{$ELSE}
function sqlite3_strnicmp; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_strglob: function (zGlob: PAnsiChar; zStr: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_strglob;
begin
  if not Assigned(vf_sqlite3_strglob) then vf_sqlite3_strglob := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_strglob');
  Result := vf_sqlite3_strglob(zGlob, zStr);
end;
{$ELSE}
function sqlite3_strglob; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_strlike: function (zGlob: PAnsiChar; zStr: PAnsiChar; cEsc: DWord): LongInt; cdecl = nil;

function sqlite3_strlike;
begin
  if not Assigned(vf_sqlite3_strlike) then vf_sqlite3_strlike := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_strlike');
  Result := vf_sqlite3_strlike(zGlob, zStr, cEsc);
end;
{$ELSE}
function sqlite3_strlike; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_log: procedure (iErrCode: LongInt; zFormat: PAnsiChar; args: PVa_List {array of const}); cdecl = nil;

procedure sqlite3_log;
begin
  if not Assigned(vf_sqlite3_log) then vf_sqlite3_log := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_log');
  vf_sqlite3_log(iErrCode, zFormat, args);
end;
{$ELSE}
procedure sqlite3_log; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_wal_hook: function (param1: Psqlite3; param2: T_016CAE90_Param2; param3: Pointer): Pointer; cdecl = nil;

function sqlite3_wal_hook;
begin
  if not Assigned(vf_sqlite3_wal_hook) then vf_sqlite3_wal_hook := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_wal_hook');
  Result := vf_sqlite3_wal_hook(param1, param2, param3);
end;
{$ELSE}
function sqlite3_wal_hook; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_wal_autocheckpoint: function (pDb: Psqlite3; N: LongInt): LongInt; cdecl = nil;

function sqlite3_wal_autocheckpoint;
begin
  if not Assigned(vf_sqlite3_wal_autocheckpoint) then vf_sqlite3_wal_autocheckpoint := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_wal_autocheckpoint');
  Result := vf_sqlite3_wal_autocheckpoint(pDb, N);
end;
{$ELSE}
function sqlite3_wal_autocheckpoint; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_wal_checkpoint: function (pDb: Psqlite3; zDb: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_wal_checkpoint;
begin
  if not Assigned(vf_sqlite3_wal_checkpoint) then vf_sqlite3_wal_checkpoint := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_wal_checkpoint');
  Result := vf_sqlite3_wal_checkpoint(pDb, zDb);
end;
{$ELSE}
function sqlite3_wal_checkpoint; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_wal_checkpoint_v2: function (pDb: Psqlite3; zDb: PAnsiChar; eMode: LongInt; var pnLog: LongInt; var pnCkpt: LongInt): LongInt; cdecl = nil;

function sqlite3_wal_checkpoint_v2;
begin
  if not Assigned(vf_sqlite3_wal_checkpoint_v2) then vf_sqlite3_wal_checkpoint_v2 := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_wal_checkpoint_v2');
  Result := vf_sqlite3_wal_checkpoint_v2(pDb, zDb, eMode, pnLog, pnCkpt);
end;
{$ELSE}
function sqlite3_wal_checkpoint_v2; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vtab_config: function (param1: Psqlite3; op: LongInt; args: PVa_List {array of const}): LongInt; cdecl = nil;

function sqlite3_vtab_config;
begin
  if not Assigned(vf_sqlite3_vtab_config) then vf_sqlite3_vtab_config := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vtab_config');
  Result := vf_sqlite3_vtab_config(param1, op, args);
end;
{$ELSE}
function sqlite3_vtab_config; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vtab_on_conflict: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_vtab_on_conflict;
begin
  if not Assigned(vf_sqlite3_vtab_on_conflict) then vf_sqlite3_vtab_on_conflict := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vtab_on_conflict');
  Result := vf_sqlite3_vtab_on_conflict(param1);
end;
{$ELSE}
function sqlite3_vtab_on_conflict; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vtab_nochange: function (param1: Psqlite3_context): LongInt; cdecl = nil;

function sqlite3_vtab_nochange;
begin
  if not Assigned(vf_sqlite3_vtab_nochange) then vf_sqlite3_vtab_nochange := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vtab_nochange');
  Result := vf_sqlite3_vtab_nochange(param1);
end;
{$ELSE}
function sqlite3_vtab_nochange; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_vtab_collation: function (param1: Psqlite3_index_info; param2: LongInt): PAnsiChar; cdecl = nil;

function sqlite3_vtab_collation;
begin
  if not Assigned(vf_sqlite3_vtab_collation) then vf_sqlite3_vtab_collation := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_vtab_collation');
  Result := vf_sqlite3_vtab_collation(param1, param2);
end;
{$ELSE}
function sqlite3_vtab_collation; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_stmt_scanstatus: function (pStmt: Psqlite3_stmt; idx: LongInt; iScanStatusOp: LongInt; pOut: Pointer): LongInt; cdecl = nil;

function sqlite3_stmt_scanstatus;
begin
  if not Assigned(vf_sqlite3_stmt_scanstatus) then vf_sqlite3_stmt_scanstatus := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_stmt_scanstatus');
  Result := vf_sqlite3_stmt_scanstatus(pStmt, idx, iScanStatusOp, pOut);
end;
{$ELSE}
function sqlite3_stmt_scanstatus; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_stmt_scanstatus_reset: procedure (param1: Psqlite3_stmt); cdecl = nil;

procedure sqlite3_stmt_scanstatus_reset;
begin
  if not Assigned(vf_sqlite3_stmt_scanstatus_reset) then vf_sqlite3_stmt_scanstatus_reset := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_stmt_scanstatus_reset');
  vf_sqlite3_stmt_scanstatus_reset(param1);
end;
{$ELSE}
procedure sqlite3_stmt_scanstatus_reset; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_db_cacheflush: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_db_cacheflush;
begin
  if not Assigned(vf_sqlite3_db_cacheflush) then vf_sqlite3_db_cacheflush := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_db_cacheflush');
  Result := vf_sqlite3_db_cacheflush(param1);
end;
{$ELSE}
function sqlite3_db_cacheflush; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_system_errno: function (param1: Psqlite3): LongInt; cdecl = nil;

function sqlite3_system_errno;
begin
  if not Assigned(vf_sqlite3_system_errno) then vf_sqlite3_system_errno := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_system_errno');
  Result := vf_sqlite3_system_errno(param1);
end;
{$ELSE}
function sqlite3_system_errno; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_snapshot_get: function (pDb: Psqlite3; zSchema: PAnsiChar; var ppSnapshot: Psqlite3_snapshot): LongInt; cdecl = nil;

function sqlite3_snapshot_get;
begin
  if not Assigned(vf_sqlite3_snapshot_get) then vf_sqlite3_snapshot_get := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_snapshot_get');
  Result := vf_sqlite3_snapshot_get(pDb, zSchema, ppSnapshot);
end;
{$ELSE}
function sqlite3_snapshot_get; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_snapshot_open: function (pDb: Psqlite3; zSchema: PAnsiChar; var pSnapshot: Tsqlite3_snapshot): LongInt; cdecl = nil;

function sqlite3_snapshot_open;
begin
  if not Assigned(vf_sqlite3_snapshot_open) then vf_sqlite3_snapshot_open := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_snapshot_open');
  Result := vf_sqlite3_snapshot_open(pDb, zSchema, pSnapshot);
end;
{$ELSE}
function sqlite3_snapshot_open; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_snapshot_free: procedure (param1: Psqlite3_snapshot); cdecl = nil;

procedure sqlite3_snapshot_free;
begin
  if not Assigned(vf_sqlite3_snapshot_free) then vf_sqlite3_snapshot_free := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_snapshot_free');
  vf_sqlite3_snapshot_free(param1);
end;
{$ELSE}
procedure sqlite3_snapshot_free; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_snapshot_cmp: function (var p1: Tsqlite3_snapshot; var p2: Tsqlite3_snapshot): LongInt; cdecl = nil;

function sqlite3_snapshot_cmp;
begin
  if not Assigned(vf_sqlite3_snapshot_cmp) then vf_sqlite3_snapshot_cmp := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_snapshot_cmp');
  Result := vf_sqlite3_snapshot_cmp(p1, p2);
end;
{$ELSE}
function sqlite3_snapshot_cmp; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_snapshot_recover: function (pDb: Psqlite3; zDb: PAnsiChar): LongInt; cdecl = nil;

function sqlite3_snapshot_recover;
begin
  if not Assigned(vf_sqlite3_snapshot_recover) then vf_sqlite3_snapshot_recover := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_snapshot_recover');
  Result := vf_sqlite3_snapshot_recover(pDb, zDb);
end;
{$ELSE}
function sqlite3_snapshot_recover; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_serialize: function (pDb: Psqlite3; zSchema: PAnsiChar; var piSize: Tsqlite3_int64; mFlags: DWord): PByte; cdecl = nil;

function sqlite3_serialize;
begin
  if not Assigned(vf_sqlite3_serialize) then vf_sqlite3_serialize := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_serialize');
  Result := vf_sqlite3_serialize(pDb, zSchema, piSize, mFlags);
end;
{$ELSE}
function sqlite3_serialize; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_deserialize: function (pDb: Psqlite3; zSchema: PAnsiChar; var pData: Byte; szDb: Tsqlite3_int64; szBuf: Tsqlite3_int64; 
               mFlags: DWord): LongInt; cdecl = nil;

function sqlite3_deserialize;
begin
  if not Assigned(vf_sqlite3_deserialize) then vf_sqlite3_deserialize := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_deserialize');
  Result := vf_sqlite3_deserialize(pDb, zSchema, pData, szDb, szBuf, mFlags);
end;
{$ELSE}
function sqlite3_deserialize; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_rtree_geometry_callback: function (pDb: Psqlite3; zGeom: PAnsiChar; xGeom: T_0171DD88_XGeom; pContext: Pointer): LongInt; cdecl = nil;

function sqlite3_rtree_geometry_callback;
begin
  if not Assigned(vf_sqlite3_rtree_geometry_callback) then vf_sqlite3_rtree_geometry_callback := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_rtree_geometry_callback');
  Result := vf_sqlite3_rtree_geometry_callback(pDb, zGeom, xGeom, pContext);
end;
{$ELSE}
function sqlite3_rtree_geometry_callback; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


{$IFDEF DELAY_LOAD_SQLITE3_DLL}
var vf_sqlite3_rtree_query_callback: function (pDb: Psqlite3; zQueryFunc: PAnsiChar; xQueryFunc: T_0171B358_XQueryFunc; pContext: Pointer; xDestructor: TSQLite3_one_ptr_arg_proc): LongInt; cdecl = nil;

function sqlite3_rtree_query_callback;
begin
  if not Assigned(vf_sqlite3_rtree_query_callback) then vf_sqlite3_rtree_query_callback := LoadProcAddress(cStrSqlite3RuntimeLibName, 'sqlite3_rtree_query_callback');
  Result := vf_sqlite3_rtree_query_callback(pDb, zQueryFunc, xQueryFunc, pContext, xDestructor);
end;
{$ELSE}
function sqlite3_rtree_query_callback; external cStrSqlite3RuntimeLibName;
{$ENDIF DELAY_LOAD_SQLITE3_DLL}


//initialization


finalization

 // Avoid calling sqlite3_shutdown when nothing has been called before, the DLL may be missing!
 if gShouldCallSQLiteShutdown then sqlite3_shutdown; // <- ignore return code

end.