From e8c759d1b3c7e46adaf12ba3dfc072251a5dea75 Mon Sep 17 00:00:00 2001 From: marco Date: Sat, 19 Feb 2011 17:24:37 +0000 Subject: * unmerged table based initialization of libraries. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16941 3ad0048d-3df7-0310-abae-a5850022a9f2 --- packages/sqlite/src/sqlite3.inc | 1196 ++++++++++++++++++++------------------- 1 file changed, 611 insertions(+), 585 deletions(-) (limited to 'packages/sqlite') diff --git a/packages/sqlite/src/sqlite3.inc b/packages/sqlite/src/sqlite3.inc index f7575d9ae4..679167edb7 100644 --- a/packages/sqlite/src/sqlite3.inc +++ b/packages/sqlite/src/sqlite3.inc @@ -12,20 +12,23 @@ interface uses - ctypes, dynlibs; - -{$IFNDEF LOAD_DYNAMICALLY} - {$IFDEF darwin} - {$linklib sqlite3} - {$ENDIF} -{$ENDIF} + ctypes, +{$ifdef LOAD_DYNAMICALLY} + SysUtils, DynLibs; +{$else} + DynLibs; + +{$ifdef darwin} +{$linklib sqlite3} +{$endif} +{$endif} const {$IFDEF WINDOWS} - sqlite3lib = 'sqlite3.dll'; -{$ELSE} - sqlite3lib = 'libsqlite3.'+sharedsuffix; -{$ENDIF} + Sqlite3Lib = 'sqlite3.dll'; +{$else} + Sqlite3Lib = 'libsqlite3.'+sharedsuffix; +{$endif} {$IFDEF LOAD_DYNAMICALLY} {$DEFINE D} @@ -52,7 +55,7 @@ const ** ** Some of the definitions that are in this file are marked as ** "experimental". Experimental interfaces are normally new -** features recently added to SQLite. We do not anticipate changes +** features recently added to SQLite. We do not anticipate changes ** to experimental interfaces but reserve to make minor changes if ** experience from use "in the wild" suggest such changes are prudent. ** @@ -110,8 +113,8 @@ const ** These features provide the same information as the [SQLITE_VERSION] ** and [SQLITE_VERSION_NUMBER] #defines in the header, but are associated ** with the library instead of the header file. Cautious programmers might -** include a check in their application to verify that -** sqlite3_libversion_number() always returns the value +** include a check in their application to verify that +** sqlite3_libversion_number() always returns the value ** [SQLITE_VERSION_NUMBER]. ** ** The sqlite3_libversion() function returns the same information as is @@ -122,17 +125,17 @@ const ** INVARIANTS: ** ** {F10021} The [sqlite3_libversion_number()] interface returns an integer -** equal to [SQLITE_VERSION_NUMBER]. +** equal to [SQLITE_VERSION_NUMBER]. ** ** {F10022} The [sqlite3_version] string constant contains the text of the -** [SQLITE_VERSION] string. +** [SQLITE_VERSION] string. ** ** {F10023} The [sqlite3_libversion()] function returns ** a pointer to the [sqlite3_version] string constant. *) //SQLITE_EXTERN const char sqlite3_version[]; -{$IFDEF S}function{$ELSE}var{$ENDIF}sqlite3_libversion{$IFDEF D}: function{$ENDIF}(): pchar; cdecl;{$IFDEF S}external sqlite3lib;{$ENDIF} -{$IFDEF S}function{$ELSE}var{$ENDIF}sqlite3_libversion_number{$IFDEF D}: function{$ENDIF}(): cint; cdecl;{$IFDEF S}external sqlite3lib;{$ENDIF} +{$IFDEF S}function{$ELSE}var{$ENDIF}sqlite3_libversion{$IFDEF D}: function{$ENDIF}(): pchar; cdecl;{$IFDEF S}external Sqlite3Lib;{$ENDIF} +{$IFDEF S}function{$ELSE}var{$ENDIF}sqlite3_libversion_number{$IFDEF D}: function{$ENDIF}(): cint; cdecl;{$IFDEF S}external Sqlite3Lib;{$ENDIF} function sqlite3_version(): pchar; (* @@ -159,7 +162,7 @@ function sqlite3_version(): pchar; ** SQLite was compiled with its mutexes enabled or zero ** if SQLite was compiled with mutexes disabled. *) -{$IFDEF S}function{$ELSE}var{$ENDIF}sqlite3_threadsafe{$IFDEF D}: function{$ENDIF}(): cint; cdecl;{$IFDEF S}external sqlite3lib;{$ENDIF} +{$IFDEF S}function{$ELSE}var{$ENDIF}sqlite3_threadsafe{$IFDEF D}: function{$ENDIF}(): cint; cdecl;{$IFDEF S}external Sqlite3Lib;{$ENDIF} (* ** CAPI3REF: Database Connection Handle {F12000} @@ -179,7 +182,7 @@ type psqlite3 = ^_sqlite3; _sqlite3 = record end; - + (* ** CAPI3REF: Constants Defining Special Destructor Behavior {F10280} ** @@ -200,7 +203,7 @@ type const SQLITE_STATIC = sqlite3_destructor_type(nil); SQLITE_TRANSIENT = pointer(-1);//sqlite3_destructor_type(-1); - + (* ** CAPI3REF: 64-Bit Integer Types {F10200} @@ -237,11 +240,11 @@ type (* ** CAPI3REF: Closing A Database Connection {F12010} ** -** This routine is the destructor for the [sqlite3] object. +** This routine is the destructor for the [sqlite3] object. ** ** Applications should [sqlite3_finalize | finalize] all ** [prepared statements] and -** [sqlite3_blob_close | close] all [sqlite3_blob | BLOBs] +** [sqlite3_blob_close | close] all [sqlite3_blob | BLOBs] ** associated with the [sqlite3] object prior ** to attempting to close the [sqlite3] object. ** @@ -267,13 +270,13 @@ type ** LIMITATIONS: ** ** {U12015} The parameter to [sqlite3_close()] must be an [sqlite3] object -** pointer previously obtained from [sqlite3_open()] or the +** pointer previously obtained from [sqlite3_open()] or the ** equivalent, or NULL. ** ** {U12016} The parameter to [sqlite3_close()] must not have been previously ** closed. *) -{$IFDEF S}function{$ELSE}var{$ENDIF}sqlite3_close{$IFDEF D}: function{$ENDIF}(ref: psqlite3): cint; cdecl;{$IFDEF S}external sqlite3lib;{$ENDIF} +{$IFDEF S}function{$ELSE}var{$ENDIF}sqlite3_close{$IFDEF D}: function{$ENDIF}(ref: psqlite3): cint; cdecl;{$IFDEF S}external Sqlite3Lib;{$ENDIF} (* ** The type for a callback function. @@ -303,7 +306,7 @@ type ** The sqlite3_exec() is just a convenient wrapper. ** ** INVARIANTS: -** +** ** {F12101} The [sqlite3_exec()] interface evaluates zero or more UTF-8 ** encoded, semicolon-separated, SQL statements in the ** zero-terminated string of its 2nd parameter within the @@ -312,7 +315,7 @@ type ** {F12104} The return value of [sqlite3_exec()] is SQLITE_OK if all ** SQL statements run successfully. ** -** {F12105} The return value of [sqlite3_exec()] is an appropriate +** {F12105} The return value of [sqlite3_exec()] is an appropriate ** non-zero error code if any SQL statement fails. ** ** {F12107} If one or more of the SQL statements handed to [sqlite3_exec()] @@ -333,7 +336,7 @@ type ** callback to be the number of columns in the current row of ** result. ** -** {F12119} The [sqlite3_exec()] routine sets the 3rd parameter of its +** {F12119} The [sqlite3_exec()] routine sets the 3rd parameter of its ** callback to be an array of pointers to strings holding the ** values for each column in the current result set row as ** obtained from [sqlite3_column_text()]. @@ -370,7 +373,7 @@ type ** ** {U12142} The database connection must not be closed while ** [sqlite3_exec()] is running. -** +** ** {U12143} The calling function is should use [sqlite3_free()] to free ** the memory that *errmsg is left pointing at once the error ** message is no longer needed. @@ -384,7 +387,7 @@ type cb: sqlite3_callback; (* Callback function *) user: pointer; (* 1st argument to callback *) errmsg: ppchar (* Error msg written here *) -): cint; cdecl;{$IFDEF S}external sqlite3lib;{$ENDIF} +): cint; cdecl;{$IFDEF S}external Sqlite3Lib;{$ENDIF} (* ** CAPI3REF: Result Codes {F10210} @@ -442,7 +445,7 @@ const ** about errors. The extended result codes are enabled or disabled ** for each database connection using the [sqlite3_extended_result_codes()] ** API. -** +** ** Some of the available extended result codes are listed here. ** One may expect the number of extended result codes will be expand ** over time. Software that uses extended result codes should expect @@ -450,7 +453,7 @@ const ** ** The SQLITE_OK result code will never be extended. It will always ** be exactly zero. -** +** ** INVARIANTS: ** ** {F10223} The symbolic name for an extended result code always contains @@ -552,8 +555,8 @@ const ** ** When the SQLITE_SYNC_DATAONLY flag is used, it means that the ** sync operation only needs to flush data to mass storage. Inode -** information need not be flushed. The SQLITE_SYNC_NORMAL flag means -** to use normal fsync() semantics. The SQLITE_SYNC_FULL flag means +** information need not be flushed. The SQLITE_SYNC_NORMAL flag means +** to use normal fsync() semantics. The SQLITE_SYNC_FULL flag means ** to use Mac OS-X style fullsync instead of fsync(). *) SQLITE_SYNC_NORMAL = $00002; @@ -592,7 +595,7 @@ type ** OS-X style fullsync. The SQLITE_SYNC_DATA flag may be ORed in to ** indicate that only the data of the file and not its inode needs to be ** synced. -** +** ** The integer values to xLock() and xUnlock() are one of ** -** xLock() increases the lock. xUnlock() decreases the lock. +** xLock() increases the lock. xUnlock() decreases the lock. ** The xCheckReservedLock() method looks ** to see if any database connection, either in this ** process or in some other process, is holding an RESERVED, ** PENDING, or EXCLUSIVE lock on the file. It returns true ** if such a lock exists and false if not. -** +** ** The xFileControl() method is a generic interface that allows custom ** VFS implementations to directly control an open file using the ** [sqlite3_file_control()] interface. The second "op" argument @@ -618,9 +621,9 @@ type ** functions to enable blocking locks with timeouts, to change the ** locking strategy (for example to use dot-file locks), to inquire ** about the status of a lock, or to break stale locks. The SQLite -** core reserves opcodes less than 100 for its own use. +** core reserves opcodes less than 100 for its own use. ** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available. -** Applications that define a custom xFileControl method should use opcodes +** Applications that define a custom xFileControl method should use opcodes ** greater than 100 to avoid conflicts. ** ** The xSectorSize() method returns the sector size of the @@ -726,7 +729,7 @@ type ** in a thread-safe way. The [sqlite3_vfs_find()] interface ** searches the list. ** -** The pNext field is the only field in the sqlite3_vfs +** The pNext field is the only field in the sqlite3_vfs ** structure that SQLite will ever modify. SQLite will only access ** or modify this field while holding a particular static mutex. ** The application should never modify anything within the sqlite3_vfs @@ -748,10 +751,10 @@ type ** If xOpen() opens a file read-only then it sets *pOutFlags to ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be ** set. -** +** ** {F11143} SQLite will also add one of the following flags to the xOpen() ** call, depending on the object being opened: -** +** **