summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-14 17:55:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-14 17:55:21 +0000
commit4cb09d377b01f966ab8e790d64f4f8fcc2bb9ecd (patch)
tree0afa7d69b50cb912a4a69a6406e7b6fb7894911c
parenteb88625a55dbaa7e92042d96241e9ddda4604862 (diff)
downloadamarok-4cb09d377b01f966ab8e790d64f4f8fcc2bb9ecd.tar.gz
amarok-4cb09d377b01f966ab8e790d64f4f8fcc2bb9ecd.zip
Fix Amarok FTBFS under Autotools
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1247158 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--amarok/configure.in.in16
-rw-r--r--amarok/src/collectiondb.cpp74
-rw-r--r--amarok/src/collectiondb.h4
-rw-r--r--amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp36
-rw-r--r--amarok/src/database_refactor/sqlite/sqlite_dbengine.h6
-rw-r--r--amarok/src/ktrm.cpp6
-rw-r--r--amarok/src/playlistbrowser.cpp24
-rw-r--r--amarok/src/playlistbrowseritem.cpp4
-rw-r--r--amarok/src/sqlite/sqlite3.c9286
-rw-r--r--amarok/src/sqlite/sqlite3.h554
-rw-r--r--amarok/src/statistics.cpp6
11 files changed, 5015 insertions, 5001 deletions
diff --git a/amarok/configure.in.in b/amarok/configure.in.in
index 539d07c2..40c0a034 100644
--- a/amarok/configure.in.in
+++ b/amarok/configure.in.in
@@ -313,7 +313,7 @@ if test "$build_yauap" != "no"; then
LIB_YAUAP=""
CFLAGS_YAUAP=""
else
- LIB_YAUAP="$DBUS_LIBS -ldbus-qt-1"
+ LIB_YAUAP="$DBUS_LIBS -ldbus-tqt-1"
CFLAGS_YAUAP="$DBUS_CFLAGS"
AC_SUBST(LIB_YAUAP)
AC_SUBST(CFLAGS_YAUAP)
@@ -834,7 +834,21 @@ AC_ARG_WITH(ifp,
if test "$build_ifp" != "no"; then
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ save_CXXFLAGS="$CXXFLAGS"
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+
AC_CHECK_HEADERS([ifp.h], [have_ifp=yes], [], [])
+
+ CXXFLAGS="$save_CXXFLAGS"
+ LIBS="$save_LIBS"
+ LDFLAGS="$save_LDFLAGS"
+ AC_LANG_RESTORE
+
+# AC_CHECK_HEADERS([ifp.h], [have_ifp=yes], [], [])
AC_CHECK_HEADERS([usb.h], [have_usb=yes], [], [])
if test "$have_ifp" = "yes"; then
diff --git a/amarok/src/collectiondb.cpp b/amarok/src/collectiondb.cpp
index 753ec474..e95df956 100644
--- a/amarok/src/collectiondb.cpp
+++ b/amarok/src/collectiondb.cpp
@@ -6062,11 +6062,11 @@ SqliteConnection::SqliteConnection( const SqliteConfig* config )
{
TQString format;
file.readLine( format, 50 );
- if ( !format.startsWith( "STQLite format 3" ) )
+ if ( !format.startsWith( "SQLite format 3" ) )
{
warning() << "Database versions incompatible. Removing and rebuilding database.\n";
}
- else if ( sqlite3_open( path, &m_db ) != STQLITE_OK )
+ else if ( sqlite3_open( path, &m_db ) != SQLITE_OK )
{
warning() << "Database file corrupt. Removing and rebuilding database.\n";
sqlite3_close( m_db );
@@ -6079,24 +6079,24 @@ SqliteConnection::SqliteConnection( const SqliteConfig* config )
{
// Remove old db file; create new
TQFile::remove( path );
- if ( sqlite3_open( path, &m_db ) == STQLITE_OK )
+ if ( sqlite3_open( path, &m_db ) == SQLITE_OK )
{
m_initialized = true;
}
}
if ( m_initialized )
{
- if( sqlite3_create_function(m_db, "rand", 0, STQLITE_UTF8, NULL, sqlite_rand, NULL, NULL) != STQLITE_OK )
+ if( sqlite3_create_function(m_db, "rand", 0, SQLITE_UTF8, NULL, sqlite_rand, NULL, NULL) != SQLITE_OK )
m_initialized = false;
- if( sqlite3_create_function(m_db, "power", 2, STQLITE_UTF8, NULL, sqlite_power, NULL, NULL) != STQLITE_OK )
+ if( sqlite3_create_function(m_db, "power", 2, SQLITE_UTF8, NULL, sqlite_power, NULL, NULL) != SQLITE_OK )
m_initialized = false;
- if ( sqlite3_create_function(m_db, "like", 2, STQLITE_UTF8, NULL, sqlite_like_new, NULL, NULL) != STQLITE_OK )
+ if ( sqlite3_create_function(m_db, "like", 2, SQLITE_UTF8, NULL, sqlite_like_new, NULL, NULL) != SQLITE_OK )
m_initialized = false;
- if ( sqlite3_create_function(m_db, "like", 3, STQLITE_UTF8, NULL, sqlite_like_new, NULL, NULL) != STQLITE_OK )
+ if ( sqlite3_create_function(m_db, "like", 3, SQLITE_UTF8, NULL, sqlite_like_new, NULL, NULL) != SQLITE_OK )
m_initialized = false;
}
- //optimization for speeding up STQLite
+ //optimization for speeding up SQLite
query( "PRAGMA default_synchronous = OFF;" );
}
@@ -6128,11 +6128,11 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
}
error = sqlite3_prepare( m_db, statement.utf8(), -1, &stmt, &tail );
}
- while ( STQLITE_BUSY==error && busyCnt++ < 120 );
+ while ( SQLITE_BUSY==error && busyCnt++ < 120 );
- if ( error != STQLITE_OK )
+ if ( error != SQLITE_OK )
{
- if ( STQLITE_BUSY==error )
+ if ( SQLITE_BUSY==error )
Debug::error() << "Gave up waiting for lock to clear" << endl;
Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl;
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@@ -6149,7 +6149,7 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
{
error = sqlite3_step( stmt );
- if ( error == STQLITE_BUSY )
+ if ( error == SQLITE_BUSY )
{
if ( busyCnt++ > 120 ) {
Debug::error() << "Busy-counter has reached maximum. Aborting this sql statement!\n";
@@ -6159,9 +6159,9 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
debug() << "sqlite3_step: BUSY counter: " << busyCnt << endl;
continue;
}
- if ( error == STQLITE_MISUSE )
+ if ( error == SQLITE_MISUSE )
debug() << "sqlite3_step: MISUSE" << endl;
- if ( error == STQLITE_DONE || error == STQLITE_ERROR )
+ if ( error == SQLITE_DONE || error == SQLITE_ERROR )
break;
//iterate over columns
@@ -6173,17 +6173,17 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
//deallocate vm resources
rc = sqlite3_finalize( stmt );
- if ( error != STQLITE_DONE && rc != STQLITE_SCHEMA )
+ if ( error != SQLITE_DONE && rc != SQLITE_SCHEMA )
{
Debug::error() << k_funcinfo << "sqlite_step error.\n";
Debug::error() << sqlite3_errmsg( m_db ) << endl;
Debug::error() << "on query: " << statement << endl;
values = TQStringList();
}
- if ( rc == STQLITE_SCHEMA )
+ if ( rc == SQLITE_SCHEMA )
{
retryCnt++;
- debug() << "STQLITE_SCHEMA error occurred on query: " << statement << endl;
+ debug() << "SQLITE_SCHEMA error occurred on query: " << statement << endl;
if ( retryCnt < 10 )
debug() << "Retrying now." << endl;
else
@@ -6195,7 +6195,7 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
}
}
}
- while ( rc == STQLITE_SCHEMA && retryCnt < 10 );
+ while ( rc == SQLITE_SCHEMA && retryCnt < 10 );
return values;
}
@@ -6220,11 +6220,11 @@ int SqliteConnection::insert( const TQString& statement, const TQString& /* tabl
}
error = sqlite3_prepare( m_db, statement.utf8(), -1, &stmt, &tail );
}
- while ( STQLITE_BUSY==error && busyCnt++ < 120 );
+ while ( SQLITE_BUSY==error && busyCnt++ < 120 );
- if ( error != STQLITE_OK )
+ if ( error != SQLITE_OK )
{
- if ( STQLITE_BUSY==error )
+ if ( SQLITE_BUSY==error )
Debug::error() << "Gave up waiting for lock to clear" << endl;
Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl;
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@@ -6239,7 +6239,7 @@ int SqliteConnection::insert( const TQString& statement, const TQString& /* tabl
{
error = sqlite3_step( stmt );
- if ( error == STQLITE_BUSY )
+ if ( error == SQLITE_BUSY )
{
if ( busyCnt++ > 120 ) {
Debug::error() << "Busy-counter has reached maximum. Aborting this sql statement!\n";
@@ -6248,24 +6248,24 @@ int SqliteConnection::insert( const TQString& statement, const TQString& /* tabl
::usleep( 100000 ); // Sleep 100 msec
debug() << "sqlite3_step: BUSY counter: " << busyCnt << endl;
}
- if ( error == STQLITE_MISUSE )
+ if ( error == SQLITE_MISUSE )
debug() << "sqlite3_step: MISUSE" << endl;
- if ( error == STQLITE_DONE || error == STQLITE_ERROR )
+ if ( error == SQLITE_DONE || error == SQLITE_ERROR )
break;
}
//deallocate vm resources
rc = sqlite3_finalize( stmt );
- if ( error != STQLITE_DONE && rc != STQLITE_SCHEMA)
+ if ( error != SQLITE_DONE && rc != SQLITE_SCHEMA)
{
Debug::error() << k_funcinfo << "sqlite_step error.\n";
Debug::error() << sqlite3_errmsg( m_db ) << endl;
Debug::error() << "on insert: " << statement << endl;
}
- if ( rc == STQLITE_SCHEMA )
+ if ( rc == SQLITE_SCHEMA )
{
retryCnt++;
- debug() << "STQLITE_SCHEMA error occurred on insert: " << statement << endl;
+ debug() << "SQLITE_SCHEMA error occurred on insert: " << statement << endl;
if ( retryCnt < 10 )
debug() << "Retrying now." << endl;
else
@@ -6276,7 +6276,7 @@ int SqliteConnection::insert( const TQString& statement, const TQString& /* tabl
}
}
}
- while ( STQLITE_SCHEMA == rc && retryCnt < 10 );
+ while ( SQLITE_SCHEMA == rc && retryCnt < 10 );
return sqlite3_last_insert_rowid( m_db );
}
@@ -6291,7 +6291,7 @@ void SqliteConnection::sqlite_rand(sqlite3_context *context, int /*argc*/, sqlit
void SqliteConnection::sqlite_power(sqlite3_context *context, int argc, sqlite3_value **argv)
{
Q_ASSERT( argc==2 );
- if( sqlite3_value_type(argv[0])==STQLITE_NULL || sqlite3_value_type(argv[1])==STQLITE_NULL ) {
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL || sqlite3_value_type(argv[1])==SQLITE_NULL ) {
sqlite3_result_null(context);
return;
}
@@ -6356,7 +6356,7 @@ MySqlConnection::MySqlConnection( const MySqlConfig* config )
{
m_initialized = true;
-#if MYSTQL_VERSION_ID >= 40113
+#if MYSQL_VERSION_ID >= 40113
// now set the right charset for the connection
TQStringList my_qslist = query( "SHOW VARIABLES LIKE 'character_set_database'" );
if( !my_qslist.isEmpty() && !mysql_set_character_set( m_db, const_cast<char *>( my_qslist[1].latin1() ) ) )
@@ -6409,11 +6409,11 @@ TQStringList MySqlConnection::query( const TQString& statement, bool suppressDeb
if ( !mysql_query( m_db, statement.utf8() ) )
{
- MYSTQL_RES* result;
+ MYSQL_RES* result;
if ( ( result = mysql_use_result( m_db ) ) )
{
int number = mysql_field_count( m_db );
- MYSTQL_ROW row;
+ MYSQL_ROW row;
while ( ( row = mysql_fetch_row( result ) ) )
{
for ( int i = 0; i < number; i++ )
@@ -6530,7 +6530,7 @@ TQStringList PostgresqlConnection::query( const TQString& statement, bool suppre
return values;
}
- status = PQresulttqStatus(result);
+ status = PQresultStatus(result);
if ((status != PGRES_COMMAND_OK) && (status != PGRES_TUPLES_OK))
{
if ( !suppressDebug )
@@ -6579,7 +6579,7 @@ int PostgresqlConnection::insert( const TQString& statement, const TQString& tab
return 0;
}
- status = PQresulttqStatus(result);
+ status = PQresultStatus(result);
if (status != PGRES_COMMAND_OK)
{
debug() << "POSTGRESQL INSERT FAILED: " << PQerrorMessage( m_db ) << "\n" << "FAILED SQL: " << statement << "\n";
@@ -6601,7 +6601,7 @@ int PostgresqlConnection::insert( const TQString& statement, const TQString& tab
return 0;
}
- status = PQresulttqStatus(result);
+ status = PQresultStatus(result);
if (status != PGRES_TUPLES_OK)
{
debug() << "POSTGRESQL INSERT FAILED: " << PQerrorMessage( m_db ) << "\n" << "FAILED SQL: " << curvalSql << "\n";
@@ -7660,7 +7660,7 @@ const int
QueryBuilder::dragFieldCount = 21;
TQString
-QueryBuilder::dragSTQLFields()
+QueryBuilder::dragSQLFields()
{
return "tags.url, tags.deviceid, album.name, artist.name, composer.name, "
"genre.name, tags.title, year.name, "
@@ -7672,7 +7672,7 @@ QueryBuilder::dragSTQLFields()
}
void
-QueryBuilder::initSTQLDrag()
+QueryBuilder::initSQLDrag()
{
clear();
addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );
diff --git a/amarok/src/collectiondb.h b/amarok/src/collectiondb.h
index 17c925a6..9b94ad00 100644
--- a/amarok/src/collectiondb.h
+++ b/amarok/src/collectiondb.h
@@ -799,8 +799,8 @@ class QueryBuilder
void shuffle( int table = 0, TQ_INT64 value = 0 );
static const int dragFieldCount;
- static TQString dragSTQLFields();
- void initSTQLDrag();
+ static TQString dragSQLFields();
+ void initSQLDrag();
void buildQuery( bool withDeviceidPlaceholder = false );
TQString getQuery();
diff --git a/amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp b/amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp
index 5f13f7db..c8dd911f 100644
--- a/amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp
+++ b/amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp
@@ -4,7 +4,7 @@
// (c) 2005 Ian Monroe <[email protected]>
// See COPYING file for licensing information.
-#define DEBUG_PREFIX "STQLite-DBEngine"
+#define DEBUG_PREFIX "SQLite-DBEngine"
#include "app.h"
#include "amarok.h"
@@ -43,11 +43,11 @@ SqliteDbEngine::SqliteDbEngine()
{
TQString format;
file.readLine( format, 50 );
- if ( !format.startsWith( "STQLite format 3" ) )
+ if ( !format.startsWith( "SQLite format 3" ) )
{
warning() << "Database versions incompatible. Removing and rebuilding database.\n";
}
- else if ( sqlite3_open( path, &m_db ) != STQLITE_OK )
+ else if ( sqlite3_open( path, &m_db ) != SQLITE_OK )
{
warning() << "Database file corrupt. Removing and rebuilding database.\n";
sqlite3_close( m_db );
@@ -60,20 +60,20 @@ SqliteDbEngine::SqliteDbEngine()
{
// Remove old db file; create new
TQFile::remove( path );
- if ( sqlite3_open( path, &m_db ) == STQLITE_OK )
+ if ( sqlite3_open( path, &m_db ) == SQLITE_OK )
{
m_initialized = true;
}
}
if ( m_initialized )
{
- if( sqlite3_create_function(m_db, "rand", 0, STQLITE_UTF8, NULL, sqlite_rand, NULL, NULL) != STQLITE_OK )
+ if( sqlite3_create_function(m_db, "rand", 0, SQLITE_UTF8, NULL, sqlite_rand, NULL, NULL) != SQLITE_OK )
m_initialized = false;
- if( sqlite3_create_function(m_db, "power", 2, STQLITE_UTF8, NULL, sqlite_power, NULL, NULL) != STQLITE_OK )
+ if( sqlite3_create_function(m_db, "power", 2, SQLITE_UTF8, NULL, sqlite_power, NULL, NULL) != SQLITE_OK )
m_initialized = false;
}
- //optimization for speeding up STQLite
+ //optimization for speeding up SQLite
query( "PRAGMA default_synchronous = OFF;" );
}
@@ -94,7 +94,7 @@ TQStringList SqliteDbEngine::query( const TQString& statement )
//compile SQL program to virtual machine
error = sqlite3_prepare( m_db, statement.utf8(), statement.length(), &stmt, &tail );
- if ( error != STQLITE_OK )
+ if ( error != SQLITE_OK )
{
Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl;
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@@ -110,7 +110,7 @@ TQStringList SqliteDbEngine::query( const TQString& statement )
{
error = sqlite3_step( stmt );
- if ( error == STQLITE_BUSY )
+ if ( error == SQLITE_BUSY )
{
if ( busyCnt++ > 20 ) {
Debug::error() << "Busy-counter has reached maximum. Aborting this sql statement!\n";
@@ -119,9 +119,9 @@ TQStringList SqliteDbEngine::query( const TQString& statement )
::usleep( 100000 ); // Sleep 100 msec
debug() << "sqlite3_step: BUSY counter: " << busyCnt << endl;
}
- if ( error == STQLITE_MISUSE )
+ if ( error == SQLITE_MISUSE )
debug() << "sqlite3_step: MISUSE" << endl;
- if ( error == STQLITE_DONE || error == STQLITE_ERROR )
+ if ( error == SQLITE_DONE || error == SQLITE_ERROR )
break;
//iterate over columns
@@ -133,7 +133,7 @@ TQStringList SqliteDbEngine::query( const TQString& statement )
//deallocate vm resources
sqlite3_finalize( stmt );
- if ( error != STQLITE_DONE )
+ if ( error != SQLITE_DONE )
{
Debug::error() << k_funcinfo << "sqlite_step error.\n";
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@@ -155,7 +155,7 @@ int SqliteDbEngine::insert( const TQString& statement, const TQString& /* table
//compile SQL program to virtual machine
error = sqlite3_prepare( m_db, statement.utf8(), statement.length(), &stmt, &tail );
- if ( error != STQLITE_OK )
+ if ( error != SQLITE_OK )
{
Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl;
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@@ -169,7 +169,7 @@ int SqliteDbEngine::insert( const TQString& statement, const TQString& /* table
{
error = sqlite3_step( stmt );
- if ( error == STQLITE_BUSY )
+ if ( error == SQLITE_BUSY )
{
if ( busyCnt++ > 20 ) {
Debug::error() << "Busy-counter has reached maximum. Aborting this sql statement!\n";
@@ -178,15 +178,15 @@ int SqliteDbEngine::insert( const TQString& statement, const TQString& /* table
::usleep( 100000 ); // Sleep 100 msec
debug() << "sqlite3_step: BUSY counter: " << busyCnt << endl;
}
- if ( error == STQLITE_MISUSE )
+ if ( error == SQLITE_MISUSE )
debug() << "sqlite3_step: MISUSE" << endl;
- if ( error == STQLITE_DONE || error == STQLITE_ERROR )
+ if ( error == SQLITE_DONE || error == SQLITE_ERROR )
break;
}
//deallocate vm resources
sqlite3_finalize( stmt );
- if ( error != STQLITE_DONE )
+ if ( error != SQLITE_DONE )
{
Debug::error() << k_funcinfo << "sqlite_step error.\n";
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@@ -207,7 +207,7 @@ void SqliteDbEngine::sqlite_rand(sqlite3_context *context, int /*argc*/, sqlite3
void SqliteDbEngine::sqlite_power(sqlite3_context *context, int argc, sqlite3_value **argv)
{
Q_ASSERT( argc==2 );
- if( sqlite3_value_type(argv[0])==STQLITE_NULL || sqlite3_value_type(argv[1])==STQLITE_NULL ) {
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL || sqlite3_value_type(argv[1])==SQLITE_NULL ) {
sqlite3_result_null(context);
return;
}
diff --git a/amarok/src/database_refactor/sqlite/sqlite_dbengine.h b/amarok/src/database_refactor/sqlite/sqlite_dbengine.h
index 276aa7d6..52fe5cdc 100644
--- a/amarok/src/database_refactor/sqlite/sqlite_dbengine.h
+++ b/amarok/src/database_refactor/sqlite/sqlite_dbengine.h
@@ -3,8 +3,8 @@
// (c) 2004 Sami Nieminen <[email protected]>
// See COPYING file for licensing information.
-#ifndef AMAROK_STQLITE_DBENGINE_H
-#define AMAROK_STQLITE_DBENGINE_H
+#ifndef AMAROK_SQLITE_DBENGINE_H
+#define AMAROK_SQLITE_DBENGINE_H
#include "dbenginebase.h"
#include <kurl.h>
@@ -55,4 +55,4 @@ class SqliteDbEngine : public DbConnection
};
-#endif /*STQLITE_DBENGINE_H*/
+#endif /*SQLITE_DBENGINE_H*/
diff --git a/amarok/src/ktrm.cpp b/amarok/src/ktrm.cpp
index d9aa9873..ccc777ae 100644
--- a/amarok/src/ktrm.cpp
+++ b/amarok/src/ktrm.cpp
@@ -52,7 +52,7 @@ class KTRMLookup;
extern "C"
{
#if HAVE_TUNEPIMP >= 4
- static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFiletqStatus status);
+ static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFileStatus status);
#else
static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId);
#endif
@@ -314,7 +314,7 @@ protected:
* Callback function for TunePimp lookup events.
*/
#if HAVE_TUNEPIMP >= 4
-static void TRMNotifyCallback(tunepimp_t /*pimp*/, void */*data*/, TPCallbackEnum type, int fileId, TPFiletqStatus status)
+static void TRMNotifyCallback(tunepimp_t /*pimp*/, void */*data*/, TPCallbackEnum type, int fileId, TPFileStatus status)
#else
static void TRMNotifyCallback(tunepimp_t pimp, void */*data*/, TPCallbackEnum type, int fileId)
#endif
@@ -617,7 +617,7 @@ void KTRMLookup::unrecognized()
tr_GetTRM(track, trm, 255);
#endif
if ( !trm[0] ) {
- tr_SettqStatus(track, ePending);
+ tr_SetStatus(track, ePending);
tp_Wake(KTRMRequestHandler::instance()->tunePimp(), track);
}
else
diff --git a/amarok/src/playlistbrowser.cpp b/amarok/src/playlistbrowser.cpp
index 3d74d65f..279f0c89 100644
--- a/amarok/src/playlistbrowser.cpp
+++ b/amarok/src/playlistbrowser.cpp
@@ -794,7 +794,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
m_smartDefaults->setOpen( m_smartDefaultsOpen );
m_smartDefaults->setKept( false );
/********** All Collection **************/
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack );
@@ -803,14 +803,14 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setPixmap( 0, SmallIcon( Amarok::icon( "collection" ) ) );
item->setKept( false );
/********** Favorite Tracks **************/
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortByFavorite();
qb.setLimit( 0, 15 );
item = new SmartPlaylist( m_smartDefaults, item, i18n( "Favorite Tracks" ), qb.query() );
item->setKept( false );
last = 0;
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortByFavorite();
qb.setLimit( 0, 15 );
foreach( artists ) {
@@ -822,7 +822,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
}
/********** Most Played **************/
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, true );
qb.setLimit( 0, 15 );
@@ -830,7 +830,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
last = 0;
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, true );
qb.setLimit( 0, 15 );
foreach( artists ) {
@@ -842,7 +842,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
}
/********** Newest Tracks **************/
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valCreateDate, true );
qb.setLimit( 0, 15 );
@@ -850,7 +850,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
last = 0;
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valCreateDate, true );
qb.setLimit( 0, 15 );
foreach( artists ) {
@@ -862,7 +862,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
}
/********** Last Played **************/
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valAccessDate, true );
qb.setLimit( 0, 15 );
@@ -870,7 +870,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
/********** Never Played **************/
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.addNumericFilter( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, "0" );
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
@@ -880,7 +880,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
/********** Ever Played **************/
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.excludeFilter( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, "1", QueryBuilder::modeLess );
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
@@ -895,7 +895,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
last = 0;
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack );
@@ -908,7 +908,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
}
/********** 50 Random Tracks **************/
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.setOptions( QueryBuilder::optRandomize );
qb.setLimit( 0, 50 );
item = new SmartPlaylist( m_smartDefaults, item, i18n( "50 Random Tracks" ), qb.query( true ) );
diff --git a/amarok/src/playlistbrowseritem.cpp b/amarok/src/playlistbrowseritem.cpp
index 229340c4..c64644c0 100644
--- a/amarok/src/playlistbrowseritem.cpp
+++ b/amarok/src/playlistbrowseritem.cpp
@@ -3150,7 +3150,7 @@ TQString SmartPlaylist::query()
return TQString( m_sqlForTags.tqunicode(), m_sqlForTags.length() )
.replace( "(*CurrentTimeT*)" ,
TQString::number(TQDateTime::tqcurrentDateTime().toTime_t()) )
- .replace( "(*ListOfFields*)" , QueryBuilder::dragSTQLFields() )
+ .replace( "(*ListOfFields*)" , QueryBuilder::dragSQLFields() )
.replace( "(*MountedDeviceSelection*)" ,
CollectionDB::instance()->deviceidSelection() );
}
@@ -3160,7 +3160,7 @@ TQString
SmartPlaylist::xmlToQuery(const TQDomElement &xml, bool forExpand /* = false */) {
QueryBuilder qb;
- qb.initSTQLDrag();
+ qb.initSQLDrag();
// This code is partly copied from SmartPlaylistEditor -- but refactoring
// to have it common would involve adding an internal data structure for smart
// playlist queries. I think having the XML be that data structure is almost as good,
diff --git a/amarok/src/sqlite/sqlite3.c b/amarok/src/sqlite/sqlite3.c
index 1c596d16..3d330da6 100644
--- a/amarok/src/sqlite/sqlite3.c
+++ b/amarok/src/sqlite/sqlite3.c
@@ -1,30 +1,30 @@
/******************************************************************************
-** This file is an amalgamation of many separate C source files from STQLite
+** This file is an amalgamation of many separate C source files from SQLite
** version 3.4.1. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a one translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
-** of 5% are more are commonly seen when STQLite is compiled as a single
+** of 5% are more are commonly seen when SQLite is compiled as a single
** translation unit.
**
-** This file is all you need to compile STQLite. To use STQLite in other
+** This file is all you need to compile SQLite. To use SQLite in other
** programs, you need this file and the "sqlite3.h" header file that defines
-** the programming interface to the STQLite library. (If you do not have
+** the programming interface to the SQLite library. (If you do not have
** the "sqlite3.h" header file at hand, you will find a copy in the first
** 2702 lines past this header comment.) Additional code files may be
-** needed if you want a wrapper to interface STQLite with your choice of
+** needed if you want a wrapper to interface SQLite with your choice of
** programming language. The code for the "sqlite3" command-line shell
** is also in a separate file. This file contains only code for the core
-** STQLite library.
+** SQLite library.
**
** This amalgamation was generated on 2007-07-20 11:05:39 UTC.
*/
-#define STQLITE_AMALGAMATION 1
-#ifndef STQLITE_PRIVATE
-# define STQLITE_PRIVATE static
+#define SQLITE_AMALGAMATION 1
+#ifndef SQLITE_PRIVATE
+# define SQLITE_PRIVATE static
#endif
-#ifndef STQLITE_API
-# define STQLITE_API
+#ifndef SQLITE_API
+# define SQLITE_API
#endif
/************** Begin file sqlite3.h *****************************************/
/*
@@ -38,21 +38,21 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
-** This header file defines the interface that the STQLite library
+** This header file defines the interface that the SQLite library
** presents to client programs. If a C-function, structure, datatype,
** or constant definition does not appear in this file, then it is
-** not a published API of STQLite, is subject to change without
-** notice, and should not be referenced by programs that use STQLite.
+** not a published API of SQLite, is subject to change without
+** notice, and should not be referenced by programs that use SQLite.
**
** Some of the definitions that are in this file are marked as
** "experimental". Experimental interfaces are normally new
-** features recently added to STQLite. 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.
**
-** The official C-language API documentation for STQLite is derived
+** The official C-language API documentation for SQLite is derived
** from comments in this file. This file is the authoritative source
-** on how STQLite interfaces are suppose to operate.
+** on how SQLite interfaces are suppose to operate.
**
** The name of this file under configuration management is "sqlite.h.in".
** The makefile makes some minor changes to this file (such as inserting
@@ -61,8 +61,8 @@
**
** @(#) $Id: sqlite.h.in,v 1.218 2007/07/19 12:41:40 drh Exp $
*/
-#ifndef _STQLITE3_H_
-#define _STQLITE3_H_
+#ifndef _SQLITE3_H_
+#define _SQLITE3_H_
#include <stdarg.h> /* Needed for the definition of va_list */
/*
@@ -76,18 +76,18 @@ extern "C" {
** Make sure these symbols where not defined by some previous header
** file.
*/
-#ifdef STQLITE_VERSION
-# undef STQLITE_VERSION
+#ifdef SQLITE_VERSION
+# undef SQLITE_VERSION
#endif
-#ifdef STQLITE_VERSION_NUMBER
-# undef STQLITE_VERSION_NUMBER
+#ifdef SQLITE_VERSION_NUMBER
+# undef SQLITE_VERSION_NUMBER
#endif
/*
** CAPI3REF: Compile-Time Library Version Numbers
**
-** The version of the STQLite library is contained in the sqlite3.h
-** header file in a #define named STQLITE_VERSION. The STQLITE_VERSION
+** The version of the SQLite library is contained in the sqlite3.h
+** header file in a #define named SQLITE_VERSION. The SQLITE_VERSION
** macro resolves to a string constant.
**
** The format of the version string is "X.Y.Z", where
@@ -95,48 +95,48 @@ extern "C" {
** is the release number. The X.Y.Z might be followed by "alpha" or "beta".
** For example "3.1.1beta".
**
-** The X value is always 3 in STQLite. The X value only changes when
+** The X value is always 3 in SQLite. The X value only changes when
** backwards compatibility is broken and we intend to never break
** backwards compatibility. The Y value only changes when
** there are major feature enhancements that are forwards compatible
** but not backwards compatible. The Z value is incremented with
** each release but resets back to 0 when Y is incremented.
**
-** The STQLITE_VERSION_NUMBER is an integer with the value
+** The SQLITE_VERSION_NUMBER is an integer with the value
** (X*1000000 + Y*1000 + Z). For example, for version "3.1.1beta",
-** STQLITE_VERSION_NUMBER is set to 3001001. To detect if they are using
+** SQLITE_VERSION_NUMBER is set to 3001001. To detect if they are using
** version 3.1.1 or greater at compile time, programs may use the test
-** (STQLITE_VERSION_NUMBER>=3001001).
+** (SQLITE_VERSION_NUMBER>=3001001).
**
** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
*/
-#define STQLITE_VERSION "3.4.1"
-#define STQLITE_VERSION_NUMBER 3004001
+#define SQLITE_VERSION "3.4.1"
+#define SQLITE_VERSION_NUMBER 3004001
/*
** CAPI3REF: Run-Time Library Version Numbers
**
** These routines return values equivalent to the header constants
-** [STQLITE_VERSION] and [STQLITE_VERSION_NUMBER]. The values returned
+** [SQLITE_VERSION] and [SQLITE_VERSION_NUMBER]. The values returned
** by this routines should only be different from the header values
** if you compile your program using an sqlite3.h header from a
-** different version of STQLite that the version of the library you
+** different version of SQLite that the version of the library you
** link against.
**
** The sqlite3_version[] string constant contains the text of the
-** [STQLITE_VERSION] string. The sqlite3_libversion() function returns
+** [SQLITE_VERSION] string. The sqlite3_libversion() function returns
** a poiner to the sqlite3_version[] string constant. The function
** is provided for DLL users who can only access functions and not
** constants within the DLL.
*/
extern const char sqlite3_version[];
-STQLITE_API const char *sqlite3_libversion(void);
+SQLITE_API const char *sqlite3_libversion(void);
int sqlite3_libversion_number(void);
/*
** CAPI3REF: Database Connection Handle
**
-** Each open STQLite database is represented by pointer to an instance of the
+** Each open SQLite database is represented by pointer to an instance of the
** opaque structure named "sqlite3". It is useful to think of an sqlite3
** pointer as an object. The [sqlite3_open] interface is its constructor
** and [sqlite3_close] is its destructor. There are many other interfaces
@@ -153,12 +153,12 @@ typedef struct sqlite3 sqlite3;
** Some compilers do not support the "long long" datatype. So we have
** to do compiler-specific typedefs for 64-bit signed and unsigned integers.
**
-** Many STQLite interface functions require a 64-bit integer arguments.
+** Many SQLite interface functions require a 64-bit integer arguments.
** Those interfaces are declared using this typedef.
*/
-#ifdef STQLITE_INT64_TYPE
- typedef STQLITE_INT64_TYPE sqlite_int64;
- typedef unsigned STQLITE_INT64_TYPE sqlite_uint64;
+#ifdef SQLITE_INT64_TYPE
+ typedef SQLITE_INT64_TYPE sqlite_int64;
+ typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
#elif defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 sqlite_int64;
typedef unsigned __int64 sqlite_uint64;
@@ -171,7 +171,7 @@ typedef struct sqlite3 sqlite3;
** If compiling for a processor that lacks floating point support,
** substitute integer for floating-point
*/
-#ifdef STQLITE_OMIT_FLOATING_POINT
+#ifdef SQLITE_OMIT_FLOATING_POINT
# define double sqlite_int64
#endif
@@ -184,10 +184,10 @@ typedef struct sqlite3 sqlite3;
**
** All SQL statements prepared using [sqlite3_prepare_v2()] or
** [sqlite3_prepare16_v2()] must be destroyed using [sqlite3_finalize()]
-** before this routine is called. Otherwise, STQLITE_BUSY is returned and the
+** before this routine is called. Otherwise, SQLITE_BUSY is returned and the
** database connection remains open.
*/
-STQLITE_API int sqlite3_close(sqlite3 *);
+SQLITE_API int sqlite3_close(sqlite3 *);
/*
** The type for a callback function.
@@ -210,7 +210,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
** invoked once for each row of the query result. This callback
** should normally return 0. If the callback returns a non-zero
** value then the query is aborted, all subsequent SQL statements
-** are skipped and the sqlite3_exec() function returns the STQLITE_ABORT.
+** are skipped and the sqlite3_exec() function returns the SQLITE_ABORT.
**
** The 4th parameter to this interface is an arbitrary pointer that is
** passed through to the callback function as its first parameter.
@@ -235,12 +235,12 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
** message. Use [sqlite3_free()] for this. If errmsg==NULL,
** then no error message is ever written.
**
-** The return value is is STQLITE_OK if there are no errors and
-** some other [STQLITE_OK | return code] if there is an error.
+** The return value is is SQLITE_OK if there are no errors and
+** some other [SQLITE_OK | return code] if there is an error.
** The particular return value depends on the type of error.
**
*/
-STQLITE_API int sqlite3_exec(
+SQLITE_API int sqlite3_exec(
sqlite3*, /* An open database */
const char *sql, /* SQL to be evaluted */
int (*callback)(void*,int,char**,char**), /* Callback function */
@@ -250,59 +250,59 @@ STQLITE_API int sqlite3_exec(
/*
** CAPI3REF: Result Codes
-** KEYWORDS: STQLITE_OK
+** KEYWORDS: SQLITE_OK
**
-** Many STQLite functions return an integer result code from the set shown
+** Many SQLite functions return an integer result code from the set shown
** above in order to indicates success or failure.
**
-** The result codes above are the only ones returned by STQLite in its
+** The result codes above are the only ones returned by SQLite in its
** default configuration. However, the [sqlite3_extended_result_codes()]
** API can be used to set a database connectoin to return more detailed
** result codes.
**
-** See also: [STQLITE_IOERR_READ | extended result codes]
+** See also: [SQLITE_IOERR_READ | extended result codes]
**
*/
-#define STQLITE_OK 0 /* Successful result */
+#define SQLITE_OK 0 /* Successful result */
/* beginning-of-error-codes */
-#define STQLITE_ERROR 1 /* SQL error or missing database */
-#define STQLITE_INTERNAL 2 /* NOT USED. Internal logic error in STQLite */
-#define STQLITE_PERM 3 /* Access permission denied */
-#define STQLITE_ABORT 4 /* Callback routine requested an abort */
-#define STQLITE_BUSY 5 /* The database file is locked */
-#define STQLITE_LOCKED 6 /* A table in the database is locked */
-#define STQLITE_NOMEM 7 /* A malloc() failed */
-#define STQLITE_READONLY 8 /* Attempt to write a readonly database */
-#define STQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
-#define STQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
-#define STQLITE_CORRUPT 11 /* The database disk image is malformed */
-#define STQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */
-#define STQLITE_FULL 13 /* Insertion failed because database is full */
-#define STQLITE_CANTOPEN 14 /* Unable to open the database file */
-#define STQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */
-#define STQLITE_EMPTY 16 /* Database is empty */
-#define STQLITE_SCHEMA 17 /* The database schema changed */
-#define STQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
-#define STQLITE_CONSTRAINT 19 /* Abort due to contraint violation */
-#define STQLITE_MISMATCH 20 /* Data type mismatch */
-#define STQLITE_MISUSE 21 /* Library used incorrectly */
-#define STQLITE_NOLFS 22 /* Uses OS features not supported on host */
-#define STQLITE_AUTH 23 /* Authorization denied */
-#define STQLITE_FORMAT 24 /* Auxiliary database format error */
-#define STQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
-#define STQLITE_NOTADB 26 /* File opened that is not a database file */
-#define STQLITE_ROW 100 /* sqlite3_step() has another row ready */
-#define STQLITE_DONE 101 /* sqlite3_step() has finished executing */
+#define SQLITE_ERROR 1 /* SQL error or missing database */
+#define SQLITE_INTERNAL 2 /* NOT USED. Internal logic error in SQLite */
+#define SQLITE_PERM 3 /* Access permission denied */
+#define SQLITE_ABORT 4 /* Callback routine requested an abort */
+#define SQLITE_BUSY 5 /* The database file is locked */
+#define SQLITE_LOCKED 6 /* A table in the database is locked */
+#define SQLITE_NOMEM 7 /* A malloc() failed */
+#define SQLITE_READONLY 8 /* Attempt to write a readonly database */
+#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
+#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
+#define SQLITE_CORRUPT 11 /* The database disk image is malformed */
+#define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */
+#define SQLITE_FULL 13 /* Insertion failed because database is full */
+#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
+#define SQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */
+#define SQLITE_EMPTY 16 /* Database is empty */
+#define SQLITE_SCHEMA 17 /* The database schema changed */
+#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
+#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */
+#define SQLITE_MISMATCH 20 /* Data type mismatch */
+#define SQLITE_MISUSE 21 /* Library used incorrectly */
+#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */
+#define SQLITE_AUTH 23 /* Authorization denied */
+#define SQLITE_FORMAT 24 /* Auxiliary database format error */
+#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
+#define SQLITE_NOTADB 26 /* File opened that is not a database file */
+#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
+#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
/* end-of-error-codes */
/*
** CAPI3REF: Extended Result Codes
**
-** In its default configuration, STQLite API routines return one of 26 integer
+** In its default configuration, SQLite API routines return one of 26 integer
** result codes described at result-codes. However, experience has shown that
** many of these result codes are too course-grained. They do not provide as
** much information about problems as users might like. In an effort to
-** address this, newer versions of STQLite (version 3.3.8 and later) include
+** address this, newer versions of SQLite (version 3.3.8 and later) include
** support for additional result codes that provide more detailed information
** about errors. The extended result codes are enabled (or disabled) for
** each database
@@ -311,7 +311,7 @@ STQLITE_API int sqlite3_exec(
** Some of the available extended result codes are listed above.
** We expect the number of extended result codes will be expand
** over time. Software that uses extended result codes should expect
-** to see new result codes in future releases of STQLite.
+** to see new result codes in future releases of SQLite.
**
** The symbolic name for an extended result code always contains a related
** primary result code as a prefix. Primary result codes contain a single
@@ -319,42 +319,42 @@ STQLITE_API int sqlite3_exec(
** The numeric value of an extended result code can be converted to its
** corresponding primary result code by masking off the lower 8 bytes.
**
-** The STQLITE_OK result code will never be extended. It will always
+** The SQLITE_OK result code will never be extended. It will always
** be exactly zero.
*/
-#define STQLITE_IOERR_READ (STQLITE_IOERR | (1<<8))
-#define STQLITE_IOERR_SHORT_READ (STQLITE_IOERR | (2<<8))
-#define STQLITE_IOERR_WRITE (STQLITE_IOERR | (3<<8))
-#define STQLITE_IOERR_FSYNC (STQLITE_IOERR | (4<<8))
-#define STQLITE_IOERR_DIR_FSYNC (STQLITE_IOERR | (5<<8))
-#define STQLITE_IOERR_TRUNCATE (STQLITE_IOERR | (6<<8))
-#define STQLITE_IOERR_FSTAT (STQLITE_IOERR | (7<<8))
-#define STQLITE_IOERR_UNLOCK (STQLITE_IOERR | (8<<8))
-#define STQLITE_IOERR_RDLOCK (STQLITE_IOERR | (9<<8))
-#define STQLITE_IOERR_DELETE (STQLITE_IOERR | (10<<8))
-#define STQLITE_IOERR_BLOCKED (STQLITE_IOERR | (11<<8))
+#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8))
+#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8))
+#define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8))
+#define SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4<<8))
+#define SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5<<8))
+#define SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6<<8))
+#define SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7<<8))
+#define SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8<<8))
+#define SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9<<8))
+#define SQLITE_IOERR_DELETE (SQLITE_IOERR | (10<<8))
+#define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8))
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
**
** This routine enables or disables the
-** [STQLITE_IOERR_READ | extended result codes] feature.
-** By default, STQLite API routines return one of only 26 integer
-** [STQLITE_OK | result codes]. When extended result codes
+** [SQLITE_IOERR_READ | extended result codes] feature.
+** By default, SQLite API routines return one of only 26 integer
+** [SQLITE_OK | result codes]. When extended result codes
** are enabled by this routine, the repetoire of result codes can be
** much larger and can (hopefully) provide more detailed information
** about the cause of an error.
**
** The second argument is a boolean value that turns extended result
** codes on and off. Extended result codes are off by default for
-** backwards compatibility with older versions of STQLite.
+** backwards compatibility with older versions of SQLite.
*/
int sqlite3_extended_result_codes(sqlite3*, int onoff);
/*
** CAPI3REF: Last Insert Rowid
**
-** Each entry in an STQLite table has a unique 64-bit signed integer key
+** Each entry in an SQLite table has a unique 64-bit signed integer key
** called the "rowid". The rowid is always available as an undeclared
** column named ROWID, OID, or _ROWID_. If the table has a column of
** type INTEGER PRIMARY KEY then that column is another an alias for the
@@ -396,7 +396,7 @@ sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
** then the changes in the inner, recursive call are counted together
** with the changes in the outer call.
**
-** STQLite implements the command "DELETE FROM table" without a WHERE clause
+** SQLite implements the command "DELETE FROM table" without a WHERE clause
** by dropping and recreating the table. (This is much faster than going
** through and deleting individual elements from the table.) Because of
** this optimization, the change count for "DELETE FROM table" will be
@@ -404,7 +404,7 @@ sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
** table. To get an accurate count of the number of rows deleted, use
** "DELETE FROM table WHERE 1" instead.
*/
-STQLITE_API int sqlite3_changes(sqlite3*);
+SQLITE_API int sqlite3_changes(sqlite3*);
/*
** CAPI3REF: Total Number Of Rows Modified
@@ -418,7 +418,7 @@ STQLITE_API int sqlite3_changes(sqlite3*);
**
** See also the [sqlite3_change()] interface.
**
-** STQLite implements the command "DELETE FROM table" without a WHERE clause
+** SQLite implements the command "DELETE FROM table" without a WHERE clause
** by dropping and recreating the table. (This is much faster than going
** through and deleting individual elements form the table.) Because of
** this optimization, the change count for "DELETE FROM table" will be
@@ -440,12 +440,12 @@ int sqlite3_total_changes(sqlite3*);
** It is safe to call this routine from a thread different from the
** thread that is currently running the database operation.
**
-** The SQL operation that is interrupted will return [STQLITE_INTERRUPT].
+** The SQL operation that is interrupted will return [SQLITE_INTERRUPT].
** If an interrupted operation was an update that is inside an
** explicit transaction, then the entire transaction will be rolled
** back automatically.
*/
-STQLITE_API void sqlite3_interrupt(sqlite3*);
+SQLITE_API void sqlite3_interrupt(sqlite3*);
/*
** CAPI3REF: Determine If An SQL Statement Is Complete
@@ -459,23 +459,23 @@ STQLITE_API void sqlite3_interrupt(sqlite3*);
** These routines are useful for command-line input to determine if the
** currently entered text forms one or more complete SQL statements or
** if additional input is needed before sending the statements into
-** STQLite for parsing. The algorithm is simple. If the
+** SQLite for parsing. The algorithm is simple. If the
** last token other than spaces and comments is a semicolon, then return
** true. Actually, the algorithm is a little more complicated than that
** in order to deal with triggers, but the basic idea is the same: the
** statement is not complete unless it ends in a semicolon.
*/
-STQLITE_API int sqlite3_complete(const char *sql);
-STQLITE_API int sqlite3_complete16(const void *sql);
+SQLITE_API int sqlite3_complete(const char *sql);
+SQLITE_API int sqlite3_complete16(const void *sql);
/*
-** CAPI3REF: Register A Callback To Handle STQLITE_BUSY Errors
+** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
**
** This routine identifies a callback function that might be invoked
** whenever an attempt is made to open a database table
** that another thread or process has locked.
-** If the busy callback is NULL, then [STQLITE_BUSY]
-** (or sometimes [STQLITE_IOERR_BLOCKED])
+** If the busy callback is NULL, then [SQLITE_BUSY]
+** (or sometimes [SQLITE_IOERR_BLOCKED])
** is returned immediately upon encountering the lock.
** If the busy callback is not NULL, then the
** callback will be invoked with two arguments. The
@@ -484,14 +484,14 @@ STQLITE_API int sqlite3_complete16(const void *sql);
** the handler is the number of times that the busy handler has
** been invoked for this locking event. If the
** busy callback returns 0, then no additional attempts are made to
-** access the database and [STQLITE_BUSY] or [STQLITE_IOERR_BLOCKED] is returned.
+** access the database and [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] is returned.
** If the callback returns non-zero, then another attempt is made to open the
** database for reading and the cycle repeats.
**
** The presence of a busy handler does not guarantee that
** it will be invoked when there is lock contention.
-** If STQLite determines that invoking the busy handler could result in
-** a deadlock, it will return [STQLITE_BUSY] instead.
+** If SQLite determines that invoking the busy handler could result in
+** a deadlock, it will return [SQLITE_BUSY] instead.
** Consider a scenario where one process is holding a read lock that
** it is trying to promote to a reserved lock and
** a second process is holding a reserved lock that it is trying
@@ -499,22 +499,22 @@ STQLITE_API int sqlite3_complete16(const void *sql);
** because it is blocked by the second and the second process cannot
** proceed because it is blocked by the first. If both processes
** invoke the busy handlers, neither will make any progress. Therefore,
-** STQLite returns [STQLITE_BUSY] for the first process, hoping that this
+** SQLite returns [SQLITE_BUSY] for the first process, hoping that this
** will induce the first process to release its read lock and allow
** the second process to proceed.
**
** The default busy callback is NULL.
**
-** The [STQLITE_BUSY] error is converted to [STQLITE_IOERR_BLOCKED] when
-** STQLite is in the middle of a large transaction where all the
-** changes will not fit into the in-memory cache. STQLite will
+** The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] when
+** SQLite is in the middle of a large transaction where all the
+** changes will not fit into the in-memory cache. SQLite will
** already hold a RESERVED lock on the database file, but it needs
** to promote this lock to EXCLUSIVE so that it can spill cache
** pages into the database file without harm to concurrent
** readers. If it is unable to promote the lock, then the in-memory
** cache will be left in an inconsistent state and so the error
-** code is promoted from the relatively benign [STQLITE_BUSY] to
-** the more severe [STQLITE_IOERR_BLOCKED]. This error code promotion
+** code is promoted from the relatively benign [SQLITE_BUSY] to
+** the more severe [SQLITE_IOERR_BLOCKED]. This error code promotion
** forces an automatic rollback of the changes. See the
** <a href="http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError">
** CorruptionFollowingBusyError</a> wiki page for a discussion of why
@@ -541,7 +541,7 @@ int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
** table is locked. The handler will sleep multiple times until
** at least "ms" milliseconds of sleeping have been done. After
** "ms" milliseconds of sleeping, the handler returns 0 which
-** causes [sqlite3_step()] to return [STQLITE_BUSY] or [STQLITE_IOERR_BLOCKED].
+** causes [sqlite3_step()] to return [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED].
**
** Calling this routine with an argument less than or equal to zero
** turns off all busy handlers.
@@ -699,53 +699,53 @@ void sqlite3_free_table(char **result);
** The code above will render a correct SQL statement in the zSQL
** variable even if the zText variable is a NULL pointer.
*/
-STQLITE_API char *sqlite3_mprintf(const char*,...);
-STQLITE_API char *sqlite3_vmprintf(const char*, va_list);
-STQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
+SQLITE_API char *sqlite3_mprintf(const char*,...);
+SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
+SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
/*
** CAPI3REF: Memory Allocation Functions
**
-** STQLite uses its own memory allocator. On some installations, this
+** SQLite uses its own memory allocator. On some installations, this
** memory allocator is identical to the standard malloc()/realloc()/free()
** and can be used interchangable. On others, the implementations are
** different. For maximum portability, it is best not to mix calls
** to the standard malloc/realloc/free with the sqlite versions.
*/
-STQLITE_API void *sqlite3_malloc(int);
-STQLITE_API void *sqlite3_realloc(void*, int);
-STQLITE_API void sqlite3_free(void*);
+SQLITE_API void *sqlite3_malloc(int);
+SQLITE_API void *sqlite3_realloc(void*, int);
+SQLITE_API void sqlite3_free(void*);
/*
** CAPI3REF: Compile-Time Authorization Callbacks
***
-** This routine registers a authorizer callback with the STQLite library.
+** This routine registers a authorizer callback with the SQLite library.
** The authorizer callback is invoked as SQL statements are being compiled
** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],
** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. At various
** points during the compilation process, as logic is being created
** to perform various actions, the authorizer callback is invoked to
** see if those actions are allowed. The authorizer callback should
-** return STQLITE_OK to allow the action, [STQLITE_IGNORE] to disallow the
+** return SQLITE_OK to allow the action, [SQLITE_IGNORE] to disallow the
** specific action but allow the SQL statement to continue to be
-** compiled, or [STQLITE_DENY] to cause the entire SQL statement to be
+** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
** rejected with an error.
**
-** Depending on the action, the [STQLITE_IGNORE] and [STQLITE_DENY] return
+** Depending on the action, the [SQLITE_IGNORE] and [SQLITE_DENY] return
** codes might mean something different or they might mean the same
** thing. If the action is, for example, to perform a delete opertion,
-** then [STQLITE_IGNORE] and [STQLITE_DENY] both cause the statement compilation
+** then [SQLITE_IGNORE] and [SQLITE_DENY] both cause the statement compilation
** to fail with an error. But if the action is to read a specific column
-** from a specific table, then [STQLITE_DENY] will cause the entire
-** statement to fail but [STQLITE_IGNORE] will cause a NULL value to be
+** from a specific table, then [SQLITE_DENY] will cause the entire
+** statement to fail but [SQLITE_IGNORE] will cause a NULL value to be
** read instead of the actual column value.
**
** The first parameter to the authorizer callback is a copy of
** the third parameter to the sqlite3_set_authorizer() interface.
** The second parameter to the callback is an integer
-** [STQLITE_COPY | action code] that specifies the particular action
+** [SQLITE_COPY | action code] that specifies the particular action
** to be authorized. The available action codes are
-** [STQLITE_COPY | documented separately]. The third through sixth
+** [SQLITE_COPY | documented separately]. The third through sixth
** parameters to the callback are strings that contain additional
** details about the action to be authorized.
**
@@ -779,13 +779,13 @@ int sqlite3_set_authorizer(
** CAPI3REF: Authorizer Return Codes
**
** The [sqlite3_set_authorizer | authorizer callback function] must
-** return either [STQLITE_OK] or one of these two constants in order
-** to signal STQLite whether or not the action is permitted. See the
+** return either [SQLITE_OK] or one of these two constants in order
+** to signal SQLite whether or not the action is permitted. See the
** [sqlite3_set_authorizer | authorizer documentation] for additional
** information.
*/
-#define STQLITE_DENY 1 /* Abort the SQL statement with an error */
-#define STQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */
+#define SQLITE_DENY 1 /* Abort the SQL statement with an error */
+#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */
/*
** CAPI3REF: Authorizer Action Codes
@@ -807,38 +807,38 @@ int sqlite3_set_authorizer(
** top-level SQL code.
*/
/******************************************* 3rd ************ 4th ***********/
-#define STQLITE_CREATE_INDEX 1 /* Index Name Table Name */
-#define STQLITE_CREATE_TABLE 2 /* Table Name NULL */
-#define STQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */
-#define STQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */
-#define STQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */
-#define STQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */
-#define STQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */
-#define STQLITE_CREATE_VIEW 8 /* View Name NULL */
-#define STQLITE_DELETE 9 /* Table Name NULL */
-#define STQLITE_DROP_INDEX 10 /* Index Name Table Name */
-#define STQLITE_DROP_TABLE 11 /* Table Name NULL */
-#define STQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */
-#define STQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */
-#define STQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */
-#define STQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */
-#define STQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */
-#define STQLITE_DROP_VIEW 17 /* View Name NULL */
-#define STQLITE_INSERT 18 /* Table Name NULL */
-#define STQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */
-#define STQLITE_READ 20 /* Table Name Column Name */
-#define STQLITE_SELECT 21 /* NULL NULL */
-#define STQLITE_TRANSACTION 22 /* NULL NULL */
-#define STQLITE_UPDATE 23 /* Table Name Column Name */
-#define STQLITE_ATTACH 24 /* Filename NULL */
-#define STQLITE_DETACH 25 /* Database Name NULL */
-#define STQLITE_ALTER_TABLE 26 /* Database Name Table Name */
-#define STQLITE_REINDEX 27 /* Index Name NULL */
-#define STQLITE_ANALYZE 28 /* Table Name NULL */
-#define STQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
-#define STQLITE_DROP_VTABLE 30 /* Table Name Module Name */
-#define STQLITE_FUNCTION 31 /* Function Name NULL */
-#define STQLITE_COPY 0 /* No longer used */
+#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */
+#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */
+#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */
+#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */
+#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */
+#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */
+#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */
+#define SQLITE_CREATE_VIEW 8 /* View Name NULL */
+#define SQLITE_DELETE 9 /* Table Name NULL */
+#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */
+#define SQLITE_DROP_TABLE 11 /* Table Name NULL */
+#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */
+#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */
+#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */
+#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */
+#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */
+#define SQLITE_DROP_VIEW 17 /* View Name NULL */
+#define SQLITE_INSERT 18 /* Table Name NULL */
+#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */
+#define SQLITE_READ 20 /* Table Name Column Name */
+#define SQLITE_SELECT 21 /* NULL NULL */
+#define SQLITE_TRANSACTION 22 /* NULL NULL */
+#define SQLITE_UPDATE 23 /* Table Name Column Name */
+#define SQLITE_ATTACH 24 /* Filename NULL */
+#define SQLITE_DETACH 25 /* Database Name NULL */
+#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */
+#define SQLITE_REINDEX 27 /* Index Name NULL */
+#define SQLITE_ANALYZE 28 /* Table Name NULL */
+#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
+#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
+#define SQLITE_FUNCTION 31 /* Function Name NULL */
+#define SQLITE_COPY 0 /* No longer used */
/*
** CAPI3REF: Tracing And Profiling Functions
@@ -854,8 +854,8 @@ int sqlite3_set_authorizer(
** The sqlite3_profile() API is currently considered experimental and
** is subject to change.
*/
-STQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
-STQLITE_API void *sqlite3_profile(sqlite3*,
+SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
+SQLITE_API void *sqlite3_profile(sqlite3*,
void(*xProfile)(void*,const char*,sqlite_uint64), void*);
/*
@@ -885,7 +885,7 @@ STQLITE_API void *sqlite3_profile(sqlite3*,
** If the progress callback returns a result other than 0, then the current
** query is immediately terminated and any database changes rolled back.
** The containing [sqlite3_exec()], [sqlite3_step()], or
-** [sqlite3_get_table()] call returns STQLITE_INTERRUPT. This feature
+** [sqlite3_get_table()] call returns SQLITE_INTERRUPT. This feature
** can be used, for example, to implement the "Cancel" button on a
** progress dialog box in a GUI.
*/
@@ -898,7 +898,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
** encoded for sqlite3_open() and UTF-16 encoded in the native byte order
** for sqlite3_open16(). An [sqlite3*] handle is returned in *ppDb, even
** if an error occurs. If the database is opened (or created) successfully,
-** then STQLITE_OK is returned. Otherwise an error code is returned. The
+** then SQLITE_OK is returned. Otherwise an error code is returned. The
** sqlite3_errmsg() or sqlite3_errmsg16() routines can be used to obtain
** an English language description of the error.
**
@@ -915,20 +915,20 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
** defined. Filenames containing international characters must be converted
** to UTF-8 prior to passing them into sqlite3_open().
*/
-STQLITE_API int sqlite3_open(
+SQLITE_API int sqlite3_open(
const char *filename, /* Database filename (UTF-8) */
- sqlite3 **ppDb /* OUT: STQLite db handle */
+ sqlite3 **ppDb /* OUT: SQLite db handle */
);
-STQLITE_API int sqlite3_open16(
+SQLITE_API int sqlite3_open16(
const void *filename, /* Database filename (UTF-16) */
- sqlite3 **ppDb /* OUT: STQLite db handle */
+ sqlite3 **ppDb /* OUT: SQLite db handle */
);
/*
** CAPI3REF: Error Codes And Messages
**
** The sqlite3_errcode() interface returns the numeric
-** [STQLITE_OK | result code] or [STQLITE_IOERR_READ | extended result code]
+** [SQLITE_OK | result code] or [SQLITE_IOERR_READ | extended result code]
** for the most recent failed sqlite3_* API call associated
** with [sqlite3] handle 'db'. If a prior API call failed but the
** most recent API call succeeded, the return value from sqlite3_errcode()
@@ -937,7 +937,7 @@ STQLITE_API int sqlite3_open16(
** The sqlite3_errmsg() and sqlite3_errmsg16() return English-langauge
** text that describes the error, as either UTF8 or UTF16 respectively.
** Memory to hold the error message string is managed internally. The
-** string may be overwritten or deallocated by subsequent calls to STQLite
+** string may be overwritten or deallocated by subsequent calls to SQLite
** interface functions.
**
** Calls to many sqlite3_* functions set the error code and string returned
@@ -952,9 +952,9 @@ STQLITE_API int sqlite3_open16(
** code returned by this function is associated with the same error as
** the strings returned by [sqlite3_errmsg()] and [sqlite3_errmsg16()].
*/
-STQLITE_API int sqlite3_errcode(sqlite3 *db);
-STQLITE_API const char *sqlite3_errmsg(sqlite3*);
-STQLITE_API const void *sqlite3_errmsg16(sqlite3*);
+SQLITE_API int sqlite3_errcode(sqlite3 *db);
+SQLITE_API const char *sqlite3_errmsg(sqlite3*);
+SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
/*
** CAPI3REF: SQL Statement Object
@@ -987,7 +987,7 @@ typedef struct sqlite3_stmt sqlite3_stmt;
** To execute an SQL query, it must first be compiled into a byte-code
** program using one of these routines.
**
-** The first argument "db" is an [sqlite3 | STQLite database handle]
+** The first argument "db" is an [sqlite3 | SQLite database handle]
** obtained from a prior call to [sqlite3_open()] or [sqlite3_open16()].
** The second argument "zSql" is the statement to be compiled, encoded
** as either UTF-8 or UTF-16. The sqlite3_prepare() and sqlite3_prepare_v2()
@@ -1013,8 +1013,8 @@ typedef struct sqlite3_stmt sqlite3_stmt;
** procedure is responsible for deleting the compiled SQL statement
** using [sqlite3_finalize()] after it has finished with it.
**
-** On success, [STQLITE_OK] is returned. Otherwise an
-** [STQLITE_ERROR | error code] is returned.
+** On success, [SQLITE_OK] is returned. Otherwise an
+** [SQLITE_ERROR | error code] is returned.
**
** The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are
** recommended for all new programs. The two older interfaces are retained
@@ -1026,30 +1026,30 @@ typedef struct sqlite3_stmt sqlite3_stmt;
**
** <ol>
** <li>
-** If the database schema changes, instead of returning [STQLITE_SCHEMA] as it
+** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
** always used to do, [sqlite3_step()] will automatically recompile the SQL
** statement and try to run it again. If the schema has changed in a way
** that makes the statement no longer valid, [sqlite3_step()] will still
-** return [STQLITE_SCHEMA]. But unlike the legacy behavior, [STQLITE_SCHEMA] is
+** return [SQLITE_SCHEMA]. But unlike the legacy behavior, [SQLITE_SCHEMA] is
** now a fatal error. Calling [sqlite3_prepare_v2()] again will not make the
** error go away. Note: use [sqlite3_errmsg()] to find the text of the parsing
-** error that results in an [STQLITE_SCHEMA] return.
+** error that results in an [SQLITE_SCHEMA] return.
** </li>
**
** <li>
** When an error occurs,
** [sqlite3_step()] will return one of the detailed
-** [STQLITE_ERROR | result codes] or
-** [STQLITE_IOERR_READ | extended result codes] such as directly.
+** [SQLITE_ERROR | result codes] or
+** [SQLITE_IOERR_READ | extended result codes] such as directly.
** The legacy behavior was that [sqlite3_step()] would only return a generic
-** [STQLITE_ERROR] result code and you would have to make a second call to
+** [SQLITE_ERROR] result code and you would have to make a second call to
** [sqlite3_reset()] in order to find the underlying cause of the problem.
** With the "v2" prepare interfaces, the underlying reason for the error is
** returned immediately.
** </li>
** </ol>
*/
-STQLITE_API int sqlite3_prepare(
+SQLITE_API int sqlite3_prepare(
sqlite3 *db, /* Database handle */
const char *zSql, /* SQL statement, UTF-8 encoded */
int nByte, /* Maximum length of zSql in bytes. */
@@ -1063,7 +1063,7 @@ int sqlite3_prepare_v2(
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
const char **pzTail /* OUT: Pointer to unused portion of zSql */
);
-STQLITE_API int sqlite3_prepare16(
+SQLITE_API int sqlite3_prepare16(
sqlite3 *db, /* Database handle */
const void *zSql, /* SQL statement, UTF-16 encoded */
int nByte, /* Maximum length of zSql in bytes. */
@@ -1081,7 +1081,7 @@ int sqlite3_prepare16_v2(
/*
** CAPI3REF: Dynamically Typed Value Object
**
-** STQLite uses dynamic typing for the values it stores. Values can
+** SQLite uses dynamic typing for the values it stores. Values can
** be integers, floating point values, strings, BLOBs, or NULL. When
** passing around values internally, each value is represented as
** an instance of the sqlite3_value object.
@@ -1129,7 +1129,7 @@ typedef struct sqlite3_context sqlite3_context;
** [sqlite3_bind_parameter_name()] API if desired. The index for "?NNN"
** parametes is the value of NNN.
** The NNN value must be between 1 and the compile-time
-** parameter STQLITE_MAX_VARIABLE_NUMBER (default value: 999).
+** parameter SQLITE_MAX_VARIABLE_NUMBER (default value: 999).
** See <a href="limits.html">limits.html</a> for additional information.
**
** The third argument is the value to bind to the parameter.
@@ -1144,10 +1144,10 @@ typedef struct sqlite3_context sqlite3_context;
**
** The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and
** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or
-** text after STQLite has finished with it. If the fifth argument is the
-** special value [STQLITE_STATIC], then the library assumes that the information
+** text after SQLite has finished with it. If the fifth argument is the
+** special value [SQLITE_STATIC], then the library assumes that the information
** is in static, unmanaged space and does not need to be freed. If the
-** fifth argument has the value [STQLITE_TRANSIENT], then STQLite makes its
+** fifth argument has the value [SQLITE_TRANSIENT], then SQLite makes its
** own private copy of the data immediately, before the sqlite3_bind_*()
** routine returns.
**
@@ -1164,10 +1164,10 @@ typedef struct sqlite3_context sqlite3_context;
** Bindings are not cleared by the [sqlite3_reset()] routine.
** Unbound parameters are interpreted as NULL.
**
-** These routines return [STQLITE_OK] on success or an error code if
-** anything goes wrong. [STQLITE_RANGE] is returned if the parameter
-** index is out of range. [STQLITE_NOMEM] is returned if malloc fails.
-** [STQLITE_MISUSE] is returned if these routines are called on a virtual
+** These routines return [SQLITE_OK] on success or an error code if
+** anything goes wrong. [SQLITE_RANGE] is returned if the parameter
+** index is out of range. [SQLITE_NOMEM] is returned if malloc fails.
+** [SQLITE_MISUSE] is returned if these routines are called on a virtual
** machine that is the wrong state or which has already been finalized.
*/
int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
@@ -1292,11 +1292,11 @@ const void *sqlite3_column_name16(sqlite3_stmt*, int N);
** name of the attached database, table and column that query result
** column was extracted from.
**
-** As with all other STQLite APIs, those postfixed with "16" return UTF-16
+** As with all other SQLite APIs, those postfixed with "16" return UTF-16
** encoded strings, the other functions return UTF-8.
**
** These APIs are only available if the library was compiled with the
-** STQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
+** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
*/
const char *sqlite3_column_database_name(sqlite3_stmt*,int);
const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
@@ -1327,9 +1327,9 @@ const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
** result column (i==1), and a NULL pointer for the first result column
** (i==0).
**
-** STQLite uses dynamic run-time typing. So just because a column
+** SQLite uses dynamic run-time typing. So just because a column
** is declared to contain a particular type does not mean that the
-** data stored in that column is of the declared type. STQLite is
+** data stored in that column is of the declared type. SQLite is
** strongly typed, but the typing is dynamic not static. Type
** is associated with individual values, not with the containers
** used to hold those values.
@@ -1353,71 +1353,71 @@ const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
** new "v2" interface is recommended for new applications but the legacy
** interface will continue to be supported.
**
-** In the lagacy interface, the return value will be either [STQLITE_BUSY],
-** [STQLITE_DONE], [STQLITE_ROW], [STQLITE_ERROR], or [STQLITE_MISUSE].
-** With the "v2" interface, any of the other [STQLITE_OK | result code]
-** or [STQLITE_IOERR_READ | extended result code] might be returned as
+** In the lagacy interface, the return value will be either [SQLITE_BUSY],
+** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE].
+** With the "v2" interface, any of the other [SQLITE_OK | result code]
+** or [SQLITE_IOERR_READ | extended result code] might be returned as
** well.
**
-** [STQLITE_BUSY] means that the database engine was unable to acquire the
+** [SQLITE_BUSY] means that the database engine was unable to acquire the
** database locks it needs to do its job. If the statement is a COMMIT
** or occurs outside of an explicit transaction, then you can retry the
** statement. If the statement is not a COMMIT and occurs within a
** explicit transaction then you should rollback the transaction before
** continuing.
**
-** [STQLITE_DONE] means that the statement has finished executing
+** [SQLITE_DONE] means that the statement has finished executing
** successfully. sqlite3_step() should not be called again on this virtual
** machine without first calling [sqlite3_reset()] to reset the virtual
** machine back to its initial state.
**
** If the SQL statement being executed returns any data, then
-** [STQLITE_ROW] is returned each time a new row of data is ready
+** [SQLITE_ROW] is returned each time a new row of data is ready
** for processing by the caller. The values may be accessed using
** the [sqlite3_column_int | column access functions].
** sqlite3_step() is called again to retrieve the next row of data.
**
-** [STQLITE_ERROR] means that a run-time error (such as a constraint
+** [SQLITE_ERROR] means that a run-time error (such as a constraint
** violation) has occurred. sqlite3_step() should not be called again on
** the VM. More information may be found by calling [sqlite3_errmsg()].
** With the legacy interface, a more specific error code (example:
-** [STQLITE_INTERRUPT], [STQLITE_SCHEMA], [STQLITE_CORRUPT], and so forth)
+** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth)
** can be obtained by calling [sqlite3_reset()] on the
** [sqlite_stmt | prepared statement]. In the "v2" interface,
** the more specific error code is returned directly by sqlite3_step().
**
-** [STQLITE_MISUSE] means that the this routine was called inappropriately.
+** [SQLITE_MISUSE] means that the this routine was called inappropriately.
** Perhaps it was called on a [sqlite_stmt | prepared statement] that has
** already been [sqlite3_finalize | finalized] or on one that had
-** previously returned [STQLITE_ERROR] or [STQLITE_DONE]. Or it could
+** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could
** be the case that the same database connection is being used by two or
** more threads at the same moment in time.
**
** <b>Goofy Interface Alert:</b>
** In the legacy interface,
** the sqlite3_step() API always returns a generic error code,
-** [STQLITE_ERROR], following any error other than [STQLITE_BUSY]
-** and [STQLITE_MISUSE]. You must call [sqlite3_reset()] or
+** [SQLITE_ERROR], following any error other than [SQLITE_BUSY]
+** and [SQLITE_MISUSE]. You must call [sqlite3_reset()] or
** [sqlite3_finalize()] in order to find one of the specific
-** [STQLITE_ERROR | result codes] that better describes the error.
+** [SQLITE_ERROR | result codes] that better describes the error.
** We admit that this is a goofy design. The problem has been fixed
** with the "v2" interface. If you prepare all of your SQL statements
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()], then the
-** more specific [STQLITE_ERROR | result codes] are returned directly
+** more specific [SQLITE_ERROR | result codes] are returned directly
** by sqlite3_step(). The use of the "v2" interface is recommended.
*/
-STQLITE_API int sqlite3_step(sqlite3_stmt*);
+SQLITE_API int sqlite3_step(sqlite3_stmt*);
/*
** CAPI3REF:
**
** Return the number of values in the current row of the result set.
**
-** After a call to [sqlite3_step()] that returns [STQLITE_ROW], this routine
+** After a call to [sqlite3_step()] that returns [SQLITE_ROW], this routine
** will return the same value as the [sqlite3_column_count()] function.
-** After [sqlite3_step()] has returned an [STQLITE_DONE], [STQLITE_BUSY], or
-** a [STQLITE_ERROR | error code], or before [sqlite3_step()] has been
+** After [sqlite3_step()] has returned an [SQLITE_DONE], [SQLITE_BUSY], or
+** a [SQLITE_ERROR | error code], or before [sqlite3_step()] has been
** called on the [sqlite_stmt | prepared statement] for the first time,
** this routine returns zero.
*/
@@ -1426,7 +1426,7 @@ int sqlite3_data_count(sqlite3_stmt *pStmt);
/*
** CAPI3REF: Fundamental Datatypes
**
-** Every value in STQLite has one of five fundamental datatypes:
+** Every value in SQLite has one of five fundamental datatypes:
**
** <ul>
** <li> 64-bit signed integer
@@ -1438,21 +1438,21 @@ int sqlite3_data_count(sqlite3_stmt *pStmt);
**
** These constants are codes for each of those types.
**
-** Note that the STQLITE_TEXT constant was also used in STQLite version 2
+** Note that the SQLITE_TEXT constant was also used in SQLite version 2
** for a completely different meaning. Software that links against both
-** STQLite version 2 and STQLite version 3 should use STQLITE3_TEXT not
-** STQLITE_TEXT.
-*/
-#define STQLITE_INTEGER 1
-#define STQLITE_FLOAT 2
-#define STQLITE_BLOB 4
-#define STQLITE_NULL 5
-#ifdef STQLITE_TEXT
-# undef STQLITE_TEXT
+** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT not
+** SQLITE_TEXT.
+*/
+#define SQLITE_INTEGER 1
+#define SQLITE_FLOAT 2
+#define SQLITE_BLOB 4
+#define SQLITE_NULL 5
+#ifdef SQLITE_TEXT
+# undef SQLITE_TEXT
#else
-# define STQLITE_TEXT 3
+# define SQLITE_TEXT 3
#endif
-#define STQLITE3_TEXT 3
+#define SQLITE3_TEXT 3
/*
** CAPI3REF: Results Values From A Query
@@ -1470,13 +1470,13 @@ int sqlite3_data_count(sqlite3_stmt *pStmt);
** the column index is out of range, the result is undefined.
**
** The sqlite3_column_type() routine returns
-** [STQLITE_INTEGER | datatype code] for the initial data type
-** of the result column. The returned value is one of [STQLITE_INTEGER],
-** [STQLITE_FLOAT], [STQLITE_TEXT], [STQLITE_BLOB], or [STQLITE_NULL]. The value
+** [SQLITE_INTEGER | datatype code] for the initial data type
+** of the result column. The returned value is one of [SQLITE_INTEGER],
+** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. The value
** returned by sqlite3_column_type() is only meaningful if no type
** conversions have occurred as described below. After a type conversion,
** the value returned by sqlite3_column_type() is undefined. Future
-** versions of STQLite may change the behavior of sqlite3_column_type()
+** versions of SQLite may change the behavior of sqlite3_column_type()
** following a type conversion.
**
** If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes()
@@ -1525,7 +1525,7 @@ int sqlite3_data_count(sqlite3_stmt *pStmt);
** </blockquote>
**
** The table above makes reference to standard C library functions atoi()
-** and atof(). STQLite does not really use these functions. It has its
+** and atof(). SQLite does not really use these functions. It has its
** on equavalent internal routines. The atoi() and atof() names are
** used in the table for brevity and because they are familiar to most
** C programmers.
@@ -1588,9 +1588,9 @@ sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
**
** The sqlite3_finalize() function is called to delete a
** [sqlite3_stmt | compiled SQL statement]. If the statement was
-** executed successfully, or not executed at all, then STQLITE_OK is returned.
+** executed successfully, or not executed at all, then SQLITE_OK is returned.
** If execution of the statement failed then an
-** [STQLITE_ERROR | error code] or [STQLITE_IOERR_READ | extended error code]
+** [SQLITE_ERROR | error code] or [SQLITE_IOERR_READ | extended error code]
** is returned.
**
** This routine can be called at any point during the execution of the
@@ -1599,9 +1599,9 @@ sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
** encountering an error or an interrupt. (See [sqlite3_interrupt()].)
** Incomplete updates may be rolled back and transactions cancelled,
** depending on the circumstances, and the
-** [STQLITE_ERROR | result code] returned will be [STQLITE_ABORT].
+** [SQLITE_ERROR | result code] returned will be [SQLITE_ABORT].
*/
-STQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
+SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
/*
** CAPI3REF: Reset A Prepared Statement Object
@@ -1613,7 +1613,7 @@ STQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values.
** Use [sqlite3_clear_bindings()] to reset the bindings.
*/
-STQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
+SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
/*
** CAPI3REF: Create Or Redefine SQL Functions
@@ -1635,24 +1635,24 @@ STQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
** The length of the name is limited to 255 bytes, exclusive of the
** zero-terminator. Note that the name length limit is in bytes, not
** characters. Any attempt to create a function with a longer name
-** will result in an STQLITE_ERROR error.
+** will result in an SQLITE_ERROR error.
**
** The third parameter is the number of arguments that the SQL function or
** aggregate takes. If this parameter is negative, then the SQL function or
** aggregate may take any number of arguments.
**
** The fourth parameter, eTextRep, specifies what
-** [STQLITE_UTF8 | text encoding] this SQL function prefers for
+** [SQLITE_UTF8 | text encoding] this SQL function prefers for
** its parameters. Any SQL function implementation should be able to work
** work with UTF-8, UTF-16le, or UTF-16be. But some implementations may be
** more efficient with one encoding than another. It is allowed to
** invoke sqlite_create_function() or sqlite3_create_function16() multiple
** times with the same function but with different values of eTextRep.
-** When multiple implementations of the same function are available, STQLite
+** When multiple implementations of the same function are available, SQLite
** will pick the one that involves the least amount of data conversion.
** If there is only a single implementation which does not care what
** text encoding is used, then the fourth argument should be
-** [STQLITE_ANY].
+** [SQLITE_ANY].
**
** The fifth parameter is an arbitrary pointer. The implementation
** of the function can gain access to this pointer using
@@ -1669,7 +1669,7 @@ STQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
**
** It is permitted to register multiple implementations of the same
** functions with the same name but with either differing numbers of
-** arguments or differing perferred text encodings. STQLite will use
+** arguments or differing perferred text encodings. SQLite will use
** the implementation most closely matches the way in which the
** SQL function is used.
*/
@@ -1698,14 +1698,14 @@ int sqlite3_create_function16(
** CAPI3REF: Text Encodings
**
** These constant define integer codes that represent the various
-** text encodings supported by STQLite.
+** text encodings supported by SQLite.
*/
-#define STQLITE_UTF8 1
-#define STQLITE_UTF16LE 2
-#define STQLITE_UTF16BE 3
-#define STQLITE_UTF16 4 /* Use native byte order */
-#define STQLITE_ANY 5 /* sqlite3_create_function only */
-#define STQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */
+#define SQLITE_UTF8 1
+#define SQLITE_UTF16LE 2
+#define SQLITE_UTF16BE 3
+#define SQLITE_UTF16 4 /* Use native byte order */
+#define SQLITE_ANY 5 /* sqlite3_create_function only */
+#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */
/*
** CAPI3REF: Obsolete Functions
@@ -1717,7 +1717,7 @@ int sqlite3_create_function16(
** using these functions, we are not going to tell you want they do.
*/
int sqlite3_aggregate_count(sqlite3_context*);
-STQLITE_API int sqlite3_expired(sqlite3_stmt*);
+SQLITE_API int sqlite3_expired(sqlite3_stmt*);
int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
int sqlite3_global_recover(void);
@@ -1753,7 +1753,7 @@ int sqlite3_global_recover(void);
** such a conversion is possible without loss of information (in order
** words if the value is original a string that looks like a number)
** then it is done. Otherwise no conversion occurs. The
-** [STQLITE_INTEGER | datatype] after conversion is returned.
+** [SQLITE_INTEGER | datatype] after conversion is returned.
**
** Please pay particular attention to the fact that the pointer that
** is returned from [sqlite3_value_blob()], [sqlite3_value_text()], or
@@ -1784,7 +1784,7 @@ int sqlite3_value_numeric_type(sqlite3_value*);
** same aggregate instance) the same buffer is returned. The implementation
** of the aggregate can use the returned buffer to accumulate data.
**
-** The buffer allocated is freed automatically by STQLite whan the aggregate
+** The buffer allocated is freed automatically by SQLite whan the aggregate
** query concludes.
**
** The first parameter should be a copy of the
@@ -1843,18 +1843,18 @@ void sqlite3_set_auxdata(sqlite3_context*, int, void*, void (*)(void*));
**
** These are special value for the destructor that is passed in as the
** final argument to routines like [sqlite3_result_blob()]. If the destructor
-** argument is STQLITE_STATIC, it means that the content pointer is constant
+** argument is SQLITE_STATIC, it means that the content pointer is constant
** and will never change. It does not need to be destroyed. The
-** STQLITE_TRANSIENT value means that the content will likely change in
-** the near future and that STQLite should make its own private copy of
+** SQLITE_TRANSIENT value means that the content will likely change in
+** the near future and that SQLite should make its own private copy of
** the content before returning.
**
** The typedef is necessary to work around problems in certain
** C++ compilers. See ticket #2191.
*/
typedef void (*sqlite3_destructor_type)(void*);
-#define STQLITE_STATIC ((sqlite3_destructor_type)0)
-#define STQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
+#define SQLITE_STATIC ((sqlite3_destructor_type)0)
+#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
/*
** CAPI3REF: Setting The Result Of An SQL Function
@@ -1906,14 +1906,14 @@ void sqlite3_result_zeroblob(sqlite3_context*, int n);
** and a UTF-16 string for sqlite3_create_collation16(). In all cases
** the name is passed as the second function argument.
**
-** The third argument must be one of the constants [STQLITE_UTF8],
-** [STQLITE_UTF16LE] or [STQLITE_UTF16BE], indicating that the user-supplied
+** The third argument must be one of the constants [SQLITE_UTF8],
+** [SQLITE_UTF16LE] or [SQLITE_UTF16BE], indicating that the user-supplied
** routine expects to be passed pointers to strings encoded using UTF-8,
** UTF-16 little-endian or UTF-16 big-endian respectively.
**
** A pointer to the user supplied routine must be passed as the fifth
** argument. If it is NULL, this is the same as deleting the collation
-** sequence (so that STQLite cannot call it anymore). Each time the user
+** sequence (so that SQLite cannot call it anymore). Each time the user
** supplied function is invoked, it is passed a copy of the void* passed as
** the fourth argument to sqlite3_create_collation() or
** sqlite3_create_collation16() as its first parameter.
@@ -1977,8 +1977,8 @@ int sqlite3_create_collation16(
** When the callback is invoked, the first argument passed is a copy
** of the second argument to sqlite3_collation_needed() or
** sqlite3_collation_needed16(). The second argument is the database
-** handle. The third argument is one of [STQLITE_UTF8], [STQLITE_UTF16BE], or
-** [STQLITE_UTF16LE], indicating the most desirable form of the collation
+** handle. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], or
+** [SQLITE_UTF16LE], indicating the most desirable form of the collation
** sequence function required. The fourth parameter is the name of the
** required collation sequence.
**
@@ -2002,9 +2002,9 @@ int sqlite3_collation_needed16(
** called right after sqlite3_open().
**
** The code to implement this API is not available in the public release
-** of STQLite.
+** of SQLite.
*/
-STQLITE_API int sqlite3_key(
+SQLITE_API int sqlite3_key(
sqlite3 *db, /* Database to be rekeyed */
const void *pKey, int nKey /* The key */
);
@@ -2015,9 +2015,9 @@ STQLITE_API int sqlite3_key(
** database is decrypted.
**
** The code to implement this API is not available in the public release
-** of STQLite.
+** of SQLite.
*/
-STQLITE_API int sqlite3_rekey(
+SQLITE_API int sqlite3_rekey(
sqlite3 *db, /* Database to be rekeyed */
const void *pKey, int nKey /* The new key */
);
@@ -2033,15 +2033,15 @@ STQLITE_API int sqlite3_rekey(
** the nearest second. The number of milliseconds of sleep actually
** requested from the operating system is returned.
*/
-STQLITE_API int sqlite3_sleep(int);
+SQLITE_API int sqlite3_sleep(int);
/*
** CAPI3REF: Name Of The Folder Holding Temporary Files
**
** If this global variable is made to point to a string which is
** the name of a folder (a.ka. directory), then all temporary files
-** created by STQLite will be placed in that directory. If this variable
-** is NULL pointer, then STQLite does a search for an appropriate temporary
+** created by SQLite will be placed in that directory. If this variable
+** is NULL pointer, then SQLite does a search for an appropriate temporary
** file directory.
**
** Once [sqlite3_open()] has been called, changing this variable will
@@ -2109,7 +2109,7 @@ void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
** The second argument is a pointer to the function to invoke when a
** row is updated, inserted or deleted. The first argument to the callback is
** a copy of the third argument to sqlite3_update_hook(). The second callback
-** argument is one of STQLITE_INSERT, STQLITE_DELETE or STQLITE_UPDATE, depending
+** argument is one of SQLITE_INSERT, SQLITE_DELETE or SQLITE_UPDATE, depending
** on the operation that caused the callback to be invoked. The third and
** fourth arguments to the callback contain pointers to the database and
** table name containing the affected row. The final callback parameter is
@@ -2163,8 +2163,8 @@ void *sqlite3_update_hook(
** cache is enabled, the sqlite3_create_module() API used to register
** virtual tables will always return an error.
**
-** This routine returns [STQLITE_OK] if shared cache was
-** enabled or disabled successfully. An [STQLITE_ERROR | error code]
+** This routine returns [SQLITE_OK] if shared cache was
+** enabled or disabled successfully. An [SQLITE_ERROR | error code]
** is returned otherwise.
**
** Shared cache is disabled by default for backward compatibility.
@@ -2179,7 +2179,7 @@ int sqlite3_enable_shared_cache(int);
** used to cache database pages to improve performance).
**
** This function is not a part of standard builds. It is only created
-** if STQLite is compiled with the STQLITE_ENABLE_MEMORY_MANAGEMENT macro.
+** if SQLite is compiled with the SQLITE_ENABLE_MEMORY_MANAGEMENT macro.
*/
int sqlite3_release_memory(int);
@@ -2187,7 +2187,7 @@ int sqlite3_release_memory(int);
** CAPI3REF: Impose A Limit On Heap Size
**
** Place a "soft" limit on the amount of heap memory that may be allocated by
-** STQLite within the current thread. If an internal allocation is requested
+** SQLite within the current thread. If an internal allocation is requested
** that would exceed the specified limit, [sqlite3_release_memory()] is invoked
** one or more times to free up some space before the allocation is made.
**
@@ -2203,13 +2203,13 @@ int sqlite3_release_memory(int);
** [sqlite3_release_memory()] will only be called when memory is exhaused.
** The default value for the soft heap limit is zero.
**
-** STQLite makes a best effort to honor the soft heap limit. But if it
+** SQLite makes a best effort to honor the soft heap limit. But if it
** is unable to reduce memory usage below the soft limit, execution will
** continue without error or notification. This is why the limit is
** called a "soft" limit. It is advisory only.
**
** This function is only available if the library was compiled with the
-** STQLITE_ENABLE_MEMORY_MANAGEMENT option set.
+** SQLITE_ENABLE_MEMORY_MANAGEMENT option set.
** memory-management has been enabled.
*/
void sqlite3_soft_heap_limit(int);
@@ -2287,11 +2287,11 @@ void sqlite3_thread_cleanup(void);
**
** This function may load one or more schemas from database files. If an
** error occurs during this process, or if the requested table or column
-** cannot be found, an STQLITE error code is returned and an error message
+** cannot be found, an SQLITE error code is returned and an error message
** left in the database handle (to be retrieved using sqlite3_errmsg()).
**
** This API is only available if the library was compiled with the
-** STQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
+** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
*/
int sqlite3_table_column_metadata(
sqlite3 *db, /* Connection handle */
@@ -2308,11 +2308,11 @@ int sqlite3_table_column_metadata(
/*
** CAPI3REF: Load An Extension
**
-** Attempt to load an STQLite extension library contained in the file
+** Attempt to load an SQLite extension library contained in the file
** zFile. The entry point is zProc. zProc may be 0 in which case the
** name of the entry point defaults to "sqlite3_extension_init".
**
-** Return [STQLITE_OK] on success and [STQLITE_ERROR] if something goes wrong.
+** Return [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
**
** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
** error message text. The calling function should free this memory
@@ -2365,7 +2365,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
** Automatic extensions apply across all threads.
**
** This interface is experimental and is subject to change or
-** removal in future releases of STQLite.
+** removal in future releases of SQLite.
*/
int sqlite3_auto_extension(void *xEntryPoint);
@@ -2380,7 +2380,7 @@ int sqlite3_auto_extension(void *xEntryPoint);
** This call disabled automatic extensions in all threads.
**
** This interface is experimental and is subject to change or
-** removal in future releases of STQLite.
+** removal in future releases of SQLite.
*/
void sqlite3_reset_auto_extension(void);
@@ -2472,7 +2472,7 @@ struct sqlite3_module {
** the right-hand side of the corresponding aConstraint[] is evaluated
** and becomes the argvIndex-th entry in argv. If aConstraintUsage[].omit
** is true, then the constraint is assumed to be fully handled by the
-** virtual table and is not checked again by STQLite.
+** virtual table and is not checked again by SQLite.
**
** The idxNum and idxPtr values are recorded and passed into xFilter.
** sqlite3_free() is used to free idxPtr if needToFreeIdxPtr is true.
@@ -2512,21 +2512,21 @@ struct sqlite3_index_info {
int orderByConsumed; /* True if output is already ordered */
double estimatedCost; /* Estimated cost of using this index */
};
-#define STQLITE_INDEX_CONSTRAINT_EQ 2
-#define STQLITE_INDEX_CONSTRAINT_GT 4
-#define STQLITE_INDEX_CONSTRAINT_LE 8
-#define STQLITE_INDEX_CONSTRAINT_LT 16
-#define STQLITE_INDEX_CONSTRAINT_GE 32
-#define STQLITE_INDEX_CONSTRAINT_MATCH 64
+#define SQLITE_INDEX_CONSTRAINT_EQ 2
+#define SQLITE_INDEX_CONSTRAINT_GT 4
+#define SQLITE_INDEX_CONSTRAINT_LE 8
+#define SQLITE_INDEX_CONSTRAINT_LT 16
+#define SQLITE_INDEX_CONSTRAINT_GE 32
+#define SQLITE_INDEX_CONSTRAINT_MATCH 64
/*
-** This routine is used to register a new module name with an STQLite
+** This routine is used to register a new module name with an SQLite
** connection. Module names must be registered before creating new
** virtual tables on the module, or before using preexisting virtual
** tables of the module.
*/
int sqlite3_create_module(
- sqlite3 *db, /* STQLite connection to register module with */
+ sqlite3 *db, /* SQLite connection to register module with */
const char *zName, /* Name of the module */
const sqlite3_module *, /* Methods for the module */
void * /* Client data for xCreate/xConnect */
@@ -2538,7 +2538,7 @@ int sqlite3_create_module(
** even more experimental than the rest of the virtual tables API.
*/
int sqlite3_create_module_v2(
- sqlite3 *db, /* STQLite connection to register module with */
+ sqlite3 *db, /* SQLite connection to register module with */
const char *zName, /* Name of the module */
const sqlite3_module *, /* Methods for the module */
void *, /* Client data for xCreate/xConnect */
@@ -2648,7 +2648,7 @@ typedef struct sqlite3_blob sqlite3_blob;
** read and write access. If it is zero, the blob is opened for read
** access.
**
-** On success, [STQLITE_OK] is returned and the new
+** On success, [SQLITE_OK] is returned and the new
** [sqlite3_blob | blob handle] is written to *ppBlob.
** Otherwise an error code is returned and
** any value written to *ppBlob should not be used by the caller.
@@ -2688,9 +2688,9 @@ int sqlite3_blob_bytes(sqlite3_blob *);
** n bytes of data are copied into buffer
** z from the open blob, starting at offset iOffset.
**
-** On success, STQLITE_OK is returned. Otherwise, an
-** [STQLITE_ERROR | STQLite error code] or an
-** [STQLITE_IOERR_READ | extended error code] is returned.
+** On success, SQLITE_OK is returned. Otherwise, an
+** [SQLITE_ERROR | SQLite error code] or an
+** [SQLITE_IOERR_READ | extended error code] is returned.
*/
int sqlite3_blob_read(sqlite3_blob *, void *z, int n, int iOffset);
@@ -2704,16 +2704,16 @@ int sqlite3_blob_read(sqlite3_blob *, void *z, int n, int iOffset);
**
** If the [sqlite3_blob | blob-handle] passed as the first argument
** was not opened for writing (the flags parameter to [sqlite3_blob_open()]
-*** was zero), this function returns [STQLITE_READONLY].
+*** was zero), this function returns [SQLITE_READONLY].
**
** This function may only modify the contents of the blob, it is
** not possible to increase the size of a blob using this API. If
** offset iOffset is less than n bytes from the end of the blob,
-** [STQLITE_ERROR] is returned and no data is written.
+** [SQLITE_ERROR] is returned and no data is written.
**
-** On success, STQLITE_OK is returned. Otherwise, an
-** [STQLITE_ERROR | STQLite error code] or an
-** [STQLITE_IOERR_READ | extended error code] is returned.
+** On success, SQLITE_OK is returned. Otherwise, an
+** [SQLITE_ERROR | SQLite error code] or an
+** [SQLITE_IOERR_READ | extended error code] is returned.
*/
int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
@@ -2721,7 +2721,7 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** Undo the hack that converts floating point types to integer for
** builds on processors without floating point support.
*/
-#ifdef STQLITE_OMIT_FLOATING_POINT
+#ifdef SQLITE_OMIT_FLOATING_POINT
# undef double
#endif
@@ -2744,7 +2744,7 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
**
*************************************************************************
** This file contains the C functions that implement date and time
-** functions for STQLite.
+** functions for SQLite.
**
** There is only one exported symbol in this file - the function
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
@@ -2752,7 +2752,7 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
**
** $Id: date.c,v 1.66 2007/05/08 21:56:00 drh Exp $
**
-** STQLite processes all times and dates as Julian Day numbers. The
+** SQLite processes all times and dates as Julian Day numbers. The
** dates and times are stored as the number of days since noon
** in Greenwich on November 24, 4714 B.C. according to the Gregorian
** calendar system.
@@ -2792,12 +2792,12 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** May you share freely, never taking more than you give.
**
*************************************************************************
-** Internal interface definitions for STQLite.
+** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.578 2007/06/26 10:38:55 danielk1977 Exp $
*/
-#ifndef _STQLITEINT_H_
-#define _STQLITEINT_H_
+#ifndef _SQLITEINT_H_
+#define _SQLITEINT_H_
/************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
/************** Begin file sqliteLimit.h *************************************/
/*
@@ -2812,7 +2812,7 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
**
*************************************************************************
**
-** This file defines various limits of what STQLite can process.
+** This file defines various limits of what SQLite can process.
**
** @(#) $Id: sqliteLimit.h,v 1.1 2007/06/19 15:23:48 drh Exp $
*/
@@ -2824,8 +2824,8 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** The hard limit is the ability of a 32-bit signed integer
** to count the size: 2^31-1 or 2147483647.
*/
-#ifndef STQLITE_MAX_LENGTH
-# define STQLITE_MAX_LENGTH 1000000000
+#ifndef SQLITE_MAX_LENGTH
+# define SQLITE_MAX_LENGTH 1000000000
#endif
/*
@@ -2845,27 +2845,27 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** that is the case, there is no point in having more than a few
** dozen values in any of the other situations described above.
*/
-#ifndef STQLITE_MAX_COLUMN
-# define STQLITE_MAX_COLUMN 2000
+#ifndef SQLITE_MAX_COLUMN
+# define SQLITE_MAX_COLUMN 2000
#endif
/*
** The maximum length of a single SQL statement in bytes.
-** The hard limit here is the same as STQLITE_MAX_LENGTH.
+** The hard limit here is the same as SQLITE_MAX_LENGTH.
*/
-#ifndef STQLITE_MAX_STQL_LENGTH
-# define STQLITE_MAX_STQL_LENGTH 1000000
+#ifndef SQLITE_MAX_SQL_LENGTH
+# define SQLITE_MAX_SQL_LENGTH 1000000
#endif
/*
** The maximum depth of an expression tree. This is limited to
-** some extent by STQLITE_MAX_STQL_LENGTH. But sometime you might
+** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might
** want to place more severe limits on the complexity of an
** expression. A value of 0 (the default) means do not enforce
** any limitation on expression tree depth.
*/
-#ifndef STQLITE_MAX_EXPR_DEPTH
-# define STQLITE_MAX_EXPR_DEPTH 1000
+#ifndef SQLITE_MAX_EXPR_DEPTH
+# define SQLITE_MAX_EXPR_DEPTH 1000
#endif
/*
@@ -2876,34 +2876,34 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** never has more than 3 or 4 terms. Use a value of 0 to disable
** any limit on the number of terms in a compount SELECT.
*/
-#ifndef STQLITE_MAX_COMPOUND_SELECT
-# define STQLITE_MAX_COMPOUND_SELECT 500
+#ifndef SQLITE_MAX_COMPOUND_SELECT
+# define SQLITE_MAX_COMPOUND_SELECT 500
#endif
/*
** The maximum number of opcodes in a VDBE program.
** Not currently enforced.
*/
-#ifndef STQLITE_MAX_VDBE_OP
-# define STQLITE_MAX_VDBE_OP 25000
+#ifndef SQLITE_MAX_VDBE_OP
+# define SQLITE_MAX_VDBE_OP 25000
#endif
/*
** The maximum number of arguments to an SQL function.
*/
-#ifndef STQLITE_MAX_FUNCTION_ARG
-# define STQLITE_MAX_FUNCTION_ARG 100
+#ifndef SQLITE_MAX_FUNCTION_ARG
+# define SQLITE_MAX_FUNCTION_ARG 100
#endif
/*
** The maximum number of in-memory pages to use for the main database
-** table and for temporary tables. The STQLITE_DEFAULT_CACHE_SIZE
+** table and for temporary tables. The SQLITE_DEFAULT_CACHE_SIZE
*/
-#ifndef STQLITE_DEFAULT_CACHE_SIZE
-# define STQLITE_DEFAULT_CACHE_SIZE 2000
+#ifndef SQLITE_DEFAULT_CACHE_SIZE
+# define SQLITE_DEFAULT_CACHE_SIZE 2000
#endif
-#ifndef STQLITE_DEFAULT_TEMP_CACHE_SIZE
-# define STQLITE_DEFAULT_TEMP_CACHE_SIZE 500
+#ifndef SQLITE_DEFAULT_TEMP_CACHE_SIZE
+# define SQLITE_DEFAULT_TEMP_CACHE_SIZE 500
#endif
/*
@@ -2913,31 +2913,31 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** we use a bitmask of databases with a u32 in places (for example
** the Parse.cookieMask field).
*/
-#ifndef STQLITE_MAX_ATTACHED
-# define STQLITE_MAX_ATTACHED 10
+#ifndef SQLITE_MAX_ATTACHED
+# define SQLITE_MAX_ATTACHED 10
#endif
/*
** The maximum value of a ?nnn wildcard that the parser will accept.
*/
-#ifndef STQLITE_MAX_VARIABLE_NUMBER
-# define STQLITE_MAX_VARIABLE_NUMBER 999
+#ifndef SQLITE_MAX_VARIABLE_NUMBER
+# define SQLITE_MAX_VARIABLE_NUMBER 999
#endif
/*
** The default size of a database page.
*/
-#ifndef STQLITE_DEFAULT_PAGE_SIZE
-# define STQLITE_DEFAULT_PAGE_SIZE 1024
+#ifndef SQLITE_DEFAULT_PAGE_SIZE
+# define SQLITE_DEFAULT_PAGE_SIZE 1024
#endif
/* Maximum page size. The upper bound on this value is 32768. This a limit
** imposed by the necessity of storing the value in a 2-byte unsigned integer
** and the fact that the page size must be a power of 2.
*/
-#ifndef STQLITE_MAX_PAGE_SIZE
-# define STQLITE_MAX_PAGE_SIZE 32768
+#ifndef SQLITE_MAX_PAGE_SIZE
+# define SQLITE_MAX_PAGE_SIZE 32768
#endif
/*
@@ -2947,34 +2947,34 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** This value can be lowered (or raised) at run-time using that the
** max_page_count macro.
*/
-#ifndef STQLITE_MAX_PAGE_COUNT
-# define STQLITE_MAX_PAGE_COUNT 1073741823
+#ifndef SQLITE_MAX_PAGE_COUNT
+# define SQLITE_MAX_PAGE_COUNT 1073741823
#endif
/*
** Maximum length (in bytes) of the pattern in a LIKE or GLOB
** operator.
*/
-#ifndef STQLITE_MAX_LIKE_PATTERN_LENGTH
-# define STQLITE_MAX_LIKE_PATTERN_LENGTH 50000
+#ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH
+# define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000
#endif
/************** End of sqliteLimit.h *****************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
-#if defined(STQLITE_TCL) || defined(TCLSH)
+#if defined(SQLITE_TCL) || defined(TCLSH)
# include <tcl.h>
#endif
/*
-** Many people are failing to set -DNDEBUG=1 when compiling STQLite.
+** Many people are failing to set -DNDEBUG=1 when compiling SQLite.
** Setting NDEBUG makes the code smaller and run faster. So the following
-** lines are added to automatically set NDEBUG unless the -DSTQLITE_DEBUG=1
+** lines are added to automatically set NDEBUG unless the -DSQLITE_DEBUG=1
** option is set. Thus NDEBUG becomes an opt-in rather than an opt-out
** feature.
*/
-#if !defined(NDEBUG) && !defined(STQLITE_DEBUG)
+#if !defined(NDEBUG) && !defined(SQLITE_DEBUG)
# define NDEBUG 1
#endif
@@ -2983,7 +2983,7 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** underlying operating system supports it. If the OS lacks
** large file support, or if the OS is windows, these should be no-ops.
**
-** Large file support can be disabled using the -DSTQLITE_DISABLE_LFS switch
+** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
** on the compiler command line. This is necessary if you are compiling
** on a recent machine (ex: RedHat 7.2) but you want your code to work
** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2
@@ -2993,7 +2993,7 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
**
** Similar is true for MacOS. LFS is only supported on MacOS 9 and later.
*/
-#ifndef STQLITE_DISABLE_LFS
+#ifndef SQLITE_DISABLE_LFS
# define _LARGE_FILE 1
# ifndef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64
@@ -3015,12 +3015,12 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
**
*************************************************************************
** This is the header file for the generic hash-table implemenation
-** used in STQLite.
+** used in SQLite.
**
** $Id: hash.h,v 1.9 2006/02/14 10:48:39 danielk1977 Exp $
*/
-#ifndef _STQLITE_HASH_H_
-#define _STQLITE_HASH_H_
+#ifndef _SQLITE_HASH_H_
+#define _SQLITE_HASH_H_
/* Forward declarations of structures. */
typedef struct Hash Hash;
@@ -3035,7 +3035,7 @@ typedef struct HashElem HashElem;
** this structure opaque.
*/
struct Hash {
- char keyClass; /* STQLITE_HASH_INT, _POINTER, _STRING, _BINARY */
+ char keyClass; /* SQLITE_HASH_INT, _POINTER, _STRING, _BINARY */
char copyKey; /* True if copy of key made on insert */
int count; /* Number of entries in this table */
HashElem *first; /* The first element of the array */
@@ -3063,32 +3063,32 @@ struct HashElem {
/*
** There are 4 different modes of operation for a hash table:
**
-** STQLITE_HASH_INT nKey is used as the key and pKey is ignored.
+** SQLITE_HASH_INT nKey is used as the key and pKey is ignored.
**
-** STQLITE_HASH_POINTER pKey is used as the key and nKey is ignored.
+** SQLITE_HASH_POINTER pKey is used as the key and nKey is ignored.
**
-** STQLITE_HASH_STRING pKey points to a string that is nKey bytes long
+** SQLITE_HASH_STRING pKey points to a string that is nKey bytes long
** (including the null-terminator, if any). Case
** is ignored in comparisons.
**
-** STQLITE_HASH_BINARY pKey points to binary data nKey bytes long.
+** SQLITE_HASH_BINARY pKey points to binary data nKey bytes long.
** memcmp() is used to compare keys.
**
-** A copy of the key is made for STQLITE_HASH_STRING and STQLITE_HASH_BINARY
+** A copy of the key is made for SQLITE_HASH_STRING and SQLITE_HASH_BINARY
** if the copyKey parameter to HashInit is 1.
*/
-/* #define STQLITE_HASH_INT 1 // NOT USED */
-/* #define STQLITE_HASH_POINTER 2 // NOT USED */
-#define STQLITE_HASH_STRING 3
-#define STQLITE_HASH_BINARY 4
+/* #define SQLITE_HASH_INT 1 // NOT USED */
+/* #define SQLITE_HASH_POINTER 2 // NOT USED */
+#define SQLITE_HASH_STRING 3
+#define SQLITE_HASH_BINARY 4
/*
** Access routines. To delete, insert a NULL pointer.
*/
-STQLITE_PRIVATE void sqlite3HashInit(Hash*, int keytype, int copyKey);
-STQLITE_PRIVATE void *sqlite3HashInsert(Hash*, const void *pKey, int nKey, void *pData);
-STQLITE_PRIVATE void *sqlite3HashFind(const Hash*, const void *pKey, int nKey);
-STQLITE_PRIVATE void sqlite3HashClear(Hash*);
+SQLITE_PRIVATE void sqlite3HashInit(Hash*, int keytype, int copyKey);
+SQLITE_PRIVATE void *sqlite3HashInsert(Hash*, const void *pKey, int nKey, void *pData);
+SQLITE_PRIVATE void *sqlite3HashFind(const Hash*, const void *pKey, int nKey);
+SQLITE_PRIVATE void sqlite3HashClear(Hash*);
/*
** Macros for looping over all elements of a hash table. The idiom is
@@ -3113,7 +3113,7 @@ STQLITE_PRIVATE void sqlite3HashClear(Hash*);
*/
#define sqliteHashCount(H) ((H)->count)
-#endif /* _STQLITE_HASH_H_ */
+#endif /* _SQLITE_HASH_H_ */
/************** End of hash.h ************************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
@@ -3286,26 +3286,26 @@ STQLITE_PRIVATE void sqlite3HashClear(Hash*);
** If compiling for a processor that lacks floating point support,
** substitute integer for floating-point
*/
-#ifdef STQLITE_OMIT_FLOATING_POINT
+#ifdef SQLITE_OMIT_FLOATING_POINT
# define double sqlite_int64
# define LONGDOUBLE_TYPE sqlite_int64
-# ifndef STQLITE_BIG_DBL
-# define STQLITE_BIG_DBL (0x7fffffffffffffff)
+# ifndef SQLITE_BIG_DBL
+# define SQLITE_BIG_DBL (0x7fffffffffffffff)
# endif
-# define STQLITE_OMIT_DATETIME_FUNCS 1
-# define STQLITE_OMIT_TRACE 1
-# undef STQLITE_MIXED_ENDIAN_64BIT_FLOAT
+# define SQLITE_OMIT_DATETIME_FUNCS 1
+# define SQLITE_OMIT_TRACE 1
+# undef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
#endif
-#ifndef STQLITE_BIG_DBL
-# define STQLITE_BIG_DBL (1e99)
+#ifndef SQLITE_BIG_DBL
+# define SQLITE_BIG_DBL (1e99)
#endif
/*
-** OMIT_TEMPDB is set to 1 if STQLITE_OMIT_TEMPDB is defined, or 0
+** OMIT_TEMPDB is set to 1 if SQLITE_OMIT_TEMPDB is defined, or 0
** afterward. Having this macro allows us to cause the C compiler
** to omit code used by TEMP tables without messy #ifndef statements.
*/
-#ifdef STQLITE_OMIT_TEMPDB
+#ifdef SQLITE_OMIT_TEMPDB
#define OMIT_TEMPDB 1
#else
#define OMIT_TEMPDB 0
@@ -3331,9 +3331,9 @@ STQLITE_PRIVATE void sqlite3HashClear(Hash*);
** the default file format for new databases and the maximum file format
** that the library can read.
*/
-#define STQLITE_MAX_FILE_FORMAT 4
-#ifndef STQLITE_DEFAULT_FILE_FORMAT
-# define STQLITE_DEFAULT_FILE_FORMAT 1
+#define SQLITE_MAX_FILE_FORMAT 4
+#ifndef SQLITE_DEFAULT_FILE_FORMAT
+# define SQLITE_DEFAULT_FILE_FORMAT 1
#endif
/*
@@ -3357,9 +3357,9 @@ STQLITE_PRIVATE void sqlite3HashClear(Hash*);
** not, there are still machines out there that use EBCDIC.)
*/
#if 'A' == '\301'
-# define STQLITE_EBCDIC 1
+# define SQLITE_EBCDIC 1
#else
-# define STQLITE_ASCII 1
+# define SQLITE_ASCII 1
#endif
/*
@@ -3401,13 +3401,13 @@ typedef UINT8_TYPE i8; /* 1-byte signed integer */
*/
extern const int sqlite3one;
#if defined(i386) || defined(__i386__) || defined(_M_IX86)
-# define STQLITE_BIGENDIAN 0
-# define STQLITE_LITTLEENDIAN 1
-# define STQLITE_UTF16NATIVE STQLITE_UTF16LE
+# define SQLITE_BIGENDIAN 0
+# define SQLITE_LITTLEENDIAN 1
+# define SQLITE_UTF16NATIVE SQLITE_UTF16LE
#else
-# define STQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
-# define STQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
-# define STQLITE_UTF16NATIVE (STQLITE_BIGENDIAN?STQLITE_UTF16BE:STQLITE_UTF16LE)
+# define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
+# define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
+# define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)
#endif
/*
@@ -3451,8 +3451,8 @@ struct BusyHandler {
**
** $Id: vdbe.h,v 1.110 2007/05/08 21:45:28 drh Exp $
*/
-#ifndef _STQLITE_VDBE_H_
-#define _STQLITE_VDBE_H_
+#ifndef _SQLITE_VDBE_H_
+#define _SQLITE_VDBE_H_
/*
** A single VDBE is an opaque structure named "Vdbe". Only routines
@@ -3708,37 +3708,37 @@ typedef struct VdbeOpList VdbeOpList;
** Prototypes for the VDBE interface. See comments on the implementation
** for a description of what each of these routines does.
*/
-STQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(sqlite3*);
-STQLITE_PRIVATE int sqlite3VdbeAddOp(Vdbe*,int,int,int);
-STQLITE_PRIVATE int sqlite3VdbeOp3(Vdbe*,int,int,int,const char *zP3,int);
-STQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp);
-STQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1);
-STQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2);
-STQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
-STQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
-STQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, int addr, const char *zP1, int N);
-STQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
-STQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
-STQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*);
-STQLITE_PRIVATE void sqlite3VdbeMakeReady(Vdbe*,int,int,int,int);
-STQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe*);
-STQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe*, int);
-STQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe*);
-#ifdef STQLITE_DEBUG
-STQLITE_PRIVATE void sqlite3VdbeTrace(Vdbe*,FILE*);
-#endif
-STQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe*);
-STQLITE_PRIVATE int sqlite3VdbeReset(Vdbe*);
-STQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe*,int);
-STQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, int);
-STQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe*);
-STQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*);
-STQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n);
-STQLITE_PRIVATE const char *sqlite3VdbeGetSql(Vdbe*);
-STQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*);
+SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(sqlite3*);
+SQLITE_PRIVATE int sqlite3VdbeAddOp(Vdbe*,int,int,int);
+SQLITE_PRIVATE int sqlite3VdbeOp3(Vdbe*,int,int,int,const char *zP3,int);
+SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp);
+SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1);
+SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2);
+SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
+SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
+SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, int addr, const char *zP1, int N);
+SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
+SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeMakeReady(Vdbe*,int,int,int,int);
+SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe*, int);
+SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe*);
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3VdbeTrace(Vdbe*,FILE*);
+#endif
+SQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe*,int);
+SQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, int);
+SQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe*);
+SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n);
+SQLITE_PRIVATE const char *sqlite3VdbeGetSql(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*);
#ifndef NDEBUG
-STQLITE_PRIVATE void sqlite3VdbeComment(Vdbe*, const char*, ...);
+SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe*, const char*, ...);
# define VdbeComment(X) sqlite3VdbeComment X
#else
# define VdbeComment(X)
@@ -3773,14 +3773,14 @@ STQLITE_PRIVATE void sqlite3VdbeComment(Vdbe*, const char*, ...);
/* TODO: This definition is just included so other modules compile. It
** needs to be revisited.
*/
-#define STQLITE_N_BTREE_META 10
+#define SQLITE_N_BTREE_META 10
/*
** If defined as non-zero, auto-vacuum is enabled by default. Otherwise
** it must be turned on for each database using "PRAGMA auto_vacuum = 1".
*/
-#ifndef STQLITE_DEFAULT_AUTOVACUUM
- #define STQLITE_DEFAULT_AUTOVACUUM 0
+#ifndef SQLITE_DEFAULT_AUTOVACUUM
+ #define SQLITE_DEFAULT_AUTOVACUUM 0
#endif
#define BTREE_AUTOVACUUM_NONE 0 /* Do not do auto-vacuum */
@@ -3795,7 +3795,7 @@ typedef struct BtCursor BtCursor;
typedef struct BtShared BtShared;
-STQLITE_PRIVATE int sqlite3BtreeOpen(
+SQLITE_PRIVATE int sqlite3BtreeOpen(
const char *zFilename, /* Name of database file to open */
sqlite3 *db, /* Associated database connection */
Btree **, /* Return open Btree* here */
@@ -3812,39 +3812,39 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
#define BTREE_NO_READLOCK 2 /* Omit readlocks on readonly files */
#define BTREE_MEMORY 4 /* In-memory DB. No argument */
-STQLITE_PRIVATE int sqlite3BtreeClose(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeSetBusyHandler(Btree*,BusyHandler*);
-STQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int);
-STQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree*,int,int);
-STQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree*,int,int);
-STQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree*,int);
-STQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int);
-STQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *);
-STQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree*,int);
-STQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster);
-STQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeCommit(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeRollback(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeCommitStmt(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeRollbackStmt(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree*, int*, int flags);
-STQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeIsInStmt(Btree*);
-STQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree*);
-STQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *, int, void(*)(void *));
-STQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *);
-STQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *, int, u8);
-
-STQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *);
-STQLITE_PRIVATE const char *sqlite3BtreeGetDirname(Btree *);
-STQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *);
-STQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *, Btree *);
-
-STQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *);
+SQLITE_PRIVATE int sqlite3BtreeClose(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeSetBusyHandler(Btree*,BusyHandler*);
+SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int);
+SQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree*,int,int);
+SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree*,int,int);
+SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree*,int);
+SQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int);
+SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *);
+SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree*,int);
+SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster);
+SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeCommit(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeRollback(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeCommitStmt(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeRollbackStmt(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree*, int*, int flags);
+SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeIsInStmt(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree*);
+SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *, int, void(*)(void *));
+SQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *);
+SQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *, int, u8);
+
+SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *);
+SQLITE_PRIVATE const char *sqlite3BtreeGetDirname(Btree *);
+SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *);
+SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *, Btree *);
+
+SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *);
/* The flags parameter to sqlite3BtreeCreateTable can be the bitwise OR
** of the following flags:
@@ -3853,12 +3853,12 @@ STQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *);
#define BTREE_ZERODATA 2 /* Table has keys only - no data */
#define BTREE_LEAFDATA 4 /* Data stored in leaves only. Implies INTKEY */
-STQLITE_PRIVATE int sqlite3BtreeDropTable(Btree*, int, int*);
-STQLITE_PRIVATE int sqlite3BtreeClearTable(Btree*, int);
-STQLITE_PRIVATE int sqlite3BtreeGetMeta(Btree*, int idx, u32 *pValue);
-STQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value);
+SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree*, int, int*);
+SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree*, int);
+SQLITE_PRIVATE int sqlite3BtreeGetMeta(Btree*, int idx, u32 *pValue);
+SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value);
-STQLITE_PRIVATE int sqlite3BtreeCursor(
+SQLITE_PRIVATE int sqlite3BtreeCursor(
Btree*, /* BTree containing table to open */
int iTable, /* Index of root page */
int wrFlag, /* 1 for writing. 0 for read-only */
@@ -3867,35 +3867,35 @@ STQLITE_PRIVATE int sqlite3BtreeCursor(
BtCursor **ppCursor /* Returned cursor */
);
-STQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor*);
-STQLITE_PRIVATE int sqlite3BtreeMoveto(BtCursor*,const void *pKey,i64 nKey,int bias,int *pRes);
-STQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor*);
-STQLITE_PRIVATE int sqlite3BtreeInsert(BtCursor*, const void *pKey, i64 nKey,
+SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreeMoveto(BtCursor*,const void *pKey,i64 nKey,int bias,int *pRes);
+SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreeInsert(BtCursor*, const void *pKey, i64 nKey,
const void *pData, int nData,
int nZero, int bias);
-STQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor*, int *pRes);
-STQLITE_PRIVATE int sqlite3BtreeLast(BtCursor*, int *pRes);
-STQLITE_PRIVATE int sqlite3BtreeNext(BtCursor*, int *pRes);
-STQLITE_PRIVATE int sqlite3BtreeEof(BtCursor*);
-STQLITE_PRIVATE int sqlite3BtreeFlags(BtCursor*);
-STQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor*, int *pRes);
-STQLITE_PRIVATE int sqlite3BtreeKeySize(BtCursor*, i64 *pSize);
-STQLITE_PRIVATE int sqlite3BtreeKey(BtCursor*, u32 offset, u32 amt, void*);
-STQLITE_PRIVATE const void *sqlite3BtreeKeyFetch(BtCursor*, int *pAmt);
-STQLITE_PRIVATE const void *sqlite3BtreeDataFetch(BtCursor*, int *pAmt);
-STQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor*, u32 *pSize);
-STQLITE_PRIVATE int sqlite3BtreeData(BtCursor*, u32 offset, u32 amt, void*);
-
-STQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*);
-STQLITE_PRIVATE struct Pager *sqlite3BtreePager(Btree*);
-
-STQLITE_PRIVATE int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*);
-STQLITE_PRIVATE void sqlite3BtreeCacheOverflow(BtCursor *);
-
-#ifdef STQLITE_TEST
-STQLITE_PRIVATE int sqlite3BtreeCursorInfo(BtCursor*, int*, int);
-STQLITE_PRIVATE void sqlite3BtreeCursorList(Btree*);
-STQLITE_PRIVATE int sqlite3BtreePageDump(Btree*, int, int recursive);
+SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor*, int *pRes);
+SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor*, int *pRes);
+SQLITE_PRIVATE int sqlite3BtreeNext(BtCursor*, int *pRes);
+SQLITE_PRIVATE int sqlite3BtreeEof(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreeFlags(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor*, int *pRes);
+SQLITE_PRIVATE int sqlite3BtreeKeySize(BtCursor*, i64 *pSize);
+SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor*, u32 offset, u32 amt, void*);
+SQLITE_PRIVATE const void *sqlite3BtreeKeyFetch(BtCursor*, int *pAmt);
+SQLITE_PRIVATE const void *sqlite3BtreeDataFetch(BtCursor*, int *pAmt);
+SQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor*, u32 *pSize);
+SQLITE_PRIVATE int sqlite3BtreeData(BtCursor*, u32 offset, u32 amt, void*);
+
+SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*);
+SQLITE_PRIVATE struct Pager *sqlite3BtreePager(Btree*);
+
+SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*);
+SQLITE_PRIVATE void sqlite3BtreeCacheOverflow(BtCursor *);
+
+#ifdef SQLITE_TEST
+SQLITE_PRIVATE int sqlite3BtreeCursorInfo(BtCursor*, int*, int);
+SQLITE_PRIVATE void sqlite3BtreeCursorList(Btree*);
+SQLITE_PRIVATE int sqlite3BtreePageDump(Btree*, int, int recursive);
#endif
#endif /* _BTREE_H_ */
@@ -3960,70 +3960,70 @@ typedef struct PgHdr DbPage;
** See source code comments for a detailed description of the following
** routines:
*/
-STQLITE_PRIVATE int sqlite3PagerOpen(Pager **ppPager, const char *zFilename,
+SQLITE_PRIVATE int sqlite3PagerOpen(Pager **ppPager, const char *zFilename,
int nExtra, int flags);
-STQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager*, BusyHandler *pBusyHandler);
-STQLITE_PRIVATE void sqlite3PagerSetDestructor(Pager*, void(*)(DbPage*,int));
-STQLITE_PRIVATE void sqlite3PagerSetReiniter(Pager*, void(*)(DbPage*,int));
-STQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, int);
-STQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int);
-STQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
-STQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager*, int);
-STQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager);
-STQLITE_PRIVATE int sqlite3PagerAcquire(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag);
+SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager*, BusyHandler *pBusyHandler);
+SQLITE_PRIVATE void sqlite3PagerSetDestructor(Pager*, void(*)(DbPage*,int));
+SQLITE_PRIVATE void sqlite3PagerSetReiniter(Pager*, void(*)(DbPage*,int));
+SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, int);
+SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int);
+SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
+SQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager*, int);
+SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager);
+SQLITE_PRIVATE int sqlite3PagerAcquire(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag);
#define sqlite3PagerGet(A,B,C) sqlite3PagerAcquire(A,B,C,0)
-STQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno);
-STQLITE_PRIVATE int sqlite3PagerRef(DbPage*);
-STQLITE_PRIVATE int sqlite3PagerUnref(DbPage*);
-STQLITE_PRIVATE int sqlite3PagerWrite(DbPage*);
-STQLITE_PRIVATE int sqlite3PagerOverwrite(Pager *pPager, Pgno pgno, void*);
-STQLITE_PRIVATE int sqlite3PagerPagecount(Pager*);
-STQLITE_PRIVATE int sqlite3PagerTruncate(Pager*,Pgno);
-STQLITE_PRIVATE int sqlite3PagerBegin(DbPage*, int exFlag);
-STQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, Pgno);
-STQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager*);
-STQLITE_PRIVATE int sqlite3PagerRollback(Pager*);
-STQLITE_PRIVATE int sqlite3PagerIsreadonly(Pager*);
-STQLITE_PRIVATE int sqlite3PagerStmtBegin(Pager*);
-STQLITE_PRIVATE int sqlite3PagerStmtCommit(Pager*);
-STQLITE_PRIVATE int sqlite3PagerStmtRollback(Pager*);
-STQLITE_PRIVATE void sqlite3PagerDontRollback(DbPage*);
-STQLITE_PRIVATE void sqlite3PagerDontWrite(DbPage*);
-STQLITE_PRIVATE int sqlite3PagerRefcount(Pager*);
-STQLITE_PRIVATE void sqlite3PagerSetSafetyLevel(Pager*,int,int);
-STQLITE_PRIVATE const char *sqlite3PagerFilename(Pager*);
-STQLITE_PRIVATE const char *sqlite3PagerDirname(Pager*);
-STQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager*);
-STQLITE_PRIVATE int sqlite3PagerNosync(Pager*);
-STQLITE_PRIVATE int sqlite3PagerMovepage(Pager*,DbPage*,Pgno);
-STQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *);
-STQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *);
-STQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *, int);
-
-#if defined(STQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(STQLITE_OMIT_DISKIO)
-STQLITE_PRIVATE int sqlite3PagerReleaseMemory(int);
-#endif
-
-#ifdef STQLITE_HAS_CODEC
-STQLITE_PRIVATE void sqlite3PagerSetCodec(Pager*,void*(*)(void*,void*,Pgno,int),void*);
-#endif
-
-#if !defined(NDEBUG) || defined(STQLITE_TEST)
-STQLITE_PRIVATE Pgno sqlite3PagerPagenumber(DbPage*);
-STQLITE_PRIVATE int sqlite3PagerIswriteable(DbPage*);
-#endif
-
-#if defined(STQLITE_DEBUG) || defined(STQLITE_TEST)
-STQLITE_PRIVATE int sqlite3PagerLockstate(Pager*);
-#endif
-
-#ifdef STQLITE_TEST
-STQLITE_PRIVATE int *sqlite3PagerStats(Pager*);
-STQLITE_PRIVATE void sqlite3PagerRefdump(Pager*);
+SQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno);
+SQLITE_PRIVATE int sqlite3PagerRef(DbPage*);
+SQLITE_PRIVATE int sqlite3PagerUnref(DbPage*);
+SQLITE_PRIVATE int sqlite3PagerWrite(DbPage*);
+SQLITE_PRIVATE int sqlite3PagerOverwrite(Pager *pPager, Pgno pgno, void*);
+SQLITE_PRIVATE int sqlite3PagerPagecount(Pager*);
+SQLITE_PRIVATE int sqlite3PagerTruncate(Pager*,Pgno);
+SQLITE_PRIVATE int sqlite3PagerBegin(DbPage*, int exFlag);
+SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, Pgno);
+SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager*);
+SQLITE_PRIVATE int sqlite3PagerRollback(Pager*);
+SQLITE_PRIVATE int sqlite3PagerIsreadonly(Pager*);
+SQLITE_PRIVATE int sqlite3PagerStmtBegin(Pager*);
+SQLITE_PRIVATE int sqlite3PagerStmtCommit(Pager*);
+SQLITE_PRIVATE int sqlite3PagerStmtRollback(Pager*);
+SQLITE_PRIVATE void sqlite3PagerDontRollback(DbPage*);
+SQLITE_PRIVATE void sqlite3PagerDontWrite(DbPage*);
+SQLITE_PRIVATE int sqlite3PagerRefcount(Pager*);
+SQLITE_PRIVATE void sqlite3PagerSetSafetyLevel(Pager*,int,int);
+SQLITE_PRIVATE const char *sqlite3PagerFilename(Pager*);
+SQLITE_PRIVATE const char *sqlite3PagerDirname(Pager*);
+SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager*);
+SQLITE_PRIVATE int sqlite3PagerNosync(Pager*);
+SQLITE_PRIVATE int sqlite3PagerMovepage(Pager*,DbPage*,Pgno);
+SQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *);
+SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *);
+SQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *, int);
+
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(SQLITE_OMIT_DISKIO)
+SQLITE_PRIVATE int sqlite3PagerReleaseMemory(int);
+#endif
+
+#ifdef SQLITE_HAS_CODEC
+SQLITE_PRIVATE void sqlite3PagerSetCodec(Pager*,void*(*)(void*,void*,Pgno,int),void*);
+#endif
+
+#if !defined(NDEBUG) || defined(SQLITE_TEST)
+SQLITE_PRIVATE Pgno sqlite3PagerPagenumber(DbPage*);
+SQLITE_PRIVATE int sqlite3PagerIswriteable(DbPage*);
+#endif
+
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
+SQLITE_PRIVATE int sqlite3PagerLockstate(Pager*);
+#endif
+
+#ifdef SQLITE_TEST
+SQLITE_PRIVATE int *sqlite3PagerStats(Pager*);
+SQLITE_PRIVATE void sqlite3PagerRefdump(Pager*);
int pager3_refinfo_enable;
#endif
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
void disable_simulated_io_errors(void);
void enable_simulated_io_errors(void);
#else
@@ -4036,10 +4036,10 @@ void enable_simulated_io_errors(void);
/************** End of pager.h ***********************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
-#ifdef STQLITE_MEMDEBUG
+#ifdef SQLITE_MEMDEBUG
/*
** The following global variables are used for testing and debugging
-** only. They only work if STQLITE_MEMDEBUG is defined.
+** only. They only work if SQLITE_MEMDEBUG is defined.
*/
extern int sqlite3_nMalloc; /* Number of sqliteMalloc() calls */
extern int sqlite3_nFree; /* Number of sqliteFree() calls */
@@ -4093,13 +4093,13 @@ extern int sqlite3_mallocHasFailed;
struct ThreadData {
int dummy; /* So that this structure is never empty */
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
int nSoftHeapLimit; /* Suggested max mem allocation. No limit if <0 */
int nAlloc; /* Number of bytes currently allocated */
Pager *pPager; /* Linked list of all pagers in this thread */
#endif
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
u8 useSharedData; /* True if shared pagers and schemas are enabled */
BtShared *pBtree; /* Linked list of all currently open BTrees */
#endif
@@ -4177,10 +4177,10 @@ typedef struct WhereLevel WhereLevel;
**
** This header file (together with is companion C source-code file
** "os.c") attempt to abstract the underlying operating system so that
-** the STQLite library will work on both POSIX and windows systems.
+** the SQLite library will work on both POSIX and windows systems.
*/
-#ifndef _STQLITE_OS_H_
-#define _STQLITE_OS_H_
+#ifndef _SQLITE_OS_H_
+#define _SQLITE_OS_H_
/*
** Figure out if we are dealing with Unix, Windows, or some other
@@ -4230,7 +4230,7 @@ typedef struct WhereLevel WhereLevel;
*/
#if OS_WIN
# include <windows.h>
-# define STQLITE_TEMPNAME_SIZE (MAX_PATH+50)
+# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
#elif OS_OS2
# if (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3) && defined(OS2_HIGH_MEMORY)
# include <os2safe.h> /* has to be included before os2.h for linking to work */
@@ -4242,9 +4242,9 @@ typedef struct WhereLevel WhereLevel;
# define INCL_DOSPROCESS
# define INCL_DOSMODULEMGR
# include <os2.h>
-# define STQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP)
+# define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP)
#else
-# define STQLITE_TEMPNAME_SIZE 200
+# define SQLITE_TEMPNAME_SIZE 200
#endif
/* If the SET_FULLSYNC macro is not defined above, then make it
@@ -4257,8 +4257,8 @@ typedef struct WhereLevel WhereLevel;
/*
** The default size of a disk sector
*/
-#ifndef STQLITE_DEFAULT_SECTOR_SIZE
-# define STQLITE_DEFAULT_SECTOR_SIZE 512
+#ifndef SQLITE_DEFAULT_SECTOR_SIZE
+# define SQLITE_DEFAULT_SECTOR_SIZE 512
#endif
/*
@@ -4271,7 +4271,7 @@ typedef struct WhereLevel WhereLevel;
** using -DTEMP_FILE_PREFIX=myprefix_ on the compiler command line.
**
** 2006-10-31: The default prefix used to be "sqlite_". But then
-** Mcafee started using STQLite in their anti-virus product and it
+** Mcafee started using SQLite in their anti-virus product and it
** started putting files with the "sqlite" name in the c:/temp folder.
** This annoyed many windows users. Those users would then do a
** Google search for "sqlite", find the telephone numbers of the
@@ -4474,7 +4474,7 @@ struct OsFile {
** shared locks begins at SHARED_FIRST.
**
** These #defines are available in sqlite_aux.h so that adaptors for
-** connecting STQLite to other operating systems can use the same byte
+** connecting SQLite to other operating systems can use the same byte
** ranges for locking. In particular, the same locking strategy and
** byte ranges are used for Unix. This leaves open the possiblity of having
** clients on win95, winNT, and unix all talking to the same shared file
@@ -4499,7 +4499,7 @@ struct OsFile {
** 1GB boundary.
**
*/
-#ifndef STQLITE_TEST
+#ifndef SQLITE_TEST
#define PENDING_BYTE 0x40000000 /* First byte past the 1GB boundary */
#else
extern unsigned int sqlite3_pending_byte;
@@ -4513,50 +4513,50 @@ extern unsigned int sqlite3_pending_byte;
/*
** Prototypes for operating system interface routines.
*/
-STQLITE_PRIVATE int sqlite3OsClose(OsFile**);
-STQLITE_PRIVATE int sqlite3OsOpenDirectory(OsFile*, const char*);
-STQLITE_PRIVATE int sqlite3OsRead(OsFile*, void*, int amt);
-STQLITE_PRIVATE int sqlite3OsWrite(OsFile*, const void*, int amt);
-STQLITE_PRIVATE int sqlite3OsSeek(OsFile*, i64 offset);
-STQLITE_PRIVATE int sqlite3OsTruncate(OsFile*, i64 size);
-STQLITE_PRIVATE int sqlite3OsSync(OsFile*, int);
-STQLITE_PRIVATE void sqlite3OsSetFullSync(OsFile *id, int setting);
-STQLITE_PRIVATE int sqlite3OsFileSize(OsFile*, i64 *pSize);
-STQLITE_PRIVATE int sqlite3OsLock(OsFile*, int);
-STQLITE_PRIVATE int sqlite3OsUnlock(OsFile*, int);
-STQLITE_PRIVATE int sqlite3OsCheckReservedLock(OsFile *id);
-STQLITE_PRIVATE int sqlite3OsOpenReadWrite(const char*, OsFile**, int*);
-STQLITE_PRIVATE int sqlite3OsOpenExclusive(const char*, OsFile**, int);
-STQLITE_PRIVATE int sqlite3OsOpenReadOnly(const char*, OsFile**);
-STQLITE_PRIVATE int sqlite3OsDelete(const char*);
-STQLITE_PRIVATE int sqlite3OsFileExists(const char*);
-STQLITE_PRIVATE char *sqlite3OsFullPathname(const char*);
-STQLITE_PRIVATE int sqlite3OsIsDirWritable(char*);
-STQLITE_PRIVATE int sqlite3OsSyncDirectory(const char*);
-STQLITE_PRIVATE int sqlite3OsSectorSize(OsFile *id);
-STQLITE_PRIVATE int sqlite3OsTempFileName(char*);
-STQLITE_PRIVATE int sqlite3OsRandomSeed(char*);
-STQLITE_PRIVATE int sqlite3OsSleep(int ms);
-STQLITE_PRIVATE int sqlite3OsCurrentTime(double*);
-STQLITE_PRIVATE void sqlite3OsEnterMutex(void);
-STQLITE_PRIVATE void sqlite3OsLeaveMutex(void);
-STQLITE_PRIVATE int sqlite3OsInMutex(int);
-STQLITE_PRIVATE ThreadData *sqlite3OsThreadSpecificData(int);
-STQLITE_PRIVATE void *sqlite3OsMalloc(int);
-STQLITE_PRIVATE void *sqlite3OsRealloc(void *, int);
-STQLITE_PRIVATE void sqlite3OsFree(void *);
-STQLITE_PRIVATE int sqlite3OsAllocationSize(void *);
-STQLITE_PRIVATE void *sqlite3OsDlopen(const char*);
-STQLITE_PRIVATE void *sqlite3OsDlsym(void*, const char*);
-STQLITE_PRIVATE int sqlite3OsDlclose(void*);
-
-#if defined(STQLITE_TEST) || defined(STQLITE_DEBUG)
-STQLITE_PRIVATE int sqlite3OsFileHandle(OsFile *id);
-STQLITE_PRIVATE int sqlite3OsLockState(OsFile *id);
-#endif
-
-/*
-** If the STQLITE_ENABLE_REDEF_IO macro is defined, then the OS-layer
+SQLITE_PRIVATE int sqlite3OsClose(OsFile**);
+SQLITE_PRIVATE int sqlite3OsOpenDirectory(OsFile*, const char*);
+SQLITE_PRIVATE int sqlite3OsRead(OsFile*, void*, int amt);
+SQLITE_PRIVATE int sqlite3OsWrite(OsFile*, const void*, int amt);
+SQLITE_PRIVATE int sqlite3OsSeek(OsFile*, i64 offset);
+SQLITE_PRIVATE int sqlite3OsTruncate(OsFile*, i64 size);
+SQLITE_PRIVATE int sqlite3OsSync(OsFile*, int);
+SQLITE_PRIVATE void sqlite3OsSetFullSync(OsFile *id, int setting);
+SQLITE_PRIVATE int sqlite3OsFileSize(OsFile*, i64 *pSize);
+SQLITE_PRIVATE int sqlite3OsLock(OsFile*, int);
+SQLITE_PRIVATE int sqlite3OsUnlock(OsFile*, int);
+SQLITE_PRIVATE int sqlite3OsCheckReservedLock(OsFile *id);
+SQLITE_PRIVATE int sqlite3OsOpenReadWrite(const char*, OsFile**, int*);
+SQLITE_PRIVATE int sqlite3OsOpenExclusive(const char*, OsFile**, int);
+SQLITE_PRIVATE int sqlite3OsOpenReadOnly(const char*, OsFile**);
+SQLITE_PRIVATE int sqlite3OsDelete(const char*);
+SQLITE_PRIVATE int sqlite3OsFileExists(const char*);
+SQLITE_PRIVATE char *sqlite3OsFullPathname(const char*);
+SQLITE_PRIVATE int sqlite3OsIsDirWritable(char*);
+SQLITE_PRIVATE int sqlite3OsSyncDirectory(const char*);
+SQLITE_PRIVATE int sqlite3OsSectorSize(OsFile *id);
+SQLITE_PRIVATE int sqlite3OsTempFileName(char*);
+SQLITE_PRIVATE int sqlite3OsRandomSeed(char*);
+SQLITE_PRIVATE int sqlite3OsSleep(int ms);
+SQLITE_PRIVATE int sqlite3OsCurrentTime(double*);
+SQLITE_PRIVATE void sqlite3OsEnterMutex(void);
+SQLITE_PRIVATE void sqlite3OsLeaveMutex(void);
+SQLITE_PRIVATE int sqlite3OsInMutex(int);
+SQLITE_PRIVATE ThreadData *sqlite3OsThreadSpecificData(int);
+SQLITE_PRIVATE void *sqlite3OsMalloc(int);
+SQLITE_PRIVATE void *sqlite3OsRealloc(void *, int);
+SQLITE_PRIVATE void sqlite3OsFree(void *);
+SQLITE_PRIVATE int sqlite3OsAllocationSize(void *);
+SQLITE_PRIVATE void *sqlite3OsDlopen(const char*);
+SQLITE_PRIVATE void *sqlite3OsDlsym(void*, const char*);
+SQLITE_PRIVATE int sqlite3OsDlclose(void*);
+
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
+SQLITE_PRIVATE int sqlite3OsFileHandle(OsFile *id);
+SQLITE_PRIVATE int sqlite3OsLockState(OsFile *id);
+#endif
+
+/*
+** If the SQLITE_ENABLE_REDEF_IO macro is defined, then the OS-layer
** interface routines are not called directly but are invoked using
** pointers to functions. This allows the implementation of various
** OS-layer interface routines to be modified at run-time. There are
@@ -4564,13 +4564,13 @@ STQLITE_PRIVATE int sqlite3OsLockState(OsFile *id);
** most users, a direct call to the underlying interface is preferable
** so the the redefinable I/O interface is turned off by default.
*/
-#ifdef STQLITE_ENABLE_REDEF_IO
+#ifdef SQLITE_ENABLE_REDEF_IO
/*
** When redefinable I/O is enabled, a single global instance of the
-** following structure holds pointers to the routines that STQLite
+** following structure holds pointers to the routines that SQLite
** uses to talk with the underlying operating system. Modify this
-** structure (before using any STQLite API!) to accomodate perculiar
+** structure (before using any SQLite API!) to accomodate perculiar
** operating system interfaces or behaviors.
*/
struct sqlite3OsVtbl {
@@ -4607,19 +4607,19 @@ struct sqlite3OsVtbl {
/* Macro used to comment out routines that do not exists when there is
** no disk I/O or extension loading
*/
-#ifdef STQLITE_OMIT_DISKIO
+#ifdef SQLITE_OMIT_DISKIO
# define IF_DISKIO(X) 0
#else
# define IF_DISKIO(X) X
#endif
-#ifdef STQLITE_OMIT_LOAD_EXTENSION
+#ifdef SQLITE_OMIT_LOAD_EXTENSION
# define IF_DLOPEN(X) 0
#else
# define IF_DLOPEN(X) X
#endif
-#if defined(_STQLITE_OS_C_) || defined(STQLITE_AMALGAMATION)
+#if defined(_SQLITE_OS_C_) || defined(SQLITE_AMALGAMATION)
/*
** The os.c file implements the global virtual function table.
** We have to put this file here because the initializers
@@ -4656,7 +4656,7 @@ struct sqlite3OsVtbl {
** Files other than os.c just reference the global virtual function table.
*/
extern struct sqlite3OsVtbl sqlite3Os;
-#endif /* _STQLITE_OS_C_ */
+#endif /* _SQLITE_OS_C_ */
/* This additional API routine is available with redefinable I/O */
@@ -4708,9 +4708,9 @@ struct sqlite3OsVtbl *sqlite3_os_switch(void);
#define sqlite3OsFree sqlite3Os.xFree
#define sqlite3OsAllocationSize sqlite3Os.xAllocationSize
-#endif /* STQLITE_ENABLE_REDEF_IO */
+#endif /* SQLITE_ENABLE_REDEF_IO */
-#endif /* _STQLITE_OS_H_ */
+#endif /* _SQLITE_OS_H_ */
/************** End of os.h **************************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
@@ -4754,7 +4754,7 @@ struct Schema {
u8 enc; /* Text encoding used by this database */
u16 flags; /* Flags associated with this schema */
int cache_size; /* Number of pages to use in the cache */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
sqlite3 *db; /* "Owner" connection. See comment above */
#endif
};
@@ -4813,7 +4813,7 @@ struct sqlite3 {
int nDb; /* Number of backends currently in use */
Db *aDb; /* All backends */
int flags; /* Miscellanous flags. See below */
- int errCode; /* Most recent error code (STQLITE_*) */
+ int errCode; /* Most recent error code (SQLITE_*) */
int errMask; /* & result codes with this before returning */
u8 autoCommit; /* The auto-commit flag. */
u8 temp_store; /* 1: file 2: memory 0: default */
@@ -4853,17 +4853,17 @@ struct sqlite3 {
int isInterrupted; /* True if sqlite3_interrupt has been called */
double notUsed1; /* Spacer */
} u1;
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*);
/* Access authorization function */
void *pAuthArg; /* 1st argument to the access auth function */
#endif
-#ifndef STQLITE_OMIT_PROGRESS_CALLBACK
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
int (*xProgress)(void *); /* The progress callback */
void *pProgressArg; /* Argument to the progress callback */
int nProgressOps; /* Number of opcodes for progress callback */
#endif
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
Hash aModule; /* populated by sqlite3_create_module() */
Table *pVTab; /* vtab with active Connect/Create method */
sqlite3_vtab **aVTrans; /* Virtual tables with open transactions */
@@ -4874,7 +4874,7 @@ struct sqlite3 {
BusyHandler busyHandler; /* Busy callback */
int busyTimeout; /* Busy handler timeout, in msec */
Db aDbStatic[2]; /* Static space for the 2 default backends */
-#ifdef STQLITE_SSE
+#ifdef SQLITE_SSE
sqlite3_stmt *pFetch; /* Used by SSE to fetch stored statements */
#endif
u8 dfltLockMode; /* Default locking-mode for attached dbs */
@@ -4888,42 +4888,42 @@ struct sqlite3 {
/*
** Possible values for the sqlite.flags and or Db.flags fields.
**
-** On sqlite.flags, the STQLITE_InTrans value means that we have
-** executed a BEGIN. On Db.flags, STQLITE_InTrans means a statement
+** On sqlite.flags, the SQLITE_InTrans value means that we have
+** executed a BEGIN. On Db.flags, SQLITE_InTrans means a statement
** transaction is active on that particular database file.
*/
-#define STQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */
-#define STQLITE_InTrans 0x00000008 /* True if in a transaction */
-#define STQLITE_InternChanges 0x00000010 /* Uncommitted Hash table changes */
-#define STQLITE_FullColNames 0x00000020 /* Show full column names on SELECT */
-#define STQLITE_ShortColNames 0x00000040 /* Show short columns names */
-#define STQLITE_CountRows 0x00000080 /* Count rows changed by INSERT, */
+#define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */
+#define SQLITE_InTrans 0x00000008 /* True if in a transaction */
+#define SQLITE_InternChanges 0x00000010 /* Uncommitted Hash table changes */
+#define SQLITE_FullColNames 0x00000020 /* Show full column names on SELECT */
+#define SQLITE_ShortColNames 0x00000040 /* Show short columns names */
+#define SQLITE_CountRows 0x00000080 /* Count rows changed by INSERT, */
/* DELETE, or UPDATE and return */
/* the count using a callback. */
-#define STQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */
+#define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */
/* result set is empty */
-#define STQLITE_SqlTrace 0x00000200 /* Debug print SQL as it executes */
-#define STQLITE_VdbeListing 0x00000400 /* Debug listings of VDBE programs */
-#define STQLITE_WriteSchema 0x00000800 /* OK to update STQLITE_MASTER */
-#define STQLITE_NoReadlock 0x00001000 /* Readlocks are omitted when
+#define SQLITE_SqlTrace 0x00000200 /* Debug print SQL as it executes */
+#define SQLITE_VdbeListing 0x00000400 /* Debug listings of VDBE programs */
+#define SQLITE_WriteSchema 0x00000800 /* OK to update SQLITE_MASTER */
+#define SQLITE_NoReadlock 0x00001000 /* Readlocks are omitted when
** accessing read-only databases */
-#define STQLITE_IgnoreChecks 0x00002000 /* Do not enforce check constraints */
-#define STQLITE_ReadUncommitted 0x00004000 /* For shared-cache mode */
-#define STQLITE_LegacyFileFmt 0x00008000 /* Create new databases in format 1 */
-#define STQLITE_FullFSync 0x00010000 /* Use full fsync on the backend */
-#define STQLITE_LoadExtension 0x00020000 /* Enable load_extension */
+#define SQLITE_IgnoreChecks 0x00002000 /* Do not enforce check constraints */
+#define SQLITE_ReadUncommitted 0x00004000 /* For shared-cache mode */
+#define SQLITE_LegacyFileFmt 0x00008000 /* Create new databases in format 1 */
+#define SQLITE_FullFSync 0x00010000 /* Use full fsync on the backend */
+#define SQLITE_LoadExtension 0x00020000 /* Enable load_extension */
-#define STQLITE_RecoveryMode 0x00040000 /* Ignore schema errors */
+#define SQLITE_RecoveryMode 0x00040000 /* Ignore schema errors */
/*
** Possible values for the sqlite.magic field.
** The numbers are obtained at random and have no special meaning, other
** than being distinct from one another.
*/
-#define STQLITE_MAGIC_OPEN 0xa029a697 /* Database is open */
-#define STQLITE_MAGIC_CLOSED 0x9f3c2d33 /* Database is closed */
-#define STQLITE_MAGIC_BUSY 0xf03b7906 /* Database currently in use */
-#define STQLITE_MAGIC_ERROR 0xb5357930 /* An STQLITE_MISUSE error occurred */
+#define SQLITE_MAGIC_OPEN 0xa029a697 /* Database is open */
+#define SQLITE_MAGIC_CLOSED 0x9f3c2d33 /* Database is closed */
+#define SQLITE_MAGIC_BUSY 0xf03b7906 /* Database currently in use */
+#define SQLITE_MAGIC_ERROR 0xb5357930 /* An SQLITE_MISUSE error occurred */
/*
** Each SQL function is defined by an instance of the following
@@ -4933,9 +4933,9 @@ struct sqlite3 {
*/
struct FuncDef {
i16 nArg; /* Number of arguments. -1 means unlimited */
- u8 iPrefEnc; /* Preferred text encoding (STQLITE_UTF8, 16LE, 16BE) */
+ u8 iPrefEnc; /* Preferred text encoding (SQLITE_UTF8, 16LE, 16BE) */
u8 needCollSeq; /* True if sqlite3GetFuncCollSeq() might be called */
- u8 flags; /* Some combination of STQLITE_FUNC_* */
+ u8 flags; /* Some combination of SQLITE_FUNC_* */
void *pUserData; /* User data parameter */
FuncDef *pNext; /* Next function with same name */
void (*xFunc)(sqlite3_context*,int,sqlite3_value**); /* Regular function */
@@ -4945,7 +4945,7 @@ struct FuncDef {
};
/*
-** Each STQLite module (virtual table definition) is defined by an
+** Each SQLite module (virtual table definition) is defined by an
** instance of the following structure, stored in the sqlite3.aModule
** hash table.
*/
@@ -4959,9 +4959,9 @@ struct Module {
/*
** Possible values for FuncDef.flags
*/
-#define STQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */
-#define STQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */
-#define STQLITE_FUNC_EPHEM 0x04 /* Ephermeral. Delete with VDBE */
+#define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */
+#define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */
+#define SQLITE_FUNC_EPHEM 0x04 /* Ephermeral. Delete with VDBE */
/*
** information about each column of an SQL table is held in an instance
@@ -4974,8 +4974,8 @@ struct Column {
char *zColl; /* Collating sequence. If NULL, use the default */
u8 notNull; /* True if there is a NOT NULL constraint */
u8 isPrimKey; /* True if this column is part of the PRIMARY KEY */
- char affinity; /* One of the STQLITE_AFF_... values */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+ char affinity; /* One of the SQLITE_AFF_... values */
+#ifndef SQLITE_OMIT_VIRTUALTABLE
u8 isHidden; /* True if this column is 'hidden' */
#endif
};
@@ -4988,7 +4988,7 @@ struct Column {
** There may two seperate implementations of the collation function, one
** that processes text in UTF-8 encoding (CollSeq.xCmp) and another that
** processes text encoded in UTF-16 (CollSeq.xCmp16), using the machine
-** native byte order. When a collation sequence is invoked, STQLite selects
+** native byte order. When a collation sequence is invoked, SQLite selects
** the version that will require the least expensive encoding
** translations, if any.
**
@@ -5004,7 +5004,7 @@ struct Column {
struct CollSeq {
char *zName; /* Name of the collating sequence, UTF-8 encoded */
u8 enc; /* Text encoding handled by xCmp() */
- u8 type; /* One of the STQLITE_COLL_... values below */
+ u8 type; /* One of the SQLITE_COLL_... values below */
void *pUser; /* First argument to xCmp() */
int (*xCmp)(void*,int, const void*, int, const void*);
void (*xDel)(void*); /* Destructor for pUser */
@@ -5013,22 +5013,22 @@ struct CollSeq {
/*
** Allowed values of CollSeq flags:
*/
-#define STQLITE_COLL_BINARY 1 /* The default memcmp() collating sequence */
-#define STQLITE_COLL_NOCASE 2 /* The built-in NOCASE collating sequence */
-#define STQLITE_COLL_REVERSE 3 /* The built-in REVERSE collating sequence */
-#define STQLITE_COLL_USER 0 /* Any other user-defined collating sequence */
+#define SQLITE_COLL_BINARY 1 /* The default memcmp() collating sequence */
+#define SQLITE_COLL_NOCASE 2 /* The built-in NOCASE collating sequence */
+#define SQLITE_COLL_REVERSE 3 /* The built-in REVERSE collating sequence */
+#define SQLITE_COLL_USER 0 /* Any other user-defined collating sequence */
/*
** A sort order can be either ASC or DESC.
*/
-#define STQLITE_SO_ASC 0 /* Sort in ascending order */
-#define STQLITE_SO_DESC 1 /* Sort in ascending order */
+#define SQLITE_SO_ASC 0 /* Sort in ascending order */
+#define SQLITE_SO_DESC 1 /* Sort in ascending order */
/*
** Column affinity types.
**
-** These used to have mnemonic name like 'i' for STQLITE_AFF_INTEGER and
-** 't' for STQLITE_AFF_TEXT. But we can save a little space and improve
+** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and
+** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve
** the speed a little by number the values consecutively.
**
** But rather than start with 0 or 1, we begin with 'a'. That way,
@@ -5038,13 +5038,13 @@ struct CollSeq {
** Note also that the numeric types are grouped together so that testing
** for a numeric type is a single comparison.
*/
-#define STQLITE_AFF_TEXT 'a'
-#define STQLITE_AFF_NONE 'b'
-#define STQLITE_AFF_NUMERIC 'c'
-#define STQLITE_AFF_INTEGER 'd'
-#define STQLITE_AFF_REAL 'e'
+#define SQLITE_AFF_TEXT 'a'
+#define SQLITE_AFF_NONE 'b'
+#define SQLITE_AFF_NUMERIC 'c'
+#define SQLITE_AFF_INTEGER 'd'
+#define SQLITE_AFF_REAL 'e'
-#define sqlite3IsNumericAffinity(X) ((X)>=STQLITE_AFF_NUMERIC)
+#define sqlite3IsNumericAffinity(X) ((X)>=SQLITE_AFF_NUMERIC)
/*
** Each SQL table is represented in memory by an instance of the
@@ -5088,10 +5088,10 @@ struct Table {
Trigger *pTrigger; /* List of SQL triggers on this table */
FKey *pFKey; /* Linked list of all foreign keys in this table */
char *zColAff; /* String defining the affinity of each column */
-#ifndef STQLITE_OMIT_CHECK
+#ifndef SQLITE_OMIT_CHECK
Expr *pCheck; /* The AND of all CHECK constraints */
#endif
-#ifndef STQLITE_OMIT_ALTERTABLE
+#ifndef SQLITE_OMIT_ALTERTABLE
int addColOffset; /* Offset in CREATE TABLE statement to add a new column */
#endif
u8 readOnly; /* True if this table should not be written by the user */
@@ -5099,7 +5099,7 @@ struct Table {
u8 hasPrimKey; /* True if there exists a primary key */
u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */
u8 autoInc; /* True if the integer primary key is autoincrement */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
u8 isVirtual; /* True if this is a virtual table */
u8 isCommit; /* True once the CREATE TABLE has been committed */
Module *pMod; /* Pointer to the implementation of the module */
@@ -5115,7 +5115,7 @@ struct Table {
** done as a macro so that it will be optimized out when virtual
** table support is omitted from the build.
*/
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
# define IsVirtual(X) ((X)->isVirtual)
# define IsHiddenColumn(X) ((X)->isHidden)
#else
@@ -5165,7 +5165,7 @@ struct FKey {
};
/*
-** STQLite supports many different ways to resolve a contraint
+** SQLite supports many different ways to resolve a contraint
** error. ROLLBACK processing means that a constraint violation
** causes the operation in process to fail and for the current transaction
** to be rolled back. ABORT processing means the operation in process
@@ -5386,7 +5386,7 @@ struct Expr {
** right side of "<expr> IN (<select>)" */
Table *pTab; /* Table for OP_Column expressions. */
Schema *pSchema;
-#if STQLITE_MAX_EXPR_DEPTH>0
+#if SQLITE_MAX_EXPR_DEPTH>0
int nHeight; /* Height of the tree headed by this node */
#endif
};
@@ -5475,7 +5475,7 @@ typedef u64 Bitmask;
** With the addition of multiple database support, the following structure
** can also be used to describe a particular table such as the table that
** is modified by an INSERT, DELETE, or UPDATE statement. In standard SQL,
-** such a table must be a simple name: ID. But in STQLite, the table can
+** such a table must be a simple name: ID. But in SQLite, the table can
** now be identified by a database name, a dot, then the table name: ID.ID.
**
** The jointype starts out showing the join type between the current table
@@ -5706,8 +5706,8 @@ struct Parse {
u32 writeMask; /* Start a write transaction on these databases */
u32 cookieMask; /* Bitmask of schema verified databases */
int cookieGoto; /* Address of OP_Goto to cookie verifier subroutine */
- int cookieValue[STQLITE_MAX_ATTACHED+2]; /* Values of cookies to verify */
-#ifndef STQLITE_OMIT_SHARED_CACHE
+ int cookieValue[SQLITE_MAX_ATTACHED+2]; /* Values of cookies to verify */
+#ifndef SQLITE_OMIT_SHARED_CACHE
int nTableLock; /* Number of locks in aTableLock */
TableLock *aTableLock; /* Required table locks for shared-cache mode */
#endif
@@ -5729,17 +5729,17 @@ struct Parse {
Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
TriggerStack *trigStack; /* Trigger actions being coded */
const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
Token sArg; /* Complete text of a module argument */
u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
Table *pVirtualLock; /* Require virtual table lock on this table */
#endif
-#if STQLITE_MAX_EXPR_DEPTH>0
+#if SQLITE_MAX_EXPR_DEPTH>0
int nHeight; /* Expression tree height of current sub-select */
#endif
};
-#ifdef STQLITE_OMIT_VIRTUALTABLE
+#ifdef SQLITE_OMIT_VIRTUALTABLE
#define IN_DECLARE_VTAB 0
#else
#define IN_DECLARE_VTAB (pParse->declareVtab)
@@ -5919,13 +5919,13 @@ typedef struct {
/*
* This global flag is set for performance testing of triggers. When it is set
- * STQLite will perform the overhead of building new and old trigger references
+ * SQLite will perform the overhead of building new and old trigger references
* even when no triggers exist
*/
extern int sqlite3_always_code_trigger_setup;
/*
-** A lookup table used by the STQLITE_READ_UTF8 macro. The definition
+** A lookup table used by the SQLITE_READ_UTF8 macro. The definition
** is in utf.c.
*/
extern const unsigned char sqlite3UtfTrans1[];
@@ -5933,11 +5933,11 @@ extern const unsigned char sqlite3UtfTrans1[];
/*
** Macros for reading UTF8 characters.
**
-** STQLITE_READ_UTF8(x,c) reads a single UTF8 value out of x and writes
+** SQLITE_READ_UTF8(x,c) reads a single UTF8 value out of x and writes
** that value into c. The type of x must be unsigned char*. The type
** of c must be unsigned int.
**
-** STQLITE_SKIP_UTF8(x) advances x forward by one character. The type of
+** SQLITE_SKIP_UTF8(x) advances x forward by one character. The type of
** x must be unsigned char*.
**
** Notes On Invalid UTF-8:
@@ -5960,7 +5960,7 @@ extern const unsigned char sqlite3UtfTrans1[];
** encodings to 0xfffd as some systems recommend.
**
*/
-#define STQLITE_READ_UTF8(zIn, c) { \
+#define SQLITE_READ_UTF8(zIn, c) { \
c = *(zIn++); \
if( c>=0xc0 ){ \
c = sqlite3UtfTrans1[c-0xc0]; \
@@ -5972,7 +5972,7 @@ extern const unsigned char sqlite3UtfTrans1[];
|| (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; } \
} \
}
-#define STQLITE_SKIP_UTF8(zIn) { \
+#define SQLITE_SKIP_UTF8(zIn) { \
if( (*(zIn++))>=0xc0 ){ \
while( (*zIn & 0xc0)==0x80 ){ zIn++; } \
} \
@@ -5982,185 +5982,185 @@ extern const unsigned char sqlite3UtfTrans1[];
/*
-** The STQLITE_CORRUPT_BKPT macro can be either a constant (for production
+** The SQLITE_CORRUPT_BKPT macro can be either a constant (for production
** builds) or a function call (for debugging). If it is a function call,
** it allows the operator to set a breakpoint at the spot where database
** corruption is first detected.
*/
-#ifdef STQLITE_DEBUG
-STQLITE_PRIVATE int sqlite3Corrupt(void);
-# define STQLITE_CORRUPT_BKPT sqlite3Corrupt()
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3Corrupt(void);
+# define SQLITE_CORRUPT_BKPT sqlite3Corrupt()
#else
-# define STQLITE_CORRUPT_BKPT STQLITE_CORRUPT
+# define SQLITE_CORRUPT_BKPT SQLITE_CORRUPT
#endif
/*
** Internal function prototypes
*/
-STQLITE_PRIVATE int sqlite3StrICmp(const char *, const char *);
-STQLITE_PRIVATE int sqlite3StrNICmp(const char *, const char *, int);
-STQLITE_PRIVATE int sqlite3IsNumber(const char*, int*, u8);
+SQLITE_PRIVATE int sqlite3StrICmp(const char *, const char *);
+SQLITE_PRIVATE int sqlite3StrNICmp(const char *, const char *, int);
+SQLITE_PRIVATE int sqlite3IsNumber(const char*, int*, u8);
-STQLITE_PRIVATE void *sqlite3Malloc(int,int);
-STQLITE_PRIVATE void *sqlite3MallocRaw(int,int);
-STQLITE_PRIVATE void *sqlite3Realloc(void*,int);
-STQLITE_PRIVATE char *sqlite3StrDup(const char*);
-STQLITE_PRIVATE char *sqlite3StrNDup(const char*, int);
+SQLITE_PRIVATE void *sqlite3Malloc(int,int);
+SQLITE_PRIVATE void *sqlite3MallocRaw(int,int);
+SQLITE_PRIVATE void *sqlite3Realloc(void*,int);
+SQLITE_PRIVATE char *sqlite3StrDup(const char*);
+SQLITE_PRIVATE char *sqlite3StrNDup(const char*, int);
# define sqlite3CheckMemory(a,b)
-STQLITE_PRIVATE void *sqlite3ReallocOrFree(void*,int);
-STQLITE_PRIVATE void sqlite3FreeX(void*);
-STQLITE_PRIVATE void *sqlite3MallocX(int);
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
-STQLITE_PRIVATE int sqlite3AllocSize(void *);
-#endif
-
-STQLITE_PRIVATE char *sqlite3MPrintf(const char*, ...);
-STQLITE_PRIVATE char *sqlite3VMPrintf(const char*, va_list);
-#if defined(STQLITE_TEST) || defined(STQLITE_DEBUG)
-STQLITE_PRIVATE void sqlite3DebugPrintf(const char*, ...);
-STQLITE_PRIVATE void *sqlite3TextToPtr(const char*);
-#endif
-STQLITE_PRIVATE void sqlite3SetString(char **, ...);
-STQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
-STQLITE_PRIVATE void sqlite3ErrorClear(Parse*);
-STQLITE_PRIVATE void sqlite3Dequote(char*);
-STQLITE_PRIVATE void sqlite3DequoteExpr(Expr*);
-STQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
-STQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*, char **);
-STQLITE_PRIVATE void sqlite3FinishCoding(Parse*);
-STQLITE_PRIVATE Expr *sqlite3Expr(int, Expr*, Expr*, const Token*);
-STQLITE_PRIVATE Expr *sqlite3ExprOrFree(int, Expr*, Expr*, const Token*);
-STQLITE_PRIVATE Expr *sqlite3RegisterExpr(Parse*,Token*);
-STQLITE_PRIVATE Expr *sqlite3ExprAnd(Expr*, Expr*);
-STQLITE_PRIVATE void sqlite3ExprSpan(Expr*,Token*,Token*);
-STQLITE_PRIVATE Expr *sqlite3ExprFunction(ExprList*, Token*);
-STQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*);
-STQLITE_PRIVATE void sqlite3ExprDelete(Expr*);
-STQLITE_PRIVATE ExprList *sqlite3ExprListAppend(ExprList*,Expr*,Token*);
-STQLITE_PRIVATE void sqlite3ExprListDelete(ExprList*);
-STQLITE_PRIVATE int sqlite3Init(sqlite3*, char**);
-STQLITE_PRIVATE int sqlite3InitCallback(void*, int, char**, char**);
-STQLITE_PRIVATE void sqlite3Pragma(Parse*,Token*,Token*,Token*,int);
-STQLITE_PRIVATE void sqlite3ResetInternalSchema(sqlite3*, int);
-STQLITE_PRIVATE void sqlite3BeginParse(Parse*,int);
-STQLITE_PRIVATE void sqlite3CommitInternalChanges(sqlite3*);
-STQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse*,char*,Select*);
-STQLITE_PRIVATE void sqlite3OpenMasterTable(Parse *, int);
-STQLITE_PRIVATE void sqlite3StartTable(Parse*,Token*,Token*,int,int,int,int);
-STQLITE_PRIVATE void sqlite3AddColumn(Parse*,Token*);
-STQLITE_PRIVATE void sqlite3AddNotNull(Parse*, int);
-STQLITE_PRIVATE void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
-STQLITE_PRIVATE void sqlite3AddCheckConstraint(Parse*, Expr*);
-STQLITE_PRIVATE void sqlite3AddColumnType(Parse*,Token*);
-STQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,Expr*);
-STQLITE_PRIVATE void sqlite3AddCollateType(Parse*, const char*, int);
-STQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,Select*);
-
-STQLITE_PRIVATE void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int,int);
-
-#if !defined(STQLITE_OMIT_VIEW) || !defined(STQLITE_OMIT_VIRTUALTABLE)
-STQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse*,Table*);
+SQLITE_PRIVATE void *sqlite3ReallocOrFree(void*,int);
+SQLITE_PRIVATE void sqlite3FreeX(void*);
+SQLITE_PRIVATE void *sqlite3MallocX(int);
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+SQLITE_PRIVATE int sqlite3AllocSize(void *);
+#endif
+
+SQLITE_PRIVATE char *sqlite3MPrintf(const char*, ...);
+SQLITE_PRIVATE char *sqlite3VMPrintf(const char*, va_list);
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
+SQLITE_PRIVATE void sqlite3DebugPrintf(const char*, ...);
+SQLITE_PRIVATE void *sqlite3TextToPtr(const char*);
+#endif
+SQLITE_PRIVATE void sqlite3SetString(char **, ...);
+SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
+SQLITE_PRIVATE void sqlite3ErrorClear(Parse*);
+SQLITE_PRIVATE void sqlite3Dequote(char*);
+SQLITE_PRIVATE void sqlite3DequoteExpr(Expr*);
+SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
+SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*, char **);
+SQLITE_PRIVATE void sqlite3FinishCoding(Parse*);
+SQLITE_PRIVATE Expr *sqlite3Expr(int, Expr*, Expr*, const Token*);
+SQLITE_PRIVATE Expr *sqlite3ExprOrFree(int, Expr*, Expr*, const Token*);
+SQLITE_PRIVATE Expr *sqlite3RegisterExpr(Parse*,Token*);
+SQLITE_PRIVATE Expr *sqlite3ExprAnd(Expr*, Expr*);
+SQLITE_PRIVATE void sqlite3ExprSpan(Expr*,Token*,Token*);
+SQLITE_PRIVATE Expr *sqlite3ExprFunction(ExprList*, Token*);
+SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*);
+SQLITE_PRIVATE void sqlite3ExprDelete(Expr*);
+SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(ExprList*,Expr*,Token*);
+SQLITE_PRIVATE void sqlite3ExprListDelete(ExprList*);
+SQLITE_PRIVATE int sqlite3Init(sqlite3*, char**);
+SQLITE_PRIVATE int sqlite3InitCallback(void*, int, char**, char**);
+SQLITE_PRIVATE void sqlite3Pragma(Parse*,Token*,Token*,Token*,int);
+SQLITE_PRIVATE void sqlite3ResetInternalSchema(sqlite3*, int);
+SQLITE_PRIVATE void sqlite3BeginParse(Parse*,int);
+SQLITE_PRIVATE void sqlite3CommitInternalChanges(sqlite3*);
+SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse*,char*,Select*);
+SQLITE_PRIVATE void sqlite3OpenMasterTable(Parse *, int);
+SQLITE_PRIVATE void sqlite3StartTable(Parse*,Token*,Token*,int,int,int,int);
+SQLITE_PRIVATE void sqlite3AddColumn(Parse*,Token*);
+SQLITE_PRIVATE void sqlite3AddNotNull(Parse*, int);
+SQLITE_PRIVATE void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
+SQLITE_PRIVATE void sqlite3AddCheckConstraint(Parse*, Expr*);
+SQLITE_PRIVATE void sqlite3AddColumnType(Parse*,Token*);
+SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,Expr*);
+SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, const char*, int);
+SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,Select*);
+
+SQLITE_PRIVATE void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int,int);
+
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)
+SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse*,Table*);
#else
# define sqlite3ViewGetColumnNames(A,B) 0
#endif
-STQLITE_PRIVATE void sqlite3DropTable(Parse*, SrcList*, int, int);
-STQLITE_PRIVATE void sqlite3DeleteTable(Table*);
-STQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int);
-STQLITE_PRIVATE void *sqlite3ArrayAllocate(void*,int,int,int*,int*,int*);
-STQLITE_PRIVATE IdList *sqlite3IdListAppend(IdList*, Token*);
-STQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
-STQLITE_PRIVATE SrcList *sqlite3SrcListAppend(SrcList*, Token*, Token*);
-STQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(SrcList*, Token*, Token*, Token*,
+SQLITE_PRIVATE void sqlite3DropTable(Parse*, SrcList*, int, int);
+SQLITE_PRIVATE void sqlite3DeleteTable(Table*);
+SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int);
+SQLITE_PRIVATE void *sqlite3ArrayAllocate(void*,int,int,int*,int*,int*);
+SQLITE_PRIVATE IdList *sqlite3IdListAppend(IdList*, Token*);
+SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
+SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(SrcList*, Token*, Token*);
+SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(SrcList*, Token*, Token*, Token*,
Select*, Expr*, IdList*);
-STQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList*);
-STQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse*, SrcList*);
-STQLITE_PRIVATE void sqlite3IdListDelete(IdList*);
-STQLITE_PRIVATE void sqlite3SrcListDelete(SrcList*);
-STQLITE_PRIVATE void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
+SQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList*);
+SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse*, SrcList*);
+SQLITE_PRIVATE void sqlite3IdListDelete(IdList*);
+SQLITE_PRIVATE void sqlite3SrcListDelete(SrcList*);
+SQLITE_PRIVATE void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
Token*, int, int);
-STQLITE_PRIVATE void sqlite3DropIndex(Parse*, SrcList*, int);
-STQLITE_PRIVATE int sqlite3Select(Parse*, Select*, int, int, Select*, int, int*, char *aff);
-STQLITE_PRIVATE Select *sqlite3SelectNew(ExprList*,SrcList*,Expr*,ExprList*,Expr*,ExprList*,
+SQLITE_PRIVATE void sqlite3DropIndex(Parse*, SrcList*, int);
+SQLITE_PRIVATE int sqlite3Select(Parse*, Select*, int, int, Select*, int, int*, char *aff);
+SQLITE_PRIVATE Select *sqlite3SelectNew(ExprList*,SrcList*,Expr*,ExprList*,Expr*,ExprList*,
int,Expr*,Expr*);
-STQLITE_PRIVATE void sqlite3SelectDelete(Select*);
-STQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse*, SrcList*);
-STQLITE_PRIVATE int sqlite3IsReadOnly(Parse*, Table*, int);
-STQLITE_PRIVATE void sqlite3OpenTable(Parse*, int iCur, int iDb, Table*, int);
-STQLITE_PRIVATE void sqlite3DeleteFrom(Parse*, SrcList*, Expr*);
-STQLITE_PRIVATE void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int);
-STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**);
-STQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo*);
-STQLITE_PRIVATE void sqlite3ExprCodeGetColumn(Vdbe*, Table*, int, int);
-STQLITE_PRIVATE void sqlite3ExprCode(Parse*, Expr*);
-STQLITE_PRIVATE void sqlite3ExprCodeAndCache(Parse*, Expr*);
-STQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*);
-STQLITE_PRIVATE void sqlite3ExprIfTrue(Parse*, Expr*, int, int);
-STQLITE_PRIVATE void sqlite3ExprIfFalse(Parse*, Expr*, int, int);
-STQLITE_PRIVATE Table *sqlite3FindTable(sqlite3*,const char*, const char*);
-STQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,const char*, const char*);
-STQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
-STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
-STQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
-STQLITE_PRIVATE void sqlite3Vacuum(Parse*);
-STQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*);
-STQLITE_PRIVATE char *sqlite3NameFromToken(Token*);
-STQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*);
+SQLITE_PRIVATE void sqlite3SelectDelete(Select*);
+SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse*, SrcList*);
+SQLITE_PRIVATE int sqlite3IsReadOnly(Parse*, Table*, int);
+SQLITE_PRIVATE void sqlite3OpenTable(Parse*, int iCur, int iDb, Table*, int);
+SQLITE_PRIVATE void sqlite3DeleteFrom(Parse*, SrcList*, Expr*);
+SQLITE_PRIVATE void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int);
+SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**);
+SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo*);
+SQLITE_PRIVATE void sqlite3ExprCodeGetColumn(Vdbe*, Table*, int, int);
+SQLITE_PRIVATE void sqlite3ExprCode(Parse*, Expr*);
+SQLITE_PRIVATE void sqlite3ExprCodeAndCache(Parse*, Expr*);
+SQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*);
+SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse*, Expr*, int, int);
+SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse*, Expr*, int, int);
+SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3*,const char*, const char*);
+SQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,const char*, const char*);
+SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
+SQLITE_PRIVATE void sqlite3Vacuum(Parse*);
+SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*);
+SQLITE_PRIVATE char *sqlite3NameFromToken(Token*);
+SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*);
int sqliteFuncId(Token*);
-STQLITE_PRIVATE int sqlite3ExprResolveNames(NameContext *, Expr *);
-STQLITE_PRIVATE int sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
-STQLITE_PRIVATE int sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
-STQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
-STQLITE_PRIVATE Expr *sqlite3CreateIdExpr(const char*);
-STQLITE_PRIVATE void sqlite3Randomness(int, void*);
-STQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*);
-STQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
-STQLITE_PRIVATE void sqlite3BeginTransaction(Parse*, int);
-STQLITE_PRIVATE void sqlite3CommitTransaction(Parse*);
-STQLITE_PRIVATE void sqlite3RollbackTransaction(Parse*);
-STQLITE_PRIVATE int sqlite3ExprIsConstant(Expr*);
-STQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr*);
-STQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*);
-STQLITE_PRIVATE int sqlite3ExprIsInteger(Expr*, int*);
-STQLITE_PRIVATE int sqlite3IsRowid(const char*);
-STQLITE_PRIVATE void sqlite3GenerateRowDelete(sqlite3*, Vdbe*, Table*, int, int);
-STQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Vdbe*, Table*, int, char*);
-STQLITE_PRIVATE void sqlite3GenerateIndexKey(Vdbe*, Index*, int);
-STQLITE_PRIVATE void sqlite3GenerateConstraintChecks(Parse*,Table*,int,char*,int,int,int,int);
-STQLITE_PRIVATE void sqlite3CompleteInsertion(Parse*, Table*, int, char*, int, int, int, int);
-STQLITE_PRIVATE void sqlite3OpenTableAndIndices(Parse*, Table*, int, int);
-STQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse*, int, int);
-STQLITE_PRIVATE Expr *sqlite3ExprDup(Expr*);
-STQLITE_PRIVATE void sqlite3TokenCopy(Token*, Token*);
-STQLITE_PRIVATE ExprList *sqlite3ExprListDup(ExprList*);
-STQLITE_PRIVATE SrcList *sqlite3SrcListDup(SrcList*);
-STQLITE_PRIVATE IdList *sqlite3IdListDup(IdList*);
-STQLITE_PRIVATE Select *sqlite3SelectDup(Select*);
-STQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int);
-STQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3*);
-STQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(sqlite3*);
-STQLITE_PRIVATE int sqlite3SafetyOn(sqlite3*);
-STQLITE_PRIVATE int sqlite3SafetyOff(sqlite3*);
-STQLITE_PRIVATE int sqlite3SafetyCheck(sqlite3*);
-STQLITE_PRIVATE void sqlite3ChangeCookie(sqlite3*, Vdbe*, int);
-
-#ifndef STQLITE_OMIT_TRIGGER
-STQLITE_PRIVATE void sqlite3BeginTrigger(Parse*, Token*,Token*,int,int,IdList*,SrcList*,
+SQLITE_PRIVATE int sqlite3ExprResolveNames(NameContext *, Expr *);
+SQLITE_PRIVATE int sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
+SQLITE_PRIVATE int sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
+SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
+SQLITE_PRIVATE Expr *sqlite3CreateIdExpr(const char*);
+SQLITE_PRIVATE void sqlite3Randomness(int, void*);
+SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*);
+SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
+SQLITE_PRIVATE void sqlite3BeginTransaction(Parse*, int);
+SQLITE_PRIVATE void sqlite3CommitTransaction(Parse*);
+SQLITE_PRIVATE void sqlite3RollbackTransaction(Parse*);
+SQLITE_PRIVATE int sqlite3ExprIsConstant(Expr*);
+SQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr*);
+SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*);
+SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr*, int*);
+SQLITE_PRIVATE int sqlite3IsRowid(const char*);
+SQLITE_PRIVATE void sqlite3GenerateRowDelete(sqlite3*, Vdbe*, Table*, int, int);
+SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Vdbe*, Table*, int, char*);
+SQLITE_PRIVATE void sqlite3GenerateIndexKey(Vdbe*, Index*, int);
+SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(Parse*,Table*,int,char*,int,int,int,int);
+SQLITE_PRIVATE void sqlite3CompleteInsertion(Parse*, Table*, int, char*, int, int, int, int);
+SQLITE_PRIVATE void sqlite3OpenTableAndIndices(Parse*, Table*, int, int);
+SQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse*, int, int);
+SQLITE_PRIVATE Expr *sqlite3ExprDup(Expr*);
+SQLITE_PRIVATE void sqlite3TokenCopy(Token*, Token*);
+SQLITE_PRIVATE ExprList *sqlite3ExprListDup(ExprList*);
+SQLITE_PRIVATE SrcList *sqlite3SrcListDup(SrcList*);
+SQLITE_PRIVATE IdList *sqlite3IdListDup(IdList*);
+SQLITE_PRIVATE Select *sqlite3SelectDup(Select*);
+SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int);
+SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3*);
+SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(sqlite3*);
+SQLITE_PRIVATE int sqlite3SafetyOn(sqlite3*);
+SQLITE_PRIVATE int sqlite3SafetyOff(sqlite3*);
+SQLITE_PRIVATE int sqlite3SafetyCheck(sqlite3*);
+SQLITE_PRIVATE void sqlite3ChangeCookie(sqlite3*, Vdbe*, int);
+
+#ifndef SQLITE_OMIT_TRIGGER
+SQLITE_PRIVATE void sqlite3BeginTrigger(Parse*, Token*,Token*,int,int,IdList*,SrcList*,
Expr*,int, int);
-STQLITE_PRIVATE void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*);
-STQLITE_PRIVATE void sqlite3DropTrigger(Parse*, SrcList*, int);
-STQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse*, Trigger*);
-STQLITE_PRIVATE int sqlite3TriggersExist(Parse*, Table*, int, ExprList*);
-STQLITE_PRIVATE int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int,
+SQLITE_PRIVATE void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*);
+SQLITE_PRIVATE void sqlite3DropTrigger(Parse*, SrcList*, int);
+SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse*, Trigger*);
+SQLITE_PRIVATE int sqlite3TriggersExist(Parse*, Table*, int, ExprList*);
+SQLITE_PRIVATE int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int,
int, int);
void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
-STQLITE_PRIVATE void sqlite3DeleteTriggerStep(TriggerStep*);
-STQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(Select*);
-STQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(Token*, IdList*, ExprList*,Select*,int);
-STQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(Token*, ExprList*, Expr*, int);
-STQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(Token*, Expr*);
-STQLITE_PRIVATE void sqlite3DeleteTrigger(Trigger*);
-STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
+SQLITE_PRIVATE void sqlite3DeleteTriggerStep(TriggerStep*);
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(Select*);
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(Token*, IdList*, ExprList*,Select*,int);
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(Token*, ExprList*, Expr*, int);
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(Token*, Expr*);
+SQLITE_PRIVATE void sqlite3DeleteTrigger(Trigger*);
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
#else
# define sqlite3TriggersExist(A,B,C,D,E,F) 0
# define sqlite3DeleteTrigger(A)
@@ -6169,199 +6169,199 @@ STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
# define sqlite3CodeRowTrigger(A,B,C,D,E,F,G,H,I) 0
#endif
-STQLITE_PRIVATE int sqlite3JoinType(Parse*, Token*, Token*, Token*);
-STQLITE_PRIVATE void sqlite3CreateForeignKey(Parse*, ExprList*, Token*, ExprList*, int);
-STQLITE_PRIVATE void sqlite3DeferForeignKey(Parse*, int);
-#ifndef STQLITE_OMIT_AUTHORIZATION
-STQLITE_PRIVATE void sqlite3AuthRead(Parse*,Expr*,SrcList*);
-STQLITE_PRIVATE int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*);
-STQLITE_PRIVATE void sqlite3AuthContextPush(Parse*, AuthContext*, const char*);
-STQLITE_PRIVATE void sqlite3AuthContextPop(AuthContext*);
+SQLITE_PRIVATE int sqlite3JoinType(Parse*, Token*, Token*, Token*);
+SQLITE_PRIVATE void sqlite3CreateForeignKey(Parse*, ExprList*, Token*, ExprList*, int);
+SQLITE_PRIVATE void sqlite3DeferForeignKey(Parse*, int);
+#ifndef SQLITE_OMIT_AUTHORIZATION
+SQLITE_PRIVATE void sqlite3AuthRead(Parse*,Expr*,SrcList*);
+SQLITE_PRIVATE int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*);
+SQLITE_PRIVATE void sqlite3AuthContextPush(Parse*, AuthContext*, const char*);
+SQLITE_PRIVATE void sqlite3AuthContextPop(AuthContext*);
#else
# define sqlite3AuthRead(a,b,c)
-# define sqlite3AuthCheck(a,b,c,d,e) STQLITE_OK
+# define sqlite3AuthCheck(a,b,c,d,e) SQLITE_OK
# define sqlite3AuthContextPush(a,b,c)
# define sqlite3AuthContextPop(a) ((void)(a))
#endif
-STQLITE_PRIVATE void sqlite3Attach(Parse*, Expr*, Expr*, Expr*);
-STQLITE_PRIVATE void sqlite3Detach(Parse*, Expr*);
-STQLITE_PRIVATE int sqlite3BtreeFactory(const sqlite3 *db, const char *zFilename,
+SQLITE_PRIVATE void sqlite3Attach(Parse*, Expr*, Expr*, Expr*);
+SQLITE_PRIVATE void sqlite3Detach(Parse*, Expr*);
+SQLITE_PRIVATE int sqlite3BtreeFactory(const sqlite3 *db, const char *zFilename,
int omitJournal, int nCache, Btree **ppBtree);
-STQLITE_PRIVATE int sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*);
-STQLITE_PRIVATE int sqlite3FixSrcList(DbFixer*, SrcList*);
-STQLITE_PRIVATE int sqlite3FixSelect(DbFixer*, Select*);
-STQLITE_PRIVATE int sqlite3FixExpr(DbFixer*, Expr*);
-STQLITE_PRIVATE int sqlite3FixExprList(DbFixer*, ExprList*);
-STQLITE_PRIVATE int sqlite3FixTriggerStep(DbFixer*, TriggerStep*);
-STQLITE_PRIVATE int sqlite3AtoF(const char *z, double*);
-STQLITE_API char *sqlite3_snprintf(int,char*,const char*,...);
-STQLITE_PRIVATE int sqlite3GetInt32(const char *, int*);
-STQLITE_PRIVATE int sqlite3FitsIn64Bits(const char *);
-STQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *pData, int nChar);
-STQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
-STQLITE_PRIVATE u32 sqlite3ReadUtf8(const unsigned char *);
-STQLITE_PRIVATE int sqlite3PutVarint(unsigned char *, u64);
-STQLITE_PRIVATE int sqlite3GetVarint(const unsigned char *, u64 *);
-STQLITE_PRIVATE int sqlite3GetVarint32(const unsigned char *, u32 *);
-STQLITE_PRIVATE int sqlite3VarintLen(u64 v);
-STQLITE_PRIVATE void sqlite3IndexAffinityStr(Vdbe *, Index *);
-STQLITE_PRIVATE void sqlite3TableAffinityStr(Vdbe *, Table *);
-STQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2);
-STQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity);
-STQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr);
-STQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*);
-STQLITE_PRIVATE void sqlite3Error(sqlite3*, int, const char*,...);
-STQLITE_PRIVATE void *sqlite3HexToBlob(const char *z);
-STQLITE_PRIVATE int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
-STQLITE_PRIVATE const char *sqlite3ErrStr(int);
-STQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse);
-STQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char *,int,int);
-STQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName);
-STQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr);
-STQLITE_PRIVATE Expr *sqlite3ExprSetColl(Parse *pParse, Expr *, Token *);
-STQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *, CollSeq *);
-STQLITE_PRIVATE int sqlite3CheckObjectName(Parse *, const char *);
-STQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *, int);
-STQLITE_PRIVATE void sqlite3Utf16Substr(sqlite3_context *,int,sqlite3_value **);
-
-STQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value*, u8);
-STQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value*, u8);
-STQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*));
-STQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value*);
-STQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(void);
-STQLITE_PRIVATE char *sqlite3Utf16to8(const void*, int);
-STQLITE_PRIVATE int sqlite3ValueFromExpr(Expr *, u8, u8, sqlite3_value **);
-STQLITE_PRIVATE void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8);
+SQLITE_PRIVATE int sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*);
+SQLITE_PRIVATE int sqlite3FixSrcList(DbFixer*, SrcList*);
+SQLITE_PRIVATE int sqlite3FixSelect(DbFixer*, Select*);
+SQLITE_PRIVATE int sqlite3FixExpr(DbFixer*, Expr*);
+SQLITE_PRIVATE int sqlite3FixExprList(DbFixer*, ExprList*);
+SQLITE_PRIVATE int sqlite3FixTriggerStep(DbFixer*, TriggerStep*);
+SQLITE_PRIVATE int sqlite3AtoF(const char *z, double*);
+SQLITE_API char *sqlite3_snprintf(int,char*,const char*,...);
+SQLITE_PRIVATE int sqlite3GetInt32(const char *, int*);
+SQLITE_PRIVATE int sqlite3FitsIn64Bits(const char *);
+SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *pData, int nChar);
+SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
+SQLITE_PRIVATE u32 sqlite3ReadUtf8(const unsigned char *);
+SQLITE_PRIVATE int sqlite3PutVarint(unsigned char *, u64);
+SQLITE_PRIVATE int sqlite3GetVarint(const unsigned char *, u64 *);
+SQLITE_PRIVATE int sqlite3GetVarint32(const unsigned char *, u32 *);
+SQLITE_PRIVATE int sqlite3VarintLen(u64 v);
+SQLITE_PRIVATE void sqlite3IndexAffinityStr(Vdbe *, Index *);
+SQLITE_PRIVATE void sqlite3TableAffinityStr(Vdbe *, Table *);
+SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2);
+SQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity);
+SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr);
+SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*);
+SQLITE_PRIVATE void sqlite3Error(sqlite3*, int, const char*,...);
+SQLITE_PRIVATE void *sqlite3HexToBlob(const char *z);
+SQLITE_PRIVATE int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
+SQLITE_PRIVATE const char *sqlite3ErrStr(int);
+SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse);
+SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char *,int,int);
+SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName);
+SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr);
+SQLITE_PRIVATE Expr *sqlite3ExprSetColl(Parse *pParse, Expr *, Token *);
+SQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *, CollSeq *);
+SQLITE_PRIVATE int sqlite3CheckObjectName(Parse *, const char *);
+SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *, int);
+SQLITE_PRIVATE void sqlite3Utf16Substr(sqlite3_context *,int,sqlite3_value **);
+
+SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value*, u8);
+SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value*, u8);
+SQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*));
+SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value*);
+SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(void);
+SQLITE_PRIVATE char *sqlite3Utf16to8(const void*, int);
+SQLITE_PRIVATE int sqlite3ValueFromExpr(Expr *, u8, u8, sqlite3_value **);
+SQLITE_PRIVATE void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8);
extern const unsigned char sqlite3UpperToLower[];
-STQLITE_PRIVATE void sqlite3RootPageMoved(Db*, int, int);
-STQLITE_PRIVATE void sqlite3Reindex(Parse*, Token*, Token*);
-STQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3*);
-STQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
-STQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
-STQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
-STQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*);
-STQLITE_PRIVATE void sqlite3CodeSubselect(Parse *, Expr *);
-STQLITE_PRIVATE int sqlite3SelectResolve(Parse *, Select *, NameContext *);
-STQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int);
-STQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
-STQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
-STQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(sqlite3*, CollSeq *, const char *, int);
-STQLITE_PRIVATE char sqlite3AffinityType(const Token*);
-STQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
-STQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*);
-STQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
-STQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB);
-STQLITE_PRIVATE void sqlite3DefaultRowEst(Index*);
-STQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3*, int);
-STQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*);
-STQLITE_PRIVATE ThreadData *sqlite3ThreadData(void);
-STQLITE_PRIVATE const ThreadData *sqlite3ThreadDataReadOnly(void);
-STQLITE_PRIVATE void sqlite3ReleaseThreadData(void);
-STQLITE_PRIVATE void sqlite3AttachFunctions(sqlite3 *);
-STQLITE_PRIVATE void sqlite3MinimumFileFormat(Parse*, int, int);
-STQLITE_PRIVATE void sqlite3SchemaFree(void *);
-STQLITE_PRIVATE Schema *sqlite3SchemaGet(Btree *);
-STQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *);
-STQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *, Index *);
-STQLITE_PRIVATE int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *,
+SQLITE_PRIVATE void sqlite3RootPageMoved(Db*, int, int);
+SQLITE_PRIVATE void sqlite3Reindex(Parse*, Token*, Token*);
+SQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3*);
+SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
+SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
+SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
+SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*);
+SQLITE_PRIVATE void sqlite3CodeSubselect(Parse *, Expr *);
+SQLITE_PRIVATE int sqlite3SelectResolve(Parse *, Select *, NameContext *);
+SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int);
+SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
+SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
+SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(sqlite3*, CollSeq *, const char *, int);
+SQLITE_PRIVATE char sqlite3AffinityType(const Token*);
+SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
+SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*);
+SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
+SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB);
+SQLITE_PRIVATE void sqlite3DefaultRowEst(Index*);
+SQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3*, int);
+SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*);
+SQLITE_PRIVATE ThreadData *sqlite3ThreadData(void);
+SQLITE_PRIVATE const ThreadData *sqlite3ThreadDataReadOnly(void);
+SQLITE_PRIVATE void sqlite3ReleaseThreadData(void);
+SQLITE_PRIVATE void sqlite3AttachFunctions(sqlite3 *);
+SQLITE_PRIVATE void sqlite3MinimumFileFormat(Parse*, int, int);
+SQLITE_PRIVATE void sqlite3SchemaFree(void *);
+SQLITE_PRIVATE Schema *sqlite3SchemaGet(Btree *);
+SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *);
+SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *, Index *);
+SQLITE_PRIVATE int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *,
void (*)(sqlite3_context*,int,sqlite3_value **),
void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*));
-STQLITE_PRIVATE int sqlite3ApiExit(sqlite3 *db, int);
-STQLITE_PRIVATE void sqlite3FailedMalloc(void);
-STQLITE_PRIVATE void sqlite3AbortOtherActiveVdbes(sqlite3 *, Vdbe *);
-STQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *);
-
-#ifndef STQLITE_OMIT_LOAD_EXTENSION
-STQLITE_PRIVATE void sqlite3CloseExtensions(sqlite3*);
-STQLITE_PRIVATE int sqlite3AutoLoadExtensions(sqlite3*);
+SQLITE_PRIVATE int sqlite3ApiExit(sqlite3 *db, int);
+SQLITE_PRIVATE void sqlite3FailedMalloc(void);
+SQLITE_PRIVATE void sqlite3AbortOtherActiveVdbes(sqlite3 *, Vdbe *);
+SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *);
+
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+SQLITE_PRIVATE void sqlite3CloseExtensions(sqlite3*);
+SQLITE_PRIVATE int sqlite3AutoLoadExtensions(sqlite3*);
#else
# define sqlite3CloseExtensions(X)
-# define sqlite3AutoLoadExtensions(X) STQLITE_OK
+# define sqlite3AutoLoadExtensions(X) SQLITE_OK
#endif
-#ifndef STQLITE_OMIT_SHARED_CACHE
-STQLITE_PRIVATE void sqlite3TableLock(Parse *, int, int, u8, const char *);
+#ifndef SQLITE_OMIT_SHARED_CACHE
+SQLITE_PRIVATE void sqlite3TableLock(Parse *, int, int, u8, const char *);
#else
#define sqlite3TableLock(v,w,x,y,z)
#endif
-#ifdef STQLITE_TEST
-STQLITE_PRIVATE int sqlite3Utf8To8(unsigned char*);
+#ifdef SQLITE_TEST
+SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char*);
#endif
-#ifdef STQLITE_MEMDEBUG
-STQLITE_PRIVATE void sqlite3MallocDisallow(void);
-STQLITE_PRIVATE void sqlite3MallocAllow(void);
-STQLITE_PRIVATE int sqlite3TestMallocFail(void);
+#ifdef SQLITE_MEMDEBUG
+SQLITE_PRIVATE void sqlite3MallocDisallow(void);
+SQLITE_PRIVATE void sqlite3MallocAllow(void);
+SQLITE_PRIVATE int sqlite3TestMallocFail(void);
#else
#define sqlite3TestMallocFail() 0
#define sqlite3MallocDisallow()
#define sqlite3MallocAllow()
#endif
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
-STQLITE_PRIVATE void *sqlite3ThreadSafeMalloc(int);
-STQLITE_PRIVATE void sqlite3ThreadSafeFree(void *);
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+SQLITE_PRIVATE void *sqlite3ThreadSafeMalloc(int);
+SQLITE_PRIVATE void sqlite3ThreadSafeFree(void *);
#else
#define sqlite3ThreadSafeMalloc sqlite3MallocX
#define sqlite3ThreadSafeFree sqlite3FreeX
#endif
-#ifdef STQLITE_OMIT_VIRTUALTABLE
+#ifdef SQLITE_OMIT_VIRTUALTABLE
# define sqlite3VtabClear(X)
# define sqlite3VtabSync(X,Y) (Y)
# define sqlite3VtabRollback(X)
# define sqlite3VtabCommit(X)
#else
-STQLITE_PRIVATE void sqlite3VtabClear(Table*);
-STQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, int rc);
-STQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db);
-STQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db);
-#endif
-STQLITE_PRIVATE void sqlite3VtabLock(sqlite3_vtab*);
-STQLITE_PRIVATE void sqlite3VtabUnlock(sqlite3*, sqlite3_vtab*);
-STQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*);
-STQLITE_PRIVATE void sqlite3VtabFinishParse(Parse*, Token*);
-STQLITE_PRIVATE void sqlite3VtabArgInit(Parse*);
-STQLITE_PRIVATE void sqlite3VtabArgExtend(Parse*, Token*);
-STQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **);
-STQLITE_PRIVATE int sqlite3VtabCallConnect(Parse*, Table*);
-STQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *);
-STQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *, sqlite3_vtab *);
-STQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(FuncDef*, int nArg, Expr*);
-STQLITE_PRIVATE void sqlite3InvalidFunction(sqlite3_context*,int,sqlite3_value**);
-STQLITE_PRIVATE int sqlite3Reprepare(Vdbe*);
-STQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, int, const char*);
+SQLITE_PRIVATE void sqlite3VtabClear(Table*);
+SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, int rc);
+SQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db);
+SQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db);
+#endif
+SQLITE_PRIVATE void sqlite3VtabLock(sqlite3_vtab*);
+SQLITE_PRIVATE void sqlite3VtabUnlock(sqlite3*, sqlite3_vtab*);
+SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*);
+SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse*, Token*);
+SQLITE_PRIVATE void sqlite3VtabArgInit(Parse*);
+SQLITE_PRIVATE void sqlite3VtabArgExtend(Parse*, Token*);
+SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **);
+SQLITE_PRIVATE int sqlite3VtabCallConnect(Parse*, Table*);
+SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *);
+SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *, sqlite3_vtab *);
+SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(FuncDef*, int nArg, Expr*);
+SQLITE_PRIVATE void sqlite3InvalidFunction(sqlite3_context*,int,sqlite3_value**);
+SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*);
+SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, int, const char*);
CollSeq* sqlite3BinaryCompareCollSeq(Parse *, Expr *, Expr *);
-#if STQLITE_MAX_EXPR_DEPTH>0
-STQLITE_PRIVATE void sqlite3ExprSetHeight(Expr *);
-STQLITE_PRIVATE int sqlite3SelectExprHeight(Select *);
+#if SQLITE_MAX_EXPR_DEPTH>0
+SQLITE_PRIVATE void sqlite3ExprSetHeight(Expr *);
+SQLITE_PRIVATE int sqlite3SelectExprHeight(Select *);
#else
#define sqlite3ExprSetHeight(x)
#endif
-STQLITE_PRIVATE u32 sqlite3Get2byte(const u8*);
-STQLITE_PRIVATE u32 sqlite3Get4byte(const u8*);
-STQLITE_PRIVATE void sqlite3Put2byte(u8*, u32);
-STQLITE_PRIVATE void sqlite3Put4byte(u8*, u32);
+SQLITE_PRIVATE u32 sqlite3Get2byte(const u8*);
+SQLITE_PRIVATE u32 sqlite3Get4byte(const u8*);
+SQLITE_PRIVATE void sqlite3Put2byte(u8*, u32);
+SQLITE_PRIVATE void sqlite3Put4byte(u8*, u32);
-#ifdef STQLITE_SSE
+#ifdef SQLITE_SSE
#include "sseInt.h"
#endif
-#ifdef STQLITE_DEBUG
-STQLITE_PRIVATE void sqlite3ParserTrace(FILE*, char *);
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3ParserTrace(FILE*, char *);
#endif
/*
-** If the STQLITE_ENABLE IOTRACE exists then the global variable
+** If the SQLITE_ENABLE IOTRACE exists then the global variable
** sqlite3_io_trace is a pointer to a printf-like routine used to
** print I/O tracing messages.
*/
-#ifdef STQLITE_ENABLE_IOTRACE
+#ifdef SQLITE_ENABLE_IOTRACE
# define IOTRACE(A) if( sqlite3_io_trace ){ sqlite3_io_trace A; }
-STQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe*);
#else
# define IOTRACE(A)
# define sqlite3VdbeIOTraceSql(X)
@@ -6375,7 +6375,7 @@ extern void (*sqlite3_io_trace)(const char*,...);
#include <ctype.h>
#include <time.h>
-#ifndef STQLITE_OMIT_DATETIME_FUNCS
+#ifndef SQLITE_OMIT_DATETIME_FUNCS
/*
** A structure for holding a single date and time.
@@ -6638,7 +6638,7 @@ static int parseDateOrTime(const char *zDate, DateTime *p){
p->rJD = r;
p->validJD = 1;
return 0;
- }else if( sqlite3IsNumber(zDate, 0, STQLITE_UTF8) ){
+ }else if( sqlite3IsNumber(zDate, 0, SQLITE_UTF8) ){
getValue(zDate, &p->rJD);
p->validJD = 1;
return 0;
@@ -6992,7 +6992,7 @@ static int isDate(int argc, sqlite3_value **argv, DateTime *p){
/*
** The following routines implement the various date and time functions
-** of STQLite.
+** of SQLite.
*/
/*
@@ -7028,7 +7028,7 @@ static void datetimeFunc(
computeYMD_HMS(&x);
sqlite3_snprintf(sizeof(zBuf), zBuf, "%04d-%02d-%02d %02d:%02d:%02d",
x.Y, x.M, x.D, x.h, x.m, (int)(x.s));
- sqlite3_result_text(context, zBuf, -1, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
}
}
@@ -7047,7 +7047,7 @@ static void timeFunc(
char zBuf[100];
computeHMS(&x);
sqlite3_snprintf(sizeof(zBuf), zBuf, "%02d:%02d:%02d", x.h, x.m, (int)x.s);
- sqlite3_result_text(context, zBuf, -1, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
}
}
@@ -7066,7 +7066,7 @@ static void dateFunc(
char zBuf[100];
computeYMD(&x);
sqlite3_snprintf(sizeof(zBuf), zBuf, "%04d-%02d-%02d", x.Y, x.M, x.D);
- sqlite3_result_text(context, zBuf, -1, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
}
}
@@ -7136,7 +7136,7 @@ static void strftimeFunc(
}
if( n<sizeof(zBuf) ){
z = zBuf;
- }else if( n>STQLITE_MAX_LENGTH ){
+ }else if( n>SQLITE_MAX_LENGTH ){
sqlite3_result_error_toobig(context);
return;
}else{
@@ -7201,7 +7201,7 @@ static void strftimeFunc(
}
}
z[j] = 0;
- sqlite3_result_text(context, z, -1, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT);
if( z!=zBuf ){
sqliteFree(z);
}
@@ -7219,7 +7219,7 @@ static void ctimeFunc(
){
sqlite3_value *pVal = sqlite3ValueNew();
if( pVal ){
- sqlite3ValueSetStr(pVal, -1, "now", STQLITE_UTF8, STQLITE_STATIC);
+ sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC);
timeFunc(context, 1, &pVal);
sqlite3ValueFree(pVal);
}
@@ -7237,7 +7237,7 @@ static void cdateFunc(
){
sqlite3_value *pVal = sqlite3ValueNew();
if( pVal ){
- sqlite3ValueSetStr(pVal, -1, "now", STQLITE_UTF8, STQLITE_STATIC);
+ sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC);
dateFunc(context, 1, &pVal);
sqlite3ValueFree(pVal);
}
@@ -7255,14 +7255,14 @@ static void ctimestampFunc(
){
sqlite3_value *pVal = sqlite3ValueNew();
if( pVal ){
- sqlite3ValueSetStr(pVal, -1, "now", STQLITE_UTF8, STQLITE_STATIC);
+ sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC);
datetimeFunc(context, 1, &pVal);
sqlite3ValueFree(pVal);
}
}
-#endif /* !defined(STQLITE_OMIT_DATETIME_FUNCS) */
+#endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */
-#ifdef STQLITE_OMIT_DATETIME_FUNCS
+#ifdef SQLITE_OMIT_DATETIME_FUNCS
/*
** If the library is compiled to omit the full-scale date and time
** handling (to get a smaller binary), the following minimal version
@@ -7284,7 +7284,7 @@ static void currentTimeFunc(
char zBuf[20];
time(&t);
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
{
extern int sqlite3_current_time; /* See os_XXX.c */
if( sqlite3_current_time ){
@@ -7309,7 +7309,7 @@ static void currentTimeFunc(
}
#endif
- sqlite3_result_text(context, zBuf, -1, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
}
#endif
@@ -7318,8 +7318,8 @@ static void currentTimeFunc(
** functions. This should be the only routine in this file with
** external linkage.
*/
-STQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(sqlite3 *db){
-#ifndef STQLITE_OMIT_DATETIME_FUNCS
+SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(sqlite3 *db){
+#ifndef SQLITE_OMIT_DATETIME_FUNCS
static const struct {
char *zName;
int nArg;
@@ -7338,7 +7338,7 @@ STQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(sqlite3 *db){
for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
sqlite3CreateFunc(db, aFuncs[i].zName, aFuncs[i].nArg,
- STQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0);
+ SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0);
}
#else
static const struct {
@@ -7352,7 +7352,7 @@ STQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(sqlite3 *db){
int i;
for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
- sqlite3CreateFunc(db, aFuncs[i].zName, 0, STQLITE_UTF8,
+ sqlite3CreateFunc(db, aFuncs[i].zName, 0, SQLITE_UTF8,
aFuncs[i].zFormat, currentTimeFunc, 0, 0);
}
#endif
@@ -7375,62 +7375,62 @@ STQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(sqlite3 *db){
** This file contains OS interface code that is common to all
** architectures.
*/
-#define _STQLITE_OS_C_ 1
-#undef _STQLITE_OS_C_
+#define _SQLITE_OS_C_ 1
+#undef _SQLITE_OS_C_
/*
** The following routines are convenience wrappers around methods
** of the OsFile object. This is mostly just syntactic sugar. All
-** of this would be completely automatic if STQLite were coded using
+** of this would be completely automatic if SQLite were coded using
** C++ instead of plain old C.
*/
-STQLITE_PRIVATE int sqlite3OsClose(OsFile **pId){
+SQLITE_PRIVATE int sqlite3OsClose(OsFile **pId){
OsFile *id;
if( pId!=0 && (id = *pId)!=0 ){
return id->pMethod->xClose(pId);
}else{
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
-STQLITE_PRIVATE int sqlite3OsOpenDirectory(OsFile *id, const char *zName){
+SQLITE_PRIVATE int sqlite3OsOpenDirectory(OsFile *id, const char *zName){
return id->pMethod->xOpenDirectory(id, zName);
}
-STQLITE_PRIVATE int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
+SQLITE_PRIVATE int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
return id->pMethod->xRead(id, pBuf, amt);
}
-STQLITE_PRIVATE int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
+SQLITE_PRIVATE int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
return id->pMethod->xWrite(id, pBuf, amt);
}
-STQLITE_PRIVATE int sqlite3OsSeek(OsFile *id, i64 offset){
+SQLITE_PRIVATE int sqlite3OsSeek(OsFile *id, i64 offset){
return id->pMethod->xSeek(id, offset);
}
-STQLITE_PRIVATE int sqlite3OsTruncate(OsFile *id, i64 size){
+SQLITE_PRIVATE int sqlite3OsTruncate(OsFile *id, i64 size){
return id->pMethod->xTruncate(id, size);
}
-STQLITE_PRIVATE int sqlite3OsSync(OsFile *id, int fullsync){
+SQLITE_PRIVATE int sqlite3OsSync(OsFile *id, int fullsync){
return id->pMethod->xSync(id, fullsync);
}
-STQLITE_PRIVATE void sqlite3OsSetFullSync(OsFile *id, int value){
+SQLITE_PRIVATE void sqlite3OsSetFullSync(OsFile *id, int value){
id->pMethod->xSetFullSync(id, value);
}
-STQLITE_PRIVATE int sqlite3OsFileSize(OsFile *id, i64 *pSize){
+SQLITE_PRIVATE int sqlite3OsFileSize(OsFile *id, i64 *pSize){
return id->pMethod->xFileSize(id, pSize);
}
-STQLITE_PRIVATE int sqlite3OsLock(OsFile *id, int lockType){
+SQLITE_PRIVATE int sqlite3OsLock(OsFile *id, int lockType){
return id->pMethod->xLock(id, lockType);
}
-STQLITE_PRIVATE int sqlite3OsUnlock(OsFile *id, int lockType){
+SQLITE_PRIVATE int sqlite3OsUnlock(OsFile *id, int lockType){
return id->pMethod->xUnlock(id, lockType);
}
-STQLITE_PRIVATE int sqlite3OsCheckReservedLock(OsFile *id){
+SQLITE_PRIVATE int sqlite3OsCheckReservedLock(OsFile *id){
return id->pMethod->xCheckReservedLock(id);
}
-STQLITE_PRIVATE int sqlite3OsSectorSize(OsFile *id){
+SQLITE_PRIVATE int sqlite3OsSectorSize(OsFile *id){
int (*xSectorSize)(OsFile*) = id->pMethod->xSectorSize;
- return xSectorSize ? xSectorSize(id) : STQLITE_DEFAULT_SECTOR_SIZE;
+ return xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE;
}
-#if defined(STQLITE_TEST) || defined(STQLITE_DEBUG)
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
/* These methods are currently only used for testing and debugging. */
int sqlite3OsFileHandle(OsFile *id){
return id->pMethod->xFileHandle(id);
@@ -7440,7 +7440,7 @@ STQLITE_PRIVATE int sqlite3OsSectorSize(OsFile *id){
}
#endif
-#ifdef STQLITE_ENABLE_REDEF_IO
+#ifdef SQLITE_ENABLE_REDEF_IO
/*
** A function to return a pointer to the virtual function table.
** This routine really does not accomplish very much since the
@@ -7510,7 +7510,7 @@ struct sqlite3OsVtbl *sqlite3_os_switch(void){
** The test wrapper provides extra test facilities to ensure the library
** does not leak memory and handles the failure of the underlying OS level
** allocation system correctly. It is only present if the library is
-** compiled with the STQLITE_MEMDEBUG macro set.
+** compiled with the SQLITE_MEMDEBUG macro set.
**
** * Guardposts to detect overwrites.
** * Ability to cause a specific Malloc() or Realloc() to fail.
@@ -7519,7 +7519,7 @@ struct sqlite3OsVtbl *sqlite3_os_switch(void){
#define MAX(x,y) ((x)>(y)?(x):(y))
-#if defined(STQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(STQLITE_OMIT_DISKIO)
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(SQLITE_OMIT_DISKIO)
/*
** Set the soft heap-size limit for the current thread. Passing a negative
** value indicates no limit.
@@ -7533,13 +7533,13 @@ void sqlite3_soft_heap_limit(int n){
}
/*
-** Release memory held by STQLite instances created by the current thread.
+** Release memory held by SQLite instances created by the current thread.
*/
int sqlite3_release_memory(int n){
return sqlite3PagerReleaseMemory(n);
}
#else
-/* If STQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, then define a version
+/* If SQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, then define a version
** of sqlite3_release_memory() to be used by other code in this file.
** This is done for no better reason than to reduce the number of
** pre-processor #ifndef statements.
@@ -7547,23 +7547,23 @@ int sqlite3_release_memory(int n){
#define sqlite3_release_memory(x) 0 /* 0 == no memory freed */
#endif
-#ifdef STQLITE_MEMDEBUG
+#ifdef SQLITE_MEMDEBUG
/*--------------------------------------------------------------------------
** Begin code for memory allocation system test layer.
**
-** Memory debugging is turned on by defining the STQLITE_MEMDEBUG macro.
+** Memory debugging is turned on by defining the SQLITE_MEMDEBUG macro.
**
-** STQLITE_MEMDEBUG==1 -> Fence-posting only (thread safe)
-** STQLITE_MEMDEBUG==2 -> Fence-posting + linked list of allocations (not ts)
-** STQLITE_MEMDEBUG==3 -> Above + backtraces (not thread safe, req. glibc)
+** SQLITE_MEMDEBUG==1 -> Fence-posting only (thread safe)
+** SQLITE_MEMDEBUG==2 -> Fence-posting + linked list of allocations (not ts)
+** SQLITE_MEMDEBUG==3 -> Above + backtraces (not thread safe, req. glibc)
*/
/* Figure out whether or not to store backtrace() information for each malloc.
-** The backtrace() function is only used if STQLITE_MEMDEBUG is set to 2 or
+** The backtrace() function is only used if SQLITE_MEMDEBUG is set to 2 or
** greater and glibc is in use. If we don't want to use backtrace(), then just
** define it as an empty macro and set the amount of space reserved to 0.
*/
-#if defined(__GLIBC__) && STQLITE_MEMDEBUG>2
+#if defined(__GLIBC__) && SQLITE_MEMDEBUG>2
extern int backtrace(void **, int);
#define TESTALLOC_STACKSIZE 128
#define TESTALLOC_STACKFRAMES ((TESTALLOC_STACKSIZE-8)/sizeof(void*))
@@ -7664,7 +7664,7 @@ int sqlite3_mallocfail_trace = 0; /* Print a msg on malloc fail if true */
** Check for a simulated memory allocation failure. Return true if
** the failure should be simulated. Return false to proceed as normal.
*/
-STQLITE_PRIVATE int sqlite3TestMallocFail(){
+SQLITE_PRIVATE int sqlite3TestMallocFail(){
if( sqlite3_isFail ){
return 1;
}
@@ -7769,7 +7769,7 @@ static void *getOsPointer(void *p)
}
-#if STQLITE_MEMDEBUG>1
+#if SQLITE_MEMDEBUG>1
/*
** The argument points to an Os level allocation. Link it into the threads list
** of allocations.
@@ -7849,8 +7849,8 @@ static void relinkAlloc(void *p)
** Todo: We could have a version of this function that outputs to stdout,
** to debug memory leaks when Tcl is not available.
*/
-#if defined(TCLSH) && defined(STQLITE_DEBUG) && STQLITE_MEMDEBUG>1
-STQLITE_PRIVATE int sqlite3OutstandingMallocs(Tcl_Interp *interp){
+#if defined(TCLSH) && defined(SQLITE_DEBUG) && SQLITE_MEMDEBUG>1
+SQLITE_PRIVATE int sqlite3OutstandingMallocs(Tcl_Interp *interp){
void *p;
Tcl_Obj *pRes = Tcl_NewObj();
Tcl_IncrRefCount(pRes);
@@ -7900,7 +7900,7 @@ STQLITE_PRIVATE int sqlite3OutstandingMallocs(Tcl_Interp *interp){
*/
static void * OSMALLOC(int n){
sqlite3OsEnterMutex();
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
sqlite3_nMaxAlloc =
MAX(sqlite3_nMaxAlloc, sqlite3ThreadDataReadOnly()->nAlloc);
#endif
@@ -7947,7 +7947,7 @@ static void OSFREE(void *pFree){
** This is the test layer's wrapper around sqlite3OsRealloc().
*/
static void * OSREALLOC(void *pRealloc, int n){
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
sqlite3_nMaxAlloc =
MAX(sqlite3_nMaxAlloc, sqlite3ThreadDataReadOnly()->nAlloc);
#endif
@@ -7969,7 +7969,7 @@ static void OSMALLOC_FAILED(){
#else
/* Define macros to call the sqlite3OsXXX interface directly if
-** the STQLITE_MEMDEBUG macro is not defined.
+** the SQLITE_MEMDEBUG macro is not defined.
*/
#define OSMALLOC(x) sqlite3OsMalloc(x)
#define OSREALLOC(x,y) sqlite3OsRealloc(x,y)
@@ -7977,7 +7977,7 @@ static void OSMALLOC_FAILED(){
#define OSSIZEOF(x) sqlite3OsAllocationSize(x)
#define OSMALLOC_FAILED()
-#endif /* STQLITE_MEMDEBUG */
+#endif /* SQLITE_MEMDEBUG */
/*
** End code for memory allocation system test layer.
**--------------------------------------------------------------------------*/
@@ -7993,10 +7993,10 @@ static void OSMALLOC_FAILED(){
** false. The updateMemoryUsedCount() routine below will deallocate
** the TSD if it ought to be.
**
-** If STQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, this routine is
+** If SQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, this routine is
** a no-op
*/
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
static int enforceSoftLimit(int n){
ThreadData *pTsd = sqlite3ThreadData();
if( pTsd==0 ){
@@ -8017,10 +8017,10 @@ static int enforceSoftLimit(int n){
** thread-specific-data (TSD). If after this update the TSD is
** no longer being used, then deallocate it.
**
-** If STQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, this routine is
+** If SQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, this routine is
** a no-op
*/
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
static void updateMemoryUsedCount(int n){
ThreadData *pTsd = sqlite3ThreadData();
if( pTsd ){
@@ -8040,7 +8040,7 @@ static void updateMemoryUsedCount(int n){
** sqlite3OsMalloc(). If the Malloc() call fails, attempt to free memory
** by calling sqlite3_release_memory().
*/
-STQLITE_PRIVATE void *sqlite3MallocRaw(int n, int doMemManage){
+SQLITE_PRIVATE void *sqlite3MallocRaw(int n, int doMemManage){
void *p = 0;
if( n>0 && !sqlite3MallocFailed() && (!doMemManage || enforceSoftLimit(n)) ){
while( (p = OSMALLOC(n))==0 && sqlite3_release_memory(n) ){}
@@ -8059,7 +8059,7 @@ STQLITE_PRIVATE void *sqlite3MallocRaw(int n, int doMemManage){
** pointer to the new allocation is returned. If the Realloc() call fails,
** attempt to free memory by calling sqlite3_release_memory().
*/
-STQLITE_PRIVATE void *sqlite3Realloc(void *p, int n){
+SQLITE_PRIVATE void *sqlite3Realloc(void *p, int n){
if( sqlite3MallocFailed() ){
return 0;
}
@@ -8068,7 +8068,7 @@ STQLITE_PRIVATE void *sqlite3Realloc(void *p, int n){
return sqlite3Malloc(n, 1);
}else{
void *np = 0;
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
int origSize = OSSIZEOF(p);
#endif
if( enforceSoftLimit(n - origSize) ){
@@ -8088,7 +8088,7 @@ STQLITE_PRIVATE void *sqlite3Realloc(void *p, int n){
** Free the memory pointed to by p. p must be either a NULL pointer or a
** value returned by a previous call to sqlite3Malloc() or sqlite3Realloc().
*/
-STQLITE_PRIVATE void sqlite3FreeX(void *p){
+SQLITE_PRIVATE void sqlite3FreeX(void *p){
if( p ){
updateMemoryUsedCount(0 - OSSIZEOF(p));
OSFREE(p);
@@ -8099,7 +8099,7 @@ STQLITE_PRIVATE void sqlite3FreeX(void *p){
** A version of sqliteMalloc() that is always a function, not a macro.
** Currently, this is used only to alloc to allocate the parser engine.
*/
-STQLITE_PRIVATE void *sqlite3MallocX(int n){
+SQLITE_PRIVATE void *sqlite3MallocX(int n){
return sqliteMalloc(n);
}
@@ -8110,14 +8110,14 @@ STQLITE_PRIVATE void *sqlite3MallocX(int n){
** These two are implemented as wrappers around sqlite3MallocRaw(),
** sqlite3Realloc() and sqlite3Free().
*/
-STQLITE_PRIVATE void *sqlite3Malloc(int n, int doMemManage){
+SQLITE_PRIVATE void *sqlite3Malloc(int n, int doMemManage){
void *p = sqlite3MallocRaw(n, doMemManage);
if( p ){
memset(p, 0, n);
}
return p;
}
-STQLITE_PRIVATE void *sqlite3ReallocOrFree(void *p, int n){
+SQLITE_PRIVATE void *sqlite3ReallocOrFree(void *p, int n){
void *pNew;
pNew = sqlite3Realloc(p, n);
if( !pNew ){
@@ -8139,12 +8139,12 @@ STQLITE_PRIVATE void *sqlite3ReallocOrFree(void *p, int n){
** not sqlite3Free(). Calling sqlite3Free() on memory obtained from
** ThreadSafeMalloc() will cause an error somewhere down the line.
*/
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
-STQLITE_PRIVATE void *sqlite3ThreadSafeMalloc(int n){
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+SQLITE_PRIVATE void *sqlite3ThreadSafeMalloc(int n){
(void)ENTER_MALLOC;
return sqlite3Malloc(n, 0);
}
-STQLITE_PRIVATE void sqlite3ThreadSafeFree(void *p){
+SQLITE_PRIVATE void sqlite3ThreadSafeFree(void *p){
(void)ENTER_MALLOC;
if( p ){
OSFREE(p);
@@ -8160,11 +8160,11 @@ STQLITE_PRIVATE void sqlite3ThreadSafeFree(void *p){
**
** The number of bytes allocated does not include any overhead inserted by
** any malloc() wrapper functions that may be called. So the value returned
-** is the number of bytes that were available to STQLite using pointer p,
+** is the number of bytes that were available to SQLite using pointer p,
** regardless of how much memory was actually allocated.
*/
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
-STQLITE_PRIVATE int sqlite3AllocSize(void *p){
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+SQLITE_PRIVATE int sqlite3AllocSize(void *p){
return OSSIZEOF(p);
}
#endif
@@ -8176,7 +8176,7 @@ STQLITE_PRIVATE int sqlite3AllocSize(void *p){
** called via macros that record the current file and line number in the
** ThreadData structure.
*/
-STQLITE_PRIVATE char *sqlite3StrDup(const char *z){
+SQLITE_PRIVATE char *sqlite3StrDup(const char *z){
char *zNew;
int n;
if( z==0 ) return 0;
@@ -8185,7 +8185,7 @@ STQLITE_PRIVATE char *sqlite3StrDup(const char *z){
if( zNew ) memcpy(zNew, z, n);
return zNew;
}
-STQLITE_PRIVATE char *sqlite3StrNDup(const char *z, int n){
+SQLITE_PRIVATE char *sqlite3StrNDup(const char *z, int n){
char *zNew;
if( z==0 ) return 0;
zNew = sqlite3MallocRaw(n+1, 1);
@@ -8203,7 +8203,7 @@ STQLITE_PRIVATE char *sqlite3StrNDup(const char *z, int n){
** point to that string. The 1st argument must either be NULL or
** point to memory obtained from sqliteMalloc().
*/
-STQLITE_PRIVATE void sqlite3SetString(char **pz, ...){
+SQLITE_PRIVATE void sqlite3SetString(char **pz, ...){
va_list ap;
int nByte;
const char *z;
@@ -8240,19 +8240,19 @@ STQLITE_PRIVATE void sqlite3SetString(char **pz, ...){
**
** The returned value is normally a copy of the second argument to this
** function. However, if a malloc() failure has occured since the previous
-** invocation STQLITE_NOMEM is returned instead.
+** invocation SQLITE_NOMEM is returned instead.
**
** If the first argument, db, is not NULL and a malloc() error has occured,
** then the connection error-code (the value returned by sqlite3_errcode())
-** is set to STQLITE_NOMEM.
+** is set to SQLITE_NOMEM.
*/
int sqlite3_mallocHasFailed = 0;
-STQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){
+SQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){
if( sqlite3MallocFailed() ){
sqlite3_mallocHasFailed = 0;
sqlite3OsLeaveMutex();
- sqlite3Error(db, STQLITE_NOMEM, 0);
- rc = STQLITE_NOMEM;
+ sqlite3Error(db, SQLITE_NOMEM, 0);
+ rc = SQLITE_NOMEM;
}
return rc & (db ? db->errMask : 0xff);
}
@@ -8260,7 +8260,7 @@ STQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){
/*
** Set the "malloc has failed" condition to true for this thread.
*/
-STQLITE_PRIVATE void sqlite3FailedMalloc(){
+SQLITE_PRIVATE void sqlite3FailedMalloc(){
if( !sqlite3MallocFailed() ){
sqlite3OsEnterMutex();
assert( sqlite3_mallocHasFailed==0 );
@@ -8268,12 +8268,12 @@ STQLITE_PRIVATE void sqlite3FailedMalloc(){
}
}
-#ifdef STQLITE_MEMDEBUG
+#ifdef SQLITE_MEMDEBUG
/*
** This function sets a flag in the thread-specific-data structure that will
** cause an assert to fail if sqliteMalloc() or sqliteRealloc() is called.
*/
-STQLITE_PRIVATE void sqlite3MallocDisallow(){
+SQLITE_PRIVATE void sqlite3MallocDisallow(){
assert( sqlite3_mallocDisallowed>=0 );
sqlite3_mallocDisallowed++;
}
@@ -8282,7 +8282,7 @@ STQLITE_PRIVATE void sqlite3MallocDisallow(){
** This function clears the flag set in the thread-specific-data structure set
** by sqlite3MallocDisallow().
*/
-STQLITE_PRIVATE void sqlite3MallocAllow(){
+SQLITE_PRIVATE void sqlite3MallocAllow(){
assert( sqlite3_mallocDisallowed>0 );
sqlite3_mallocDisallowed--;
}
@@ -8359,13 +8359,13 @@ STQLITE_PRIVATE void sqlite3MallocAllow(){
#define etCHARX 9 /* Characters. %c */
/* The rest are extensions, not normally found in printf() */
#define etCHARLIT 10 /* Literal characters. %' */
-#define etSTQLESCAPE 11 /* Strings with '\'' doubled. %q */
-#define etSTQLESCAPE2 12 /* Strings with '\'' doubled and enclosed in '',
+#define etSQLESCAPE 11 /* Strings with '\'' doubled. %q */
+#define etSQLESCAPE2 12 /* Strings with '\'' doubled and enclosed in '',
NULL pointers replaced by SQL NULL. %Q */
#define etTOKEN 13 /* a pointer to a Token structure */
#define etSRCLIST 14 /* a pointer to a SrcList */
#define etPOINTER 15 /* The %p conversion */
-#define etSTQLESCAPE3 16 /* %w -> Strings with '\"' doubled */
+#define etSQLESCAPE3 16 /* %w -> Strings with '\"' doubled */
/*
@@ -8405,15 +8405,15 @@ static const et_info fmtinfo[] = {
{ 's', 0, 4, etSTRING, 0, 0 },
{ 'g', 0, 1, etGENERIC, 30, 0 },
{ 'z', 0, 6, etDYNSTRING, 0, 0 },
- { 'q', 0, 4, etSTQLESCAPE, 0, 0 },
- { 'Q', 0, 4, etSTQLESCAPE2, 0, 0 },
- { 'w', 0, 4, etSTQLESCAPE3, 0, 0 },
+ { 'q', 0, 4, etSQLESCAPE, 0, 0 },
+ { 'Q', 0, 4, etSQLESCAPE2, 0, 0 },
+ { 'w', 0, 4, etSQLESCAPE3, 0, 0 },
{ 'c', 0, 0, etCHARX, 0, 0 },
{ 'o', 8, 0, etRADIX, 0, 2 },
{ 'u', 10, 0, etRADIX, 0, 0 },
{ 'x', 16, 0, etRADIX, 16, 1 },
{ 'X', 16, 0, etRADIX, 0, 4 },
-#ifndef STQLITE_OMIT_FLOATING_POINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
{ 'f', 0, 1, etFLOAT, 0, 0 },
{ 'e', 0, 1, etEXP, 30, 0 },
{ 'E', 0, 1, etEXP, 14, 0 },
@@ -8429,10 +8429,10 @@ static const et_info fmtinfo[] = {
#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0]))
/*
-** If STQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point
+** If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point
** conversions will work.
*/
-#ifndef STQLITE_OMIT_FLOATING_POINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
/*
** "*val" is a double such that 0.1 <= *val < 10.0
** Return the ascii code for the leading digit of *val, then
@@ -8456,17 +8456,17 @@ static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){
*val = (*val - d)*10.0;
return digit;
}
-#endif /* STQLITE_OMIT_FLOATING_POINT */
+#endif /* SQLITE_OMIT_FLOATING_POINT */
/*
** On machines with a small stack size, you can redefine the
-** STQLITE_PRINT_BUF_SIZE to be less than 350. But beware - for
+** SQLITE_PRINT_BUF_SIZE to be less than 350. But beware - for
** smaller values some %f conversions may go into an infinite loop.
*/
-#ifndef STQLITE_PRINT_BUF_SIZE
-# define STQLITE_PRINT_BUF_SIZE 350
+#ifndef SQLITE_PRINT_BUF_SIZE
+# define SQLITE_PRINT_BUF_SIZE 350
#endif
-#define etBUFSIZE STQLITE_PRINT_BUF_SIZE /* Size of the output buffer */
+#define etBUFSIZE SQLITE_PRINT_BUF_SIZE /* Size of the output buffer */
/*
** The root program. All variations call this core.
@@ -8529,7 +8529,7 @@ static int vxprintf(
static const char spaces[] =
" ";
#define etSPACESIZE (sizeof(spaces)-1)
-#ifndef STQLITE_OMIT_FLOATING_POINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
int exp, e2; /* exponent of real numbers */
double rounder; /* Used for rounding floating point values */
etByte flag_dp; /* True if decimal point should be shown */
@@ -8725,7 +8725,7 @@ static int vxprintf(
case etEXP:
case etGENERIC:
realvalue = va_arg(ap,double);
-#ifndef STQLITE_OMIT_FLOATING_POINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
if( precision<0 ) precision = 6; /* Set default precision */
if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10;
if( realvalue<0.0 ){
@@ -8903,19 +8903,19 @@ static int vxprintf(
length = strlen(bufpt);
if( precision>=0 && precision<length ) length = precision;
break;
- case etSTQLESCAPE:
- case etSTQLESCAPE2:
- case etSTQLESCAPE3: {
+ case etSQLESCAPE:
+ case etSQLESCAPE2:
+ case etSQLESCAPE3: {
int i, j, n, ch, isnull;
int needQuote;
- char q = ((xtype==etSTQLESCAPE3)?'"':'\''); /* Quote character */
+ char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */
char *escarg = va_arg(ap,char*);
isnull = escarg==0;
- if( isnull ) escarg = (xtype==etSTQLESCAPE2 ? "NULL" : "(NULL)");
+ if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
for(i=n=0; (ch=escarg[i])!=0; i++){
if( ch==q ) n++;
}
- needQuote = !isnull && xtype==etSTQLESCAPE2;
+ needQuote = !isnull && xtype==etSQLESCAPE2;
n += i + 1 + needQuote*2;
if( n>etBUFSIZE ){
bufpt = zExtra = sqliteMalloc( n );
@@ -9096,8 +9096,8 @@ static void *printf_realloc(void *old, int size){
** Print into memory obtained from sqliteMalloc(). Use the internal
** %-conversion extensions.
*/
-STQLITE_PRIVATE char *sqlite3VMPrintf(const char *zFormat, va_list ap){
- char zBase[STQLITE_PRINT_BUF_SIZE];
+SQLITE_PRIVATE char *sqlite3VMPrintf(const char *zFormat, va_list ap){
+ char zBase[SQLITE_PRINT_BUF_SIZE];
return base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap);
}
@@ -9105,10 +9105,10 @@ STQLITE_PRIVATE char *sqlite3VMPrintf(const char *zFormat, va_list ap){
** Print into memory obtained from sqliteMalloc(). Use the internal
** %-conversion extensions.
*/
-STQLITE_PRIVATE char *sqlite3MPrintf(const char *zFormat, ...){
+SQLITE_PRIVATE char *sqlite3MPrintf(const char *zFormat, ...){
va_list ap;
char *z;
- char zBase[STQLITE_PRINT_BUF_SIZE];
+ char zBase[SQLITE_PRINT_BUF_SIZE];
va_start(ap, zFormat);
z = base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap);
va_end(ap);
@@ -9119,8 +9119,8 @@ STQLITE_PRIVATE char *sqlite3MPrintf(const char *zFormat, ...){
** Print into memory obtained from sqlite3_malloc(). Omit the internal
** %-conversion extensions.
*/
-STQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
- char zBase[STQLITE_PRINT_BUF_SIZE];
+SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
+ char zBase[SQLITE_PRINT_BUF_SIZE];
return base_vprintf(sqlite3_realloc, 0, zBase, sizeof(zBase), zFormat, ap);
}
@@ -9128,7 +9128,7 @@ STQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
** Print into memory obtained from sqlite3_malloc()(). Omit the internal
** %-conversion extensions.
*/
-STQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
+SQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
va_list ap;
char *z;
va_start(ap, zFormat);
@@ -9139,11 +9139,11 @@ STQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
/*
** sqlite3_snprintf() works like snprintf() except that it ignores the
-** current locale settings. This is important for STQLite because we
+** current locale settings. This is important for SQLite because we
** are not able to use a "," as the decimal point in place of "." as
** specified by some locales.
*/
-STQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
+SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
char *z;
va_list ap;
@@ -9157,13 +9157,13 @@ STQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
return z;
}
-#if defined(STQLITE_TEST) || defined(STQLITE_DEBUG) || defined(STQLITE_MEMDEBUG)
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) || defined(SQLITE_MEMDEBUG)
/*
** A version of printf() that understands %lld. Used for debugging.
** The printf() built into some versions of windows does not understand %lld
** and segfaults if you give it a long long int.
*/
-STQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
+SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
extern int getpid(void);
va_list ap;
char zBuf[500];
@@ -9189,7 +9189,7 @@ STQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
**
*************************************************************************
** This file contains code to implement a pseudo-random number
-** generator (PRNG) for STQLite.
+** generator (PRNG) for SQLite.
**
** Random numbers are used by some of the database backends in order
** to generate random integer keys for tables or random filenames.
@@ -9208,7 +9208,7 @@ STQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
** well be good enough. But maybe not. Or maybe lrand48() has some
** subtle problems on some systems that could cause problems. It is hard
** to know. To minimize the risk of problems due to bad lrand48()
-** implementations, STQLite uses this random number generator based
+** implementations, SQLite uses this random number generator based
** on RC4, which we know works very well.
**
** (Later): Actually, OP_NewRowid does not depend on a good source of
@@ -9231,7 +9231,7 @@ static int randomByte(void){
** not need to contain a lot of randomness since we are not
** trying to do secure encryption or anything like that...
**
- ** Nothing in this file or anywhere else in STQLite does any kind of
+ ** Nothing in this file or anywhere else in SQLite does any kind of
** encryption. The RC4 algorithm is being used as a PRNG (pseudo-random
** number generator) not as an encryption device.
*/
@@ -9267,7 +9267,7 @@ static int randomByte(void){
/*
** Return N random bytes.
*/
-STQLITE_PRIVATE void sqlite3Randomness(int N, void *pBuf){
+SQLITE_PRIVATE void sqlite3Randomness(int N, void *pBuf){
unsigned char *zBuf = pBuf;
sqlite3OsEnterMutex();
while( N-- ){
@@ -9440,8 +9440,8 @@ typedef struct Cursor Cursor;
**
** Each value has a manifest type. The manifest type of the value stored
** in a Mem struct is returned by the MemType(Mem*) macro. The type is
-** one of STQLITE_NULL, STQLITE_INTEGER, STQLITE_REAL, STQLITE_TEXT or
-** STQLITE_BLOB.
+** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or
+** SQLITE_BLOB.
*/
struct Mem {
union {
@@ -9452,8 +9452,8 @@ struct Mem {
char *z; /* String or BLOB value */
int n; /* Number of characters in string value, including '\0' */
u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
- u8 type; /* One of STQLITE_NULL, STQLITE_TEXT, STQLITE_INTEGER, etc */
- u8 enc; /* STQLITE_UTF8, STQLITE_UTF16BE, STQLITE_UTF16LE */
+ u8 type; /* One of SQLITE_NULL, SQLITE_TEXT, SQLITE_INTEGER, etc */
+ u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */
void (*xDel)(void *); /* If not null, call this function to delete Mem.z */
char zShort[NBFS]; /* Space for short strings */
};
@@ -9493,7 +9493,7 @@ typedef struct Mem Mem;
#define MEM_Agg 0x0400 /* Mem.z points to an agg function context */
#define MEM_Zero 0x0800 /* Mem.i contains count of 0s appended to blob */
-#ifdef STQLITE_OMIT_INCRBLOB
+#ifdef SQLITE_OMIT_INCRBLOB
#undef MEM_Zero
#define MEM_Zero 0x0000
#endif
@@ -9524,7 +9524,7 @@ typedef struct VdbeFunc VdbeFunc;
** implement the SQL functions.
**
** There is a typedef for this structure in sqlite.h. So all routines,
-** even the public interface to STQLite, can use a pointer to this structure.
+** even the public interface to SQLite, can use a pointer to this structure.
** But this file is the only place where the internal details of this
** structure are known.
**
@@ -9606,7 +9606,7 @@ struct Context {
** set to 2 for xDestroy method calls and 1 for all other methods. This
** variable is used for two purposes: to allow xDestroy methods to execute
** "DROP TABLE" statements and to prevent some nasty side effects of
-** malloc failure when STQLite is invoked recursively by a virtual table
+** malloc failure when SQLite is invoked recursively by a virtual table
** method function.
*/
struct Vdbe {
@@ -9659,11 +9659,11 @@ struct Vdbe {
i64 startTime; /* Time when query started - used for profiling */
int nSql; /* Number of bytes in zSql */
char *zSql; /* Text of the SQL statement that generated this */
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
FILE *trace; /* Write an execution trace here, if not NULL */
#endif
int openedStatement; /* True if this VM has opened a statement journal */
-#ifdef STQLITE_SSE
+#ifdef SQLITE_SSE
int fetchId; /* Statement number used by sqlite3_fetch_statement */
int lru; /* Counter used for LRU cache replacement */
#endif
@@ -9680,69 +9680,69 @@ struct Vdbe {
/*
** Function prototypes
*/
-STQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, Cursor*);
+SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, Cursor*);
void sqliteVdbePopStack(Vdbe*,int);
-STQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor*);
-#if defined(STQLITE_DEBUG) || defined(VDBE_PROFILE)
-STQLITE_PRIVATE void sqlite3VdbePrintOp(FILE*, int, Op*);
+SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor*);
+#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
+SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE*, int, Op*);
#endif
-STQLITE_PRIVATE int sqlite3VdbeSerialTypeLen(u32);
-STQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int);
-STQLITE_PRIVATE int sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int);
-STQLITE_PRIVATE int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
-STQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
+SQLITE_PRIVATE int sqlite3VdbeSerialTypeLen(u32);
+SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int);
+SQLITE_PRIVATE int sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int);
+SQLITE_PRIVATE int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
+SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
-STQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(Cursor*, int , const unsigned char*, int*);
-STQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
-STQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
-STQLITE_PRIVATE int sqlite3VdbeRecordCompare(void*,int,const void*,int, const void*);
-STQLITE_PRIVATE int sqlite3VdbeIdxRowidLen(const u8*);
-STQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
-STQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
-STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
-STQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int);
-STQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem*, const Mem*);
-STQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int);
-STQLITE_PRIVATE int sqlite3VdbeMemMove(Mem*, Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*));
-STQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64);
-STQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double);
-STQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*);
-STQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int);
-STQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemDynamicify(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem*, int);
-STQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem*);
-STQLITE_PRIVATE double sqlite3VdbeRealValue(Mem*);
-STQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
-STQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p);
-STQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
+SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(Cursor*, int , const unsigned char*, int*);
+SQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
+SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
+SQLITE_PRIVATE int sqlite3VdbeRecordCompare(void*,int,const void*,int, const void*);
+SQLITE_PRIVATE int sqlite3VdbeIdxRowidLen(const u8*);
+SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int);
+SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem*, const Mem*);
+SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int);
+SQLITE_PRIVATE int sqlite3VdbeMemMove(Mem*, Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*));
+SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64);
+SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double);
+SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*);
+SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int);
+SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemDynamicify(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem*, int);
+SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem*);
+SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem*);
+SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
+SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p);
+SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
#ifndef NDEBUG
-STQLITE_PRIVATE void sqlite3VdbeMemSanity(Mem*);
-STQLITE_PRIVATE int sqlite3VdbeOpcodeNoPush(u8);
-#endif
-STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem*, u8);
-#ifdef STQLITE_DEBUG
-STQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe*);
-STQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
-#endif
-STQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem);
-STQLITE_PRIVATE void sqlite3VdbeFifoInit(Fifo*);
-STQLITE_PRIVATE int sqlite3VdbeFifoPush(Fifo*, i64);
-STQLITE_PRIVATE int sqlite3VdbeFifoPop(Fifo*, i64*);
-STQLITE_PRIVATE void sqlite3VdbeFifoClear(Fifo*);
-
-#ifndef STQLITE_OMIT_INCRBLOB
-STQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *);
+SQLITE_PRIVATE void sqlite3VdbeMemSanity(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeOpcodeNoPush(u8);
+#endif
+SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem*, u8);
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
+#endif
+SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem);
+SQLITE_PRIVATE void sqlite3VdbeFifoInit(Fifo*);
+SQLITE_PRIVATE int sqlite3VdbeFifoPush(Fifo*, i64);
+SQLITE_PRIVATE int sqlite3VdbeFifoPop(Fifo*, i64*);
+SQLITE_PRIVATE void sqlite3VdbeFifoClear(Fifo*);
+
+#ifndef SQLITE_OMIT_INCRBLOB
+SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *);
#else
- #define sqlite3VdbeMemExpandBlob(x) STQLITE_OK
+ #define sqlite3VdbeMemExpandBlob(x) SQLITE_OK
#endif
#endif /* !defined(_VDBEINT_H_) */
@@ -9751,8 +9751,8 @@ STQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *);
/************** Continuing where we left off in utf.c ************************/
/*
-** The following constant value is used by the STQLITE_BIGENDIAN and
-** STQLITE_LITTLEENDIAN macros.
+** The following constant value is used by the SQLITE_BIGENDIAN and
+** SQLITE_LITTLEENDIAN macros.
*/
const int sqlite3one = 1;
@@ -9843,13 +9843,13 @@ const unsigned char sqlite3UtfTrans1[] = {
*/
/* #define TRANSLATE_TRACE 1 */
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** This routine transforms the internal text encoding used by pMem to
** desiredEnc. It is an error if the string is already of the desired
** encoding, or if *pMem does not contain a string value.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
+SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
unsigned char zShort[NBFS]; /* Temporary short output buffer */
int len; /* Maximum length of output string in bytes */
unsigned char *zOut; /* Output buffer */
@@ -9863,7 +9863,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
assert( pMem->enc!=0 );
assert( pMem->n>=0 );
-#if defined(TRANSLATE_TRACE) && defined(STQLITE_DEBUG)
+#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
{
char zBuf[100];
sqlite3VdbeMemPrettyPrint(pMem, zBuf);
@@ -9875,13 +9875,13 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
** all that is required is to swap the byte order. This case is handled
** differently from the others.
*/
- if( pMem->enc!=STQLITE_UTF8 && desiredEnc!=STQLITE_UTF8 ){
+ if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
u8 temp;
int rc;
rc = sqlite3VdbeMemMakeWriteable(pMem);
- if( rc!=STQLITE_OK ){
- assert( rc==STQLITE_NOMEM );
- return STQLITE_NOMEM;
+ if( rc!=SQLITE_OK ){
+ assert( rc==SQLITE_NOMEM );
+ return SQLITE_NOMEM;
}
zIn = (u8*)pMem->z;
zTerm = &zIn[pMem->n];
@@ -9896,7 +9896,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
}
/* Set len to the maximum number of bytes required in the output buffer. */
- if( desiredEnc==STQLITE_UTF8 ){
+ if( desiredEnc==SQLITE_UTF8 ){
/* When converting from UTF-16, the maximum growth results from
** translating a 2-byte character to a 4-byte UTF-8 character.
** A single byte is required for the output string
@@ -9923,19 +9923,19 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
zTerm = &zIn[pMem->n];
if( len>NBFS ){
zOut = sqliteMallocRaw(len);
- if( !zOut ) return STQLITE_NOMEM;
+ if( !zOut ) return SQLITE_NOMEM;
}else{
zOut = zShort;
}
z = zOut;
- if( pMem->enc==STQLITE_UTF8 ){
+ if( pMem->enc==SQLITE_UTF8 ){
unsigned int iExtra = 0xD800;
if( 0==(pMem->flags&MEM_Term) && zTerm>zIn && (zTerm[-1]&0x80) ){
/* This UTF8 string is not nul-terminated, and the last byte is
** not a character in the ascii range (codpoints 0..127). This
- ** means the STQLITE_READ_UTF8() macro might read past the end
+ ** means the SQLITE_READ_UTF8() macro might read past the end
** of the allocated buffer.
**
** There are four possibilities:
@@ -9952,7 +9952,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
**
** 4. The entire string consists of continuation characters.
**
- ** Cases (3) and (4) require no special handling. The STQLITE_READ_UTF8()
+ ** Cases (3) and (4) require no special handling. The SQLITE_READ_UTF8()
** macro will not overread the buffer in these cases.
*/
unsigned char *zExtra = &zTerm[-1];
@@ -9962,7 +9962,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
if( (zExtra[0]&0xC0)==0xC0 ){
/* Make a copy of the last character encoding in the input string.
- ** Then make sure it is nul-terminated and use STQLITE_READ_UTF8()
+ ** Then make sure it is nul-terminated and use SQLITE_READ_UTF8()
** to decode the codepoint. Store the codepoint in variable iExtra,
** it will be appended to the output string later.
*/
@@ -9973,7 +9973,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
if( nExtra>15 ){
zExtra = sqliteMallocRaw(nExtra+1);
if( !zExtra ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
zFree = zExtra;
}else{
@@ -9981,25 +9981,25 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
}
memcpy(zExtra, zTerm, nExtra);
zExtra[nExtra] = '\0';
- STQLITE_READ_UTF8(zExtra, iExtra);
+ SQLITE_READ_UTF8(zExtra, iExtra);
sqliteFree(zFree);
}
}
- if( desiredEnc==STQLITE_UTF16LE ){
+ if( desiredEnc==SQLITE_UTF16LE ){
/* UTF-8 -> UTF-16 Little-endian */
while( zIn<zTerm ){
- STQLITE_READ_UTF8(zIn, c);
+ SQLITE_READ_UTF8(zIn, c);
WRITE_UTF16LE(z, c);
}
if( iExtra!=0xD800 ){
WRITE_UTF16LE(z, iExtra);
}
}else{
- assert( desiredEnc==STQLITE_UTF16BE );
+ assert( desiredEnc==SQLITE_UTF16BE );
/* UTF-8 -> UTF-16 Big-endian */
while( zIn<zTerm ){
- STQLITE_READ_UTF8(zIn, c);
+ SQLITE_READ_UTF8(zIn, c);
WRITE_UTF16BE(z, c);
}
if( iExtra!=0xD800 ){
@@ -10009,8 +10009,8 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
pMem->n = z - zOut;
*z++ = 0;
}else{
- assert( desiredEnc==STQLITE_UTF8 );
- if( pMem->enc==STQLITE_UTF16LE ){
+ assert( desiredEnc==SQLITE_UTF8 );
+ if( pMem->enc==SQLITE_UTF16LE ){
/* UTF-16 Little-endian -> UTF-8 */
while( zIn<zTerm ){
READ_UTF16LE(zIn, c);
@@ -10026,7 +10026,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
pMem->n = z - zOut;
}
*z = 0;
- assert( (pMem->n+(desiredEnc==STQLITE_UTF8?1:2))<=len );
+ assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );
sqlite3VdbeMemRelease(pMem);
pMem->flags &= ~(MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short);
@@ -10041,14 +10041,14 @@ STQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
pMem->z = (char*)zOut;
translate_out:
-#if defined(TRANSLATE_TRACE) && defined(STQLITE_DEBUG)
+#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
{
char zBuf[100];
sqlite3VdbeMemPrettyPrint(pMem, zBuf);
fprintf(stderr, "OUTPUT: %s\n", zBuf);
}
#endif
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -10060,18 +10060,18 @@ translate_out:
** The allocation (static, dynamic etc.) and encoding of the Mem may be
** changed by this function.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
+ int rc = SQLITE_OK;
u8 bom = 0;
if( pMem->n<0 || pMem->n>1 ){
u8 b1 = *(u8 *)pMem->z;
u8 b2 = *(((u8 *)pMem->z) + 1);
if( b1==0xFE && b2==0xFF ){
- bom = STQLITE_UTF16BE;
+ bom = SQLITE_UTF16BE;
}
if( b1==0xFF && b2==0xFE ){
- bom = STQLITE_UTF16LE;
+ bom = SQLITE_UTF16LE;
}
}
@@ -10088,16 +10088,16 @@ STQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
char *z = pMem->z;
pMem->z = 0;
pMem->xDel = 0;
- rc = sqlite3VdbeMemSetStr(pMem, &z[2], pMem->n-2, bom, STQLITE_TRANSIENT);
+ rc = sqlite3VdbeMemSetStr(pMem, &z[2], pMem->n-2, bom, SQLITE_TRANSIENT);
xDel(z);
}else{
rc = sqlite3VdbeMemSetStr(pMem, &pMem->z[2], pMem->n-2, bom,
- STQLITE_TRANSIENT);
+ SQLITE_TRANSIENT);
}
}
return rc;
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
/*
** pZ is a UTF-8 encoded tqunicode string. If nByte is less than zero,
@@ -10106,7 +10106,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
** number of tqunicode characters in the first nByte of pZ (or up to
** the first 0x00, whichever comes first).
*/
-STQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
+SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
int r = 0;
const u8 *z = (const u8*)zIn;
const u8 *zTerm;
@@ -10117,13 +10117,13 @@ STQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
}
assert( z<=zTerm );
while( *z!=0 && z<zTerm ){
- STQLITE_SKIP_UTF8(z);
+ SQLITE_SKIP_UTF8(z);
r++;
}
return r;
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** Convert a UTF-16 string in the native encoding into a UTF-8 string.
** Memory to hold the UTF-8 string is obtained from malloc and must be
@@ -10131,11 +10131,11 @@ STQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
**
** NULL is returned if there is an allocation error.
*/
-STQLITE_PRIVATE char *sqlite3Utf16to8(const void *z, int nByte){
+SQLITE_PRIVATE char *sqlite3Utf16to8(const void *z, int nByte){
Mem m;
memset(&m, 0, sizeof(m));
- sqlite3VdbeMemSetStr(&m, z, nByte, STQLITE_UTF16NATIVE, STQLITE_STATIC);
- sqlite3VdbeChangeEncoding(&m, STQLITE_UTF8);
+ sqlite3VdbeMemSetStr(&m, z, nByte, SQLITE_UTF16NATIVE, SQLITE_STATIC);
+ sqlite3VdbeChangeEncoding(&m, SQLITE_UTF8);
assert( (m.flags & MEM_Term)!=0 || sqlite3MallocFailed() );
assert( (m.flags & MEM_Str)!=0 || sqlite3MallocFailed() );
return (m.flags & MEM_Dyn)!=0 ? m.z : sqliteStrDup(m.z);
@@ -10148,16 +10148,16 @@ STQLITE_PRIVATE char *sqlite3Utf16to8(const void *z, int nByte){
** then return the number of bytes in the first nChar tqunicode characters
** in pZ (or up until the first pair of 0x00 bytes, whichever comes first).
*/
-STQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
+SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
unsigned int c = 1;
char const *z = zIn;
int n = 0;
- if( STQLITE_UTF16NATIVE==STQLITE_UTF16BE ){
- /* Using an "if (STQLITE_UTF16NATIVE==STQLITE_UTF16BE)" construct here
+ if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
+ /* Using an "if (SQLITE_UTF16NATIVE==SQLITE_UTF16BE)" construct here
** and in other parts of this file means that at one branch will
** not be covered by coverage testing on any single host. But coverage
** will be complete if the tests are run on both a little-endian and
- ** big-endian host. Because both the UTF16NATIVE and STQLITE_UTF16BE
+ ** big-endian host. Because both the UTF16NATIVE and SQLITE_UTF16BE
** macros are constant at compile time the compiler can determine
** which branch will be followed. It is therefore assumed that no runtime
** penalty is paid for this "if" statement.
@@ -10175,7 +10175,7 @@ STQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
return (z-(char const *)zIn)-((c==0)?2:0);
}
-#if defined(STQLITE_TEST)
+#if defined(SQLITE_TEST)
/*
** Translate UTF-8 to UTF-8.
**
@@ -10185,13 +10185,13 @@ STQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
** The translation is done in-place (since it is impossible for the
** correct UTF-8 encoding to be longer than a malformed encoding).
*/
-STQLITE_PRIVATE int sqlite3Utf8To8(unsigned char *zIn){
+SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char *zIn){
unsigned char *zOut = zIn;
unsigned char *zStart = zIn;
int c;
while(1){
- STQLITE_READ_UTF8(zIn, c);
+ SQLITE_READ_UTF8(zIn, c);
if( c==0 ) break;
if( c!=0xfffd ){
WRITE_UTF8(zOut, c);
@@ -10202,13 +10202,13 @@ STQLITE_PRIVATE int sqlite3Utf8To8(unsigned char *zIn){
}
#endif
-#if defined(STQLITE_TEST)
+#if defined(SQLITE_TEST)
/*
** This routine is called from the TCL test function "translate_selftest".
** It checks that the primitives for serializing and deserializing
** characters in each encoding are inverses of each other.
*/
-STQLITE_PRIVATE void sqlite3UtfSelfTest(){
+SQLITE_PRIVATE void sqlite3UtfSelfTest(){
unsigned int i, t;
unsigned char zBuf[20];
unsigned char *z;
@@ -10221,7 +10221,7 @@ STQLITE_PRIVATE void sqlite3UtfSelfTest(){
n = z-zBuf;
z[0] = 0;
z = zBuf;
- STQLITE_READ_UTF8(z, c);
+ SQLITE_READ_UTF8(z, c);
t = i;
if( i>=0xD800 && i<=0xDFFF ) t = 0xFFFD;
if( (i&0xFFFFFFFE)==0xFFFE ) t = 0xFFFD;
@@ -10251,8 +10251,8 @@ STQLITE_PRIVATE void sqlite3UtfSelfTest(){
assert( (z-zBuf)==n );
}
}
-#endif /* STQLITE_TEST */
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_TEST */
+#endif /* SQLITE_OMIT_UTF16 */
/************** End of utf.c *************************************************/
/************** Begin file util.c ********************************************/
@@ -10294,10 +10294,10 @@ STQLITE_PRIVATE void sqlite3UtfSelfTest(){
** encoded in UTF-8.
**
** To clear the most recent error for sqlite handle "db", sqlite3Error
-** should be called with err_code set to STQLITE_OK and zFormat set
+** should be called with err_code set to SQLITE_OK and zFormat set
** to NULL.
*/
-STQLITE_PRIVATE void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
+SQLITE_PRIVATE void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
if( db && (db->pErr || (db->pErr = sqlite3ValueNew())!=0) ){
db->errCode = err_code;
if( zFormat ){
@@ -10306,9 +10306,9 @@ STQLITE_PRIVATE void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat
va_start(ap, zFormat);
z = sqlite3VMPrintf(zFormat, ap);
va_end(ap);
- sqlite3ValueSetStr(db->pErr, -1, z, STQLITE_UTF8, sqlite3FreeX);
+ sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, sqlite3FreeX);
}else{
- sqlite3ValueSetStr(db->pErr, 0, 0, STQLITE_UTF8, STQLITE_STATIC);
+ sqlite3ValueSetStr(db->pErr, 0, 0, SQLITE_UTF8, SQLITE_STATIC);
}
}
}
@@ -10330,22 +10330,22 @@ STQLITE_PRIVATE void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat
** Function sqlite3Error() should be used during statement execution
** (sqlite3_step() etc.).
*/
-STQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
+SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
va_list ap;
pParse->nErr++;
sqliteFree(pParse->zErrMsg);
va_start(ap, zFormat);
pParse->zErrMsg = sqlite3VMPrintf(zFormat, ap);
va_end(ap);
- if( pParse->rc==STQLITE_OK ){
- pParse->rc = STQLITE_ERROR;
+ if( pParse->rc==SQLITE_OK ){
+ pParse->rc = SQLITE_ERROR;
}
}
/*
** Clear the error message in pParse, if any
*/
-STQLITE_PRIVATE void sqlite3ErrorClear(Parse *pParse){
+SQLITE_PRIVATE void sqlite3ErrorClear(Parse *pParse){
sqliteFree(pParse->zErrMsg);
pParse->zErrMsg = 0;
pParse->nErr = 0;
@@ -10361,7 +10361,7 @@ STQLITE_PRIVATE void sqlite3ErrorClear(Parse *pParse){
** brackets from around identifers. For example: "[a-b-c]" becomes
** "a-b-c".
*/
-STQLITE_PRIVATE void sqlite3Dequote(char *z){
+SQLITE_PRIVATE void sqlite3Dequote(char *z){
int quote;
int i, j;
if( z==0 ) return;
@@ -10392,7 +10392,7 @@ STQLITE_PRIVATE void sqlite3Dequote(char *z){
** lower-case character.
*/
const unsigned char sqlite3UpperToLower[] = {
-#ifdef STQLITE_ASCII
+#ifdef SQLITE_ASCII
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
@@ -10409,7 +10409,7 @@ const unsigned char sqlite3UpperToLower[] = {
234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,
252,253,254,255
#endif
-#ifdef STQLITE_EBCDIC
+#ifdef SQLITE_EBCDIC
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 0x */
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* 1x */
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 2x */
@@ -10434,14 +10434,14 @@ const unsigned char sqlite3UpperToLower[] = {
** Some systems have stricmp(). Others have strcasecmp(). Because
** there is no consistency, we will define our own.
*/
-STQLITE_PRIVATE int sqlite3StrICmp(const char *zLeft, const char *zRight){
+SQLITE_PRIVATE int sqlite3StrICmp(const char *zLeft, const char *zRight){
register unsigned char *a, *b;
a = (unsigned char *)zLeft;
b = (unsigned char *)zRight;
while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
return UpperToLower[*a] - UpperToLower[*b];
}
-STQLITE_PRIVATE int sqlite3StrNICmp(const char *zLeft, const char *zRight, int N){
+SQLITE_PRIVATE int sqlite3StrNICmp(const char *zLeft, const char *zRight, int N){
register unsigned char *a, *b;
a = (unsigned char *)zLeft;
b = (unsigned char *)zRight;
@@ -10457,9 +10457,9 @@ STQLITE_PRIVATE int sqlite3StrNICmp(const char *zLeft, const char *zRight, int N
**
** An empty string is considered non-numeric.
*/
-STQLITE_PRIVATE int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
- int incr = (enc==STQLITE_UTF8?1:2);
- if( enc==STQLITE_UTF16BE ) z++;
+SQLITE_PRIVATE int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
+ int incr = (enc==SQLITE_UTF8?1:2);
+ if( enc==SQLITE_UTF16BE ) z++;
if( *z=='-' || *z=='+' ) z += incr;
if( !isdigit(*(u8*)z) ){
return 0;
@@ -10495,8 +10495,8 @@ STQLITE_PRIVATE int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
** of "." depending on how locale is set. But that would cause problems
** for SQL. So this routine always uses "." regardless of locale.
*/
-STQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult){
-#ifndef STQLITE_OMIT_FLOATING_POINT
+SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult){
+#ifndef SQLITE_OMIT_FLOATING_POINT
int sign = 1;
const char *zBegin = z;
LONGDOUBLE_TYPE v1 = 0.0;
@@ -10550,7 +10550,7 @@ STQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult){
return z - zBegin;
#else
return sqlite3Atoi64(z, pResult);
-#endif /* STQLITE_OMIT_FLOATING_POINT */
+#endif /* SQLITE_OMIT_FLOATING_POINT */
}
/*
@@ -10586,7 +10586,7 @@ static int compare2pow63(const char *zNum){
** 32-bit numbers. At that time, it was much faster than the
** atoi() library routine in RedHat 7.2.
*/
-STQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum){
+SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum){
i64 v = 0;
int neg;
int i, c;
@@ -10631,7 +10631,7 @@ STQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum){
** 9223373036854775808 will not fit in 64 bits. So it seems safer to return
** false.
*/
-STQLITE_PRIVATE int sqlite3FitsIn64Bits(const char *zNum){
+SQLITE_PRIVATE int sqlite3FitsIn64Bits(const char *zNum){
int i, c;
int neg = 0;
if( *zNum=='-' ){
@@ -10664,7 +10664,7 @@ STQLITE_PRIVATE int sqlite3FitsIn64Bits(const char *zNum){
** This is different from sqlite3Atoi64() which requires the
** input number to be zero-terminated.
*/
-STQLITE_PRIVATE int sqlite3GetInt32(const char *zNum, int *pValue){
+SQLITE_PRIVATE int sqlite3GetInt32(const char *zNum, int *pValue){
sqlite_int64 v = 0;
int i, c;
int neg = 0;
@@ -10698,15 +10698,15 @@ STQLITE_PRIVATE int sqlite3GetInt32(const char *zNum, int *pValue){
** NULL or which have been previously closed. If this routine returns
** TRUE it means that the db pointer is invalid and should not be
** dereferenced for any reason. The calling function should invoke
-** STQLITE_MISUSE immediately.
+** SQLITE_MISUSE immediately.
*/
-STQLITE_PRIVATE int sqlite3SafetyCheck(sqlite3 *db){
+SQLITE_PRIVATE int sqlite3SafetyCheck(sqlite3 *db){
int magic;
if( db==0 ) return 1;
magic = db->magic;
- if( magic!=STQLITE_MAGIC_CLOSED &&
- magic!=STQLITE_MAGIC_OPEN &&
- magic!=STQLITE_MAGIC_BUSY ) return 1;
+ if( magic!=SQLITE_MAGIC_CLOSED &&
+ magic!=SQLITE_MAGIC_OPEN &&
+ magic!=SQLITE_MAGIC_BUSY ) return 1;
return 0;
}
@@ -10739,7 +10739,7 @@ STQLITE_PRIVATE int sqlite3SafetyCheck(sqlite3 *db){
** bit clear. Except, if we get to the 9th byte, it stores the full
** 8 bits and is the last byte.
*/
-STQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
+SQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
int i, j, n;
u8 buf[10];
if( v & (((u64)0xff000000)<<32) ){
@@ -10768,7 +10768,7 @@ STQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
** Read a 64-bit variable-length integer from memory starting at p[0].
** Return the number of bytes read. The value is stored in *v.
*/
-STQLITE_PRIVATE int sqlite3GetVarint(const unsigned char *p, u64 *v){
+SQLITE_PRIVATE int sqlite3GetVarint(const unsigned char *p, u64 *v){
u32 x;
u64 x64;
int n;
@@ -10810,7 +10810,7 @@ STQLITE_PRIVATE int sqlite3GetVarint(const unsigned char *p, u64 *v){
** Read a 32-bit variable-length integer from memory starting at p[0].
** Return the number of bytes read. The value is stored in *v.
*/
-STQLITE_PRIVATE int sqlite3GetVarint32(const unsigned char *p, u32 *v){
+SQLITE_PRIVATE int sqlite3GetVarint32(const unsigned char *p, u32 *v){
u32 x;
int n;
unsigned char c;
@@ -10836,7 +10836,7 @@ STQLITE_PRIVATE int sqlite3GetVarint32(const unsigned char *p, u32 *v){
** Return the number of bytes that will be needed to store the given
** 64-bit integer.
*/
-STQLITE_PRIVATE int sqlite3VarintLen(u64 v){
+SQLITE_PRIVATE int sqlite3VarintLen(u64 v){
int i = 0;
do{
i++;
@@ -10849,10 +10849,10 @@ STQLITE_PRIVATE int sqlite3VarintLen(u64 v){
/*
** Read or write a four-byte big-endian integer value.
*/
-STQLITE_PRIVATE u32 sqlite3Get4byte(const u8 *p){
+SQLITE_PRIVATE u32 sqlite3Get4byte(const u8 *p){
return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
}
-STQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
+SQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
p[0] = v>>24;
p[1] = v>>16;
p[2] = v>>8;
@@ -10861,8 +10861,8 @@ STQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
-#if !defined(STQLITE_OMIT_BLOB_LITERAL) || defined(STQLITE_HAS_CODEC) \
- || defined(STQLITE_TEST)
+#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) \
+ || defined(SQLITE_TEST)
/*
** Translate a single byte of Hex into an integer.
*/
@@ -10876,16 +10876,16 @@ static int hexToInt(int h){
return h - 'A' + 10;
}
}
-#endif /* !STQLITE_OMIT_BLOB_LITERAL || STQLITE_HAS_CODEC || STQLITE_TEST */
+#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC || SQLITE_TEST */
-#if !defined(STQLITE_OMIT_BLOB_LITERAL) || defined(STQLITE_HAS_CODEC)
+#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC)
/*
** Convert a BLOB literal of the form "x'hhhhhh'" into its binary
** value. Return a pointer to its binary value. Space to hold the
** binary value has been obtained from malloc and must be freed by
** the calling routine.
*/
-STQLITE_PRIVATE void *sqlite3HexToBlob(const char *z){
+SQLITE_PRIVATE void *sqlite3HexToBlob(const char *z){
char *zBlob;
int i;
int n = strlen(z);
@@ -10899,19 +10899,19 @@ STQLITE_PRIVATE void *sqlite3HexToBlob(const char *z){
}
return zBlob;
}
-#endif /* !STQLITE_OMIT_BLOB_LITERAL || STQLITE_HAS_CODEC */
+#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC */
/*
-** Change the sqlite.magic from STQLITE_MAGIC_OPEN to STQLITE_MAGIC_BUSY.
-** Return an error (non-zero) if the magic was not STQLITE_MAGIC_OPEN
+** Change the sqlite.magic from SQLITE_MAGIC_OPEN to SQLITE_MAGIC_BUSY.
+** Return an error (non-zero) if the magic was not SQLITE_MAGIC_OPEN
** when this routine is called.
**
-** This routine is called when entering an STQLite API. The STQLITE_MAGIC_OPEN
+** This routine is called when entering an SQLite API. The SQLITE_MAGIC_OPEN
** value indicates that the database connection passed into the API is
** open and is not being used by another thread. By changing the value
-** to STQLITE_MAGIC_BUSY we indicate that the connection is in use.
-** sqlite3SafetyOff() below will change the value back to STQLITE_MAGIC_OPEN
+** to SQLITE_MAGIC_BUSY we indicate that the connection is in use.
+** sqlite3SafetyOff() below will change the value back to SQLITE_MAGIC_OPEN
** when the API exits.
**
** This routine is a attempt to detect if two threads use the
@@ -10919,7 +10919,7 @@ STQLITE_PRIVATE void *sqlite3HexToBlob(const char *z){
** condition so it is possible that the error is not detected.
** But usually the problem will be seen. The result will be an
** error which can be used to debug the application that is
-** using STQLite incorrectly.
+** using SQLite incorrectly.
**
** Ticket #202: If db->magic is not a valid open value, take care not
** to modify the db structure at all. It could be that db is a stale
@@ -10927,28 +10927,28 @@ STQLITE_PRIVATE void *sqlite3HexToBlob(const char *z){
** call to sqlite3_close(db) and db has been deallocated. And we do
** not want to write into deallocated memory.
*/
-STQLITE_PRIVATE int sqlite3SafetyOn(sqlite3 *db){
- if( db->magic==STQLITE_MAGIC_OPEN ){
- db->magic = STQLITE_MAGIC_BUSY;
+SQLITE_PRIVATE int sqlite3SafetyOn(sqlite3 *db){
+ if( db->magic==SQLITE_MAGIC_OPEN ){
+ db->magic = SQLITE_MAGIC_BUSY;
return 0;
- }else if( db->magic==STQLITE_MAGIC_BUSY ){
- db->magic = STQLITE_MAGIC_ERROR;
+ }else if( db->magic==SQLITE_MAGIC_BUSY ){
+ db->magic = SQLITE_MAGIC_ERROR;
db->u1.isInterrupted = 1;
}
return 1;
}
/*
-** Change the magic from STQLITE_MAGIC_BUSY to STQLITE_MAGIC_OPEN.
-** Return an error (non-zero) if the magic was not STQLITE_MAGIC_BUSY
+** Change the magic from SQLITE_MAGIC_BUSY to SQLITE_MAGIC_OPEN.
+** Return an error (non-zero) if the magic was not SQLITE_MAGIC_BUSY
** when this routine is called.
*/
-STQLITE_PRIVATE int sqlite3SafetyOff(sqlite3 *db){
- if( db->magic==STQLITE_MAGIC_BUSY ){
- db->magic = STQLITE_MAGIC_OPEN;
+SQLITE_PRIVATE int sqlite3SafetyOff(sqlite3 *db){
+ if( db->magic==SQLITE_MAGIC_BUSY ){
+ db->magic = SQLITE_MAGIC_OPEN;
return 0;
}else {
- db->magic = STQLITE_MAGIC_ERROR;
+ db->magic = SQLITE_MAGIC_ERROR;
db->u1.isInterrupted = 1;
return 1;
}
@@ -10957,7 +10957,7 @@ STQLITE_PRIVATE int sqlite3SafetyOff(sqlite3 *db){
/*
** Return a pointer to the ThreadData associated with the calling thread.
*/
-STQLITE_PRIVATE ThreadData *sqlite3ThreadData(){
+SQLITE_PRIVATE ThreadData *sqlite3ThreadData(){
ThreadData *p = (ThreadData*)sqlite3OsThreadSpecificData(1);
if( !p ){
sqlite3FailedMalloc();
@@ -10970,7 +10970,7 @@ STQLITE_PRIVATE ThreadData *sqlite3ThreadData(){
** If no ThreadData has been allocated to this thread yet, return a pointer
** to a substitute ThreadData structure that is all zeros.
*/
-STQLITE_PRIVATE const ThreadData *sqlite3ThreadDataReadOnly(){
+SQLITE_PRIVATE const ThreadData *sqlite3ThreadDataReadOnly(){
static const ThreadData zeroData = {0}; /* Initializer to silence warnings
** from broken compilers */
const ThreadData *pTd = sqlite3OsThreadSpecificData(0);
@@ -10981,7 +10981,7 @@ STQLITE_PRIVATE const ThreadData *sqlite3ThreadDataReadOnly(){
** Check to see if the ThreadData for this thread is all zero. If it
** is, then deallocate it.
*/
-STQLITE_PRIVATE void sqlite3ReleaseThreadData(){
+SQLITE_PRIVATE void sqlite3ReleaseThreadData(){
sqlite3OsThreadSpecificData(-1);
}
@@ -10999,7 +10999,7 @@ STQLITE_PRIVATE void sqlite3ReleaseThreadData(){
**
*************************************************************************
** This is the implementation of generic hash-tables
-** used in STQLite.
+** used in SQLite.
**
** $Id: hash.c,v 1.19 2007/03/31 03:59:24 drh Exp $
*/
@@ -11008,20 +11008,20 @@ STQLITE_PRIVATE void sqlite3ReleaseThreadData(){
** fields of the Hash structure.
**
** "pNew" is a pointer to the hash table that is to be initialized.
-** keyClass is one of the constants STQLITE_HASH_INT, STQLITE_HASH_POINTER,
-** STQLITE_HASH_BINARY, or STQLITE_HASH_STRING. The value of keyClass
+** keyClass is one of the constants SQLITE_HASH_INT, SQLITE_HASH_POINTER,
+** SQLITE_HASH_BINARY, or SQLITE_HASH_STRING. The value of keyClass
** determines what kind of key the hash table will use. "copyKey" is
** true if the hash table should make its own private copy of keys and
** false if it should just use the supplied pointer. CopyKey only makes
-** sense for STQLITE_HASH_STRING and STQLITE_HASH_BINARY and is ignored
+** sense for SQLITE_HASH_STRING and SQLITE_HASH_BINARY and is ignored
** for other key classes.
*/
-STQLITE_PRIVATE void sqlite3HashInit(Hash *pNew, int keyClass, int copyKey){
+SQLITE_PRIVATE void sqlite3HashInit(Hash *pNew, int keyClass, int copyKey){
assert( pNew!=0 );
- assert( keyClass>=STQLITE_HASH_STRING && keyClass<=STQLITE_HASH_BINARY );
+ assert( keyClass>=SQLITE_HASH_STRING && keyClass<=SQLITE_HASH_BINARY );
pNew->keyClass = keyClass;
#if 0
- if( keyClass==STQLITE_HASH_POINTER || keyClass==STQLITE_HASH_INT ) copyKey = 0;
+ if( keyClass==SQLITE_HASH_POINTER || keyClass==SQLITE_HASH_INT ) copyKey = 0;
#endif
pNew->copyKey = copyKey;
pNew->first = 0;
@@ -11036,7 +11036,7 @@ STQLITE_PRIVATE void sqlite3HashInit(Hash *pNew, int keyClass, int copyKey){
** Call this routine to delete a hash table or to reset a hash table
** to the empty state.
*/
-STQLITE_PRIVATE void sqlite3HashClear(Hash *pH){
+SQLITE_PRIVATE void sqlite3HashClear(Hash *pH){
HashElem *elem; /* For looping over all elements of the table */
assert( pH!=0 );
@@ -11058,7 +11058,7 @@ STQLITE_PRIVATE void sqlite3HashClear(Hash *pH){
#if 0 /* NOT USED */
/*
-** Hash and comparison functions when the mode is STQLITE_HASH_INT
+** Hash and comparison functions when the mode is SQLITE_HASH_INT
*/
static int intHash(const void *pKey, int nKey){
return nKey ^ (nKey<<8) ^ (nKey>>8);
@@ -11070,7 +11070,7 @@ static int intCompare(const void *pKey1, int n1, const void *pKey2, int n2){
#if 0 /* NOT USED */
/*
-** Hash and comparison functions when the mode is STQLITE_HASH_POINTER
+** Hash and comparison functions when the mode is SQLITE_HASH_POINTER
*/
static int ptrHash(const void *pKey, int nKey){
uptr x = Addr(pKey);
@@ -11084,7 +11084,7 @@ static int ptrCompare(const void *pKey1, int n1, const void *pKey2, int n2){
#endif
/*
-** Hash and comparison functions when the mode is STQLITE_HASH_STRING
+** Hash and comparison functions when the mode is SQLITE_HASH_STRING
*/
static int strHash(const void *pKey, int nKey){
const char *z = (const char *)pKey;
@@ -11102,7 +11102,7 @@ static int strCompare(const void *pKey1, int n1, const void *pKey2, int n2){
}
/*
-** Hash and comparison functions when the mode is STQLITE_HASH_BINARY
+** Hash and comparison functions when the mode is SQLITE_HASH_BINARY
*/
static int binHash(const void *pKey, int nKey){
int h = 0;
@@ -11132,18 +11132,18 @@ static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){
static int (*hashFunction(int keyClass))(const void*,int){
#if 0 /* HASH_INT and HASH_POINTER are never used */
switch( keyClass ){
- case STQLITE_HASH_INT: return &intHash;
- case STQLITE_HASH_POINTER: return &ptrHash;
- case STQLITE_HASH_STRING: return &strHash;
- case STQLITE_HASH_BINARY: return &binHash;;
+ case SQLITE_HASH_INT: return &intHash;
+ case SQLITE_HASH_POINTER: return &ptrHash;
+ case SQLITE_HASH_STRING: return &strHash;
+ case SQLITE_HASH_BINARY: return &binHash;;
default: break;
}
return 0;
#else
- if( keyClass==STQLITE_HASH_STRING ){
+ if( keyClass==SQLITE_HASH_STRING ){
return &strHash;
}else{
- assert( keyClass==STQLITE_HASH_BINARY );
+ assert( keyClass==SQLITE_HASH_BINARY );
return &binHash;
}
#endif
@@ -11158,18 +11158,18 @@ static int (*hashFunction(int keyClass))(const void*,int){
static int (*compareFunction(int keyClass))(const void*,int,const void*,int){
#if 0 /* HASH_INT and HASH_POINTER are never used */
switch( keyClass ){
- case STQLITE_HASH_INT: return &intCompare;
- case STQLITE_HASH_POINTER: return &ptrCompare;
- case STQLITE_HASH_STRING: return &strCompare;
- case STQLITE_HASH_BINARY: return &binCompare;
+ case SQLITE_HASH_INT: return &intCompare;
+ case SQLITE_HASH_POINTER: return &ptrCompare;
+ case SQLITE_HASH_STRING: return &strCompare;
+ case SQLITE_HASH_BINARY: return &binCompare;
default: break;
}
return 0;
#else
- if( keyClass==STQLITE_HASH_STRING ){
+ if( keyClass==SQLITE_HASH_STRING ){
return &strCompare;
}else{
- assert( keyClass==STQLITE_HASH_BINARY );
+ assert( keyClass==SQLITE_HASH_BINARY );
return &binCompare;
}
#endif
@@ -11294,7 +11294,7 @@ static void removeElementGivenHash(
** that matches pKey,nKey. Return the data for this element if it is
** found, or NULL if there is no match.
*/
-STQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey){
+SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey){
int h; /* A hash on key */
HashElem *elem; /* The element that matches key */
int (*xHash)(const void*,int); /* The hash function */
@@ -11323,7 +11323,7 @@ STQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey
** If the "data" parameter to this function is NULL, then the
** element corresponding to "key" is removed from the hash table.
*/
-STQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
+SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
int hraw; /* Raw hash value of the key */
int h; /* the hash of the key modulo hash table size */
HashElem *elem; /* Used to loop thru the element list */
@@ -11387,7 +11387,7 @@ STQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, vo
/************** Begin file opcodes.c *****************************************/
/* Automatically generated. Do not edit */
/* See the mkopcodec.awk script for details. */
-#if !defined(STQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(STQLITE_DEBUG)
+#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
const char *const sqlite3OpcodeNames[] = { "?",
/* 1 */ "MemLoad",
/* 2 */ "VNext",
@@ -11558,7 +11558,7 @@ const char *const sqlite3OpcodeNames[] = { "?",
** Macros used to determine whether or not to use threads.
*/
#if defined(THREADSAFE) && THREADSAFE
-# define STQLITE_OS2_THREADS 1
+# define SQLITE_OS2_THREADS 1
#endif
/*
@@ -11588,11 +11588,11 @@ const char *const sqlite3OpcodeNames[] = { "?",
/*
** At least two bugs have slipped in because we changed the MEMORY_DEBUG
-** macro to STQLITE_DEBUG and some older makefiles have not yet made the
+** macro to SQLITE_DEBUG and some older makefiles have not yet made the
** switch. The following code should catch this problem at compile-time.
*/
#ifdef MEMORY_DEBUG
-# error "The MEMORY_DEBUG macro is obsolete. Use STQLITE_DEBUG instead."
+# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
#endif
@@ -11600,12 +11600,12 @@ const char *const sqlite3OpcodeNames[] = { "?",
* When testing, this global variable stores the location of the
* pending-byte in the database file.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
unsigned int sqlite3_pending_byte = 0x40000000;
#endif
int sqlite3_os_trace = 0;
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
#define OSTRACE1(X) if( sqlite3_os_trace ) sqlite3DebugPrintf(X)
#define OSTRACE2(X,Y) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y)
#define OSTRACE3(X,Y,Z) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z)
@@ -11629,7 +11629,7 @@ int sqlite3_os_trace = 0;
** Macros for performance tracing. Normally turned off. Only works
** on i486 hardware.
*/
-#ifdef STQLITE_PERFORMANCE_TRACE
+#ifdef SQLITE_PERFORMANCE_TRACE
__inline__ unsigned long long int hwtime(void){
unsigned long long int x;
__asm__("rdtsc\n\t"
@@ -11649,11 +11649,11 @@ static unsigned int elapse;
#endif
/*
-** If we compile with the STQLITE_TEST macro set, then the following block
+** If we compile with the SQLITE_TEST macro set, then the following block
** of code will give us the ability to simulate a disk I/O error. This
** is used for testing the I/O recovery logic.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_io_error_hit = 0;
int sqlite3_io_error_pending = 0;
int sqlite3_io_error_persist = 0;
@@ -11687,7 +11687,7 @@ static void local_ioerr(){
/*
** When testing, keep a count of the number of open files.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_open_file_count = 0;
#define OpenCounter(X) sqlite3_open_file_count+=(X)
#else
@@ -11712,8 +11712,8 @@ int sqlite3_open_file_count = 0;
** If neither memory-management or debugging is enabled, the second
** set of implementations is used instead.
*/
-#if defined(STQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (STQLITE_MEMDEBUG)
-STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (SQLITE_MEMDEBUG)
+SQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
char *p = (char *)malloc(n+8);
assert(n>0);
assert(sizeof(int)<=8);
@@ -11723,7 +11723,7 @@ STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
}
return (void *)p;
}
-STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
+SQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
char *p2 = ((char *)p - 8);
assert(n>0);
p2 = (char*)realloc(p2, n+8);
@@ -11733,29 +11733,29 @@ STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
}
return (void *)p2;
}
-STQLITE_PRIVATE void sqlite3GenericFree(void *p){
+SQLITE_PRIVATE void sqlite3GenericFree(void *p){
assert(p);
free((void *)((char *)p - 8));
}
-STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){
+SQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){
return p ? *(int *)((char *)p - 8) : 0;
}
#else
-STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
+SQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
char *p = (char *)malloc(n);
return (void *)p;
}
-STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
+SQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
assert(n>0);
p = realloc(p, n);
return p;
}
-STQLITE_PRIVATE void sqlite3GenericFree(void *p){
+SQLITE_PRIVATE void sqlite3GenericFree(void *p){
assert(p);
free(p);
}
/* Never actually used, but needed for the linker */
-STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
+SQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
#endif
/*
@@ -11783,26 +11783,26 @@ struct os2File {
/*
** Do not include any of the File I/O interface procedures if the
-** STQLITE_OMIT_DISKIO macro is defined (indicating that there database
+** SQLITE_OMIT_DISKIO macro is defined (indicating that there database
** will be in-memory only)
*/
-#ifndef STQLITE_OMIT_DISKIO
+#ifndef SQLITE_OMIT_DISKIO
/*
** Delete the named file
*/
-STQLITE_PRIVATE int sqlite3Os2Delete( const char *zFilename ){
+SQLITE_PRIVATE int sqlite3Os2Delete( const char *zFilename ){
APIRET rc = NO_ERROR;
rc = DosDelete( (PSZ)zFilename );
OSTRACE2( "DELETE \"%s\"\n", zFilename );
- return rc == NO_ERROR ? STQLITE_OK : STQLITE_IOERR;
+ return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
}
/*
** Return TRUE if the named file exists.
*/
-STQLITE_PRIVATE int sqlite3Os2FileExists( const char *zFilename ){
+SQLITE_PRIVATE int sqlite3Os2FileExists( const char *zFilename ){
FILESTATUS3 fsts3ConfigInfo;
memset(&fsts3ConfigInfo, 0, sizeof(fsts3ConfigInfo));
return DosQueryPathInfo( (PSZ)zFilename, FIL_STANDARD,
@@ -11820,12 +11820,12 @@ int allocateOs2File( os2File *pInit, OsFile **pld );
** On success, a handle for the open file is written to *id
** and *pReadonly is set to 0 if the file was opened for reading and
** writing or 1 if the file was opened read-only. The function returns
-** STQLITE_OK.
+** SQLITE_OK.
**
-** On failure, the function returns STQLITE_CANTOPEN and leaves
+** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id and *pReadonly unchanged.
*/
-STQLITE_PRIVATE int sqlite3Os2OpenReadWrite(
+SQLITE_PRIVATE int sqlite3Os2OpenReadWrite(
const char *zFilename,
OsFile **pld,
int *pReadonly
@@ -11848,7 +11848,7 @@ STQLITE_PRIVATE int sqlite3Os2OpenReadWrite(
OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_RANDOM |
OPEN_SHARE_DENYWRITE | OPEN_ACCESS_READONLY, (PEAOP2)NULL );
if( rc != NO_ERROR ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
*pReadonly = 1;
}
@@ -11875,11 +11875,11 @@ STQLITE_PRIVATE int sqlite3Os2OpenReadWrite(
** If delFlag is true, then make arrangements to automatically delete
** the file when it is closed.
**
-** On success, write the file handle into *id and return STQLITE_OK.
+** On success, write the file handle into *id and return SQLITE_OK.
**
-** On failure, return STQLITE_CANTOPEN.
+** On failure, return SQLITE_CANTOPEN.
*/
-STQLITE_PRIVATE int sqlite3Os2OpenExclusive( const char *zFilename, OsFile **pld, int delFlag ){
+SQLITE_PRIVATE int sqlite3Os2OpenExclusive( const char *zFilename, OsFile **pld, int delFlag ){
os2File f;
HFILE hf;
ULONG ulAction;
@@ -11891,7 +11891,7 @@ STQLITE_PRIVATE int sqlite3Os2OpenExclusive( const char *zFilename, OsFile **pld
OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_RANDOM |
OPEN_SHARE_DENYREADWRITE | OPEN_ACCESS_READWRITE, (PEAOP2)NULL );
if( rc != NO_ERROR ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
f.h = hf;
@@ -11907,11 +11907,11 @@ STQLITE_PRIVATE int sqlite3Os2OpenExclusive( const char *zFilename, OsFile **pld
/*
** Attempt to open a new file for read-only access.
**
-** On success, write the file handle into *id and return STQLITE_OK.
+** On success, write the file handle into *id and return SQLITE_OK.
**
-** On failure, return STQLITE_CANTOPEN.
+** On failure, return SQLITE_CANTOPEN.
*/
-STQLITE_PRIVATE int sqlite3Os2OpenReadOnly( const char *zFilename, OsFile **pld ){
+SQLITE_PRIVATE int sqlite3Os2OpenReadOnly( const char *zFilename, OsFile **pld ){
os2File f;
HFILE hf;
ULONG ulAction;
@@ -11923,7 +11923,7 @@ STQLITE_PRIVATE int sqlite3Os2OpenReadOnly( const char *zFilename, OsFile **pld
OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_RANDOM |
OPEN_SHARE_DENYWRITE | OPEN_ACCESS_READONLY, (PEAOP2)NULL );
if( rc != NO_ERROR ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
f.h = hf;
f.locktype = NO_LOCK;
@@ -11944,24 +11944,24 @@ STQLITE_PRIVATE int sqlite3Os2OpenReadOnly( const char *zFilename, OsFile **pld
** OS/2 since OS/2 does not support hard links.
**
** On success, a handle for a previously open file is at *id is
-** updated with the new directory file descriptor and STQLITE_OK is
+** updated with the new directory file descriptor and SQLITE_OK is
** returned.
**
-** On failure, the function returns STQLITE_CANTOPEN and leaves
+** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id unchanged.
*/
int os2OpenDirectory(
OsFile *id,
const char *zDirname
){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Create a temporary file name in zBuf. zBuf must be big enough to
-** hold at least STQLITE_TEMPNAME_SIZE characters.
+** hold at least SQLITE_TEMPNAME_SIZE characters.
*/
-STQLITE_PRIVATE int sqlite3Os2TempFileName( char *zBuf ){
+SQLITE_PRIVATE int sqlite3Os2TempFileName( char *zBuf ){
static const unsigned char zChars[] =
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPTQRSTUVWXYZ"
@@ -11988,7 +11988,7 @@ STQLITE_PRIVATE int sqlite3Os2TempFileName( char *zBuf ){
if( !sqlite3OsFileExists( zBuf ) ) break;
}
OSTRACE2( "TEMP FILENAME: %s\n", zBuf );
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -12008,40 +12008,40 @@ int os2Close( OsFile **pld ){
OpenCounter( -1 );
}
- return rc == NO_ERROR ? STQLITE_OK : STQLITE_IOERR;
+ return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
}
/*
-** Read data from a file into a buffer. Return STQLITE_OK if all
-** bytes were read successfully and STQLITE_IOERR if anything goes
+** Read data from a file into a buffer. Return SQLITE_OK if all
+** bytes were read successfully and SQLITE_IOERR if anything goes
** wrong.
*/
int os2Read( OsFile *id, void *pBuf, int amt ){
ULONG got;
assert( id!=0 );
- SimulateIOError( return STQLITE_IOERR );
+ SimulateIOError( return SQLITE_IOERR );
OSTRACE3( "READ %d lock=%d\n", ((os2File*)id)->h, ((os2File*)id)->locktype );
DosRead( ((os2File*)id)->h, pBuf, amt, &got );
if (got == (ULONG)amt)
- return STQLITE_OK;
+ return SQLITE_OK;
else if (got == 0)
- return STQLITE_IOERR_READ;
+ return SQLITE_IOERR_READ;
else {
memset(&((char*)pBuf)[got], 0, amt-got);
- return STQLITE_IOERR_SHORT_READ;
+ return SQLITE_IOERR_SHORT_READ;
}
}
/*
-** Write data from a buffer into a file. Return STQLITE_OK on success
+** Write data from a buffer into a file. Return SQLITE_OK on success
** or some other error code on failure.
*/
int os2Write( OsFile *id, const void *pBuf, int amt ){
APIRET rc = NO_ERROR;
ULONG wrote;
assert( id!=0 );
- SimulateIOError( return STQLITE_IOERR );
- SimulateDiskfullError( return STQLITE_FULL );
+ SimulateIOError( return SQLITE_IOERR );
+ SimulateDiskfullError( return SQLITE_FULL );
OSTRACE3( "WRITE %d lock=%d\n", ((os2File*)id)->h, ((os2File*)id)->locktype );
while( amt > 0 &&
(rc = DosWrite( ((os2File*)id)->h, (PVOID)pBuf, amt, &wrote )) && wrote > 0 ){
@@ -12049,7 +12049,7 @@ int os2Write( OsFile *id, const void *pBuf, int amt ){
pBuf = &((char*)pBuf)[wrote];
}
- return ( rc != NO_ERROR || amt > (int)wrote ) ? STQLITE_FULL : STQLITE_OK;
+ return ( rc != NO_ERROR || amt > (int)wrote ) ? SQLITE_FULL : SQLITE_OK;
}
/*
@@ -12061,7 +12061,7 @@ int os2Seek( OsFile *id, i64 offset ){
assert( id!=0 );
rc = DosSetFilePtr( ((os2File*)id)->h, offset, FILE_BEGIN, &filePointer );
OSTRACE3( "SEEK %d %lld\n", ((os2File*)id)->h, offset );
- return rc == NO_ERROR ? STQLITE_OK : STQLITE_IOERR;
+ return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
}
/*
@@ -12070,16 +12070,16 @@ int os2Seek( OsFile *id, i64 offset ){
int os2Sync( OsFile *id, int dataOnly ){
assert( id!=0 );
OSTRACE3( "SYNC %d lock=%d\n", ((os2File*)id)->h, ((os2File*)id)->locktype );
- return DosResetBuffer( ((os2File*)id)->h ) == NO_ERROR ? STQLITE_OK : STQLITE_IOERR;
+ return DosResetBuffer( ((os2File*)id)->h ) == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
}
/*
** Sync the directory zDirname. This is a no-op on operating systems other
** than UNIX.
*/
-STQLITE_PRIVATE int sqlite3Os2SyncDirectory( const char *zDirname ){
- SimulateIOError( return STQLITE_IOERR );
- return STQLITE_OK;
+SQLITE_PRIVATE int sqlite3Os2SyncDirectory( const char *zDirname ){
+ SimulateIOError( return SQLITE_IOERR );
+ return SQLITE_OK;
}
/*
@@ -12090,13 +12090,13 @@ int os2Truncate( OsFile *id, i64 nByte ){
ULONG upperBits = nByte>>32;
assert( id!=0 );
OSTRACE3( "TRUNCATE %d %lld\n", ((os2File*)id)->h, nByte );
- SimulateIOError( return STQLITE_IOERR );
+ SimulateIOError( return SQLITE_IOERR );
rc = DosSetFilePtr( ((os2File*)id)->h, nByte, FILE_BEGIN, &upperBits );
if( rc != NO_ERROR ){
- return STQLITE_IOERR;
+ return SQLITE_IOERR;
}
rc = DosSetFilePtr( ((os2File*)id)->h, 0L, FILE_END, &upperBits );
- return rc == NO_ERROR ? STQLITE_OK : STQLITE_IOERR;
+ return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
}
/*
@@ -12107,14 +12107,14 @@ int os2FileSize( OsFile *id, i64 *pSize ){
FILESTATUS3 fsts3FileInfo;
memset(&fsts3FileInfo, 0, sizeof(fsts3FileInfo));
assert( id!=0 );
- SimulateIOError( return STQLITE_IOERR );
+ SimulateIOError( return SQLITE_IOERR );
rc = DosQueryFileInfo( ((os2File*)id)->h, FIL_STANDARD, &fsts3FileInfo, sizeof(FILESTATUS3) );
if( rc == NO_ERROR ){
*pSize = fsts3FileInfo.cbFile;
- return STQLITE_OK;
+ return SQLITE_OK;
}
else{
- return STQLITE_IOERR;
+ return SQLITE_IOERR;
}
}
@@ -12148,12 +12148,12 @@ static int unlockReadLock( os2File *id ){
return DosSetFileLocks( id->h, &UnlockArea, &LockArea, 2000L, 1L );
}
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
/*
** Check that a given pathname is a directory and is writable
**
*/
-STQLITE_PRIVATE int sqlite3Os2IsDirWritable( char *zDirname ){
+SQLITE_PRIVATE int sqlite3Os2IsDirWritable( char *zDirname ){
FILESTATUS3 fsts3ConfigInfo;
APIRET rc = NO_ERROR;
memset(&fsts3ConfigInfo, 0, sizeof(fsts3ConfigInfo));
@@ -12165,7 +12165,7 @@ STQLITE_PRIVATE int sqlite3Os2IsDirWritable( char *zDirname ){
return 1;
}
-#endif /* STQLITE_OMIT_PAGER_PRAGMAS */
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
/*
** Lock the file with the lock specified by parameter locktype - one
@@ -12194,7 +12194,7 @@ STQLITE_PRIVATE int sqlite3Os2IsDirWritable( char *zDirname ){
** must go straight to locking level 0.
*/
int os2Lock( OsFile *id, int locktype ){
- APIRET rc = STQLITE_OK; /* Return code from subroutines */
+ APIRET rc = SQLITE_OK; /* Return code from subroutines */
APIRET res = NO_ERROR; /* Result of an OS/2 lock call */
int newLocktype; /* Set id->locktype to this value before exiting */
int gotPendingLock = 0;/* True if we acquired a PENDING lock this time */
@@ -12211,7 +12211,7 @@ int os2Lock( OsFile *id, int locktype ){
** sqlite3OsEnterMutex() hasn't been called yet.
*/
if( pFile->locktype>=locktype ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* Make sure the locking sequence is correct
@@ -12309,11 +12309,11 @@ int os2Lock( OsFile *id, int locktype ){
** return the appropriate result code.
*/
if( res == NO_ERROR ){
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}else{
OSTRACE4( "LOCK FAILED %d trying for %d but got %d\n", pFile->h,
locktype, newLocktype );
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
}
pFile->locktype = newLocktype;
return rc;
@@ -12362,11 +12362,11 @@ int os2CheckReservedLock( OsFile *id ){
**
** It is not possible for this routine to fail if the second argument
** is NO_LOCK. If the second argument is SHARED_LOCK then this routine
-** might return STQLITE_IOERR;
+** might return SQLITE_IOERR;
*/
int os2Unlock( OsFile *id, int locktype ){
int type;
- APIRET rc = STQLITE_OK;
+ APIRET rc = SQLITE_OK;
os2File *pFile = (os2File*)id;
FILELOCK LockArea,
UnlockArea;
@@ -12385,7 +12385,7 @@ int os2Unlock( OsFile *id, int locktype ){
if( locktype==SHARED_LOCK && getReadLock(pFile) != NO_ERROR ){
/* This should never happen. We should always be able to
** reacquire the read lock */
- rc = STQLITE_IOERR;
+ rc = SQLITE_IOERR;
}
}
if( type>=RESERVED_LOCK ){
@@ -12415,14 +12415,14 @@ int os2Unlock( OsFile *id, int locktype ){
** The calling function is responsible for freeing this space once it
** is no longer needed.
*/
-STQLITE_PRIVATE char *sqlite3Os2FullPathname( const char *zRelative ){
+SQLITE_PRIVATE char *sqlite3Os2FullPathname( const char *zRelative ){
char *zFull = 0;
if( strchr(zRelative, ':') ){
sqlite3SetString( &zFull, zRelative, (char*)0 );
}else{
ULONG ulDriveNum = 0;
ULONG ulDriveMap = 0;
- ULONG cbzBufLen = STQLITE_TEMPNAME_SIZE;
+ ULONG cbzBufLen = SQLITE_TEMPNAME_SIZE;
char zDrive[2];
char *zBuff;
@@ -12469,13 +12469,13 @@ static int os2LockState( OsFile *id ){
** the specified file. This is almost always 512 bytes, but may be
** larger for some devices.
**
-** STQLite code assumes this function cannot fail. It also assumes that
+** SQLite code assumes this function cannot fail. It also assumes that
** if two files are created in the same file-system directory (i.e.
** a database and it's journal file) that the sector size will be the
** same for both.
*/
static int os2SectorSize(OsFile *id){
- return STQLITE_DEFAULT_SECTOR_SIZE;
+ return SQLITE_DEFAULT_SECTOR_SIZE;
}
/*
@@ -12511,29 +12511,29 @@ int allocateOs2File( os2File *pInit, OsFile **pld ){
if( pNew==0 ){
DosClose( pInit->h );
*pld = 0;
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}else{
*pNew = *pInit;
pNew->pMethod = &sqlite3Os2IoMethod;
pNew->locktype = NO_LOCK;
*pld = (OsFile*)pNew;
OpenCounter(+1);
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
-#endif /* STQLITE_OMIT_DISKIO */
+#endif /* SQLITE_OMIT_DISKIO */
/***************************************************************************
** Everything above deals with file I/O. Everything that follows deals
** with other miscellanous aspects of the operating system interface
****************************************************************************/
-#ifndef STQLITE_OMIT_LOAD_EXTENSION
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
/*
** Interfaces for opening a shared library, finding entry points
** within the shared library, and closing the shared library.
*/
-STQLITE_PRIVATE void *sqlite3Os2Dlopen(const char *zFilename){
+SQLITE_PRIVATE void *sqlite3Os2Dlopen(const char *zFilename){
UCHAR loadErr[256];
HMODULE hmod;
APIRET rc;
@@ -12541,7 +12541,7 @@ STQLITE_PRIVATE void *sqlite3Os2Dlopen(const char *zFilename){
if (rc != NO_ERROR) return 0;
return (void*)hmod;
}
-STQLITE_PRIVATE void *sqlite3Os2Dlsym(void *pHandle, const char *zSymbol){
+SQLITE_PRIVATE void *sqlite3Os2Dlsym(void *pHandle, const char *zSymbol){
PFN pfn;
APIRET rc;
rc = DosQueryProcAddr((HMODULE)pHandle, 0L, zSymbol, &pfn);
@@ -12556,10 +12556,10 @@ STQLITE_PRIVATE void *sqlite3Os2Dlsym(void *pHandle, const char *zSymbol){
if (rc != NO_ERROR) return 0;
return (void *)pfn;
}
-STQLITE_PRIVATE int sqlite3Os2Dlclose(void *pHandle){
+SQLITE_PRIVATE int sqlite3Os2Dlclose(void *pHandle){
return DosFreeModule((HMODULE)pHandle);
}
-#endif /* STQLITE_OMIT_LOAD_EXTENSION */
+#endif /* SQLITE_OMIT_LOAD_EXTENSION */
/*
@@ -12567,7 +12567,7 @@ STQLITE_PRIVATE int sqlite3Os2Dlclose(void *pHandle){
** is written into the buffer zBuf[256]. The calling function must
** supply a sufficiently large buffer.
*/
-STQLITE_PRIVATE int sqlite3Os2RandomSeed( char *zBuf ){
+SQLITE_PRIVATE int sqlite3Os2RandomSeed( char *zBuf ){
/* We have to initialize zBuf to prevent valgrind from reporting
** errors. The reports issued by valgrind are incorrect - we would
** prefer that the randomness be increased by making use of the
@@ -12582,13 +12582,13 @@ STQLITE_PRIVATE int sqlite3Os2RandomSeed( char *zBuf ){
*/
memset( zBuf, 0, 256 );
DosGetDateTime( (PDATETIME)zBuf );
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Sleep for a little while. Return the amount of time slept.
*/
-STQLITE_PRIVATE int sqlite3Os2Sleep( int ms ){
+SQLITE_PRIVATE int sqlite3Os2Sleep( int ms ){
DosSleep( ms );
return ms;
}
@@ -12597,7 +12597,7 @@ STQLITE_PRIVATE int sqlite3Os2Sleep( int ms ){
** Static variables used for thread synchronization
*/
static int inMutex = 0;
-#ifdef STQLITE_OS2_THREADS
+#ifdef SQLITE_OS2_THREADS
static ULONG mutexOwner;
#endif
@@ -12606,11 +12606,11 @@ static ULONG mutexOwner;
** multi-threaded processes. Only a single thread is allowed to
** executed code that is surrounded by EnterMutex() and LeaveMutex().
**
-** STQLite uses only a single Mutex. There is not much critical
+** SQLite uses only a single Mutex. There is not much critical
** code and what little there is executes quickly and without blocking.
*/
-STQLITE_PRIVATE void sqlite3Os2EnterMutex(){
-#ifdef STQLITE_OS2_THREADS
+SQLITE_PRIVATE void sqlite3Os2EnterMutex(){
+#ifdef SQLITE_OS2_THREADS
PTIB ptib;
DosEnterCritSec();
DosGetInfoBlocks( &ptib, NULL );
@@ -12619,13 +12619,13 @@ STQLITE_PRIVATE void sqlite3Os2EnterMutex(){
assert( !inMutex );
inMutex = 1;
}
-STQLITE_PRIVATE void sqlite3Os2LeaveMutex(){
-#ifdef STQLITE_OS2_THREADS
+SQLITE_PRIVATE void sqlite3Os2LeaveMutex(){
+#ifdef SQLITE_OS2_THREADS
PTIB ptib;
#endif
assert( inMutex );
inMutex = 0;
-#ifdef STQLITE_OS2_THREADS
+#ifdef SQLITE_OS2_THREADS
DosGetInfoBlocks( &ptib, NULL );
assert( mutexOwner == ptib->tib_ptib2->tib2_ultid );
DosExitCritSec();
@@ -12639,8 +12639,8 @@ STQLITE_PRIVATE void sqlite3Os2LeaveMutex(){
** calling thread holds the mutex. If the parameter is false, return
** true if any thread holds the mutex.
*/
-STQLITE_PRIVATE int sqlite3Os2InMutex( int thisThreadOnly ){
-#ifdef STQLITE_OS2_THREADS
+SQLITE_PRIVATE int sqlite3Os2InMutex( int thisThreadOnly ){
+#ifdef SQLITE_OS2_THREADS
PTIB ptib;
DosGetInfoBlocks( &ptib, NULL );
return inMutex>0 && (thisThreadOnly==0 || mutexOwner==ptib->tib_ptib2->tib2_ultid);
@@ -12653,7 +12653,7 @@ STQLITE_PRIVATE int sqlite3Os2InMutex( int thisThreadOnly ){
** The following variable, if set to a non-zero value, becomes the result
** returned from sqlite3OsCurrentTime(). This is used for testing.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_current_time = 0;
#endif
@@ -12662,7 +12662,7 @@ int sqlite3_current_time = 0;
** current time and date as a Julian Day number into *prNow and
** return 0. Return 1 if the time and date cannot be found.
*/
-STQLITE_PRIVATE int sqlite3Os2CurrentTime( double *prNow ){
+SQLITE_PRIVATE int sqlite3Os2CurrentTime( double *prNow ){
double now;
USHORT second, minute, hour,
day, month, year;
@@ -12688,7 +12688,7 @@ STQLITE_PRIVATE int sqlite3Os2CurrentTime( double *prNow ){
now += minute/1440.0;
now += second/86400.0;
*prNow = now;
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
if( sqlite3_current_time ){
*prNow = sqlite3_current_time/86400.0 + 2440587.5;
}
@@ -12701,7 +12701,7 @@ STQLITE_PRIVATE int sqlite3Os2CurrentTime( double *prNow ){
** Use this to verify that we are not leaking thread-specific-data.
** Ticket #1601
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_tsd_count = 0;
# define TSD_COUNTER_INCR InterlockedIncrement( &sqlite3_tsd_count )
# define TSD_COUNTER_DECR InterlockedDecrement( &sqlite3_tsd_count )
@@ -12724,7 +12724,7 @@ int sqlite3_tsd_count = 0;
** Return a pointer to the thread specific data or NULL if it is
** unallocated or gets deallocated.
*/
-STQLITE_PRIVATE ThreadData *sqlite3Os2ThreadSpecificData( int allocateFlag ){
+SQLITE_PRIVATE ThreadData *sqlite3Os2ThreadSpecificData( int allocateFlag ){
static ThreadData **s_ppTsd = NULL;
static const ThreadData zeroData = {0, 0, 0};
ThreadData *pTsd;
@@ -12781,14 +12781,14 @@ STQLITE_PRIVATE ThreadData *sqlite3Os2ThreadSpecificData( int allocateFlag ){
*/
#if OS_UNIX /* This file is used on unix only */
-/* #define STQLITE_ENABLE_LOCKING_STYLE 0 */
+/* #define SQLITE_ENABLE_LOCKING_STYLE 0 */
/*
** These #defines should enable >2GB file support on Posix if the
** underlying operating system supports it. If the OS lacks
** large file support, these should be no-ops.
**
-** Large file support can be disabled using the -DSTQLITE_DISABLE_LFS switch
+** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
** on the compiler command line. This is necessary if you are compiling
** on a recent machine (ex: RedHat 7.2) but you want your code to work
** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2
@@ -12796,7 +12796,7 @@ STQLITE_PRIVATE ThreadData *sqlite3Os2ThreadSpecificData( int allocateFlag ){
** in RedHat 6.0, so the code won't work. Hence, for maximum binary
** portability you should omit LFS.
*/
-#ifndef STQLITE_DISABLE_LFS
+#ifndef SQLITE_DISABLE_LFS
# define _LARGE_FILE 1
# ifndef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64
@@ -12813,29 +12813,29 @@ STQLITE_PRIVATE ThreadData *sqlite3Os2ThreadSpecificData( int allocateFlag ){
#include <unistd.h>
#include <sys/time.h>
#include <errno.h>
-#ifdef STQLITE_ENABLE_LOCKING_STYLE
+#ifdef SQLITE_ENABLE_LOCKING_STYLE
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/mount.h>
-#endif /* STQLITE_ENABLE_LOCKING_STYLE */
+#endif /* SQLITE_ENABLE_LOCKING_STYLE */
/*
** If we are to be thread-safe, include the pthreads header and define
-** the STQLITE_UNIX_THREADS macro.
+** the SQLITE_UNIX_THREADS macro.
*/
#ifndef THREADSAFE
# define THREADSAFE 1
#endif
#if THREADSAFE
# include <pthread.h>
-# define STQLITE_UNIX_THREADS 1
+# define SQLITE_UNIX_THREADS 1
#endif
/*
** Default permissions when creating a new file
*/
-#ifndef STQLITE_DEFAULT_FILE_PERMISSIONS
-# define STQLITE_DEFAULT_FILE_PERMISSIONS 0644
+#ifndef SQLITE_DEFAULT_FILE_PERMISSIONS
+# define SQLITE_DEFAULT_FILE_PERMISSIONS 0644
#endif
@@ -12849,16 +12849,16 @@ struct unixFile {
IoMethod const *pMethod; /* Always the first entry */
struct openCnt *pOpen; /* Info about all open fd's on this inode */
struct lockInfo *pLock; /* Info about locks on this inode */
-#ifdef STQLITE_ENABLE_LOCKING_STYLE
+#ifdef SQLITE_ENABLE_LOCKING_STYLE
void *lockingContext; /* Locking style specific state */
-#endif /* STQLITE_ENABLE_LOCKING_STYLE */
+#endif /* SQLITE_ENABLE_LOCKING_STYLE */
int h; /* The file descriptor */
unsigned char locktype; /* The type of lock held on this fd */
unsigned char isOpen; /* True if needs to be closed */
unsigned char fullSync; /* Use F_FULLSYNC if available */
int dirfd; /* File descriptor for the directory */
i64 offset; /* Seek offset */
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
pthread_t tid; /* The thread that "owns" this OsFile */
#endif
};
@@ -12868,7 +12868,7 @@ struct unixFile {
** testing. This is used to simulate OS crashes to verify that
** commits are atomic even in the event of an OS crash.
*/
-#ifdef STQLITE_CRASH_TEST
+#ifdef SQLITE_CRASH_TEST
extern int sqlite3CrashTestEnable;
extern int sqlite3CrashOpenReadWrite(const char*, OsFile**, int*);
extern int sqlite3CrashOpenExclusive(const char*, OsFile**, int);
@@ -12907,11 +12907,11 @@ struct unixFile {
/*
** At least two bugs have slipped in because we changed the MEMORY_DEBUG
-** macro to STQLITE_DEBUG and some older makefiles have not yet made the
+** macro to SQLITE_DEBUG and some older makefiles have not yet made the
** switch. The following code should catch this problem at compile-time.
*/
#ifdef MEMORY_DEBUG
-# error "The MEMORY_DEBUG macro is obsolete. Use STQLITE_DEBUG instead."
+# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
#endif
@@ -12919,12 +12919,12 @@ struct unixFile {
* When testing, this global variable stores the location of the
* pending-byte in the database file.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
unsigned int sqlite3_pending_byte = 0x40000000;
#endif
int sqlite3_os_trace = 0;
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
#define OSTRACE1(X) if( sqlite3_os_trace ) sqlite3DebugPrintf(X)
#define OSTRACE2(X,Y) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y)
#define OSTRACE3(X,Y,Z) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z)
@@ -12948,7 +12948,7 @@ int sqlite3_os_trace = 0;
** Macros for performance tracing. Normally turned off. Only works
** on i486 hardware.
*/
-#ifdef STQLITE_PERFORMANCE_TRACE
+#ifdef SQLITE_PERFORMANCE_TRACE
__inline__ unsigned long long int hwtime(void){
unsigned long long int x;
__asm__("rdtsc\n\t"
@@ -12968,11 +12968,11 @@ static unsigned int elapse;
#endif
/*
-** If we compile with the STQLITE_TEST macro set, then the following block
+** If we compile with the SQLITE_TEST macro set, then the following block
** of code will give us the ability to simulate a disk I/O error. This
** is used for testing the I/O recovery logic.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_io_error_hit = 0;
int sqlite3_io_error_pending = 0;
int sqlite3_io_error_persist = 0;
@@ -13006,7 +13006,7 @@ static void local_ioerr(){
/*
** When testing, keep a count of the number of open files.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_open_file_count = 0;
#define OpenCounter(X) sqlite3_open_file_count+=(X)
#else
@@ -13031,8 +13031,8 @@ int sqlite3_open_file_count = 0;
** If neither memory-management or debugging is enabled, the second
** set of implementations is used instead.
*/
-#if defined(STQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (STQLITE_MEMDEBUG)
-STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (SQLITE_MEMDEBUG)
+SQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
char *p = (char *)malloc(n+8);
assert(n>0);
assert(sizeof(int)<=8);
@@ -13042,7 +13042,7 @@ STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
}
return (void *)p;
}
-STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
+SQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
char *p2 = ((char *)p - 8);
assert(n>0);
p2 = (char*)realloc(p2, n+8);
@@ -13052,29 +13052,29 @@ STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
}
return (void *)p2;
}
-STQLITE_PRIVATE void sqlite3GenericFree(void *p){
+SQLITE_PRIVATE void sqlite3GenericFree(void *p){
assert(p);
free((void *)((char *)p - 8));
}
-STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){
+SQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){
return p ? *(int *)((char *)p - 8) : 0;
}
#else
-STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
+SQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
char *p = (char *)malloc(n);
return (void *)p;
}
-STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
+SQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
assert(n>0);
p = realloc(p, n);
return p;
}
-STQLITE_PRIVATE void sqlite3GenericFree(void *p){
+SQLITE_PRIVATE void sqlite3GenericFree(void *p){
assert(p);
free(p);
}
/* Never actually used, but needed for the linker */
-STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
+SQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
#endif
/*
@@ -13089,10 +13089,10 @@ STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
/*
** Do not include any of the File I/O interface procedures if the
-** STQLITE_OMIT_DISKIO macro is defined (indicating that the database
+** SQLITE_OMIT_DISKIO macro is defined (indicating that the database
** will be in-memory only)
*/
-#ifndef STQLITE_OMIT_DISKIO
+#ifndef SQLITE_OMIT_DISKIO
/*
@@ -13101,7 +13101,7 @@ STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
#ifndef O_LARGEFILE
# define O_LARGEFILE 0
#endif
-#ifdef STQLITE_DISABLE_LFS
+#ifdef SQLITE_DISABLE_LFS
# undef O_LARGEFILE
# define O_LARGEFILE 0
#endif
@@ -13126,7 +13126,7 @@ STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
** The threadid macro resolves to the thread-id or to 0. Used for
** testing and debugging only.
*/
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
#define threadid pthread_self()
#else
#define threadid 0
@@ -13148,7 +13148,7 @@ STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
** recomputed because its key includes the thread-id. See the
** transferOwnership() function below for additional information
*/
-#if defined(STQLITE_UNIX_THREADS)
+#if defined(SQLITE_UNIX_THREADS)
# define SET_THREADID(X) (X)->tid = pthread_self()
# define CHECK_THREADID(X) (threadsOverrideEachOthersLocks==0 && \
!pthread_equal((X)->tid, pthread_self()))
@@ -13183,7 +13183,7 @@ STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
** to synchronize access for threads in separate processes, but not
** threads within the same process.
**
-** To work around the problem, STQLite has to manage file locks internally
+** To work around the problem, SQLite has to manage file locks internally
** on its own. Whenever a new database is opened, we have to find the
** specific inode of the database file (the inode is determined by the
** st_dev and st_ino fields of the stat structure that fstat() fills in)
@@ -13269,7 +13269,7 @@ STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
struct lockKey {
dev_t dev; /* Device number */
ino_t ino; /* Inode number */
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
pthread_t tid; /* Thread ID or zero if threads can override each other */
#endif
};
@@ -13320,12 +13320,12 @@ struct openCnt {
** openKey structures) into lockInfo and openCnt structures. Access to
** these hash tables must be protected by a mutex.
*/
-static Hash lockHash = {STQLITE_HASH_BINARY, 0, 0, 0,
+static Hash lockHash = {SQLITE_HASH_BINARY, 0, 0, 0,
sqlite3ThreadSafeMalloc, sqlite3ThreadSafeFree, 0, 0};
-static Hash openHash = {STQLITE_HASH_BINARY, 0, 0, 0,
+static Hash openHash = {SQLITE_HASH_BINARY, 0, 0, 0,
sqlite3ThreadSafeMalloc, sqlite3ThreadSafeFree, 0, 0};
-#ifdef STQLITE_ENABLE_LOCKING_STYLE
+#ifdef SQLITE_ENABLE_LOCKING_STYLE
/*
** The locking styles are associated with the different file locking
** capabilities supported by different file systems.
@@ -13349,9 +13349,9 @@ typedef enum {
noLockingStyle, /* useful for read-only file system */
unsupportedLockingStyle /* indicates unsupported file system */
} sqlite3LockingStyle;
-#endif /* STQLITE_ENABLE_LOCKING_STYLE */
+#endif /* SQLITE_ENABLE_LOCKING_STYLE */
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
/*
** This variable records whether or not threads can override each others
** locks.
@@ -13361,22 +13361,22 @@ typedef enum {
** -1: We don't know yet.
**
** On some systems, we know at compile-time if threads can override each
-** others locks. On those systems, the STQLITE_THREAD_OVERRIDE_LOCK macro
+** others locks. On those systems, the SQLITE_THREAD_OVERRIDE_LOCK macro
** will be set appropriately. On other systems, we have to check at
-** runtime. On these latter systems, STQLTIE_THREAD_OVERRIDE_LOCK is
+** runtime. On these latter systems, SQLTIE_THREAD_OVERRIDE_LOCK is
** undefined.
**
** This variable normally has file scope only. But during testing, we make
** it a global so that the test code can change its value in order to verify
** that the right stuff happens in either case.
*/
-#ifndef STQLITE_THREAD_OVERRIDE_LOCK
-# define STQLITE_THREAD_OVERRIDE_LOCK -1
+#ifndef SQLITE_THREAD_OVERRIDE_LOCK
+# define SQLITE_THREAD_OVERRIDE_LOCK -1
#endif
-#ifdef STQLITE_TEST
-int threadsOverrideEachOthersLocks = STQLITE_THREAD_OVERRIDE_LOCK;
+#ifdef SQLITE_TEST
+int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK;
#else
-static int threadsOverrideEachOthersLocks = STQLITE_THREAD_OVERRIDE_LOCK;
+static int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK;
#endif
/*
@@ -13389,12 +13389,12 @@ struct threadTestData {
int result; /* Result of the locking operation */
};
-#ifdef STQLITE_LOCK_TRACE
+#ifdef SQLITE_LOCK_TRACE
/*
** Print out information about all locking operations.
**
** This routine is used for troubleshooting locks on multithreaded
-** platforms. Enable by compiling with the -DSTQLITE_LOCK_TRACE
+** platforms. Enable by compiling with the -DSQLITE_LOCK_TRACE
** command-line option on the compiler. This code is normally
** turned off.
*/
@@ -13446,7 +13446,7 @@ static int lockTrace(int fd, int op, struct flock *p){
return s;
}
#define fcntl lockTrace
-#endif /* STQLITE_LOCK_TRACE */
+#endif /* SQLITE_LOCK_TRACE */
/*
** The testThreadLockingBehavior() routine launches two separate
@@ -13488,7 +13488,7 @@ static void testThreadLockingBehavior(int fd_orig){
close(fd);
threadsOverrideEachOthersLocks = d[0].result==0 && d[1].result==0;
}
-#endif /* STQLITE_UNIX_THREADS */
+#endif /* SQLITE_UNIX_THREADS */
/*
** Release a lockInfo structure previously allocated by findLockInfo().
@@ -13519,7 +13519,7 @@ static void releaseOpenCnt(struct openCnt *pOpen){
}
}
-#ifdef STQLITE_ENABLE_LOCKING_STYLE
+#ifdef SQLITE_ENABLE_LOCKING_STYLE
/*
** Tests a byte-range locking query to see if byte range locks are
** supported, if not we fall back to dotlockLockingStyle.
@@ -13554,8 +13554,8 @@ static sqlite3LockingStyle sqlite3TestLockingStyle(const char *filePath,
static sqlite3LockingStyle sqlite3DetectLockingStyle(const char *filePath,
int fd) {
-#ifdef STQLITE_FIXED_LOCKING_STYLE
- return (sqlite3LockingStyle)STQLITE_FIXED_LOCKING_STYLE;
+#ifdef SQLITE_FIXED_LOCKING_STYLE
+ return (sqlite3LockingStyle)SQLITE_FIXED_LOCKING_STYLE;
#else
struct statfs fsInfo;
@@ -13585,10 +13585,10 @@ static sqlite3LockingStyle sqlite3DetectLockingStyle(const char *filePath,
return unsupportedLockingStyle;
return sqlite3TestLockingStyle(filePath, fd);
-#endif /* STQLITE_FIXED_LOCKING_STYLE */
+#endif /* SQLITE_FIXED_LOCKING_STYLE */
}
-#endif /* STQLITE_ENABLE_LOCKING_STYLE */
+#endif /* SQLITE_ENABLE_LOCKING_STYLE */
/*
** Given a file descriptor, locate lockInfo and openCnt structures that
@@ -13615,7 +13615,7 @@ static int findLockInfo(
memset(&key1, 0, sizeof(key1));
key1.dev = statbuf.st_dev;
key1.ino = statbuf.st_ino;
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
if( threadsOverrideEachOthersLocks<0 ){
testThreadLockingBehavior(fd);
}
@@ -13680,7 +13680,7 @@ exit_findlockinfo:
return rc;
}
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
/*
** Helper function for printing out trace information from debugging
** binaries. This returns the string represetation of the supplied
@@ -13709,25 +13709,25 @@ static const char *locktypeName(int locktype){
**
** Ownership transfer is only allowed if the unixFile is currently unlocked.
** If the unixFile is locked and an ownership is wrong, then return
-** STQLITE_MISUSE. STQLITE_OK is returned if everything works.
+** SQLITE_MISUSE. SQLITE_OK is returned if everything works.
*/
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
static int transferOwnership(unixFile *pFile){
int rc;
pthread_t hSelf;
if( threadsOverrideEachOthersLocks ){
/* Ownership transfers not needed on this system */
- return STQLITE_OK;
+ return SQLITE_OK;
}
hSelf = pthread_self();
if( pthread_equal(pFile->tid, hSelf) ){
/* We are still in the same thread */
OSTRACE1("No-transfer, same thread\n");
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( pFile->locktype!=NO_LOCK ){
/* We cannot change ownership while we are holding a lock! */
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
OSTRACE4("Transfer ownership of %d from %d to %d\n",
pFile->h, pFile->tid, hSelf);
@@ -13740,27 +13740,27 @@ static int transferOwnership(unixFile *pFile){
locktypeName(pFile->pLock->locktype), pFile->pLock->cnt);
return rc;
} else {
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
#else
/* On single-threaded builds, ownership transfer is a no-op */
-# define transferOwnership(X) STQLITE_OK
+# define transferOwnership(X) SQLITE_OK
#endif
/*
** Delete the named file
*/
-STQLITE_PRIVATE int sqlite3UnixDelete(const char *zFilename){
- SimulateIOError(return STQLITE_IOERR_DELETE);
+SQLITE_PRIVATE int sqlite3UnixDelete(const char *zFilename){
+ SimulateIOError(return SQLITE_IOERR_DELETE);
unlink(zFilename);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Return TRUE if the named file exists.
*/
-STQLITE_PRIVATE int sqlite3UnixFileExists(const char *zFilename){
+SQLITE_PRIVATE int sqlite3UnixFileExists(const char *zFilename){
return access(zFilename, 0)==0;
}
@@ -13780,12 +13780,12 @@ static int allocateUnixFile(
** On success, a handle for the open file is written to *id
** and *pReadonly is set to 0 if the file was opened for reading and
** writing or 1 if the file was opened read-only. The function returns
-** STQLITE_OK.
+** SQLITE_OK.
**
-** On failure, the function returns STQLITE_CANTOPEN and leaves
+** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id and *pReadonly unchanged.
*/
-STQLITE_PRIVATE int sqlite3UnixOpenReadWrite(
+SQLITE_PRIVATE int sqlite3UnixOpenReadWrite(
const char *zFilename,
OsFile **pId,
int *pReadonly
@@ -13795,16 +13795,16 @@ STQLITE_PRIVATE int sqlite3UnixOpenReadWrite(
CRASH_TEST_OVERRIDE(sqlite3CrashOpenReadWrite, zFilename, pId, pReadonly);
assert( 0==*pId );
h = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY,
- STQLITE_DEFAULT_FILE_PERMISSIONS);
+ SQLITE_DEFAULT_FILE_PERMISSIONS);
if( h<0 ){
#ifdef EISDIR
if( errno==EISDIR ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
#endif
h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
if( h<0 ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
*pReadonly = 1;
}else{
@@ -13824,20 +13824,20 @@ STQLITE_PRIVATE int sqlite3UnixOpenReadWrite(
** If delFlag is true, then make arrangements to automatically delete
** the file when it is closed.
**
-** On success, write the file handle into *id and return STQLITE_OK.
+** On success, write the file handle into *id and return SQLITE_OK.
**
-** On failure, return STQLITE_CANTOPEN.
+** On failure, return SQLITE_CANTOPEN.
*/
-STQLITE_PRIVATE int sqlite3UnixOpenExclusive(const char *zFilename, OsFile **pId, int delFlag){
+SQLITE_PRIVATE int sqlite3UnixOpenExclusive(const char *zFilename, OsFile **pId, int delFlag){
int h;
CRASH_TEST_OVERRIDE(sqlite3CrashOpenExclusive, zFilename, pId, delFlag);
assert( 0==*pId );
h = open(zFilename,
O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE|O_BINARY,
- delFlag ? 0600 : STQLITE_DEFAULT_FILE_PERMISSIONS);
+ delFlag ? 0600 : SQLITE_DEFAULT_FILE_PERMISSIONS);
if( h<0 ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
return allocateUnixFile(h, pId, zFilename, delFlag);
}
@@ -13845,18 +13845,18 @@ STQLITE_PRIVATE int sqlite3UnixOpenExclusive(const char *zFilename, OsFile **pId
/*
** Attempt to open a new file for read-only access.
**
-** On success, write the file handle into *id and return STQLITE_OK.
+** On success, write the file handle into *id and return SQLITE_OK.
**
-** On failure, return STQLITE_CANTOPEN.
+** On failure, return SQLITE_CANTOPEN.
*/
-STQLITE_PRIVATE int sqlite3UnixOpenReadOnly(const char *zFilename, OsFile **pId){
+SQLITE_PRIVATE int sqlite3UnixOpenReadOnly(const char *zFilename, OsFile **pId){
int h;
CRASH_TEST_OVERRIDE(sqlite3CrashOpenReadOnly, zFilename, pId, 0);
assert( 0==*pId );
h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
if( h<0 ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
return allocateUnixFile(h, pId, zFilename, 0);
}
@@ -13874,10 +13874,10 @@ STQLITE_PRIVATE int sqlite3UnixOpenReadOnly(const char *zFilename, OsFile **pId)
** a FULL_FSYNC sync applies to all pending disk operations.
**
** On success, a handle for a previously open file at *id is
-** updated with the new directory file descriptor and STQLITE_OK is
+** updated with the new directory file descriptor and SQLITE_OK is
** returned.
**
-** On failure, the function returns STQLITE_CANTOPEN and leaves
+** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id unchanged.
*/
static int unixOpenDirectory(
@@ -13891,20 +13891,20 @@ static int unixOpenDirectory(
assert( pFile->dirfd<0 );
pFile->dirfd = h = open(zDirname, O_RDONLY|O_BINARY, 0);
if( h<0 ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
#ifdef FD_CLOEXEC
fcntl(h, F_SETFD, fcntl(h, F_GETFD, 0) | FD_CLOEXEC);
#endif
OSTRACE3("OPENDIR %-3d %s\n", h, zDirname);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Create a temporary file name in zBuf. zBuf must be big enough to
-** hold at least STQLITE_TEMPNAME_SIZE characters.
+** hold at least SQLITE_TEMPNAME_SIZE characters.
*/
-STQLITE_PRIVATE int sqlite3UnixTempFileName(char *zBuf){
+SQLITE_PRIVATE int sqlite3UnixTempFileName(char *zBuf){
static const char *azDirs[] = {
0,
"/var/tmp",
@@ -13929,7 +13929,7 @@ STQLITE_PRIVATE int sqlite3UnixTempFileName(char *zBuf){
break;
}
do{
- sqlite3_snprintf(STQLITE_TEMPNAME_SIZE, zBuf, "%s/"TEMP_FILE_PREFIX, zDir);
+ sqlite3_snprintf(SQLITE_TEMPNAME_SIZE, zBuf, "%s/"TEMP_FILE_PREFIX, zDir);
j = strlen(zBuf);
sqlite3Randomness(15, &zBuf[j]);
for(i=0; i<15; i++, j++){
@@ -13937,22 +13937,22 @@ STQLITE_PRIVATE int sqlite3UnixTempFileName(char *zBuf){
}
zBuf[j] = 0;
}while( access(zBuf,0)==0 );
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Check that a given pathname is a directory and is writable
**
*/
-STQLITE_PRIVATE int sqlite3UnixIsDirWritable(char *zBuf){
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+SQLITE_PRIVATE int sqlite3UnixIsDirWritable(char *zBuf){
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
struct stat buf;
if( zBuf==0 ) return 0;
if( zBuf[0]==0 ) return 0;
if( stat(zBuf, &buf) ) return 0;
if( !S_ISDIR(buf.st_mode) ) return 0;
if( access(zBuf, 07) ) return 0;
-#endif /* STQLITE_OMIT_PAGER_PRAGMAS */
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
return 1;
}
@@ -13987,8 +13987,8 @@ static int seekAndRead(unixFile *id, void *pBuf, int cnt){
}
/*
-** Read data from a file into a buffer. Return STQLITE_OK if all
-** bytes were read successfully and STQLITE_IOERR if anything goes
+** Read data from a file into a buffer. Return SQLITE_OK if all
+** bytes were read successfully and SQLITE_IOERR if anything goes
** wrong.
*/
static int unixRead(OsFile *id, void *pBuf, int amt){
@@ -13996,12 +13996,12 @@ static int unixRead(OsFile *id, void *pBuf, int amt){
assert( id );
got = seekAndRead((unixFile*)id, pBuf, amt);
if( got==amt ){
- return STQLITE_OK;
+ return SQLITE_OK;
}else if( got<0 ){
- return STQLITE_IOERR_READ;
+ return SQLITE_IOERR_READ;
}else{
memset(&((char*)pBuf)[got], 0, amt-got);
- return STQLITE_IOERR_SHORT_READ;
+ return SQLITE_IOERR_SHORT_READ;
}
}
@@ -14034,7 +14034,7 @@ static int seekAndWrite(unixFile *id, const void *pBuf, int cnt){
/*
-** Write data from a buffer into a file. Return STQLITE_OK on success
+** Write data from a buffer into a file. Return SQLITE_OK on success
** or some other error code on failure.
*/
static int unixWrite(OsFile *id, const void *pBuf, int amt){
@@ -14049,12 +14049,12 @@ static int unixWrite(OsFile *id, const void *pBuf, int amt){
SimulateDiskfullError(( wrote=0, amt=1 ));
if( amt>0 ){
if( wrote<0 ){
- return STQLITE_IOERR_WRITE;
+ return SQLITE_IOERR_WRITE;
}else{
- return STQLITE_FULL;
+ return SQLITE_FULL;
}
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -14062,14 +14062,14 @@ static int unixWrite(OsFile *id, const void *pBuf, int amt){
*/
static int unixSeek(OsFile *id, i64 offset){
assert( id );
-#ifdef STQLITE_TEST
- if( offset ) SimulateDiskfullError(return STQLITE_FULL);
+#ifdef SQLITE_TEST
+ if( offset ) SimulateDiskfullError(return SQLITE_FULL);
#endif
((unixFile*)id)->offset = offset;
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
/*
** Count the number of fullsyncs and normal syncs. This is used to test
** that syncs and fullsyncs are occuring at the right times.
@@ -14103,10 +14103,10 @@ int sqlite3_fullsync_count = 0;
** unix systems. The following procedure is an attempt to make
** it work better.
**
-** The STQLITE_NO_SYNC macro disables all fsync()s. This is useful
+** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful
** for testing when we want to run through the test suite quickly.
-** You are strongly advised *not* to deploy with STQLITE_NO_SYNC
-** enabled, however, since with STQLITE_NO_SYNC enabled, an OS crash
+** You are strongly advised *not* to deploy with SQLITE_NO_SYNC
+** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash
** or power failure will likely corrupt the database file.
*/
static int full_fsync(int fd, int fullSync, int dataOnly){
@@ -14116,16 +14116,16 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
** FULLSYNC. This is used during testing to verify that this procedure
** gets called with the correct arguments.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
if( fullSync ) sqlite3_fullsync_count++;
sqlite3_sync_count++;
#endif
- /* If we compiled with the STQLITE_NO_SYNC flag, then syncing is a
+ /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
** no-op
*/
-#ifdef STQLITE_NO_SYNC
- rc = STQLITE_OK;
+#ifdef SQLITE_NO_SYNC
+ rc = SQLITE_OK;
#else
#if HAVE_FULLFSYNC
@@ -14151,7 +14151,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
rc = fsync(fd);
}
#endif /* HAVE_FULLFSYNC */
-#endif /* defined(STQLITE_NO_SYNC) */
+#endif /* defined(SQLITE_NO_SYNC) */
return rc;
}
@@ -14167,7 +14167,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
** has been created by fsync-ing the directory that contains the file.
** If we do not do this and we encounter a power failure, the directory
** entry for the journal might not exist after we reboot. The next
-** STQLite to access the file will not know that the journal exists (because
+** SQLite to access the file will not know that the journal exists (because
** the directory entry for the journal was never created) and the transaction
** will not roll back - possibly leading to database corruption.
*/
@@ -14179,12 +14179,12 @@ static int unixSync(OsFile *id, int dataOnly){
rc = full_fsync(pFile->h, pFile->fullSync, dataOnly);
SimulateIOError( rc=1 );
if( rc ){
- return STQLITE_IOERR_FSYNC;
+ return SQLITE_IOERR_FSYNC;
}
if( pFile->dirfd>=0 ){
OSTRACE4("DIRSYNC %-3d (have_fullfsync=%d fullsync=%d)\n", pFile->dirfd,
HAVE_FULLFSYNC, pFile->fullSync);
-#ifndef STQLITE_DISABLE_DIRSYNC
+#ifndef SQLITE_DISABLE_DIRSYNC
/* The directory sync is only attempted if full_fsync is
** turned off or unavailable. If a full_fsync occurred above,
** then the directory sync is superfluous.
@@ -14196,13 +14196,13 @@ static int unixSync(OsFile *id, int dataOnly){
** A failed directory sync is not a big deal. So it seems
** better to ignore the error. Ticket #1657
*/
- /* return STQLITE_IOERR; */
+ /* return SQLITE_IOERR; */
}
#endif
close(pFile->dirfd); /* Only need to sync once, so close the directory */
pFile->dirfd = -1; /* when we are done. */
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -14213,24 +14213,24 @@ static int unixSync(OsFile *id, int dataOnly){
** before making changes to individual journals on a multi-database commit.
** The F_FULLFSYNC option is not needed here.
*/
-STQLITE_PRIVATE int sqlite3UnixSyncDirectory(const char *zDirname){
-#ifdef STQLITE_DISABLE_DIRSYNC
- return STQLITE_OK;
+SQLITE_PRIVATE int sqlite3UnixSyncDirectory(const char *zDirname){
+#ifdef SQLITE_DISABLE_DIRSYNC
+ return SQLITE_OK;
#else
int fd;
int r;
fd = open(zDirname, O_RDONLY|O_BINARY, 0);
OSTRACE3("DIRSYNC %-3d (%s)\n", fd, zDirname);
if( fd<0 ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
r = fsync(fd);
close(fd);
SimulateIOError( r=1 );
if( r ){
- return STQLITE_IOERR_DIR_FSYNC;
+ return SQLITE_IOERR_DIR_FSYNC;
}else{
- return STQLITE_OK;
+ return SQLITE_OK;
}
#endif
}
@@ -14244,9 +14244,9 @@ static int unixTruncate(OsFile *id, i64 nByte){
rc = ftruncate(((unixFile*)id)->h, (off_t)nByte);
SimulateIOError( rc=1 );
if( rc ){
- return STQLITE_IOERR_TRUNCATE;
+ return SQLITE_IOERR_TRUNCATE;
}else{
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
@@ -14260,10 +14260,10 @@ static int unixFileSize(OsFile *id, i64 *pSize){
rc = fstat(((unixFile*)id)->h, &buf);
SimulateIOError( rc=1 );
if( rc!=0 ){
- return STQLITE_IOERR_FSTAT;
+ return SQLITE_IOERR_FSTAT;
}
*pSize = buf.st_size;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -14332,7 +14332,7 @@ static int unixLock(OsFile *id, int locktype){
/* The following describes the implementation of the various locks and
** lock transitions in terms of the POSIX advisory shared and exclusive
** lock primitives (called read-locks and write-locks below, to avoid
- ** confusion with STQLite lock names). The algorithms are complicated
+ ** confusion with SQLite lock names). The algorithms are complicated
** slightly in order to be compatible with windows systems simultaneously
** accessing the same database file, in case that is ever required.
**
@@ -14367,7 +14367,7 @@ static int unixLock(OsFile *id, int locktype){
** locking a random byte from a range, concurrent SHARED locks may exist
** even if the locking primitive used is always a write-lock.
*/
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
unixFile *pFile = (unixFile*)id;
struct lockInfo *pLock = pFile->pLock;
struct flock lock;
@@ -14385,7 +14385,7 @@ static int unixLock(OsFile *id, int locktype){
if( pFile->locktype>=locktype ){
OSTRACE3("LOCK %d %s ok (already held)\n", pFile->h,
locktypeName(locktype));
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* Make sure the locking sequence is correct
@@ -14401,7 +14401,7 @@ static int unixLock(OsFile *id, int locktype){
/* Make sure the current thread owns the pFile.
*/
rc = transferOwnership(pFile);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3OsLeaveMutex();
return rc;
}
@@ -14413,13 +14413,13 @@ static int unixLock(OsFile *id, int locktype){
if( (pFile->locktype!=pLock->locktype &&
(pLock->locktype>=PENDING_LOCK || locktype>SHARED_LOCK))
){
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
goto end_lock;
}
/* If a SHARED lock is requested, and some thread using this PID already
** has a SHARED or RESERVED lock, then increment reference counts and
- ** return STQLITE_OK.
+ ** return SQLITE_OK.
*/
if( locktype==SHARED_LOCK &&
(pLock->locktype==SHARED_LOCK || pLock->locktype==RESERVED_LOCK) ){
@@ -14447,7 +14447,7 @@ static int unixLock(OsFile *id, int locktype){
lock.l_start = PENDING_BYTE;
s = fcntl(pFile->h, F_SETLK, &lock);
if( s==(-1) ){
- rc = (errno==EINVAL) ? STQLITE_NOLFS : STQLITE_BUSY;
+ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY;
goto end_lock;
}
}
@@ -14470,11 +14470,11 @@ static int unixLock(OsFile *id, int locktype){
lock.l_len = 1L;
lock.l_type = F_UNLCK;
if( fcntl(pFile->h, F_SETLK, &lock)!=0 ){
- rc = STQLITE_IOERR_UNLOCK; /* This should never happen */
+ rc = SQLITE_IOERR_UNLOCK; /* This should never happen */
goto end_lock;
}
if( s==(-1) ){
- rc = (errno==EINVAL) ? STQLITE_NOLFS : STQLITE_BUSY;
+ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY;
}else{
pFile->locktype = SHARED_LOCK;
pFile->pOpen->nLock++;
@@ -14483,7 +14483,7 @@ static int unixLock(OsFile *id, int locktype){
}else if( locktype==EXCLUSIVE_LOCK && pLock->cnt>1 ){
/* We are trying for an exclusive lock but another thread in this
** same process is still holding a shared lock. */
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
}else{
/* The request was for a RESERVED or EXCLUSIVE lock. It is
** assumed that there is a SHARED or greater lock on the file
@@ -14504,11 +14504,11 @@ static int unixLock(OsFile *id, int locktype){
}
s = fcntl(pFile->h, F_SETLK, &lock);
if( s==(-1) ){
- rc = (errno==EINVAL) ? STQLITE_NOLFS : STQLITE_BUSY;
+ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY;
}
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pFile->locktype = locktype;
pLock->locktype = locktype;
}else if( locktype==EXCLUSIVE_LOCK ){
@@ -14519,7 +14519,7 @@ static int unixLock(OsFile *id, int locktype){
end_lock:
sqlite3OsLeaveMutex();
OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype),
- rc==STQLITE_OK ? "ok" : "failed");
+ rc==SQLITE_OK ? "ok" : "failed");
return rc;
}
@@ -14533,7 +14533,7 @@ end_lock:
static int unixUnlock(OsFile *id, int locktype){
struct lockInfo *pLock;
struct flock lock;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
unixFile *pFile = (unixFile*)id;
assert( pFile );
@@ -14542,10 +14542,10 @@ static int unixUnlock(OsFile *id, int locktype){
assert( locktype<=SHARED_LOCK );
if( pFile->locktype<=locktype ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( CHECK_THREADID(pFile) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
sqlite3OsEnterMutex();
pLock = pFile->pLock;
@@ -14559,7 +14559,7 @@ static int unixUnlock(OsFile *id, int locktype){
lock.l_len = SHARED_SIZE;
if( fcntl(pFile->h, F_SETLK, &lock)==(-1) ){
/* This should never happen */
- rc = STQLITE_IOERR_RDLOCK;
+ rc = SQLITE_IOERR_RDLOCK;
}
}
lock.l_type = F_UNLCK;
@@ -14569,7 +14569,7 @@ static int unixUnlock(OsFile *id, int locktype){
if( fcntl(pFile->h, F_SETLK, &lock)!=(-1) ){
pLock->locktype = SHARED_LOCK;
}else{
- rc = STQLITE_IOERR_UNLOCK; /* This should never happen */
+ rc = SQLITE_IOERR_UNLOCK; /* This should never happen */
}
}
if( locktype==NO_LOCK ){
@@ -14587,7 +14587,7 @@ static int unixUnlock(OsFile *id, int locktype){
if( fcntl(pFile->h, F_SETLK, &lock)!=(-1) ){
pLock->locktype = NO_LOCK;
}else{
- rc = STQLITE_IOERR_UNLOCK; /* This should never happen */
+ rc = SQLITE_IOERR_UNLOCK; /* This should never happen */
}
}
@@ -14619,7 +14619,7 @@ static int unixUnlock(OsFile *id, int locktype){
static int unixClose(OsFile **pId){
unixFile *id = (unixFile*)*pId;
- if( !id ) return STQLITE_OK;
+ if( !id ) return SQLITE_OK;
unixUnlock(*pId, NO_LOCK);
if( id->dirfd>=0 ) close(id->dirfd);
id->dirfd = -1;
@@ -14654,11 +14654,11 @@ static int unixClose(OsFile **pId){
OpenCounter(-1);
sqlite3ThreadSafeFree(id);
*pId = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#ifdef STQLITE_ENABLE_LOCKING_STYLE
+#ifdef SQLITE_ENABLE_LOCKING_STYLE
#pragma mark AFP Support
/*
@@ -14750,7 +14750,7 @@ static int afpUnixCheckReservedLock(OsFile *id){
** function comments for details of lock management. */
static int afpUnixLock(OsFile *id, int locktype)
{
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
unixFile *pFile = (unixFile*)id;
afpLockingContext *context = (afpLockingContext *) pFile->lockingContext;
int gotPendingLock = 0;
@@ -14765,7 +14765,7 @@ static int afpUnixLock(OsFile *id, int locktype)
if( pFile->locktype>=locktype ){
OSTRACE3("LOCK %d %s ok (already held)\n", pFile->h,
locktypeName(locktype));
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* Make sure the locking sequence is correct
@@ -14781,7 +14781,7 @@ static int afpUnixLock(OsFile *id, int locktype)
/* Make sure the current thread owns the pFile.
*/
rc = transferOwnership(pFile);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3OsLeaveMutex();
return rc;
}
@@ -14796,7 +14796,7 @@ static int afpUnixLock(OsFile *id, int locktype)
int failed = _AFPFSSetLock(context->filePath, pFile->h,
PENDING_BYTE, 1, 1);
if (failed) {
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
goto afp_end_lock;
}
}
@@ -14817,12 +14817,12 @@ static int afpUnixLock(OsFile *id, int locktype)
/* Drop the temporary PENDING lock */
if (_AFPFSSetLock(context->filePath, pFile->h, PENDING_BYTE, 1, 0)) {
- rc = STQLITE_IOERR_UNLOCK; /* This should never happen */
+ rc = SQLITE_IOERR_UNLOCK; /* This should never happen */
goto afp_end_lock;
}
if( failed ){
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
} else {
pFile->locktype = SHARED_LOCK;
}
@@ -14850,19 +14850,19 @@ static int afpUnixLock(OsFile *id, int locktype)
SHARED_SIZE, 1);
if (failed && _AFPFSSetLock(context->filePath, pFile->h, SHARED_FIRST +
context->sharedLockByte, 1, 1)) {
- rc = STQLITE_IOERR_RDLOCK; /* this should never happen */
+ rc = SQLITE_IOERR_RDLOCK; /* this should never happen */
}
} else {
/* */
- rc = STQLITE_IOERR_UNLOCK; /* this should never happen */
+ rc = SQLITE_IOERR_UNLOCK; /* this should never happen */
}
}
- if( failed && rc == STQLITE_OK){
- rc = STQLITE_BUSY;
+ if( failed && rc == SQLITE_OK){
+ rc = SQLITE_BUSY;
}
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pFile->locktype = locktype;
}else if( locktype==EXCLUSIVE_LOCK ){
pFile->locktype = PENDING_LOCK;
@@ -14871,7 +14871,7 @@ static int afpUnixLock(OsFile *id, int locktype)
afp_end_lock:
sqlite3OsLeaveMutex();
OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype),
- rc==STQLITE_OK ? "ok" : "failed");
+ rc==SQLITE_OK ? "ok" : "failed");
return rc;
}
@@ -14884,7 +14884,7 @@ afp_end_lock:
*/
static int afpUnixUnlock(OsFile *id, int locktype) {
struct flock lock;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
unixFile *pFile = (unixFile*)id;
afpLockingContext *context = (afpLockingContext *) pFile->lockingContext;
@@ -14894,10 +14894,10 @@ static int afpUnixUnlock(OsFile *id, int locktype) {
assert( locktype<=SHARED_LOCK );
if( pFile->locktype<=locktype ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( CHECK_THREADID(pFile) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
sqlite3OsEnterMutex();
if( pFile->locktype>SHARED_LOCK ){
@@ -14913,24 +14913,24 @@ static int afpUnixUnlock(OsFile *id, int locktype) {
if (_AFPFSSetLock(context->filePath, pFile->h, SHARED_FIRST+
context->sharedLockByte, 1, 1)) {
/* failed to re-establish our shared lock */
- rc = STQLITE_IOERR_RDLOCK; /* This should never happen */
+ rc = SQLITE_IOERR_RDLOCK; /* This should never happen */
}
} else {
/* This should never happen - failed to unlock the exclusive range */
- rc = STQLITE_IOERR_UNLOCK;
+ rc = SQLITE_IOERR_UNLOCK;
}
}
}
- if (rc == STQLITE_OK && pFile->locktype>=PENDING_LOCK) {
+ if (rc == SQLITE_OK && pFile->locktype>=PENDING_LOCK) {
if (_AFPFSSetLock(context->filePath, pFile->h, PENDING_BYTE, 1, 0)){
/* failed to release the pending lock */
- rc = STQLITE_IOERR_UNLOCK; /* This should never happen */
+ rc = SQLITE_IOERR_UNLOCK; /* This should never happen */
}
}
- if (rc == STQLITE_OK && pFile->locktype>=RESERVED_LOCK) {
+ if (rc == SQLITE_OK && pFile->locktype>=RESERVED_LOCK) {
if (_AFPFSSetLock(context->filePath, pFile->h, RESERVED_BYTE, 1, 0)) {
/* failed to release the reserved lock */
- rc = STQLITE_IOERR_UNLOCK; /* This should never happen */
+ rc = SQLITE_IOERR_UNLOCK; /* This should never happen */
}
}
}
@@ -14938,10 +14938,10 @@ static int afpUnixUnlock(OsFile *id, int locktype) {
int failed = _AFPFSSetLock(context->filePath, pFile->h,
SHARED_FIRST + context->sharedLockByte, 1, 0);
if (failed) {
- rc = STQLITE_IOERR_UNLOCK; /* This should never happen */
+ rc = SQLITE_IOERR_UNLOCK; /* This should never happen */
}
}
- if (rc == STQLITE_OK)
+ if (rc == SQLITE_OK)
pFile->locktype = locktype;
sqlite3OsLeaveMutex();
return rc;
@@ -14953,7 +14953,7 @@ static int afpUnixUnlock(OsFile *id, int locktype) {
static int afpUnixClose(OsFile **pId) {
unixFile *id = (unixFile*)*pId;
- if( !id ) return STQLITE_OK;
+ if( !id ) return SQLITE_OK;
afpUnixUnlock(*pId, NO_LOCK);
/* free the AFP locking structure */
if (id->lockingContext != NULL) {
@@ -14970,7 +14970,7 @@ static int afpUnixClose(OsFile **pId) {
OpenCounter(-1);
sqlite3ThreadSafeFree(id);
*pId = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
@@ -15005,18 +15005,18 @@ static int flockUnixLock(OsFile *id, int locktype) {
** Just adjust level and punt on outta here. */
if (pFile->locktype > NO_LOCK) {
pFile->locktype = locktype;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* grab an exclusive lock */
int rc = flock(pFile->h, LOCK_EX | LOCK_NB);
if (rc) {
/* didn't get, must be busy */
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
} else {
/* got it, set the type and return ok */
pFile->locktype = locktype;
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
@@ -15027,22 +15027,22 @@ static int flockUnixUnlock(OsFile *id, int locktype) {
/* no-op if possible */
if( pFile->locktype==locktype ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* shared can just be set because we always have an exclusive */
if (locktype==SHARED_LOCK) {
pFile->locktype = locktype;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* no, really, unlock. */
int rc = flock(pFile->h, LOCK_UN);
if (rc)
- return STQLITE_IOERR_UNLOCK;
+ return SQLITE_IOERR_UNLOCK;
else {
pFile->locktype = NO_LOCK;
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
@@ -15052,7 +15052,7 @@ static int flockUnixUnlock(OsFile *id, int locktype) {
static int flockUnixClose(OsFile **pId) {
unixFile *id = (unixFile*)*pId;
- if( !id ) return STQLITE_OK;
+ if( !id ) return SQLITE_OK;
flockUnixUnlock(*pId, NO_LOCK);
if( id->dirfd>=0 ) close(id->dirfd);
@@ -15066,7 +15066,7 @@ static int flockUnixClose(OsFile **pId) {
OpenCounter(-1);
sqlite3ThreadSafeFree(id);
*pId = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
#pragma mark Old-School .lock file based locking
@@ -15111,26 +15111,26 @@ static int dotlockUnixLock(OsFile *id, int locktype) {
/* Always update the timestamp on the old file */
utimes(context->lockPath,NULL);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* check to see if lock file already exists */
struct stat statBuf;
if (lstat(context->lockPath,&statBuf) == 0){
- return STQLITE_BUSY; /* it does, busy */
+ return SQLITE_BUSY; /* it does, busy */
}
/* grab an exclusive lock */
int fd = open(context->lockPath,O_RDONLY|O_CREAT|O_EXCL,0600);
if (fd < 0) {
/* failed to open/create the file, someone else may have stolen the lock */
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
}
close(fd);
/* got it, set the type and return ok */
pFile->locktype = locktype;
- return STQLITE_OK;
+ return SQLITE_OK;
}
static int dotlockUnixUnlock(OsFile *id, int locktype) {
@@ -15142,19 +15142,19 @@ static int dotlockUnixUnlock(OsFile *id, int locktype) {
/* no-op if possible */
if( pFile->locktype==locktype ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* shared can just be set because we always have an exclusive */
if (locktype==SHARED_LOCK) {
pFile->locktype = locktype;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* no, really, unlock. */
unlink(context->lockPath);
pFile->locktype = NO_LOCK;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -15163,7 +15163,7 @@ static int dotlockUnixUnlock(OsFile *id, int locktype) {
static int dotlockUnixClose(OsFile **pId) {
unixFile *id = (unixFile*)*pId;
- if( !id ) return STQLITE_OK;
+ if( !id ) return SQLITE_OK;
dotlockUnixUnlock(*pId, NO_LOCK);
/* free the dotlock locking structure */
if (id->lockingContext != NULL) {
@@ -15185,7 +15185,7 @@ static int dotlockUnixClose(OsFile **pId) {
OpenCounter(-1);
sqlite3ThreadSafeFree(id);
*pId = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
@@ -15201,11 +15201,11 @@ static int nolockUnixCheckReservedLock(OsFile *id) {
}
static int nolockUnixLock(OsFile *id, int locktype) {
- return STQLITE_OK;
+ return SQLITE_OK;
}
static int nolockUnixUnlock(OsFile *id, int locktype) {
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -15214,7 +15214,7 @@ static int nolockUnixUnlock(OsFile *id, int locktype) {
static int nolockUnixClose(OsFile **pId) {
unixFile *id = (unixFile*)*pId;
- if( !id ) return STQLITE_OK;
+ if( !id ) return SQLITE_OK;
if( id->dirfd>=0 ) close(id->dirfd);
id->dirfd = -1;
sqlite3OsEnterMutex();
@@ -15227,10 +15227,10 @@ static int nolockUnixClose(OsFile **pId) {
OpenCounter(-1);
sqlite3ThreadSafeFree(id);
*pId = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#endif /* STQLITE_ENABLE_LOCKING_STYLE */
+#endif /* SQLITE_ENABLE_LOCKING_STYLE */
/*
** Turn a relative pathname into a full pathname. Return a pointer
@@ -15238,7 +15238,7 @@ static int nolockUnixClose(OsFile **pId) {
** The calling function is responsible for freeing this space once it
** is no longer needed.
*/
-STQLITE_PRIVATE char *sqlite3UnixFullPathname(const char *zRelative){
+SQLITE_PRIVATE char *sqlite3UnixFullPathname(const char *zRelative){
char *zFull = 0;
if( zRelative[0]=='/' ){
sqlite3SetString(&zFull, zRelative, (char*)0);
@@ -15309,13 +15309,13 @@ static int unixLockState(OsFile *id){
** the specified file. This is almost always 512 bytes, but may be
** larger for some devices.
**
-** STQLite code assumes this function cannot fail. It also assumes that
+** SQLite code assumes this function cannot fail. It also assumes that
** if two files are created in the same file-system directory (i.e.
** a database and it's journal file) that the sector size will be the
** same for both.
*/
static int unixSectorSize(OsFile *id){
- return STQLITE_DEFAULT_SECTOR_SIZE;
+ return SQLITE_DEFAULT_SECTOR_SIZE;
}
/*
@@ -15340,7 +15340,7 @@ static const IoMethod sqlite3UnixIoMethod = {
unixSectorSize,
};
-#ifdef STQLITE_ENABLE_LOCKING_STYLE
+#ifdef SQLITE_ENABLE_LOCKING_STYLE
/*
** This vector defines all the methods that can operate on an OsFile
** for unix with AFP style file locking.
@@ -15429,14 +15429,14 @@ static const IoMethod sqlite3NolockLockingUnixIoMethod = {
unixSectorSize,
};
-#endif /* STQLITE_ENABLE_LOCKING_STYLE */
+#endif /* SQLITE_ENABLE_LOCKING_STYLE */
/*
** Allocate memory for a new unixFile and initialize that unixFile.
** Write a pointer to the new unixFile into *pId.
** If we run out of memory, close the file and return an error.
*/
-#ifdef STQLITE_ENABLE_LOCKING_STYLE
+#ifdef SQLITE_ENABLE_LOCKING_STYLE
/*
** When locking extensions are enabled, the filepath and locking style
** are needed to determine the unixFile pMethod to use for locking operations.
@@ -15463,7 +15463,7 @@ static int allocateUnixFile(
if( rc ){
close(h);
unlink(zFilename);
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
} else {
/* pLock and pOpen are only used for posix advisory locking */
@@ -15484,7 +15484,7 @@ static int allocateUnixFile(
releaseOpenCnt(f.pOpen);
sqlite3OsLeaveMutex();
*pId = 0;
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}else{
*pNew = f;
switch(lockingStyle) {
@@ -15533,10 +15533,10 @@ static int allocateUnixFile(
}
*pId = (OsFile*)pNew;
OpenCounter(+1);
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
-#else /* STQLITE_ENABLE_LOCKING_STYLE */
+#else /* SQLITE_ENABLE_LOCKING_STYLE */
static int allocateUnixFile(
int h, /* Open file descriptor on file being opened */
OsFile **pId, /* Write the resul unixFile structure here */
@@ -15559,7 +15559,7 @@ static int allocateUnixFile(
}
if( rc ){
close(h);
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
OSTRACE3("OPEN %-3d %s\n", h, zFilename);
f.dirfd = -1;
@@ -15573,47 +15573,47 @@ static int allocateUnixFile(
releaseOpenCnt(f.pOpen);
sqlite3OsLeaveMutex();
*pId = 0;
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}else{
*pNew = f;
pNew->pMethod = &sqlite3UnixIoMethod;
*pId = (OsFile*)pNew;
OpenCounter(+1);
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
-#endif /* STQLITE_ENABLE_LOCKING_STYLE */
+#endif /* SQLITE_ENABLE_LOCKING_STYLE */
-#endif /* STQLITE_OMIT_DISKIO */
+#endif /* SQLITE_OMIT_DISKIO */
/***************************************************************************
** Everything above deals with file I/O. Everything that follows deals
** with other miscellanous aspects of the operating system interface
****************************************************************************/
-#ifndef STQLITE_OMIT_LOAD_EXTENSION
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
/*
** Interfaces for opening a shared library, finding entry points
** within the shared library, and closing the shared library.
*/
#include <dlfcn.h>
-STQLITE_PRIVATE void *sqlite3UnixDlopen(const char *zFilename){
+SQLITE_PRIVATE void *sqlite3UnixDlopen(const char *zFilename){
return dlopen(zFilename, RTLD_NOW | RTLD_GLOBAL);
}
-STQLITE_PRIVATE void *sqlite3UnixDlsym(void *pHandle, const char *zSymbol){
+SQLITE_PRIVATE void *sqlite3UnixDlsym(void *pHandle, const char *zSymbol){
return dlsym(pHandle, zSymbol);
}
-STQLITE_PRIVATE int sqlite3UnixDlclose(void *pHandle){
+SQLITE_PRIVATE int sqlite3UnixDlclose(void *pHandle){
return dlclose(pHandle);
}
-#endif /* STQLITE_OMIT_LOAD_EXTENSION */
+#endif /* SQLITE_OMIT_LOAD_EXTENSION */
/*
** Get information to seed the random number generator. The seed
** is written into the buffer zBuf[256]. The calling function must
** supply a sufficiently large buffer.
*/
-STQLITE_PRIVATE int sqlite3UnixRandomSeed(char *zBuf){
+SQLITE_PRIVATE int sqlite3UnixRandomSeed(char *zBuf){
/* We have to initialize zBuf to prevent valgrind from reporting
** errors. The reports issued by valgrind are incorrect - we would
** prefer that the randomness be increased by making use of the
@@ -15627,7 +15627,7 @@ STQLITE_PRIVATE int sqlite3UnixRandomSeed(char *zBuf){
** tests repeatable.
*/
memset(zBuf, 0, 256);
-#if !defined(STQLITE_TEST)
+#if !defined(SQLITE_TEST)
{
int pid, fd;
fd = open("/dev/urandom", O_RDONLY);
@@ -15643,14 +15643,14 @@ STQLITE_PRIVATE int sqlite3UnixRandomSeed(char *zBuf){
}
}
#endif
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Sleep for a little while. Return the amount of time slept.
** The argument is the number of milliseconds we want to sleep.
*/
-STQLITE_PRIVATE int sqlite3UnixSleep(int ms){
+SQLITE_PRIVATE int sqlite3UnixSleep(int ms){
#if defined(HAVE_USLEEP) && HAVE_USLEEP
usleep(ms*1000);
return ms;
@@ -15676,7 +15676,7 @@ STQLITE_PRIVATE int sqlite3UnixSleep(int ms){
** access rules apply as for inMutex.
**
** mutexMain The main mutex. Hold this mutex in order to get exclusive
-** access to STQLite data structures.
+** access to SQLite data structures.
**
** mutexAux An auxiliary mutex needed to access variables defined above.
**
@@ -15692,7 +15692,7 @@ STQLITE_PRIVATE int sqlite3UnixSleep(int ms){
** safer to protect them using mutexAux.
*/
static int inMutex = 0;
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
static pthread_t mutexOwner; /* Thread holding mutexMain */
static int mutexOwnerValid = 0; /* True if mutexOwner is valid */
static pthread_mutex_t mutexMain = PTHREAD_MUTEX_INITIALIZER; /* The mutex */
@@ -15704,13 +15704,13 @@ static pthread_mutex_t mutexAux = PTHREAD_MUTEX_INITIALIZER; /* Aux mutex */
** multi-threaded processes. Only a single thread is allowed to
** executed code that is surrounded by EnterMutex() and LeaveMutex().
**
-** STQLite uses only a single Mutex. There is not much critical
+** SQLite uses only a single Mutex. There is not much critical
** code and what little there is executes quickly and without blocking.
**
** As of version 3.3.2, this mutex must be recursive.
*/
-STQLITE_PRIVATE void sqlite3UnixEnterMutex(){
-#ifdef STQLITE_UNIX_THREADS
+SQLITE_PRIVATE void sqlite3UnixEnterMutex(){
+#ifdef SQLITE_UNIX_THREADS
pthread_mutex_lock(&mutexAux);
if( !mutexOwnerValid || !pthread_equal(mutexOwner, pthread_self()) ){
pthread_mutex_unlock(&mutexAux);
@@ -15727,9 +15727,9 @@ STQLITE_PRIVATE void sqlite3UnixEnterMutex(){
inMutex++;
#endif
}
-STQLITE_PRIVATE void sqlite3UnixLeaveMutex(){
+SQLITE_PRIVATE void sqlite3UnixLeaveMutex(){
assert( inMutex>0 );
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
pthread_mutex_lock(&mutexAux);
inMutex--;
assert( pthread_equal(mutexOwner, pthread_self()) );
@@ -15751,8 +15751,8 @@ STQLITE_PRIVATE void sqlite3UnixLeaveMutex(){
** calling thread holds the mutex. If the parameter is false, return
** true if any thread holds the mutex.
*/
-STQLITE_PRIVATE int sqlite3UnixInMutex(int thisThrd){
-#ifdef STQLITE_UNIX_THREADS
+SQLITE_PRIVATE int sqlite3UnixInMutex(int thisThrd){
+#ifdef SQLITE_UNIX_THREADS
int rc;
pthread_mutex_lock(&mutexAux);
rc = inMutex>0 && (thisThrd==0 || pthread_equal(mutexOwner,pthread_self()));
@@ -15768,9 +15768,9 @@ STQLITE_PRIVATE int sqlite3UnixInMutex(int thisThrd){
** Use this to verify that we are not leaking thread-specific-data.
** Ticket #1601
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_tsd_count = 0;
-# ifdef STQLITE_UNIX_THREADS
+# ifdef SQLITE_UNIX_THREADS
static pthread_mutex_t tsd_counter_mutex = PTHREAD_MUTEX_INITIALIZER;
# define TSD_COUNTER(N) \
pthread_mutex_lock(&tsd_counter_mutex); \
@@ -15797,10 +15797,10 @@ int sqlite3_tsd_count = 0;
** Return a pointer to the thread specific data or NULL if it is
** unallocated or gets deallocated.
*/
-STQLITE_PRIVATE ThreadData *sqlite3UnixThreadSpecificData(int allocateFlag){
+SQLITE_PRIVATE ThreadData *sqlite3UnixThreadSpecificData(int allocateFlag){
static const ThreadData zeroData = {0}; /* Initializer to silence warnings
** from broken compilers */
-#ifdef STQLITE_UNIX_THREADS
+#ifdef SQLITE_UNIX_THREADS
static pthread_key_t key;
static int keyInit = 0;
ThreadData *pTsd;
@@ -15825,7 +15825,7 @@ STQLITE_PRIVATE ThreadData *sqlite3UnixThreadSpecificData(int allocateFlag){
if( !sqlite3TestMallocFail() ){
pTsd = sqlite3OsMalloc(sizeof(zeroData));
}
-#ifdef STQLITE_MEMDEBUG
+#ifdef SQLITE_MEMDEBUG
sqlite3_isFail = 0;
#endif
if( pTsd ){
@@ -15849,7 +15849,7 @@ STQLITE_PRIVATE ThreadData *sqlite3UnixThreadSpecificData(int allocateFlag){
if( !sqlite3TestMallocFail() ){
pTsd = sqlite3OsMalloc( sizeof(zeroData) );
}
-#ifdef STQLITE_MEMDEBUG
+#ifdef SQLITE_MEMDEBUG
sqlite3_isFail = 0;
#endif
if( pTsd ){
@@ -15871,7 +15871,7 @@ STQLITE_PRIVATE ThreadData *sqlite3UnixThreadSpecificData(int allocateFlag){
** The following variable, if set to a non-zero value, becomes the result
** returned from sqlite3OsCurrentTime(). This is used for testing.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_current_time = 0;
#endif
@@ -15880,7 +15880,7 @@ int sqlite3_current_time = 0;
** current time and date as a Julian Day number into *prNow and
** return 0. Return 1 if the time and date cannot be found.
*/
-STQLITE_PRIVATE int sqlite3UnixCurrentTime(double *prNow){
+SQLITE_PRIVATE int sqlite3UnixCurrentTime(double *prNow){
#ifdef NO_GETTOD
time_t t;
time(&t);
@@ -15890,7 +15890,7 @@ STQLITE_PRIVATE int sqlite3UnixCurrentTime(double *prNow){
gettimeofday(&sNow, 0);
*prNow = 2440587.5 + sNow.tv_sec/86400.0 + sNow.tv_usec/86400000000.0;
#endif
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
if( sqlite3_current_time ){
*prNow = sqlite3_current_time/86400.0 + 2440587.5;
}
@@ -15928,7 +15928,7 @@ STQLITE_PRIVATE int sqlite3UnixCurrentTime(double *prNow){
** Macros used to determine whether or not to use threads.
*/
#if defined(THREADSAFE) && THREADSAFE
-# define STQLITE_W32_THREADS 1
+# define SQLITE_W32_THREADS 1
#endif
/*
@@ -15958,11 +15958,11 @@ STQLITE_PRIVATE int sqlite3UnixCurrentTime(double *prNow){
/*
** At least two bugs have slipped in because we changed the MEMORY_DEBUG
-** macro to STQLITE_DEBUG and some older makefiles have not yet made the
+** macro to SQLITE_DEBUG and some older makefiles have not yet made the
** switch. The following code should catch this problem at compile-time.
*/
#ifdef MEMORY_DEBUG
-# error "The MEMORY_DEBUG macro is obsolete. Use STQLITE_DEBUG instead."
+# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
#endif
@@ -15970,12 +15970,12 @@ STQLITE_PRIVATE int sqlite3UnixCurrentTime(double *prNow){
* When testing, this global variable stores the location of the
* pending-byte in the database file.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
unsigned int sqlite3_pending_byte = 0x40000000;
#endif
int sqlite3_os_trace = 0;
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
#define OSTRACE1(X) if( sqlite3_os_trace ) sqlite3DebugPrintf(X)
#define OSTRACE2(X,Y) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y)
#define OSTRACE3(X,Y,Z) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z)
@@ -15999,7 +15999,7 @@ int sqlite3_os_trace = 0;
** Macros for performance tracing. Normally turned off. Only works
** on i486 hardware.
*/
-#ifdef STQLITE_PERFORMANCE_TRACE
+#ifdef SQLITE_PERFORMANCE_TRACE
__inline__ unsigned long long int hwtime(void){
unsigned long long int x;
__asm__("rdtsc\n\t"
@@ -16019,11 +16019,11 @@ static unsigned int elapse;
#endif
/*
-** If we compile with the STQLITE_TEST macro set, then the following block
+** If we compile with the SQLITE_TEST macro set, then the following block
** of code will give us the ability to simulate a disk I/O error. This
** is used for testing the I/O recovery logic.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_io_error_hit = 0;
int sqlite3_io_error_pending = 0;
int sqlite3_io_error_persist = 0;
@@ -16057,7 +16057,7 @@ static void local_ioerr(){
/*
** When testing, keep a count of the number of open files.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_open_file_count = 0;
#define OpenCounter(X) sqlite3_open_file_count+=(X)
#else
@@ -16082,8 +16082,8 @@ int sqlite3_open_file_count = 0;
** If neither memory-management or debugging is enabled, the second
** set of implementations is used instead.
*/
-#if defined(STQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (STQLITE_MEMDEBUG)
-STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (SQLITE_MEMDEBUG)
+SQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
char *p = (char *)malloc(n+8);
assert(n>0);
assert(sizeof(int)<=8);
@@ -16093,7 +16093,7 @@ STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
}
return (void *)p;
}
-STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
+SQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
char *p2 = ((char *)p - 8);
assert(n>0);
p2 = (char*)realloc(p2, n+8);
@@ -16103,29 +16103,29 @@ STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
}
return (void *)p2;
}
-STQLITE_PRIVATE void sqlite3GenericFree(void *p){
+SQLITE_PRIVATE void sqlite3GenericFree(void *p){
assert(p);
free((void *)((char *)p - 8));
}
-STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){
+SQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){
return p ? *(int *)((char *)p - 8) : 0;
}
#else
-STQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
+SQLITE_PRIVATE void *sqlite3GenericMalloc(int n){
char *p = (char *)malloc(n);
return (void *)p;
}
-STQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
+SQLITE_PRIVATE void *sqlite3GenericRealloc(void *p, int n){
assert(n>0);
p = realloc(p, n);
return p;
}
-STQLITE_PRIVATE void sqlite3GenericFree(void *p){
+SQLITE_PRIVATE void sqlite3GenericFree(void *p){
assert(p);
free(p);
}
/* Never actually used, but needed for the linker */
-STQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
+SQLITE_PRIVATE int sqlite3GenericAllocationSize(void *p){ return 0; }
#endif
/*
@@ -16184,10 +16184,10 @@ struct winFile {
/*
** Do not include any of the File I/O interface procedures if the
-** STQLITE_OMIT_DISKIO macro is defined (indicating that there database
+** SQLITE_OMIT_DISKIO macro is defined (indicating that there database
** will be in-memory only)
*/
-#ifndef STQLITE_OMIT_DISKIO
+#ifndef SQLITE_OMIT_DISKIO
/*
** The following variable is (normally) set once and never changes
@@ -16698,14 +16698,14 @@ static void *convertUtf8Filename(const char *zFilename){
** up and returning an error.
*/
#define MX_DELETION_ATTEMPTS 3
-STQLITE_PRIVATE int sqlite3WinDelete(const char *zFilename){
+SQLITE_PRIVATE int sqlite3WinDelete(const char *zFilename){
int cnt = 0;
int rc;
void *zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
- SimulateIOError(return STQLITE_IOERR_DELETE);
+ SimulateIOError(return SQLITE_IOERR_DELETE);
if( isNT() ){
do{
rc = DeleteFileW(zConverted);
@@ -16713,7 +16713,7 @@ STQLITE_PRIVATE int sqlite3WinDelete(const char *zFilename){
&& cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
}else{
#if OS_WINCE
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
#else
do{
rc = DeleteFileA(zConverted);
@@ -16723,23 +16723,23 @@ STQLITE_PRIVATE int sqlite3WinDelete(const char *zFilename){
}
sqliteFree(zConverted);
OSTRACE2("DELETE \"%s\"\n", zFilename);
- return rc!=0 ? STQLITE_OK : STQLITE_IOERR;
+ return rc!=0 ? SQLITE_OK : SQLITE_IOERR;
}
/*
** Return TRUE if the named file exists.
*/
-STQLITE_PRIVATE int sqlite3WinFileExists(const char *zFilename){
+SQLITE_PRIVATE int sqlite3WinFileExists(const char *zFilename){
int exists = 0;
void *zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
if( isNT() ){
exists = GetFileAttributesW((WCHAR*)zConverted) != 0xffffffff;
}else{
#if OS_WINCE
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
#else
exists = GetFileAttributesA((char*)zConverted) != 0xffffffff;
#endif
@@ -16759,12 +16759,12 @@ static int allocateWinFile(winFile *pInit, OsFile **pId);
** On success, a handle for the open file is written to *id
** and *pReadonly is set to 0 if the file was opened for reading and
** writing or 1 if the file was opened read-only. The function returns
-** STQLITE_OK.
+** SQLITE_OK.
**
-** On failure, the function returns STQLITE_CANTOPEN and leaves
+** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id and *pReadonly unchanged.
*/
-STQLITE_PRIVATE int sqlite3WinOpenReadWrite(
+SQLITE_PRIVATE int sqlite3WinOpenReadWrite(
const char *zFilename,
OsFile **pId,
int *pReadonly
@@ -16773,7 +16773,7 @@ STQLITE_PRIVATE int sqlite3WinOpenReadWrite(
HANDLE h;
void *zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
assert( *pId==0 );
@@ -16797,7 +16797,7 @@ STQLITE_PRIVATE int sqlite3WinOpenReadWrite(
);
if( h==INVALID_HANDLE_VALUE ){
sqliteFree(zConverted);
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
*pReadonly = 1;
}else{
@@ -16807,12 +16807,12 @@ STQLITE_PRIVATE int sqlite3WinOpenReadWrite(
if (!winceCreateLock(zFilename, &f)){
CloseHandle(h);
sqliteFree(zConverted);
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
#endif
}else{
#if OS_WINCE
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
#else
h = CreateFileA((char*)zConverted,
GENERIC_READ | GENERIC_WRITE,
@@ -16833,7 +16833,7 @@ STQLITE_PRIVATE int sqlite3WinOpenReadWrite(
);
if( h==INVALID_HANDLE_VALUE ){
sqliteFree(zConverted);
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
*pReadonly = 1;
}else{
@@ -16863,9 +16863,9 @@ STQLITE_PRIVATE int sqlite3WinOpenReadWrite(
** If delFlag is true, then make arrangements to automatically delete
** the file when it is closed.
**
-** On success, write the file handle into *id and return STQLITE_OK.
+** On success, write the file handle into *id and return SQLITE_OK.
**
-** On failure, return STQLITE_CANTOPEN.
+** On failure, return SQLITE_CANTOPEN.
**
** Sometimes if we have just deleted a prior journal file, windows
** will fail to open a new one because there is a "pending delete".
@@ -16873,13 +16873,13 @@ STQLITE_PRIVATE int sqlite3WinOpenReadWrite(
** a second open after the first one fails. The whole operation only
** fails if both open attempts are unsuccessful.
*/
-STQLITE_PRIVATE int sqlite3WinOpenExclusive(const char *zFilename, OsFile **pId, int delFlag){
+SQLITE_PRIVATE int sqlite3WinOpenExclusive(const char *zFilename, OsFile **pId, int delFlag){
winFile f;
HANDLE h;
DWORD fileflags;
void *zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
assert( *pId == 0 );
fileflags = FILE_FLAG_RANDOM_ACCESS;
@@ -16902,7 +16902,7 @@ STQLITE_PRIVATE int sqlite3WinOpenExclusive(const char *zFilename, OsFile **pId,
}while( h==INVALID_HANDLE_VALUE && cnt++ < 2 && (Sleep(100), 1) );
}else{
#if OS_WINCE
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
#else
int cnt = 0;
do{
@@ -16926,7 +16926,7 @@ STQLITE_PRIVATE int sqlite3WinOpenExclusive(const char *zFilename, OsFile **pId,
#endif
sqliteFree(zConverted);
if( h==INVALID_HANDLE_VALUE ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
f.h = h;
OSTRACE3("OPEN EX %d \"%s\"\n", h, zFilename);
@@ -16936,16 +16936,16 @@ STQLITE_PRIVATE int sqlite3WinOpenExclusive(const char *zFilename, OsFile **pId,
/*
** Attempt to open a new file for read-only access.
**
-** On success, write the file handle into *id and return STQLITE_OK.
+** On success, write the file handle into *id and return SQLITE_OK.
**
-** On failure, return STQLITE_CANTOPEN.
+** On failure, return SQLITE_CANTOPEN.
*/
-STQLITE_PRIVATE int sqlite3WinOpenReadOnly(const char *zFilename, OsFile **pId){
+SQLITE_PRIVATE int sqlite3WinOpenReadOnly(const char *zFilename, OsFile **pId){
winFile f;
HANDLE h;
void *zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
assert( *pId==0 );
if( isNT() ){
@@ -16959,7 +16959,7 @@ STQLITE_PRIVATE int sqlite3WinOpenReadOnly(const char *zFilename, OsFile **pId){
);
}else{
#if OS_WINCE
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
#else
h = CreateFileA((char*)zConverted,
GENERIC_READ,
@@ -16973,7 +16973,7 @@ STQLITE_PRIVATE int sqlite3WinOpenReadOnly(const char *zFilename, OsFile **pId){
}
sqliteFree(zConverted);
if( h==INVALID_HANDLE_VALUE ){
- return STQLITE_CANTOPEN;
+ return SQLITE_CANTOPEN;
}
f.h = h;
#if OS_WINCE
@@ -16994,62 +16994,62 @@ STQLITE_PRIVATE int sqlite3WinOpenReadOnly(const char *zFilename, OsFile **pId){
** windows since windows does not support hard links.
**
** On success, a handle for a previously open file is at *id is
-** updated with the new directory file descriptor and STQLITE_OK is
+** updated with the new directory file descriptor and SQLITE_OK is
** returned.
**
-** On failure, the function returns STQLITE_CANTOPEN and leaves
+** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id unchanged.
*/
static int winOpenDirectory(
OsFile *id,
const char *zDirname
){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Create a temporary file name in zBuf. zBuf must be big enough to
-** hold at least STQLITE_TEMPNAME_SIZE characters.
+** hold at least SQLITE_TEMPNAME_SIZE characters.
*/
-STQLITE_PRIVATE int sqlite3WinTempFileName(char *zBuf){
+SQLITE_PRIVATE int sqlite3WinTempFileName(char *zBuf){
static char zChars[] =
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPTQRSTUVWXYZ"
"0123456789";
int i, j;
- char zTempPath[STQLITE_TEMPNAME_SIZE];
+ char zTempPath[SQLITE_TEMPNAME_SIZE];
if( sqlite3_temp_directory ){
- strncpy(zTempPath, sqlite3_temp_directory, STQLITE_TEMPNAME_SIZE-30);
- zTempPath[STQLITE_TEMPNAME_SIZE-30] = 0;
+ strncpy(zTempPath, sqlite3_temp_directory, SQLITE_TEMPNAME_SIZE-30);
+ zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0;
}else if( isNT() ){
char *zMulti;
- WCHAR zWidePath[STQLITE_TEMPNAME_SIZE];
- GetTempPathW(STQLITE_TEMPNAME_SIZE-30, zWidePath);
+ WCHAR zWidePath[SQLITE_TEMPNAME_SIZE];
+ GetTempPathW(SQLITE_TEMPNAME_SIZE-30, zWidePath);
zMulti = tqunicodeToUtf8(zWidePath);
if( zMulti ){
- strncpy(zTempPath, zMulti, STQLITE_TEMPNAME_SIZE-30);
- zTempPath[STQLITE_TEMPNAME_SIZE-30] = 0;
+ strncpy(zTempPath, zMulti, SQLITE_TEMPNAME_SIZE-30);
+ zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0;
sqliteFree(zMulti);
}else{
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
}else{
char *zUtf8;
- char zMbcsPath[STQLITE_TEMPNAME_SIZE];
- GetTempPathA(STQLITE_TEMPNAME_SIZE-30, zMbcsPath);
+ char zMbcsPath[SQLITE_TEMPNAME_SIZE];
+ GetTempPathA(SQLITE_TEMPNAME_SIZE-30, zMbcsPath);
zUtf8 = mbcsToUtf8(zMbcsPath);
if( zUtf8 ){
- strncpy(zTempPath, zUtf8, STQLITE_TEMPNAME_SIZE-30);
- zTempPath[STQLITE_TEMPNAME_SIZE-30] = 0;
+ strncpy(zTempPath, zUtf8, SQLITE_TEMPNAME_SIZE-30);
+ zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0;
sqliteFree(zUtf8);
}else{
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
}
for(i=strlen(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){}
zTempPath[i] = 0;
for(;;){
- sqlite3_snprintf(STQLITE_TEMPNAME_SIZE, zBuf,
+ sqlite3_snprintf(SQLITE_TEMPNAME_SIZE, zBuf,
"%s\\"TEMP_FILE_PREFIX, zTempPath);
j = strlen(zBuf);
sqlite3Randomness(15, &zBuf[j]);
@@ -17060,7 +17060,7 @@ STQLITE_PRIVATE int sqlite3WinTempFileName(char *zBuf){
if( !sqlite3OsFileExists(zBuf) ) break;
}
OSTRACE2("TEMP FILENAME: %s\n", zBuf);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -17090,40 +17090,40 @@ static int winClose(OsFile **pId){
sqliteFree(pFile);
*pId = 0;
}
- return rc ? STQLITE_OK : STQLITE_IOERR;
+ return rc ? SQLITE_OK : SQLITE_IOERR;
}
/*
-** Read data from a file into a buffer. Return STQLITE_OK if all
-** bytes were read successfully and STQLITE_IOERR if anything goes
+** Read data from a file into a buffer. Return SQLITE_OK if all
+** bytes were read successfully and SQLITE_IOERR if anything goes
** wrong.
*/
static int winRead(OsFile *id, void *pBuf, int amt){
DWORD got;
assert( id!=0 );
- SimulateIOError(return STQLITE_IOERR_READ);
+ SimulateIOError(return SQLITE_IOERR_READ);
OSTRACE3("READ %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype);
if( !ReadFile(((winFile*)id)->h, pBuf, amt, &got, 0) ){
- return STQLITE_IOERR_READ;
+ return SQLITE_IOERR_READ;
}
if( got==(DWORD)amt ){
- return STQLITE_OK;
+ return SQLITE_OK;
}else{
memset(&((char*)pBuf)[got], 0, amt-got);
- return STQLITE_IOERR_SHORT_READ;
+ return SQLITE_IOERR_SHORT_READ;
}
}
/*
-** Write data from a buffer into a file. Return STQLITE_OK on success
+** Write data from a buffer into a file. Return SQLITE_OK on success
** or some other error code on failure.
*/
static int winWrite(OsFile *id, const void *pBuf, int amt){
int rc = 0;
DWORD wrote;
assert( id!=0 );
- SimulateIOError(return STQLITE_IOERR_READ);
- SimulateDiskfullError(return STQLITE_FULL);
+ SimulateIOError(return SQLITE_IOERR_READ);
+ SimulateDiskfullError(return SQLITE_FULL);
OSTRACE3("WRITE %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype);
assert( amt>0 );
while( amt>0 && (rc = WriteFile(((winFile*)id)->h, pBuf, amt, &wrote, 0))!=0
@@ -17132,9 +17132,9 @@ static int winWrite(OsFile *id, const void *pBuf, int amt){
pBuf = &((char*)pBuf)[wrote];
}
if( !rc || amt>(int)wrote ){
- return STQLITE_FULL;
+ return SQLITE_FULL;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -17152,15 +17152,15 @@ static int winSeek(OsFile *id, i64 offset){
LONG lowerBits = offset & 0xffffffff;
DWORD rc;
assert( id!=0 );
-#ifdef STQLITE_TEST
- if( offset ) SimulateDiskfullError(return STQLITE_FULL);
+#ifdef SQLITE_TEST
+ if( offset ) SimulateDiskfullError(return SQLITE_FULL);
#endif
rc = SetFilePointer(((winFile*)id)->h, lowerBits, &upperBits, FILE_BEGIN);
OSTRACE3("SEEK %d %lld\n", ((winFile*)id)->h, offset);
if( rc==INVALID_SET_FILE_POINTER && GetLastError()!=NO_ERROR ){
- return STQLITE_FULL;
+ return SQLITE_FULL;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -17170,9 +17170,9 @@ static int winSync(OsFile *id, int dataOnly){
assert( id!=0 );
OSTRACE3("SYNC %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype);
if( FlushFileBuffers(((winFile*)id)->h) ){
- return STQLITE_OK;
+ return SQLITE_OK;
}else{
- return STQLITE_IOERR;
+ return SQLITE_IOERR;
}
}
@@ -17180,9 +17180,9 @@ static int winSync(OsFile *id, int dataOnly){
** Sync the directory zDirname. This is a no-op on operating systems other
** than UNIX.
*/
-STQLITE_PRIVATE int sqlite3WinSyncDirectory(const char *zDirname){
- SimulateIOError(return STQLITE_IOERR_READ);
- return STQLITE_OK;
+SQLITE_PRIVATE int sqlite3WinSyncDirectory(const char *zDirname){
+ SimulateIOError(return SQLITE_IOERR_READ);
+ return SQLITE_OK;
}
/*
@@ -17192,10 +17192,10 @@ static int winTruncate(OsFile *id, i64 nByte){
LONG upperBits = nByte>>32;
assert( id!=0 );
OSTRACE3("TRUNCATE %d %lld\n", ((winFile*)id)->h, nByte);
- SimulateIOError(return STQLITE_IOERR_TRUNCATE);
+ SimulateIOError(return SQLITE_IOERR_TRUNCATE);
SetFilePointer(((winFile*)id)->h, nByte, &upperBits, FILE_BEGIN);
SetEndOfFile(((winFile*)id)->h);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -17204,10 +17204,10 @@ static int winTruncate(OsFile *id, i64 nByte){
static int winFileSize(OsFile *id, i64 *pSize){
DWORD upperBits, lowerBits;
assert( id!=0 );
- SimulateIOError(return STQLITE_IOERR_FSTAT);
+ SimulateIOError(return SQLITE_IOERR_FSTAT);
lowerBits = GetFileSize(((winFile*)id)->h, &upperBits);
*pSize = (((i64)upperBits)<<32) + lowerBits;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -17252,12 +17252,12 @@ static int unlockReadLock(winFile *pFile){
return res;
}
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
/*
** Check that a given pathname is a directory and is writable
**
*/
-STQLITE_PRIVATE int sqlite3WinIsDirWritable(char *zDirname){
+SQLITE_PRIVATE int sqlite3WinIsDirWritable(char *zDirname){
int fileAttr;
void *zConverted;
if( zDirname==0 ) return 0;
@@ -17265,7 +17265,7 @@ STQLITE_PRIVATE int sqlite3WinIsDirWritable(char *zDirname){
zConverted = convertUtf8Filename(zDirname);
if( zConverted==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
if( isNT() ){
fileAttr = GetFileAttributesW((WCHAR*)zConverted);
@@ -17283,7 +17283,7 @@ STQLITE_PRIVATE int sqlite3WinIsDirWritable(char *zDirname){
}
return 1;
}
-#endif /* STQLITE_OMIT_PAGER_PRAGMAS */
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
/*
** Lock the file with the lock specified by parameter locktype - one
@@ -17312,7 +17312,7 @@ STQLITE_PRIVATE int sqlite3WinIsDirWritable(char *zDirname){
** must go straight to locking level 0.
*/
static int winLock(OsFile *id, int locktype){
- int rc = STQLITE_OK; /* Return code from subroutines */
+ int rc = SQLITE_OK; /* Return code from subroutines */
int res = 1; /* Result of a windows lock call */
int newLocktype; /* Set id->locktype to this value before exiting */
int gotPendingLock = 0;/* True if we acquired a PENDING lock this time */
@@ -17327,7 +17327,7 @@ static int winLock(OsFile *id, int locktype){
** sqlite3OsEnterMutex() hasn't been called yet.
*/
if( pFile->locktype>=locktype ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* Make sure the locking sequence is correct
@@ -17408,11 +17408,11 @@ static int winLock(OsFile *id, int locktype){
** return the appropriate result code.
*/
if( res ){
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}else{
OSTRACE4("LOCK FAILED %d trying for %d but got %d\n", pFile->h,
locktype, newLocktype);
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
}
pFile->locktype = newLocktype;
return rc;
@@ -17450,11 +17450,11 @@ static int winCheckReservedLock(OsFile *id){
**
** It is not possible for this routine to fail if the second argument
** is NO_LOCK. If the second argument is SHARED_LOCK then this routine
-** might return STQLITE_IOERR;
+** might return SQLITE_IOERR;
*/
static int winUnlock(OsFile *id, int locktype){
int type;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
winFile *pFile = (winFile*)id;
assert( pFile!=0 );
assert( locktype<=SHARED_LOCK );
@@ -17466,7 +17466,7 @@ static int winUnlock(OsFile *id, int locktype){
if( locktype==SHARED_LOCK && !getReadLock(pFile) ){
/* This should never happen. We should always be able to
** reacquire the read lock */
- rc = STQLITE_IOERR_UNLOCK;
+ rc = SQLITE_IOERR_UNLOCK;
}
}
if( type>=RESERVED_LOCK ){
@@ -17488,7 +17488,7 @@ static int winUnlock(OsFile *id, int locktype){
** The calling function is responsible for freeing this space once it
** is no longer needed.
*/
-STQLITE_PRIVATE char *sqlite3WinFullPathname(const char *zRelative){
+SQLITE_PRIVATE char *sqlite3WinFullPathname(const char *zRelative){
char *zFull;
#if defined(__CYGWIN__)
int nByte;
@@ -17559,13 +17559,13 @@ static int winLockState(OsFile *id){
** the specified file. This is almost always 512 bytes, but may be
** larger for some devices.
**
-** STQLite code assumes this function cannot fail. It also assumes that
+** SQLite code assumes this function cannot fail. It also assumes that
** if two files are created in the same file-system directory (i.e.
** a database and it's journal file) that the sector size will be the
** same for both.
*/
static int winSectorSize(OsFile *id){
- return STQLITE_DEFAULT_SECTOR_SIZE;
+ return SQLITE_DEFAULT_SECTOR_SIZE;
}
/*
@@ -17604,7 +17604,7 @@ static int allocateWinFile(winFile *pInit, OsFile **pId){
sqliteFree(pInit->zDeleteOnClose);
#endif
*pId = 0;
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}else{
*pNew = *pInit;
pNew->pMethod = &sqlite3WinIoMethod;
@@ -17612,23 +17612,23 @@ static int allocateWinFile(winFile *pInit, OsFile **pId){
pNew->sharedLockByte = 0;
*pId = (OsFile*)pNew;
OpenCounter(+1);
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
-#endif /* STQLITE_OMIT_DISKIO */
+#endif /* SQLITE_OMIT_DISKIO */
/***************************************************************************
** Everything above deals with file I/O. Everything that follows deals
** with other miscellanous aspects of the operating system interface
****************************************************************************/
-#if !defined(STQLITE_OMIT_LOAD_EXTENSION)
+#if !defined(SQLITE_OMIT_LOAD_EXTENSION)
/*
** Interfaces for opening a shared library, finding entry points
** within the shared library, and closing the shared library.
*/
-STQLITE_PRIVATE void *sqlite3WinDlopen(const char *zFilename){
+SQLITE_PRIVATE void *sqlite3WinDlopen(const char *zFilename){
HANDLE h;
void *zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
@@ -17647,7 +17647,7 @@ STQLITE_PRIVATE void *sqlite3WinDlopen(const char *zFilename){
return (void*)h;
}
-STQLITE_PRIVATE void *sqlite3WinDlsym(void *pHandle, const char *zSymbol){
+SQLITE_PRIVATE void *sqlite3WinDlsym(void *pHandle, const char *zSymbol){
#if OS_WINCE
/* The GetProcAddressA() routine is only available on wince. */
return GetProcAddressA((HANDLE)pHandle, zSymbol);
@@ -17657,17 +17657,17 @@ STQLITE_PRIVATE void *sqlite3WinDlsym(void *pHandle, const char *zSymbol){
return GetProcAddress((HANDLE)pHandle, zSymbol);
#endif
}
-STQLITE_PRIVATE int sqlite3WinDlclose(void *pHandle){
+SQLITE_PRIVATE int sqlite3WinDlclose(void *pHandle){
return FreeLibrary((HANDLE)pHandle);
}
-#endif /* !STQLITE_OMIT_LOAD_EXTENSION */
+#endif /* !SQLITE_OMIT_LOAD_EXTENSION */
/*
** Get information to seed the random number generator. The seed
** is written into the buffer zBuf[256]. The calling function must
** supply a sufficiently large buffer.
*/
-STQLITE_PRIVATE int sqlite3WinRandomSeed(char *zBuf){
+SQLITE_PRIVATE int sqlite3WinRandomSeed(char *zBuf){
/* We have to initialize zBuf to prevent valgrind from reporting
** errors. The reports issued by valgrind are incorrect - we would
** prefer that the randomness be increased by making use of the
@@ -17682,13 +17682,13 @@ STQLITE_PRIVATE int sqlite3WinRandomSeed(char *zBuf){
*/
memset(zBuf, 0, 256);
GetSystemTime((LPSYSTEMTIME)zBuf);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Sleep for a little while. Return the amount of time slept.
*/
-STQLITE_PRIVATE int sqlite3WinSleep(int ms){
+SQLITE_PRIVATE int sqlite3WinSleep(int ms){
Sleep(ms);
return ms;
}
@@ -17697,7 +17697,7 @@ STQLITE_PRIVATE int sqlite3WinSleep(int ms){
** Static variables used for thread synchronization
*/
static int inMutex = 0;
-#ifdef STQLITE_W32_THREADS
+#ifdef SQLITE_W32_THREADS
static DWORD mutexOwner;
static CRITICAL_SECTION cs;
#endif
@@ -17707,14 +17707,14 @@ static int inMutex = 0;
** multi-threaded processes. Only a single thread is allowed to
** executed code that is surrounded by EnterMutex() and LeaveMutex().
**
-** STQLite uses only a single Mutex. There is not much critical
+** SQLite uses only a single Mutex. There is not much critical
** code and what little there is executes quickly and without blocking.
**
** Version 3.3.1 and earlier used a simple mutex. Beginning with
** version 3.3.2, a recursive mutex is required.
*/
-STQLITE_PRIVATE void sqlite3WinEnterMutex(){
-#ifdef STQLITE_W32_THREADS
+SQLITE_PRIVATE void sqlite3WinEnterMutex(){
+#ifdef SQLITE_W32_THREADS
static int isInit = 0;
while( !isInit ){
static long lock = 0;
@@ -17730,10 +17730,10 @@ STQLITE_PRIVATE void sqlite3WinEnterMutex(){
#endif
inMutex++;
}
-STQLITE_PRIVATE void sqlite3WinLeaveMutex(){
+SQLITE_PRIVATE void sqlite3WinLeaveMutex(){
assert( inMutex );
inMutex--;
-#ifdef STQLITE_W32_THREADS
+#ifdef SQLITE_W32_THREADS
assert( mutexOwner==GetCurrentThreadId() );
LeaveCriticalSection(&cs);
#endif
@@ -17746,8 +17746,8 @@ STQLITE_PRIVATE void sqlite3WinLeaveMutex(){
** calling thread holds the mutex. If the parameter is false, return
** true if any thread holds the mutex.
*/
-STQLITE_PRIVATE int sqlite3WinInMutex(int thisThreadOnly){
-#ifdef STQLITE_W32_THREADS
+SQLITE_PRIVATE int sqlite3WinInMutex(int thisThreadOnly){
+#ifdef SQLITE_W32_THREADS
return inMutex>0 && (thisThreadOnly==0 || mutexOwner==GetCurrentThreadId());
#else
return inMutex>0;
@@ -17759,7 +17759,7 @@ STQLITE_PRIVATE int sqlite3WinInMutex(int thisThreadOnly){
** The following variable, if set to a non-zero value, becomes the result
** returned from sqlite3OsCurrentTime(). This is used for testing.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_current_time = 0;
#endif
@@ -17768,7 +17768,7 @@ int sqlite3_current_time = 0;
** current time and date as a Julian Day number into *prNow and
** return 0. Return 1 if the time and date cannot be found.
*/
-STQLITE_PRIVATE int sqlite3WinCurrentTime(double *prNow){
+SQLITE_PRIVATE int sqlite3WinCurrentTime(double *prNow){
FILETIME ft;
/* FILETIME structure is a 64-bit value representing the number of
100-nanosecond intervals since January 1, 1601 (= JD 2305813.5).
@@ -17783,7 +17783,7 @@ STQLITE_PRIVATE int sqlite3WinCurrentTime(double *prNow){
#endif
now = ((double)ft.dwHighDateTime) * 4294967296.0;
*prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5;
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
if( sqlite3_current_time ){
*prNow = sqlite3_current_time/86400.0 + 2440587.5;
}
@@ -17796,7 +17796,7 @@ STQLITE_PRIVATE int sqlite3WinCurrentTime(double *prNow){
** Use this to verify that we are not leaking thread-specific-data.
** Ticket #1601
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_tsd_count = 0;
# define TSD_COUNTER_INCR InterlockedIncrement(&sqlite3_tsd_count)
# define TSD_COUNTER_DECR InterlockedDecrement(&sqlite3_tsd_count)
@@ -17821,7 +17821,7 @@ int sqlite3_tsd_count = 0;
** Return a pointer to the thread specific data or NULL if it is
** unallocated or gets deallocated.
*/
-STQLITE_PRIVATE ThreadData *sqlite3WinThreadSpecificData(int allocateFlag){
+SQLITE_PRIVATE ThreadData *sqlite3WinThreadSpecificData(int allocateFlag){
static int key;
static int keyInit = 0;
static const ThreadData zeroData = {0};
@@ -17884,7 +17884,7 @@ STQLITE_PRIVATE ThreadData *sqlite3WinThreadSpecificData(int allocateFlag){
**
** @(#) $Id: pager.c,v 1.351 2007/07/20 00:33:36 drh Exp $
*/
-#ifndef STQLITE_OMIT_DISKIO
+#ifndef SQLITE_OMIT_DISKIO
/*
** Macros for troubleshooting. Normally turned off
@@ -17970,7 +17970,7 @@ STQLITE_PRIVATE ThreadData *sqlite3WinThreadSpecificData(int allocateFlag){
#define PAGER_SYNCED 5
/*
-** If the STQLITE_BUSY_RESERVED_LOCK macro is set to true at compile-time,
+** If the SQLITE_BUSY_RESERVED_LOCK macro is set to true at compile-time,
** then failed attempts to get a reserved lock will invoke the busy callback.
** This is off by default. To see why, consider the following scenario:
**
@@ -17982,8 +17982,8 @@ STQLITE_PRIVATE ThreadData *sqlite3WinThreadSpecificData(int allocateFlag){
** (if it never invokes its busy callback) then the contention will be
** resolved quickly.
*/
-#ifndef STQLITE_BUSY_RESERVED_LOCK
-# define STQLITE_BUSY_RESERVED_LOCK 0
+#ifndef SQLITE_BUSY_RESERVED_LOCK
+# define SQLITE_BUSY_RESERVED_LOCK 0
#endif
/*
@@ -18097,7 +18097,7 @@ struct PgHdr {
short int nRef; /* Number of users of this page */
PgHdr *pDirty, *pPrevDirty; /* Dirty pages */
u32 notUsed; /* Buffer space */
-#ifdef STQLITE_CHECK_PAGES
+#ifdef SQLITE_CHECK_PAGES
u32 pageHash;
#endif
/* pPager->pageSize bytes of page data follow this header */
@@ -18126,7 +18126,7 @@ struct PgHistory {
/*
** A macro used for invoking the codec if there is one
*/
-#ifdef STQLITE_HAS_CODEC
+#ifdef SQLITE_HAS_CODEC
# define CODEC1(P,D,N,X) if( P->xCodec!=0 ){ P->xCodec(P->pCodecArg,D,N,X); }
# define CODEC2(P,D,N,X) ((char*)(P->xCodec!=0?P->xCodec(P->pCodecArg,D,N,X):D))
#else
@@ -18147,12 +18147,12 @@ struct PgHistory {
/*
** A open page cache is an instance of the following structure.
**
-** Pager.errCode may be set to STQLITE_IOERR, STQLITE_CORRUPT, or
-** or STQLITE_FULL. Once one of the first three errors occurs, it persists
+** Pager.errCode may be set to SQLITE_IOERR, SQLITE_CORRUPT, or
+** or SQLITE_FULL. Once one of the first three errors occurs, it persists
** and is returned as the result of every major pager API call. The
-** STQLITE_FULL return code is slightly different. It persists only until the
+** SQLITE_FULL return code is slightly different. It persists only until the
** next successful rollback is performed on the pager cache. Also,
-** STQLITE_FULL does not affect the sqlite3PagerGet() and sqlite3PagerLookup()
+** SQLITE_FULL does not affect the sqlite3PagerGet() and sqlite3PagerLookup()
** APIs, they may still be used successfully.
*/
struct Pager {
@@ -18209,19 +18209,19 @@ struct Pager {
i64 stmtCksum; /* cksumInit when statement was started */
i64 stmtJSize; /* Size of journal at stmt_begin() */
int sectorSize; /* Assumed sector size during rollback */
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int nHit, nMiss; /* Cache hits and missing */
int nRead, nWrite; /* Database pages read/written */
#endif
void (*xDestructor)(DbPage*,int); /* Call this routine when freeing pages */
void (*xReiniter)(DbPage*,int); /* Call this routine when reloading pages */
-#ifdef STQLITE_HAS_CODEC
+#ifdef SQLITE_HAS_CODEC
void *(*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */
void *pCodecArg; /* First argument to xCodec() */
#endif
int nHash; /* Size of the pager hash table */
PgHdr **aHash; /* Hash table to map page number to PgHdr */
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
Pager *pNext; /* Linked list of pagers in this thread */
#endif
char *pTmpSpace; /* Pager.pageSize bytes of space for tmp use */
@@ -18233,7 +18233,7 @@ struct Pager {
** testing purposes only. These variables do not exist in
** a non-testing build. These variables are not thread-safe.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_pager_readdb_count = 0; /* Number of full pages read from DB */
int sqlite3_pager_writedb_count = 0; /* Number of full pages written to DB */
int sqlite3_pager_writej_count = 0; /* Number of pages written to journal */
@@ -18287,18 +18287,18 @@ static const unsigned char aJournalMagic[] = {
/*
** The macro MEMDB is true if we are dealing with an in-memory database.
-** We do this as a macro so that if the STQLITE_OMIT_MEMORYDB macro is set,
+** We do this as a macro so that if the SQLITE_OMIT_MEMORYDB macro is set,
** the value of MEMDB will be a constant and the compiler will optimize
** out code that would never execute.
*/
-#ifdef STQLITE_OMIT_MEMORYDB
+#ifdef SQLITE_OMIT_MEMORYDB
# define MEMDB 0
#else
# define MEMDB pPager->memDb
#endif
/*
-** Page number PAGER_MJ_PGNO is never used in an STQLite database (it is
+** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is
** reserved for working around a windows/posix incompatibility). It is
** used in the journal to signify that the remainder of the journal file
** is devoted to storing a master journal name - there are no more pages to
@@ -18315,7 +18315,7 @@ static const unsigned char aJournalMagic[] = {
/*
** Enable reference count tracking (for debugging) here:
*/
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
int pager3_refinfo_enable = 0;
static void pager_refinfo(PgHdr *p){
static int cnt = 0;
@@ -18380,7 +18380,7 @@ static void pager_resize_hash_table(Pager *pPager, int N){
/*
** Read a 32-bit integer from the given file descriptor. Store the integer
-** that is read in *pRes. Return STQLITE_OK if everything worked, or an
+** that is read in *pRes. Return SQLITE_OK if everything worked, or an
** error code is something goes wrong.
**
** All values are stored on disk as big-endian.
@@ -18388,7 +18388,7 @@ static void pager_resize_hash_table(Pager *pPager, int N){
static int read32bits(OsFile *fd, u32 *pRes){
unsigned char ac[4];
int rc = sqlite3OsRead(fd, ac, sizeof(ac));
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
*pRes = sqlite3Get4byte(ac);
}
return rc;
@@ -18400,7 +18400,7 @@ static int read32bits(OsFile *fd, u32 *pRes){
#define put32bits(A,B) sqlite3Put4byte((u8*)A,B)
/*
-** Write a 32-bit integer into the given file descriptor. Return STQLITE_OK
+** Write a 32-bit integer into the given file descriptor. Return SQLITE_OK
** on success or an error code is something goes wrong.
*/
static int write32bits(OsFile *fd, u32 val){
@@ -18415,17 +18415,17 @@ static int write32bits(OsFile *fd, u32 val){
** second the error-code about to be returned by a pager API function.
** The value returned is a copy of the second argument to this function.
**
-** If the second argument is STQLITE_IOERR, STQLITE_CORRUPT, or STQLITE_FULL
+** If the second argument is SQLITE_IOERR, SQLITE_CORRUPT, or SQLITE_FULL
** the error becomes persistent. All subsequent API calls on this Pager
** will immediately return the same error code.
*/
static int pager_error(Pager *pPager, int rc){
int rc2 = rc & 0xff;
- assert( pPager->errCode==STQLITE_FULL || pPager->errCode==STQLITE_OK );
+ assert( pPager->errCode==SQLITE_FULL || pPager->errCode==SQLITE_OK );
if(
- rc2==STQLITE_FULL ||
- rc2==STQLITE_IOERR ||
- rc2==STQLITE_CORRUPT
+ rc2==SQLITE_FULL ||
+ rc2==SQLITE_IOERR ||
+ rc2==SQLITE_CORRUPT
){
pPager->errCode = rc;
}
@@ -18433,11 +18433,11 @@ static int pager_error(Pager *pPager, int rc){
}
/*
-** If STQLITE_CHECK_PAGES is defined then we do some sanity checking
+** If SQLITE_CHECK_PAGES is defined then we do some sanity checking
** on the cache using a hash function. This is used for testing
** and debugging only.
*/
-#ifdef STQLITE_CHECK_PAGES
+#ifdef SQLITE_CHECK_PAGES
/*
** Return a 32-bit hash of the page data for pPage.
*/
@@ -18455,7 +18455,7 @@ static u32 pager_pagehash(PgHdr *pPage){
}
/*
-** The CHECK_PAGE macro takes a PgHdr* as an argument. If STQLITE_CHECK_PAGES
+** The CHECK_PAGE macro takes a PgHdr* as an argument. If SQLITE_CHECK_PAGES
** is defined, and NDEBUG is not defined, an assert() statement checks
** that the page is either dirty or still matches the calculated page-hash.
*/
@@ -18476,11 +18476,11 @@ static void checkPage(PgHdr *pPg){
** When this is called the journal file for pager pPager must be open.
** The master journal file name is read from the end of the file and
** written into memory obtained from sqliteMalloc(). *pzMaster is
-** set to point at the memory and STQLITE_OK returned. The caller must
+** set to point at the memory and SQLITE_OK returned. The caller must
** sqliteFree() *pzMaster.
**
** If no master journal file name is present *pzMaster is set to 0 and
-** STQLITE_OK returned.
+** SQLITE_OK returned.
*/
static int readMasterJournal(OsFile *pJrnl, char **pzMaster){
int rc;
@@ -18493,29 +18493,29 @@ static int readMasterJournal(OsFile *pJrnl, char **pzMaster){
*pzMaster = 0;
rc = sqlite3OsFileSize(pJrnl, &szJ);
- if( rc!=STQLITE_OK || szJ<16 ) return rc;
+ if( rc!=SQLITE_OK || szJ<16 ) return rc;
rc = sqlite3OsSeek(pJrnl, szJ-16);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
rc = read32bits(pJrnl, &len);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
rc = read32bits(pJrnl, &cksum);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
rc = sqlite3OsRead(pJrnl, aMagic, 8);
- if( rc!=STQLITE_OK || memcmp(aMagic, aJournalMagic, 8) ) return rc;
+ if( rc!=SQLITE_OK || memcmp(aMagic, aJournalMagic, 8) ) return rc;
rc = sqlite3OsSeek(pJrnl, szJ-16-len);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
*pzMaster = (char *)sqliteMalloc(len+1);
if( !*pzMaster ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
rc = sqlite3OsRead(pJrnl, *pzMaster, len);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqliteFree(*pzMaster);
*pzMaster = 0;
return rc;
@@ -18528,7 +18528,7 @@ static int readMasterJournal(OsFile *pJrnl, char **pzMaster){
if( cksum ){
/* If the checksum doesn't add up, then one or more of the disk sectors
** containing the master journal filename is corrupted. This means
- ** definitely roll back, so just return STQLITE_OK and report a (nul)
+ ** definitely roll back, so just return SQLITE_OK and report a (nul)
** master-journal filename.
*/
sqliteFree(*pzMaster);
@@ -18537,7 +18537,7 @@ static int readMasterJournal(OsFile *pJrnl, char **pzMaster){
(*pzMaster)[len] = '\0';
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -18620,10 +18620,10 @@ static int writeJournalHdr(Pager *pPager){
/* The journal header has been written successfully. Seek the journal
** file descriptor to the end of the journal header sector.
*/
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
IOTRACE(("JTAIL %p %lld\n", pPager, pPager->journalOff-1))
rc = sqlite3OsSeek(pPager->jfd, pPager->journalOff-1);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3OsWrite(pPager->jfd, "\000", 1);
}
}
@@ -18639,10 +18639,10 @@ static int writeJournalHdr(Pager *pPager){
** If the header is read successfully, *nRec is set to the number of
** page records following this header and *dbSize is set to the size of the
** database before the transaction began, in pages. Also, pPager->cksumInit
-** is set to the value read from the journal header. STQLITE_OK is returned
+** is set to the value read from the journal header. SQLITE_OK is returned
** in this case.
**
-** If the journal header file appears to be corrupted, STQLITE_DONE is
+** If the journal header file appears to be corrupted, SQLITE_DONE is
** returned and *nRec and *dbSize are not set. If JOURNAL_HDR_SZ bytes
** cannot be read from the journal file an error code is returned.
*/
@@ -18659,14 +18659,14 @@ static int readJournalHdr(
if( rc ) return rc;
if( pPager->journalOff+JOURNAL_HDR_SZ(pPager) > journalSize ){
- return STQLITE_DONE;
+ return SQLITE_DONE;
}
rc = sqlite3OsRead(pPager->jfd, aMagic, sizeof(aMagic));
if( rc ) return rc;
if( memcmp(aMagic, aJournalMagic, sizeof(aMagic))!=0 ){
- return STQLITE_DONE;
+ return SQLITE_DONE;
}
rc = read32bits(pPager->jfd, pNRec);
@@ -18719,7 +18719,7 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){
u32 cksum = 0;
char zBuf[sizeof(aJournalMagic)+2*4];
- if( !zMaster || pPager->setMaster) return STQLITE_OK;
+ if( !zMaster || pPager->setMaster) return SQLITE_OK;
pPager->setMaster = 1;
len = strlen(zMaster);
@@ -18733,15 +18733,15 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){
*/
if( pPager->fullSync ){
rc = seekJournalHdr(pPager);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
}
pPager->journalOff += (len+20);
rc = write32bits(pPager->jfd, PAGER_MJ_PGNO(pPager));
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
rc = sqlite3OsWrite(pPager->jfd, zMaster, len);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
put32bits(zBuf, len);
put32bits(&zBuf[4], cksum);
@@ -18867,11 +18867,11 @@ static void pager_reset(Pager *pPager){
*/
static int pager_end_transaction(Pager *pPager){
PgHdr *pPg;
- int rc = STQLITE_OK;
- int rc2 = STQLITE_OK;
+ int rc = SQLITE_OK;
+ int rc2 = SQLITE_OK;
assert( !MEMDB );
if( pPager->state<PAGER_RESERVED ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
sqlite3PagerStmtCommit(pPager);
if( pPager->stmtOpen && !pPager->exclusiveMode ){
@@ -18880,14 +18880,14 @@ static int pager_end_transaction(Pager *pPager){
}
if( pPager->journalOpen ){
if( pPager->exclusiveMode
- && (rc = sqlite3OsTruncate(pPager->jfd, 0))==STQLITE_OK ){;
+ && (rc = sqlite3OsTruncate(pPager->jfd, 0))==SQLITE_OK ){;
sqlite3OsSeek(pPager->jfd, 0);
pPager->journalOff = 0;
pPager->journalStarted = 0;
}else{
sqlite3OsClose(&pPager->jfd);
pPager->journalOpen = 0;
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3OsDelete(pPager->zJournal);
}
}
@@ -18898,7 +18898,7 @@ static int pager_end_transaction(Pager *pPager){
pPg->dirty = 0;
pPg->needSync = 0;
pPg->alwaysRollback = 0;
-#ifdef STQLITE_CHECK_PAGES
+#ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg);
#endif
}
@@ -18922,7 +18922,7 @@ static int pager_end_transaction(Pager *pPager){
pPager->pFirstSynced = pPager->pFirst;
pPager->dbSize = -1;
- return (rc==STQLITE_OK?rc2:rc);
+ return (rc==SQLITE_OK?rc2:rc);
}
/*
@@ -18980,9 +18980,9 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
assert( aData );
rc = read32bits(jfd, &pgno);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
rc = sqlite3OsRead(jfd, aData, pPager->pageSize);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
pPager->journalOff += pPager->pageSize + 4;
/* Sanity checking on the page. This is more important that I originally
@@ -18991,17 +18991,17 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
** detect this invalid data (with high probability) and ignore it.
*/
if( pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){
- return STQLITE_DONE;
+ return SQLITE_DONE;
}
if( pgno>(unsigned)pPager->dbSize ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( useCksum ){
rc = read32bits(jfd, &cksum);
if( rc ) return rc;
pPager->journalOff += 4;
if( pager_cksum(pPager, aData)!=cksum ){
- return STQLITE_DONE;
+ return SQLITE_DONE;
}
}
@@ -19040,7 +19040,7 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
PAGERID(pPager), pgno, pager_datahash(pPager->pageSize, aData));
if( pPager->state>=PAGER_EXCLUSIVE && (pPg==0 || pPg->needSync==0) ){
rc = sqlite3OsSeek(pPager->fd, (pgno-1)*(i64)pPager->pageSize);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3OsWrite(pPager->fd, aData, pPager->pageSize);
}
if( pPg ){
@@ -19061,7 +19061,7 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
if( pPager->xReiniter ){
pPager->xReiniter(pPg, pPager->pageSize);
}
-#ifdef STQLITE_CHECK_PAGES
+#ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg);
#endif
/* If this was page 1, then restore the value of Pager.dbFileVers.
@@ -19098,11 +19098,11 @@ static int pager_delmaster(const char *zMaster){
** is running this routine also. Not that it makes too much difference.
*/
rc = sqlite3OsOpenReadOnly(zMaster, &master);
- assert( rc!=STQLITE_OK || master );
- if( rc!=STQLITE_OK ) goto delmaster_out;
+ assert( rc!=SQLITE_OK || master );
+ if( rc!=SQLITE_OK ) goto delmaster_out;
master_open = 1;
rc = sqlite3OsFileSize(master, &nMasterJournal);
- if( rc!=STQLITE_OK ) goto delmaster_out;
+ if( rc!=SQLITE_OK ) goto delmaster_out;
if( nMasterJournal>0 ){
char *zJournal;
@@ -19113,11 +19113,11 @@ static int pager_delmaster(const char *zMaster){
*/
zMasterJournal = (char *)sqliteMalloc(nMasterJournal);
if( !zMasterJournal ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto delmaster_out;
}
rc = sqlite3OsRead(master, zMasterJournal, nMasterJournal);
- if( rc!=STQLITE_OK ) goto delmaster_out;
+ if( rc!=SQLITE_OK ) goto delmaster_out;
zJournal = zMasterJournal;
while( (zJournal-zMasterJournal)<nMasterJournal ){
@@ -19130,14 +19130,14 @@ static int pager_delmaster(const char *zMaster){
int c;
rc = sqlite3OsOpenReadOnly(zJournal, &journal);
- assert( rc!=STQLITE_OK || journal );
- if( rc!=STQLITE_OK ){
+ assert( rc!=SQLITE_OK || journal );
+ if( rc!=SQLITE_OK ){
goto delmaster_out;
}
rc = readMasterJournal(journal, &zMasterPtr);
sqlite3OsClose(&journal);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto delmaster_out;
}
@@ -19172,11 +19172,11 @@ static void pager_truncate_cache(Pager *pPager);
** indicated. Also truncate the cached representation of the file.
*/
static int pager_truncate(Pager *pPager, int nPage){
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
if( pPager->state>=PAGER_EXCLUSIVE ){
rc = sqlite3OsTruncate(pPager->fd, pPager->pageSize*(i64)nPage);
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pPager->dbSize = nPage;
pager_truncate_cache(pPager);
}
@@ -19243,7 +19243,7 @@ static void setSectorSize(Pager *pPager){
** If the file opened as the journal file is not a well-formed
** journal file then all pages up to the first corrupted page are rolled
** back (or no pages if the journal header is corrupted). The journal file
-** is then deleted and STQLITE_OK returned, just as if no corruption had
+** is then deleted and SQLITE_OK returned, just as if no corruption had
** been encountered.
**
** If an I/O or malloc() error occurs, the journal-file is not deleted
@@ -19262,7 +19262,7 @@ static int pager_playback(Pager *pPager, int isHot){
*/
assert( pPager->journalOpen );
rc = sqlite3OsFileSize(pPager->jfd, &szJ);
- if( rc!=STQLITE_OK || szJ==0 ){
+ if( rc!=SQLITE_OK || szJ==0 ){
goto end_playback;
}
@@ -19272,18 +19272,18 @@ static int pager_playback(Pager *pPager, int isHot){
** played back.
*/
rc = readMasterJournal(pPager->jfd, &zMaster);
- assert( rc!=STQLITE_DONE );
- if( rc!=STQLITE_OK || (zMaster && !sqlite3OsFileExists(zMaster)) ){
+ assert( rc!=SQLITE_DONE );
+ if( rc!=SQLITE_OK || (zMaster && !sqlite3OsFileExists(zMaster)) ){
sqliteFree(zMaster);
zMaster = 0;
- if( rc==STQLITE_DONE ) rc = STQLITE_OK;
+ if( rc==SQLITE_DONE ) rc = SQLITE_OK;
goto end_playback;
}
sqlite3OsSeek(pPager->jfd, 0);
pPager->journalOff = 0;
/* This loop terminates either when the readJournalHdr() call returns
- ** STQLITE_DONE or an IO error occurs. */
+ ** SQLITE_DONE or an IO error occurs. */
while( 1 ){
/* Read the next journal header from the journal file. If there are
@@ -19292,9 +19292,9 @@ static int pager_playback(Pager *pPager, int isHot){
** This indicates nothing more needs to be rolled back.
*/
rc = readJournalHdr(pPager, szJ, &nRec, &mxPg);
- if( rc!=STQLITE_OK ){
- if( rc==STQLITE_DONE ){
- rc = STQLITE_OK;
+ if( rc!=SQLITE_OK ){
+ if( rc==SQLITE_DONE ){
+ rc = SQLITE_OK;
}
goto end_playback;
}
@@ -19322,7 +19322,7 @@ static int pager_playback(Pager *pPager, int isHot){
*/
if( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ){
rc = pager_truncate(pPager, mxPg);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto end_playback;
}
}
@@ -19331,9 +19331,9 @@ static int pager_playback(Pager *pPager, int isHot){
*/
for(i=0; i<nRec; i++){
rc = pager_playback_one_page(pPager, pPager->jfd, 1);
- if( rc!=STQLITE_OK ){
- if( rc==STQLITE_DONE ){
- rc = STQLITE_OK;
+ if( rc!=SQLITE_OK ){
+ if( rc==SQLITE_DONE ){
+ rc = SQLITE_OK;
pPager->journalOff = szJ;
break;
}else{
@@ -19346,14 +19346,14 @@ static int pager_playback(Pager *pPager, int isHot){
assert( 0 );
end_playback:
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = pager_end_transaction(pPager);
}
if( zMaster ){
/* If there was a master journal and this routine will return success,
** see if it is possible to delete the master journal.
*/
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = pager_delmaster(zMaster);
}
sqliteFree(zMaster);
@@ -19393,7 +19393,7 @@ static int pager_stmt_playback(Pager *pPager){
{
i64 os_szJ;
rc = sqlite3OsFileSize(pPager->jfd, &os_szJ);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
assert( szJ==os_szJ );
}
#endif
@@ -19427,8 +19427,8 @@ static int pager_stmt_playback(Pager *pPager){
*/
for(i=nRec-1; i>=0; i--){
rc = pager_playback_one_page(pPager, pPager->stfd, 0);
- assert( rc!=STQLITE_DONE );
- if( rc!=STQLITE_OK ) goto end_stmt_playback;
+ assert( rc!=SQLITE_DONE );
+ if( rc!=SQLITE_OK ) goto end_stmt_playback;
}
/* Now roll some pages back from the transaction journal. Pager.stmtJSize
@@ -19440,23 +19440,23 @@ static int pager_stmt_playback(Pager *pPager){
** of the first journal header written during this statement transaction.
*/
rc = sqlite3OsSeek(pPager->jfd, pPager->stmtJSize);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto end_stmt_playback;
}
pPager->journalOff = pPager->stmtJSize;
pPager->cksumInit = pPager->stmtCksum;
while( pPager->journalOff < hdrOff ){
rc = pager_playback_one_page(pPager, pPager->jfd, 1);
- assert( rc!=STQLITE_DONE );
- if( rc!=STQLITE_OK ) goto end_stmt_playback;
+ assert( rc!=SQLITE_DONE );
+ if( rc!=SQLITE_OK ) goto end_stmt_playback;
}
while( pPager->journalOff < szJ ){
u32 nJRec; /* Number of Journal Records */
u32 dummy;
rc = readJournalHdr(pPager, szJ, &nJRec, &dummy);
- if( rc!=STQLITE_OK ){
- assert( rc!=STQLITE_DONE );
+ if( rc!=SQLITE_OK ){
+ assert( rc!=SQLITE_DONE );
goto end_stmt_playback;
}
if( nJRec==0 ){
@@ -19464,15 +19464,15 @@ static int pager_stmt_playback(Pager *pPager){
}
for(i=nJRec-1; i>=0 && pPager->journalOff < szJ; i--){
rc = pager_playback_one_page(pPager, pPager->jfd, 1);
- assert( rc!=STQLITE_DONE );
- if( rc!=STQLITE_OK ) goto end_stmt_playback;
+ assert( rc!=SQLITE_DONE );
+ if( rc!=SQLITE_OK ) goto end_stmt_playback;
}
}
pPager->journalOff = szJ;
end_stmt_playback:
- if( rc==STQLITE_OK) {
+ if( rc==SQLITE_OK) {
pPager->journalOff = szJ;
/* pager_reload_cache(pPager); */
}
@@ -19482,7 +19482,7 @@ end_stmt_playback:
/*
** Change the maximum number of in-memory pages that are allowed.
*/
-STQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager *pPager, int mxPage){
+SQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager *pPager, int mxPage){
if( mxPage>10 ){
pPager->mxPage = mxPage;
}else{
@@ -19516,8 +19516,8 @@ STQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager *pPager, int mxPage){
** Numeric values associated with these states are OFF==1, NORMAL=2,
** and FULL=3.
*/
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
-STQLITE_PRIVATE void sqlite3PagerSetSafetyLevel(Pager *pPager, int level, int full_fsync){
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+SQLITE_PRIVATE void sqlite3PagerSetSafetyLevel(Pager *pPager, int level, int full_fsync){
pPager->noSync = level==1 || pPager->tempFile;
pPager->fullSync = level==3 && !pPager->tempFile;
pPager->full_fsync = full_fsync;
@@ -19530,14 +19530,14 @@ STQLITE_PRIVATE void sqlite3PagerSetSafetyLevel(Pager *pPager, int level, int fu
** attempts to open a temporary file. This information is used for
** testing and analysis only.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_opentemp_count = 0;
#endif
/*
** Open a temporary file.
**
-** Write the file descriptor into *fd. Return STQLITE_OK on success or some
+** Write the file descriptor into *fd. Return SQLITE_OK on success or some
** other error code if we fail.
**
** The OS will automatically delete the temporary file when it is
@@ -19546,17 +19546,17 @@ int sqlite3_opentemp_count = 0;
static int sqlite3PagerOpentemp(OsFile **pFd){
int cnt = 8;
int rc;
- char zFile[STQLITE_TEMPNAME_SIZE];
+ char zFile[SQLITE_TEMPNAME_SIZE];
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
sqlite3_opentemp_count++; /* Used for testing and analysis only */
#endif
do{
cnt--;
sqlite3OsTempFileName(zFile);
rc = sqlite3OsOpenExclusive(zFile, pFd, 1);
- assert( rc!=STQLITE_OK || *pFd );
- }while( cnt>0 && rc!=STQLITE_OK && rc!=STQLITE_NOMEM );
+ assert( rc!=SQLITE_OK || *pFd );
+ }while( cnt>0 && rc!=SQLITE_OK && rc!=SQLITE_NOMEM );
return rc;
}
@@ -19574,7 +19574,7 @@ static int sqlite3PagerOpentemp(OsFile **pFd){
** It is never written to disk. This can be used to implement an
** in-memory database.
*/
-STQLITE_PRIVATE int sqlite3PagerOpen(
+SQLITE_PRIVATE int sqlite3PagerOpen(
Pager **ppPager, /* Return the Pager structure here */
const char *zFilename, /* Name of the database file to open */
int nExtra, /* Extra bytes append to each in-memory page */
@@ -19584,15 +19584,15 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
char *zFullPathname = 0;
int nameLen; /* Compiler is wrong. This is always initialized before use */
OsFile *fd = 0;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
int i;
int tempFile = 0;
int memDb = 0;
int readOnly = 0;
int useJournal = (flags & PAGER_OMIT_JOURNAL)==0;
int noReadlock = (flags & PAGER_NO_READLOCK)!=0;
- char zTemp[STQLITE_TEMPNAME_SIZE];
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+ char zTemp[SQLITE_TEMPNAME_SIZE];
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
/* A malloc() cannot fail in sqlite3ThreadData() as one or more calls to
** malloc() must have already been made by this thread before it gets
** to this point. This means the ThreadData must have been allocated already
@@ -19605,10 +19605,10 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
#endif
/* We used to test if malloc() had already failed before proceeding.
- ** But the way this function is used in STQLite means that can never
+ ** But the way this function is used in SQLite means that can never
** happen. Furthermore, if the malloc-failed flag is already set,
** either the call to sqliteStrDup() or sqliteMalloc() below will
- ** fail shortly and STQLITE_NOMEM returned anyway.
+ ** fail shortly and SQLITE_NOMEM returned anyway.
*/
*ppPager = 0;
@@ -19616,7 +19616,7 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
** memory containing the complete filename (i.e. including the directory).
*/
if( zFilename && zFilename[0] ){
-#ifndef STQLITE_OMIT_MEMORYDB
+#ifndef SQLITE_OMIT_MEMORYDB
if( strcmp(zFilename,":memory:")==0 ){
memDb = 1;
zFullPathname = sqliteStrDup("");
@@ -19626,7 +19626,7 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
zFullPathname = sqlite3OsFullPathname(zFilename);
if( zFullPathname ){
rc = sqlite3OsOpenReadWrite(zFullPathname, &fd, &readOnly);
- assert( rc!=STQLITE_OK || fd );
+ assert( rc!=SQLITE_OK || fd );
}
}
}else{
@@ -19634,7 +19634,7 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
sqlite3OsTempFileName(zTemp);
zFilename = zTemp;
zFullPathname = sqlite3OsFullPathname(zFilename);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
tempFile = 1;
}
}
@@ -19646,8 +19646,8 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
if( zFullPathname ){
nameLen = strlen(zFullPathname);
pPager = sqliteMalloc( sizeof(*pPager) + nameLen*3 + 30 );
- if( pPager && rc==STQLITE_OK ){
- pPager->pTmpSpace = (char *)sqliteMallocRaw(STQLITE_DEFAULT_PAGE_SIZE);
+ if( pPager && rc==SQLITE_OK ){
+ pPager->pTmpSpace = (char *)sqliteMallocRaw(SQLITE_DEFAULT_PAGE_SIZE);
}
}
@@ -19657,11 +19657,11 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
** file. Since the pager is not allocated there is no need to set
** any Pager.errMask variables.
*/
- if( !pPager || !zFullPathname || !pPager->pTmpSpace || rc!=STQLITE_OK ){
+ if( !pPager || !zFullPathname || !pPager->pTmpSpace || rc!=SQLITE_OK ){
sqlite3OsClose(&fd);
sqliteFree(zFullPathname);
sqliteFree(pPager);
- return ((rc==STQLITE_OK)?STQLITE_NOMEM:rc);
+ return ((rc==SQLITE_OK)?SQLITE_NOMEM:rc);
}
PAGERTRACE3("OPEN %d %s\n", FILEHANDLEID(fd), zFullPathname);
@@ -19685,12 +19685,12 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
/* pPager->stmtInUse = 0; */
/* pPager->nRef = 0; */
pPager->dbSize = memDb-1;
- pPager->pageSize = STQLITE_DEFAULT_PAGE_SIZE;
+ pPager->pageSize = SQLITE_DEFAULT_PAGE_SIZE;
/* pPager->stmtSize = 0; */
/* pPager->stmtJSize = 0; */
/* pPager->nPage = 0; */
pPager->mxPage = 100;
- pPager->mxPgno = STQLITE_MAX_PAGE_COUNT;
+ pPager->mxPgno = SQLITE_MAX_PAGE_COUNT;
assert( PAGER_UNLOCK==0 );
/* pPager->state = PAGER_UNLOCK; */
/* pPager->errMask = 0; */
@@ -19715,17 +19715,17 @@ STQLITE_PRIVATE int sqlite3PagerOpen(
/* pPager->pBusyHandler = 0; */
/* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
*ppPager = pPager;
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
pPager->pNext = pTsd->pPager;
pTsd->pPager = pPager;
#endif
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Set the busy handler function.
*/
-STQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager *pPager, BusyHandler *pBusyHandler){
+SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager *pPager, BusyHandler *pBusyHandler){
pPager->pBusyHandler = pBusyHandler;
}
@@ -19737,7 +19737,7 @@ STQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager *pPager, BusyHandler *pBus
** The destructor is not called as a result sqlite3PagerClose().
** Destructors are only called by sqlite3PagerUnref().
*/
-STQLITE_PRIVATE void sqlite3PagerSetDestructor(Pager *pPager, void (*xDesc)(DbPage*,int)){
+SQLITE_PRIVATE void sqlite3PagerSetDestructor(Pager *pPager, void (*xDesc)(DbPage*,int)){
pPager->xDestructor = xDesc;
}
@@ -19748,7 +19748,7 @@ STQLITE_PRIVATE void sqlite3PagerSetDestructor(Pager *pPager, void (*xDesc)(DbPa
** an opportunity to restore the EXTRA section to agree with the restored
** page data.
*/
-STQLITE_PRIVATE void sqlite3PagerSetReiniter(Pager *pPager, void (*xReinit)(DbPage*,int)){
+SQLITE_PRIVATE void sqlite3PagerSetReiniter(Pager *pPager, void (*xReinit)(DbPage*,int)){
pPager->xReiniter = xReinit;
}
@@ -19757,8 +19757,8 @@ STQLITE_PRIVATE void sqlite3PagerSetReiniter(Pager *pPager, void (*xReinit)(DbPa
** size is inappropriate, then an alternative page size is selected
** and returned.
*/
-STQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, int pageSize){
- assert( pageSize>=512 && pageSize<=STQLITE_MAX_PAGE_SIZE );
+SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, int pageSize){
+ assert( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE );
if( !pPager->memDb && pPager->nRef==0 ){
pager_reset(pPager);
pPager->pageSize = pageSize;
@@ -19774,7 +19774,7 @@ STQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, int pageSize){
**
** Regardless of mxPage, return the current maximum page count.
*/
-STQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager *pPager, int mxPage){
+SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager *pPager, int mxPage){
if( mxPage>0 ){
pPager->mxPgno = mxPage;
}
@@ -19787,10 +19787,10 @@ STQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager *pPager, int mxPage){
** I/O error mechanism. These routines are used to avoid simulated
** errors in places where we do not care about errors.
**
-** Unless -DSTQLITE_TEST=1 is used, these routines are all no-ops
+** Unless -DSQLITE_TEST=1 is used, these routines are all no-ops
** and generate no code.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
extern int sqlite3_io_error_pending;
extern int sqlite3_io_error_hit;
static int saved_cnt;
@@ -19816,8 +19816,8 @@ void enable_simulated_io_errors(void){
** response is to zero the memory at pDest and continue. A real IO error
** will presumably recur and be picked up later (Todo: Think about this).
*/
-STQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){
+ int rc = SQLITE_OK;
memset(pDest, 0, N);
if( MEMDB==0 ){
disable_simulated_io_errors();
@@ -19825,8 +19825,8 @@ STQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned ch
enable_simulated_io_errors();
IOTRACE(("DBHDR %p 0 %d\n", pPager, N))
rc = sqlite3OsRead(pPager->fd, pDest, N);
- if( rc==STQLITE_IOERR_SHORT_READ ){
- rc = STQLITE_OK;
+ if( rc==SQLITE_IOERR_SHORT_READ ){
+ rc = SQLITE_OK;
}
}
return rc;
@@ -19841,7 +19841,7 @@ STQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned ch
** PENDING_BYTE is byte 4096 (the first byte of page 5) and the size of the
** file is 4096 bytes, 5 is returned instead of 4.
*/
-STQLITE_PRIVATE int sqlite3PagerPagecount(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerPagecount(Pager *pPager){
i64 n;
int rc;
assert( pPager!=0 );
@@ -19851,7 +19851,7 @@ STQLITE_PRIVATE int sqlite3PagerPagecount(Pager *pPager){
if( pPager->dbSize>=0 ){
n = pPager->dbSize;
} else {
- if( (rc = sqlite3OsFileSize(pPager->fd, &n))!=STQLITE_OK ){
+ if( (rc = sqlite3OsFileSize(pPager->fd, &n))!=SQLITE_OK ){
pager_error(pPager, rc);
return 0;
}
@@ -19874,7 +19874,7 @@ STQLITE_PRIVATE int sqlite3PagerPagecount(Pager *pPager){
}
-#ifndef STQLITE_OMIT_MEMORYDB
+#ifndef SQLITE_OMIT_MEMORYDB
/*
** Clear a PgHistory block
*/
@@ -19995,7 +19995,7 @@ static void pager_truncate_cache(Pager *pPager){
** is currently not available. Repeat until the busy callback returns
** false or until the lock succeeds.
**
-** Return STQLITE_OK on success and an error code if we cannot obtain
+** Return SQLITE_OK on success and an error code if we cannot obtain
** the lock.
*/
static int pager_wait_on_lock(Pager *pPager, int locktype){
@@ -20010,12 +20010,12 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){
assert( pPager->state>=PAGER_SHARED || pPager->dbSize<0 || MEMDB );
if( pPager->state>=locktype ){
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}else{
do {
rc = sqlite3OsLock(pPager->fd, locktype);
- }while( rc==STQLITE_BUSY && sqlite3InvokeBusyHandler(pPager->pBusyHandler) );
- if( rc==STQLITE_OK ){
+ }while( rc==SQLITE_BUSY && sqlite3InvokeBusyHandler(pPager->pBusyHandler) );
+ if( rc==SQLITE_OK ){
pPager->state = locktype;
IOTRACE(("LOCK %p %d\n", pPager, locktype))
}
@@ -20026,7 +20026,7 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){
/*
** Truncate the file to the number of pages specified.
*/
-STQLITE_PRIVATE int sqlite3PagerTruncate(Pager *pPager, Pgno nPage){
+SQLITE_PRIVATE int sqlite3PagerTruncate(Pager *pPager, Pgno nPage){
int rc;
assert( pPager->state>=PAGER_SHARED || MEMDB );
sqlite3PagerPagecount(pPager);
@@ -20035,21 +20035,21 @@ STQLITE_PRIVATE int sqlite3PagerTruncate(Pager *pPager, Pgno nPage){
return rc;
}
if( nPage>=(unsigned)pPager->dbSize ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( MEMDB ){
pPager->dbSize = nPage;
pager_truncate_cache(pPager);
- return STQLITE_OK;
+ return SQLITE_OK;
}
rc = syncJournal(pPager);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
/* Get an exclusive lock on the database before truncating. */
rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -20071,8 +20071,8 @@ STQLITE_PRIVATE int sqlite3PagerTruncate(Pager *pPager, Pgno nPage){
** a hot journal may be left in the filesystem but no error is returned
** to the caller.
*/
-STQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager){
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager){
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
/* A malloc() cannot fail in sqlite3ThreadData() as one or more calls to
** malloc() must have already been made by this thread before it gets
** to this point. This means the ThreadData must have been allocated already
@@ -20106,7 +20106,7 @@ STQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager){
** }
*/
-#ifdef STQLITE_ENABLE_MEMORY_MANAGEMENT
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
/* Remove the pager from the linked list of pagers starting at
** ThreadData.pPager if memory-management is enabled.
*/
@@ -20121,14 +20121,14 @@ STQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager){
sqliteFree(pPager->aHash);
sqliteFree(pPager->pTmpSpace);
sqliteFree(pPager);
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#if !defined(NDEBUG) || defined(STQLITE_TEST)
+#if !defined(NDEBUG) || defined(SQLITE_TEST)
/*
** Return the page number for the given page data.
*/
-STQLITE_PRIVATE Pgno sqlite3PagerPagenumber(DbPage *p){
+SQLITE_PRIVATE Pgno sqlite3PagerPagenumber(DbPage *p){
return p->pgno;
}
#endif
@@ -20165,7 +20165,7 @@ static void _page_ref(PgHdr *pPg){
pPg->nRef++;
REFINFO(pPg);
}
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
static void page_ref(PgHdr *pPg){
if( pPg->nRef==0 ){
_page_ref(pPg);
@@ -20182,9 +20182,9 @@ static void _page_ref(PgHdr *pPg){
** Increment the reference count for a page. The input pointer is
** a reference to the page data.
*/
-STQLITE_PRIVATE int sqlite3PagerRef(DbPage *pPg){
+SQLITE_PRIVATE int sqlite3PagerRef(DbPage *pPg){
page_ref(pPg);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -20209,7 +20209,7 @@ STQLITE_PRIVATE int sqlite3PagerRef(DbPage *pPg){
*/
static int syncJournal(Pager *pPager){
PgHdr *pPg;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
/* Sync the journal before modifying the main database
** (assuming there is a journal and it needs to be synced.)
@@ -20320,7 +20320,7 @@ static PgHdr *merge_pagelist(PgHdr *pA, PgHdr *pB){
*/
#define N_SORT_BUCKET_ALLOC 25
#define N_SORT_BUCKET 25
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_pager_n_sort_bucket = 0;
#undef N_SORT_BUCKET
#define N_SORT_BUCKET \
@@ -20368,7 +20368,7 @@ static int pager_write_pagelist(PgHdr *pList){
Pager *pPager;
int rc;
- if( pList==0 ) return STQLITE_OK;
+ if( pList==0 ) return SQLITE_OK;
pPager = pList->pPager;
/* At this point there may be either a RESERVED or EXCLUSIVE lock on the
@@ -20388,7 +20388,7 @@ static int pager_write_pagelist(PgHdr *pList){
** will require a journal playback.
*/
rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -20421,12 +20421,12 @@ static int pager_write_pagelist(PgHdr *pList){
#endif
if( rc ) return rc;
pList->dirty = 0;
-#ifdef STQLITE_CHECK_PAGES
+#ifdef SQLITE_CHECK_PAGES
pList->pageHash = pager_pagehash(pList);
#endif
pList = pList->pDirty;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -20465,7 +20465,7 @@ static int hasHotJournal(Pager *pPager){
/*
** Try to find a page in the cache that can be recycled.
**
-** This routine may return STQLITE_IOERR, STQLITE_FULL or STQLITE_OK. It
+** This routine may return SQLITE_IOERR, SQLITE_FULL or SQLITE_OK. It
** does not set the pPager->errCode variable.
*/
static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
@@ -20507,7 +20507,7 @@ static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
pPg = pPager->pFirst;
}
if( pPg==0 ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
assert( pPg->nRef==0 );
@@ -20521,7 +20521,7 @@ static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
pPg->dirty = 1;
pPg->pDirty = 0;
rc = pager_write_pagelist( pPg );
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
}
@@ -20546,12 +20546,12 @@ static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
assert( pPg->pgno==0 );
*ppPg = pPg;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** This function is called to free superfluous dynamically allocated memory
-** held by the pager system. Memory in use by any STQLite pager allocated
+** held by the pager system. Memory in use by any SQLite pager allocated
** by the current thread may be sqliteFree()ed.
**
** nReq is the number of bytes of memory required. Once this much has
@@ -20559,8 +20559,8 @@ static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
** free as much memory as possible. The return value is the total number
** of bytes of memory released.
*/
-#if defined(STQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(STQLITE_OMIT_DISKIO)
-STQLITE_PRIVATE int sqlite3PagerReleaseMemory(int nReq){
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(SQLITE_OMIT_DISKIO)
+SQLITE_PRIVATE int sqlite3PagerReleaseMemory(int nReq){
const ThreadData *pTsdro = sqlite3ThreadDataReadOnly();
int nReleased = 0;
int i;
@@ -20582,7 +20582,7 @@ STQLITE_PRIVATE int sqlite3PagerReleaseMemory(int nReq){
*/
for(i=0; i<=1; i++){
- /* Loop through all the STQLite pagers opened by the current thread. */
+ /* Loop through all the SQLite pagers opened by the current thread. */
Pager *pPager = pTsdro->pPager;
for( ; pPager && (nReq<0 || nReleased<nReq); pPager=pPager->pNext){
PgHdr *pPg;
@@ -20596,7 +20596,7 @@ STQLITE_PRIVATE int sqlite3PagerReleaseMemory(int nReq){
** calling fsync() if this is the first iteration of the outermost
** loop).
*/
- while( STQLITE_OK==(rc = pager_recycle(pPager, i, &pPg)) && pPg) {
+ while( SQLITE_OK==(rc = pager_recycle(pPager, i, &pPg)) && pPg) {
/* We've found a page to free. At this point the page has been
** removed from the page hash-table, free-list and synced-list
** (pFirstSynced). It is still in the all pages (pAll) list.
@@ -20619,14 +20619,14 @@ STQLITE_PRIVATE int sqlite3PagerReleaseMemory(int nReq){
sqliteFree(pPg);
}
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
/* An error occured whilst writing to the database file or
** journal in pager_recycle(). The error is not returned to the
** caller of this function. Instead, set the Pager.errCode variable.
** The error will be returned to the user (or users, in the case
** of a shared pager cache) of the pager for which the error occured.
*/
- assert( (rc&0xff)==STQLITE_IOERR || rc==STQLITE_FULL );
+ assert( (rc&0xff)==SQLITE_IOERR || rc==SQLITE_FULL );
assert( pPager->state>=PAGER_RESERVED );
pager_error(pPager, rc);
}
@@ -20635,7 +20635,7 @@ STQLITE_PRIVATE int sqlite3PagerReleaseMemory(int nReq){
return nReleased;
}
-#endif /* STQLITE_ENABLE_MEMORY_MANAGEMENT && !STQLITE_OMIT_DISKIO */
+#endif /* SQLITE_ENABLE_MEMORY_MANAGEMENT && !SQLITE_OMIT_DISKIO */
/*
** Read the content of page pPg out of the database file.
@@ -20644,7 +20644,7 @@ static int readDbPage(Pager *pPager, PgHdr *pPg, Pgno pgno){
int rc;
assert( MEMDB==0 );
rc = sqlite3OsSeek(pPager->fd, (pgno-1)*(i64)pPager->pageSize);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3OsRead(pPager->fd, PGHDR_TO_DATA(pPg),
pPager->pageSize);
}
@@ -20672,14 +20672,14 @@ static int readDbPage(Pager *pPager, PgHdr *pPg, Pgno pgno){
** is performed immediately.
*/
static int pagerSharedLock(Pager *pPager){
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
if( pPager->state==PAGER_UNLOCK ){
if( !MEMDB ){
assert( pPager->nRef==0 );
if( !pPager->noReadlock ){
rc = pager_wait_on_lock(pPager, SHARED_LOCK);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return pager_error(pPager, rc);
}
assert( pPager->state>=SHARED_LOCK );
@@ -20701,13 +20701,13 @@ static int pagerSharedLock(Pager *pPager){
** obtain it's own EXCLUSIVE lock on the database file.
*/
rc = sqlite3OsLock(pPager->fd, EXCLUSIVE_LOCK);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
pager_unlock(pPager);
return pager_error(pPager, rc);
}
pPager->state = PAGER_EXCLUSIVE;
- /* Open the journal for reading only. Return STQLITE_BUSY if
+ /* Open the journal for reading only. Return SQLITE_BUSY if
** we are unable to open the journal file.
**
** The journal file does not need to be locked itself. The
@@ -20721,20 +20721,20 @@ static int pagerSharedLock(Pager *pPager){
** OsTruncate() call used in exclusive-access mode also requires
** a read/write file handle.
*/
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
if( sqlite3OsFileExists(pPager->zJournal) ){
int ro;
assert( !pPager->tempFile );
rc = sqlite3OsOpenReadWrite(pPager->zJournal, &pPager->jfd, &ro);
- assert( rc!=STQLITE_OK || pPager->jfd );
+ assert( rc!=SQLITE_OK || pPager->jfd );
if( ro ){
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
sqlite3OsClose(&pPager->jfd);
}
}
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
pager_unlock(pPager);
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
}
pPager->journalOpen = 1;
pPager->journalStarted = 0;
@@ -20746,7 +20746,7 @@ static int pagerSharedLock(Pager *pPager){
** lock and reacquire the read lock.
*/
rc = pager_playback(pPager, 1);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return pager_error(pPager, rc);
}
assert(pPager->state==PAGER_SHARED ||
@@ -20781,11 +20781,11 @@ static int pagerSharedLock(Pager *pPager){
if( pPager->dbSize>0 ){
IOTRACE(("CKVERS %p %d\n", pPager, sizeof(dbFileVers)));
rc = sqlite3OsSeek(pPager->fd, 24);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers));
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
}else{
@@ -20839,7 +20839,7 @@ static int pagerSharedLock(Pager *pPager){
** allowed.
*/
static int pagerAllocatePage(Pager *pPager, PgHdr **ppPg){
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
PgHdr *pPg;
/* Create a new PgHdr if any of the four conditions defined
@@ -20853,7 +20853,7 @@ static int pagerAllocatePage(Pager *pPager, PgHdr **ppPg){
pager_resize_hash_table(pPager,
pPager->nHash<256 ? 256 : pPager->nHash*2);
if( pPager->nHash==0 ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto pager_allocate_out;
}
}
@@ -20861,7 +20861,7 @@ static int pagerAllocatePage(Pager *pPager, PgHdr **ppPg){
+ sizeof(u32) + pPager->nExtra
+ MEMDB*sizeof(PgHistory) );
if( pPg==0 ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto pager_allocate_out;
}
memset(pPg, 0, sizeof(*pPg));
@@ -20875,10 +20875,10 @@ static int pagerAllocatePage(Pager *pPager, PgHdr **ppPg){
}else{
/* Recycle an existing page with a zero ref-count. */
rc = pager_recycle(pPager, 1, &pPg);
- if( rc==STQLITE_BUSY ){
- rc = STQLITE_IOERR_BLOCKED;
+ if( rc==SQLITE_BUSY ){
+ rc = SQLITE_IOERR_BLOCKED;
}
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto pager_allocate_out;
}
assert( pPager->state>=SHARED_LOCK );
@@ -20900,13 +20900,13 @@ pager_allocate_out:
static int pager_get_content(PgHdr *pPg){
if( pPg->needRead ){
int rc = readDbPage(pPg->pPager, pPg, pPg->pgno);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pPg->needRead = 0;
}else{
return rc;
}
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -20941,7 +20941,7 @@ static int pager_get_content(PgHdr *pPg){
** called again with noContent==0, that means that the content is needed
** and the disk read should occur at that point.
*/
-STQLITE_PRIVATE int sqlite3PagerAcquire(
+SQLITE_PRIVATE int sqlite3PagerAcquire(
Pager *pPager, /* The pager open on the database file */
Pgno pgno, /* Page number to fetch */
DbPage **ppPage, /* Write a pointer to the page here */
@@ -20952,18 +20952,18 @@ STQLITE_PRIVATE int sqlite3PagerAcquire(
assert( pPager->state==PAGER_UNLOCK || pPager->nRef>0 || pgno==1 );
- /* The maximum page number is 2^31. Return STQLITE_CORRUPT if a page
+ /* The maximum page number is 2^31. Return SQLITE_CORRUPT if a page
** number greater than this, or zero, is requested.
*/
if( pgno>PAGER_MAX_PGNO || pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
/* Make sure we have not hit any critical errors.
*/
assert( pPager!=0 );
*ppPage = 0;
- if( pPager->errCode && pPager->errCode!=STQLITE_FULL ){
+ if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){
return pPager->errCode;
}
@@ -20972,7 +20972,7 @@ STQLITE_PRIVATE int sqlite3PagerAcquire(
** a database lock is already held.
*/
rc = pagerSharedLock(pPager);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
assert( pPager->state!=PAGER_UNLOCK );
@@ -20984,7 +20984,7 @@ STQLITE_PRIVATE int sqlite3PagerAcquire(
int h;
PAGER_INCR(pPager->nMiss);
rc = pagerAllocatePage(pPager, &pPg);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -21021,14 +21021,14 @@ STQLITE_PRIVATE int sqlite3PagerAcquire(
if( nMax<(int)pgno || MEMDB || (noContent && !pPager->alwaysRollback) ){
if( pgno>pPager->mxPgno ){
sqlite3PagerUnref(pPg);
- return STQLITE_FULL;
+ return SQLITE_FULL;
}
memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize);
pPg->needRead = noContent && !pPager->alwaysRollback;
IOTRACE(("ZERO %p %d\n", pPager, pgno));
}else{
rc = readDbPage(pPager, pPg, pgno);
- if( rc!=STQLITE_OK && rc!=STQLITE_IOERR_SHORT_READ ){
+ if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){
pPg->pgno = 0;
sqlite3PagerUnref(pPg);
return rc;
@@ -21046,7 +21046,7 @@ STQLITE_PRIVATE int sqlite3PagerAcquire(
pPg->pNextHash->pPrevHash = pPg;
}
-#ifdef STQLITE_CHECK_PAGES
+#ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg);
#endif
}else{
@@ -21062,7 +21062,7 @@ STQLITE_PRIVATE int sqlite3PagerAcquire(
page_ref(pPg);
}
*ppPage = pPg;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -21076,7 +21076,7 @@ STQLITE_PRIVATE int sqlite3PagerAcquire(
** returns NULL if the page is not in cache or if a disk I/O error
** has ever happened.
*/
-STQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){
+SQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){
PgHdr *pPg;
assert( pPager!=0 );
@@ -21086,7 +21086,7 @@ STQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){
assert( !pPager->pAll || pPager->exclusiveMode );
return 0;
}
- if( pPager->errCode && pPager->errCode!=STQLITE_FULL ){
+ if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){
return 0;
}
pPg = pager_lookup(pPager, pgno);
@@ -21103,7 +21103,7 @@ STQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){
** are released, a rollback occurs and the lock on the database is
** removed.
*/
-STQLITE_PRIVATE int sqlite3PagerUnref(DbPage *pPg){
+SQLITE_PRIVATE int sqlite3PagerUnref(DbPage *pPg){
/* Decrement the reference count for this page
*/
@@ -21143,14 +21143,14 @@ STQLITE_PRIVATE int sqlite3PagerUnref(DbPage *pPg){
pagerUnlockAndRollback(pPager);
}
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Create a journal file for pPager. There should already be a RESERVED
** or EXCLUSIVE lock on the database file when this routine is called.
**
-** Return STQLITE_OK if everything. Return an error code and release the
+** Return SQLITE_OK if everything. Return an error code and release the
** write lock if anything goes wrong.
*/
static int pager_open_journal(Pager *pPager){
@@ -21163,17 +21163,17 @@ static int pager_open_journal(Pager *pPager){
sqlite3PagerPagecount(pPager);
pPager->aInJournal = sqliteMalloc( pPager->dbSize/8 + 1 );
if( pPager->aInJournal==0 ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto failed_to_open_journal;
}
rc = sqlite3OsOpenExclusive(pPager->zJournal, &pPager->jfd,
pPager->tempFile);
- assert( rc!=STQLITE_OK || pPager->jfd );
+ assert( rc!=SQLITE_OK || pPager->jfd );
pPager->journalOff = 0;
pPager->setMaster = 0;
pPager->journalHdr = 0;
- if( rc!=STQLITE_OK ){
- if( rc==STQLITE_NOMEM ){
+ if( rc!=SQLITE_OK ){
+ if( rc==SQLITE_NOMEM ){
sqlite3OsDelete(pPager->zJournal);
}
goto failed_to_open_journal;
@@ -21194,13 +21194,13 @@ static int pager_open_journal(Pager *pPager){
rc = writeJournalHdr(pPager);
- if( pPager->stmtAutoopen && rc==STQLITE_OK ){
+ if( pPager->stmtAutoopen && rc==SQLITE_OK ){
rc = sqlite3PagerStmtBegin(pPager);
}
- if( rc!=STQLITE_OK && rc!=STQLITE_NOMEM ){
+ if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM ){
rc = pager_end_transaction(pPager);
- if( rc==STQLITE_OK ){
- rc = STQLITE_FULL;
+ if( rc==SQLITE_OK ){
+ rc = SQLITE_FULL;
}
}
return rc;
@@ -21238,9 +21238,9 @@ failed_to_open_journal:
** immediately instead of waiting until we try to flush the cache. The
** exFlag is ignored if a transaction is already active.
*/
-STQLITE_PRIVATE int sqlite3PagerBegin(DbPage *pPg, int exFlag){
+SQLITE_PRIVATE int sqlite3PagerBegin(DbPage *pPg, int exFlag){
Pager *pPager = pPg->pPager;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
assert( pPg->nRef>0 );
assert( pPager->state!=PAGER_UNLOCK );
if( pPager->state==PAGER_SHARED ){
@@ -21250,13 +21250,13 @@ STQLITE_PRIVATE int sqlite3PagerBegin(DbPage *pPg, int exFlag){
pPager->origDbSize = pPager->dbSize;
}else{
rc = sqlite3OsLock(pPager->fd, RESERVED_LOCK);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pPager->state = PAGER_RESERVED;
if( exFlag ){
rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
}
}
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
pPager->dirtyCache = 0;
@@ -21277,13 +21277,13 @@ STQLITE_PRIVATE int sqlite3PagerBegin(DbPage *pPg, int exFlag){
sqlite3PagerPagecount(pPager);
pPager->aInJournal = sqliteMalloc( pPager->dbSize/8 + 1 );
if( !pPager->aInJournal ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
}else{
pPager->origDbSize = pPager->dbSize;
rc = writeJournalHdr(pPager);
}
}
- assert( !pPager->journalOpen || pPager->journalOff>0 || rc!=STQLITE_OK );
+ assert( !pPager->journalOpen || pPager->journalOff>0 || rc!=SQLITE_OK );
return rc;
}
@@ -21330,20 +21330,20 @@ static void makeClean(PgHdr *pPg){
**
** The first time this routine is called, the pager creates a new
** journal and acquires a RESERVED lock on the database. If the RESERVED
-** lock could not be acquired, this routine returns STQLITE_BUSY. The
+** lock could not be acquired, this routine returns SQLITE_BUSY. The
** calling routine must check for that return value and be careful not to
-** change any page data until this routine returns STQLITE_OK.
+** change any page data until this routine returns SQLITE_OK.
**
** If the journal file could not be written because the disk is full,
-** then this routine returns STQLITE_FULL and does an immediate rollback.
-** All subsequent write attempts also return STQLITE_FULL until there
+** then this routine returns SQLITE_FULL and does an immediate rollback.
+** All subsequent write attempts also return SQLITE_FULL until there
** is a call to sqlite3PagerCommit() or sqlite3PagerRollback() to
** reset.
*/
static int pager_write(PgHdr *pPg){
void *pData = PGHDR_TO_DATA(pPg);
Pager *pPager = pPg->pPager;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
/* Check for errors
*/
@@ -21351,7 +21351,7 @@ static int pager_write(PgHdr *pPg){
return pPager->errCode;
}
if( pPager->readOnly ){
- return STQLITE_PERM;
+ return SQLITE_PERM;
}
assert( !pPager->setMaster );
@@ -21388,13 +21388,13 @@ static int pager_write(PgHdr *pPg){
*/
assert( pPager->state!=PAGER_UNLOCK );
rc = sqlite3PagerBegin(pPg, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
assert( pPager->state>=PAGER_RESERVED );
if( !pPager->journalOpen && pPager->useJournal ){
rc = pager_open_journal(pPager);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
}
assert( pPager->journalOpen || !pPager->useJournal );
pPager->dirtyCache = 1;
@@ -21441,7 +21441,7 @@ static int pager_write(PgHdr *pPg){
/* An error has occured writing to the journal file. The
** transaction will be rolled back by the layer above.
*/
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -21488,7 +21488,7 @@ static int pager_write(PgHdr *pPg){
put32bits(pData2, pPg->pgno);
rc = sqlite3OsWrite(pPager->stfd, pData2, pPager->pageSize+4);
PAGERTRACE3("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
pPager->stmtNRec++;
@@ -21520,8 +21520,8 @@ static int pager_write(PgHdr *pPg){
** fit on a single disk sector. In this case all co-resident pages
** must have been written to the journal file before returning.
*/
-STQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){
+ int rc = SQLITE_OK;
PgHdr *pPg = pDbPage;
Pager *pPager = pPg->pPager;
@@ -21557,7 +21557,7 @@ STQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){
assert(pg1<=pPg->pgno);
assert((pg1+nPage)>pPg->pgno);
- for(ii=0; ii<nPage && rc==STQLITE_OK; ii++){
+ for(ii=0; ii<nPage && rc==SQLITE_OK; ii++){
Pgno pg = pg1+ii;
if( !pPager->aInJournal || pg==pPg->pgno ||
pg>pPager->origDbSize || !(pPager->aInJournal[pg/8]&(1<<(pg&7)))
@@ -21565,7 +21565,7 @@ STQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){
if( pg!=PAGER_MJ_PGNO(pPager) ){
PgHdr *pPage;
rc = sqlite3PagerGet(pPager, pg, &pPage);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = pager_write(pPage);
sqlite3PagerUnref(pPage);
}
@@ -21587,24 +21587,24 @@ STQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){
** to change the content of the page.
*/
#ifndef NDEBUG
-STQLITE_PRIVATE int sqlite3PagerIswriteable(DbPage *pPg){
+SQLITE_PRIVATE int sqlite3PagerIswriteable(DbPage *pPg){
return pPg->dirty;
}
#endif
-#ifndef STQLITE_OMIT_VACUUM
+#ifndef SQLITE_OMIT_VACUUM
/*
** Replace the content of a single page with the information in the third
** argument.
*/
-STQLITE_PRIVATE int sqlite3PagerOverwrite(Pager *pPager, Pgno pgno, void *pData){
+SQLITE_PRIVATE int sqlite3PagerOverwrite(Pager *pPager, Pgno pgno, void *pData){
PgHdr *pPg;
int rc;
rc = sqlite3PagerGet(pPager, pgno, &pPg);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3PagerWrite(pPg);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
memcpy(sqlite3PagerGetData(pPg), pData, pPager->pageSize);
}
sqlite3PagerUnref(pPg);
@@ -21637,7 +21637,7 @@ STQLITE_PRIVATE int sqlite3PagerOverwrite(Pager *pPager, Pgno pgno, void *pData)
** page contains critical data, we still need to be sure it gets
** rolled back in spite of the sqlite3PagerDontRollback() call.
*/
-STQLITE_PRIVATE void sqlite3PagerDontWrite(DbPage *pDbPage){
+SQLITE_PRIVATE void sqlite3PagerDontWrite(DbPage *pDbPage){
PgHdr *pPg = pDbPage;
Pager *pPager = pPg->pPager;
@@ -21658,7 +21658,7 @@ STQLITE_PRIVATE void sqlite3PagerDontWrite(DbPage *pDbPage){
PAGERTRACE3("DONT_WRITE page %d of %d\n", pPg->pgno, PAGERID(pPager));
IOTRACE(("CLEAN %p %d\n", pPager, pPg->pgno))
makeClean(pPg);
-#ifdef STQLITE_CHECK_PAGES
+#ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg);
#endif
}
@@ -21676,7 +21676,7 @@ STQLITE_PRIVATE void sqlite3PagerDontWrite(DbPage *pDbPage){
** that we will never need to read the page content in the future.
** so the needRead flag can be cleared at this point.
*/
-STQLITE_PRIVATE void sqlite3PagerDontRollback(DbPage *pPg){
+SQLITE_PRIVATE void sqlite3PagerDontRollback(DbPage *pPg){
Pager *pPager = pPg->pPager;
assert( pPager->state>=PAGER_RESERVED );
@@ -21716,9 +21716,9 @@ static int pager_incr_changecounter(Pager *pPager){
if( !pPager->changeCountDone ){
/* Open page 1 of the file for writing. */
rc = sqlite3PagerGet(pPager, 1, &pPgHdr);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
rc = sqlite3PagerWrite(pPgHdr);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
/* Increment the value just read and write it back to byte 24. */
change_counter = sqlite3Get4byte((u8*)pPager->dbFileVers);
@@ -21728,7 +21728,7 @@ static int pager_incr_changecounter(Pager *pPager){
sqlite3PagerUnref(pPgHdr);
pPager->changeCountDone = 1;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -21748,8 +21748,8 @@ static int pager_incr_changecounter(Pager *pPager){
** If parameter nTrunc is non-zero, then the pager file is truncated to
** nTrunc pages (this is used by auto-vacuum databases).
*/
-STQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager *pPager, const char *zMaster, Pgno nTrunc){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager *pPager, const char *zMaster, Pgno nTrunc){
+ int rc = SQLITE_OK;
PAGERTRACE4("DATABASE SYNC: File=%s zMaster=%s nTrunc=%d\n",
pPager->zFilename, zMaster, nTrunc);
@@ -21769,8 +21769,8 @@ STQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager *pPager, const char *zMaste
*/
if( !pPager->setMaster ){
rc = pager_incr_changecounter(pPager);
- if( rc!=STQLITE_OK ) goto sync_exit;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+ if( rc!=SQLITE_OK ) goto sync_exit;
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( nTrunc!=0 ){
/* If this transaction has made the database smaller, then all pages
** being discarded by the truncation must be written to the journal
@@ -21781,31 +21781,31 @@ STQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager *pPager, const char *zMaste
for( i=nTrunc+1; i<=pPager->origDbSize; i++ ){
if( !(pPager->aInJournal[i/8] & (1<<(i&7))) && i!=iSkip ){
rc = sqlite3PagerGet(pPager, i, &pPg);
- if( rc!=STQLITE_OK ) goto sync_exit;
+ if( rc!=SQLITE_OK ) goto sync_exit;
rc = sqlite3PagerWrite(pPg);
sqlite3PagerUnref(pPg);
- if( rc!=STQLITE_OK ) goto sync_exit;
+ if( rc!=SQLITE_OK ) goto sync_exit;
}
}
}
#endif
rc = writeMasterJournal(pPager, zMaster);
- if( rc!=STQLITE_OK ) goto sync_exit;
+ if( rc!=SQLITE_OK ) goto sync_exit;
rc = syncJournal(pPager);
- if( rc!=STQLITE_OK ) goto sync_exit;
+ if( rc!=SQLITE_OK ) goto sync_exit;
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( nTrunc!=0 ){
rc = sqlite3PagerTruncate(pPager, nTrunc);
- if( rc!=STQLITE_OK ) goto sync_exit;
+ if( rc!=SQLITE_OK ) goto sync_exit;
}
#endif
/* Write all dirty pages to the database file */
pPg = pager_get_all_dirty_pages(pPager);
rc = pager_write_pagelist(pPg);
- if( rc!=STQLITE_OK ) goto sync_exit;
+ if( rc!=SQLITE_OK ) goto sync_exit;
pPager->pDirty = 0;
/* Sync the database file. */
@@ -21820,13 +21820,13 @@ STQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager *pPager, const char *zMaste
}
sync_exit:
- if( rc==STQLITE_IOERR_BLOCKED ){
+ if( rc==SQLITE_IOERR_BLOCKED ){
/* pager_incr_changecounter() may attempt to obtain an exclusive
* lock to spill the cache and return IOERR_BLOCKED. But since
* there is no chance the cache is inconsistent, it's
- * better to return STQLITE_BUSY.
+ * better to return SQLITE_BUSY.
*/
- rc = STQLITE_BUSY;
+ rc = SQLITE_BUSY;
}
return rc;
}
@@ -21836,10 +21836,10 @@ sync_exit:
** Commit all changes to the database and release the write lock.
**
** If the commit fails for any reason, a rollback attempt is made
-** and an error code is returned. If the commit worked, STQLITE_OK
+** and an error code is returned. If the commit worked, SQLITE_OK
** is returned.
*/
-STQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){
int rc;
PgHdr *pPg;
@@ -21847,7 +21847,7 @@ STQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){
return pPager->errCode;
}
if( pPager->state<PAGER_RESERVED ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
PAGERTRACE2("COMMIT %d\n", PAGERID(pPager));
if( MEMDB ){
@@ -21873,7 +21873,7 @@ STQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){
#endif
pPager->pStmt = 0;
pPager->state = PAGER_SHARED;
- return STQLITE_OK;
+ return SQLITE_OK;
}
assert( pPager->journalOpen || !pPager->dirtyCache );
assert( pPager->state==PAGER_SYNCED || !pPager->dirtyCache );
@@ -21888,12 +21888,12 @@ STQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){
**
** This routine cannot fail unless some other process is not following
** the correct locking protocol or unless some other
-** process is writing trash into the journal file (STQLITE_CORRUPT) or
-** unless a prior malloc() failed (STQLITE_NOMEM). Appropriate error
+** process is writing trash into the journal file (SQLITE_CORRUPT) or
+** unless a prior malloc() failed (SQLITE_NOMEM). Appropriate error
** codes are returned for all these occasions. Otherwise,
-** STQLITE_OK is returned.
+** SQLITE_OK is returned.
*/
-STQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){
int rc;
PAGERTRACE2("ROLLBACK %d\n", PAGERID(pPager));
if( MEMDB ){
@@ -21929,7 +21929,7 @@ STQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){
pager_truncate_cache(pPager);
pPager->stmtInUse = 0;
pPager->state = PAGER_SHARED;
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( !pPager->dirtyCache || !pPager->journalOpen ){
@@ -21937,7 +21937,7 @@ STQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){
return rc;
}
- if( pPager->errCode && pPager->errCode!=STQLITE_FULL ){
+ if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){
if( pPager->state>=PAGER_EXCLUSIVE ){
pager_playback(pPager, 0);
}
@@ -21947,7 +21947,7 @@ STQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){
int rc2;
rc = pager_playback(pPager, 0);
rc2 = pager_end_transaction(pPager);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = rc2;
}
}else{
@@ -21967,22 +21967,22 @@ STQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){
** Return TRUE if the database file is opened read-only. Return FALSE
** if the database is (in theory) writable.
*/
-STQLITE_PRIVATE int sqlite3PagerIsreadonly(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerIsreadonly(Pager *pPager){
return pPager->readOnly;
}
/*
** Return the number of references to the pager.
*/
-STQLITE_PRIVATE int sqlite3PagerRefcount(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerRefcount(Pager *pPager){
return pPager->nRef;
}
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
/*
** This routine is used for testing and analysis only.
*/
-STQLITE_PRIVATE int *sqlite3PagerStats(Pager *pPager){
+SQLITE_PRIVATE int *sqlite3PagerStats(Pager *pPager){
static int a[11];
a[0] = pPager->nRef;
a[1] = pPager->nPage;
@@ -22006,7 +22006,7 @@ STQLITE_PRIVATE int *sqlite3PagerStats(Pager *pPager){
** open. A new statement journal is created that can be used to rollback
** changes of a single SQL command within a larger transaction.
*/
-STQLITE_PRIVATE int sqlite3PagerStmtBegin(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerStmtBegin(Pager *pPager){
int rc;
assert( !pPager->stmtInUse );
assert( pPager->state>=PAGER_SHARED );
@@ -22015,17 +22015,17 @@ STQLITE_PRIVATE int sqlite3PagerStmtBegin(Pager *pPager){
if( MEMDB ){
pPager->stmtInUse = 1;
pPager->stmtSize = pPager->dbSize;
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( !pPager->journalOpen ){
pPager->stmtAutoopen = 1;
- return STQLITE_OK;
+ return SQLITE_OK;
}
assert( pPager->journalOpen );
pPager->aInStmt = sqliteMalloc( pPager->dbSize/8 + 1 );
if( pPager->aInStmt==0 ){
/* sqlite3OsLock(pPager->fd, SHARED_LOCK); */
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
#ifndef NDEBUG
rc = sqlite3OsFileSize(pPager->jfd, &pPager->stmtJSize);
@@ -22043,7 +22043,7 @@ STQLITE_PRIVATE int sqlite3PagerStmtBegin(Pager *pPager){
pPager->stmtNRec = 0;
}
pPager->stmtInUse = 1;
- return STQLITE_OK;
+ return SQLITE_OK;
stmt_begin_failed:
if( pPager->aInStmt ){
@@ -22056,7 +22056,7 @@ stmt_begin_failed:
/*
** Commit a statement.
*/
-STQLITE_PRIVATE int sqlite3PagerStmtCommit(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerStmtCommit(Pager *pPager){
if( pPager->stmtInUse ){
PgHdr *pPg, *pNext;
PAGERTRACE2("STMT-COMMIT %d\n", PAGERID(pPager));
@@ -22081,13 +22081,13 @@ STQLITE_PRIVATE int sqlite3PagerStmtCommit(Pager *pPager){
pPager->pStmt = 0;
}
pPager->stmtAutoopen = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Rollback a statement.
*/
-STQLITE_PRIVATE int sqlite3PagerStmtRollback(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerStmtRollback(Pager *pPager){
int rc;
if( pPager->stmtInUse ){
PAGERTRACE2("STMT-ROLLBACK %d\n", PAGERID(pPager));
@@ -22104,13 +22104,13 @@ STQLITE_PRIVATE int sqlite3PagerStmtRollback(Pager *pPager){
}
pPager->dbSize = pPager->stmtSize;
pager_truncate_cache(pPager);
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}else{
rc = pager_stmt_playback(pPager);
}
sqlite3PagerStmtCommit(pPager);
}else{
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}
pPager->stmtAutoopen = 0;
return rc;
@@ -22119,21 +22119,21 @@ STQLITE_PRIVATE int sqlite3PagerStmtRollback(Pager *pPager){
/*
** Return the full pathname of the database file.
*/
-STQLITE_PRIVATE const char *sqlite3PagerFilename(Pager *pPager){
+SQLITE_PRIVATE const char *sqlite3PagerFilename(Pager *pPager){
return pPager->zFilename;
}
/*
** Return the directory of the database file.
*/
-STQLITE_PRIVATE const char *sqlite3PagerDirname(Pager *pPager){
+SQLITE_PRIVATE const char *sqlite3PagerDirname(Pager *pPager){
return pPager->zDirectory;
}
/*
** Return the full pathname of the journal file.
*/
-STQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager *pPager){
+SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager *pPager){
return pPager->zJournal;
}
@@ -22141,15 +22141,15 @@ STQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager *pPager){
** Return true if fsync() calls are disabled for this pager. Return FALSE
** if fsync()s are executed normally.
*/
-STQLITE_PRIVATE int sqlite3PagerNosync(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerNosync(Pager *pPager){
return pPager->noSync;
}
-#ifdef STQLITE_HAS_CODEC
+#ifdef SQLITE_HAS_CODEC
/*
** Set the codec for this pager
*/
-STQLITE_PRIVATE void sqlite3PagerSetCodec(
+SQLITE_PRIVATE void sqlite3PagerSetCodec(
Pager *pPager,
void *(*xCodec)(void*,void*,Pgno,int),
void *pCodecArg
@@ -22159,7 +22159,7 @@ STQLITE_PRIVATE void sqlite3PagerSetCodec(
}
#endif
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/*
** Move the page pPg to location pgno in the file.
**
@@ -22177,7 +22177,7 @@ STQLITE_PRIVATE void sqlite3PagerSetCodec(
** has been removed (CREATE INDEX needs to move a page when a statement
** transaction is active).
*/
-STQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno){
+SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno){
PgHdr *pPgOld; /* The page being overwritten. */
int h;
Pgno needSyncPgno = 0;
@@ -22250,7 +22250,7 @@ STQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno){
PgHdr *pPgHdr;
assert( pPager->needSync );
rc = sqlite3PagerGet(pPager, needSyncPgno, &pPgHdr);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
pPager->needSync = 1;
pPgHdr->needSync = 1;
pPgHdr->inJournal = 1;
@@ -22258,14 +22258,14 @@ STQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno){
sqlite3PagerUnref(pPgHdr);
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
#endif
/*
** Return a pointer to the data for the specified page.
*/
-STQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *pPg){
+SQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *pPg){
return PGHDR_TO_DATA(pPg);
}
@@ -22273,7 +22273,7 @@ STQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *pPg){
** Return a pointer to the Pager.nExtra bytes of "extra" space
** allocated along with the specified page.
*/
-STQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *pPg){
+SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *pPg){
Pager *pPager = pPg->pPager;
return (pPager?PGHDR_TO_EXTRA(pPg, pPager):0);
}
@@ -22288,7 +22288,7 @@ STQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *pPg){
** PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated)
** locking-mode.
*/
-STQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *pPager, int eMode){
+SQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *pPager, int eMode){
assert( eMode==PAGER_LOCKINGMODE_TQUERY
|| eMode==PAGER_LOCKINGMODE_NORMAL
|| eMode==PAGER_LOCKINGMODE_EXCLUSIVE );
@@ -22300,22 +22300,22 @@ STQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *pPager, int eMode){
return (int)pPager->exclusiveMode;
}
-#if defined(STQLITE_DEBUG) || defined(STQLITE_TEST)
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
/*
** Return the current state of the file lock for the given pager.
** The return value is one of NO_LOCK, SHARED_LOCK, RESERVED_LOCK,
** PENDING_LOCK, or EXCLUSIVE_LOCK.
*/
-STQLITE_PRIVATE int sqlite3PagerLockstate(Pager *pPager){
+SQLITE_PRIVATE int sqlite3PagerLockstate(Pager *pPager){
return sqlite3OsLockState(pPager->fd);
}
#endif
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
/*
** Print a listing of all referenced pages and their ref count.
*/
-STQLITE_PRIVATE void sqlite3PagerRefdump(Pager *pPager){
+SQLITE_PRIVATE void sqlite3PagerRefdump(Pager *pPager){
PgHdr *pPg;
for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
if( pPg->nRef<=0 ) continue;
@@ -22325,7 +22325,7 @@ STQLITE_PRIVATE void sqlite3PagerRefdump(Pager *pPager){
}
#endif
-#endif /* STQLITE_OMIT_DISKIO */
+#endif /* SQLITE_OMIT_DISKIO */
/************** End of pager.c ***********************************************/
/************** Begin file btree.c *******************************************/
@@ -22407,7 +22407,7 @@ STQLITE_PRIVATE void sqlite3PagerRefdump(Pager *pPager){
** The format of the file header is as follows:
**
** OFFSET SIZE DESCRIPTION
-** 0 16 Header string: "STQLite format 3\000"
+** 0 16 Header string: "SQLite format 3\000"
** 16 2 Page size in bytes.
** 18 1 File format write version
** 19 1 File format read version
@@ -22577,18 +22577,18 @@ typedef struct BtLock BtLock;
/*
** This is a magic string that appears at the beginning of every
-** STQLite database in order to identify the file as a real database.
+** SQLite database in order to identify the file as a real database.
**
** You can change this value at compile-time by specifying a
-** -DSTQLITE_FILE_HEADER="..." on the compiler command-line. The
+** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The
** header must be exactly 16 bytes including the zero-terminator so
** the string itself should be 15 characters long. If you change
** the header, then your custom library will not be able to read
** databases generated by the standard tools and the standard tools
** will not be able to read databases created by your custom library.
*/
-#ifndef STQLITE_FILE_HEADER /* 123456789 123456 */
-# define STQLITE_FILE_HEADER "STQLite format 3"
+#ifndef SQLITE_FILE_HEADER /* 123456789 123456 */
+# define SQLITE_FILE_HEADER "SQLite format 3"
#endif
/*
@@ -22677,7 +22677,7 @@ struct BtShared {
u8 minEmbedFrac; /* Minimum payload as % of total page size */
u8 minLeafFrac; /* Minimum leaf payload as % of total page size */
u8 pageSizeFixed; /* True if the page size can no longer be changed */
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
u8 autoVacuum; /* True if auto-vacuum is enabled */
u8 incrVacuum; /* True if incr-vacuum is enabled */
Pgno nTrunc; /* Non-zero if the db will be truncated (incr vacuum) */
@@ -22694,7 +22694,7 @@ struct BtShared {
int nTransaction; /* Number of open transactions (read + write) */
void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
void (*xFreeSchema)(void*); /* Destructor for BtShared.pSchema */
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
BtLock *pLock; /* List of locks held on this shared-btree struct */
BtShared *pNext; /* Next in ThreadData.pBtree linked list */
#endif
@@ -22736,7 +22736,7 @@ struct BtCursor {
void *pKey; /* Saved key that was cursor's last known position */
i64 nKey; /* Size of pKey, or last integer key */
int skip; /* (skip<0) -> Prev() is a no-op. (skip>0) -> Next() is */
-#ifndef STQLITE_OMIT_INCRBLOB
+#ifndef SQLITE_OMIT_INCRBLOB
u8 isIncrblobHandle; /* True if this cursor is an incr. io handle */
Pgno *aOverflow; /* Cache of overflow page locations */
#endif
@@ -22769,7 +22769,7 @@ struct BtCursor {
** btree operation when the global variable sqlite3_btree_trace is
** enabled.
*/
-#if STQLITE_TEST
+#if SQLITE_TEST
# define TRACE(X) if( sqlite3_btree_trace ){ printf X; fflush(stdout); }
#else
# define TRACE(X)
@@ -22791,7 +22791,7 @@ struct BtCursor {
** If disk I/O is omitted (meaning that the database is stored purely
** in memory) then there is no pending byte.
*/
-#ifdef STQLITE_OMIT_DISKIO
+#ifdef SQLITE_OMIT_DISKIO
# define PENDING_BYTE_PAGE(pBt) 0x7fffffff
#else
# define PENDING_BYTE_PAGE(pBt) ((PENDING_BYTE/(pBt)->pageSize)+1)
@@ -22888,7 +22888,7 @@ struct BtLock {
** (sqliteMallocRaw), it is not possible to use conditional compilation.
** So, this macro is defined instead.
*/
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
#define ISAUTOVACUUM (pBt->autoVacuum)
#else
#define ISAUTOVACUUM 0
@@ -22921,32 +22921,32 @@ struct IntegrityCk {
/*
** Internal routines that should be accessed by the btree layer only.
*/
-STQLITE_PRIVATE int sqlite3BtreeGetPage(BtShared*, Pgno, MemPage**, int);
-STQLITE_PRIVATE int sqlite3BtreeInitPage(MemPage *pPage, MemPage *pParent);
-STQLITE_PRIVATE void sqlite3BtreeParseCellPtr(MemPage*, u8*, CellInfo*);
-STQLITE_PRIVATE void sqlite3BtreeParseCell(MemPage*, int, CellInfo*);
-STQLITE_PRIVATE u8 *sqlite3BtreeFindCell(MemPage *pPage, int iCell);
-STQLITE_PRIVATE int sqlite3BtreeRestoreOrClearCursorPosition(BtCursor *pCur);
-STQLITE_PRIVATE void sqlite3BtreeGetTempCursor(BtCursor *pCur, BtCursor *pTempCur);
-STQLITE_PRIVATE void sqlite3BtreeReleaseTempCursor(BtCursor *pCur);
-STQLITE_PRIVATE int sqlite3BtreeIsRootPage(MemPage *pPage);
-STQLITE_PRIVATE void sqlite3BtreeMoveToParent(BtCursor *pCur);
+SQLITE_PRIVATE int sqlite3BtreeGetPage(BtShared*, Pgno, MemPage**, int);
+SQLITE_PRIVATE int sqlite3BtreeInitPage(MemPage *pPage, MemPage *pParent);
+SQLITE_PRIVATE void sqlite3BtreeParseCellPtr(MemPage*, u8*, CellInfo*);
+SQLITE_PRIVATE void sqlite3BtreeParseCell(MemPage*, int, CellInfo*);
+SQLITE_PRIVATE u8 *sqlite3BtreeFindCell(MemPage *pPage, int iCell);
+SQLITE_PRIVATE int sqlite3BtreeRestoreOrClearCursorPosition(BtCursor *pCur);
+SQLITE_PRIVATE void sqlite3BtreeGetTempCursor(BtCursor *pCur, BtCursor *pTempCur);
+SQLITE_PRIVATE void sqlite3BtreeReleaseTempCursor(BtCursor *pCur);
+SQLITE_PRIVATE int sqlite3BtreeIsRootPage(MemPage *pPage);
+SQLITE_PRIVATE void sqlite3BtreeMoveToParent(BtCursor *pCur);
/************** End of btreeInt.h ********************************************/
/************** Continuing where we left off in btree.c **********************/
/*
** The header string that appears at the beginning of every
-** STQLite database.
+** SQLite database.
*/
-static const char zMagicHeader[] = STQLITE_FILE_HEADER;
+static const char zMagicHeader[] = SQLITE_FILE_HEADER;
/*
** Set this global variable to 1 to enable tracing using the TRACE
** macro.
*/
-#if STQLITE_TEST
+#if SQLITE_TEST
int sqlite3_btree_trace=0; /* True to enable tracing */
#endif
@@ -22956,7 +22956,7 @@ int sqlite3_btree_trace=0; /* True to enable tracing */
static int checkReadLocks(Btree*,Pgno,BtCursor*);
-#ifdef STQLITE_OMIT_SHARED_CACHE
+#ifdef SQLITE_OMIT_SHARED_CACHE
/*
** The functions queryTableLock(), lockTable() and unlockAllTables()
** manipulate entries in the BtShared.pLock linked list used to store
@@ -22965,16 +22965,16 @@ static int checkReadLocks(Btree*,Pgno,BtCursor*);
** of each BtShared structure and so this locking is not necessary.
** So define the lock related functions as no-ops.
*/
- #define queryTableLock(a,b,c) STQLITE_OK
- #define lockTable(a,b,c) STQLITE_OK
+ #define queryTableLock(a,b,c) SQLITE_OK
+ #define lockTable(a,b,c) SQLITE_OK
#define unlockAllTables(a)
#else
/*
** Query to see if btree handle p may obtain a lock of type eLock
** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
-** STQLITE_OK if the lock may be obtained (by calling lockTable()), or
-** STQLITE_LOCKED if not.
+** SQLITE_OK if the lock may be obtained (by calling lockTable()), or
+** SQLITE_LOCKED if not.
*/
static int queryTableLock(Btree *p, Pgno iTab, u8 eLock){
BtShared *pBt = p->pBt;
@@ -22982,7 +22982,7 @@ static int queryTableLock(Btree *p, Pgno iTab, u8 eLock){
/* This is a no-op if the shared-cache is not enabled */
if( 0==sqlite3ThreadDataReadOnly()->useSharedData ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* This (along with lockTable()) is where the ReadUncommitted flag is
@@ -23001,18 +23001,18 @@ static int queryTableLock(Btree *p, Pgno iTab, u8 eLock){
*/
if(
!p->pSqlite ||
- 0==(p->pSqlite->flags&STQLITE_ReadUncommitted) ||
+ 0==(p->pSqlite->flags&SQLITE_ReadUncommitted) ||
eLock==WRITE_LOCK ||
iTab==MASTER_ROOT
){
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){
if( pIter->pBtree!=p && pIter->iTable==iTab &&
(pIter->eLock!=eLock || eLock!=READ_LOCK) ){
- return STQLITE_LOCKED;
+ return SQLITE_LOCKED;
}
}
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -23020,8 +23020,8 @@ static int queryTableLock(Btree *p, Pgno iTab, u8 eLock){
** by Btree handle p. Parameter eLock must be either READ_LOCK or
** WRITE_LOCK.
**
-** STQLITE_OK is returned if the lock is added successfully. STQLITE_BUSY and
-** STQLITE_NOMEM may also be returned.
+** SQLITE_OK is returned if the lock is added successfully. SQLITE_BUSY and
+** SQLITE_NOMEM may also be returned.
*/
static int lockTable(Btree *p, Pgno iTable, u8 eLock){
BtShared *pBt = p->pBt;
@@ -23030,10 +23030,10 @@ static int lockTable(Btree *p, Pgno iTable, u8 eLock){
/* This is a no-op if the shared-cache is not enabled */
if( 0==sqlite3ThreadDataReadOnly()->useSharedData ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
- assert( STQLITE_OK==queryTableLock(p, iTable, eLock) );
+ assert( SQLITE_OK==queryTableLock(p, iTable, eLock) );
/* If the read-uncommitted flag is set and a read-lock is requested,
** return early without adding an entry to the BtShared.pLock list. See
@@ -23042,11 +23042,11 @@ static int lockTable(Btree *p, Pgno iTable, u8 eLock){
*/
if(
(p->pSqlite) &&
- (p->pSqlite->flags&STQLITE_ReadUncommitted) &&
+ (p->pSqlite->flags&SQLITE_ReadUncommitted) &&
(eLock==READ_LOCK) &&
iTable!=MASTER_ROOT
){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* First search the list for an existing lock on this table. */
@@ -23063,7 +23063,7 @@ static int lockTable(Btree *p, Pgno iTable, u8 eLock){
if( !pLock ){
pLock = (BtLock *)sqliteMalloc(sizeof(BtLock));
if( !pLock ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
pLock->iTable = iTable;
pLock->pBtree = p;
@@ -23080,7 +23080,7 @@ static int lockTable(Btree *p, Pgno iTable, u8 eLock){
pLock->eLock = eLock;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -23106,11 +23106,11 @@ static void unlockAllTables(Btree *p){
}
}
}
-#endif /* STQLITE_OMIT_SHARED_CACHE */
+#endif /* SQLITE_OMIT_SHARED_CACHE */
static void releasePage(MemPage *pPage); /* Forward reference */
-#ifndef STQLITE_OMIT_INCRBLOB
+#ifndef SQLITE_OMIT_INCRBLOB
/*
** Invalidate the overflow page-list cache for cursor pCur, if any.
*/
@@ -23152,22 +23152,22 @@ static int saveCursorPosition(BtCursor *pCur){
** table, then malloc space for and store the pCur->nKey bytes of key
** data.
*/
- if( rc==STQLITE_OK && 0==pCur->pPage->intKey){
+ if( rc==SQLITE_OK && 0==pCur->pPage->intKey){
void *pKey = sqliteMalloc(pCur->nKey);
if( pKey ){
rc = sqlite3BtreeKey(pCur, 0, pCur->nKey, pKey);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pCur->pKey = pKey;
}else{
sqliteFree(pKey);
}
}else{
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
}
}
assert( !pCur->pPage->intKey || !pCur->pKey );
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
releasePage(pCur->pPage);
pCur->pPage = 0;
pCur->eState = CURSOR_RETQUIRESEEK;
@@ -23188,12 +23188,12 @@ static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor *pExcept){
if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) &&
p->eState==CURSOR_VALID ){
int rc = saveCursorPosition(p);
- if( STQLITE_OK!=rc ){
+ if( SQLITE_OK!=rc ){
return rc;
}
}
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -23216,17 +23216,17 @@ static void clearCursorPosition(BtCursor *pCur){
** returning the cursor to it's saved position, any saved position is deleted
** and the cursor state set to CURSOR_INVALID.
*/
-STQLITE_PRIVATE int sqlite3BtreeRestoreOrClearCursorPosition(BtCursor *pCur){
+SQLITE_PRIVATE int sqlite3BtreeRestoreOrClearCursorPosition(BtCursor *pCur){
int rc;
assert( pCur->eState==CURSOR_RETQUIRESEEK );
-#ifndef STQLITE_OMIT_INCRBLOB
+#ifndef SQLITE_OMIT_INCRBLOB
if( pCur->isIncrblobHandle ){
- return STQLITE_ABORT;
+ return SQLITE_ABORT;
}
#endif
pCur->eState = CURSOR_INVALID;
rc = sqlite3BtreeMoveto(pCur, pCur->pKey, pCur->nKey, 0, &pCur->skip);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqliteFree(pCur->pKey);
pCur->pKey = 0;
assert( pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_INVALID );
@@ -23237,9 +23237,9 @@ STQLITE_PRIVATE int sqlite3BtreeRestoreOrClearCursorPosition(BtCursor *pCur){
#define restoreOrClearCursorPosition(p) \
(p->eState==CURSOR_RETQUIRESEEK ? \
sqlite3BtreeRestoreOrClearCursorPosition(p) : \
- STQLITE_OK)
+ SQLITE_OK)
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/*
** Given a page number of a regular database page, return the page
** number for the pointer-map page that contains the entry for the
@@ -23260,7 +23260,7 @@ static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){
**
** This routine updates the pointer map entry for page number 'key'
** so that it maps to type 'eType' and parent page number 'pgno'.
-** An error code is returned if something goes wrong, otherwise STQLITE_OK.
+** An error code is returned if something goes wrong, otherwise SQLITE_OK.
*/
static int ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent){
DbPage *pDbPage; /* The pointer map page */
@@ -23274,11 +23274,11 @@ static int ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent){
assert( pBt->autoVacuum );
if( key==0 ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
iPtrmap = PTRMAP_PAGENO(pBt, key);
rc = sqlite3PagerGet(pBt->pPager, iPtrmap, &pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
offset = PTRMAP_PTROFFSET(pBt, key);
@@ -23287,7 +23287,7 @@ static int ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent){
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){
TRACE(("PTRMAP_UPDATE: %d->(%d,%d)\n", key, eType, parent));
rc = sqlite3PagerWrite(pDbPage);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pPtrmap[offset] = eType;
put4byte(&pPtrmap[offset+1], parent);
}
@@ -23302,7 +23302,7 @@ static int ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent){
**
** This routine retrieves the pointer map entry for page 'key', writing
** the type and parent page number to *pEType and *pPgno respectively.
-** An error code is returned if something goes wrong, otherwise STQLITE_OK.
+** An error code is returned if something goes wrong, otherwise SQLITE_OK.
*/
static int ptrmapGet(BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno){
DbPage *pDbPage; /* The pointer map page */
@@ -23324,11 +23324,11 @@ static int ptrmapGet(BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno){
if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]);
sqlite3PagerUnref(pDbPage);
- if( *pEType<1 || *pEType>5 ) return STQLITE_CORRUPT_BKPT;
- return STQLITE_OK;
+ if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_BKPT;
+ return SQLITE_OK;
}
-#endif /* STQLITE_OMIT_AUTOVACUUM */
+#endif /* SQLITE_OMIT_AUTOVACUUM */
/*
** Given a btree page and a cell index (0 means the first cell on
@@ -23339,7 +23339,7 @@ static int ptrmapGet(BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno){
*/
#define findCell(pPage, iCell) \
((pPage)->aData + get2byte(&(pPage)->aData[(pPage)->cellOffset+2*(iCell)]))
-STQLITE_PRIVATE u8 *sqlite3BtreeFindCell(MemPage *pPage, int iCell){
+SQLITE_PRIVATE u8 *sqlite3BtreeFindCell(MemPage *pPage, int iCell){
assert( iCell>=0 );
assert( iCell<get2byte(&pPage->aData[pPage->hdrOffset+3]) );
return findCell(pPage, iCell);
@@ -23375,7 +23375,7 @@ static u8 *findOverflowCell(MemPage *pPage, int iCell){
** Within this file, the parseCell() macro can be called instead of
** sqlite3BtreeParseCellPtr(). Using some compilers, this will be faster.
*/
-STQLITE_PRIVATE void sqlite3BtreeParseCellPtr(
+SQLITE_PRIVATE void sqlite3BtreeParseCellPtr(
MemPage *pPage, /* Page containing the cell */
u8 *pCell, /* Pointer to the cell text. */
CellInfo *pInfo /* Fill in this structure */
@@ -23443,7 +23443,7 @@ STQLITE_PRIVATE void sqlite3BtreeParseCellPtr(
}
#define parseCell(pPage, iCell, pInfo) \
sqlite3BtreeParseCellPtr((pPage), findCell((pPage), (iCell)), (pInfo))
-STQLITE_PRIVATE void sqlite3BtreeParseCell(
+SQLITE_PRIVATE void sqlite3BtreeParseCell(
MemPage *pPage, /* Page containing the cell */
int iCell, /* The cell index. First cell is 0 */
CellInfo *pInfo /* Fill in this structure */
@@ -23470,7 +23470,7 @@ static int cellSizePtr(MemPage *pPage, u8 *pCell){
return info.nSize;
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/*
** If the cell pCell, part of page pPage contains a pointer
** to an overflow page, insert an entry into the pointer-map
@@ -23486,7 +23486,7 @@ static int ptrmapPutOvflPtr(MemPage *pPage, u8 *pCell){
return ptrmapPut(pPage->pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno);
}
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** If the cell with index iCell on page pPage contains a pointer
@@ -23522,10 +23522,10 @@ static int defragmentPage(MemPage *pPage){
assert( sqlite3PagerIswriteable(pPage->pDbPage) );
assert( pPage->pBt!=0 );
- assert( pPage->pBt->usableSize <= STQLITE_MAX_PAGE_SIZE );
+ assert( pPage->pBt->usableSize <= SQLITE_MAX_PAGE_SIZE );
assert( pPage->nOverflow==0 );
temp = sqliteMalloc( pPage->pBt->pageSize );
- if( temp==0 ) return STQLITE_NOMEM;
+ if( temp==0 ) return SQLITE_NOMEM;
data = pPage->aData;
hdr = pPage->hdrOffset;
cellOffset = pPage->cellOffset;
@@ -23553,7 +23553,7 @@ static int defragmentPage(MemPage *pPage){
addr = cellOffset+2*nCell;
memset(&data[addr], 0, brk-addr);
sqliteFree(temp);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -23640,7 +23640,7 @@ static void freeSpace(MemPage *pPage, int start, int size){
assert( (start + size)<=pPage->pBt->usableSize );
if( size<4 ) size = 4;
-#ifdef STQLITE_SECURE_DELETE
+#ifdef SQLITE_SECURE_DELETE
/* Overwrite deleted information with zeros when the SECURE_DELETE
** option is enabled at compile-time */
memset(&data[start], 0, size);
@@ -23722,13 +23722,13 @@ static void decodeFlags(MemPage *pPage, int flagByte){
** is the parent of the page being initialized. The root of a
** BTree has no parent and so for that page, pParent==NULL.
**
-** Return STQLITE_OK on success. If we see that the page does
+** Return SQLITE_OK on success. If we see that the page does
** not contain a well-formed database page, then return
-** STQLITE_CORRUPT. Note that a return of STQLITE_OK does not
+** SQLITE_CORRUPT. Note that a return of SQLITE_OK does not
** guarantee that the page is well-formed. It only shows that
** we failed to detect any corruption.
*/
-STQLITE_PRIVATE int sqlite3BtreeInitPage(
+SQLITE_PRIVATE int sqlite3BtreeInitPage(
MemPage *pPage, /* The page to be initialized */
MemPage *pParent /* The parent. Might be NULL */
){
@@ -23748,9 +23748,9 @@ STQLITE_PRIVATE int sqlite3BtreeInitPage(
assert( pPage->aData == &((unsigned char*)pPage)[-pBt->pageSize] );
if( pPage->pParent!=pParent && (pPage->pParent!=0 || pPage->isInit) ){
/* The parent page should never change unless the file is corrupt */
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
- if( pPage->isInit ) return STQLITE_OK;
+ if( pPage->isInit ) return SQLITE_OK;
if( pPage->pParent==0 && pParent!=0 ){
pPage->pParent = pParent;
sqlite3PagerRef(pParent->pDbPage);
@@ -23766,11 +23766,11 @@ STQLITE_PRIVATE int sqlite3BtreeInitPage(
pPage->nCell = get2byte(&data[hdr+3]);
if( pPage->nCell>MX_CELL(pBt) ){
/* To many cells for a single page. The page must be corrupt */
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
if( pPage->nCell==0 && pParent!=0 && pParent->pgno!=1 ){
/* All pages must have at least one cell, except for root pages */
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
/* Compute the total free space on the page */
@@ -23780,13 +23780,13 @@ STQLITE_PRIVATE int sqlite3BtreeInitPage(
int next, size;
if( pc>usableSize-4 ){
/* Free block is off the page */
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
next = get2byte(&data[pc]);
size = get2byte(&data[pc+2]);
if( next>0 && next<=pc+size+3 ){
/* Free blocks must be in accending order */
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
nFree += size;
pc = next;
@@ -23794,11 +23794,11 @@ STQLITE_PRIVATE int sqlite3BtreeInitPage(
pPage->nFree = nFree;
if( nFree>=usableSize ){
/* Free space cannot exceed total page size */
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
pPage->isInit = 1;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -23841,7 +23841,7 @@ static void zeroPage(MemPage *pPage, int flags){
** means we have started to be concerned about content and the disk
** read should occur at that point.
*/
-STQLITE_PRIVATE int sqlite3BtreeGetPage(
+SQLITE_PRIVATE int sqlite3BtreeGetPage(
BtShared *pBt, /* The btree */
Pgno pgno, /* Number of the page to fetch */
MemPage **ppPage, /* Return the page in this parameter */
@@ -23860,7 +23860,7 @@ STQLITE_PRIVATE int sqlite3BtreeGetPage(
pPage->pgno = pgno;
pPage->hdrOffset = pPage->pgno==1 ? 100 : 0;
*ppPage = pPage;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -23876,10 +23876,10 @@ static int getAndInitPage(
){
int rc;
if( pgno==0 ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
rc = sqlite3BtreeGetPage(pBt, pgno, ppPage, 0);
- if( rc==STQLITE_OK && (*ppPage)->isInit==0 ){
+ if( rc==SQLITE_OK && (*ppPage)->isInit==0 ){
rc = sqlite3BtreeInitPage(*ppPage, pParent);
}
return rc;
@@ -23940,7 +23940,7 @@ static void pageReinit(DbPage *pData, int pageSize){
** a new database with a random name is created. This randomly named
** database file will be deleted when sqlite3BtreeClose() is called.
*/
-STQLITE_PRIVATE int sqlite3BtreeOpen(
+SQLITE_PRIVATE int sqlite3BtreeOpen(
const char *zFilename, /* Name of the file containing the BTree database */
sqlite3 *pSqlite, /* Associated database handle */
Btree **ppBtree, /* Pointer to new Btree object written here */
@@ -23948,10 +23948,10 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
){
BtShared *pBt; /* Shared part of btree structure */
Btree *p; /* Handle to return */
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
int nReserve;
unsigned char zDbHeader[100];
-#if !defined(STQLITE_OMIT_SHARED_CACHE) && !defined(STQLITE_OMIT_DISKIO)
+#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
const ThreadData *pTsdro;
#endif
@@ -23960,8 +23960,8 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
** either of the shared-data or autovacuum features are compiled
** into the library.
*/
-#if !defined(STQLITE_OMIT_SHARED_CACHE) || !defined(STQLITE_OMIT_AUTOVACUUM)
- #ifdef STQLITE_OMIT_MEMORYDB
+#if !defined(SQLITE_OMIT_SHARED_CACHE) || !defined(SQLITE_OMIT_AUTOVACUUM)
+ #ifdef SQLITE_OMIT_MEMORYDB
const int isMemdb = 0;
#else
const int isMemdb = zFilename && !strcmp(zFilename, ":memory:");
@@ -23970,19 +23970,19 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
p = sqliteMalloc(sizeof(Btree));
if( !p ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
p->inTrans = TRANS_NONE;
p->pSqlite = pSqlite;
/* Try to find an existing Btree structure opened on zFilename. */
-#if !defined(STQLITE_OMIT_SHARED_CACHE) && !defined(STQLITE_OMIT_DISKIO)
+#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
pTsdro = sqlite3ThreadDataReadOnly();
if( pTsdro->useSharedData && zFilename && !isMemdb ){
char *zFullPathname = sqlite3OsFullPathname(zFilename);
if( !zFullPathname ){
sqliteFree(p);
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
for(pBt=pTsdro->pBtree; pBt; pBt=pBt->pNext){
assert( pBt->nRef>0 );
@@ -23991,7 +23991,7 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
*ppBtree = p;
pBt->nRef++;
sqliteFree(zFullPathname);
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
sqliteFree(zFullPathname);
@@ -24011,14 +24011,14 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
pBt = sqliteMalloc( sizeof(*pBt) );
if( pBt==0 ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto btree_open_out;
}
rc = sqlite3PagerOpen(&pBt->pPager, zFilename, EXTRA_SIZE, flags);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3PagerReadFileheader(pBt->pPager,sizeof(zDbHeader),zDbHeader);
}
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto btree_open_out;
}
p->pBt = pBt;
@@ -24029,22 +24029,22 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
pBt->pPage1 = 0;
pBt->readOnly = sqlite3PagerIsreadonly(pBt->pPager);
pBt->pageSize = get2byte(&zDbHeader[16]);
- if( pBt->pageSize<512 || pBt->pageSize>STQLITE_MAX_PAGE_SIZE
+ if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE
|| ((pBt->pageSize-1)&pBt->pageSize)!=0 ){
- pBt->pageSize = STQLITE_DEFAULT_PAGE_SIZE;
+ pBt->pageSize = SQLITE_DEFAULT_PAGE_SIZE;
pBt->maxEmbedFrac = 64; /* 25% */
pBt->minEmbedFrac = 32; /* 12.5% */
pBt->minLeafFrac = 32; /* 12.5% */
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/* If the magic name ":memory:" will create an in-memory database, then
** leave the autoVacuum mode at 0 (do not auto-vacuum), even if
- ** STQLITE_DEFAULT_AUTOVACUUM is true. On the other hand, if
- ** STQLITE_OMIT_MEMORYDB has been defined, then ":memory:" is just a
+ ** SQLITE_DEFAULT_AUTOVACUUM is true. On the other hand, if
+ ** SQLITE_OMIT_MEMORYDB has been defined, then ":memory:" is just a
** regular file-name. In this case the auto-vacuum applies as per normal.
*/
if( zFilename && !isMemdb ){
- pBt->autoVacuum = (STQLITE_DEFAULT_AUTOVACUUM ? 1 : 0);
- pBt->incrVacuum = (STQLITE_DEFAULT_AUTOVACUUM==2 ? 1 : 0);
+ pBt->autoVacuum = (SQLITE_DEFAULT_AUTOVACUUM ? 1 : 0);
+ pBt->incrVacuum = (SQLITE_DEFAULT_AUTOVACUUM==2 ? 1 : 0);
}
#endif
nReserve = 0;
@@ -24054,7 +24054,7 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
pBt->minEmbedFrac = zDbHeader[22];
pBt->minLeafFrac = zDbHeader[23];
pBt->pageSizeFixed = 1;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
pBt->autoVacuum = (get4byte(&zDbHeader[36 + 4*4])?1:0);
pBt->incrVacuum = (get4byte(&zDbHeader[36 + 7*4])?1:0);
#endif
@@ -24063,7 +24063,7 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
assert( (pBt->pageSize & 7)==0 ); /* 8-byte tqalignment of pageSize */
sqlite3PagerSetPagesize(pBt->pPager, pBt->pageSize);
-#if !defined(STQLITE_OMIT_SHARED_CACHE) && !defined(STQLITE_OMIT_DISKIO)
+#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
/* Add the new btree to the linked list starting at ThreadData.pBtree.
** There is no chance that a malloc() may fail inside of the
** sqlite3ThreadData() call, as the ThreadData structure must have already
@@ -24078,7 +24078,7 @@ STQLITE_PRIVATE int sqlite3BtreeOpen(
*ppBtree = p;
btree_open_out:
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
if( pBt && pBt->pPager ){
sqlite3PagerClose(pBt->pPager);
}
@@ -24092,11 +24092,11 @@ btree_open_out:
/*
** Close an open database and tqinvalidate all cursors.
*/
-STQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
BtShared *pBt = p->pBt;
BtCursor *pCur;
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
ThreadData *pTsd;
#endif
@@ -24117,7 +24117,7 @@ STQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
sqlite3BtreeRollback(p);
sqliteFree(p);
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
/* If there are still other outstanding references to the shared-btree
** structure, return now. The remainder of this procedure cleans
** up the shared-btree.
@@ -24125,7 +24125,7 @@ STQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
assert( pBt->nRef>0 );
pBt->nRef--;
if( pBt->nRef ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* Remove the shared-btree from the thread wide list. Call
@@ -24154,17 +24154,17 @@ STQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
}
sqliteFree(pBt->pSchema);
sqliteFree(pBt);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Change the busy handler callback function.
*/
-STQLITE_PRIVATE int sqlite3BtreeSetBusyHandler(Btree *p, BusyHandler *pHandler){
+SQLITE_PRIVATE int sqlite3BtreeSetBusyHandler(Btree *p, BusyHandler *pHandler){
BtShared *pBt = p->pBt;
pBt->pBusyHandler = pHandler;
sqlite3PagerSetBusyhandler(pBt->pPager, pHandler);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -24182,10 +24182,10 @@ STQLITE_PRIVATE int sqlite3BtreeSetBusyHandler(Btree *p, BusyHandler *pHandler){
** Synchronous is on by default so database corruption is not
** normally a worry.
*/
-STQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
+SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
BtShared *pBt = p->pBt;
sqlite3PagerSetCachesize(pBt->pPager, mxPage);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -24196,11 +24196,11 @@ STQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
** is a very low but non-zero probability of damage. Level 3 reduces the
** probability of damage to near zero but with a write performance reduction.
*/
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
-STQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree *p, int level, int fullSync){
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+SQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree *p, int level, int fullSync){
BtShared *pBt = p->pBt;
sqlite3PagerSetSafetyLevel(pBt->pPager, level, fullSync);
- return STQLITE_OK;
+ return SQLITE_OK;
}
#endif
@@ -24208,13 +24208,13 @@ STQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree *p, int level, int fullSync
** Return TRUE if the given btree is set to safety level 1. In other
** words, return TRUE if no sync() occurs on the disk files.
*/
-STQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree *p){
BtShared *pBt = p->pBt;
assert( pBt && pBt->pPager );
return sqlite3PagerNosync(pBt->pPager);
}
-#if !defined(STQLITE_OMIT_PAGER_PRAGMAS) || !defined(STQLITE_OMIT_VACUUM)
+#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM)
/*
** Change the default pages size and the number of reserved bytes per page.
**
@@ -24230,31 +24230,31 @@ STQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree *p){
** If parameter nReserve is less than zero, then the number of reserved
** bytes per page is left unchanged.
*/
-STQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve){
+SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve){
BtShared *pBt = p->pBt;
if( pBt->pageSizeFixed ){
- return STQLITE_READONLY;
+ return SQLITE_READONLY;
}
if( nReserve<0 ){
nReserve = pBt->pageSize - pBt->usableSize;
}
- if( pageSize>=512 && pageSize<=STQLITE_MAX_PAGE_SIZE &&
+ if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE &&
((pageSize-1)&pageSize)==0 ){
assert( (pageSize & 7)==0 );
assert( !pBt->pPage1 && !pBt->pCursor );
pBt->pageSize = sqlite3PagerSetPagesize(pBt->pPager, pageSize);
}
pBt->usableSize = pBt->pageSize - nReserve;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Return the currently defined page size
*/
-STQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *p){
return p->pBt->pageSize;
}
-STQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree *p){
return p->pBt->pageSize - p->pBt->usableSize;
}
@@ -24263,28 +24263,28 @@ STQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree *p){
** No changes are made if mxPage is 0 or negative.
** Regardless of the value of mxPage, return the maximum page count.
*/
-STQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree *p, int mxPage){
+SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree *p, int mxPage){
return sqlite3PagerMaxPageCount(p->pBt->pPager, mxPage);
}
-#endif /* !defined(STQLITE_OMIT_PAGER_PRAGMAS) || !defined(STQLITE_OMIT_VACUUM) */
+#endif /* !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) */
/*
** Change the 'auto-vacuum' property of the database. If the 'autoVacuum'
** parameter is non-zero, then auto-vacuum mode is enabled. If zero, it
** is disabled. The default value for the auto-vacuum property is
-** determined by the STQLITE_DEFAULT_AUTOVACUUM macro.
+** determined by the SQLITE_DEFAULT_AUTOVACUUM macro.
*/
-STQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){
-#ifdef STQLITE_OMIT_AUTOVACUUM
- return STQLITE_READONLY;
+SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ return SQLITE_READONLY;
#else
BtShared *pBt = p->pBt;
int av = (autoVacuum?1:0);
if( pBt->pageSizeFixed && av!=pBt->autoVacuum ){
- return STQLITE_READONLY;
+ return SQLITE_READONLY;
}
pBt->autoVacuum = av;
- return STQLITE_OK;
+ return SQLITE_OK;
#endif
}
@@ -24292,8 +24292,8 @@ STQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){
** Return the value of the 'auto-vacuum' property. If auto-vacuum is
** enabled 1 is returned. Otherwise 0.
*/
-STQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *p){
-#ifdef STQLITE_OMIT_AUTOVACUUM
+SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *p){
+#ifdef SQLITE_OMIT_AUTOVACUUM
return BTREE_AUTOVACUUM_NONE;
#else
return (
@@ -24309,23 +24309,23 @@ STQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *p){
** Get a reference to pPage1 of the database file. This will
** also acquire a readlock on that file.
**
-** STQLITE_OK is returned on success. If the file is not a
-** well-formed database file, then STQLITE_CORRUPT is returned.
-** STQLITE_BUSY is returned if the database is locked. STQLITE_NOMEM
+** SQLITE_OK is returned on success. If the file is not a
+** well-formed database file, then SQLITE_CORRUPT is returned.
+** SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM
** is returned if we run out of memory.
*/
static int lockBtree(BtShared *pBt){
int rc, pageSize;
MemPage *pPage1;
- if( pBt->pPage1 ) return STQLITE_OK;
+ if( pBt->pPage1 ) return SQLITE_OK;
rc = sqlite3BtreeGetPage(pBt, 1, &pPage1, 0);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
/* Do some checking to help insure the file we opened really is
** a valid database file.
*/
- rc = STQLITE_NOTADB;
+ rc = SQLITE_NOTADB;
if( sqlite3PagerPagecount(pBt->pPager)>0 ){
u8 *page1 = pPage1->aData;
if( memcmp(page1, zMagicHeader, 16)!=0 ){
@@ -24350,7 +24350,7 @@ static int lockBtree(BtShared *pBt){
pBt->maxEmbedFrac = page1[21];
pBt->minEmbedFrac = page1[22];
pBt->minLeafFrac = page1[23];
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
pBt->autoVacuum = (get4byte(&page1[36 + 4*4])?1:0);
pBt->incrVacuum = (get4byte(&page1[36 + 7*4])?1:0);
#endif
@@ -24378,7 +24378,7 @@ static int lockBtree(BtShared *pBt){
}
assert( pBt->maxLeaf + 23 <= MX_CELL_SIZE(pBt) );
pBt->pPage1 = pPage1;
- return STQLITE_OK;
+ return SQLITE_OK;
page1_init_failed:
releasePage(pPage1);
@@ -24391,14 +24391,14 @@ page1_init_failed:
** busy callback if there is lock contention.
*/
static int lockBtreeWithRetry(Btree *pRef){
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
if( pRef->inTrans==TRANS_NONE ){
u8 inTransaction = pRef->pBt->inTransaction;
btreeIntegrity(pRef);
rc = sqlite3BtreeBeginTrans(pRef, 0);
pRef->pBt->inTransaction = inTransaction;
pRef->inTrans = TRANS_NONE;
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pRef->pBt->nTransaction--;
}
btreeIntegrity(pRef);
@@ -24441,7 +24441,7 @@ static int newDatabase(BtShared *pBt){
MemPage *pP1;
unsigned char *data;
int rc;
- if( sqlite3PagerPagecount(pBt->pPager)>0 ) return STQLITE_OK;
+ if( sqlite3PagerPagecount(pBt->pPager)>0 ) return SQLITE_OK;
pP1 = pBt->pPage1;
assert( pP1!=0 );
data = pP1->aData;
@@ -24459,13 +24459,13 @@ static int newDatabase(BtShared *pBt){
memset(&data[24], 0, 100-24);
zeroPage(pP1, PTF_INTKEY|PTF_LEAF|PTF_LEAFDATA );
pBt->pageSizeFixed = 1;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
assert( pBt->autoVacuum==1 || pBt->autoVacuum==0 );
assert( pBt->incrVacuum==1 || pBt->incrVacuum==0 );
put4byte(&data[36 + 4*4], pBt->autoVacuum);
put4byte(&data[36 + 7*4], pBt->incrVacuum);
#endif
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -24492,20 +24492,20 @@ static int newDatabase(BtShared *pBt){
** If an initial attempt to acquire the lock fails because of lock contention
** and the database was previously unlocked, then invoke the busy handler
** if there is one. But if there was previously a read-lock, do not
-** invoke the busy handler - just return STQLITE_BUSY. STQLITE_BUSY is
+** invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is
** returned when there is already a read-lock in order to avoid a deadlock.
**
** Suppose there are two processes A and B. A has a read lock and B has
** a reserved lock. B tries to promote to exclusive but is blocked because
** of A's read lock. A tries to promote to reserved but is blocked by B.
** One or the other of the two processes must give way or there can be
-** no progress. By returning STQLITE_BUSY and not invoking the busy callback
+** no progress. By returning SQLITE_BUSY and not invoking the busy callback
** when A already has a read lock, we encourage A to give up and let B
** proceed.
*/
-STQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
+SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
BtShared *pBt = p->pBt;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
btreeIntegrity(p);
@@ -24514,20 +24514,20 @@ STQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
** is requested, this is a no-op.
*/
if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
/* Write transactions are not possible on a read-only database */
if( pBt->readOnly && wrflag ){
- return STQLITE_READONLY;
+ return SQLITE_READONLY;
}
/* If another database handle has already opened a write transaction
** on this shared-btree structure and a second write transaction is
- ** requested, return STQLITE_BUSY.
+ ** requested, return SQLITE_BUSY.
*/
if( pBt->inTransaction==TRANS_WRITE && wrflag ){
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
}
do {
@@ -24535,26 +24535,26 @@ STQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
rc = lockBtree(pBt);
}
- if( rc==STQLITE_OK && wrflag ){
+ if( rc==SQLITE_OK && wrflag ){
if( pBt->readOnly ){
- rc = STQLITE_READONLY;
+ rc = SQLITE_READONLY;
}else{
rc = sqlite3PagerBegin(pBt->pPage1->pDbPage, wrflag>1);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = newDatabase(pBt);
}
}
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
if( wrflag ) pBt->inStmt = 0;
}else{
unlockBtreeIfUnused(pBt);
}
- }while( rc==STQLITE_BUSY && pBt->inTransaction==TRANS_NONE &&
+ }while( rc==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE &&
sqlite3InvokeBusyHandler(pBt->pBusyHandler) );
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
if( p->inTrans==TRANS_NONE ){
pBt->nTransaction++;
}
@@ -24568,7 +24568,7 @@ STQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
return rc;
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/*
** Set the pointer-map entries for all tqchildren of page pPage. Also, if
@@ -24584,7 +24584,7 @@ static int setChildPtrmaps(MemPage *pPage){
Pgno pgno = pPage->pgno;
rc = sqlite3BtreeInitPage(pPage, pPage->pParent);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto set_child_ptrmaps_out;
}
nCell = pPage->nCell;
@@ -24593,14 +24593,14 @@ static int setChildPtrmaps(MemPage *pPage){
u8 *pCell = findCell(pPage, i);
rc = ptrmapPutOvflPtr(pPage, pCell);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto set_child_ptrmaps_out;
}
if( !pPage->leaf ){
Pgno childPgno = get4byte(pCell);
rc = ptrmapPut(pBt, childPgno, PTRMAP_BTREE, pgno);
- if( rc!=STQLITE_OK ) goto set_child_ptrmaps_out;
+ if( rc!=SQLITE_OK ) goto set_child_ptrmaps_out;
}
}
@@ -24633,7 +24633,7 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){
if( eType==PTRMAP_OVERFLOW2 ){
/* The pointer is always the first 4 bytes of the page in this case. */
if( get4byte(pPage->aData)!=iFrom ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
put4byte(pPage->aData, iTo);
}else{
@@ -24666,14 +24666,14 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){
if( i==nCell ){
if( eType!=PTRMAP_BTREE ||
get4byte(&pPage->aData[pPage->hdrOffset+8])!=iFrom ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
put4byte(&pPage->aData[pPage->hdrOffset+8], iTo);
}
pPage->isInit = isInitOrig;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
@@ -24700,7 +24700,7 @@ static int relocatePage(
TRACE(("AUTOVACUUM: Moving %d to free page %d (ptr page %d type %d)\n",
iDbPage, iFreePage, iPtrPage, eType));
rc = sqlite3PagerMovepage(pPager, pDbPage->pDbPage, iFreePage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
pDbPage->pgno = iFreePage;
@@ -24715,14 +24715,14 @@ static int relocatePage(
*/
if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){
rc = setChildPtrmaps(pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
}else{
Pgno nextOvfl = get4byte(pDbPage->aData);
if( nextOvfl!=0 ){
rc = ptrmapPut(pBt, nextOvfl, PTRMAP_OVERFLOW2, iFreePage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
}
@@ -24734,17 +24734,17 @@ static int relocatePage(
*/
if( eType!=PTRMAP_ROOTPAGE ){
rc = sqlite3BtreeGetPage(pBt, iPtrPage, &pPtrPage, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = sqlite3PagerWrite(pPtrPage->pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(pPtrPage);
return rc;
}
rc = modifyPagePointer(pPtrPage, iDbPage, iFreePage, eType);
releasePage(pPtrPage);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = ptrmapPut(pBt, iFreePage, eType, iPtrPage);
}
}
@@ -24756,8 +24756,8 @@ static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8);
/*
** Perform a single step of an incremental-vacuum. If successful,
-** return STQLITE_OK. If there is no work to do (and therefore no
-** point in calling this function again), return STQLITE_DONE.
+** return SQLITE_OK. If there is no work to do (and therefore no
+** point in calling this function again), return SQLITE_DONE.
**
** More specificly, this function attempts to re-organize the
** database so that the last page of the file currently in use
@@ -24765,7 +24765,7 @@ static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8);
**
** If the nFin parameter is non-zero, the implementation assumes
** that the caller will keep calling incrVacuumStep() until
-** it returns STQLITE_DONE or an error, and that nFin is the
+** it returns SQLITE_DONE or an error, and that nFin is the
** number of pages the database file will contain after this
** process is complete.
*/
@@ -24785,15 +24785,15 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin){
nFreeList = get4byte(&pBt->pPage1->aData[36]);
if( nFreeList==0 || nFin==iLastPg ){
- return STQLITE_DONE;
+ return SQLITE_DONE;
}
rc = ptrmapGet(pBt, iLastPg, &eType, &iPtrPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
if( eType==PTRMAP_ROOTPAGE ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
if( eType==PTRMAP_FREEPAGE ){
@@ -24806,7 +24806,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin){
Pgno iFreePg;
MemPage *pFreePg;
rc = allocateBtreePage(pBt, &pFreePg, &iFreePg, iLastPg, 1);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
assert( iFreePg==iLastPg );
@@ -24817,7 +24817,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin){
MemPage *pLastPg;
rc = sqlite3BtreeGetPage(pBt, iLastPg, &pLastPg, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -24831,7 +24831,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin){
do {
MemPage *pFreePg;
rc = allocateBtreePage(pBt, &pFreePg, &iFreePg, 0, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(pLastPg);
return rc;
}
@@ -24840,12 +24840,12 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin){
assert( iFreePg<iLastPg );
rc = sqlite3PagerWrite(pLastPg->pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = relocatePage(pBt, pLastPg, eType, iPtrPage, iFreePg);
releasePage(pLastPg);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
}
@@ -24855,7 +24855,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin){
while( pBt->nTrunc==PENDING_BYTE_PAGE(pBt)||PTRMAP_ISPAGE(pBt, pBt->nTrunc) ){
pBt->nTrunc--;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -24863,14 +24863,14 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin){
** It performs a single unit of work towards an incremental vacuum.
**
** If the incremental vacuum is finished after this function has run,
-** STQLITE_DONE is returned. If it is not finished, but no error occured,
-** STQLITE_OK is returned. Otherwise an STQLite error code.
+** SQLITE_DONE is returned. If it is not finished, but no error occured,
+** SQLITE_OK is returned. Otherwise an SQLite error code.
*/
-STQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){
BtShared *pBt = p->pBt;
assert( pBt->inTransaction==TRANS_WRITE && p->inTrans==TRANS_WRITE );
if( !pBt->autoVacuum ){
- return STQLITE_DONE;
+ return SQLITE_DONE;
}
invalidateAllOverflowCache(pBt);
return incrVacuumStep(pBt, 0);
@@ -24880,13 +24880,13 @@ STQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){
** This routine is called prior to sqlite3PagerCommit when a transaction
** is commited for an auto-vacuum database.
**
-** If STQLITE_OK is returned, then *pnTrunc is set to the number of pages
+** If SQLITE_OK is returned, then *pnTrunc is set to the number of pages
** the database file should be truncated to during the commit process.
** i.e. the database has been reorganized so that only the first *pnTrunc
** pages are in use.
*/
static int autoVacuumCommit(BtShared *pBt, Pgno *pnTrunc){
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
Pager *pPager = pBt->pPager;
#ifndef NDEBUG
int nRef = sqlite3PagerRefcount(pPager);
@@ -24904,7 +24904,7 @@ static int autoVacuumCommit(BtShared *pBt, Pgno *pnTrunc){
Pgno nOrig = sqlite3PagerPagecount(pBt->pPager);
if( PTRMAP_ISPAGE(pBt, nOrig) ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
if( nOrig==PENDING_BYTE_PAGE(pBt) ){
nOrig--;
@@ -24920,12 +24920,12 @@ static int autoVacuumCommit(BtShared *pBt, Pgno *pnTrunc){
}
}
- while( rc==STQLITE_OK ){
+ while( rc==SQLITE_OK ){
rc = incrVacuumStep(pBt, nFin);
}
- if( rc==STQLITE_DONE ){
+ if( rc==SQLITE_DONE ){
assert(nFin==0 || pBt->nTrunc==0 || nFin<=pBt->nTrunc);
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
if( pBt->nTrunc ){
sqlite3PagerWrite(pBt->pPage1->pDbPage);
put4byte(&pBt->pPage1->aData[32], 0);
@@ -24933,12 +24933,12 @@ static int autoVacuumCommit(BtShared *pBt, Pgno *pnTrunc){
pBt->nTrunc = nFin;
}
}
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3PagerRollback(pPager);
}
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
*pnTrunc = pBt->nTrunc;
pBt->nTrunc = 0;
}
@@ -24974,15 +24974,15 @@ static int autoVacuumCommit(BtShared *pBt, Pgno *pnTrunc){
** Once this is routine has returned, the only thing required to commit
** the write-transaction for this database file is to delete the journal.
*/
-STQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
+ int rc = SQLITE_OK;
if( p->inTrans==TRANS_WRITE ){
BtShared *pBt = p->pBt;
Pgno nTrunc = 0;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
rc = autoVacuumCommit(pBt, &nTrunc);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
}
@@ -25006,7 +25006,7 @@ STQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
** This will release the write lock on the database file. If there
** are no active cursors, it also releases the read lock.
*/
-STQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p){
BtShared *pBt = p->pBt;
btreeIntegrity(p);
@@ -25019,7 +25019,7 @@ STQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p){
assert( pBt->inTransaction==TRANS_WRITE );
assert( pBt->nTransaction>0 );
rc = sqlite3PagerCommitPhaseTwo(pBt->pPager);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
pBt->inTransaction = TRANS_READ;
@@ -25046,16 +25046,16 @@ STQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p){
unlockBtreeIfUnused(pBt);
btreeIntegrity(p);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Do both phases of a commit.
*/
-STQLITE_PRIVATE int sqlite3BtreeCommit(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeCommit(Btree *p){
int rc;
rc = sqlite3BtreeCommitPhaseOne(p, 0);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3BtreeCommitPhaseTwo(p);
}
return rc;
@@ -25086,14 +25086,14 @@ static int countWriteCursors(BtShared *pBt){
** This will release the write lock on the database file. If there
** are no active cursors, it also releases the read lock.
*/
-STQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p){
int rc;
BtShared *pBt = p->pBt;
MemPage *pPage1;
rc = saveAllCursors(pBt, 0, 0);
-#ifndef STQLITE_OMIT_SHARED_CACHE
- if( rc!=STQLITE_OK ){
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ if( rc!=SQLITE_OK ){
/* This is a horrible situation. An IO or malloc() error occured whilst
** trying to save cursor positions. If this is an automatic rollback (as
** the result of a constraint, malloc() failure or IO error) then
@@ -25115,20 +25115,20 @@ STQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p){
if( p->inTrans==TRANS_WRITE ){
int rc2;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
pBt->nTrunc = 0;
#endif
assert( TRANS_WRITE==pBt->inTransaction );
rc2 = sqlite3PagerRollback(pBt->pPager);
- if( rc2!=STQLITE_OK ){
+ if( rc2!=SQLITE_OK ){
rc = rc2;
}
/* The rollback may have destroyed the pPage1->aData value. So
** call sqlite3BtreeGetPage() on page 1 again to make
** sure pPage1->aData is set correctly. */
- if( sqlite3BtreeGetPage(pBt, 1, &pPage1, 0)==STQLITE_OK ){
+ if( sqlite3BtreeGetPage(pBt, 1, &pPage1, 0)==SQLITE_OK ){
releasePage(pPage1);
}
assert( countWriteCursors(pBt)==0 );
@@ -25166,14 +25166,14 @@ STQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p){
** error occurs within the statement, the effect of that one statement
** can be rolled back without having to rollback the entire transaction.
*/
-STQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree *p){
int rc;
BtShared *pBt = p->pBt;
if( (p->inTrans!=TRANS_WRITE) || pBt->inStmt ){
- return pBt->readOnly ? STQLITE_READONLY : STQLITE_ERROR;
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
assert( pBt->inTransaction==TRANS_WRITE );
- rc = pBt->readOnly ? STQLITE_OK : sqlite3PagerStmtBegin(pBt->pPager);
+ rc = pBt->readOnly ? SQLITE_OK : sqlite3PagerStmtBegin(pBt->pPager);
pBt->inStmt = 1;
return rc;
}
@@ -25183,13 +25183,13 @@ STQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree *p){
** Commit the statment subtransaction currently in progress. If no
** subtransaction is active, this is a no-op.
*/
-STQLITE_PRIVATE int sqlite3BtreeCommitStmt(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeCommitStmt(Btree *p){
int rc;
BtShared *pBt = p->pBt;
if( pBt->inStmt && !pBt->readOnly ){
rc = sqlite3PagerStmtCommit(pBt->pPager);
}else{
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}
pBt->inStmt = 0;
return rc;
@@ -25203,8 +25203,8 @@ STQLITE_PRIVATE int sqlite3BtreeCommitStmt(Btree *p){
** to use a cursor that was open at the beginning of this operation
** will result in an error.
*/
-STQLITE_PRIVATE int sqlite3BtreeRollbackStmt(Btree *p){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3BtreeRollbackStmt(Btree *p){
+ int rc = SQLITE_OK;
BtShared *pBt = p->pBt;
sqlite3MallocDisallow();
if( pBt->inStmt && !pBt->readOnly ){
@@ -25266,7 +25266,7 @@ static int dfltCompare(
** default comparison function is used. The comparison function is
** always ignored for INTKEY tables.
*/
-STQLITE_PRIVATE int sqlite3BtreeCursor(
+SQLITE_PRIVATE int sqlite3BtreeCursor(
Btree *p, /* The btree */
int iTable, /* Root page of table to open */
int wrFlag, /* 1 to write. 0 read-only */
@@ -25281,34 +25281,34 @@ STQLITE_PRIVATE int sqlite3BtreeCursor(
*ppCur = 0;
if( wrFlag ){
if( pBt->readOnly ){
- return STQLITE_READONLY;
+ return SQLITE_READONLY;
}
if( checkReadLocks(p, iTable, 0) ){
- return STQLITE_LOCKED;
+ return SQLITE_LOCKED;
}
}
if( pBt->pPage1==0 ){
rc = lockBtreeWithRetry(p);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
if( pBt->readOnly && wrFlag ){
- return STQLITE_READONLY;
+ return SQLITE_READONLY;
}
}
pCur = sqliteMalloc( sizeof(*pCur) );
if( pCur==0 ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto create_cursor_exception;
}
pCur->pgnoRoot = (Pgno)iTable;
if( iTable==1 && sqlite3PagerPagecount(pBt->pPager)==0 ){
- rc = STQLITE_EMPTY;
+ rc = SQLITE_EMPTY;
goto create_cursor_exception;
}
rc = getAndInitPage(pBt, pCur->pgnoRoot, &pCur->pPage, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto create_cursor_exception;
}
@@ -25328,7 +25328,7 @@ STQLITE_PRIVATE int sqlite3BtreeCursor(
pCur->eState = CURSOR_INVALID;
*ppCur = pCur;
- return STQLITE_OK;
+ return SQLITE_OK;
create_cursor_exception:
if( pCur ){
releasePage(pCur->pPage);
@@ -25342,7 +25342,7 @@ create_cursor_exception:
** Close a cursor. The read lock on the database file is released
** when the last cursor is closed.
*/
-STQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
+SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
BtShared *pBt = pCur->pBtree->pBt;
clearCursorPosition(pCur);
if( pCur->pPrev ){
@@ -25357,14 +25357,14 @@ STQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
unlockBtreeIfUnused(pBt);
invalidateOverflowCache(pCur);
sqliteFree(pCur);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Make a temporary cursor by filling in the fields of pTempCur.
** The temporary cursor is not on the cursor list for the Btree.
*/
-STQLITE_PRIVATE void sqlite3BtreeGetTempCursor(BtCursor *pCur, BtCursor *pTempCur){
+SQLITE_PRIVATE void sqlite3BtreeGetTempCursor(BtCursor *pCur, BtCursor *pTempCur){
memcpy(pTempCur, pCur, sizeof(*pCur));
pTempCur->pNext = 0;
pTempCur->pPrev = 0;
@@ -25377,7 +25377,7 @@ STQLITE_PRIVATE void sqlite3BtreeGetTempCursor(BtCursor *pCur, BtCursor *pTempCu
** Delete a temporary cursor such as was made by the CreateTemporaryCursor()
** function above.
*/
-STQLITE_PRIVATE void sqlite3BtreeReleaseTempCursor(BtCursor *pCur){
+SQLITE_PRIVATE void sqlite3BtreeReleaseTempCursor(BtCursor *pCur){
if( pCur->pPage ){
sqlite3PagerUnref(pCur->pPage->pDbPage);
}
@@ -25435,9 +25435,9 @@ STQLITE_PRIVATE void sqlite3BtreeReleaseTempCursor(BtCursor *pCur){
** For a table with the INTKEY flag set, this routine returns the key
** itself, not the number of bytes in the key.
*/
-STQLITE_PRIVATE int sqlite3BtreeKeySize(BtCursor *pCur, i64 *pSize){
+SQLITE_PRIVATE int sqlite3BtreeKeySize(BtCursor *pCur, i64 *pSize){
int rc = restoreOrClearCursorPosition(pCur);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
assert( pCur->eState==CURSOR_INVALID || pCur->eState==CURSOR_VALID );
if( pCur->eState==CURSOR_INVALID ){
*pSize = 0;
@@ -25451,14 +25451,14 @@ STQLITE_PRIVATE int sqlite3BtreeKeySize(BtCursor *pCur, i64 *pSize){
/*
** Set *pSize to the number of bytes of data in the entry the
-** cursor currently points to. Always return STQLITE_OK.
+** cursor currently points to. Always return SQLITE_OK.
** Failure is not possible. If the cursor is not currently
** pointing to an entry (which can happen, for example, if
** the database is empty) then *pSize is set to 0.
*/
-STQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){
+SQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){
int rc = restoreOrClearCursorPosition(pCur);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
assert( pCur->eState==CURSOR_INVALID || pCur->eState==CURSOR_VALID );
if( pCur->eState==CURSOR_INVALID ){
/* Not pointing at a valid entry - set *pSize to 0. */
@@ -25477,7 +25477,7 @@ STQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){
** linked list of overflow pages. If possible, it uses the auto-vacuum
** pointer-map data instead of reading the content of page ovfl to do so.
**
-** If an error occurs an STQLite error code is returned. Otherwise:
+** If an error occurs an SQLite error code is returned. Otherwise:
**
** Unless pPgnoNext is NULL, the page number of the next overflow
** page in the linked list is written to *pPgnoNext. If page ovfl
@@ -25507,7 +25507,7 @@ static int getOverflowPage(
return sqlite3BtreeGetPage(pBt, ovfl, ppPage, 1);
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/* Try to find the next page in the overflow list using the
** autovacuum pointer-map pages. Guess that the next page in
** the overflow list is page number (ovfl+1). If that guess turns
@@ -25525,7 +25525,7 @@ static int getOverflowPage(
if( iGuess<=sqlite3PagerPagecount(pBt->pPager) ){
rc = ptrmapGet(pBt, iGuess, &eType, &pgno);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
if( eType==PTRMAP_OVERFLOW2 && pgno==ovfl ){
@@ -25539,8 +25539,8 @@ static int getOverflowPage(
MemPage *pPage = 0;
rc = sqlite3BtreeGetPage(pBt, ovfl, &pPage, next!=0);
- assert(rc==STQLITE_OK || pPage==0);
- if( next==0 && rc==STQLITE_OK ){
+ assert(rc==SQLITE_OK || pPage==0);
+ if( next==0 && rc==SQLITE_OK ){
next = get4byte(pPage->aData);
}
@@ -25564,7 +25564,7 @@ static int getOverflowPage(
** then sqlite3PagerWrite() is called on pDbPage and nByte bytes
** of data are copied from the buffer pBuf to pPayload.
**
-** STQLITE_OK is returned on success, otherwise an error code.
+** SQLITE_OK is returned on success, otherwise an error code.
*/
static int copyPayload(
void *pPayload, /* Pointer to page data */
@@ -25576,7 +25576,7 @@ static int copyPayload(
if( eOp ){
/* Copy data from buffer to page (a write operation) */
int rc = sqlite3PagerWrite(pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
memcpy(pPayload, pBuf, nByte);
@@ -25584,7 +25584,7 @@ static int copyPayload(
/* Copy data from page to buffer (a read operation) */
memcpy(pBuf, pPayload, nByte);
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -25626,7 +25626,7 @@ static int accessPayload(
int eOp /* zero to read. non-zero to write. */
){
unsigned char *aPayload;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
u32 nKey;
int iIdx = 0;
MemPage *pPage = pCur->pPage; /* Btree page of current cursor entry */
@@ -25646,7 +25646,7 @@ static int accessPayload(
}
if( offset+amt > nKey+pCur->info.nData ){
/* Trying to read or write past the end of the data is an error */
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
/* Check if data must be read/written to/from the btree page itself. */
@@ -25663,13 +25663,13 @@ static int accessPayload(
offset -= pCur->info.nLocal;
}
- if( rc==STQLITE_OK && amt>0 ){
+ if( rc==SQLITE_OK && amt>0 ){
const int ovflSize = pBt->usableSize - 4; /* Bytes content per ovfl page */
Pgno nextPage;
nextPage = get4byte(&aPayload[pCur->info.nLocal]);
-#ifndef STQLITE_OMIT_INCRBLOB
+#ifndef SQLITE_OMIT_INCRBLOB
/* If the isIncrblobHandle flag is set and the BtCursor.aOverflow[]
** has not been allocated, allocate it now. The array is sized at
** one entry for each overflow page in the overflow chain. The
@@ -25681,7 +25681,7 @@ static int accessPayload(
int nOvfl = (pCur->info.nPayload-pCur->info.nLocal+ovflSize-1)/ovflSize;
pCur->aOverflow = (Pgno *)sqliteMalloc(sizeof(Pgno)*nOvfl);
if( nOvfl && !pCur->aOverflow ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
}
}
@@ -25696,9 +25696,9 @@ static int accessPayload(
}
#endif
- for( ; rc==STQLITE_OK && amt>0 && nextPage; iIdx++){
+ for( ; rc==SQLITE_OK && amt>0 && nextPage; iIdx++){
-#ifndef STQLITE_OMIT_INCRBLOB
+#ifndef SQLITE_OMIT_INCRBLOB
/* If required, populate the overflow page-list cache. */
if( pCur->aOverflow ){
assert(!pCur->aOverflow[iIdx] || pCur->aOverflow[iIdx]==nextPage);
@@ -25713,7 +25713,7 @@ static int accessPayload(
** page-list cache, if any, then fall back to the getOverflowPage()
** function.
*/
-#ifndef STQLITE_OMIT_INCRBLOB
+#ifndef SQLITE_OMIT_INCRBLOB
if( pCur->aOverflow && pCur->aOverflow[iIdx+1] ){
nextPage = pCur->aOverflow[iIdx+1];
} else
@@ -25727,7 +25727,7 @@ static int accessPayload(
DbPage *pDbPage;
int a = amt;
rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
aPayload = sqlite3PagerGetData(pDbPage);
nextPage = get4byte(aPayload);
if( a + offset > ovflSize ){
@@ -25743,8 +25743,8 @@ static int accessPayload(
}
}
- if( rc==STQLITE_OK && amt>0 ){
- return STQLITE_CORRUPT_BKPT;
+ if( rc==SQLITE_OK && amt>0 ){
+ return SQLITE_CORRUPT_BKPT;
}
return rc;
}
@@ -25754,17 +25754,17 @@ static int accessPayload(
** "amt" bytes will be transfered into pBuf[]. The transfer
** begins at "offset".
**
-** Return STQLITE_OK on success or an error code if anything goes
+** Return SQLITE_OK on success or an error code if anything goes
** wrong. An error is returned if "offset+amt" is larger than
** the available payload.
*/
-STQLITE_PRIVATE int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
+SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
int rc = restoreOrClearCursorPosition(pCur);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
assert( pCur->eState==CURSOR_VALID );
assert( pCur->pPage!=0 );
if( pCur->pPage->intKey ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
assert( pCur->pPage->intKey==0 );
assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
@@ -25778,13 +25778,13 @@ STQLITE_PRIVATE int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *p
** "amt" bytes will be transfered into pBuf[]. The transfer
** begins at "offset".
**
-** Return STQLITE_OK on success or an error code if anything goes
+** Return SQLITE_OK on success or an error code if anything goes
** wrong. An error is returned if "offset+amt" is larger than
** the available payload.
*/
-STQLITE_PRIVATE int sqlite3BtreeData(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
+SQLITE_PRIVATE int sqlite3BtreeData(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
int rc = restoreOrClearCursorPosition(pCur);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
assert( pCur->eState==CURSOR_VALID );
assert( pCur->pPage!=0 );
assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
@@ -25859,13 +25859,13 @@ static const unsigned char *fetchPayload(
** These routines is used to get quick access to key and data
** in the common case where no overflow pages are used.
*/
-STQLITE_PRIVATE const void *sqlite3BtreeKeyFetch(BtCursor *pCur, int *pAmt){
+SQLITE_PRIVATE const void *sqlite3BtreeKeyFetch(BtCursor *pCur, int *pAmt){
if( pCur->eState==CURSOR_VALID ){
return (const void*)fetchPayload(pCur, pAmt, 0);
}
return 0;
}
-STQLITE_PRIVATE const void *sqlite3BtreeDataFetch(BtCursor *pCur, int *pAmt){
+SQLITE_PRIVATE const void *sqlite3BtreeDataFetch(BtCursor *pCur, int *pAmt){
if( pCur->eState==CURSOR_VALID ){
return (const void*)fetchPayload(pCur, pAmt, 1);
}
@@ -25894,9 +25894,9 @@ static int moveToChild(BtCursor *pCur, u32 newPgno){
pCur->idx = 0;
pCur->info.nSize = 0;
if( pNewPage->nCell<1 ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -25908,7 +25908,7 @@ static int moveToChild(BtCursor *pCur, u32 newPgno){
** virtual root page is the page that the right-pointer of page
** 1 is pointing to.
*/
-STQLITE_PRIVATE int sqlite3BtreeIsRootPage(MemPage *pPage){
+SQLITE_PRIVATE int sqlite3BtreeIsRootPage(MemPage *pPage){
MemPage *pParent = pPage->pParent;
if( pParent==0 ) return 1;
if( pParent->pgno>1 ) return 0;
@@ -25924,7 +25924,7 @@ STQLITE_PRIVATE int sqlite3BtreeIsRootPage(MemPage *pPage){
** right-most child page then pCur->idx is set to one more than
** the largest cell index.
*/
-STQLITE_PRIVATE void sqlite3BtreeMoveToParent(BtCursor *pCur){
+SQLITE_PRIVATE void sqlite3BtreeMoveToParent(BtCursor *pCur){
MemPage *pParent;
MemPage *pPage;
int idxParent;
@@ -25949,7 +25949,7 @@ STQLITE_PRIVATE void sqlite3BtreeMoveToParent(BtCursor *pCur){
*/
static int moveToRoot(BtCursor *pCur){
MemPage *pRoot;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
BtShared *pBt = pCur->pBtree->pBt;
if( pCur->eState==CURSOR_RETQUIRESEEK ){
@@ -25960,7 +25960,7 @@ static int moveToRoot(BtCursor *pCur){
assert( pRoot->isInit );
}else{
if(
- STQLITE_OK!=(rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0))
+ SQLITE_OK!=(rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0))
){
pCur->eState = CURSOR_INVALID;
return rc;
@@ -26001,7 +26001,7 @@ static int moveToLeftmost(BtCursor *pCur){
rc = moveToChild(pCur, pgno);
if( rc ) return rc;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -26028,21 +26028,21 @@ static int moveToRightmost(BtCursor *pCur){
}
pCur->idx = pPage->nCell - 1;
pCur->info.nSize = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
-/* Move the cursor to the first entry in the table. Return STQLITE_OK
+/* Move the cursor to the first entry in the table. Return SQLITE_OK
** on success. Set *pRes to 0 if the cursor actually points to something
** or set *pRes to 1 if the table is empty.
*/
-STQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){
+SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){
int rc;
rc = moveToRoot(pCur);
if( rc ) return rc;
if( pCur->eState==CURSOR_INVALID ){
assert( pCur->pPage->nCell==0 );
*pRes = 1;
- return STQLITE_OK;
+ return SQLITE_OK;
}
assert( pCur->pPage->nCell>0 );
*pRes = 0;
@@ -26050,18 +26050,18 @@ STQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){
return rc;
}
-/* Move the cursor to the last entry in the table. Return STQLITE_OK
+/* Move the cursor to the last entry in the table. Return SQLITE_OK
** on success. Set *pRes to 0 if the cursor actually points to something
** or set *pRes to 1 if the table is empty.
*/
-STQLITE_PRIVATE int sqlite3BtreeLast(BtCursor *pCur, int *pRes){
+SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor *pCur, int *pRes){
int rc;
rc = moveToRoot(pCur);
if( rc ) return rc;
if( CURSOR_INVALID==pCur->eState ){
assert( pCur->pPage->nCell==0 );
*pRes = 1;
- return STQLITE_OK;
+ return SQLITE_OK;
}
assert( pCur->eState==CURSOR_VALID );
*pRes = 0;
@@ -26096,7 +26096,7 @@ STQLITE_PRIVATE int sqlite3BtreeLast(BtCursor *pCur, int *pRes){
** *pRes>0 The cursor is left pointing at an entry that
** is larger than pKey.
*/
-STQLITE_PRIVATE int sqlite3BtreeMoveto(
+SQLITE_PRIVATE int sqlite3BtreeMoveto(
BtCursor *pCur, /* The cursor to be moved */
const void *pKey, /* The key content for indices. Not used by tables */
i64 nKey, /* Size of pKey. Or the key for tables */
@@ -26111,7 +26111,7 @@ STQLITE_PRIVATE int sqlite3BtreeMoveto(
if( pCur->eState==CURSOR_INVALID ){
*pRes = -1;
assert( pCur->pPage->nCell==0 );
- return STQLITE_OK;
+ return SQLITE_OK;
}
for(;;){
int lwr, upr;
@@ -26121,7 +26121,7 @@ STQLITE_PRIVATE int sqlite3BtreeMoveto(
lwr = 0;
upr = pPage->nCell-1;
if( !pPage->intKey && pKey==0 ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
if( biasRight ){
pCur->idx = upr;
@@ -26155,7 +26155,7 @@ STQLITE_PRIVATE int sqlite3BtreeMoveto(
c = pCur->xCompare(pCur->pArg, nCellKey, pCellKey, nKey, pKey);
}else{
pCellKey = sqliteMallocRaw( nCellKey );
- if( pCellKey==0 ) return STQLITE_NOMEM;
+ if( pCellKey==0 ) return SQLITE_NOMEM;
rc = sqlite3BtreeKey(pCur, 0, nCellKey, (void *)pCellKey);
c = pCur->xCompare(pCur->pArg, nCellKey, pCellKey, nKey, pKey);
sqliteFree(pCellKey);
@@ -26169,7 +26169,7 @@ STQLITE_PRIVATE int sqlite3BtreeMoveto(
break;
}else{
if( pRes ) *pRes = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
if( c<0 ){
@@ -26194,7 +26194,7 @@ STQLITE_PRIVATE int sqlite3BtreeMoveto(
if( chldPg==0 ){
assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
if( pRes ) *pRes = c;
- return STQLITE_OK;
+ return SQLITE_OK;
}
pCur->idx = lwr;
pCur->info.nSize = 0;
@@ -26213,7 +26213,7 @@ STQLITE_PRIVATE int sqlite3BtreeMoveto(
** past the last entry in the table or sqlite3BtreePrev() moves past
** the first entry. TRUE is also returned if the table is empty.
*/
-STQLITE_PRIVATE int sqlite3BtreeEof(BtCursor *pCur){
+SQLITE_PRIVATE int sqlite3BtreeEof(BtCursor *pCur){
/* TODO: What if the cursor is in CURSOR_RETQUIRESEEK but all table entries
** have been deleted? This API will need to change to return an error code
** as well as the boolean result value.
@@ -26227,24 +26227,24 @@ STQLITE_PRIVATE int sqlite3BtreeEof(BtCursor *pCur){
** was already pointing to the last entry in the database before
** this routine was called, then set *pRes=1.
*/
-STQLITE_PRIVATE int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
+SQLITE_PRIVATE int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
int rc;
MemPage *pPage;
rc = restoreOrClearCursorPosition(pCur);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
assert( pRes!=0 );
pPage = pCur->pPage;
if( CURSOR_INVALID==pCur->eState ){
*pRes = 1;
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( pCur->skip>0 ){
pCur->skip = 0;
*pRes = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
pCur->skip = 0;
@@ -26265,7 +26265,7 @@ STQLITE_PRIVATE int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
if( sqlite3BtreeIsRootPage(pPage) ){
*pRes = 1;
pCur->eState = CURSOR_INVALID;
- return STQLITE_OK;
+ return SQLITE_OK;
}
sqlite3BtreeMoveToParent(pCur);
pPage = pCur->pPage;
@@ -26274,13 +26274,13 @@ STQLITE_PRIVATE int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
if( pPage->leafData ){
rc = sqlite3BtreeNext(pCur, pRes);
}else{
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}
return rc;
}
*pRes = 0;
if( pPage->leaf ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
rc = moveToLeftmost(pCur);
return rc;
@@ -26292,23 +26292,23 @@ STQLITE_PRIVATE int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
** was already pointing to the first entry in the database before
** this routine was called, then set *pRes=1.
*/
-STQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
+SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
int rc;
Pgno pgno;
MemPage *pPage;
rc = restoreOrClearCursorPosition(pCur);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
if( CURSOR_INVALID==pCur->eState ){
*pRes = 1;
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( pCur->skip<0 ){
pCur->skip = 0;
*pRes = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
pCur->skip = 0;
@@ -26325,7 +26325,7 @@ STQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
if( sqlite3BtreeIsRootPage(pPage) ){
pCur->eState = CURSOR_INVALID;
*pRes = 1;
- return STQLITE_OK;
+ return SQLITE_OK;
}
sqlite3BtreeMoveToParent(pCur);
pPage = pCur->pPage;
@@ -26335,7 +26335,7 @@ STQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
if( pPage->leafData && !pPage->leaf ){
rc = sqlite3BtreePrevious(pCur, pRes);
}else{
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}
}
*pRes = 0;
@@ -26350,7 +26350,7 @@ STQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
** been referenced and the calling routine is responsible for calling
** sqlite3PagerUnref() on the new page when it is done.
**
-** STQLITE_OK is returned on success. Any other return value indicates
+** SQLITE_OK is returned on success. Any other return value indicates
** an error. *ppPage and *pPgno are undefined in the event of an error.
** Do not invoke sqlite3PagerUnref() on *ppPage if an error is returned.
**
@@ -26388,7 +26388,7 @@ static int allocateBtreePage(
** shows that the page 'nearby' is somewhere on the free-list, then
** the entire-list will be searched for that page.
*/
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( exact && nearby<=sqlite3PagerPagecount(pBt->pPager) ){
u8 eType;
assert( nearby>0 );
@@ -26443,9 +26443,9 @@ static int allocateBtreePage(
TRACE(("ALLOCATE: %d trunk - %d free pages left\n", *pPgno, n-1));
}else if( k>pBt->usableSize/4 - 8 ){
/* Value of k is out of range. Database corruption */
- rc = STQLITE_CORRUPT_BKPT;
+ rc = SQLITE_CORRUPT_BKPT;
goto end_allocate_page;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
}else if( searchList && nearby==iTrunk ){
/* The list is being searched and this trunk page is the page
** to allocate, regardless of whether it has leaves.
@@ -26471,11 +26471,11 @@ static int allocateBtreePage(
MemPage *pNewTrunk;
Pgno iNewTrunk = get4byte(&pTrunk->aData[8]);
rc = sqlite3BtreeGetPage(pBt, iNewTrunk, &pNewTrunk, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto end_allocate_page;
}
rc = sqlite3PagerWrite(pNewTrunk->pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(pNewTrunk);
goto end_allocate_page;
}
@@ -26527,7 +26527,7 @@ static int allocateBtreePage(
*pPgno = iPage;
if( *pPgno>sqlite3PagerPagecount(pBt->pPager) ){
/* Free page off the end of the file */
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
TRACE(("ALLOCATE: %d was leaf %d of %d on trunk %d"
": %d more free pages\n",
@@ -26537,10 +26537,10 @@ static int allocateBtreePage(
}
put4byte(&aData[4], k-1);
rc = sqlite3BtreeGetPage(pBt, *pPgno, ppPage, 1);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqlite3PagerDontRollback((*ppPage)->pDbPage);
rc = sqlite3PagerWrite((*ppPage)->pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(*ppPage);
}
}
@@ -26555,7 +26555,7 @@ static int allocateBtreePage(
** end of the file */
*pPgno = sqlite3PagerPagecount(pBt->pPager) + 1;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->nTrunc ){
/* An incr-vacuum has already run within this transaction. So the
** page to allocate is not from the physical end of the file, but
@@ -26584,7 +26584,7 @@ static int allocateBtreePage(
rc = sqlite3BtreeGetPage(pBt, *pPgno, ppPage, 0);
if( rc ) return rc;
rc = sqlite3PagerWrite((*ppPage)->pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(*ppPage);
}
TRACE(("ALLOCATE: %d from end of file\n", *pPgno));
@@ -26620,8 +26620,8 @@ static int freePage(MemPage *pPage){
n = get4byte(&pPage1->aData[36]);
put4byte(&pPage1->aData[36], n+1);
-#ifdef STQLITE_SECURE_DELETE
- /* If the STQLITE_SECURE_DELETE compile-time option is enabled, then
+#ifdef SQLITE_SECURE_DELETE
+ /* If the SQLITE_SECURE_DELETE compile-time option is enabled, then
** always fully overwrite deleted information with zeros.
*/
rc = sqlite3PagerWrite(pPage->pDbPage);
@@ -26629,7 +26629,7 @@ static int freePage(MemPage *pPage){
memset(pPage->aData, 0, pPage->pBt->pageSize);
#endif
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/* If the database supports auto-vacuum, write an entry in the pointer-map
** to indicate that the page is free.
*/
@@ -26666,10 +26666,10 @@ static int freePage(MemPage *pPage){
}else{
/* Add the newly freed page as a leaf on the current trunk */
rc = sqlite3PagerWrite(pTrunk->pDbPage);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
put4byte(&pTrunk->aData[4], k+1);
put4byte(&pTrunk->aData[8+k*4], pPage->pgno);
-#ifndef STQLITE_SECURE_DELETE
+#ifndef SQLITE_SECURE_DELETE
sqlite3PagerDontWrite(pPage->pDbPage);
#endif
}
@@ -26693,7 +26693,7 @@ static int clearCell(MemPage *pPage, unsigned char *pCell){
sqlite3BtreeParseCellPtr(pPage, pCell, &info);
if( info.iOverflow==0 ){
- return STQLITE_OK; /* No overflow pages. Return without doing anything */
+ return SQLITE_OK; /* No overflow pages. Return without doing anything */
}
ovflPgno = get4byte(&pCell[info.iOverflow]);
ovflPageSize = pBt->usableSize - 4;
@@ -26702,7 +26702,7 @@ static int clearCell(MemPage *pPage, unsigned char *pCell){
while( nOvfl-- ){
MemPage *pOvfl;
if( ovflPgno==0 || ovflPgno>sqlite3PagerPagecount(pBt->pPager) ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
rc = getOverflowPage(pBt, ovflPgno, &pOvfl, (nOvfl==0)?0:&ovflPgno);
@@ -26711,7 +26711,7 @@ static int clearCell(MemPage *pPage, unsigned char *pCell){
sqlite3PagerUnref(pOvfl->pDbPage);
if( rc ) return rc;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -26782,7 +26782,7 @@ static int fillInCell(
while( nPayload>0 ){
if( spaceLeft==0 ){
int isExact = 0;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
Pgno pgnoPtrmap = pgnoOvfl; /* Overflow page pointer-map entry page */
if( pBt->autoVacuum ){
do{
@@ -26796,7 +26796,7 @@ static int fillInCell(
}
#endif
rc = allocateBtreePage(pBt, &pOvfl, &pgnoOvfl, pgnoOvfl, isExact);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/* If the database supports auto-vacuum, and the second or subsequent
** overflow page is being allocated, add an entry to the pointer-map
** for that page now.
@@ -26807,7 +26807,7 @@ static int fillInCell(
** may misinterpret the uninitialised values and delete the
** wrong pages from the database.
*/
- if( pBt->autoVacuum && rc==STQLITE_OK ){
+ if( pBt->autoVacuum && rc==SQLITE_OK ){
u8 eType = (pgnoPtrmap?PTRMAP_OVERFLOW2:PTRMAP_OVERFLOW1);
rc = ptrmapPut(pBt, pgnoOvfl, eType, pgnoPtrmap);
if( rc ){
@@ -26847,7 +26847,7 @@ static int fillInCell(
}
}
releasePage(pToRelease);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -26860,7 +26860,7 @@ static int reparentPage(BtShared *pBt, Pgno pgno, MemPage *pNewParent, int idx){
DbPage *pDbPage;
assert( pNewParent!=0 );
- if( pgno==0 ) return STQLITE_OK;
+ if( pgno==0 ) return SQLITE_OK;
assert( pBt->pPager!=0 );
pDbPage = sqlite3PagerLookup(pBt->pPager, pgno);
if( pDbPage ){
@@ -26877,12 +26877,12 @@ static int reparentPage(BtShared *pBt, Pgno pgno, MemPage *pNewParent, int idx){
sqlite3PagerUnref(pDbPage);
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
return ptrmapPut(pBt, pgno, PTRMAP_BTREE, pNewParent->pgno);
}
#endif
- return STQLITE_OK;
+ return SQLITE_OK;
}
@@ -26900,15 +26900,15 @@ static int reparentPage(BtShared *pBt, Pgno pgno, MemPage *pNewParent, int idx){
static int reparentChildPages(MemPage *pPage){
int i;
BtShared *pBt = pPage->pBt;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
- if( pPage->leaf ) return STQLITE_OK;
+ if( pPage->leaf ) return SQLITE_OK;
for(i=0; i<pPage->nCell; i++){
u8 *pCell = findCell(pPage, i);
if( !pPage->leaf ){
rc = reparentPage(pBt, get4byte(pCell), pPage, i);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
}
}
if( !pPage->leaf ){
@@ -27008,7 +27008,7 @@ static int insertCell(
ins = cellOffset + 2*i;
if( end > top - sz ){
int rc = defragmentPage(pPage);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
top = get2byte(&data[hdr+5]);
assert( end + sz <= top );
}
@@ -27025,7 +27025,7 @@ static int insertCell(
put2byte(&data[ins], idx);
put2byte(&data[hdr+3], pPage->nCell);
pPage->idxShift = 1;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pPage->pBt->autoVacuum ){
/* The cell may contain a pointer to an overflow page. If so, write
** the entry for the overflow page into the pointer map.
@@ -27036,13 +27036,13 @@ static int insertCell(
if( (info.nData+(pPage->intKey?0:info.nKey))>info.nLocal ){
Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]);
int rc = ptrmapPut(pPage->pBt, pgnoOvfl, PTRMAP_OVERFLOW1, pPage->pgno);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
}
}
#endif
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -27107,7 +27107,7 @@ static void assemblePage(
/* Forward reference */
static int balance(MemPage*, int);
-#ifndef STQLITE_OMIT_TQUICKBALANCE
+#ifndef SQLITE_OMIT_TQUICKBALANCE
/*
** This version of balance() handles the common special case where
** a new entry is being inserted on the extreme right-end of the
@@ -27141,7 +27141,7 @@ static int balance_quick(MemPage *pPage, MemPage *pParent){
** into it. Then remove the overflow cell from pPage.
*/
rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
pCell = pPage->aOvfl[0].pCell;
@@ -27162,28 +27162,28 @@ static int balance_quick(MemPage *pPage, MemPage *pParent){
pCell = findCell(pPage, pPage->nCell-1);
sqlite3BtreeParseCellPtr(pPage, pCell, &info);
rc = fillInCell(pParent, parentCell, 0, info.nKey, 0, 0, 0, &parentSize);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
assert( parentSize<64 );
rc = insertCell(pParent, parentIdx, parentCell, parentSize, 0, 4);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
put4byte(findOverflowCell(pParent,parentIdx), pPage->pgno);
put4byte(&pParent->aData[pParent->hdrOffset+8], pgnoNew);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/* If this is an auto-vacuum database, update the pointer map
** with entries for the new page, and any pointer from the
** cell on the page to an overflow page.
*/
if( pBt->autoVacuum ){
rc = ptrmapPut(pBt, pgnoNew, PTRMAP_BTREE, pParent->pgno);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = ptrmapPutOvfl(pNew, 0);
}
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(pNew);
return rc;
}
@@ -27196,7 +27196,7 @@ static int balance_quick(MemPage *pPage, MemPage *pParent){
releasePage(pNew);
return balance(pParent, 0);
}
-#endif /* STQLITE_OMIT_TQUICKBALANCE */
+#endif /* SQLITE_OMIT_TQUICKBALANCE */
/*
** This routine redistributes Cells on pPage and up to NN*2 siblings
@@ -27257,7 +27257,7 @@ static int balance_nonroot(MemPage *pPage){
int *szCell; /* Local size of all cells in apCell[] */
u8 *aCopy[NB]; /* Space for holding data of apCopy[] */
u8 *aSpace; /* Space to hold copies of dividers cells */
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
u8 *aFrom = 0;
#endif
@@ -27269,12 +27269,12 @@ static int balance_nonroot(MemPage *pPage){
pBt = pPage->pBt;
pParent = pPage->pParent;
assert( pParent );
- if( STQLITE_OK!=(rc = sqlite3PagerWrite(pParent->pDbPage)) ){
+ if( SQLITE_OK!=(rc = sqlite3PagerWrite(pParent->pDbPage)) ){
return rc;
}
TRACE(("BALANCE: begin page %d child of %d\n", pPage->pgno, pParent->pgno));
-#ifndef STQLITE_OMIT_TQUICKBALANCE
+#ifndef SQLITE_OMIT_TQUICKBALANCE
/*
** A special case: If a new entry has just been inserted into a
** table (that is, a btree with integer keys and all data at the leaves)
@@ -27376,7 +27376,7 @@ static int balance_nonroot(MemPage *pPage){
+ (ISAUTOVACUUM ? nMaxCells : 0) /* aFrom */
);
if( apCell==0 ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto balance_cleanup;
}
szCell = (int*)&apCell[nMaxCells];
@@ -27388,7 +27388,7 @@ static int balance_nonroot(MemPage *pPage){
}
aSpace = &aCopy[NB-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
assert( ((aSpace - (u8*)apCell) & 7)==0 ); /* 8-byte tqalignment required */
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
aFrom = &aSpace[5*pBt->pageSize];
}
@@ -27435,7 +27435,7 @@ static int balance_nonroot(MemPage *pPage){
assert( nCell<nMaxCells );
apCell[nCell] = findOverflowCell(pOld, j);
szCell[nCell] = cellSizePtr(pOld, apCell[nCell]);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
int a;
aFrom[nCell] = i;
@@ -27467,7 +27467,7 @@ static int balance_nonroot(MemPage *pPage){
assert( iSpace<=pBt->pageSize*5 );
memcpy(pTemp, apDiv[i], sz);
apCell[nCell] = pTemp+leafCorrection;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
aFrom[nCell] = 0xFF;
}
@@ -27653,7 +27653,7 @@ static int balance_nonroot(MemPage *pPage){
assert( pNew->nCell>0 || (nNew==1 && cntNew[0]==0) );
assert( pNew->nOverflow==0 );
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/* If this is an auto-vacuum database, update the pointer map entries
** that point to the siblings that were rearranged. These can be: left
** tqchildren of cells, the right-child of the page, or overflow pages
@@ -27664,7 +27664,7 @@ static int balance_nonroot(MemPage *pPage){
assert( k<nMaxCells );
if( aFrom[k]==0xFF || apCopy[aFrom[k]]->pgno!=pNew->pgno ){
rc = ptrmapPutOvfl(pNew, k-j);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto balance_cleanup;
}
}
@@ -27714,7 +27714,7 @@ static int balance_nonroot(MemPage *pPage){
** any cell). But it's important to pass the correct size to
** insertCell(), so reparse the cell now.
**
- ** Note that this can never happen in an STQLite data file, as all
+ ** Note that this can never happen in an SQLite data file, as all
** cells are at least 4 bytes. It only happens in b-trees used
** to evaluate "IN (SELECT ...)" and similar clauses.
*/
@@ -27724,16 +27724,16 @@ static int balance_nonroot(MemPage *pPage){
}
}
rc = insertCell(pParent, nxDiv, pCell, sz, pTemp, 4);
- if( rc!=STQLITE_OK ) goto balance_cleanup;
+ if( rc!=SQLITE_OK ) goto balance_cleanup;
put4byte(findOverflowCell(pParent,nxDiv), pNew->pgno);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/* If this is an auto-vacuum database, and not a leaf-data tree,
** then update the pointer map with an entry for the overflow page
** that the cell just inserted points to (if any).
*/
if( pBt->autoVacuum && !leafData ){
rc = ptrmapPutOvfl(pParent, nxDiv);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto balance_cleanup;
}
}
@@ -27762,10 +27762,10 @@ static int balance_nonroot(MemPage *pPage){
*/
for(i=0; i<nNew; i++){
rc = reparentChildPages(apNew[i]);
- if( rc!=STQLITE_OK ) goto balance_cleanup;
+ if( rc!=SQLITE_OK ) goto balance_cleanup;
}
rc = reparentChildPages(pParent);
- if( rc!=STQLITE_OK ) goto balance_cleanup;
+ if( rc!=SQLITE_OK ) goto balance_cleanup;
/*
** Balance the parent page. Note that the current page (pPage) might
@@ -27800,7 +27800,7 @@ balance_cleanup:
static int balance_shallower(MemPage *pPage){
MemPage *pChild; /* The only child page of pPage */
Pgno pgnoChild; /* Page number for pChild */
- int rc = STQLITE_OK; /* Return code from subprocedures */
+ int rc = SQLITE_OK; /* Return code from subprocedures */
BtShared *pBt; /* The main BTree structure */
int mxCellPerPage; /* Maximum number of cells per page */
u8 **apCell; /* All cells from pages being balanced */
@@ -27811,7 +27811,7 @@ static int balance_shallower(MemPage *pPage){
pBt = pPage->pBt;
mxCellPerPage = MX_CELL(pBt);
apCell = sqliteMallocRaw( mxCellPerPage*(sizeof(u8*)+sizeof(int)) );
- if( apCell==0 ) return STQLITE_NOMEM;
+ if( apCell==0 ) return SQLITE_NOMEM;
szCell = (int*)&apCell[mxCellPerPage];
if( pPage->leaf ){
/* The table is completely empty */
@@ -27863,25 +27863,25 @@ static int balance_shallower(MemPage *pPage){
pPage->isInit = 0;
pPage->pParent = 0;
rc = sqlite3BtreeInitPage(pPage, 0);
- assert( rc==STQLITE_OK );
+ assert( rc==SQLITE_OK );
freePage(pChild);
TRACE(("BALANCE: transfer child %d into root %d\n",
pChild->pgno, pPage->pgno));
}
rc = reparentChildPages(pPage);
assert( pPage->nOverflow==0 );
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
int i;
for(i=0; i<pPage->nCell; i++){
rc = ptrmapPutOvfl(pPage, i);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto end_shallow_balance;
}
}
}
#endif
- if( rc!=STQLITE_OK ) goto end_shallow_balance;
+ if( rc!=SQLITE_OK ) goto end_shallow_balance;
releasePage(pChild);
}
end_shallow_balance:
@@ -27935,14 +27935,14 @@ static int balance_deeper(MemPage *pPage){
zeroPage(pPage, pChild->aData[0] & ~PTF_LEAF);
put4byte(&pPage->aData[pPage->hdrOffset+8], pgnoChild);
TRACE(("BALANCE: copy root %d into %d\n", pPage->pgno, pChild->pgno));
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
int i;
rc = ptrmapPut(pBt, pChild->pgno, PTRMAP_BTREE, pPage->pgno);
if( rc ) goto balancedeeper_out;
for(i=0; i<pChild->nCell; i++){
rc = ptrmapPutOvfl(pChild, i);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
}
@@ -27960,12 +27960,12 @@ balancedeeper_out:
** required, call the appropriate balancing routine.
*/
static int balance(MemPage *pPage, int insert){
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
if( pPage->pParent==0 ){
if( pPage->nOverflow>0 ){
rc = balance_deeper(pPage);
}
- if( rc==STQLITE_OK && pPage->nCell==0 ){
+ if( rc==SQLITE_OK && pPage->nCell==0 ){
rc = balance_shallower(pPage);
}
}else{
@@ -27983,7 +27983,7 @@ static int balance(MemPage *pPage, int insert){
** database connection (a database connection that shares the pager
** cache with the current connection) and that other connection
** is not in the ReadUncommmitted state, then this routine returns
-** STQLITE_LOCKED.
+** SQLITE_LOCKED.
**
** In addition to checking for read-locks (where a read-lock
** means a cursor opened with wrFlag==0) this routine also moves
@@ -28004,14 +28004,14 @@ static int checkReadLocks(Btree *pBtree, Pgno pgnoRoot, BtCursor *pExclude){
if( p->wrFlag==0 ){
sqlite3 *dbOther = p->pBtree->pSqlite;
if( dbOther==0 ||
- (dbOther!=db && (dbOther->flags & STQLITE_ReadUncommitted)==0) ){
- return STQLITE_LOCKED;
+ (dbOther!=db && (dbOther->flags & SQLITE_ReadUncommitted)==0) ){
+ return SQLITE_LOCKED;
}
}else if( p->pPage->pgno!=p->pgnoRoot ){
moveToRoot(p);
}
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -28023,7 +28023,7 @@ static int checkReadLocks(Btree *pBtree, Pgno pgnoRoot, BtCursor *pExclude){
** For an INTKEY table, only the nKey value of the key is used. pKey is
** ignored. For a ZERODATA table, the pData and nData are both ignored.
*/
-STQLITE_PRIVATE int sqlite3BtreeInsert(
+SQLITE_PRIVATE int sqlite3BtreeInsert(
BtCursor *pCur, /* Insert data into the table of this cursor */
const void *pKey, i64 nKey, /* The key of the new record */
const void *pData, int nData, /* The data of the new record */
@@ -28040,21 +28040,21 @@ STQLITE_PRIVATE int sqlite3BtreeInsert(
if( pBt->inTransaction!=TRANS_WRITE ){
/* Must start a transaction before doing an insert */
- return pBt->readOnly ? STQLITE_READONLY : STQLITE_ERROR;
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
assert( !pBt->readOnly );
if( !pCur->wrFlag ){
- return STQLITE_PERM; /* Cursor not open for writing */
+ return SQLITE_PERM; /* Cursor not open for writing */
}
if( checkReadLocks(pCur->pBtree, pCur->pgnoRoot, pCur) ){
- return STQLITE_LOCKED; /* The table pCur points to has a read lock */
+ return SQLITE_LOCKED; /* The table pCur points to has a read lock */
}
/* Save the positions of any other cursors open on this table */
clearCursorPosition(pCur);
if(
- STQLITE_OK!=(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur)) ||
- STQLITE_OK!=(rc = sqlite3BtreeMoveto(pCur, pKey, nKey, appendBias, &loc))
+ SQLITE_OK!=(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur)) ||
+ SQLITE_OK!=(rc = sqlite3BtreeMoveto(pCur, pKey, nKey, appendBias, &loc))
){
return rc;
}
@@ -28069,7 +28069,7 @@ STQLITE_PRIVATE int sqlite3BtreeInsert(
rc = sqlite3PagerWrite(pPage->pDbPage);
if( rc ) return rc;
newCell = sqliteMallocRaw( MX_CELL_SIZE(pBt) );
- if( newCell==0 ) return STQLITE_NOMEM;
+ if( newCell==0 ) return SQLITE_NOMEM;
rc = fillInCell(pPage, newCell, pKey, nKey, pData, nData, nZero, &szNew);
if( rc ) goto end_insert;
assert( szNew==cellSizePtr(pPage, newCell) );
@@ -28093,11 +28093,11 @@ STQLITE_PRIVATE int sqlite3BtreeInsert(
assert( pPage->leaf );
}
rc = insertCell(pPage, pCur->idx, newCell, szNew, 0, 0);
- if( rc!=STQLITE_OK ) goto end_insert;
+ if( rc!=SQLITE_OK ) goto end_insert;
rc = balance(pPage, 1);
/* sqlite3BtreePageDump(pCur->pBt, pCur->pgnoRoot, 1); */
/* fflush(stdout); */
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
moveToRoot(pCur);
}
end_insert:
@@ -28109,7 +28109,7 @@ end_insert:
** Delete the entry that the cursor is pointing to. The cursor
** is left pointing at a random location.
*/
-STQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){
+SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){
MemPage *pPage = pCur->pPage;
unsigned char *pCell;
int rc;
@@ -28119,17 +28119,17 @@ STQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){
assert( pPage->isInit );
if( pBt->inTransaction!=TRANS_WRITE ){
/* Must start a transaction before doing a delete */
- return pBt->readOnly ? STQLITE_READONLY : STQLITE_ERROR;
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
assert( !pBt->readOnly );
if( pCur->idx >= pPage->nCell ){
- return STQLITE_ERROR; /* The cursor is not pointing to anything */
+ return SQLITE_ERROR; /* The cursor is not pointing to anything */
}
if( !pCur->wrFlag ){
- return STQLITE_PERM; /* Did not open this cursor for writing */
+ return SQLITE_PERM; /* Did not open this cursor for writing */
}
if( checkReadLocks(pCur->pBtree, pCur->pgnoRoot, pCur) ){
- return STQLITE_LOCKED; /* The table pCur points to has a read lock */
+ return SQLITE_LOCKED; /* The table pCur points to has a read lock */
}
/* Restore the current cursor position (a no-op if the cursor is not in
@@ -28174,10 +28174,10 @@ STQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){
assert( !pPage->leafData );
sqlite3BtreeGetTempCursor(pCur, &leafCur);
rc = sqlite3BtreeNext(&leafCur, &notUsed);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3PagerWrite(leafCur.pPage->pDbPage);
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
TRACE(("DELETE: table=%d delete internal from %d replace from leaf %d\n",
pCur->pgnoRoot, pPage->pgno, leafCur.pPage->pgno));
dropCell(pPage, pCur->idx, cellSizePtr(pPage, pCell));
@@ -28186,17 +28186,17 @@ STQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){
assert( MX_CELL_SIZE(pBt)>=szNext+4 );
tempCell = sqliteMallocRaw( MX_CELL_SIZE(pBt) );
if( tempCell==0 ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
}
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = insertCell(pPage, pCur->idx, pNext-4, szNext+4, tempCell, 0);
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
put4byte(findOverflowCell(pPage, pCur->idx), pgnoChild);
rc = balance(pPage, 0);
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
dropCell(leafCur.pPage, leafCur.idx, szNext);
rc = balance(leafCur.pPage, 0);
}
@@ -28208,7 +28208,7 @@ STQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){
dropCell(pPage, pCur->idx, cellSizePtr(pPage, pCell));
rc = balance(pPage, 0);
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
moveToRoot(pCur);
}
return rc;
@@ -28225,18 +28225,18 @@ STQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){
** BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys
** BTREE_ZERODATA Used for SQL indices
*/
-STQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
+SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
BtShared *pBt = p->pBt;
MemPage *pRoot;
Pgno pgnoRoot;
int rc;
if( pBt->inTransaction!=TRANS_WRITE ){
/* Must start a transaction first */
- return pBt->readOnly ? STQLITE_READONLY : STQLITE_ERROR;
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
assert( !pBt->readOnly );
-#ifdef STQLITE_OMIT_AUTOVACUUM
+#ifdef SQLITE_OMIT_AUTOVACUUM
rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
if( rc ) return rc;
#else
@@ -28256,7 +28256,7 @@ STQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
** created so far, so the new root-page is (meta[3]+1).
*/
rc = sqlite3BtreeGetMeta(p, 4, &pgnoRoot);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
pgnoRoot++;
/* The new root-page may not be allocated on a pointer-map page, or the
@@ -28273,7 +28273,7 @@ STQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
** to reside at pgnoRoot).
*/
rc = allocateBtreePage(pBt, &pPageMove, &pgnoMove, pgnoRoot, 1);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -28291,18 +28291,18 @@ STQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
/* Move the page currently at pgnoRoot to pgnoMove. */
rc = sqlite3BtreeGetPage(pBt, pgnoRoot, &pRoot, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = ptrmapGet(pBt, pgnoRoot, &eType, &iPtrPage);
- if( rc!=STQLITE_OK || eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){
+ if( rc!=SQLITE_OK || eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){
releasePage(pRoot);
return rc;
}
assert( eType!=PTRMAP_ROOTPAGE );
assert( eType!=PTRMAP_FREEPAGE );
rc = sqlite3PagerWrite(pRoot->pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(pRoot);
return rc;
}
@@ -28310,15 +28310,15 @@ STQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
releasePage(pRoot);
/* Obtain the page at pgnoRoot */
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = sqlite3BtreeGetPage(pBt, pgnoRoot, &pRoot, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = sqlite3PagerWrite(pRoot->pDbPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(pRoot);
return rc;
}
@@ -28347,7 +28347,7 @@ STQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
zeroPage(pRoot, flags | PTF_LEAF);
sqlite3PagerUnref(pRoot->pDbPage);
*piTable = (int)pgnoRoot;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -28366,7 +28366,7 @@ static int clearDatabasePage(
int i;
if( pgno>sqlite3PagerPagecount(pBt->pPager) ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
rc = getAndInitPage(pBt, pgno, &pPage, pParent);
@@ -28400,15 +28400,15 @@ cleardatabasepage_out:
** the page number of the root of the table. After this routine returns,
** the root page is empty, but still exists.
**
-** This routine will fail with STQLITE_LOCKED if there are any open
+** This routine will fail with SQLITE_LOCKED if there are any open
** read cursors on the table. Open write cursors are moved to the
** root of the table.
*/
-STQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable){
+SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable){
int rc;
BtShared *pBt = p->pBt;
if( p->inTrans!=TRANS_WRITE ){
- return pBt->readOnly ? STQLITE_READONLY : STQLITE_ERROR;
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
rc = checkReadLocks(p, iTable, 0);
if( rc ){
@@ -28416,7 +28416,7 @@ STQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable){
}
/* Save the position of all cursors open on this table */
- if( STQLITE_OK!=(rc = saveAllCursors(pBt, iTable, 0)) ){
+ if( SQLITE_OK!=(rc = saveAllCursors(pBt, iTable, 0)) ){
return rc;
}
@@ -28428,7 +28428,7 @@ STQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable){
** the freelist. Except, the root of the principle table (the one on
** page 1) is never added to the freelist.
**
-** This routine will fail with STQLITE_LOCKED if there are any open
+** This routine will fail with SQLITE_LOCKED if there are any open
** cursors on the table.
**
** If AUTOVACUUM is enabled and the page at iTable is not the last
@@ -28443,13 +28443,13 @@ STQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable){
** The last root page is recorded in meta[3] and the value of
** meta[3] is updated by this procedure.
*/
-STQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
+SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
int rc;
MemPage *pPage = 0;
BtShared *pBt = p->pBt;
if( p->inTrans!=TRANS_WRITE ){
- return pBt->readOnly ? STQLITE_READONLY : STQLITE_ERROR;
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
/* It is illegal to drop a table if any cursors are open on the
@@ -28459,7 +28459,7 @@ STQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
** occur.
*/
if( pBt->pCursor ){
- return STQLITE_LOCKED;
+ return SQLITE_LOCKED;
}
rc = sqlite3BtreeGetPage(pBt, (Pgno)iTable, &pPage, 0);
@@ -28473,14 +28473,14 @@ STQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
*piMoved = 0;
if( iTable>1 ){
-#ifdef STQLITE_OMIT_AUTOVACUUM
+#ifdef SQLITE_OMIT_AUTOVACUUM
rc = freePage(pPage);
releasePage(pPage);
#else
if( pBt->autoVacuum ){
Pgno maxRootPgno;
rc = sqlite3BtreeGetMeta(p, 4, &maxRootPgno);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
releasePage(pPage);
return rc;
}
@@ -28491,7 +28491,7 @@ STQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
*/
rc = freePage(pPage);
releasePage(pPage);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
}else{
@@ -28502,21 +28502,21 @@ STQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
MemPage *pMove;
releasePage(pPage);
rc = sqlite3BtreeGetPage(pBt, maxRootPgno, &pMove, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = relocatePage(pBt, pMove, PTRMAP_ROOTPAGE, 0, iTable);
releasePage(pMove);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = sqlite3BtreeGetPage(pBt, maxRootPgno, &pMove, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
rc = freePage(pMove);
releasePage(pMove);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
*piMoved = maxRootPgno;
@@ -28561,7 +28561,7 @@ STQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
** layer (and the SetCookie and ReadCookie opcodes) the number of
** free pages is not visible. So Cookie[0] is the same as Meta[1].
*/
-STQLITE_PRIVATE int sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
+SQLITE_PRIVATE int sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
DbPage *pDbPage;
int rc;
unsigned char *pP1;
@@ -28569,11 +28569,11 @@ STQLITE_PRIVATE int sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
/* Reading a meta-data value requires a read-lock on page 1 (and hence
** the sqlite_master table. We grab this lock regardless of whether or
- ** not the STQLITE_ReadUncommitted flag is set (the table rooted at page
+ ** not the SQLITE_ReadUncommitted flag is set (the table rooted at page
** 1 is treated as a special case by queryTableLock() and lockTable()).
*/
rc = queryTableLock(p, 1, READ_LOCK);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -28587,7 +28587,7 @@ STQLITE_PRIVATE int sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
/* If autovacuumed is disabled in this build but we are trying to
** access an autovacuumed database, then make the database readonly.
*/
-#ifdef STQLITE_OMIT_AUTOVACUUM
+#ifdef SQLITE_OMIT_AUTOVACUUM
if( idx==4 && *pMeta>0 ) pBt->readOnly = 1;
#endif
@@ -28600,13 +28600,13 @@ STQLITE_PRIVATE int sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
** Write meta-information back into the database. Meta[0] is
** read-only and may not be written.
*/
-STQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
+SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
BtShared *pBt = p->pBt;
unsigned char *pP1;
int rc;
assert( idx>=1 && idx<=15 );
if( p->inTrans!=TRANS_WRITE ){
- return pBt->readOnly ? STQLITE_READONLY : STQLITE_ERROR;
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
assert( pBt->pPage1!=0 );
pP1 = pBt->pPage1->aData;
@@ -28618,14 +28618,14 @@ STQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
assert( iMeta==0 || iMeta==1 );
pBt->incrVacuum = iMeta;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Return the flag byte at the beginning of the page that the cursor
** is currently pointing to.
*/
-STQLITE_PRIVATE int sqlite3BtreeFlags(BtCursor *pCur){
+SQLITE_PRIVATE int sqlite3BtreeFlags(BtCursor *pCur){
/* TODO: What about CURSOR_RETQUIRESEEK state? Probably need to call
** restoreOrClearCursorPosition() here.
*/
@@ -28638,11 +28638,11 @@ STQLITE_PRIVATE int sqlite3BtreeFlags(BtCursor *pCur){
** Return the pager associated with a BTree. This routine is used for
** testing and debugging only.
*/
-STQLITE_PRIVATE Pager *sqlite3BtreePager(Btree *p){
+SQLITE_PRIVATE Pager *sqlite3BtreePager(Btree *p){
return p->pBt->pPager;
}
-#ifndef STQLITE_OMIT_INTEGRITY_CHECK
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
/*
** Append a message to the error message string.
*/
@@ -28671,9 +28671,9 @@ static void checkAppendMsg(
}
sqliteFree(zMsg2);
}
-#endif /* STQLITE_OMIT_INTEGRITY_CHECK */
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
-#ifndef STQLITE_OMIT_INTEGRITY_CHECK
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
/*
** Add 1 to the reference count for page iPage. If this is the second
** reference to the page, add an error message to pCheck->zErrMsg.
@@ -28695,7 +28695,7 @@ static int checkRef(IntegrityCk *pCheck, int iPage, char *zContext){
return (pCheck->anRef[iPage]++)>1;
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/*
** Check that the entry in the pointer-map for page iChild maps to
** page iParent, pointer type ptrType. If not, append an error message
@@ -28713,7 +28713,7 @@ static void checkPtrmap(
Pgno iPtrmapParent;
rc = ptrmapGet(pCheck->pBt, iChild, &ePtrmapType, &iPtrmapParent);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
checkAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild);
return;
}
@@ -28757,7 +28757,7 @@ static void checkList(
pOvflData = (unsigned char *)sqlite3PagerGetData(pOvflPage);
if( isFreeList ){
int n = get4byte(&pOvflData[4]);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pCheck->pBt->autoVacuum ){
checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0, zContext);
}
@@ -28769,7 +28769,7 @@ static void checkList(
}else{
for(i=0; i<n; i++){
Pgno iFreePage = get4byte(&pOvflData[8+i*4]);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pCheck->pBt->autoVacuum ){
checkPtrmap(pCheck, iFreePage, PTRMAP_FREEPAGE, 0, zContext);
}
@@ -28779,7 +28779,7 @@ static void checkList(
N -= n;
}
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
else{
/* If this database supports auto-vacuum and iPage is not the last
** page in this overflow list, check that the pointer-map entry for
@@ -28795,9 +28795,9 @@ static void checkList(
sqlite3PagerUnref(pOvflPage);
}
}
-#endif /* STQLITE_OMIT_INTEGRITY_CHECK */
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
-#ifndef STQLITE_OMIT_INTEGRITY_CHECK
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
/*
** Do various sanity checks on a single page of a tree. Return
** the tree depth. Root pages return 0. Parents of root pages
@@ -28872,7 +28872,7 @@ static int checkTreePage(
if( sz>info.nLocal ){
int nPage = (sz - info.nLocal + usableSize - 5)/(usableSize - 4);
Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage, zContext);
}
@@ -28884,7 +28884,7 @@ static int checkTreePage(
*/
if( !pPage->leaf ){
pgno = get4byte(pCell);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext);
}
@@ -28900,7 +28900,7 @@ static int checkTreePage(
pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]);
sqlite3_snprintf(sizeof(zContext), zContext,
"On page %d at right child: ", iPage);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0);
}
@@ -28960,9 +28960,9 @@ static int checkTreePage(
releasePage(pPage);
return depth+1;
}
-#endif /* STQLITE_OMIT_INTEGRITY_CHECK */
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
-#ifndef STQLITE_OMIT_INTEGRITY_CHECK
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
/*
** This routine does a complete check of the given BTree file. aRoot[] is
** an array of pages numbers were each page number is the root page of
@@ -28973,7 +28973,7 @@ static int checkTreePage(
** and a pointer to that error message is returned. The calling function
** is responsible for freeing the error message when it is done.
*/
-STQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
+SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
Btree *p, /* The btree to be checked */
int *aRoot, /* An array of root pages numbers for individual trees */
int nRoot, /* Number of entries in aRoot[] */
@@ -28986,7 +28986,7 @@ STQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
BtShared *pBt = p->pBt;
nRef = sqlite3PagerRefcount(pBt->pPager);
- if( lockBtreeWithRetry(p)!=STQLITE_OK ){
+ if( lockBtreeWithRetry(p)!=SQLITE_OK ){
return sqliteStrDup("Unable to acquire a read lock on the database");
}
sCheck.pBt = pBt;
@@ -28995,7 +28995,7 @@ STQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
sCheck.mxErr = mxErr;
sCheck.nErr = 0;
*pnErr = 0;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->nTrunc!=0 ){
sCheck.nPage = pBt->nTrunc;
}
@@ -29027,7 +29027,7 @@ STQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
*/
for(i=0; i<nRoot && sCheck.mxErr; i++){
if( aRoot[i]==0 ) continue;
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum && aRoot[i]>1 ){
checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0);
}
@@ -29038,7 +29038,7 @@ STQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
/* Make sure every page in the file is referenced
*/
for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){
-#ifdef STQLITE_OMIT_AUTOVACUUM
+#ifdef SQLITE_OMIT_AUTOVACUUM
if( sCheck.anRef[i]==0 ){
checkAppendMsg(&sCheck, 0, "Page %d is never used", i);
}
@@ -29073,12 +29073,12 @@ STQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
*pnErr = sCheck.nErr;
return sCheck.zErrMsg;
}
-#endif /* STQLITE_OMIT_INTEGRITY_CHECK */
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
/*
** Return the full pathname of the underlying database file.
*/
-STQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *p){
+SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *p){
assert( p->pBt->pPager!=0 );
return sqlite3PagerFilename(p->pBt->pPager);
}
@@ -29086,7 +29086,7 @@ STQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *p){
/*
** Return the pathname of the directory that contains the database file.
*/
-STQLITE_PRIVATE const char *sqlite3BtreeGetDirname(Btree *p){
+SQLITE_PRIVATE const char *sqlite3BtreeGetDirname(Btree *p){
assert( p->pBt->pPager!=0 );
return sqlite3PagerDirname(p->pBt->pPager);
}
@@ -29096,12 +29096,12 @@ STQLITE_PRIVATE const char *sqlite3BtreeGetDirname(Btree *p){
** value of this routine is the same regardless of whether the journal file
** has been created or not.
*/
-STQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *p){
+SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *p){
assert( p->pBt->pPager!=0 );
return sqlite3PagerJournalname(p->pBt->pPager);
}
-#ifndef STQLITE_OMIT_VACUUM
+#ifndef SQLITE_OMIT_VACUUM
/*
** Copy the complete content of pBtFrom into pBtTo. A transaction
** must be active for both files.
@@ -29109,21 +29109,21 @@ STQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *p){
** The size of file pBtFrom may be reduced by this operation.
** If anything goes wrong, the transaction on pBtFrom is rolled back.
*/
-STQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
+ int rc = SQLITE_OK;
Pgno i, nPage, nToPage, iSkip;
BtShared *pBtTo = pTo->pBt;
BtShared *pBtFrom = pFrom->pBt;
if( pTo->inTrans!=TRANS_WRITE || pFrom->inTrans!=TRANS_WRITE ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
- if( pBtTo->pCursor ) return STQLITE_BUSY;
+ if( pBtTo->pCursor ) return SQLITE_BUSY;
nToPage = sqlite3PagerPagecount(pBtTo->pPager);
nPage = sqlite3PagerPagecount(pBtFrom->pPager);
iSkip = PENDING_BYTE_PAGE(pBtTo);
- for(i=1; rc==STQLITE_OK && i<=nPage; i++){
+ for(i=1; rc==SQLITE_OK && i<=nPage; i++){
DbPage *pDbPage;
if( i==iSkip ) continue;
rc = sqlite3PagerGet(pBtFrom->pPager, i, &pDbPage);
@@ -29135,7 +29135,7 @@ STQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
/* If the file is shrinking, journal the pages that are being truncated
** so that they can be rolled back if the commit fails.
*/
- for(i=nPage+1; rc==STQLITE_OK && i<=nToPage; i++){
+ for(i=nPage+1; rc==SQLITE_OK && i<=nToPage; i++){
DbPage *pDbPage;
if( i==iSkip ) continue;
rc = sqlite3PagerGet(pBtTo->pPager, i, &pDbPage);
@@ -29161,26 +29161,26 @@ STQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
}
return rc;
}
-#endif /* STQLITE_OMIT_VACUUM */
+#endif /* SQLITE_OMIT_VACUUM */
/*
** Return non-zero if a transaction is active.
*/
-STQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree *p){
return (p && (p->inTrans==TRANS_WRITE));
}
/*
** Return non-zero if a statement transaction is active.
*/
-STQLITE_PRIVATE int sqlite3BtreeIsInStmt(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeIsInStmt(Btree *p){
return (p->pBt && p->pBt->inStmt);
}
/*
** Return non-zero if a read (or write) transaction is active.
*/
-STQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree *p){
+SQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree *p){
return (p && (p->inTrans!=TRANS_NONE));
}
@@ -29200,7 +29200,7 @@ STQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree *p){
** blob of allocated memory. This function should not call sqliteFree()
** on the memory, the btree layer does that.
*/
-STQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void *)){
+SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void *)){
BtShared *pBt = p->pBt;
if( !pBt->pSchema ){
pBt->pSchema = sqliteMalloc(nBytes);
@@ -29213,29 +29213,29 @@ STQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void
** Return true if another user of the same shared btree as the argument
** handle holds an exclusive lock on the sqlite_master table.
*/
-STQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *p){
- return (queryTableLock(p, MASTER_ROOT, READ_LOCK)!=STQLITE_OK);
+SQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *p){
+ return (queryTableLock(p, MASTER_ROOT, READ_LOCK)!=SQLITE_OK);
}
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
/*
** Obtain a lock on the table whose root page is iTab. The
** lock is a write lock if isWritelock is true or a read lock
** if it is false.
*/
-STQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
+ int rc = SQLITE_OK;
u8 lockType = (isWriteLock?WRITE_LOCK:READ_LOCK);
rc = queryTableLock(p, iTab, lockType);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = lockTable(p, iTab, lockType);
}
return rc;
}
#endif
-#ifndef STQLITE_OMIT_INCRBLOB
+#ifndef SQLITE_OMIT_INCRBLOB
/*
** Argument pCsr must be a cursor opened for writing on an
** INTKEY table currently pointing at a valid table entry.
@@ -29243,11 +29243,11 @@ STQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
** Only the data content may only be modified, it is not possible
** to change the length of the data stored.
*/
-STQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
+SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
assert(pCsr->isIncrblobHandle);
if( pCsr->eState==CURSOR_RETQUIRESEEK ){
- return STQLITE_ABORT;
+ return SQLITE_ABORT;
}
/* Check some preconditions:
@@ -29256,15 +29256,15 @@ STQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, voi
** (c) the cursor points at a valid row of an intKey table.
*/
if( !pCsr->wrFlag ){
- return STQLITE_READONLY;
+ return SQLITE_READONLY;
}
assert( !pCsr->pBtree->pBt->readOnly
&& pCsr->pBtree->pBt->inTransaction==TRANS_WRITE );
if( checkReadLocks(pCsr->pBtree, pCsr->pgnoRoot, pCsr) ){
- return STQLITE_LOCKED; /* The table pCur points to has a read lock */
+ return SQLITE_LOCKED; /* The table pCur points to has a read lock */
}
if( pCsr->eState==CURSOR_INVALID || !pCsr->pPage->intKey ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
return accessPayload(pCsr, offset, amt, (unsigned char *)z, 0, 1);
@@ -29280,7 +29280,7 @@ STQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, voi
** accessPayload() (the worker function for sqlite3BtreeData() and
** sqlite3BtreePutData()).
*/
-STQLITE_PRIVATE void sqlite3BtreeCacheOverflow(BtCursor *pCur){
+SQLITE_PRIVATE void sqlite3BtreeCacheOverflow(BtCursor *pCur){
assert(!pCur->isIncrblobHandle);
assert(!pCur->aOverflow);
pCur->isIncrblobHandle = 1;
@@ -29326,44 +29326,44 @@ static FifoPage *allocateFifoPage(int nEntry){
/*
** Initialize a Fifo structure.
*/
-STQLITE_PRIVATE void sqlite3VdbeFifoInit(Fifo *pFifo){
+SQLITE_PRIVATE void sqlite3VdbeFifoInit(Fifo *pFifo){
memset(pFifo, 0, sizeof(*pFifo));
}
/*
-** Push a single 64-bit integer value into the Fifo. Return STQLITE_OK
-** normally. STQLITE_NOMEM is returned if we are unable to allocate
+** Push a single 64-bit integer value into the Fifo. Return SQLITE_OK
+** normally. SQLITE_NOMEM is returned if we are unable to allocate
** memory.
*/
-STQLITE_PRIVATE int sqlite3VdbeFifoPush(Fifo *pFifo, i64 val){
+SQLITE_PRIVATE int sqlite3VdbeFifoPush(Fifo *pFifo, i64 val){
FifoPage *pPage;
pPage = pFifo->pLast;
if( pPage==0 ){
pPage = pFifo->pLast = pFifo->pFirst = allocateFifoPage(20);
if( pPage==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
}else if( pPage->iWrite>=pPage->nSlot ){
pPage->pNext = allocateFifoPage(pFifo->nEntry);
if( pPage->pNext==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
pPage = pFifo->pLast = pPage->pNext;
}
pPage->aSlot[pPage->iWrite++] = val;
pFifo->nEntry++;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Extract a single 64-bit integer value from the Fifo. The integer
** extracted is the one least recently inserted. If the Fifo is empty
-** return STQLITE_DONE.
+** return SQLITE_DONE.
*/
-STQLITE_PRIVATE int sqlite3VdbeFifoPop(Fifo *pFifo, i64 *pVal){
+SQLITE_PRIVATE int sqlite3VdbeFifoPop(Fifo *pFifo, i64 *pVal){
FifoPage *pPage;
if( pFifo->nEntry==0 ){
- return STQLITE_DONE;
+ return SQLITE_DONE;
}
assert( pFifo->nEntry>0 );
pPage = pFifo->pFirst;
@@ -29386,14 +29386,14 @@ STQLITE_PRIVATE int sqlite3VdbeFifoPop(Fifo *pFifo, i64 *pVal){
}else{
assert( pFifo->nEntry>0 );
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Delete all information from a Fifo object. Free all memory held
** by the Fifo.
*/
-STQLITE_PRIVATE void sqlite3VdbeFifoClear(Fifo *pFifo){
+SQLITE_PRIVATE void sqlite3VdbeFifoClear(Fifo *pFifo){
FifoPage *pPage, *pNextPage;
for(pPage=pFifo->pFirst; pPage; pPage=pNextPage){
pNextPage = pPage->pNext;
@@ -29431,33 +29431,33 @@ STQLITE_PRIVATE void sqlite3VdbeFifoClear(Fifo *pFifo){
/*
** If pMem is an object with a valid string representation, this routine
** ensures the internal encoding for the string representation is
-** 'desiredEnc', one of STQLITE_UTF8, STQLITE_UTF16LE or STQLITE_UTF16BE.
+** 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.
**
** If pMem is not a string object, or the encoding of the string
** representation is already stored using the requested encoding, then this
** routine is a no-op.
**
-** STQLITE_OK is returned if the conversion is successful (or not required).
-** STQLITE_NOMEM may be returned if a malloc() fails during conversion
+** SQLITE_OK is returned if the conversion is successful (or not required).
+** SQLITE_NOMEM may be returned if a malloc() fails during conversion
** between formats.
*/
-STQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
+SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
int rc;
if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#ifdef STQLITE_OMIT_UTF16
- return STQLITE_ERROR;
+#ifdef SQLITE_OMIT_UTF16
+ return SQLITE_ERROR;
#else
- /* MemTranslate() may return STQLITE_OK or STQLITE_NOMEM. If NOMEM is returned,
+ /* MemTranslate() may return SQLITE_OK or SQLITE_NOMEM. If NOMEM is returned,
** then the encoding of the value may not have changed.
*/
rc = sqlite3VdbeMemTranslate(pMem, desiredEnc);
- assert(rc==STQLITE_OK || rc==STQLITE_NOMEM);
- assert(rc==STQLITE_OK || pMem->enc!=desiredEnc);
- assert(rc==STQLITE_NOMEM || pMem->enc==desiredEnc);
+ assert(rc==SQLITE_OK || rc==SQLITE_NOMEM);
+ assert(rc==SQLITE_OK || pMem->enc!=desiredEnc);
+ assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
return rc;
#endif
}
@@ -29465,21 +29465,21 @@ STQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
/*
** Make the given Mem object MEM_Dyn.
**
-** Return STQLITE_OK on success or STQLITE_NOMEM if malloc fails.
+** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemDynamicify(Mem *pMem){
+SQLITE_PRIVATE int sqlite3VdbeMemDynamicify(Mem *pMem){
int n;
u8 *z;
expandBlob(pMem);
if( (pMem->flags & (MEM_Ephem|MEM_Static|MEM_Short))==0 ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
assert( (pMem->flags & MEM_Dyn)==0 );
n = pMem->n;
assert( pMem->flags & (MEM_Str|MEM_Blob) );
z = sqliteMallocRaw( n+2 );
if( z==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
pMem->flags |= MEM_Dyn|MEM_Term;
pMem->xDel = 0;
@@ -29488,15 +29488,15 @@ STQLITE_PRIVATE int sqlite3VdbeMemDynamicify(Mem *pMem){
z[n+1] = 0;
pMem->z = (char*)z;
pMem->flags &= ~(MEM_Ephem|MEM_Static|MEM_Short);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** If the given Mem* has a zero-filled tail, turn it into an ordinary
** blob stored in dynamically allocated space.
*/
-#ifndef STQLITE_OMIT_INCRBLOB
-STQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
+#ifndef SQLITE_OMIT_INCRBLOB
+SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
if( pMem->flags & MEM_Zero ){
char *pNew;
int nByte;
@@ -29505,7 +29505,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
if( nByte<=0 ) nByte = 1;
pNew = sqliteMalloc(nByte);
if( pNew==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
memcpy(pNew, pMem->z, pMem->n);
memset(&pNew[pMem->n], 0, pMem->u.i);
@@ -29516,7 +29516,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
pMem->flags &= ~(MEM_Zero|MEM_Static|MEM_Ephem|MEM_Short|MEM_Term);
pMem->flags |= MEM_Dyn;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
#endif
@@ -29525,14 +29525,14 @@ STQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
** Make the given Mem object either MEM_Short or MEM_Dyn so that bytes
** of the Mem.z[] array can be modified.
**
-** Return STQLITE_OK on success or STQLITE_NOMEM if malloc fails.
+** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
+SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
int n;
u8 *z;
expandBlob(pMem);
if( (pMem->flags & (MEM_Ephem|MEM_Static))==0 ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
assert( (pMem->flags & MEM_Dyn)==0 );
assert( pMem->flags & (MEM_Str|MEM_Blob) );
@@ -29542,7 +29542,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
}else{
z = sqliteMallocRaw( n+2 );
if( z==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
pMem->flags |= MEM_Dyn|MEM_Term;
pMem->xDel = 0;
@@ -29553,15 +29553,15 @@ STQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
pMem->z = (char*)z;
pMem->flags &= ~(MEM_Ephem|MEM_Static);
assert(0==(1&(int)pMem->z));
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Make sure the given Mem is \u0000 terminated.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
+SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){
- return STQLITE_OK; /* Nothing to do */
+ return SQLITE_OK; /* Nothing to do */
}
if( pMem->flags & (MEM_Static|MEM_Ephem) ){
return sqlite3VdbeMemMakeWriteable(pMem);
@@ -29570,7 +29570,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
sqlite3VdbeMemExpandBlob(pMem);
z = sqliteMalloc(pMem->n+2);
- if( !z ) return STQLITE_NOMEM;
+ if( !z ) return SQLITE_NOMEM;
memcpy(z, pMem->z, pMem->n);
z[pMem->n] = 0;
z[pMem->n+1] = 0;
@@ -29583,7 +29583,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
pMem->z = z;
pMem->flags |= MEM_Term;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -29599,8 +29599,8 @@ STQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
** keys are strings. In the former case a NULL pointer is returned the
** user and the later is an internal programming error.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
+ int rc = SQLITE_OK;
int fg = pMem->flags;
char *z = pMem->zShort;
@@ -29622,7 +29622,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
}
pMem->n = strlen(z);
pMem->z = z;
- pMem->enc = STQLITE_UTF8;
+ pMem->enc = SQLITE_UTF8;
pMem->flags |= MEM_Str | MEM_Short | MEM_Term;
sqlite3VdbeChangeEncoding(pMem, enc);
return rc;
@@ -29633,11 +29633,11 @@ STQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
** This routine calls the finalize method for that function. The
** result of the aggregate is stored back into pMem.
**
-** Return STQLITE_ERROR if the finalizer reports an error. STQLITE_OK
+** Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK
** otherwise.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
+ int rc = SQLITE_OK;
if( pFunc && pFunc->xFinalize ){
sqlite3_context ctx;
assert( (pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef );
@@ -29655,7 +29655,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
pMem->z = pMem->zShort;
}
if( ctx.isError ){
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
}
return rc;
@@ -29664,9 +29664,9 @@ STQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
/*
** Release any memory held by the Mem. This may leave the Mem in an
** inconsistent state, for example with (Mem.z==0) and
-** (Mem.type==STQLITE_TEXT).
+** (Mem.type==SQLITE_TEXT).
*/
-STQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p){
+SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p){
if( p->flags & (MEM_Dyn|MEM_Agg) ){
if( p->xDel ){
if( p->flags & MEM_Agg ){
@@ -29694,7 +29694,7 @@ STQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p){
**
** If pMem is a string, its encoding might be changed.
*/
-STQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
+SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
int flags = pMem->flags;
if( flags & MEM_Int ){
return pMem->u.i;
@@ -29703,7 +29703,7 @@ STQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
}else if( flags & (MEM_Str|MEM_Blob) ){
i64 value;
pMem->flags |= MEM_Str;
- if( sqlite3VdbeChangeEncoding(pMem, STQLITE_UTF8)
+ if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
|| sqlite3VdbeMemNulTerminate(pMem) ){
return 0;
}
@@ -29721,7 +29721,7 @@ STQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
** value. If it is a string or blob, try to convert it to a double.
** If it is a NULL, return 0.0.
*/
-STQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
+SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
if( pMem->flags & MEM_Real ){
return pMem->r;
}else if( pMem->flags & MEM_Int ){
@@ -29729,7 +29729,7 @@ STQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
}else if( pMem->flags & (MEM_Str|MEM_Blob) ){
double val = 0.0;
pMem->flags |= MEM_Str;
- if( sqlite3VdbeChangeEncoding(pMem, STQLITE_UTF8)
+ if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
|| sqlite3VdbeMemNulTerminate(pMem) ){
return 0.0;
}
@@ -29745,7 +29745,7 @@ STQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
** The MEM structure is already a MEM_Real. Try to also make it a
** MEM_Int if we can.
*/
-STQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem *pMem){
+SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem *pMem){
assert( pMem->flags & MEM_Real );
pMem->u.i = pMem->r;
if( ((double)pMem->u.i)==pMem->r ){
@@ -29756,29 +29756,29 @@ STQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem *pMem){
/*
** Convert pMem to type integer. Invalidate any prior representations.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem *pMem){
+SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem *pMem){
pMem->u.i = sqlite3VdbeIntValue(pMem);
sqlite3VdbeMemRelease(pMem);
pMem->flags = MEM_Int;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Convert pMem so that it is of type MEM_Real.
** Invalidate any prior representations.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem *pMem){
+SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem *pMem){
pMem->r = sqlite3VdbeRealValue(pMem);
sqlite3VdbeMemRelease(pMem);
pMem->flags = MEM_Real;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Convert pMem so that it has types MEM_Real or MEM_Int or both.
** Invalidate any prior representations.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
+SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
double r1, r2;
i64 i;
assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))==0 );
@@ -29793,16 +29793,16 @@ STQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
pMem->flags = MEM_Real;
sqlite3VdbeMemRelease(pMem);
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Delete any previous value and set the value stored in *pMem to NULL.
*/
-STQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
+SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
sqlite3VdbeMemRelease(pMem);
pMem->flags = MEM_Null;
- pMem->type = STQLITE_NULL;
+ pMem->type = SQLITE_NULL;
pMem->n = 0;
}
@@ -29810,54 +29810,54 @@ STQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
** Delete any previous value and set the value to be a BLOB of length
** n containing all zeros.
*/
-STQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
+SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
sqlite3VdbeMemRelease(pMem);
pMem->flags = MEM_Blob|MEM_Zero|MEM_Short;
- pMem->type = STQLITE_BLOB;
+ pMem->type = SQLITE_BLOB;
pMem->n = 0;
if( n<0 ) n = 0;
pMem->u.i = n;
pMem->z = pMem->zShort;
- pMem->enc = STQLITE_UTF8;
+ pMem->enc = SQLITE_UTF8;
}
/*
** Delete any previous value and set the value stored in *pMem to val,
** manifest type INTEGER.
*/
-STQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
+SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
sqlite3VdbeMemRelease(pMem);
pMem->u.i = val;
pMem->flags = MEM_Int;
- pMem->type = STQLITE_INTEGER;
+ pMem->type = SQLITE_INTEGER;
}
/*
** Delete any previous value and set the value stored in *pMem to val,
** manifest type REAL.
*/
-STQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
+SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
if( sqlite3_isnan(val) ){
sqlite3VdbeMemSetNull(pMem);
}else{
sqlite3VdbeMemRelease(pMem);
pMem->r = val;
pMem->flags = MEM_Real;
- pMem->type = STQLITE_FLOAT;
+ pMem->type = SQLITE_FLOAT;
}
}
/*
** Return true if the Mem object contains a TEXT or BLOB that is
-** too large - whose size exceeds STQLITE_MAX_LENGTH.
+** too large - whose size exceeds SQLITE_MAX_LENGTH.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem *p){
+SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem *p){
if( p->flags & (MEM_Str|MEM_Blob) ){
int n = p->n;
if( p->flags & MEM_Zero ){
n += p->u.i;
}
- return n>STQLITE_MAX_LENGTH;
+ return n>SQLITE_MAX_LENGTH;
}
return 0;
}
@@ -29868,7 +29868,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem *p){
** pFrom->z is used, then pTo->z points to the same thing as pFrom->z
** and flags gets srcType (either MEM_Ephem or MEM_Static).
*/
-STQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
+SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
memcpy(pTo, pFrom, sizeof(*pFrom)-sizeof(pFrom->zShort));
pTo->xDel = 0;
if( pTo->flags & (MEM_Str|MEM_Blob) ){
@@ -29882,7 +29882,7 @@ STQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int s
** Make a full copy of pFrom into pTo. Prior contents of pTo are
** freed before the copy is made.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
+SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
int rc;
if( pTo->flags & MEM_Dyn ){
sqlite3VdbeMemRelease(pTo);
@@ -29891,7 +29891,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
if( pTo->flags & MEM_Ephem ){
rc = sqlite3VdbeMemMakeWriteable(pTo);
}else{
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}
return rc;
}
@@ -29900,11 +29900,11 @@ STQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
** Transfer the contents of pFrom to pTo. Any existing value in pTo is
** freed. If pFrom contains ephemeral data, a copy is made.
**
-** pFrom contains an SQL NULL when this routine returns. STQLITE_NOMEM
+** pFrom contains an SQL NULL when this routine returns. SQLITE_NOMEM
** might be returned if pFrom held ephemeral data and we were unable
** to allocate enough space to make a copy.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){
+SQLITE_PRIVATE int sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){
int rc;
if( pTo->flags & MEM_Dyn ){
sqlite3VdbeMemRelease(pTo);
@@ -29918,7 +29918,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){
if( pTo->flags & MEM_Ephem ){
rc = sqlite3VdbeMemMakeWriteable(pTo);
}else{
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}
return rc;
}
@@ -29926,7 +29926,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){
/*
** Change the value of a Mem to be a string or a BLOB.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemSetStr(
+SQLITE_PRIVATE int sqlite3VdbeMemSetStr(
Mem *pMem, /* Memory cell to set to string value */
const char *z, /* String pointer */
int n, /* Bytes in string, or negative */
@@ -29936,14 +29936,14 @@ STQLITE_PRIVATE int sqlite3VdbeMemSetStr(
sqlite3VdbeMemRelease(pMem);
if( !z ){
pMem->flags = MEM_Null;
- pMem->type = STQLITE_NULL;
- return STQLITE_OK;
+ pMem->type = SQLITE_NULL;
+ return SQLITE_OK;
}
pMem->z = (char *)z;
- if( xDel==STQLITE_STATIC ){
+ if( xDel==SQLITE_STATIC ){
pMem->flags = MEM_Static;
- }else if( xDel==STQLITE_TRANSIENT ){
+ }else if( xDel==SQLITE_TRANSIENT ){
pMem->flags = MEM_Ephem;
}else{
pMem->flags = MEM_Dyn;
@@ -29951,18 +29951,18 @@ STQLITE_PRIVATE int sqlite3VdbeMemSetStr(
}
pMem->enc = enc;
- pMem->type = enc==0 ? STQLITE_BLOB : STQLITE_TEXT;
+ pMem->type = enc==0 ? SQLITE_BLOB : SQLITE_TEXT;
pMem->n = n;
- assert( enc==0 || enc==STQLITE_UTF8 || enc==STQLITE_UTF16LE
- || enc==STQLITE_UTF16BE );
+ assert( enc==0 || enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE
+ || enc==SQLITE_UTF16BE );
switch( enc ){
case 0:
pMem->flags |= MEM_Blob;
- pMem->enc = STQLITE_UTF8;
+ pMem->enc = SQLITE_UTF8;
break;
- case STQLITE_UTF8:
+ case SQLITE_UTF8:
pMem->flags |= MEM_Str;
if( n<0 ){
pMem->n = strlen(z);
@@ -29970,23 +29970,23 @@ STQLITE_PRIVATE int sqlite3VdbeMemSetStr(
}
break;
-#ifndef STQLITE_OMIT_UTF16
- case STQLITE_UTF16LE:
- case STQLITE_UTF16BE:
+#ifndef SQLITE_OMIT_UTF16
+ case SQLITE_UTF16LE:
+ case SQLITE_UTF16BE:
pMem->flags |= MEM_Str;
if( pMem->n<0 ){
pMem->n = sqlite3Utf16ByteLen(pMem->z,-1);
pMem->flags |= MEM_Term;
}
if( sqlite3VdbeMemHandleBom(pMem) ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
}
if( pMem->flags&MEM_Ephem ){
return sqlite3VdbeMemMakeWriteable(pMem);
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -29998,7 +29998,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemSetStr(
**
** Two NULL values are considered equal by this function.
*/
-STQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){
+SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){
int rc;
int f1, f2;
int combined_flags;
@@ -30064,8 +30064,8 @@ STQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const
}
assert( pMem1->enc==pMem2->enc );
- assert( pMem1->enc==STQLITE_UTF8 ||
- pMem1->enc==STQLITE_UTF16LE || pMem1->enc==STQLITE_UTF16BE );
+ assert( pMem1->enc==SQLITE_UTF8 ||
+ pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE );
/* The collation sequence must be defined at this point, even if
** the user deletes the collation sequence after the vdbe program is
@@ -30123,7 +30123,7 @@ STQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const
** If this routine fails for any reason (malloc returns NULL or unable
** to read from the disk) then the pMem is left in an inconsistent state.
*/
-STQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
+SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
BtCursor *pCur, /* Cursor pointing at record to retrieve. */
int offset, /* Offset from the start of data to return bytes from. */
int amt, /* Number of bytes to return. */
@@ -30149,7 +30149,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
if( amt>NBFS-2 ){
zData = (char *)sqliteMallocRaw(amt+2);
if( !zData ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term;
pMem->xDel = 0;
@@ -30159,7 +30159,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
}
pMem->z = zData;
pMem->enc = 0;
- pMem->type = STQLITE_BLOB;
+ pMem->type = SQLITE_BLOB;
if( key ){
rc = sqlite3BtreeKey(pCur, offset, amt, zData);
@@ -30168,7 +30168,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
}
zData[amt] = 0;
zData[amt+1] = 0;
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
if( amt>NBFS-2 ){
assert( zData!=pMem->zShort );
assert( pMem->flags & MEM_Dyn );
@@ -30181,7 +30181,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
}
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
#ifndef NDEBUG
@@ -30189,7 +30189,7 @@ STQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
** Perform various checks on the memory cell pMem. An assert() will
** fail if pMem is internally inconsistent.
*/
-STQLITE_PRIVATE void sqlite3VdbeMemSanity(Mem *pMem){
+SQLITE_PRIVATE void sqlite3VdbeMemSanity(Mem *pMem){
int flags = pMem->flags;
assert( flags!=0 ); /* Must define some type */
if( flags & (MEM_Str|MEM_Blob) ){
@@ -30204,9 +30204,9 @@ STQLITE_PRIVATE void sqlite3VdbeMemSanity(Mem *pMem){
assert( pMem->xDel==0 || (pMem->flags & MEM_Dyn)!=0 );
if( (flags & MEM_Str) ){
- assert( pMem->enc==STQLITE_UTF8 ||
- pMem->enc==STQLITE_UTF16BE ||
- pMem->enc==STQLITE_UTF16LE
+ assert( pMem->enc==SQLITE_UTF8 ||
+ pMem->enc==SQLITE_UTF16BE ||
+ pMem->enc==SQLITE_UTF16LE
);
/* If the string is UTF-8 encoded and nul terminated, then pMem->n
** must be the length of the string. (Later:) If the database file
@@ -30214,7 +30214,7 @@ STQLITE_PRIVATE void sqlite3VdbeMemSanity(Mem *pMem){
** into the middle of the string. In that case, the strlen() might
** be less.
*/
- if( pMem->enc==STQLITE_UTF8 && (flags & MEM_Term) ){
+ if( pMem->enc==SQLITE_UTF8 && (flags & MEM_Term) ){
assert( strlen(pMem->z)<=pMem->n );
assert( pMem->z[pMem->n]==0 );
}
@@ -30236,16 +30236,16 @@ STQLITE_PRIVATE void sqlite3VdbeMemSanity(Mem *pMem){
/* This function is only available internally, it is not part of the
** external API. It works in a similar way to sqlite3_value_text(),
** except the data returned is in the encoding specified by the second
-** parameter, which must be one of STQLITE_UTF16BE, STQLITE_UTF16LE or
-** STQLITE_UTF8.
+** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or
+** SQLITE_UTF8.
**
-** (2006-02-16:) The enc value can be or-ed with STQLITE_UTF16_ALIGNED.
+** (2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
** If that is the case, then the result must be aligned on an even byte
** boundary.
*/
-STQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
+SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
if( !pVal ) return 0;
- assert( (enc&3)==(enc&~STQLITE_UTF16_ALIGNED) );
+ assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) );
if( pVal->flags&MEM_Null ){
return 0;
@@ -30254,10 +30254,10 @@ STQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
pVal->flags |= (pVal->flags & MEM_Blob)>>3;
expandBlob(pVal);
if( pVal->flags&MEM_Str ){
- sqlite3VdbeChangeEncoding(pVal, enc & ~STQLITE_UTF16_ALIGNED);
- if( (enc & STQLITE_UTF16_ALIGNED)!=0 && 1==(1&(int)pVal->z) ){
+ sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
+ if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&(int)pVal->z) ){
assert( (pVal->flags & (MEM_Ephem|MEM_Static))!=0 );
- if( sqlite3VdbeMemMakeWriteable(pVal)!=STQLITE_OK ){
+ if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){
return 0;
}
}
@@ -30267,8 +30267,8 @@ STQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
sqlite3VdbeMemStringify(pVal, enc);
assert( 0==(1&(int)pVal->z) );
}
- assert(pVal->enc==(enc & ~STQLITE_UTF16_ALIGNED) || sqlite3MallocFailed() );
- if( pVal->enc==(enc & ~STQLITE_UTF16_ALIGNED) ){
+ assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || sqlite3MallocFailed() );
+ if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
return pVal->z;
}else{
return 0;
@@ -30278,11 +30278,11 @@ STQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
/*
** Create a new sqlite3_value object.
*/
-STQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(void){
+SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(void){
Mem *p = sqliteMalloc(sizeof(*p));
if( p ){
p->flags = MEM_Null;
- p->type = STQLITE_NULL;
+ p->type = SQLITE_NULL;
}
return p;
}
@@ -30297,7 +30297,7 @@ STQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(void){
** the value by passing it to sqlite3ValueFree() later on. If the expression
** cannot be converted to a value, then *ppVal is set to NULL.
*/
-STQLITE_PRIVATE int sqlite3ValueFromExpr(
+SQLITE_PRIVATE int sqlite3ValueFromExpr(
Expr *pExpr,
u8 enc,
u8 affinity,
@@ -30309,7 +30309,7 @@ STQLITE_PRIVATE int sqlite3ValueFromExpr(
if( !pExpr ){
*ppVal = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
op = pExpr->op;
@@ -30318,19 +30318,19 @@ STQLITE_PRIVATE int sqlite3ValueFromExpr(
pVal = sqlite3ValueNew();
if( !zVal || !pVal ) goto no_mem;
sqlite3Dequote(zVal);
- sqlite3ValueSetStr(pVal, -1, zVal, STQLITE_UTF8, sqlite3FreeX);
- if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==STQLITE_AFF_NONE ){
- sqlite3ValueApplyAffinity(pVal, STQLITE_AFF_NUMERIC, enc);
+ sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, sqlite3FreeX);
+ if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_NONE ){
+ sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, enc);
}else{
sqlite3ValueApplyAffinity(pVal, affinity, enc);
}
}else if( op==TK_UMINUS ) {
- if( STQLITE_OK==sqlite3ValueFromExpr(pExpr->pLeft, enc, affinity, &pVal) ){
+ if( SQLITE_OK==sqlite3ValueFromExpr(pExpr->pLeft, enc, affinity, &pVal) ){
pVal->u.i = -1 * pVal->u.i;
pVal->r = -1.0 * pVal->r;
}
}
-#ifndef STQLITE_OMIT_BLOB_LITERAL
+#ifndef SQLITE_OMIT_BLOB_LITERAL
else if( op==TK_BLOB ){
int nVal;
pVal = sqlite3ValueNew();
@@ -30344,19 +30344,19 @@ STQLITE_PRIVATE int sqlite3ValueFromExpr(
#endif
*ppVal = pVal;
- return STQLITE_OK;
+ return SQLITE_OK;
no_mem:
sqliteFree(zVal);
sqlite3ValueFree(pVal);
*ppVal = 0;
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
/*
** Change the string value of an sqlite3_value object
*/
-STQLITE_PRIVATE void sqlite3ValueSetStr(
+SQLITE_PRIVATE void sqlite3ValueSetStr(
sqlite3_value *v,
int n,
const void *z,
@@ -30369,9 +30369,9 @@ STQLITE_PRIVATE void sqlite3ValueSetStr(
/*
** Free an sqlite3_value object
*/
-STQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value *v){
+SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value *v){
if( !v ) return;
- sqlite3ValueSetStr(v, 0, 0, STQLITE_UTF8, STQLITE_STATIC);
+ sqlite3ValueSetStr(v, 0, 0, SQLITE_UTF8, SQLITE_STATIC);
sqliteFree(v);
}
@@ -30379,7 +30379,7 @@ STQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value *v){
** Return the number of bytes in the sqlite3_value object assuming
** that it uses the encoding "enc"
*/
-STQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
+SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
Mem *p = (Mem*)pVal;
if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ){
if( p->flags & MEM_Zero ){
@@ -30416,7 +30416,7 @@ STQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
** set the sqlite3_vdbe_addop_trace to 1 and all opcodes will be printed
** as they are added to the instruction stream.
*/
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
int sqlite3_vdbe_addop_trace = 0;
#endif
@@ -30424,7 +30424,7 @@ int sqlite3_vdbe_addop_trace = 0;
/*
** Create a new virtual database engine.
*/
-STQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(sqlite3 *db){
+SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(sqlite3 *db){
Vdbe *p;
p = sqliteMalloc( sizeof(Vdbe) );
if( p==0 ) return 0;
@@ -30442,7 +30442,7 @@ STQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(sqlite3 *db){
/*
** Remember the SQL string for a prepared statement.
*/
-STQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n){
+SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n){
if( p==0 ) return;
assert( p->zSql==0 );
p->zSql = sqlite3StrNDup(z, n);
@@ -30451,14 +30451,14 @@ STQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n){
/*
** Return the SQL associated with a prepared statement
*/
-STQLITE_PRIVATE const char *sqlite3VdbeGetSql(Vdbe *p){
+SQLITE_PRIVATE const char *sqlite3VdbeGetSql(Vdbe *p){
return p->zSql;
}
/*
** Swap all content between two VDBE structures.
*/
-STQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){
+SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){
Vdbe tmp, *pTmp;
char *zTmp;
int nTmp;
@@ -30479,11 +30479,11 @@ STQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){
pB->nSql = nTmp;
}
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
/*
** Turn tracing on or off
*/
-STQLITE_PRIVATE void sqlite3VdbeTrace(Vdbe *p, FILE *trace){
+SQLITE_PRIVATE void sqlite3VdbeTrace(Vdbe *p, FILE *trace){
p->trace = trace;
}
#endif
@@ -30533,7 +30533,7 @@ static void resizeOpArray(Vdbe *p, int N){
** the sqlite3VdbeChangeP3() function to change the value of the P3
** operand.
*/
-STQLITE_PRIVATE int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
+SQLITE_PRIVATE int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
int i;
VdbeOp *pOp;
@@ -30553,7 +30553,7 @@ STQLITE_PRIVATE int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
pOp->p3 = 0;
pOp->p3type = P3_NOTUSED;
p->expired = 0;
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
if( sqlite3_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]);
#endif
return i;
@@ -30562,7 +30562,7 @@ STQLITE_PRIVATE int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
/*
** Add an opcode that includes the p3 value.
*/
-STQLITE_PRIVATE int sqlite3VdbeOp3(Vdbe *p, int op, int p1, int p2, const char *zP3,int p3type){
+SQLITE_PRIVATE int sqlite3VdbeOp3(Vdbe *p, int op, int p1, int p2, const char *zP3,int p3type){
int addr = sqlite3VdbeAddOp(p, op, p1, p2);
sqlite3VdbeChangeP3(p, addr, zP3, p3type);
return addr;
@@ -30582,7 +30582,7 @@ STQLITE_PRIVATE int sqlite3VdbeOp3(Vdbe *p, int op, int p1, int p2, const char *
**
** Zero is returned if a malloc() fails.
*/
-STQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *p){
+SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *p){
int i;
i = p->nLabel++;
assert( p->magic==VDBE_MAGIC_INIT );
@@ -30602,7 +30602,7 @@ STQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *p){
** be inserted. The parameter "x" must have been obtained from
** a prior call to sqlite3VdbeMakeLabel().
*/
-STQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe *p, int x){
+SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe *p, int x){
int j = -1-x;
assert( p->magic==VDBE_MAGIC_INIT );
assert( j>=0 && j<p->nLabel );
@@ -30648,7 +30648,7 @@ static int opcodeNoPush(u8 op){
}
#ifndef NDEBUG
-STQLITE_PRIVATE int sqlite3VdbeOpcodeNoPush(u8 op){
+SQLITE_PRIVATE int sqlite3VdbeOpcodeNoPush(u8 op){
return opcodeNoPush(op);
}
#endif
@@ -30668,7 +30668,7 @@ STQLITE_PRIVATE int sqlite3VdbeOpcodeNoPush(u8 op){
** entries that static analysis reveals this program might need.
**
** This routine also does the following optimization: It scans for
-** Halt instructions where P1==STQLITE_CONSTRAINT or P2==OE_Abort or for
+** Halt instructions where P1==SQLITE_CONSTRAINT or P2==OE_Abort or for
** IdxInsert instructions where P2!=0. If no such instruction is
** found, then every Statement instruction is changed to a Noop. In
** this way, we avoid creating the statement journal file unnecessarily.
@@ -30685,19 +30685,19 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs, int *pMaxStack){
u8 opcode = pOp->opcode;
if( opcode==OP_Function || opcode==OP_AggStep
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
|| opcode==OP_VUpdate
#endif
){
if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2;
}
if( opcode==OP_Halt ){
- if( pOp->p1==STQLITE_CONSTRAINT && pOp->p2==OE_Abort ){
+ if( pOp->p1==SQLITE_CONSTRAINT && pOp->p2==OE_Abort ){
doesStatementRollback = 1;
}
}else if( opcode==OP_Statement ){
hasStatementBegin = 1;
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
}else if( opcode==OP_VUpdate || opcode==OP_VRename ){
doesStatementRollback = 1;
}else if( opcode==OP_VFilter ){
@@ -30739,7 +30739,7 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs, int *pMaxStack){
/*
** Return the address of the next instruction to be inserted.
*/
-STQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe *p){
+SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe *p){
assert( p->magic==VDBE_MAGIC_INIT );
return p->nOp;
}
@@ -30748,7 +30748,7 @@ STQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe *p){
** Add a whole list of operations to the operation stack. Return the
** address of the first operation added.
*/
-STQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
+SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
int addr;
assert( p->magic==VDBE_MAGIC_INIT );
resizeOpArray(p, p->nOp + nOp);
@@ -30767,7 +30767,7 @@ STQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp
pOut->p2 = p2<0 ? addr + ADDR(p2) : p2;
pOut->p3 = pIn->p3;
pOut->p3type = pIn->p3 ? P3_STATIC : P3_NOTUSED;
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
if( sqlite3_vdbe_addop_trace ){
sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]);
}
@@ -30784,7 +30784,7 @@ STQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp
** static array using sqlite3VdbeAddOpList but we want to make a
** few minor changes to the program.
*/
-STQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
+SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
assert( p==0 || p->magic==VDBE_MAGIC_INIT );
if( p && addr>=0 && p->nOp>addr && p->aOp ){
p->aOp[addr].p1 = val;
@@ -30795,7 +30795,7 @@ STQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
** Change the value of the P2 operand for a specific instruction.
** This routine is useful for setting a jump destination.
*/
-STQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
+SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
assert( val>=0 );
assert( p==0 || p->magic==VDBE_MAGIC_INIT );
if( p && addr>=0 && p->nOp>addr && p->aOp ){
@@ -30807,7 +30807,7 @@ STQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
** Change the P2 operand of instruction addr so that it points to
** the address of the next instruction to be coded.
*/
-STQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
+SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
sqlite3VdbeChangeP2(p, addr, p->nOp);
}
@@ -30817,7 +30817,7 @@ STQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
** the FuncDef is not ephermal, then do nothing.
*/
static void freeEphemeralFunction(FuncDef *pDef){
- if( pDef && (pDef->flags & STQLITE_FUNC_EPHEM)!=0 ){
+ if( pDef && (pDef->flags & SQLITE_FUNC_EPHEM)!=0 ){
sqliteFree(pDef);
}
}
@@ -30861,7 +30861,7 @@ static void freeP3(int p3type, void *p3){
/*
** Change N opcodes starting at addr to No-ops.
*/
-STQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
+SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
if( p && p->aOp ){
VdbeOp *pOp = &p->aOp[addr];
while( N-- ){
@@ -30898,7 +30898,7 @@ STQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
**
** If addr<0 then change P3 on the most recently inserted instruction.
*/
-STQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){
+SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){
Op *pOp;
assert( p==0 || p->magic==VDBE_MAGIC_INIT );
if( p==0 || p->aOp==0 || sqlite3MallocFailed() ){
@@ -30955,7 +30955,7 @@ STQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, int addr, const char *zP3, int
** Replace the P3 field of the most recently coded instruction with
** comment text.
*/
-STQLITE_PRIVATE void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
+SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
va_list ap;
assert( p->nOp>0 || p->aOp==0 );
assert( p->aOp==0 || p->aOp[p->nOp-1].p3==0 || sqlite3MallocFailed() );
@@ -30968,14 +30968,14 @@ STQLITE_PRIVATE void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
/*
** Return the opcode for a given address.
*/
-STQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
+SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
assert( p->magic==VDBE_MAGIC_INIT );
assert( (addr>=0 && addr<p->nOp) || sqlite3MallocFailed() );
return ((addr>=0 && addr<p->nOp)?(&p->aOp[addr]):0);
}
-#if !defined(STQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \
- || defined(VDBE_PROFILE) || defined(STQLITE_DEBUG)
+#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \
+ || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
/*
** Compute a string that describes the P3 parameter for an opcode.
** Use zTemp for any required temporary buffer space.
@@ -31026,7 +31026,7 @@ static char *displayP3(Op *pOp, char *zTemp, int nTemp){
zP3 = zTemp;
break;
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
case P3_VTAB: {
sqlite3_vtab *pVtab = (sqlite3_vtab*)pOp->p3;
sqlite3_snprintf(nTemp, zTemp, "vtab:%p:%p", pVtab, pVtab->pModule);
@@ -31047,11 +31047,11 @@ static char *displayP3(Op *pOp, char *zTemp, int nTemp){
#endif
-#if defined(VDBE_PROFILE) || defined(STQLITE_DEBUG)
+#if defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
/*
** Print a single opcode. This routine is used for debugging only.
*/
-STQLITE_PRIVATE void sqlite3VdbePrintOp(FILE *pOut, int pc, Op *pOp){
+SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE *pOut, int pc, Op *pOp){
char *zP3;
char zPtr[50];
static const char *zFormat1 = "%4d %-13s %4d %4d %s\n";
@@ -31074,7 +31074,7 @@ static void releaseMemArray(Mem *p, int N){
}
}
-#ifndef STQLITE_OMIT_EXPLAIN
+#ifndef SQLITE_OMIT_EXPLAIN
/*
** Give a listing of the program in the virtual machine.
**
@@ -31082,17 +31082,17 @@ static void releaseMemArray(Mem *p, int N){
** running the code, it invokes the callback once for each instruction.
** This feature is used to implement "EXPLAIN".
*/
-STQLITE_PRIVATE int sqlite3VdbeList(
+SQLITE_PRIVATE int sqlite3VdbeList(
Vdbe *p /* The VDBE */
){
sqlite3 *db = p->db;
int i;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
assert( p->explain );
- if( p->magic!=VDBE_MAGIC_RUN ) return STQLITE_MISUSE;
- assert( db->magic==STQLITE_MAGIC_BUSY );
- assert( p->rc==STQLITE_OK || p->rc==STQLITE_BUSY );
+ if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE;
+ assert( db->magic==SQLITE_MAGIC_BUSY );
+ assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY );
/* Even though this opcode does not put dynamic strings onto the
** the stack, they may become dynamic if the user calls
@@ -31107,17 +31107,17 @@ STQLITE_PRIVATE int sqlite3VdbeList(
i = p->pc++;
}while( i<p->nOp && p->explain==2 && p->aOp[i].opcode!=OP_Explain );
if( i>=p->nOp ){
- p->rc = STQLITE_OK;
- rc = STQLITE_DONE;
+ p->rc = SQLITE_OK;
+ rc = SQLITE_DONE;
}else if( db->u1.isInterrupted ){
- p->rc = STQLITE_INTERRUPT;
- rc = STQLITE_ERROR;
+ p->rc = SQLITE_INTERRUPT;
+ rc = SQLITE_ERROR;
sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(p->rc), (char*)0);
}else{
Op *pOp = &p->aOp[i];
Mem *pMem = p->aStack;
pMem->flags = MEM_Int;
- pMem->type = STQLITE_INTEGER;
+ pMem->type = SQLITE_INTEGER;
pMem->u.i = i; /* Program counter */
pMem++;
@@ -31125,42 +31125,42 @@ STQLITE_PRIVATE int sqlite3VdbeList(
pMem->z = (char*)sqlite3OpcodeNames[pOp->opcode]; /* Opcode */
assert( pMem->z!=0 );
pMem->n = strlen(pMem->z);
- pMem->type = STQLITE_TEXT;
- pMem->enc = STQLITE_UTF8;
+ pMem->type = SQLITE_TEXT;
+ pMem->enc = SQLITE_UTF8;
pMem++;
pMem->flags = MEM_Int;
pMem->u.i = pOp->p1; /* P1 */
- pMem->type = STQLITE_INTEGER;
+ pMem->type = SQLITE_INTEGER;
pMem++;
pMem->flags = MEM_Int;
pMem->u.i = pOp->p2; /* P2 */
- pMem->type = STQLITE_INTEGER;
+ pMem->type = SQLITE_INTEGER;
pMem++;
pMem->flags = MEM_Ephem|MEM_Str|MEM_Term; /* P3 */
pMem->z = displayP3(pOp, pMem->zShort, sizeof(pMem->zShort));
assert( pMem->z!=0 );
pMem->n = strlen(pMem->z);
- pMem->type = STQLITE_TEXT;
- pMem->enc = STQLITE_UTF8;
+ pMem->type = SQLITE_TEXT;
+ pMem->enc = SQLITE_UTF8;
p->nResColumn = 5 - 2*(p->explain-1);
p->pTos = pMem;
- p->rc = STQLITE_OK;
+ p->rc = SQLITE_OK;
p->resOnStack = 1;
- rc = STQLITE_ROW;
+ rc = SQLITE_ROW;
}
return rc;
}
-#endif /* STQLITE_OMIT_EXPLAIN */
+#endif /* SQLITE_OMIT_EXPLAIN */
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
/*
** Print the SQL that was used to generate a VDBE program.
*/
-STQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe *p){
+SQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe *p){
int nOp = p->nOp;
VdbeOp *pOp;
if( nOp<1 ) return;
@@ -31173,11 +31173,11 @@ STQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe *p){
}
#endif
-#if !defined(STQLITE_OMIT_TRACE) && defined(STQLITE_ENABLE_IOTRACE)
+#if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE)
/*
** Print an IOTRACE message showing SQL content.
*/
-STQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe *p){
+SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe *p){
int nOp = p->nOp;
VdbeOp *pOp;
if( sqlite3_io_trace==0 ) return;
@@ -31201,7 +31201,7 @@ STQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe *p){
sqliteFree(z);
}
}
-#endif /* !STQLITE_OMIT_TRACE && STQLITE_ENABLE_IOTRACE */
+#endif /* !SQLITE_OMIT_TRACE && SQLITE_ENABLE_IOTRACE */
/*
@@ -31213,7 +31213,7 @@ STQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe *p){
** This is the only way to move a VDBE from VDBE_MAGIC_INIT to
** VDBE_MAGIC_RUN.
*/
-STQLITE_PRIVATE void sqlite3VdbeMakeReady(
+SQLITE_PRIVATE void sqlite3VdbeMakeReady(
Vdbe *p, /* The VDBE */
int nVar, /* Number of '?' see in the SQL statement */
int nMem, /* Number of memory cells to allocate */
@@ -31284,7 +31284,7 @@ STQLITE_PRIVATE void sqlite3VdbeMakeReady(
p->pTos = &p->aStack[-1];
p->pc = -1;
- p->rc = STQLITE_OK;
+ p->rc = SQLITE_OK;
p->uniqueCnt = 0;
p->returnDepth = 0;
p->errorAction = OE_Abort;
@@ -31310,7 +31310,7 @@ STQLITE_PRIVATE void sqlite3VdbeMakeReady(
** Close a cursor and release all the resources that cursor happens
** to hold.
*/
-STQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, Cursor *pCx){
+SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, Cursor *pCx){
if( pCx==0 ){
return;
}
@@ -31320,7 +31320,7 @@ STQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, Cursor *pCx){
if( pCx->pBt ){
sqlite3BtreeClose(pCx->pBt);
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( pCx->pVtabCursor ){
sqlite3_vtab_cursor *pVtabCursor = pCx->pVtabCursor;
const sqlite3_module *pModule = pCx->pModule;
@@ -31386,7 +31386,7 @@ static void Cleanup(Vdbe *p){
** execution of the vdbe program so that sqlite3_column_count() can
** be called on an SQL statement before sqlite3_step().
*/
-STQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
+SQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
Mem *pColName;
int n;
releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
@@ -31411,20 +31411,20 @@ STQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
** the string is freed using sqliteFree() when the vdbe is finished with
** it. Otherwise, N bytes of zName are copied.
*/
-STQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe *p, int idx, int var, const char *zName, int N){
+SQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe *p, int idx, int var, const char *zName, int N){
int rc;
Mem *pColName;
assert( idx<p->nResColumn );
assert( var<COLNAME_N );
- if( sqlite3MallocFailed() ) return STQLITE_NOMEM;
+ if( sqlite3MallocFailed() ) return SQLITE_NOMEM;
assert( p->aColName!=0 );
pColName = &(p->aColName[idx+var*p->nResColumn]);
if( N==P3_DYNAMIC || N==P3_STATIC ){
- rc = sqlite3VdbeMemSetStr(pColName, zName, -1, STQLITE_UTF8, STQLITE_STATIC);
+ rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, SQLITE_STATIC);
}else{
- rc = sqlite3VdbeMemSetStr(pColName, zName, N, STQLITE_UTF8,STQLITE_TRANSIENT);
+ rc = sqlite3VdbeMemSetStr(pColName, zName, N, SQLITE_UTF8,SQLITE_TRANSIENT);
}
- if( rc==STQLITE_OK && N==P3_DYNAMIC ){
+ if( rc==SQLITE_OK && N==P3_DYNAMIC ){
pColName->flags = (pColName->flags&(~MEM_Static))|MEM_Dyn;
pColName->xDel = 0;
}
@@ -31440,7 +31440,7 @@ STQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe *p, int idx, int var, const char
static int vdbeCommit(sqlite3 *db){
int i;
int nTrans = 0; /* Number of databases with an active write-transaction */
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
int needXcommit = 0;
/* Before doing anything else, call the xSync() callback for any
@@ -31450,7 +31450,7 @@ static int vdbeCommit(sqlite3 *db){
** to the transaction.
*/
rc = sqlite3VtabSync(db, rc);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -31474,7 +31474,7 @@ static int vdbeCommit(sqlite3 *db){
rc = db->xCommitCallback(db->pCommitArg);
sqlite3SafetyOn(db);
if( rc ){
- return STQLITE_CONSTRAINT;
+ return SQLITE_CONSTRAINT;
}
}
@@ -31488,7 +31488,7 @@ static int vdbeCommit(sqlite3 *db){
** too.
*/
if( 0==strlen(sqlite3BtreeGetFilename(db->aDb[0].pBt)) || nTrans<=1 ){
- for(i=0; rc==STQLITE_OK && i<db->nDb; i++){
+ for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
Btree *pBt = db->aDb[i].pBt;
if( pBt ){
rc = sqlite3BtreeCommitPhaseOne(pBt, 0);
@@ -31500,13 +31500,13 @@ static int vdbeCommit(sqlite3 *db){
** IO error while deleting or truncating a journal file. It is unlikely,
** but could happen. In this case abandon processing and return the error.
*/
- for(i=0; rc==STQLITE_OK && i<db->nDb; i++){
+ for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
Btree *pBt = db->aDb[i].pBt;
if( pBt ){
rc = sqlite3BtreeCommitPhaseTwo(pBt);
}
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqlite3VtabCommit(db);
}
}
@@ -31515,7 +31515,7 @@ static int vdbeCommit(sqlite3 *db){
** This requires a master journal file to ensure the transaction is
** committed atomicly.
*/
-#ifndef STQLITE_OMIT_DISKIO
+#ifndef SQLITE_OMIT_DISKIO
else{
int needSync = 0;
char *zMaster = 0; /* File-name for the master journal */
@@ -31529,13 +31529,13 @@ static int vdbeCommit(sqlite3 *db){
sqlite3Randomness(sizeof(random), &random);
zMaster = sqlite3MPrintf("%s-mj%08X", zMainFile, random&0x7fffffff);
if( !zMaster ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
}while( sqlite3OsFileExists(zMaster) );
/* Open the master journal. */
rc = sqlite3OsOpenExclusive(zMaster, &master, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqliteFree(zMaster);
return rc;
}
@@ -31556,7 +31556,7 @@ static int vdbeCommit(sqlite3 *db){
needSync = 1;
}
rc = sqlite3OsWrite(master, zFile, strlen(zFile)+1);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3OsClose(&master);
sqlite3OsDelete(zMaster);
sqliteFree(zMaster);
@@ -31571,8 +31571,8 @@ static int vdbeCommit(sqlite3 *db){
*/
zMainFile = sqlite3BtreeGetDirname(db->aDb[0].pBt);
rc = sqlite3OsOpenDirectory(master, zMainFile);
- if( rc!=STQLITE_OK ||
- (needSync && (rc=sqlite3OsSync(master,0))!=STQLITE_OK) ){
+ if( rc!=SQLITE_OK ||
+ (needSync && (rc=sqlite3OsSync(master,0))!=SQLITE_OK) ){
sqlite3OsClose(&master);
sqlite3OsDelete(zMaster);
sqliteFree(zMaster);
@@ -31589,14 +31589,14 @@ static int vdbeCommit(sqlite3 *db){
** in case the master journal file name was written into the journal
** file before the failure occured.
*/
- for(i=0; rc==STQLITE_OK && i<db->nDb; i++){
+ for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
Btree *pBt = db->aDb[i].pBt;
if( pBt && sqlite3BtreeIsInTrans(pBt) ){
rc = sqlite3BtreeCommitPhaseOne(pBt, zMaster);
}
}
sqlite3OsClose(&master);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqliteFree(zMaster);
return rc;
}
@@ -31612,7 +31612,7 @@ static int vdbeCommit(sqlite3 *db){
return rc;
}
rc = sqlite3OsSyncDirectory(zMainFile);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
/* This is not good. The master journal file has been deleted, but
** the directory sync failed. There is no completely safe course of
** action from here. The individual journals contain the name of the
@@ -31679,7 +31679,7 @@ static void checkActiveVdbeCnt(sqlite3 *db){
** aborted so that they do not have data rolled out from underneath
** them leading to a segfault.
*/
-STQLITE_PRIVATE void sqlite3AbortOtherActiveVdbes(sqlite3 *db, Vdbe *pExcept){
+SQLITE_PRIVATE void sqlite3AbortOtherActiveVdbes(sqlite3 *db, Vdbe *pExcept){
Vdbe *pOther;
for(pOther=db->pVdbe; pOther; pOther=pOther->pNext){
if( pOther==pExcept ) continue;
@@ -31697,17 +31697,17 @@ STQLITE_PRIVATE void sqlite3AbortOtherActiveVdbes(sqlite3 *db, Vdbe *pExcept){
** changes. If a rollback is needed, then do the rollback.
**
** This routine is the only way to move the state of a VM from
-** STQLITE_MAGIC_RUN to STQLITE_MAGIC_HALT.
+** SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT.
**
** Return an error code. If the commit could not complete because of
-** lock contention, return STQLITE_BUSY. If STQLITE_BUSY is returned, it
+** lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it
** means the close did not happen and needs to be repeated.
*/
-STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
+SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
sqlite3 *db = p->db;
int i;
int (*xFunc)(Btree *pBt) = 0; /* Function to call on each btree backend */
- int isSpecialError; /* Set to true if STQLITE_NOMEM or IOERR */
+ int isSpecialError; /* Set to true if SQLITE_NOMEM or IOERR */
/* This function contains the logic that determines if a statement or
** transaction will be committed or rolled back as a result of the
@@ -31715,13 +31715,13 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
**
** Special errors:
**
- ** If an STQLITE_NOMEM error has occured in a statement that writes to
+ ** If an SQLITE_NOMEM error has occured in a statement that writes to
** the database, then either a statement or transaction must be rolled
** back to ensure the tree-structures are in a consistent state. A
** statement transaction is rolled back if one is open, otherwise the
** entire transaction must be rolled back.
**
- ** If an STQLITE_IOERR error has occured in a statement that writes to
+ ** If an SQLITE_IOERR error has occured in a statement that writes to
** the database, then the entire transaction must be rolled back. The
** I/O error may have caused garbage to be written to the journal
** file. Were the transaction to continue and eventually be rolled
@@ -31738,15 +31738,15 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
*/
if( sqlite3MallocFailed() ){
- p->rc = STQLITE_NOMEM;
+ p->rc = SQLITE_NOMEM;
}
if( p->magic!=VDBE_MAGIC_RUN ){
/* Already halted. Nothing to do. */
assert( p->magic==VDBE_MAGIC_HALT );
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
closeAllCursors(p);
#endif
- return STQLITE_OK;
+ return SQLITE_OK;
}
closeAllCursors(p);
checkActiveVdbeCnt(db);
@@ -31754,10 +31754,10 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
/* No commit or rollback needed if the program never started */
if( p->pc>=0 ){
int mrc; /* Primary error code from p->rc */
- /* Check for one of the special errors - STQLITE_NOMEM or STQLITE_IOERR */
+ /* Check for one of the special errors - SQLITE_NOMEM or SQLITE_IOERR */
mrc = p->rc & 0xff;
isSpecialError = (
- (mrc==STQLITE_NOMEM || mrc==STQLITE_IOERR || mrc==STQLITE_INTERRUPT)?1:0);
+ (mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR || mrc==SQLITE_INTERRUPT)?1:0);
if( isSpecialError ){
/* This loop does static analysis of the query to see which of the
** following three categories it falls into:
@@ -31781,14 +31781,14 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
/* This is a bit strange. If we hit a malloc() or IO error and
** the statement did not open a statement transaction, we will
** rollback any active transaction and abort all other active
- ** statements. Or, if this is an STQLITE_INTERRUPT error, we
+ ** statements. Or, if this is an SQLITE_INTERRUPT error, we
** will only rollback if the interrupted statement was a write.
**
** It could be argued that read-only statements should never
** rollback anything. But careful analysis is required before
** making this change
*/
- if( p->aOp[i].p2 || mrc!=STQLITE_INTERRUPT ){
+ if( p->aOp[i].p2 || mrc!=SQLITE_INTERRUPT ){
isReadOnly = 0;
}
break;
@@ -31802,10 +31802,10 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
** proceed with the special handling.
*/
if( !isReadOnly ){
- if( p->rc==STQLITE_IOERR_BLOCKED && isStatement ){
+ if( p->rc==SQLITE_IOERR_BLOCKED && isStatement ){
xFunc = sqlite3BtreeRollbackStmt;
- p->rc = STQLITE_BUSY;
- } else if( p->rc==STQLITE_NOMEM && isStatement ){
+ p->rc = SQLITE_BUSY;
+ } else if( p->rc==SQLITE_NOMEM && isStatement ){
xFunc = sqlite3BtreeRollbackStmt;
}else{
/* We are forced to roll back the active transaction. Before doing
@@ -31825,15 +31825,15 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
** above has occured.
*/
if( db->autoCommit && db->activeVdbeCnt==1 ){
- if( p->rc==STQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){
+ if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){
/* The auto-commit flag is true, and the vdbe program was
** successful or hit an 'OR FAIL' constraint. This means a commit
** is required.
*/
int rc = vdbeCommit(db);
- if( rc==STQLITE_BUSY ){
- return STQLITE_BUSY;
- }else if( rc!=STQLITE_OK ){
+ if( rc==SQLITE_BUSY ){
+ return SQLITE_BUSY;
+ }else if( rc!=SQLITE_OK ){
p->rc = rc;
sqlite3RollbackAll(db);
}else{
@@ -31843,7 +31843,7 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
sqlite3RollbackAll(db);
}
}else if( !xFunc ){
- if( p->rc==STQLITE_OK || p->errorAction==OE_Fail ){
+ if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){
if( p->openedStatement ){
xFunc = sqlite3BtreeCommitStmt;
}
@@ -31858,7 +31858,7 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
/* If xFunc is not NULL, then it is one of sqlite3BtreeRollbackStmt or
** sqlite3BtreeCommitStmt. Call it once on each backend. If an error occurs
- ** and the return code is still STQLITE_OK, set the return code to the new
+ ** and the return code is still SQLITE_OK, set the return code to the new
** error value.
*/
assert(!xFunc ||
@@ -31870,7 +31870,7 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
Btree *pBt = db->aDb[i].pBt;
if( pBt ){
rc = xFunc(pBt);
- if( rc && (p->rc==STQLITE_OK || p->rc==STQLITE_CONSTRAINT) ){
+ if( rc && (p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT) ){
p->rc = rc;
sqlite3SetString(&p->zErrMsg, 0);
}
@@ -31890,9 +31890,9 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
}
/* Rollback or commit any schema changes that occurred. */
- if( p->rc!=STQLITE_OK && db->flags&STQLITE_InternChanges ){
+ if( p->rc!=SQLITE_OK && db->flags&SQLITE_InternChanges ){
sqlite3ResetInternalSchema(db, 0);
- db->flags = (db->flags | STQLITE_InternChanges);
+ db->flags = (db->flags | SQLITE_InternChanges);
}
}
@@ -31903,15 +31903,15 @@ STQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
p->magic = VDBE_MAGIC_HALT;
checkActiveVdbeCnt(db);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Each VDBE holds the result of the most recent sqlite3_step() call
-** in p->rc. This routine sets that result back to STQLITE_OK.
+** in p->rc. This routine sets that result back to SQLITE_OK.
*/
-STQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe *p){
- p->rc = STQLITE_OK;
+SQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe *p){
+ p->rc = SQLITE_OK;
}
/*
@@ -31925,7 +31925,7 @@ STQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe *p){
** virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to
** VDBE_MAGIC_INIT.
*/
-STQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){
+SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){
sqlite3 *db;
db = p->db;
@@ -31944,13 +31944,13 @@ STQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){
*/
if( p->pc>=0 ){
if( p->zErrMsg ){
- sqlite3ValueSetStr(db->pErr, -1, p->zErrMsg, STQLITE_UTF8, sqlite3FreeX);
+ sqlite3ValueSetStr(db->pErr, -1, p->zErrMsg, SQLITE_UTF8, sqlite3FreeX);
db->errCode = p->rc;
p->zErrMsg = 0;
}else if( p->rc ){
sqlite3Error(db, p->rc, 0);
}else{
- sqlite3Error(db, STQLITE_OK, 0);
+ sqlite3Error(db, SQLITE_OK, 0);
}
}else if( p->rc && p->expired ){
/* The expired flag was set on the VDBE before the first call
@@ -31991,7 +31991,7 @@ STQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){
#endif
p->magic = VDBE_MAGIC_INIT;
p->aborted = 0;
- if( p->rc==STQLITE_SCHEMA ){
+ if( p->rc==SQLITE_SCHEMA ){
sqlite3ResetInternalSchema(db, 0);
}
return p->rc & db->errMask;
@@ -32001,13 +32001,13 @@ STQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){
** Clean up and delete a VDBE after execution. Return an integer which is
** the result code. Write any error message text into *pzErrMsg.
*/
-STQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe *p){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe *p){
+ int rc = SQLITE_OK;
if( p->magic==VDBE_MAGIC_RUN || p->magic==VDBE_MAGIC_HALT ){
rc = sqlite3VdbeReset(p);
assert( (rc & p->db->errMask)==rc );
}else if( p->magic!=VDBE_MAGIC_INIT ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
sqlite3VdbeDelete(p);
return rc;
@@ -32019,7 +32019,7 @@ STQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe *p){
** are always destroyed. To destroy all auxdata entries, call this
** routine with mask==0.
*/
-STQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){
+SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){
int i;
for(i=0; i<pVdbeFunc->nAux; i++){
struct AuxData *pAux = &pVdbeFunc->apAux[i];
@@ -32035,7 +32035,7 @@ STQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){
/*
** Delete an entire VDBE.
*/
-STQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe *p){
+SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe *p){
int i;
if( p==0 ) return;
Cleanup(p);
@@ -32068,12 +32068,12 @@ STQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe *p){
/*
** If a MoveTo operation is pending on the given cursor, then do that
** MoveTo now. Return an error code. If no MoveTo is pending, this
-** routine does nothing and returns STQLITE_OK.
+** routine does nothing and returns SQLITE_OK.
*/
-STQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor *p){
+SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor *p){
if( p->deferredMoveto ){
int res, rc;
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
extern int sqlite3_search_count;
#endif
assert( p->isTable );
@@ -32086,13 +32086,13 @@ STQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor *p){
rc = sqlite3BtreeNext(p->pCursor, &res);
if( rc ) return rc;
}
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
sqlite3_search_count++;
#endif
p->deferredMoveto = 0;
p->cachetqStatus = CACHE_STALE;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -32104,12 +32104,12 @@ STQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor *p){
** sqlite3VdbeSerialLen()
** sqlite3VdbeSerialWrite()
**
-** encapsulate the code that serializes values for storage in STQLite
+** encapsulate the code that serializes values for storage in SQLite
** data and index records. Each serialized value consists of a
** 'serial-type' and a blob of data. The serial type is an 8-byte unsigned
** integer, stored as a varint.
**
-** In an STQLite index record, the serial type is stored directly before
+** In an SQLite index record, the serial type is stored directly before
** the blob of data that it corresponds to. In a table record, all serial
** types are stored at the start of the record, and the blobs of data at
** the end. Hence these functions allow the caller to handle the
@@ -32134,13 +32134,13 @@ STQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor *p){
** N>=13 and odd (N-13)/2 text
**
** The 8 and 9 types were added in 3.3.0, file format 4. Prior versions
-** of STQLite will not understand those serial types.
+** of SQLite will not understand those serial types.
*/
/*
** Return the serial-type for the value stored in pMem.
*/
-STQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
+SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
int flags = pMem->flags;
int n;
@@ -32178,7 +32178,7 @@ STQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
/*
** Return the length of the data corresponding to the supplied serial-type.
*/
-STQLITE_PRIVATE int sqlite3VdbeSerialTypeLen(u32 serial_type){
+SQLITE_PRIVATE int sqlite3VdbeSerialTypeLen(u32 serial_type){
if( serial_type>=12 ){
return (serial_type-12)/2;
}else{
@@ -32203,12 +32203,12 @@ STQLITE_PRIVATE int sqlite3VdbeSerialTypeLen(u32 serial_type){
** I am also told that newer versions of GCC that follow a different
** ABI get the byte order right.
**
-** Developers using STQLite on an ARM7 should compile and run their
-** application using -DSTQLITE_DEBUG=1 at least once. With DEBUG
+** Developers using SQLite on an ARM7 should compile and run their
+** application using -DSQLITE_DEBUG=1 at least once. With DEBUG
** enabled, some asserts below will ensure that the byte order of
** floating point values is correct.
*/
-#ifdef STQLITE_MIXED_ENDIAN_64BIT_FLOAT
+#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
static double floatSwap(double in){
union {
double r;
@@ -32245,7 +32245,7 @@ static double floatSwap(double in){
** of bytes in the zero-filled tail is included in the return value only
** if those bytes were zeroed in buf[].
*/
-STQLITE_PRIVATE int sqlite3VdbeSerialPut(u8 *buf, int nBuf, Mem *pMem, int file_format){
+SQLITE_PRIVATE int sqlite3VdbeSerialPut(u8 *buf, int nBuf, Mem *pMem, int file_format){
u32 serial_type = sqlite3VdbeSerialType(pMem, file_format);
int len;
@@ -32294,7 +32294,7 @@ STQLITE_PRIVATE int sqlite3VdbeSerialPut(u8 *buf, int nBuf, Mem *pMem, int file_
** Deserialize the data blob pointed to by buf as serial type serial_type
** and store the result in pMem. Return the number of bytes read.
*/
-STQLITE_PRIVATE int sqlite3VdbeSerialGet(
+SQLITE_PRIVATE int sqlite3VdbeSerialGet(
const unsigned char *buf, /* Buffer to deserialize from */
u32 serial_type, /* Serial type to deserialize */
Mem *pMem /* Memory cell to write value into */
@@ -32338,9 +32338,9 @@ STQLITE_PRIVATE int sqlite3VdbeSerialGet(
case 7: { /* IEEE floating point */
u64 x;
u32 y;
-#if !defined(NDEBUG) && !defined(STQLITE_OMIT_FLOATING_POINT)
+#if !defined(NDEBUG) && !defined(SQLITE_OMIT_FLOATING_POINT)
/* Verify that integers and floating point values use the same
- ** byte order. Or, that if STQLITE_MIXED_ENDIAN_64BIT_FLOAT is
+ ** byte order. Or, that if SQLITE_MIXED_ENDIAN_64BIT_FLOAT is
** defined that 64-bit floating point values really are mixed
** endian.
*/
@@ -32411,7 +32411,7 @@ STQLITE_PRIVATE int sqlite3VdbeSerialGet(
** greater than {nKey2, pKey2}. Both Key1 and Key2 must be byte strings
** composed by the OP_MakeRecord opcode of the VDBE.
*/
-STQLITE_PRIVATE int sqlite3VdbeRecordCompare(
+SQLITE_PRIVATE int sqlite3VdbeRecordCompare(
void *userData,
int nKey1, const void *pKey1,
int nKey2, const void *pKey2
@@ -32488,7 +32488,7 @@ STQLITE_PRIVATE int sqlite3VdbeRecordCompare(
** an integer rowid). This routine returns the number of bytes in
** that integer.
*/
-STQLITE_PRIVATE int sqlite3VdbeIdxRowidLen(const u8 *aKey){
+SQLITE_PRIVATE int sqlite3VdbeIdxRowidLen(const u8 *aKey){
u32 szHdr; /* Size of the header */
u32 typeRowid; /* Serial type of the rowid */
@@ -32501,9 +32501,9 @@ STQLITE_PRIVATE int sqlite3VdbeIdxRowidLen(const u8 *aKey){
/*
** pCur points at an index entry created using the OP_MakeRecord opcode.
** Read the rowid (the last field in the record) and store it in *rowid.
-** Return STQLITE_OK if everything works, or an error code otherwise.
+** Return SQLITE_OK if everything works, or an error code otherwise.
*/
-STQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){
+SQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){
i64 nCellKey = 0;
int rc;
u32 szHdr; /* Size of the header */
@@ -32513,7 +32513,7 @@ STQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){
sqlite3BtreeKeySize(pCur, &nCellKey);
if( nCellKey<=0 ){
- return STQLITE_CORRUPT_BKPT;
+ return SQLITE_CORRUPT_BKPT;
}
rc = sqlite3VdbeMemFromBtree(pCur, 0, nCellKey, 1, &m);
if( rc ){
@@ -32525,20 +32525,20 @@ STQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){
sqlite3VdbeSerialGet((u8*)&m.z[m.n-lenRowid], typeRowid, &v);
*rowid = v.u.i;
sqlite3VdbeMemRelease(&m);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Compare the key of the index entry that cursor pC is point to against
** the key string in pKey (of length nKey). Write into *pRes a number
** that is negative, zero, or positive if pC is less than, equal to,
-** or greater than pKey. Return STQLITE_OK on success.
+** or greater than pKey. Return SQLITE_OK on success.
**
** pKey is either created without a rowid or is truncated so that it
** omits the rowid at the end. The rowid at the end of the index entry
** is ignored as well.
*/
-STQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(
+SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(
Cursor *pC, /* The cursor to compare against */
int nKey, const u8 *pKey, /* The key to compare */
int *res /* Write the comparison result here */
@@ -32552,7 +32552,7 @@ STQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(
sqlite3BtreeKeySize(pCur, &nCellKey);
if( nCellKey<=0 ){
*res = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
rc = sqlite3VdbeMemFromBtree(pC->pCursor, 0, nCellKey, 1, &m);
if( rc ){
@@ -32561,14 +32561,14 @@ STQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(
lenRowid = sqlite3VdbeIdxRowidLen((u8*)m.z);
*res = sqlite3VdbeRecordCompare(pC->pKeyInfo, m.n-lenRowid, m.z, nKey, pKey);
sqlite3VdbeMemRelease(&m);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** This routine sets the value to be returned by subsequent calls to
** sqlite3_changes() on the database handle 'db'.
*/
-STQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *db, int nChange){
+SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *db, int nChange){
db->nChange = nChange;
db->nTotalChange += nChange;
}
@@ -32577,7 +32577,7 @@ STQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *db, int nChange){
** Set a flag in the vdbe to update the change counter when it is finalised
** or reset.
*/
-STQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe *v){
+SQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe *v){
v->changeCntOn = 1;
}
@@ -32591,7 +32591,7 @@ STQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe *v){
** sequences, or changing an authorization function are the types of
** things that make prepared statements obsolete.
*/
-STQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3 *db){
+SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3 *db){
Vdbe *p;
for(p = db->pVdbe; p; p=p->pNext){
p->expired = 1;
@@ -32601,7 +32601,7 @@ STQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3 *db){
/*
** Return the database associated with the Vdbe.
*/
-STQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){
+SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){
return v->db;
}
@@ -32631,7 +32631,7 @@ STQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){
** collating sequences are registered or if an authorizer function is
** added or changed.
*/
-STQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){
+SQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){
Vdbe *p = (Vdbe*)pStmt;
return p==0 || p->expired;
}
@@ -32652,10 +32652,10 @@ const void *sqlite3_value_blob(sqlite3_value *pVal){
}
}
int sqlite3_value_bytes(sqlite3_value *pVal){
- return sqlite3ValueBytes(pVal, STQLITE_UTF8);
+ return sqlite3ValueBytes(pVal, SQLITE_UTF8);
}
int sqlite3_value_bytes16(sqlite3_value *pVal){
- return sqlite3ValueBytes(pVal, STQLITE_UTF16NATIVE);
+ return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
}
double sqlite3_value_double(sqlite3_value *pVal){
return sqlite3VdbeRealValue((Mem*)pVal);
@@ -32667,19 +32667,19 @@ sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
return sqlite3VdbeIntValue((Mem*)pVal);
}
const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
- return (const unsigned char *)sqlite3ValueText(pVal, STQLITE_UTF8);
+ return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
const void *sqlite3_value_text16(sqlite3_value* pVal){
- return sqlite3ValueText(pVal, STQLITE_UTF16NATIVE);
+ return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
}
const void *sqlite3_value_text16be(sqlite3_value *pVal){
- return sqlite3ValueText(pVal, STQLITE_UTF16BE);
+ return sqlite3ValueText(pVal, SQLITE_UTF16BE);
}
const void *sqlite3_value_text16le(sqlite3_value *pVal){
- return sqlite3ValueText(pVal, STQLITE_UTF16LE);
+ return sqlite3ValueText(pVal, SQLITE_UTF16LE);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
int sqlite3_value_type(sqlite3_value* pVal){
return pVal->type;
}
@@ -32703,12 +32703,12 @@ void sqlite3_result_double(sqlite3_context *pCtx, double rVal){
}
void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
pCtx->isError = 1;
- sqlite3VdbeMemSetStr(&pCtx->s, z, n, STQLITE_UTF8, STQLITE_TRANSIENT);
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
pCtx->isError = 1;
- sqlite3VdbeMemSetStr(&pCtx->s, z, n, STQLITE_UTF16NATIVE, STQLITE_TRANSIENT);
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
}
#endif
void sqlite3_result_int(sqlite3_context *pCtx, int iVal){
@@ -32726,16 +32726,16 @@ void sqlite3_result_text(
int n,
void (*xDel)(void *)
){
- sqlite3VdbeMemSetStr(&pCtx->s, z, n, STQLITE_UTF8, xDel);
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, xDel);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
void sqlite3_result_text16(
sqlite3_context *pCtx,
const void *z,
int n,
void (*xDel)(void *)
){
- sqlite3VdbeMemSetStr(&pCtx->s, z, n, STQLITE_UTF16NATIVE, xDel);
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, xDel);
}
void sqlite3_result_text16be(
sqlite3_context *pCtx,
@@ -32743,7 +32743,7 @@ void sqlite3_result_text16be(
int n,
void (*xDel)(void *)
){
- sqlite3VdbeMemSetStr(&pCtx->s, z, n, STQLITE_UTF16BE, xDel);
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16BE, xDel);
}
void sqlite3_result_text16le(
sqlite3_context *pCtx,
@@ -32751,9 +32751,9 @@ void sqlite3_result_text16le(
int n,
void (*xDel)(void *)
){
- sqlite3VdbeMemSetStr(&pCtx->s, z, n, STQLITE_UTF16LE, xDel);
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16LE, xDel);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
sqlite3VdbeMemCopy(&pCtx->s, pValue);
}
@@ -32761,9 +32761,9 @@ void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
sqlite3VdbeMemSetZeroBlob(&pCtx->s, n);
}
-/* Force an STQLITE_TOOBIG error. */
+/* Force an SQLITE_TOOBIG error. */
void sqlite3_result_error_toobig(sqlite3_context *pCtx){
- sqlite3VdbeMemSetZeroBlob(&pCtx->s, STQLITE_MAX_LENGTH+1);
+ sqlite3VdbeMemSetZeroBlob(&pCtx->s, SQLITE_MAX_LENGTH+1);
}
@@ -32784,22 +32784,22 @@ static int sqlite3Step(Vdbe *p){
assert( !sqlite3MallocFailed() );
if( p==0 || p->magic!=VDBE_MAGIC_RUN ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
if( p->aborted ){
- return STQLITE_ABORT;
+ return SQLITE_ABORT;
}
if( p->pc<=0 && p->expired ){
- if( p->rc==STQLITE_OK ){
- p->rc = STQLITE_SCHEMA;
+ if( p->rc==SQLITE_OK ){
+ p->rc = SQLITE_SCHEMA;
}
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
goto end_of_step;
}
db = p->db;
if( sqlite3SafetyOn(db) ){
- p->rc = STQLITE_MISUSE;
- return STQLITE_MISUSE;
+ p->rc = SQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
if( p->pc<0 ){
/* If there are no other statements currently running, then
@@ -32810,7 +32810,7 @@ static int sqlite3Step(Vdbe *p){
db->u1.isInterrupted = 0;
}
-#ifndef STQLITE_OMIT_TRACE
+#ifndef SQLITE_OMIT_TRACE
/* Invoke the trace callback if there is one
*/
if( db->xTrace && !db->init.busy ){
@@ -32821,8 +32821,8 @@ static int sqlite3Step(Vdbe *p){
sqlite3SafetyOff(db);
db->xTrace(db->pTraceArg, p->aOp[p->nOp-1].p3);
if( sqlite3SafetyOn(db) ){
- p->rc = STQLITE_MISUSE;
- return STQLITE_MISUSE;
+ p->rc = SQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
}
if( db->xProfile && !db->init.busy ){
@@ -32832,35 +32832,35 @@ static int sqlite3Step(Vdbe *p){
}
#endif
- /* Print a copy of SQL as it is executed if the STQL_TRACE pragma is turned
+ /* Print a copy of SQL as it is executed if the SQL_TRACE pragma is turned
** on in debugging mode.
*/
-#ifdef STQLITE_DEBUG
- if( (db->flags & STQLITE_SqlTrace)!=0 ){
+#ifdef SQLITE_DEBUG
+ if( (db->flags & SQLITE_SqlTrace)!=0 ){
sqlite3DebugPrintf("SQL-trace: %s\n", p->aOp[p->nOp-1].p3);
}
-#endif /* STQLITE_DEBUG */
+#endif /* SQLITE_DEBUG */
db->activeVdbeCnt++;
p->pc = 0;
}
-#ifndef STQLITE_OMIT_EXPLAIN
+#ifndef SQLITE_OMIT_EXPLAIN
if( p->explain ){
rc = sqlite3VdbeList(p);
}else
-#endif /* STQLITE_OMIT_EXPLAIN */
+#endif /* SQLITE_OMIT_EXPLAIN */
{
rc = sqlite3VdbeExec(p);
}
if( sqlite3SafetyOff(db) ){
- rc = STQLITE_MISUSE;
+ rc = SQLITE_MISUSE;
}
-#ifndef STQLITE_OMIT_TRACE
+#ifndef SQLITE_OMIT_TRACE
/* Invoke the profile callback if there is one
*/
- if( rc!=STQLITE_ROW && db->xProfile && !db->init.busy ){
+ if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy ){
double rNow;
u64 elapseTime;
@@ -32878,14 +32878,14 @@ static int sqlite3Step(Vdbe *p){
p->rc = sqlite3ApiExit(p->db, p->rc);
end_of_step:
assert( (rc&0xff)==rc );
- if( p->zSql && (rc&0xff)<STQLITE_ROW ){
+ if( p->zSql && (rc&0xff)<SQLITE_ROW ){
/* This behavior occurs if sqlite3_prepare_v2() was used to build
** the prepared statement. Return error codes directly */
sqlite3Error(p->db, p->rc, 0);
return p->rc;
}else{
/* This is for legacy sqlite3_prepare() builds and when the code
- ** is STQLITE_ROW or STQLITE_DONE */
+ ** is SQLITE_ROW or SQLITE_DONE */
return rc;
}
}
@@ -32895,16 +32895,16 @@ end_of_step:
** sqlite3Step() to do most of the work. If a schema error occurs,
** call sqlite3Reprepare() and try again.
*/
-#ifdef STQLITE_OMIT_PARSER
-STQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
+#ifdef SQLITE_OMIT_PARSER
+SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
return sqlite3Step((Vdbe*)pStmt);
}
#else
-STQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
+SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
int cnt = 0;
int rc;
Vdbe *v = (Vdbe*)pStmt;
- while( (rc = sqlite3Step(v))==STQLITE_SCHEMA
+ while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
&& cnt++ < 5
&& sqlite3Reprepare(v) ){
sqlite3_reset(pStmt);
@@ -32931,7 +32931,7 @@ void *sqlite3_user_data(sqlite3_context *p){
** for name resolution but are actually overloaded by the xFindFunction
** method of virtual tables.
*/
-STQLITE_PRIVATE void sqlite3InvalidFunction(
+SQLITE_PRIVATE void sqlite3InvalidFunction(
sqlite3_context *context, /* The function calling context */
int argc, /* Number of arguments to the function */
sqlite3_value **argv /* Value of each argument */
@@ -33061,8 +33061,8 @@ static Mem *columnMem(sqlite3_stmt *pStmt, int i){
Vdbe *pVm = (Vdbe *)pStmt;
int vals = sqlite3_data_count(pStmt);
if( pVm==0 || pVm->resOnStack==0 || i>=pVm->nResColumn || i<0 ){
- static const Mem nullMem = {{0}, 0.0, "", 0, MEM_Null, STQLITE_NULL };
- sqlite3Error(pVm->db, STQLITE_RANGE, 0);
+ static const Mem nullMem = {{0}, 0.0, "", 0, MEM_Null, SQLITE_NULL };
+ sqlite3Error(pVm->db, SQLITE_RANGE, 0);
return (Mem*)&nullMem;
}
return &pVm->pTos[(1-vals)+i];
@@ -33073,7 +33073,7 @@ static Mem *columnMem(sqlite3_stmt *pStmt, int i){
** column value (i.e. a value returned by evaluating an SQL expression in the
** select list of a SELECT statement) that may cause a malloc() failure. If
** malloc() has failed, the threads mallocFailed flag is cleared and the result
-** code of statement pStmt set to STQLITE_NOMEM.
+** code of statement pStmt set to SQLITE_NOMEM.
**
** Specificly, this is called from within:
**
@@ -33091,7 +33091,7 @@ static void columnMallocFailure(sqlite3_stmt *pStmt)
{
/* If malloc() failed during an encoding conversion within an
** sqlite3_column_XXX API, then set the return code of the statement to
- ** STQLITE_NOMEM. The next call to _step() (if any) will return STQLITE_ERROR
+ ** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
** and _finalize() will return NOMEM.
*/
Vdbe *p = (Vdbe *)pStmt;
@@ -33145,13 +33145,13 @@ const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){
return columnMem(pStmt, i);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
const void *sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
columnMallocFailure(pStmt);
return val;
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
int sqlite3_column_type(sqlite3_stmt *pStmt, int i){
return sqlite3_value_type( columnMem(pStmt,i) );
}
@@ -33210,7 +33210,7 @@ const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
@@ -33225,14 +33225,14 @@ const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
-#ifdef STQLITE_ENABLE_COLUMN_METADATA
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
/*
** Return the name of the database from which a result column derives.
** NULL is returned if the result column is an expression or constant or
@@ -33242,12 +33242,12 @@ const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
const void *sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
/*
** Return the name of the table from which a result column derives.
@@ -33258,12 +33258,12 @@ const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
/*
** Return the name of the table column from which a result column derives.
@@ -33274,13 +33274,13 @@ const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
return columnName(
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
}
-#endif /* STQLITE_OMIT_UTF16 */
-#endif /* STQLITE_ENABLE_COLUMN_METADATA */
+#endif /* SQLITE_OMIT_UTF16 */
+#endif /* SQLITE_ENABLE_COLUMN_METADATA */
/******************************* sqlite3_bind_ ***************************
@@ -33290,7 +33290,7 @@ const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
/*
** Unbind the value bound to variable i in virtual machine p. This is the
** the same as binding a NULL value to the column. If the "i" parameter is
-** out of range, then STQLITE_RANGE is returned. Othewise STQLITE_OK.
+** out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK.
**
** The error code stored in database p->db is overwritten with the return
** value in any case.
@@ -33298,19 +33298,19 @@ const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
static int vdbeUnbind(Vdbe *p, int i){
Mem *pVar;
if( p==0 || p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){
- if( p ) sqlite3Error(p->db, STQLITE_MISUSE, 0);
- return STQLITE_MISUSE;
+ if( p ) sqlite3Error(p->db, SQLITE_MISUSE, 0);
+ return SQLITE_MISUSE;
}
if( i<1 || i>p->nVar ){
- sqlite3Error(p->db, STQLITE_RANGE, 0);
- return STQLITE_RANGE;
+ sqlite3Error(p->db, SQLITE_RANGE, 0);
+ return SQLITE_RANGE;
}
i--;
pVar = &p->aVar[i];
sqlite3VdbeMemRelease(pVar);
pVar->flags = MEM_Null;
- sqlite3Error(p->db, STQLITE_OK, 0);
- return STQLITE_OK;
+ sqlite3Error(p->db, SQLITE_OK, 0);
+ return SQLITE_OK;
}
/*
@@ -33334,7 +33334,7 @@ static int bindText(
}
pVar = &p->aVar[i-1];
rc = sqlite3VdbeMemSetStr(pVar, zData, nData, encoding, xDel);
- if( rc==STQLITE_OK && encoding!=0 ){
+ if( rc==SQLITE_OK && encoding!=0 ){
rc = sqlite3VdbeChangeEncoding(pVar, ENC(p->db));
}
@@ -33359,7 +33359,7 @@ int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
int rc;
Vdbe *p = (Vdbe *)pStmt;
rc = vdbeUnbind(p, i);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
}
return rc;
@@ -33371,7 +33371,7 @@ int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
int rc;
Vdbe *p = (Vdbe *)pStmt;
rc = vdbeUnbind(p, i);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
}
return rc;
@@ -33386,9 +33386,9 @@ int sqlite3_bind_text(
int nData,
void (*xDel)(void*)
){
- return bindText(pStmt, i, zData, nData, xDel, STQLITE_UTF8);
+ return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
int sqlite3_bind_text16(
sqlite3_stmt *pStmt,
int i,
@@ -33396,14 +33396,14 @@ int sqlite3_bind_text16(
int nData,
void (*xDel)(void*)
){
- return bindText(pStmt, i, zData, nData, xDel, STQLITE_UTF16NATIVE);
+ return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
int rc;
Vdbe *p = (Vdbe *)pStmt;
rc = vdbeUnbind(p, i);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqlite3VdbeMemCopy(&p->aVar[i-1], pValue);
}
return rc;
@@ -33412,7 +33412,7 @@ int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
int rc;
Vdbe *p = (Vdbe *)pStmt;
rc = vdbeUnbind(p, i);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
}
return rc;
@@ -33420,7 +33420,7 @@ int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
/*
** Return the number of wildcards that can be potentially bound to.
-** This routine is added to support DBD::STQLite.
+** This routine is added to support DBD::SQLite.
*/
int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
Vdbe *p = (Vdbe*)pStmt;
@@ -33487,25 +33487,25 @@ int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
/*
** Transfer all bindings from the first statement over to the second.
** If the two statements contain a different number of bindings, then
-** an STQLITE_ERROR is returned.
+** an SQLITE_ERROR is returned.
*/
int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
Vdbe *pFrom = (Vdbe*)pFromStmt;
Vdbe *pTo = (Vdbe*)pToStmt;
- int i, rc = STQLITE_OK;
+ int i, rc = SQLITE_OK;
if( (pFrom->magic!=VDBE_MAGIC_RUN && pFrom->magic!=VDBE_MAGIC_HALT)
|| (pTo->magic!=VDBE_MAGIC_RUN && pTo->magic!=VDBE_MAGIC_HALT) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
if( pFrom->nVar!=pTo->nVar ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
- for(i=0; rc==STQLITE_OK && i<pFrom->nVar; i++){
+ for(i=0; rc==SQLITE_OK && i<pFrom->nVar; i++){
sqlite3MallocDisallow();
rc = sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]);
sqlite3MallocAllow();
}
- assert( rc==STQLITE_OK || rc==STQLITE_NOMEM );
+ assert( rc==SQLITE_OK || rc==SQLITE_NOMEM );
return rc;
}
@@ -33576,7 +33576,7 @@ sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){
** working correctly. This variable has no function other than to
** help verify the correct operation of the library.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_search_count = 0;
#endif
@@ -33588,7 +33588,7 @@ int sqlite3_search_count = 0;
** This facility is used for testing purposes only. It does not function
** in an ordinary build.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_interrupt_count = 0;
#endif
@@ -33599,7 +33599,7 @@ int sqlite3_interrupt_count = 0;
** has no function other than to help verify the correct operation of the
** library.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_sort_count = 0;
#endif
@@ -33610,7 +33610,7 @@ int sqlite3_sort_count = 0;
** is working correctly. This variable has no function other than to
** help verify the correct operation of the library.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_max_blobsize = 0;
#endif
@@ -33686,18 +33686,18 @@ int sqlite3_max_blobsize = 0;
static void _storeTypeInfo(Mem *pMem){
int flags = pMem->flags;
if( flags & MEM_Null ){
- pMem->type = STQLITE_NULL;
+ pMem->type = SQLITE_NULL;
}
else if( flags & MEM_Int ){
- pMem->type = STQLITE_INTEGER;
+ pMem->type = SQLITE_INTEGER;
}
else if( flags & MEM_Real ){
- pMem->type = STQLITE_FLOAT;
+ pMem->type = SQLITE_FLOAT;
}
else if( flags & MEM_Str ){
- pMem->type = STQLITE_TEXT;
+ pMem->type = SQLITE_TEXT;
}else{
- pMem->type = STQLITE_BLOB;
+ pMem->type = SQLITE_BLOB;
}
}
@@ -33744,7 +33744,7 @@ static void applyNumericAffinity(Mem *pRec){
if( (pRec->flags&MEM_Str)
&& sqlite3IsNumber(pRec->z, &realnum, pRec->enc) ){
i64 value;
- sqlite3VdbeChangeEncoding(pRec, STQLITE_UTF8);
+ sqlite3VdbeChangeEncoding(pRec, SQLITE_UTF8);
if( !realnum && sqlite3Atoi64(pRec->z, &value) ){
sqlite3VdbeMemRelease(pRec);
pRec->u.i = value;
@@ -33759,23 +33759,23 @@ static void applyNumericAffinity(Mem *pRec){
/*
** Processing is determine by the affinity parameter:
**
-** STQLITE_AFF_INTEGER:
-** STQLITE_AFF_REAL:
-** STQLITE_AFF_NUMERIC:
+** SQLITE_AFF_INTEGER:
+** SQLITE_AFF_REAL:
+** SQLITE_AFF_NUMERIC:
** Try to convert pRec to an integer representation or a
** floating-point representation if an integer representation
** is not possible. Note that the integer representation is
** always preferred, even if the affinity is REAL, because
** an integer representation is more space efficient on disk.
**
-** STQLITE_AFF_TEXT:
+** SQLITE_AFF_TEXT:
** Convert pRec to a text representation.
**
-** STQLITE_AFF_NONE:
+** SQLITE_AFF_NONE:
** No-op. pRec is unchanged.
*/
static void applyAffinity(Mem *pRec, char affinity, u8 enc){
- if( affinity==STQLITE_AFF_TEXT ){
+ if( affinity==SQLITE_AFF_TEXT ){
/* Only attempt the conversion to TEXT if there is an integer or real
** representation (blob and NULL do not get converted) but no string
** representation.
@@ -33784,9 +33784,9 @@ static void applyAffinity(Mem *pRec, char affinity, u8 enc){
sqlite3VdbeMemStringify(pRec, enc);
}
pRec->flags &= ~(MEM_Real|MEM_Int);
- }else if( affinity!=STQLITE_AFF_NONE ){
- assert( affinity==STQLITE_AFF_INTEGER || affinity==STQLITE_AFF_REAL
- || affinity==STQLITE_AFF_NUMERIC );
+ }else if( affinity!=SQLITE_AFF_NONE ){
+ assert( affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL
+ || affinity==SQLITE_AFF_NUMERIC );
applyNumericAffinity(pRec);
if( pRec->flags & MEM_Real ){
sqlite3VdbeIntegerAffinity(pRec);
@@ -33813,16 +33813,16 @@ int sqlite3_value_numeric_type(sqlite3_value *pVal){
** Exported version of applyAffinity(). This one works on sqlite3_value*,
** not the internal Mem* type.
*/
-STQLITE_PRIVATE void sqlite3ValueApplyAffinity(sqlite3_value *pVal, u8 affinity, u8 enc){
+SQLITE_PRIVATE void sqlite3ValueApplyAffinity(sqlite3_value *pVal, u8 affinity, u8 enc){
applyAffinity((Mem *)pVal, affinity, enc);
}
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
/*
** Write a nice string representation of the contents of cell pMem
** into buffer zBuf, length nBuf.
*/
-STQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
+SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
char *zCsr = zBuf;
int f = pMem->flags;
@@ -33940,34 +33940,34 @@ __inline__ unsigned long long int hwtime(void){
**
** Whenever a row or result data is available, this routine will either
** invoke the result callback (if there is one) or return with
-** STQLITE_ROW.
+** SQLITE_ROW.
**
** If an attempt is made to open a locked database, then this routine
** will either invoke the busy callback (if there is one) or it will
-** return STQLITE_BUSY.
+** return SQLITE_BUSY.
**
** If an error occurs, an error message is written to memory obtained
** from sqliteMalloc() and p->zErrMsg is made to point to that memory.
-** The error code is stored in p->rc and this routine returns STQLITE_ERROR.
+** The error code is stored in p->rc and this routine returns SQLITE_ERROR.
**
** If the callback ever returns non-zero, then the program exits
** immediately. There will be no error message but the p->rc field is
-** set to STQLITE_ABORT and this routine will return STQLITE_ERROR.
+** set to SQLITE_ABORT and this routine will return SQLITE_ERROR.
**
-** A memory allocation error causes p->rc to be set to STQLITE_NOMEM and this
-** routine to return STQLITE_ERROR.
+** A memory allocation error causes p->rc to be set to SQLITE_NOMEM and this
+** routine to return SQLITE_ERROR.
**
-** Other fatal errors return STQLITE_ERROR.
+** Other fatal errors return SQLITE_ERROR.
**
** After this routine has finished, sqlite3VdbeFinalize() should be
** used to clean up the mess that was left behind.
*/
-STQLITE_PRIVATE int sqlite3VdbeExec(
+SQLITE_PRIVATE int sqlite3VdbeExec(
Vdbe *p /* The VDBE */
){
int pc; /* The program counter */
Op *pOp; /* Current operation */
- int rc = STQLITE_OK; /* Value to return */
+ int rc = SQLITE_OK; /* Value to return */
sqlite3 *db = p->db; /* The database */
u8 encoding = ENC(db); /* The database encoding */
Mem *pTos; /* Top entry in the operand stack */
@@ -33975,23 +33975,23 @@ STQLITE_PRIVATE int sqlite3VdbeExec(
unsigned long long start; /* CPU clock count at start of opcode */
int origPc; /* Program counter at start of opcode */
#endif
-#ifndef STQLITE_OMIT_PROGRESS_CALLBACK
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
int nProgressOps = 0; /* Opcodes executed since progress callback. */
#endif
#ifndef NDEBUG
Mem *pStackLimit;
#endif
- if( p->magic!=VDBE_MAGIC_RUN ) return STQLITE_MISUSE;
- assert( db->magic==STQLITE_MAGIC_BUSY );
+ if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE;
+ assert( db->magic==SQLITE_MAGIC_BUSY );
pTos = p->pTos;
- if( p->rc==STQLITE_NOMEM ){
+ if( p->rc==SQLITE_NOMEM ){
/* This happens if a malloc() inside a call to sqlite3_column_text() or
** sqlite3_column_text16() failed. */
goto no_mem;
}
- assert( p->rc==STQLITE_OK || p->rc==STQLITE_BUSY );
- p->rc = STQLITE_OK;
+ assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY );
+ p->rc = SQLITE_OK;
assert( p->explain==0 );
if( p->popStack ){
popStack(&pTos, p->popStack);
@@ -34001,8 +34001,8 @@ STQLITE_PRIVATE int sqlite3VdbeExec(
db->busyHandler.nBusy = 0;
CHECK_FOR_INTERRUPT;
sqlite3VdbeIOTraceSql(p);
-#ifdef STQLITE_DEBUG
- if( (p->db->flags & STQLITE_VdbeListing)!=0
+#ifdef SQLITE_DEBUG
+ if( (p->db->flags & SQLITE_VdbeListing)!=0
|| sqlite3OsFileExists("vdbe_explain")
){
int i;
@@ -34016,7 +34016,7 @@ STQLITE_PRIVATE int sqlite3VdbeExec(
p->trace = stdout;
}
#endif
- for(pc=p->pc; rc==STQLITE_OK; pc++){
+ for(pc=p->pc; rc==SQLITE_OK; pc++){
assert( pc>=0 && pc<p->nOp );
assert( pTos<=&p->aStack[pc] );
if( sqlite3MallocFailed() ) goto no_mem;
@@ -34026,9 +34026,9 @@ STQLITE_PRIVATE int sqlite3VdbeExec(
#endif
pOp = &p->aOp[pc];
- /* Only allow tracing if STQLITE_DEBUG is defined.
+ /* Only allow tracing if SQLITE_DEBUG is defined.
*/
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
if( p->trace ){
if( pc==0 ){
printf("VDBE Execution Trace:\n");
@@ -34045,7 +34045,7 @@ STQLITE_PRIVATE int sqlite3VdbeExec(
/* Check to see if we need to simulate an interrupt. This only happens
** if we have a special test build.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
if( sqlite3_interrupt_count>0 ){
sqlite3_interrupt_count--;
if( sqlite3_interrupt_count==0 ){
@@ -34054,12 +34054,12 @@ STQLITE_PRIVATE int sqlite3VdbeExec(
}
#endif
-#ifndef STQLITE_OMIT_PROGRESS_CALLBACK
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
/* Call the progress callback if it is configured and the required number
** of VDBE ops have been executed (either since this invocation of
** sqlite3VdbeExec() or since last time the progress callback was called).
** If the progress callback returns non-zero, exit the virtual machine with
- ** a return code STQLITE_ABORT.
+ ** a return code SQLITE_ABORT.
*/
if( db->xProgress ){
if( db->nProgressOps==nProgressOps ){
@@ -34068,7 +34068,7 @@ STQLITE_PRIVATE int sqlite3VdbeExec(
prc =db->xProgress(db->pProgressArg);
if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
if( prc!=0 ){
- rc = STQLITE_INTERRUPT;
+ rc = SQLITE_INTERRUPT;
goto vdbe_halt;
}
nProgressOps = 0;
@@ -34105,7 +34105,7 @@ STQLITE_PRIVATE int sqlite3VdbeExec(
** big comment (similar to this one) will mark the point in the code where
** we transition back to normal indentation.
**
-** The formatting of each case is important. The makefile for STQLite
+** The formatting of each case is important. The makefile for SQLite
** generates two C files "opcodes.h" and "opcodes.c" by scanning this
** file looking for lines that begin with "case OP_". The opcodes.h files
** will be filled with #defines that give unique integer values to each
@@ -34180,7 +34180,7 @@ case OP_Return: { /* no-push */
** automatically.
**
** P1 is the result code returned by sqlite3_exec(), sqlite3_reset(),
-** or sqlite3_finalize(). For a normal halt, this should be STQLITE_OK (0).
+** or sqlite3_finalize(). For a normal halt, this should be SQLITE_OK (0).
** For errors, it can be some other value. If P1!=0 then P2 will determine
** whether or not to rollback the current transaction. Do not rollback
** if P2==OE_Fail. Do the rollback if P2==OE_Rollback. If P2==OE_Abort,
@@ -34202,12 +34202,12 @@ case OP_Halt: { /* no-push */
sqlite3SetString(&p->zErrMsg, pOp->p3, (char*)0);
}
rc = sqlite3VdbeHalt(p);
- assert( rc==STQLITE_BUSY || rc==STQLITE_OK );
- if( rc==STQLITE_BUSY ){
- p->rc = STQLITE_BUSY;
- return STQLITE_BUSY;
+ assert( rc==SQLITE_BUSY || rc==SQLITE_OK );
+ if( rc==SQLITE_BUSY ){
+ p->rc = SQLITE_BUSY;
+ return SQLITE_BUSY;
}
- return p->rc ? STQLITE_ERROR : STQLITE_DONE;
+ return p->rc ? SQLITE_ERROR : SQLITE_DONE;
}
/* Opcode: Integer P1 * *
@@ -34232,7 +34232,7 @@ case OP_Int64: {
pTos->flags = MEM_Str|MEM_Static|MEM_Term;
pTos->z = pOp->p3;
pTos->n = strlen(pTos->z);
- pTos->enc = STQLITE_UTF8;
+ pTos->enc = SQLITE_UTF8;
pTos->u.i = sqlite3VdbeIntValue(pTos);
pTos->flags |= MEM_Int;
break;
@@ -34247,7 +34247,7 @@ case OP_Real: { /* same as TK_FLOAT, */
pTos->flags = MEM_Str|MEM_Static|MEM_Term;
pTos->z = pOp->p3;
pTos->n = strlen(pTos->z);
- pTos->enc = STQLITE_UTF8;
+ pTos->enc = SQLITE_UTF8;
pTos->r = sqlite3VdbeRealValue(pTos);
pTos->flags |= MEM_Real;
sqlite3VdbeChangeEncoding(pTos, encoding);
@@ -34263,15 +34263,15 @@ case OP_String8: { /* same as TK_STRING */
assert( pOp->p3!=0 );
pOp->opcode = OP_String;
pOp->p1 = strlen(pOp->p3);
- assert( STQLITE_MAX_STQL_LENGTH < STQLITE_MAX_LENGTH );
- assert( pOp->p1 < STQLITE_MAX_LENGTH );
+ assert( SQLITE_MAX_SQL_LENGTH < SQLITE_MAX_LENGTH );
+ assert( pOp->p1 < SQLITE_MAX_LENGTH );
-#ifndef STQLITE_OMIT_UTF16
- if( encoding!=STQLITE_UTF8 ){
+#ifndef SQLITE_OMIT_UTF16
+ if( encoding!=SQLITE_UTF8 ){
pTos++;
- sqlite3VdbeMemSetStr(pTos, pOp->p3, -1, STQLITE_UTF8, STQLITE_STATIC);
- if( STQLITE_OK!=sqlite3VdbeChangeEncoding(pTos, encoding) ) goto no_mem;
- if( STQLITE_OK!=sqlite3VdbeMemDynamicify(pTos) ) goto no_mem;
+ sqlite3VdbeMemSetStr(pTos, pOp->p3, -1, SQLITE_UTF8, SQLITE_STATIC);
+ if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pTos, encoding) ) goto no_mem;
+ if( SQLITE_OK!=sqlite3VdbeMemDynamicify(pTos) ) goto no_mem;
pTos->flags &= ~(MEM_Dyn);
pTos->flags |= MEM_Static;
if( pOp->p3type==P3_DYNAMIC ){
@@ -34280,7 +34280,7 @@ case OP_String8: { /* same as TK_STRING */
pOp->p3type = P3_DYNAMIC;
pOp->p3 = pTos->z;
pOp->p1 = pTos->n;
- assert( pOp->p1 < STQLITE_MAX_LENGTH ); /* Due to STQLITE_MAX_STQL_LENGTH */
+ assert( pOp->p1 < SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */
break;
}
#endif
@@ -34292,7 +34292,7 @@ case OP_String8: { /* same as TK_STRING */
** The string value P3 of length P1 (bytes) is pushed onto the stack.
*/
case OP_String: {
- assert( pOp->p1 < STQLITE_MAX_LENGTH ); /* Due to STQLITE_MAX_STQL_LENGTH */
+ assert( pOp->p1 < SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */
pTos++;
assert( pOp->p3!=0 );
pTos->flags = MEM_Str|MEM_Static|MEM_Term;
@@ -34314,7 +34314,7 @@ case OP_Null: {
}
-#ifndef STQLITE_OMIT_BLOB_LITERAL
+#ifndef SQLITE_OMIT_BLOB_LITERAL
/* Opcode: HexBlob * * P3
**
** P3 is an UTF-8 SQL hex encoding of a blob. The blob is pushed onto the
@@ -34326,8 +34326,8 @@ case OP_Null: {
case OP_HexBlob: { /* same as TK_BLOB */
pOp->opcode = OP_Blob;
pOp->p1 = strlen(pOp->p3)/2;
- assert( STQLITE_MAX_STQL_LENGTH < STQLITE_MAX_LENGTH );
- assert( pOp->p1 < STQLITE_MAX_LENGTH );
+ assert( SQLITE_MAX_SQL_LENGTH < SQLITE_MAX_LENGTH );
+ assert( pOp->p1 < SQLITE_MAX_LENGTH );
if( pOp->p1 ){
char *zBlob = sqlite3HexToBlob(pOp->p3);
if( !zBlob ) goto no_mem;
@@ -34358,12 +34358,12 @@ case OP_HexBlob: { /* same as TK_BLOB */
*/
case OP_Blob: {
pTos++;
- assert( pOp->p1 < STQLITE_MAX_LENGTH ); /* Due to STQLITE_MAX_STQL_LENGTH */
+ assert( pOp->p1 < SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */
sqlite3VdbeMemSetStr(pTos, pOp->p3, pOp->p1, 0, 0);
pTos->enc = encoding;
break;
}
-#endif /* STQLITE_OMIT_BLOB_LITERAL */
+#endif /* SQLITE_OMIT_BLOB_LITERAL */
/* Opcode: Variable P1 * *
**
@@ -34480,7 +34480,7 @@ case OP_Push: { /* no-push */
**
** The top P1 values on the stack represent a single result row from
** a query. This opcode causes the sqlite3_step() call to terminate
-** with an STQLITE_ROW return code and it sets up the sqlite3_stmt
+** with an SQLITE_ROW return code and it sets up the sqlite3_stmt
** structure to provide access to the top P1 values as the result
** row. When the sqlite3_step() function is run again, the top P1
** values will be automatically popped from the stack before the next
@@ -34522,7 +34522,7 @@ case OP_Callback: { /* no-push */
p->popStack = pOp->p1;
p->pc = pc + 1;
p->pTos = pTos;
- return STQLITE_ROW;
+ return SQLITE_ROW;
}
/* Opcode: Concat P1 P2 *
@@ -34571,7 +34571,7 @@ case OP_Concat: { /* same as TK_CONCAT */
/* Otherwise malloc() space for the result and concatenate all the
** stack values.
*/
- if( nByte+2>STQLITE_MAX_LENGTH ){
+ if( nByte+2>SQLITE_MAX_LENGTH ){
goto too_big;
}
zNew = sqliteMallocRaw( nByte+2 );
@@ -34822,7 +34822,7 @@ case OP_Function: {
/* If the function returned an error, throw an exception */
if( ctx.isError ){
sqlite3SetString(&p->zErrMsg, sqlite3_value_text(&ctx.s), (char*)0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
/* Copy the result of the function to the top of the stack */
@@ -34922,7 +34922,7 @@ case OP_AddImm: { /* no-push */
case OP_ForceInt: { /* no-push */
i64 v;
assert( pTos>=p->aStack );
- applyAffinity(pTos, STQLITE_AFF_NUMERIC, encoding);
+ applyAffinity(pTos, SQLITE_AFF_NUMERIC, encoding);
if( (pTos->flags & (MEM_Int|MEM_Real))==0 ){
Release(pTos);
pTos--;
@@ -34949,7 +34949,7 @@ case OP_ForceInt: { /* no-push */
** Force the top of the stack to be an integer. If the top of the
** stack is not an integer and cannot be converted into an integer
** with out data loss, then jump immediately to P2, or if P2==0
-** raise an STQLITE_MISMATCH exception.
+** raise an SQLITE_MISMATCH exception.
**
** If the top of the stack is not an integer and P2 is not zero and
** P1 is 1, then the stack is popped. In all other cases, the depth
@@ -34957,10 +34957,10 @@ case OP_ForceInt: { /* no-push */
*/
case OP_MustBeInt: { /* no-push */
assert( pTos>=p->aStack );
- applyAffinity(pTos, STQLITE_AFF_NUMERIC, encoding);
+ applyAffinity(pTos, SQLITE_AFF_NUMERIC, encoding);
if( (pTos->flags & MEM_Int)==0 ){
if( pOp->p2==0 ){
- rc = STQLITE_MISMATCH;
+ rc = SQLITE_MISMATCH;
goto abort_due_to_error;
}else{
if( pOp->p1 ) popStack(&pTos, 1);
@@ -34990,7 +34990,7 @@ case OP_RealAffinity: { /* no-push */
break;
}
-#ifndef STQLITE_OMIT_CAST
+#ifndef SQLITE_OMIT_CAST
/* Opcode: ToText * * *
**
** Force the value on the top of the stack to be text.
@@ -35005,7 +35005,7 @@ case OP_ToText: { /* same as TK_TO_TEXT, no-push */
if( pTos->flags & MEM_Null ) break;
assert( MEM_Str==(MEM_Blob>>3) );
pTos->flags |= (pTos->flags&MEM_Blob)>>3;
- applyAffinity(pTos, STQLITE_AFF_TEXT, encoding);
+ applyAffinity(pTos, SQLITE_AFF_TEXT, encoding);
rc = ExpandBlob(pTos);
assert( pTos->flags & MEM_Str );
pTos->flags &= ~(MEM_Int|MEM_Real|MEM_Blob);
@@ -35025,7 +35025,7 @@ case OP_ToBlob: { /* same as TK_TO_BLOB, no-push */
assert( pTos>=p->aStack );
if( pTos->flags & MEM_Null ) break;
if( (pTos->flags & MEM_Blob)==0 ){
- applyAffinity(pTos, STQLITE_AFF_TEXT, encoding);
+ applyAffinity(pTos, SQLITE_AFF_TEXT, encoding);
assert( pTos->flags & MEM_Str );
pTos->flags |= MEM_Blob;
}
@@ -35050,7 +35050,7 @@ case OP_ToNumeric: { /* same as TK_TO_NUMERIC, no-push */
}
break;
}
-#endif /* STQLITE_OMIT_CAST */
+#endif /* SQLITE_OMIT_CAST */
/* Opcode: ToInt * * *
**
@@ -35069,7 +35069,7 @@ case OP_ToInt: { /* same as TK_TO_INT, no-push */
break;
}
-#ifndef STQLITE_OMIT_CAST
+#ifndef SQLITE_OMIT_CAST
/* Opcode: ToReal * * *
**
** Force the value on the top of the stack to be a floating point number.
@@ -35086,7 +35086,7 @@ case OP_ToReal: { /* same as TK_TO_REAL, no-push */
}
break;
}
-#endif /* STQLITE_OMIT_CAST */
+#endif /* SQLITE_OMIT_CAST */
/* Opcode: Eq P1 P2 P3
**
@@ -35105,7 +35105,7 @@ case OP_ToReal: { /* same as TK_TO_REAL, no-push */
** 0x200 is set but is NULL when the 0x200 bit of P1 is clear.
**
** The least significant byte of P1 (mask 0xff) must be an affinity character -
-** STQLITE_AFF_TEXT, STQLITE_AFF_INTEGER, and so forth. An attempt is made
+** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made
** to coerce both values
** according to the affinity before the comparison is made. If the byte is
** 0x00, then numeric affinity is used.
@@ -35393,7 +35393,7 @@ case OP_IfNot: { /* no-push */
if( pTos->flags & MEM_Null ){
c = pOp->p1;
}else{
-#ifdef STQLITE_OMIT_FLOATING_POINT
+#ifdef SQLITE_OMIT_FLOATING_POINT
c = sqlite3VdbeIntValue(pTos);
#else
c = sqlite3VdbeRealValue(pTos)!=0.0;
@@ -35517,7 +35517,7 @@ case OP_Column: {
** which is the number of records.
*/
pC = p->apCsr[p1];
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
assert( pC->pVtabCursor==0 );
#endif
assert( pC!=0 );
@@ -35560,7 +35560,7 @@ case OP_Column: {
assert( pTos->flags==MEM_Null );
break;
}
- if( payloadSize>STQLITE_MAX_LENGTH ){
+ if( payloadSize>SQLITE_MAX_LENGTH ){
goto too_big;
}
@@ -35624,7 +35624,7 @@ case OP_Column: {
*/
if( !zRec && avail<offset ){
rc = sqlite3VdbeMemFromBtree(pCrsr, 0, offset, pC->isIndex, &sMem);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto op_column_out;
}
zData = sMem.z;
@@ -35660,7 +35660,7 @@ case OP_Column: {
** record, then we must be dealing with a corrupt database.
*/
if( zIdx>zEndHdr || offset>payloadSize ){
- rc = STQLITE_CORRUPT_BKPT;
+ rc = SQLITE_CORRUPT_BKPT;
goto op_column_out;
}
}
@@ -35672,13 +35672,13 @@ case OP_Column: {
** a pointer to a Mem object.
*/
if( aOffset[p2] ){
- assert( rc==STQLITE_OK );
+ assert( rc==SQLITE_OK );
if( zRec ){
zData = &zRec[aOffset[p2]];
}else{
len = sqlite3VdbeSerialTypeLen(aType[p2]);
rc = sqlite3VdbeMemFromBtree(pCrsr, aOffset[p2], len, pC->isIndex,&sMem);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto op_column_out;
}
zData = sMem.z;
@@ -35737,7 +35737,7 @@ op_column_out:
** field of the index key (i.e. the first character of P3 corresponds to the
** lowest element on the stack).
**
-** The mapping from character to affinity is given by the STQLITE_AFF_
+** The mapping from character to affinity is given by the SQLITE_AFF_
** macros defined in sqliteInt.h.
**
** If P3 is NULL then all index fields have the affinity NONE.
@@ -35846,7 +35846,7 @@ case OP_MakeRecord: {
nHdr++;
}
nByte = nHdr+nData-nZero;
- if( nByte>STQLITE_MAX_LENGTH ){
+ if( nByte>SQLITE_MAX_LENGTH ){
goto too_big;
}
@@ -35898,7 +35898,7 @@ case OP_MakeRecord: {
pTos->u.i = nZero;
pTos->flags |= MEM_Zero;
}
- pTos->enc = STQLITE_UTF8; /* In case the blob is ever converted to text */
+ pTos->enc = SQLITE_UTF8; /* In case the blob is ever converted to text */
/* If a NULL was encountered and jumpIfNull is non-zero, take the jump. */
if( jumpIfNull && containsNull ){
@@ -35956,7 +35956,7 @@ case OP_AutoCommit: { /* no-push */
*/
sqlite3SetString(&p->zErrMsg, "cannot ", rollback?"rollback":"commit",
" transaction - SQL statements in progress", (char*)0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}else if( i!=db->autoCommit ){
if( pOp->p2 ){
assert( i==1 );
@@ -35964,18 +35964,18 @@ case OP_AutoCommit: { /* no-push */
db->autoCommit = 1;
}else{
db->autoCommit = i;
- if( sqlite3VdbeHalt(p)==STQLITE_BUSY ){
+ if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){
p->pTos = pTos;
p->pc = pc;
db->autoCommit = 1-i;
- p->rc = STQLITE_BUSY;
- return STQLITE_BUSY;
+ p->rc = SQLITE_BUSY;
+ return SQLITE_BUSY;
}
}
- if( p->rc==STQLITE_OK ){
- return STQLITE_DONE;
+ if( p->rc==SQLITE_OK ){
+ return SQLITE_DONE;
}else{
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
}else{
sqlite3SetString(&p->zErrMsg,
@@ -35983,7 +35983,7 @@ case OP_AutoCommit: { /* no-push */
(rollback)?"cannot rollback - no transaction is active":
"cannot commit - no transaction is active"), (char*)0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
break;
}
@@ -36017,13 +36017,13 @@ case OP_Transaction: { /* no-push */
if( pBt ){
rc = sqlite3BtreeBeginTrans(pBt, pOp->p2);
- if( rc==STQLITE_BUSY ){
+ if( rc==SQLITE_BUSY ){
p->pc = pc;
- p->rc = STQLITE_BUSY;
+ p->rc = SQLITE_BUSY;
p->pTos = pTos;
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
}
- if( rc!=STQLITE_OK && rc!=STQLITE_READONLY /* && rc!=STQLITE_BUSY */ ){
+ if( rc!=SQLITE_OK && rc!=SQLITE_READONLY /* && rc!=SQLITE_BUSY */ ){
goto abort_due_to_error;
}
}
@@ -36052,7 +36052,7 @@ case OP_ReadCookie: {
int iDb = pOp->p1;
int iCookie = pOp->p2;
- assert( pOp->p2<STQLITE_N_BTREE_META );
+ assert( pOp->p2<SQLITE_N_BTREE_META );
if( iDb<0 ){
iDb = (-1*(iDb+1));
iCookie *= -1;
@@ -36085,7 +36085,7 @@ case OP_ReadCookie: {
*/
case OP_SetCookie: { /* no-push */
Db *pDb;
- assert( pOp->p2<STQLITE_N_BTREE_META );
+ assert( pOp->p2<SQLITE_N_BTREE_META );
assert( pOp->p1>=0 && pOp->p1<db->nDb );
pDb = &db->aDb[pOp->p1];
assert( pDb->pBt!=0 );
@@ -36096,7 +36096,7 @@ case OP_SetCookie: { /* no-push */
if( pOp->p2==0 ){
/* When the schema cookie changes, record the new cookie internally */
pDb->pSchema->schema_cookie = pTos->u.i;
- db->flags |= STQLITE_InternChanges;
+ db->flags |= SQLITE_InternChanges;
}else if( pOp->p2==1 ){
/* Record changes in the file format */
pDb->pSchema->file_format = pTos->u.i;
@@ -36135,17 +36135,17 @@ case OP_VerifyCookie: { /* no-push */
if( pBt ){
rc = sqlite3BtreeGetMeta(pBt, 1, (u32 *)&iMeta);
}else{
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
iMeta = 0;
}
- if( rc==STQLITE_OK && iMeta!=pOp->p2 ){
+ if( rc==SQLITE_OK && iMeta!=pOp->p2 ){
sqlite3SetString(&p->zErrMsg, "database schema has changed", (char*)0);
/* If the schema-cookie from the database file matches the cookie
** stored with the in-memory representation of the schema, do
** not reload the schema from the database file.
**
** If virtual-tables are in use, this is not just an optimisation.
- ** Often, v-tables store their data in other STQLite tables, which
+ ** Often, v-tables store their data in other SQLite tables, which
** are queried from within xNext() and other v-table methods using
** prepared queries. If such a query is out-of-date, we do not want to
** discard the database schema, as the user code implementing the
@@ -36158,7 +36158,7 @@ case OP_VerifyCookie: { /* no-push */
}
sqlite3ExpirePreparedStatements(db);
- rc = STQLITE_SCHEMA;
+ rc = SQLITE_SCHEMA;
}
break;
}
@@ -36182,7 +36182,7 @@ case OP_VerifyCookie: { /* no-push */
** any other process from modifying the database. The read lock is
** released when all cursors are closed. If this instruction attempts
** to get a read lock but fails, the script terminates with an
-** STQLITE_BUSY error code.
+** SQLITE_BUSY error code.
**
** The P3 value is a pointer to a KeyInfo structure that defines the
** content and collating sequence of indices. P3 is NULL for cursors
@@ -36259,13 +36259,13 @@ case OP_OpenWrite: { /* no-push */
pCur->pIncrKey = &pCur->bogusIncrKey;
}
switch( rc ){
- case STQLITE_BUSY: {
+ case SQLITE_BUSY: {
p->pc = pc;
- p->rc = STQLITE_BUSY;
+ p->rc = SQLITE_BUSY;
p->pTos = &pTos[1 + (pOp->p2<=0)]; /* Operands must remain on stack */
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
}
- case STQLITE_OK: {
+ case SQLITE_OK: {
int flags = sqlite3BtreeFlags(pCur->pCursor);
/* Sanity checking. Only the lower four bits of the flags byte should
** be used. Bit 3 (mask 0x08) is unpreditable. The lower 3 bits
@@ -36274,7 +36274,7 @@ case OP_OpenWrite: { /* no-push */
** only mean that we are dealing with a corrupt database file
*/
if( (flags & 0xf0)!=0 || ((flags & 0x07)!=5 && (flags & 0x07)!=2) ){
- rc = STQLITE_CORRUPT_BKPT;
+ rc = SQLITE_CORRUPT_BKPT;
goto abort_due_to_error;
}
pCur->isTable = (flags & BTREE_INTKEY)!=0;
@@ -36285,15 +36285,15 @@ case OP_OpenWrite: { /* no-push */
*/
if( (pCur->isTable && pOp->p3type==P3_KEYINFO)
|| (pCur->isIndex && pOp->p3type!=P3_KEYINFO) ){
- rc = STQLITE_CORRUPT_BKPT;
+ rc = SQLITE_CORRUPT_BKPT;
goto abort_due_to_error;
}
break;
}
- case STQLITE_EMPTY: {
+ case SQLITE_EMPTY: {
pCur->isTable = pOp->p3type!=P3_KEYINFO;
pCur->isIndex = !pCur->isTable;
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
break;
}
default: {
@@ -36328,11 +36328,11 @@ case OP_OpenEphemeral: { /* no-push */
pCx = allocateCursor(p, i, -1);
if( pCx==0 ) goto no_mem;
pCx->nullRow = 1;
- rc = sqlite3BtreeFactory(db, 0, 1, STQLITE_DEFAULT_TEMP_CACHE_SIZE, &pCx->pBt);
- if( rc==STQLITE_OK ){
+ rc = sqlite3BtreeFactory(db, 0, 1, SQLITE_DEFAULT_TEMP_CACHE_SIZE, &pCx->pBt);
+ if( rc==SQLITE_OK ){
rc = sqlite3BtreeBeginTrans(pCx->pBt, 1);
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
/* If a transient index is required, create it by calling
** sqlite3BtreeCreateTable() with the BTREE_ZERODATA flag before
** opening it. If a transient table is required, just use the
@@ -36342,7 +36342,7 @@ case OP_OpenEphemeral: { /* no-push */
int pgno;
assert( pOp->p3type==P3_KEYINFO );
rc = sqlite3BtreeCreateTable(pCx->pBt, &pgno, BTREE_ZERODATA);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
assert( pgno==MASTER_ROOT+1 );
rc = sqlite3BtreeCursor(pCx->pBt, pgno, 1, sqlite3VdbeRecordCompare,
pOp->p3, &pCx->pCursor);
@@ -36470,7 +36470,7 @@ case OP_MoveGt: { /* no-push */
break;
}
rc = sqlite3BtreeMoveto(pC->pCursor, 0, (u64)iKey, 0, &res);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
pC->lastRowid = pTos->u.i;
@@ -36479,7 +36479,7 @@ case OP_MoveGt: { /* no-push */
assert( pTos->flags & MEM_Blob );
ExpandBlob(pTos);
rc = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, 0, &res);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
pC->rowidIsValid = 0;
@@ -36487,13 +36487,13 @@ case OP_MoveGt: { /* no-push */
pC->deferredMoveto = 0;
pC->cachetqStatus = CACHE_STALE;
*pC->pIncrKey = 0;
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
sqlite3_search_count++;
#endif
if( oc==OP_MoveGe || oc==OP_MoveGt ){
if( res<0 ){
rc = sqlite3BtreeNext(pC->pCursor, &res);
- if( rc!=STQLITE_OK ) goto abort_due_to_error;
+ if( rc!=SQLITE_OK ) goto abort_due_to_error;
pC->rowidIsValid = 0;
}else{
res = 0;
@@ -36502,7 +36502,7 @@ case OP_MoveGt: { /* no-push */
assert( oc==OP_MoveLt || oc==OP_MoveLe );
if( res>=0 ){
rc = sqlite3BtreePrevious(pC->pCursor, &res);
- if( rc!=STQLITE_OK ) goto abort_due_to_error;
+ if( rc!=SQLITE_OK ) goto abort_due_to_error;
pC->rowidIsValid = 0;
}else{
/* res might be negative because the table is empty. Check to
@@ -36587,7 +36587,7 @@ case OP_Found: { /* no-push */
assert( pTos->flags & MEM_Blob );
Stringify(pTos, encoding);
rx = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, 0, &res);
- alreadyExists = rx==STQLITE_OK && res==0;
+ alreadyExists = rx==SQLITE_OK && res==0;
pC->deferredMoveto = 0;
pC->cachetqStatus = CACHE_STALE;
}
@@ -36666,7 +36666,7 @@ case OP_IsUnique: { /* no-push */
assert( pCx->deferredMoveto==0 );
pCx->cachetqStatus = CACHE_STALE;
rc = sqlite3BtreeMoveto(pCrsr, zKey, len, 0, &res);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
if( res<0 ){
@@ -36677,7 +36677,7 @@ case OP_IsUnique: { /* no-push */
}
}
rc = sqlite3VdbeIdxKeyCompare(pCx, len, (u8*)zKey, &res);
- if( rc!=STQLITE_OK ) goto abort_due_to_error;
+ if( rc!=SQLITE_OK ) goto abort_due_to_error;
if( res>0 ){
pc = pOp->p2 - 1;
break;
@@ -36689,7 +36689,7 @@ case OP_IsUnique: { /* no-push */
** immediately to P2.
*/
rc = sqlite3VdbeIdxRowid(pCrsr, &v);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
if( v==R ){
@@ -36740,7 +36740,7 @@ case OP_NotExists: { /* no-push */
pC->rowidIsValid = res==0;
pC->nullRow = 0;
pC->cachetqStatus = CACHE_STALE;
- /* res might be uninitialized if rc!=STQLITE_OK. But if rc!=STQLITE_OK
+ /* res might be uninitialized if rc!=SQLITE_OK. But if rc!=SQLITE_OK
** processing is about to abort so we really do not care whether or not
** the following jump is taken. (In other words, do not stress over
** the error that valgrind sometimes shows on the next statement when
@@ -36782,7 +36782,7 @@ case OP_Sequence: {
**
** If P2>0 then P2 is a memory cell that holds the largest previously
** generated record number. No new record numbers are allowed to be less
-** than this value. When this value reaches its maximum, a STQLITE_FULL
+** than this value. When this value reaches its maximum, a SQLITE_FULL
** error is generated. The P2 memory cell is updated with the generated
** record number. This P2 mechanism is used to help implement the
** AUTOINCREMENT feature.
@@ -36819,7 +36819,7 @@ case OP_NewRowid: {
** source of random numbers. Is a library function like lrand48()
** good enough? Maybe. Maybe not. It's hard to know whether there
** might be subtle bugs is some implementations of lrand48() that
- ** could cause problems. To avoid uncertainty, STQLite uses its own
+ ** could cause problems. To avoid uncertainty, SQLite uses its own
** random number generator based on the RC4 algorithm.
**
** To promote locality of reference for repetitive inserts, the
@@ -36827,18 +36827,18 @@ case OP_NewRowid: {
** larger than the previous rowid. This has been shown experimentally
** to double the speed of the COPY operation.
*/
- int res, rx=STQLITE_OK, cnt;
+ int res, rx=SQLITE_OK, cnt;
i64 x;
cnt = 0;
if( (sqlite3BtreeFlags(pC->pCursor)&(BTREE_INTKEY|BTREE_ZERODATA)) !=
BTREE_INTKEY ){
- rc = STQLITE_CORRUPT_BKPT;
+ rc = SQLITE_CORRUPT_BKPT;
goto abort_due_to_error;
}
assert( (sqlite3BtreeFlags(pC->pCursor) & BTREE_INTKEY)!=0 );
assert( (sqlite3BtreeFlags(pC->pCursor) & BTREE_ZERODATA)==0 );
-#ifdef STQLITE_32BIT_ROWID
+#ifdef SQLITE_32BIT_ROWID
# define MAX_ROWID 0x7fffffff
#else
/* Some compilers complain about constants of the form 0x7fffffffffffffff.
@@ -36853,7 +36853,7 @@ case OP_NewRowid: {
v = pC->nextRowid;
}else{
rc = sqlite3BtreeLast(pC->pCursor, &res);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
if( res ){
@@ -36869,7 +36869,7 @@ case OP_NewRowid: {
}
}
-#ifndef STQLITE_OMIT_AUTOINCREMENT
+#ifndef SQLITE_OMIT_AUTOINCREMENT
if( pOp->p2 ){
Mem *pMem;
assert( pOp->p2>0 && pOp->p2<p->nMem ); /* P2 is a valid memory cell */
@@ -36877,7 +36877,7 @@ case OP_NewRowid: {
sqlite3VdbeMemIntegerify(pMem);
assert( (pMem->flags & MEM_Int)!=0 ); /* mem(P2) holds an integer */
if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){
- rc = STQLITE_FULL;
+ rc = SQLITE_FULL;
goto abort_due_to_error;
}
if( v<pMem->u.i+1 ){
@@ -36895,7 +36895,7 @@ case OP_NewRowid: {
}
}
if( pC->useRandomRowid ){
- assert( pOp->p2==0 ); /* STQLITE_FULL must have occurred prior to this */
+ assert( pOp->p2==0 ); /* SQLITE_FULL must have occurred prior to this */
v = db->priorNewRowid;
cnt = 0;
do{
@@ -36911,10 +36911,10 @@ case OP_NewRowid: {
x = intToKey(v);
rx = sqlite3BtreeMoveto(pC->pCursor, 0, (u64)x, 0, &res);
cnt++;
- }while( cnt<1000 && rx==STQLITE_OK && res==0 );
+ }while( cnt<1000 && rx==SQLITE_OK && res==0 );
db->priorNewRowid = v;
- if( rx==STQLITE_OK && res==0 ){
- rc = STQLITE_FULL;
+ if( rx==SQLITE_OK && res==0 ){
+ rc = SQLITE_FULL;
goto abort_due_to_error;
}
}
@@ -37005,10 +37005,10 @@ case OP_Insert: { /* no-push */
pC->cachetqStatus = CACHE_STALE;
/* Invoke the update-hook if required. */
- if( rc==STQLITE_OK && db->xUpdateCallback && pOp->p3 ){
+ if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p3 ){
const char *zDb = db->aDb[pC->iDb].zName;
const char *zTbl = pOp->p3;
- int op = ((pOp->p2 & OPFLAG_ISUPDATE) ? STQLITE_UPDATE : STQLITE_INSERT);
+ int op = ((pOp->p2 & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_INSERT);
assert( pC->isTable );
db->xUpdateCallback(db->pUpdateArg, op, zDb, zTbl, iKey);
assert( pC->iDb>=0 );
@@ -37065,10 +37065,10 @@ case OP_Delete: { /* no-push */
pC->cachetqStatus = CACHE_STALE;
/* Invoke the update-hook if required. */
- if( rc==STQLITE_OK && db->xUpdateCallback && pOp->p3 ){
+ if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p3 ){
const char *zDb = db->aDb[pC->iDb].zName;
const char *zTbl = pOp->p3;
- db->xUpdateCallback(db->pUpdateArg, STQLITE_DELETE, zDb, zTbl, iKey);
+ db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE, zDb, zTbl, iKey);
assert( pC->iDb>=0 );
}
}
@@ -37135,14 +37135,14 @@ case OP_RowData: {
i64 n64;
assert( !pC->isTable );
sqlite3BtreeKeySize(pCrsr, &n64);
- if( n64>STQLITE_MAX_LENGTH ){
+ if( n64>SQLITE_MAX_LENGTH ){
goto too_big;
}
n = n64;
}else{
sqlite3BtreeDataSize(pCrsr, &n);
}
- if( n>STQLITE_MAX_LENGTH ){
+ if( n>SQLITE_MAX_LENGTH ){
goto too_big;
}
pTos->n = n;
@@ -37163,13 +37163,13 @@ case OP_RowData: {
}
}else if( pC->pseudoTable ){
pTos->n = pC->nData;
- assert( pC->nData<=STQLITE_MAX_LENGTH );
+ assert( pC->nData<=SQLITE_MAX_LENGTH );
pTos->z = pC->pData;
pTos->flags = MEM_Blob|MEM_Ephem;
}else{
pTos->flags = MEM_Null;
}
- pTos->enc = STQLITE_UTF8; /* In case the blob is ever cast to text */
+ pTos->enc = SQLITE_UTF8; /* In case the blob is ever cast to text */
break;
}
@@ -37269,7 +37269,7 @@ case OP_Last: { /* no-push */
** correctly optimizing out sorts.
*/
case OP_Sort: { /* no-push */
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
sqlite3_sort_count++;
sqlite3_search_count--;
#endif
@@ -37347,7 +37347,7 @@ case OP_Next: { /* no-push */
}
if( res==0 ){
pc = pOp->p2 - 1;
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
sqlite3_search_count++;
#endif
}
@@ -37381,7 +37381,7 @@ case OP_IdxInsert: { /* no-push */
if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
assert( pC->isTable==0 );
rc = ExpandBlob(pTos);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
int nKey = pTos->n;
const char *zKey = pTos->z;
rc = sqlite3BtreeInsert(pCrsr, zKey, nKey, "", 0, 0, pOp->p2);
@@ -37411,7 +37411,7 @@ case OP_IdxDelete: { /* no-push */
if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
int res;
rc = sqlite3BtreeMoveto(pCrsr, pTos->z, pTos->n, 0, &res);
- if( rc==STQLITE_OK && res==0 ){
+ if( rc==SQLITE_OK && res==0 ){
rc = sqlite3BtreeDelete(pCrsr);
}
assert( pC->deferredMoveto==0 );
@@ -37448,7 +37448,7 @@ case OP_IdxRowid: {
pTos->flags = MEM_Null;
}else{
rc = sqlite3VdbeIdxRowid(pCrsr, &rowid);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
pTos->flags = MEM_Int;
@@ -37521,7 +37521,7 @@ case OP_IdxGE: { /* no-push */
assert( pOp->p3==0 || pOp->opcode!=OP_IdxGT );
rc = sqlite3VdbeIdxKeyCompare(pC, pTos->n, (u8*)pTos->z, &res);
*pC->pIncrKey = 0;
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
break;
}
if( pOp->opcode==OP_IdxLT ){
@@ -37561,7 +37561,7 @@ case OP_IdxGE: { /* no-push */
case OP_Destroy: {
int iMoved;
int iCnt;
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
Vdbe *pVdbe;
iCnt = 0;
for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){
@@ -37573,15 +37573,15 @@ case OP_Destroy: {
iCnt = db->activeVdbeCnt;
#endif
if( iCnt>1 ){
- rc = STQLITE_LOCKED;
+ rc = SQLITE_LOCKED;
}else{
assert( iCnt==1 );
rc = sqlite3BtreeDropTable(db->aDb[pOp->p2].pBt, pOp->p1, &iMoved);
pTos++;
pTos->flags = MEM_Int;
pTos->u.i = iMoved;
-#ifndef STQLITE_OMIT_AUTOVACUUM
- if( rc==STQLITE_OK && iMoved!=0 ){
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( rc==SQLITE_OK && iMoved!=0 ){
sqlite3RootPageMoved(&db->aDb[pOp->p2], iMoved, pOp->p1);
}
#endif
@@ -37603,7 +37603,7 @@ case OP_Destroy: {
*/
case OP_Clear: { /* no-push */
- /* For consistency with the way other features of STQLite operate
+ /* For consistency with the way other features of SQLite operate
** with a truncate, we will also skip the update callback.
*/
#if 0
@@ -37615,12 +37615,12 @@ case OP_Clear: { /* no-push */
int fin = 0;
rc = sqlite3BtreeCursor(pBt, pOp->p1, 0, 0, 0, &pCur);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
for(
rc=sqlite3BtreeFirst(pCur, &fin);
- rc==STQLITE_OK && !fin;
+ rc==SQLITE_OK && !fin;
rc=sqlite3BtreeNext(pCur, &fin)
){
i64 iKey;
@@ -37629,10 +37629,10 @@ case OP_Clear: { /* no-push */
break;
}
iKey = keyToInt(iKey);
- db->xUpdateCallback(db->pUpdateArg, STQLITE_DELETE, zDb, zTbl, iKey);
+ db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE, zDb, zTbl, iKey);
}
sqlite3BtreeCloseCursor(pCur);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
}
@@ -37677,7 +37677,7 @@ case OP_CreateTable: {
}
rc = sqlite3BtreeCreateTable(pDb->pBt, &pgno, flags);
pTos++;
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pTos->u.i = pgno;
pTos->flags = MEM_Int;
}else{
@@ -37688,11 +37688,11 @@ case OP_CreateTable: {
/* Opcode: ParseSchema P1 P2 P3
**
-** Read and parse all entries from the STQLITE_MASTER table of database P1
+** Read and parse all entries from the SQLITE_MASTER table of database P1
** that match the WHERE clause P3. P2 is the "force" flag. Always do
** the parsing if P2 is true. If P2 is false, then this routine is a
** no-op if the schema is not currently loaded. In other words, if P2
-** is false, the STQLITE_MASTER table is only parsed if the rest of the
+** is false, the SQLITE_MASTER table is only parsed if the rest of the
** schema is already loaded into the symbol table.
**
** This opcode invokes the parser to create a new virtual machine,
@@ -37721,18 +37721,18 @@ case OP_ParseSchema: { /* no-push */
db->init.busy = 1;
assert( !sqlite3MallocFailed() );
rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0);
- if( rc==STQLITE_ABORT ) rc = initData.rc;
+ if( rc==SQLITE_ABORT ) rc = initData.rc;
sqliteFree(zSql);
db->init.busy = 0;
sqlite3SafetyOn(db);
- if( rc==STQLITE_NOMEM ){
+ if( rc==SQLITE_NOMEM ){
sqlite3FailedMalloc();
goto no_mem;
}
break;
}
-#if !defined(STQLITE_OMIT_ANALYZE) && !defined(STQLITE_OMIT_PARSER)
+#if !defined(SQLITE_OMIT_ANALYZE) && !defined(SQLITE_OMIT_PARSER)
/* Opcode: LoadAnalysis P1 * *
**
** Read the sqlite_stat1 table for database P1 and load the content
@@ -37745,7 +37745,7 @@ case OP_LoadAnalysis: { /* no-push */
rc = sqlite3AnalysisLoad(db, iDb);
break;
}
-#endif /* !defined(STQLITE_OMIT_ANALYZE) && !defined(STQLITE_OMIT_PARSER) */
+#endif /* !defined(SQLITE_OMIT_ANALYZE) && !defined(SQLITE_OMIT_PARSER) */
/* Opcode: DropTable P1 * P3
**
@@ -37784,7 +37784,7 @@ case OP_DropTrigger: { /* no-push */
}
-#ifndef STQLITE_OMIT_INTEGRITY_CHECK
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
/* Opcode: IntegrityCk P1 P2 *
**
** Do an analysis of the currently open database. Push onto the
@@ -37841,12 +37841,12 @@ case OP_IntegrityCk: {
pTos->flags = MEM_Str | MEM_Dyn | MEM_Term;
pTos->xDel = 0;
}
- pTos->enc = STQLITE_UTF8;
+ pTos->enc = SQLITE_UTF8;
sqlite3VdbeChangeEncoding(pTos, encoding);
sqliteFree(aRoot);
break;
}
-#endif /* STQLITE_OMIT_INTEGRITY_CHECK */
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
/* Opcode: FifoWrite * * *
**
@@ -37871,7 +37871,7 @@ case OP_FifoWrite: { /* no-push */
case OP_FifoRead: {
i64 v;
CHECK_FOR_INTERRUPT;
- if( sqlite3VdbeFifoPop(&p->sFifo, &v)==STQLITE_DONE ){
+ if( sqlite3VdbeFifoPop(&p->sFifo, &v)==SQLITE_DONE ){
pc = pOp->p2 - 1;
}else{
pTos++;
@@ -37881,7 +37881,7 @@ case OP_FifoRead: {
break;
}
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/* Opcode: ContextPush * * *
**
** Save the current Vdbe context such that it can be restored by a ContextPop
@@ -37923,7 +37923,7 @@ case OP_ContextPop: { /* no-push */
p->sFifo = pContext->sFifo;
break;
}
-#endif /* #ifndef STQLITE_OMIT_TRIGGER */
+#endif /* #ifndef SQLITE_OMIT_TRIGGER */
/* Opcode: MemStore P1 P2 *
**
@@ -37965,7 +37965,7 @@ case OP_MemLoad: {
break;
}
-#ifndef STQLITE_OMIT_AUTOINCREMENT
+#ifndef SQLITE_OMIT_AUTOINCREMENT
/* Opcode: MemMax P1 * *
**
** Set the value of memory cell P1 to the maximum of its current value
@@ -37987,7 +37987,7 @@ case OP_MemMax: { /* no-push */
}
break;
}
-#endif /* STQLITE_OMIT_AUTOINCREMENT */
+#endif /* SQLITE_OMIT_AUTOINCREMENT */
/* Opcode: MemIncr P1 P2 *
**
@@ -38140,7 +38140,7 @@ case OP_AggStep: { /* no-push */
popStack(&pTos, n);
if( ctx.isError ){
sqlite3SetString(&p->zErrMsg, sqlite3_value_text(&ctx.s), (char*)0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
sqlite3VdbeMemRelease(&ctx.s);
break;
@@ -38164,7 +38164,7 @@ case OP_AggFinal: { /* no-push */
pMem = &p->aMem[pOp->p1];
assert( (pMem->flags & ~(MEM_Null|MEM_Agg))==0 );
rc = sqlite3VdbeMemFinalize(pMem, (FuncDef*)pOp->p3);
- if( rc==STQLITE_ERROR ){
+ if( rc==SQLITE_ERROR ){
sqlite3SetString(&p->zErrMsg, sqlite3_value_text(pMem), (char*)0);
}
if( sqlite3VdbeMemTooBig(pMem) ){
@@ -38174,7 +38174,7 @@ case OP_AggFinal: { /* no-push */
}
-#if !defined(STQLITE_OMIT_VACUUM) && !defined(STQLITE_OMIT_ATTACH)
+#if !defined(SQLITE_OMIT_VACUUM) && !defined(SQLITE_OMIT_ATTACH)
/* Opcode: Vacuum * * *
**
** Vacuum the entire database. This opcode will cause other virtual
@@ -38189,7 +38189,7 @@ case OP_Vacuum: { /* no-push */
}
#endif
-#if !defined(STQLITE_OMIT_AUTOVACUUM)
+#if !defined(SQLITE_OMIT_AUTOVACUUM)
/* Opcode: IncrVacuum P1 P2 *
**
** Perform a single step of the incremental vacuum procedure on
@@ -38202,9 +38202,9 @@ case OP_IncrVacuum: { /* no-push */
assert( pOp->p1>=0 && pOp->p1<db->nDb );
pBt = db->aDb[pOp->p1].pBt;
rc = sqlite3BtreeIncrVacuum(pBt);
- if( rc==STQLITE_DONE ){
+ if( rc==SQLITE_DONE ){
pc = pOp->p2 - 1;
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}
break;
}
@@ -38213,7 +38213,7 @@ case OP_IncrVacuum: { /* no-push */
/* Opcode: Expire P1 * *
**
** Cause precompiled statements to become expired. An expired statement
-** fails with an error code of STQLITE_SCHEMA if it is ever executed
+** fails with an error code of SQLITE_SCHEMA if it is ever executed
** (via sqlite3_step()).
**
** If P1 is 0, then all SQL statements become expired. If P1 is non-zero,
@@ -38228,7 +38228,7 @@ case OP_Expire: { /* no-push */
break;
}
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
/* Opcode: TableLock P1 P2 P3
**
** Obtain a lock on a particular table. This instruction is only used when
@@ -38252,15 +38252,15 @@ case OP_TableLock: { /* no-push */
p1 = (-1*p1)-1;
}
rc = sqlite3BtreeLockTable(db->aDb[p1].pBt, pOp->p2, isWriteLock);
- if( rc==STQLITE_LOCKED ){
+ if( rc==SQLITE_LOCKED ){
const char *z = (const char *)pOp->p3;
sqlite3SetString(&p->zErrMsg, "database table is locked: ", z, (char*)0);
}
break;
}
-#endif /* STQLITE_OMIT_SHARED_CACHE */
+#endif /* SQLITE_OMIT_SHARED_CACHE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VBegin * * P3
**
** P3 a pointer to an sqlite3_vtab structure. Call the xBegin method
@@ -38270,9 +38270,9 @@ case OP_VBegin: { /* no-push */
rc = sqlite3VtabBegin(db, (sqlite3_vtab *)pOp->p3);
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VCreate P1 * P3
**
** P3 is the name of a virtual table in database P1. Call the xCreate method
@@ -38282,9 +38282,9 @@ case OP_VCreate: { /* no-push */
rc = sqlite3VtabCallCreate(db, pOp->p1, pOp->p3, &p->zErrMsg);
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VDestroy P1 * P3
**
** P3 is the name of a virtual table in database P1. Call the xDestroy method
@@ -38296,9 +38296,9 @@ case OP_VDestroy: { /* no-push */
p->inVtabMethod = 0;
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VOpen P1 * P3
**
** P3 is a pointer to a virtual table object, an sqlite3_vtab structure.
@@ -38316,7 +38316,7 @@ case OP_VOpen: { /* no-push */
if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
rc = pModule->xOpen(pVtab, &pVtabCursor);
if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
- if( STQLITE_OK==rc ){
+ if( SQLITE_OK==rc ){
/* Initialise sqlite3_vtab_cursor base class */
pVtabCursor->pVtab = pVtab;
@@ -38331,9 +38331,9 @@ case OP_VOpen: { /* no-push */
}
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VFilter P1 P2 P3
**
** P1 is a cursor opened using VOpen. P2 is an address to jump to if
@@ -38384,7 +38384,7 @@ case OP_VFilter: { /* no-push */
p->inVtabMethod = 1;
rc = pModule->xFilter(pCur->pVtabCursor, pTos->u.i, pOp->p3, nArg, apArg);
p->inVtabMethod = 0;
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
res = pModule->xEof(pCur->pVtabCursor);
}
if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
@@ -38398,9 +38398,9 @@ case OP_VFilter: { /* no-push */
popStack(&pTos, 2+nArg);
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VRowid P1 * *
**
** Push an integer onto the stack which is the rowid of
@@ -38414,7 +38414,7 @@ case OP_VRowid: {
pModule = pCur->pVtabCursor->pVtab->pModule;
if( pModule->xRowid==0 ){
sqlite3SetString(&p->zErrMsg, "Unsupported module operation: xRowid", 0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
} else {
sqlite_int64 iRow;
@@ -38429,9 +38429,9 @@ case OP_VRowid: {
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VColumn P1 P2 *
**
** Push onto the stack the value of the P2-th column of
@@ -38445,7 +38445,7 @@ case OP_VColumn: {
pModule = pCur->pVtabCursor->pVtab->pModule;
if( pModule->xColumn==0 ){
sqlite3SetString(&p->zErrMsg, "Unsupported module operation: xColumn", 0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
} else {
sqlite3_context sContext;
memset(&sContext, 0, sizeof(sContext));
@@ -38472,9 +38472,9 @@ case OP_VColumn: {
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VNext P1 P2 *
**
** Advance virtual table P1 to the next row in its result set and
@@ -38490,7 +38490,7 @@ case OP_VNext: { /* no-push */
pModule = pCur->pVtabCursor->pVtab->pModule;
if( pModule->xNext==0 ){
sqlite3SetString(&p->zErrMsg, "Unsupported module operation: xNext", 0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
} else {
/* Invoke the xNext() method of the module. There is no way for the
** underlying implementation to return an error if one occurs during
@@ -38502,7 +38502,7 @@ case OP_VNext: { /* no-push */
p->inVtabMethod = 1;
rc = pModule->xNext(pCur->pVtabCursor);
p->inVtabMethod = 0;
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
res = pModule->xEof(pCur->pVtabCursor);
}
if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
@@ -38515,9 +38515,9 @@ case OP_VNext: { /* no-push */
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VRename * * P3
**
** P3 is a pointer to a virtual table object, an sqlite3_vtab structure.
@@ -38542,7 +38542,7 @@ case OP_VRename: { /* no-push */
}
#endif
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VUpdate P1 P2 P3
**
** P3 is a pointer to a virtual table object, an sqlite3_vtab structure.
@@ -38573,7 +38573,7 @@ case OP_VUpdate: { /* no-push */
assert( pOp->p3type==P3_VTAB );
if( pModule->xUpdate==0 ){
sqlite3SetString(&p->zErrMsg, "read-only table", 0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}else{
int i;
sqlite_int64 rowid;
@@ -38588,7 +38588,7 @@ case OP_VUpdate: { /* no-push */
rc = pModule->xUpdate(pVtab, nArg, apArg, &rowid);
sqlite3VtabUnlock(db, pVtab);
if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
- if( pOp->p1 && rc==STQLITE_OK ){
+ if( pOp->p1 && rc==SQLITE_OK ){
assert( nArg>1 && apArg[0] && (apArg[0]->flags&MEM_Null) );
db->lastRowid = rowid;
}
@@ -38596,7 +38596,7 @@ case OP_VUpdate: { /* no-push */
popStack(&pTos, nArg);
break;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
/* An other opcode is illegal...
*/
@@ -38628,7 +38628,7 @@ default: {
}
#endif
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
/* Keep track of the size of the largest BLOB or STR that has appeared
** on the top of the VDBE stack.
*/
@@ -38655,7 +38655,7 @@ default: {
}
assert( pc>=-1 && pc<p->nOp );
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
/* Code for tracing the vdbe stack. */
if( p->trace && pTos>=p->aStack ){
int i;
@@ -38679,7 +38679,7 @@ default: {
if( rc!=0 ) fprintf(p->trace," rc=%d",rc);
fprintf(p->trace,"\n");
}
-#endif /* STQLITE_DEBUG */
+#endif /* SQLITE_DEBUG */
#endif /* NDEBUG */
} /* The end of the for(;;) loop the loops through opcodes */
@@ -38688,33 +38688,33 @@ default: {
vdbe_halt:
if( rc ){
p->rc = rc;
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}else{
- rc = STQLITE_DONE;
+ rc = SQLITE_DONE;
}
sqlite3VdbeHalt(p);
p->pTos = pTos;
return rc;
- /* Jump to here if a string or blob larger than STQLITE_MAX_LENGTH
+ /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH
** is encountered.
*/
too_big:
sqlite3SetString(&p->zErrMsg, "string or blob too big", (char*)0);
- rc = STQLITE_TOOBIG;
+ rc = SQLITE_TOOBIG;
goto vdbe_halt;
/* Jump to here if a malloc() fails.
*/
no_mem:
sqlite3SetString(&p->zErrMsg, "out of memory", (char*)0);
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto vdbe_halt;
- /* Jump to here for an STQLITE_MISUSE error.
+ /* Jump to here for an SQLITE_MISUSE error.
*/
abort_due_to_misuse:
- rc = STQLITE_MISUSE;
+ rc = SQLITE_MISUSE;
/* Fall thru into abort_due_to_error */
/* Jump to here for any other kind of fatal error. The "rc" variable
@@ -38722,7 +38722,7 @@ abort_due_to_misuse:
*/
abort_due_to_error:
if( p->zErrMsg==0 ){
- if( sqlite3MallocFailed() ) rc = STQLITE_NOMEM;
+ if( sqlite3MallocFailed() ) rc = SQLITE_NOMEM;
sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0);
}
goto vdbe_halt;
@@ -38732,10 +38732,10 @@ abort_due_to_error:
*/
abort_due_to_interrupt:
assert( db->u1.isInterrupted );
- if( db->magic!=STQLITE_MAGIC_BUSY ){
- rc = STQLITE_MISUSE;
+ if( db->magic!=SQLITE_MAGIC_BUSY ){
+ rc = SQLITE_MISUSE;
}else{
- rc = STQLITE_INTERRUPT;
+ rc = SQLITE_INTERRUPT;
}
p->rc = rc;
sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0);
@@ -38762,7 +38762,7 @@ abort_due_to_interrupt:
*/
-#ifndef STQLITE_OMIT_INCRBLOB
+#ifndef SQLITE_OMIT_INCRBLOB
/*
** Valid sqlite3_blob* handles point to Incrblob structures.
@@ -38827,7 +38827,7 @@ int sqlite3_blob_open(
};
Vdbe *v = 0;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
char zErr[128];
zErr[0] = 0;
@@ -38839,7 +38839,7 @@ int sqlite3_blob_open(
sParse.db = db;
rc = sqlite3SafetyOn(db);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -38849,7 +38849,7 @@ int sqlite3_blob_open(
sqlite3_snprintf(sizeof(zErr), zErr, "%s", sParse.zErrMsg);
}
sqliteFree(sParse.zErrMsg);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
sqlite3SafetyOff(db);
goto blob_open_out;
}
@@ -38862,7 +38862,7 @@ int sqlite3_blob_open(
}
if( iCol==pTab->nCol ){
sqlite3_snprintf(sizeof(zErr), zErr, "no such column: \"%s\"", zColumn);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
sqlite3SafetyOff(db);
goto blob_open_out;
}
@@ -38879,7 +38879,7 @@ int sqlite3_blob_open(
if( pIdx->aiColumn[j]==iCol ){
sqlite3_snprintf(sizeof(zErr), zErr,
"cannot open indexed column for writing");
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
sqlite3SafetyOff(db);
goto blob_open_out;
}
@@ -38923,21 +38923,21 @@ int sqlite3_blob_open(
}
rc = sqlite3SafetyOff(db);
- if( rc!=STQLITE_OK || sqlite3MallocFailed() ){
+ if( rc!=SQLITE_OK || sqlite3MallocFailed() ){
goto blob_open_out;
}
sqlite3_bind_int64((sqlite3_stmt *)v, 1, iRow);
rc = sqlite3_step((sqlite3_stmt *)v);
- if( rc!=STQLITE_ROW ){
+ if( rc!=SQLITE_ROW ){
nAttempt++;
rc = sqlite3_finalize((sqlite3_stmt *)v);
sqlite3_snprintf(sizeof(zErr), zErr, sqlite3_errmsg(db));
v = 0;
}
- } while( nAttempt<5 && rc==STQLITE_SCHEMA );
+ } while( nAttempt<5 && rc==SQLITE_SCHEMA );
- if( rc==STQLITE_ROW ){
+ if( rc==SQLITE_ROW ){
/* The row-record has been opened successfully. Check that the
** column in question contains text or a blob. If it contains
** text, it is up to the caller to get the encoding right.
@@ -38949,7 +38949,7 @@ int sqlite3_blob_open(
sqlite3_snprintf(sizeof(zErr), zErr, "cannot open value of type %s",
type==0?"null": type==7?"real": "integer"
);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
goto blob_open_out;
}
pBlob = (Incrblob *)sqliteMalloc(sizeof(Incrblob));
@@ -38964,18 +38964,18 @@ int sqlite3_blob_open(
pBlob->iOffset = v->apCsr[0]->aOffset[iCol];
pBlob->nByte = sqlite3VdbeSerialTypeLen(type);
*ppBlob = (sqlite3_blob *)pBlob;
- rc = STQLITE_OK;
- }else if( rc==STQLITE_OK ){
+ rc = SQLITE_OK;
+ }else if( rc==SQLITE_OK ){
sqlite3_snprintf(sizeof(zErr), zErr, "no such rowid: %lld", iRow);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
blob_open_out:
zErr[sizeof(zErr)-1] = '\0';
- if( rc!=STQLITE_OK || sqlite3MallocFailed() ){
+ if( rc!=SQLITE_OK || sqlite3MallocFailed() ){
sqlite3_finalize((sqlite3_stmt *)v);
}
- sqlite3Error(db, rc, (rc==STQLITE_OK?0:zErr));
+ sqlite3Error(db, rc, (rc==SQLITE_OK?0:zErr));
return sqlite3ApiExit(db, rc);
}
@@ -39004,21 +39004,21 @@ static int blobReadWrite(
sqlite3 *db;
/* If there is no statement handle, then the blob-handle has
- ** already been invalidated. Return STQLITE_ABORT in this case.
+ ** already been invalidated. Return SQLITE_ABORT in this case.
*/
- if( !v ) return STQLITE_ABORT;
+ if( !v ) return SQLITE_ABORT;
/* Request is out of range. Return a transient error. */
if( (iOffset+n)>p->nByte ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
- /* Call either BtreeData() or BtreePutData(). If STQLITE_ABORT is
+ /* Call either BtreeData() or BtreePutData(). If SQLITE_ABORT is
** returned, clean-up the statement handle.
*/
db = v->db;
rc = xCall(p->pCsr, iOffset+p->iOffset, n, z);
- if( rc==STQLITE_ABORT ){
+ if( rc==SQLITE_ABORT ){
sqlite3VdbeFinalize(v);
p->pStmt = 0;
}else{
@@ -39051,7 +39051,7 @@ int sqlite3_blob_bytes(sqlite3_blob *pBlob){
return p->nByte;
}
-#endif /* #ifndef STQLITE_OMIT_INCRBLOB */
+#endif /* #ifndef SQLITE_OMIT_INCRBLOB */
/************** End of vdbeblob.c ********************************************/
/************** Begin file expr.c ********************************************/
@@ -39067,7 +39067,7 @@ int sqlite3_blob_bytes(sqlite3_blob *pBlob){
**
*************************************************************************
** This file contains routines used for analyzing expressions and
-** for generating VDBE code that evaluates expressions in STQLite.
+** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.300 2007/06/25 16:29:34 danielk1977 Exp $
*/
@@ -39088,12 +39088,12 @@ int sqlite3_blob_bytes(sqlite3_blob *pBlob){
** SELECT a AS b FROM t1 WHERE b;
** SELECT * FROM t1 WHERE (select a from t1);
*/
-STQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
+SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
int op = pExpr->op;
if( op==TK_SELECT ){
return sqlite3ExprAffinity(pExpr->pSelect->pEList->a[0].pExpr);
}
-#ifndef STQLITE_OMIT_CAST
+#ifndef SQLITE_OMIT_CAST
if( op==TK_CAST ){
return sqlite3AffinityType(&pExpr->token);
}
@@ -39108,7 +39108,7 @@ STQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
** flag. An explicit collating sequence will override implicit
** collating sequences.
*/
-STQLITE_PRIVATE Expr *sqlite3ExprSetColl(Parse *pParse, Expr *pExpr, Token *pName){
+SQLITE_PRIVATE Expr *sqlite3ExprSetColl(Parse *pParse, Expr *pExpr, Token *pName){
CollSeq *pColl;
if( pExpr==0 ) return 0;
pColl = sqlite3LocateCollSeq(pParse, (char*)pName->z, pName->n);
@@ -39123,7 +39123,7 @@ STQLITE_PRIVATE Expr *sqlite3ExprSetColl(Parse *pParse, Expr *pExpr, Token *pNam
** Return the default collation sequence for the expression pExpr. If
** there is no default collation type, return 0.
*/
-STQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
+SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
CollSeq *pColl = 0;
if( pExpr ){
int op;
@@ -39144,22 +39144,22 @@ STQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
** type affinity of the other operand. This routine returns the
** type affinity that should be used for the comparison operator.
*/
-STQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2){
+SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2){
char aff1 = sqlite3ExprAffinity(pExpr);
if( aff1 && aff2 ){
/* Both sides of the comparison are columns. If one has numeric
** affinity, use that. Otherwise use no affinity.
*/
if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){
- return STQLITE_AFF_NUMERIC;
+ return SQLITE_AFF_NUMERIC;
}else{
- return STQLITE_AFF_NONE;
+ return SQLITE_AFF_NONE;
}
}else if( !aff1 && !aff2 ){
/* Neither side of the comparison is a column. Compare the
** results directly.
*/
- return STQLITE_AFF_NONE;
+ return SQLITE_AFF_NONE;
}else{
/* One side is a column, the other is not. Use the columns affinity. */
assert( aff1==0 || aff2==0 );
@@ -39185,7 +39185,7 @@ static char comparisonAffinity(Expr *pExpr){
aff = sqlite3CompareAffinity(pExpr->pSelect->pEList->a[0].pExpr, aff);
}
else if( !aff ){
- aff = STQLITE_AFF_NONE;
+ aff = SQLITE_AFF_NONE;
}
return aff;
}
@@ -39196,13 +39196,13 @@ static char comparisonAffinity(Expr *pExpr){
** if the index with affinity idx_affinity may be used to implement
** the comparison in pExpr.
*/
-STQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){
+SQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){
char aff = comparisonAffinity(pExpr);
switch( aff ){
- case STQLITE_AFF_NONE:
+ case SQLITE_AFF_NONE:
return 1;
- case STQLITE_AFF_TEXT:
- return idx_affinity==STQLITE_AFF_TEXT;
+ case SQLITE_AFF_TEXT:
+ return idx_affinity==SQLITE_AFF_TEXT;
default:
return sqlite3IsNumericAffinity(idx_affinity);
}
@@ -39275,7 +39275,7 @@ static int codeCompare(
** for this node is obtained from sqliteMalloc(). The calling function
** is responsible for making sure the node eventually gets freed.
*/
-STQLITE_PRIVATE Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, const Token *pToken){
+SQLITE_PRIVATE Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, const Token *pToken){
Expr *pNew;
pNew = sqliteMalloc( sizeof(Expr) );
if( pNew==0 ){
@@ -39316,7 +39316,7 @@ STQLITE_PRIVATE Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, const Token
** Works like sqlite3Expr() but frees its pLeft and pRight arguments
** if it fails due to a malloc problem.
*/
-STQLITE_PRIVATE Expr *sqlite3ExprOrFree(int op, Expr *pLeft, Expr *pRight, const Token *pToken){
+SQLITE_PRIVATE Expr *sqlite3ExprOrFree(int op, Expr *pLeft, Expr *pRight, const Token *pToken){
Expr *pNew = sqlite3Expr(op, pLeft, pRight, pToken);
if( pNew==0 ){
sqlite3ExprDelete(pLeft);
@@ -39336,7 +39336,7 @@ STQLITE_PRIVATE Expr *sqlite3ExprOrFree(int op, Expr *pLeft, Expr *pRight, const
** The returns an expression that will code to extract the value from
** that memory location as needed.
*/
-STQLITE_PRIVATE Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
+SQLITE_PRIVATE Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
Vdbe *v = pParse->pVdbe;
Expr *p;
int depth;
@@ -39360,7 +39360,7 @@ STQLITE_PRIVATE Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
** Join two expressions using an AND operator. If either expression is
** NULL, then just return the other expression.
*/
-STQLITE_PRIVATE Expr *sqlite3ExprAnd(Expr *pLeft, Expr *pRight){
+SQLITE_PRIVATE Expr *sqlite3ExprAnd(Expr *pLeft, Expr *pRight){
if( pLeft==0 ){
return pRight;
}else if( pRight==0 ){
@@ -39374,7 +39374,7 @@ STQLITE_PRIVATE Expr *sqlite3ExprAnd(Expr *pLeft, Expr *pRight){
** Set the Expr.span field of the given expression to span all
** text between the two given tokens.
*/
-STQLITE_PRIVATE void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){
+SQLITE_PRIVATE void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){
assert( pRight!=0 );
assert( pLeft!=0 );
if( !sqlite3MallocFailed() && pRight->z && pLeft->z ){
@@ -39392,7 +39392,7 @@ STQLITE_PRIVATE void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){
** Construct a new expression node for a function with multiple
** arguments.
*/
-STQLITE_PRIVATE Expr *sqlite3ExprFunction(ExprList *pList, Token *pToken){
+SQLITE_PRIVATE Expr *sqlite3ExprFunction(ExprList *pList, Token *pToken){
Expr *pNew;
assert( pToken );
pNew = sqliteMalloc( sizeof(Expr) );
@@ -39426,7 +39426,7 @@ STQLITE_PRIVATE Expr *sqlite3ExprFunction(ExprList *pList, Token *pToken){
** instance of the wildcard, the next sequenial variable number is
** assigned.
*/
-STQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
+SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
Token *pToken;
if( pExpr==0 ) return;
pToken = &pExpr->token;
@@ -39441,9 +39441,9 @@ STQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
** use it as the variable number */
int i;
pExpr->iTable = i = atoi((char*)&pToken->z[1]);
- if( i<1 || i>STQLITE_MAX_VARIABLE_NUMBER ){
+ if( i<1 || i>SQLITE_MAX_VARIABLE_NUMBER ){
sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d",
- STQLITE_MAX_VARIABLE_NUMBER);
+ SQLITE_MAX_VARIABLE_NUMBER);
}
if( i>pParse->nVar ){
pParse->nVar = i;
@@ -39477,7 +39477,7 @@ STQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
}
}
}
- if( !pParse->nErr && pParse->nVar>STQLITE_MAX_VARIABLE_NUMBER ){
+ if( !pParse->nErr && pParse->nVar>SQLITE_MAX_VARIABLE_NUMBER ){
sqlite3ErrorMsg(pParse, "too many SQL variables");
}
}
@@ -39485,7 +39485,7 @@ STQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
/*
** Recursively delete an expression tree.
*/
-STQLITE_PRIVATE void sqlite3ExprDelete(Expr *p){
+SQLITE_PRIVATE void sqlite3ExprDelete(Expr *p){
if( p==0 ) return;
if( p->span.dyn ) sqliteFree((char*)p->span.z);
if( p->token.dyn ) sqliteFree((char*)p->token.z);
@@ -39500,7 +39500,7 @@ STQLITE_PRIVATE void sqlite3ExprDelete(Expr *p){
** The Expr.token field might be a string literal that is quoted.
** If so, remove the quotation marks.
*/
-STQLITE_PRIVATE void sqlite3DequoteExpr(Expr *p){
+SQLITE_PRIVATE void sqlite3DequoteExpr(Expr *p){
if( ExprHasAnyProperty(p, EP_Dequoted) ){
return;
}
@@ -39524,7 +39524,7 @@ STQLITE_PRIVATE void sqlite3DequoteExpr(Expr *p){
**
** Any tables that the SrcList might point to are not duplicated.
*/
-STQLITE_PRIVATE Expr *sqlite3ExprDup(Expr *p){
+SQLITE_PRIVATE Expr *sqlite3ExprDup(Expr *p){
Expr *pNew;
if( p==0 ) return 0;
pNew = sqliteMallocRaw( sizeof(*p) );
@@ -39543,7 +39543,7 @@ STQLITE_PRIVATE Expr *sqlite3ExprDup(Expr *p){
pNew->pSelect = sqlite3SelectDup(p->pSelect);
return pNew;
}
-STQLITE_PRIVATE void sqlite3TokenCopy(Token *pTo, Token *pFrom){
+SQLITE_PRIVATE void sqlite3TokenCopy(Token *pTo, Token *pFrom){
if( pTo->dyn ) sqliteFree((char*)pTo->z);
if( pFrom->z ){
pTo->n = pFrom->n;
@@ -39553,7 +39553,7 @@ STQLITE_PRIVATE void sqlite3TokenCopy(Token *pTo, Token *pFrom){
pTo->z = 0;
}
}
-STQLITE_PRIVATE ExprList *sqlite3ExprListDup(ExprList *p){
+SQLITE_PRIVATE ExprList *sqlite3ExprListDup(ExprList *p){
ExprList *pNew;
struct ExprList_item *pItem, *pOldItem;
int i;
@@ -39593,9 +39593,9 @@ STQLITE_PRIVATE ExprList *sqlite3ExprListDup(ExprList *p){
** sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes
** called with a NULL argument.
*/
-#if !defined(STQLITE_OMIT_VIEW) || !defined(STQLITE_OMIT_TRIGGER) \
- || !defined(STQLITE_OMIT_SUBTQUERY)
-STQLITE_PRIVATE SrcList *sqlite3SrcListDup(SrcList *p){
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER) \
+ || !defined(SQLITE_OMIT_SUBTQUERY)
+SQLITE_PRIVATE SrcList *sqlite3SrcListDup(SrcList *p){
SrcList *pNew;
int i;
int nByte;
@@ -39625,7 +39625,7 @@ STQLITE_PRIVATE SrcList *sqlite3SrcListDup(SrcList *p){
}
return pNew;
}
-STQLITE_PRIVATE IdList *sqlite3IdListDup(IdList *p){
+SQLITE_PRIVATE IdList *sqlite3IdListDup(IdList *p){
IdList *pNew;
int i;
if( p==0 ) return 0;
@@ -39645,7 +39645,7 @@ STQLITE_PRIVATE IdList *sqlite3IdListDup(IdList *p){
}
return pNew;
}
-STQLITE_PRIVATE Select *sqlite3SelectDup(Select *p){
+SQLITE_PRIVATE Select *sqlite3SelectDup(Select *p){
Select *pNew;
if( p==0 ) return 0;
pNew = sqliteMallocRaw( sizeof(*p) );
@@ -39674,7 +39674,7 @@ STQLITE_PRIVATE Select *sqlite3SelectDup(Select *p){
return pNew;
}
#else
-STQLITE_PRIVATE Select *sqlite3SelectDup(Select *p){
+SQLITE_PRIVATE Select *sqlite3SelectDup(Select *p){
assert( p==0 );
return 0;
}
@@ -39685,7 +39685,7 @@ STQLITE_PRIVATE Select *sqlite3SelectDup(Select *p){
** Add a new element to the end of an expression list. If pList is
** initially NULL, then create a new expression list.
*/
-STQLITE_PRIVATE ExprList *sqlite3ExprListAppend(ExprList *pList, Expr *pExpr, Token *pName){
+SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(ExprList *pList, Expr *pExpr, Token *pName){
if( pList==0 ){
pList = sqliteMalloc( sizeof(ExprList) );
if( pList==0 ){
@@ -39723,7 +39723,7 @@ no_mem:
** If the expression list pEList contains more than iLimit elements,
** leave an error message in pParse.
*/
-STQLITE_PRIVATE void sqlite3ExprListCheckLength(
+SQLITE_PRIVATE void sqlite3ExprListCheckLength(
Parse *pParse,
ExprList *pEList,
int iLimit,
@@ -39735,7 +39735,7 @@ STQLITE_PRIVATE void sqlite3ExprListCheckLength(
}
-#if STQLITE_MAX_EXPR_DEPTH>0
+#if SQLITE_MAX_EXPR_DEPTH>0
/* The following three functions, heightOfExpr(), heightOfExprList()
** and heightOfSelect(), are used to determine the maximum height
** of any expression tree referenced by the structure passed as the
@@ -39780,7 +39780,7 @@ static void heightOfSelect(Select *p, int *pnHeight){
** has a height equal to the maximum height of any other
** referenced Expr plus one.
*/
-STQLITE_PRIVATE void sqlite3ExprSetHeight(Expr *p){
+SQLITE_PRIVATE void sqlite3ExprSetHeight(Expr *p){
int nHeight = 0;
heightOfExpr(p->pLeft, &nHeight);
heightOfExpr(p->pRight, &nHeight);
@@ -39793,7 +39793,7 @@ STQLITE_PRIVATE void sqlite3ExprSetHeight(Expr *p){
** Return the maximum height of any expression tree referenced
** by the select statement passed as an argument.
*/
-STQLITE_PRIVATE int sqlite3SelectExprHeight(Select *p){
+SQLITE_PRIVATE int sqlite3SelectExprHeight(Select *p){
int nHeight = 0;
heightOfSelect(p, &nHeight);
return nHeight;
@@ -39803,7 +39803,7 @@ STQLITE_PRIVATE int sqlite3SelectExprHeight(Select *p){
/*
** Delete an entire expression list.
*/
-STQLITE_PRIVATE void sqlite3ExprListDelete(ExprList *pList){
+SQLITE_PRIVATE void sqlite3ExprListDelete(ExprList *pList){
int i;
struct ExprList_item *pItem;
if( pList==0 ) return;
@@ -39909,7 +39909,7 @@ static int exprNodeIsConstant(void *pArg, Expr *pExpr){
case TK_DOT:
case TK_AGG_FUNCTION:
case TK_AGG_COLUMN:
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
case TK_SELECT:
case TK_EXISTS:
#endif
@@ -39933,7 +39933,7 @@ static int exprNodeIsConstant(void *pArg, Expr *pExpr){
** is considered a variable but a single-quoted string (ex: 'abc') is
** a constant.
*/
-STQLITE_PRIVATE int sqlite3ExprIsConstant(Expr *p){
+SQLITE_PRIVATE int sqlite3ExprIsConstant(Expr *p){
int isConst = 1;
walkExprTree(p, exprNodeIsConstant, &isConst);
return isConst;
@@ -39945,7 +39945,7 @@ STQLITE_PRIVATE int sqlite3ExprIsConstant(Expr *p){
** Return 0 if it involves variables or function calls or terms from
** an ON or USING clause.
*/
-STQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr *p){
+SQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr *p){
int isConst = 3;
walkExprTree(p, exprNodeIsConstant, &isConst);
return isConst!=0;
@@ -39960,7 +39960,7 @@ STQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr *p){
** is considered a variable but a single-quoted string (ex: 'abc') is
** a constant.
*/
-STQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr *p){
+SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr *p){
int isConst = 2;
walkExprTree(p, exprNodeIsConstant, &isConst);
return isConst!=0;
@@ -39972,7 +39972,7 @@ STQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr *p){
** in *pValue. If the expression is not an integer or if it is too big
** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.
*/
-STQLITE_PRIVATE int sqlite3ExprIsInteger(Expr *p, int *pValue){
+SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr *p, int *pValue){
switch( p->op ){
case TK_INTEGER: {
if( sqlite3GetInt32((char*)p->token.z, pValue) ){
@@ -39999,7 +39999,7 @@ STQLITE_PRIVATE int sqlite3ExprIsInteger(Expr *p, int *pValue){
/*
** Return TRUE if the given string is a row-id column name.
*/
-STQLITE_PRIVATE int sqlite3IsRowid(const char *z){
+SQLITE_PRIVATE int sqlite3IsRowid(const char *z){
if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1;
if( sqlite3StrICmp(z, "ROWID")==0 ) return 1;
if( sqlite3StrICmp(z, "OID")==0 ) return 1;
@@ -40130,7 +40130,7 @@ static int lookupName(
}
}
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/* If we have not already resolved the name, then maybe
** it is a new.* or old.* trigger argument reference
*/
@@ -40168,7 +40168,7 @@ static int lookupName(
}
}
}
-#endif /* !defined(STQLITE_OMIT_TRIGGER) */
+#endif /* !defined(SQLITE_OMIT_TRIGGER) */
/*
** Perhaps the name is a reference to the ROWID
@@ -40176,7 +40176,7 @@ static int lookupName(
if( cnt==0 && cntTab==1 && sqlite3IsRowid(zCol) ){
cnt = 1;
pExpr->iColumn = -1;
- pExpr->affinity = STQLITE_AFF_INTEGER;
+ pExpr->affinity = SQLITE_AFF_INTEGER;
}
/*
@@ -40406,11 +40406,11 @@ static int nameResolverStep(void *pArg, Expr *pExpr){
}else{
is_agg = pDef->xFunc==0;
}
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
if( pDef ){
- auth = sqlite3AuthCheck(pParse, STQLITE_FUNCTION, 0, pDef->zName, 0);
- if( auth!=STQLITE_OK ){
- if( auth==STQLITE_DENY ){
+ auth = sqlite3AuthCheck(pParse, SQLITE_FUNCTION, 0, pDef->zName, 0);
+ if( auth!=SQLITE_OK ){
+ if( auth==SQLITE_DENY ){
sqlite3ErrorMsg(pParse, "not authorized to use function: %s",
pDef->zName);
pNC->nErr++;
@@ -40446,14 +40446,14 @@ static int nameResolverStep(void *pArg, Expr *pExpr){
*/
return is_agg;
}
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
case TK_SELECT:
case TK_EXISTS:
#endif
case TK_IN: {
if( pExpr->pSelect ){
int nRef = pNC->nRef;
-#ifndef STQLITE_OMIT_CHECK
+#ifndef SQLITE_OMIT_CHECK
if( pNC->isCheck ){
sqlite3ErrorMsg(pParse,"subqueries prohibited in CHECK constraints");
}
@@ -40466,7 +40466,7 @@ static int nameResolverStep(void *pArg, Expr *pExpr){
}
break;
}
-#ifndef STQLITE_OMIT_CHECK
+#ifndef SQLITE_OMIT_CHECK
case TK_VARIABLE: {
if( pNC->isCheck ){
sqlite3ErrorMsg(pParse,"parameters prohibited in CHECK constraints");
@@ -40499,17 +40499,17 @@ static int nameResolverStep(void *pArg, Expr *pExpr){
** If the expression contains aggregate functions then set the EP_Agg
** property on the expression.
*/
-STQLITE_PRIVATE int sqlite3ExprResolveNames(
+SQLITE_PRIVATE int sqlite3ExprResolveNames(
NameContext *pNC, /* Namespace to resolve expressions in. */
Expr *pExpr /* The expression to be analyzed. */
){
int savedHasAgg;
if( pExpr==0 ) return 0;
-#if STQLITE_MAX_EXPR_DEPTH>0
- if( (pExpr->nHeight+pNC->pParse->nHeight)>STQLITE_MAX_EXPR_DEPTH ){
+#if SQLITE_MAX_EXPR_DEPTH>0
+ if( (pExpr->nHeight+pNC->pParse->nHeight)>SQLITE_MAX_EXPR_DEPTH ){
sqlite3ErrorMsg(pNC->pParse,
"Expression tree is too large (maximum depth %d)",
- STQLITE_MAX_EXPR_DEPTH
+ SQLITE_MAX_EXPR_DEPTH
);
return 1;
}
@@ -40518,7 +40518,7 @@ STQLITE_PRIVATE int sqlite3ExprResolveNames(
savedHasAgg = pNC->hasAgg;
pNC->hasAgg = 0;
walkExprTree(pExpr, nameResolverStep, pNC);
-#if STQLITE_MAX_EXPR_DEPTH>0
+#if SQLITE_MAX_EXPR_DEPTH>0
pNC->pParse->nHeight -= pExpr->nHeight;
#endif
if( pNC->nErr>0 ){
@@ -40555,8 +40555,8 @@ struct QueryCoder {
** The pExpr parameter describes the expression that contains the IN
** operator or subquery.
*/
-#ifndef STQLITE_OMIT_SUBTQUERY
-STQLITE_PRIVATE void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
+#ifndef SQLITE_OMIT_SUBTQUERY
+SQLITE_PRIVATE void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
int testAddr = 0; /* One-time test address */
Vdbe *v = sqlite3GetVdbe(pParse);
if( v==0 ) return;
@@ -40637,7 +40637,7 @@ STQLITE_PRIVATE void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
struct ExprList_item *pItem;
if( !affinity ){
- affinity = STQLITE_AFF_NONE;
+ affinity = SQLITE_AFF_NONE;
}
keyInfo.aColl[0] = pExpr->pLeft->pColl;
@@ -40702,7 +40702,7 @@ STQLITE_PRIVATE void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
return;
}
-#endif /* STQLITE_OMIT_SUBTQUERY */
+#endif /* SQLITE_OMIT_SUBTQUERY */
/*
** Generate an instruction that will put the integer describe by
@@ -40729,7 +40729,7 @@ static void codeInteger(Vdbe *v, const char *z, int n){
** is an open cursor to pTab in iTable. If iColumn<0 then
** code is generated that extracts the rowid.
*/
-STQLITE_PRIVATE void sqlite3ExprCodeGetColumn(Vdbe *v, Table *pTab, int iColumn, int iTable){
+SQLITE_PRIVATE void sqlite3ExprCodeGetColumn(Vdbe *v, Table *pTab, int iColumn, int iTable){
if( iColumn<0 ){
int op = (pTab && IsVirtual(pTab)) ? OP_VRowid : OP_Rowid;
sqlite3VdbeAddOp(v, op, iTable, 0);
@@ -40739,8 +40739,8 @@ STQLITE_PRIVATE void sqlite3ExprCodeGetColumn(Vdbe *v, Table *pTab, int iColumn,
int op = IsVirtual(pTab) ? OP_VColumn : OP_Column;
sqlite3VdbeAddOp(v, op, iTable, iColumn);
sqlite3ColumnDefault(v, pTab, iColumn);
-#ifndef STQLITE_OMIT_FLOATING_POINT
- if( pTab->aCol[iColumn].affinity==STQLITE_AFF_REAL ){
+#ifndef SQLITE_OMIT_FLOATING_POINT
+ if( pTab->aCol[iColumn].affinity==SQLITE_AFF_REAL ){
sqlite3VdbeAddOp(v, OP_RealAffinity, 0, 0);
}
#endif
@@ -40757,7 +40757,7 @@ STQLITE_PRIVATE void sqlite3ExprCodeGetColumn(Vdbe *v, Table *pTab, int iColumn,
** the make process cause these values to align. Assert()s in the code
** below verify that the numbers are aligned correctly.
*/
-STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
+SQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
Vdbe *v = pParse->pVdbe;
int op;
int stackChng = 1; /* Amount of change to stack depth */
@@ -40808,7 +40808,7 @@ STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
sqlite3VdbeAddOp(v, OP_Null, 0, 0);
break;
}
-#ifndef STQLITE_OMIT_BLOB_LITERAL
+#ifndef SQLITE_OMIT_BLOB_LITERAL
case TK_BLOB: {
int n;
const char *z;
@@ -40834,23 +40834,23 @@ STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
sqlite3VdbeAddOp(v, OP_MemLoad, pExpr->iTable, 0);
break;
}
-#ifndef STQLITE_OMIT_CAST
+#ifndef SQLITE_OMIT_CAST
case TK_CAST: {
/* Expressions of the form: CAST(pLeft AS token) */
int aff, to_op;
sqlite3ExprCode(pParse, pExpr->pLeft);
aff = sqlite3AffinityType(&pExpr->token);
- to_op = aff - STQLITE_AFF_TEXT + OP_ToText;
- assert( to_op==OP_ToText || aff!=STQLITE_AFF_TEXT );
- assert( to_op==OP_ToBlob || aff!=STQLITE_AFF_NONE );
- assert( to_op==OP_ToNumeric || aff!=STQLITE_AFF_NUMERIC );
- assert( to_op==OP_ToInt || aff!=STQLITE_AFF_INTEGER );
- assert( to_op==OP_ToReal || aff!=STQLITE_AFF_REAL );
+ to_op = aff - SQLITE_AFF_TEXT + OP_ToText;
+ assert( to_op==OP_ToText || aff!=SQLITE_AFF_TEXT );
+ assert( to_op==OP_ToBlob || aff!=SQLITE_AFF_NONE );
+ assert( to_op==OP_ToNumeric || aff!=SQLITE_AFF_NUMERIC );
+ assert( to_op==OP_ToInt || aff!=SQLITE_AFF_INTEGER );
+ assert( to_op==OP_ToReal || aff!=SQLITE_AFF_REAL );
sqlite3VdbeAddOp(v, to_op, 0, 0);
stackChng = 0;
break;
}
-#endif /* STQLITE_OMIT_CAST */
+#endif /* SQLITE_OMIT_CAST */
case TK_LT:
case TK_LE:
case TK_GT:
@@ -40962,7 +40962,7 @@ STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
pDef = sqlite3FindFunction(pParse->db, zId, nId, nExpr, enc, 0);
assert( pDef!=0 );
nExpr = sqlite3ExprCodeExprList(pParse, pList);
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Possibly overload the function if the first argument is
** a virtual table column.
**
@@ -40997,7 +40997,7 @@ STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
stackChng = 1-nExpr;
break;
}
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
case TK_EXISTS:
case TK_SELECT: {
if( pExpr->iColumn==0 ){
@@ -41102,7 +41102,7 @@ STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
sqlite3VdbeResolveLabel(v, expr_end_label);
break;
}
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
case TK_RAISE: {
if( !pParse->trigStack ){
sqlite3ErrorMsg(pParse,
@@ -41114,7 +41114,7 @@ STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
pExpr->iColumn == OE_Abort ||
pExpr->iColumn == OE_Fail );
sqlite3DequoteExpr(pExpr);
- sqlite3VdbeOp3(v, OP_Halt, STQLITE_CONSTRAINT, pExpr->iColumn,
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->iColumn,
(char*)pExpr->token.z, pExpr->token.n);
} else {
assert( pExpr->iColumn == OE_Ignore );
@@ -41134,7 +41134,7 @@ STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
}
}
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/*
** Generate code that evalutes the given expression and leaves the result
** on the stack. See also sqlite3ExprCode().
@@ -41145,7 +41145,7 @@ STQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
** not cached. If the expression is cached, its result is stored in a
** memory location.
*/
-STQLITE_PRIVATE void sqlite3ExprCodeAndCache(Parse *pParse, Expr *pExpr){
+SQLITE_PRIVATE void sqlite3ExprCodeAndCache(Parse *pParse, Expr *pExpr){
Vdbe *v = pParse->pVdbe;
int iMem;
int addr1, addr2;
@@ -41167,7 +41167,7 @@ STQLITE_PRIVATE void sqlite3ExprCodeAndCache(Parse *pParse, Expr *pExpr){
**
** Return the number of elements pushed onto the stack.
*/
-STQLITE_PRIVATE int sqlite3ExprCodeExprList(
+SQLITE_PRIVATE int sqlite3ExprCodeExprList(
Parse *pParse, /* Parsing context */
ExprList *pList /* The expression list to be coded */
){
@@ -41195,7 +41195,7 @@ STQLITE_PRIVATE int sqlite3ExprCodeExprList(
** the make process cause these values to align. Assert()s in the code
** below verify that the numbers are aligned correctly.
*/
-STQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
+SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
Vdbe *v = pParse->pVdbe;
int op = 0;
int ckOffset = pParse->ckOffset;
@@ -41284,7 +41284,7 @@ STQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int
** If the expression evaluates to NULL (neither true nor false) then
** jump if jumpIfNull is true or fall through if jumpIfNull is false.
*/
-STQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
+SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
Vdbe *v = pParse->pVdbe;
int op = 0;
int ckOffset = pParse->ckOffset;
@@ -41401,7 +41401,7 @@ STQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, in
** just might result in some slightly slower code. But returning
** an incorrect TRUE could lead to a malfunction.
*/
-STQLITE_PRIVATE int sqlite3ExprCompare(Expr *pA, Expr *pB){
+SQLITE_PRIVATE int sqlite3ExprCompare(Expr *pA, Expr *pB){
int i;
if( pA==0||pB==0 ){
return pB==pA;
@@ -41611,7 +41611,7 @@ static int analyzeAggregate(void *pArg, Expr *pExpr){
** If errors are seen, leave an error message in zErrMsg and return
** the number of errors.
*/
-STQLITE_PRIVATE int sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){
+SQLITE_PRIVATE int sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){
int nErr = pNC->pParse->nErr;
walkExprTree(pExpr, analyzeAggregate, pNC);
return pNC->pParse->nErr - nErr;
@@ -41623,7 +41623,7 @@ STQLITE_PRIVATE int sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){
**
** If an error is found, the analysis is cut short.
*/
-STQLITE_PRIVATE int sqlite3ExprAnalyzeAggList(NameContext *pNC, ExprList *pList){
+SQLITE_PRIVATE int sqlite3ExprAnalyzeAggList(NameContext *pNC, ExprList *pList){
struct ExprList_item *pItem;
int i;
int nErr = 0;
@@ -41658,7 +41658,7 @@ STQLITE_PRIVATE int sqlite3ExprAnalyzeAggList(NameContext *pNC, ExprList *pList)
** The code in this file only exists if we are not omitting the
** ALTER TABLE logic from the build.
*/
-#ifndef STQLITE_OMIT_ALTERTABLE
+#ifndef SQLITE_OMIT_ALTERTABLE
/*
@@ -41719,7 +41719,7 @@ static void renameTableFunc(
}
}
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/* This function is used by SQL generated to implement the
** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER
** statement. The second is a table name. The table name in the CREATE
@@ -41791,19 +41791,19 @@ static void renameTriggerFunc(
sqlite3_result_text(context, zRet, -1, sqlite3FreeX);
}
}
-#endif /* !STQLITE_OMIT_TRIGGER */
+#endif /* !SQLITE_OMIT_TRIGGER */
/*
** Register built-in functions used to help implement ALTER TABLE
*/
-STQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3 *db){
+SQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3 *db){
static const struct {
char *zName;
signed char nArg;
void (*xFunc)(sqlite3_context*,int,sqlite3_value **);
} aFuncs[] = {
{ "sqlite_rename_table", 2, renameTableFunc},
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
{ "sqlite_rename_trigger", 2, renameTriggerFunc},
#endif
};
@@ -41811,7 +41811,7 @@ STQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3 *db){
for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
sqlite3CreateFunc(db, aFuncs[i].zName, aFuncs[i].nArg,
- STQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0);
+ SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0);
}
}
@@ -41860,7 +41860,7 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
Vdbe *v;
char *zWhere;
int iDb; /* Index of database containing pTab */
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
Trigger *pTrig;
#endif
@@ -41869,7 +41869,7 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
assert( iDb>=0 );
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/* Drop any table triggers from the internal schema. */
for(pTrig=pTab->pTrigger; pTrig; pTrig=pTrig->pNext){
int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
@@ -41886,9 +41886,9 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
if( !zWhere ) return;
sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0, zWhere, P3_DYNAMIC);
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/* Now, if the table is not stored in the temp database, reload any temp
- ** triggers. Don't use IN(...) in case STQLITE_OMIT_SUBTQUERY is defined.
+ ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBTQUERY is defined.
*/
if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){
sqlite3VdbeOp3(v, OP_ParseSchema, 1, 0, zWhere, P3_DYNAMIC);
@@ -41900,7 +41900,7 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy"
** command.
*/
-STQLITE_PRIVATE void sqlite3AlterRenameTable(
+SQLITE_PRIVATE void sqlite3AlterRenameTable(
Parse *pParse, /* Parser context. */
SrcList *pSrc, /* The table to rename. */
Token *pName /* The new table name. */
@@ -41913,7 +41913,7 @@ STQLITE_PRIVATE void sqlite3AlterRenameTable(
int nTabName; /* Number of UTF-8 characters in zTabName */
const char *zTabName; /* Original name of the table */
Vdbe *v;
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
char *zWhere = 0; /* Where clause to locate temp triggers */
#endif
int isVirtualRename = 0; /* True if this is a v-table with an xRename() */
@@ -41946,18 +41946,18 @@ STQLITE_PRIVATE void sqlite3AlterRenameTable(
sqlite3ErrorMsg(pParse, "table %s may not be altered", pTab->zName);
goto exit_rename_table;
}
- if( STQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
goto exit_rename_table;
}
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
/* Invoke the authorization callback. */
- if( sqlite3AuthCheck(pParse, STQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
goto exit_rename_table;
}
#endif
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
goto exit_rename_table;
}
@@ -41981,9 +41981,9 @@ STQLITE_PRIVATE void sqlite3AlterRenameTable(
/* If this is a virtual table, invoke the xRename() function if
** one is defined. The xRename() callback will modify the names
** of any resources used by the v-table implementation (including other
- ** STQLite tables) that are identified by the name of the virtual table.
+ ** SQLite tables) that are identified by the name of the virtual table.
*/
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( isVirtualRename ){
sqlite3VdbeOp3(v, OP_String8, 0, 0, zName, 0);
sqlite3VdbeOp3(v, OP_VRename, 0, 0, (const char*)pTab->pVtab, P3_VTAB);
@@ -41997,7 +41997,7 @@ STQLITE_PRIVATE void sqlite3AlterRenameTable(
/* Modify the sqlite_master table to use the new table name. */
sqlite3NestedParse(pParse,
"UPDATE %Q.%s SET "
-#ifdef STQLITE_OMIT_TRIGGER
+#ifdef SQLITE_OMIT_TRIGGER
"sql = sqlite_rename_table(sql, %Q), "
#else
"sql = CASE "
@@ -42013,13 +42013,13 @@ STQLITE_PRIVATE void sqlite3AlterRenameTable(
"WHERE tbl_name=%Q AND "
"(type='table' OR type='index' OR type='trigger');",
zDb, SCHEMA_TABLE(iDb), zName, zName, zName,
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
zName,
#endif
zName, nTabName, zTabName
);
-#ifndef STQLITE_OMIT_AUTOINCREMENT
+#ifndef SQLITE_OMIT_AUTOINCREMENT
/* If the sqlite_sequence table exists in this database, then update
** it with the new table name.
*/
@@ -42030,7 +42030,7 @@ STQLITE_PRIVATE void sqlite3AlterRenameTable(
}
#endif
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/* If there are TEMP triggers on this table, modify the sqlite_temp_master
** table. Don't do this if the table being ALTERed is itself located in
** the temp database.
@@ -42062,7 +42062,7 @@ exit_rename_table:
** The Table structure pParse->pNewTable was extended to include
** the new column during parsing.
*/
-STQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
+SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
Table *pNew; /* Copy of pParse->pNewTable */
Table *pTab; /* Table being altered */
int iDb; /* Database number */
@@ -42084,9 +42084,9 @@ STQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
pTab = sqlite3FindTable(pParse->db, zTab, zDb);
assert( pTab );
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
/* Invoke the authorization callback. */
- if( sqlite3AuthCheck(pParse, STQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
return;
}
#endif
@@ -42122,7 +42122,7 @@ STQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
*/
if( pDflt ){
sqlite3_value *pVal;
- if( sqlite3ValueFromExpr(pDflt, STQLITE_UTF8, STQLITE_AFF_NONE, &pVal) ){
+ if( sqlite3ValueFromExpr(pDflt, SQLITE_UTF8, SQLITE_AFF_NONE, &pVal) ){
/* malloc() has failed */
return;
}
@@ -42175,7 +42175,7 @@ STQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
** Routine sqlite3AlterFinishAddColumn() will be called to complete
** coding the "ALTER TABLE ... ADD" statement.
*/
-STQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
+SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
Table *pNew;
Table *pTab;
Vdbe *v;
@@ -42189,7 +42189,7 @@ STQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
pTab = sqlite3LocateTable(pParse, pSrc->a[0].zName, pSrc->a[0].zDatabase);
if( !pTab ) goto exit_begin_add_column;
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( IsVirtual(pTab) ){
sqlite3ErrorMsg(pParse, "virtual tables may not be altered");
goto exit_begin_add_column;
@@ -42243,7 +42243,7 @@ exit_begin_add_column:
sqlite3SrcListDelete(pSrc);
return;
}
-#endif /* STQLITE_ALTER_TABLE */
+#endif /* SQLITE_ALTER_TABLE */
/************** End of alter.c ***********************************************/
/************** Begin file analyze.c *****************************************/
@@ -42262,7 +42262,7 @@ exit_begin_add_column:
**
** @(#) $Id: analyze.c,v 1.19 2007/06/20 13:37:31 drh Exp $
*/
-#ifndef STQLITE_OMIT_ANALYZE
+#ifndef SQLITE_OMIT_ANALYZE
/*
** This routine generates code that opens the sqlite_stat1 table on cursor
@@ -42351,8 +42351,8 @@ static void analyzeOneTable(
iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
assert( iDb>=0 );
-#ifndef STQLITE_OMIT_AUTHORIZATION
- if( sqlite3AuthCheck(pParse, STQLITE_ANALYZE, pTab->zName, 0,
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0,
pParse->db->aDb[iDb].zName ) ){
return;
}
@@ -42526,7 +42526,7 @@ static void analyzeTable(Parse *pParse, Table *pTab){
** Form 2 analyzes all indices the single database named.
** Form 3 analyzes all indices associated with the named table.
*/
-STQLITE_PRIVATE void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){
+SQLITE_PRIVATE void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){
sqlite3 *db = pParse->db;
int iDb;
int i;
@@ -42536,7 +42536,7 @@ STQLITE_PRIVATE void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2)
/* Read the database schema. If an error occurs, leave an error message
** and code in pParse and return NULL. */
- if( STQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
return;
}
@@ -42624,7 +42624,7 @@ static int analysisLoader(void *pData, int argc, char **argv, char **azNotUsed){
/*
** Load the content of the sqlite_stat1 table into the index hash tables.
*/
-STQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
+SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
analysisInfo sInfo;
HashElem *i;
char *zSql;
@@ -42640,7 +42640,7 @@ STQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
sInfo.db = db;
sInfo.zDatabase = db->aDb[iDb].zName;
if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)==0 ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
@@ -42655,7 +42655,7 @@ STQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
}
-#endif /* STQLITE_OMIT_ANALYZE */
+#endif /* SQLITE_OMIT_ANALYZE */
/************** End of analyze.c *********************************************/
/************** Begin file attach.c ******************************************/
@@ -42675,7 +42675,7 @@ STQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
** $Id: attach.c,v 1.60 2007/05/09 20:31:30 drh Exp $
*/
-#ifndef STQLITE_OMIT_ATTACH
+#ifndef SQLITE_OMIT_ATTACH
/*
** Resolve an expression that was part of an ATTACH or DETACH statement. This
** is slightly different from resolving a normal SQL expression, because simple
@@ -42696,13 +42696,13 @@ STQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
*/
static int resolveAttachExpr(NameContext *pName, Expr *pExpr)
{
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
if( pExpr ){
if( pExpr->op!=TK_ID ){
rc = sqlite3ExprResolveNames(pName, pExpr);
- if( rc==STQLITE_OK && !sqlite3ExprIsConstant(pExpr) ){
+ if( rc==SQLITE_OK && !sqlite3ExprIsConstant(pExpr) ){
sqlite3ErrorMsg(pName->pParse, "invalid name: \"%T\"", &pExpr->span);
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
}else{
pExpr->op = TK_STRING;
@@ -42747,10 +42747,10 @@ static void attachFunc(
** * Transaction currently open
** * Specified database name already being used.
*/
- if( db->nDb>=STQLITE_MAX_ATTACHED+2 ){
+ if( db->nDb>=SQLITE_MAX_ATTACHED+2 ){
sqlite3_snprintf(
sizeof(zErr), zErr, "too many attached databases - max %d",
- STQLITE_MAX_ATTACHED
+ SQLITE_MAX_ATTACHED
);
goto attach_error;
}
@@ -42790,11 +42790,11 @@ static void attachFunc(
** it to obtain the database schema. At this point the schema may
** or may not be initialised.
*/
- rc = sqlite3BtreeFactory(db, zFile, 0, STQLITE_DEFAULT_CACHE_SIZE, &aNew->pBt);
- if( rc==STQLITE_OK ){
+ rc = sqlite3BtreeFactory(db, zFile, 0, SQLITE_DEFAULT_CACHE_SIZE, &aNew->pBt);
+ if( rc==SQLITE_OK ){
aNew->pSchema = sqlite3SchemaGet(aNew->pBt);
if( !aNew->pSchema ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
}else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
sqlite3_snprintf(sizeof(zErr), zErr,
"attached databases must use the same text encoding as main database");
@@ -42805,7 +42805,7 @@ static void attachFunc(
aNew->zName = sqliteStrDup(zName);
aNew->safety_level = 3;
-#if STQLITE_HAS_CODEC
+#if SQLITE_HAS_CODEC
{
extern int sqlite3CodecAttach(sqlite3*, int, const void*, int);
extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
@@ -42813,20 +42813,20 @@ static void attachFunc(
char *zKey;
int t = sqlite3_value_type(argv[2]);
switch( t ){
- case STQLITE_INTEGER:
- case STQLITE_FLOAT:
+ case SQLITE_INTEGER:
+ case SQLITE_FLOAT:
zErrDyn = sqliteStrDup("Invalid key value");
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
break;
- case STQLITE_TEXT:
- case STQLITE_BLOB:
+ case SQLITE_TEXT:
+ case SQLITE_BLOB:
nKey = sqlite3_value_bytes(argv[2]);
zKey = (char *)sqlite3_value_blob(argv[2]);
sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
break;
- case STQLITE_NULL:
+ case SQLITE_NULL:
/* No key specified. Use the key from the main database */
sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
@@ -42840,7 +42840,7 @@ static void attachFunc(
** remove the entry from the db->aDb[] array. i.e. put everything back the way
** we found it.
*/
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqlite3SafetyOn(db);
rc = sqlite3Init(db, &zErrDyn);
sqlite3SafetyOff(db);
@@ -42855,7 +42855,7 @@ static void attachFunc(
}
sqlite3ResetInternalSchema(db, 0);
db->nDb = iDb;
- if( rc==STQLITE_NOMEM ){
+ if( rc==SQLITE_NOMEM ){
sqlite3FailedMalloc();
sqlite3_snprintf(sizeof(zErr),zErr, "out of memory");
}else{
@@ -42937,7 +42937,7 @@ detach_error:
*/
static void codeAttach(
Parse *pParse, /* The parser context */
- int type, /* Either STQLITE_ATTACH or STQLITE_DETACH */
+ int type, /* Either SQLITE_ATTACH or SQLITE_DETACH */
const char *zFunc, /* Either "sqlite_attach" or "sqlite_detach */
int nFunc, /* Number of args to pass to zFunc */
Expr *pAuthArg, /* Expression to pass to authorization callback */
@@ -42951,7 +42951,7 @@ static void codeAttach(
FuncDef *pFunc;
sqlite3* db = pParse->db;
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
assert( sqlite3MallocFailed() || pAuthArg );
if( pAuthArg ){
char *zAuthArg = sqlite3NameFromToken(&pAuthArg->span);
@@ -42960,19 +42960,19 @@ static void codeAttach(
}
rc = sqlite3AuthCheck(pParse, type, zAuthArg, 0, 0);
sqliteFree(zAuthArg);
- if(rc!=STQLITE_OK ){
+ if(rc!=SQLITE_OK ){
goto attach_end;
}
}
-#endif /* STQLITE_OMIT_AUTHORIZATION */
+#endif /* SQLITE_OMIT_AUTHORIZATION */
memset(&sName, 0, sizeof(NameContext));
sName.pParse = pParse;
if(
- STQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
- STQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
- STQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))
+ SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
+ SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
+ SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))
){
pParse->nErr++;
goto attach_end;
@@ -42986,14 +42986,14 @@ static void codeAttach(
assert( v || sqlite3MallocFailed() );
if( v ){
sqlite3VdbeAddOp(v, OP_Function, 0, nFunc);
- pFunc = sqlite3FindFunction(db, zFunc, strlen(zFunc), nFunc, STQLITE_UTF8,0);
+ pFunc = sqlite3FindFunction(db, zFunc, strlen(zFunc), nFunc, SQLITE_UTF8,0);
sqlite3VdbeChangeP3(v, -1, (char *)pFunc, P3_FUNCDEF);
/* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this
** statement only). For DETACH, set it to false (expire all existing
** statements).
*/
- sqlite3VdbeAddOp(v, OP_Expire, (type==STQLITE_ATTACH), 0);
+ sqlite3VdbeAddOp(v, OP_Expire, (type==SQLITE_ATTACH), 0);
}
attach_end:
@@ -43007,8 +43007,8 @@ attach_end:
**
** DETACH pDbname
*/
-STQLITE_PRIVATE void sqlite3Detach(Parse *pParse, Expr *pDbname){
- codeAttach(pParse, STQLITE_DETACH, "sqlite_detach", 1, pDbname, 0, 0, pDbname);
+SQLITE_PRIVATE void sqlite3Detach(Parse *pParse, Expr *pDbname){
+ codeAttach(pParse, SQLITE_DETACH, "sqlite_detach", 1, pDbname, 0, 0, pDbname);
}
/*
@@ -43016,17 +43016,17 @@ STQLITE_PRIVATE void sqlite3Detach(Parse *pParse, Expr *pDbname){
**
** ATTACH p AS pDbname KEY pKey
*/
-STQLITE_PRIVATE void sqlite3Attach(Parse *pParse, Expr *p, Expr *pDbname, Expr *pKey){
- codeAttach(pParse, STQLITE_ATTACH, "sqlite_attach", 3, p, p, pDbname, pKey);
+SQLITE_PRIVATE void sqlite3Attach(Parse *pParse, Expr *p, Expr *pDbname, Expr *pKey){
+ codeAttach(pParse, SQLITE_ATTACH, "sqlite_attach", 3, p, p, pDbname, pKey);
}
-#endif /* STQLITE_OMIT_ATTACH */
+#endif /* SQLITE_OMIT_ATTACH */
/*
** Register the functions sqlite_attach and sqlite_detach.
*/
-STQLITE_PRIVATE void sqlite3AttachFunctions(sqlite3 *db){
-#ifndef STQLITE_OMIT_ATTACH
- static const int enc = STQLITE_UTF8;
+SQLITE_PRIVATE void sqlite3AttachFunctions(sqlite3 *db){
+#ifndef SQLITE_OMIT_ATTACH
+ static const int enc = SQLITE_UTF8;
sqlite3CreateFunc(db, "sqlite_attach", 3, enc, db, attachFunc, 0, 0);
sqlite3CreateFunc(db, "sqlite_detach", 1, enc, db, detachFunc, 0, 0);
#endif
@@ -43039,7 +43039,7 @@ STQLITE_PRIVATE void sqlite3AttachFunctions(sqlite3 *db){
** The return value indicates whether or not fixation is required. TRUE
** means we do need to fix the database references, FALSE means we do not.
*/
-STQLITE_PRIVATE int sqlite3FixInit(
+SQLITE_PRIVATE int sqlite3FixInit(
DbFixer *pFix, /* The fixer to be initialized */
Parse *pParse, /* Error messages will be written here */
int iDb, /* This is the database that must be used */
@@ -43072,7 +43072,7 @@ STQLITE_PRIVATE int sqlite3FixInit(
** pParse->zErrMsg and these routines return non-zero. If everything
** checks out, these routines return 0.
*/
-STQLITE_PRIVATE int sqlite3FixSrcList(
+SQLITE_PRIVATE int sqlite3FixSrcList(
DbFixer *pFix, /* Context of the fixation */
SrcList *pList /* The Source list to check and modify */
){
@@ -43091,15 +43091,15 @@ STQLITE_PRIVATE int sqlite3FixSrcList(
pFix->zType, pFix->pName, pItem->zDatabase);
return 1;
}
-#if !defined(STQLITE_OMIT_VIEW) || !defined(STQLITE_OMIT_TRIGGER)
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)
if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1;
if( sqlite3FixExpr(pFix, pItem->pOn) ) return 1;
#endif
}
return 0;
}
-#if !defined(STQLITE_OMIT_VIEW) || !defined(STQLITE_OMIT_TRIGGER)
-STQLITE_PRIVATE int sqlite3FixSelect(
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)
+SQLITE_PRIVATE int sqlite3FixSelect(
DbFixer *pFix, /* Context of the fixation */
Select *pSelect /* The SELECT statement to be fixed to one database */
){
@@ -43120,7 +43120,7 @@ STQLITE_PRIVATE int sqlite3FixSelect(
}
return 0;
}
-STQLITE_PRIVATE int sqlite3FixExpr(
+SQLITE_PRIVATE int sqlite3FixExpr(
DbFixer *pFix, /* Context of the fixation */
Expr *pExpr /* The expression to be fixed to one database */
){
@@ -43138,7 +43138,7 @@ STQLITE_PRIVATE int sqlite3FixExpr(
}
return 0;
}
-STQLITE_PRIVATE int sqlite3FixExprList(
+SQLITE_PRIVATE int sqlite3FixExprList(
DbFixer *pFix, /* Context of the fixation */
ExprList *pList /* The expression to be fixed to one database */
){
@@ -43154,8 +43154,8 @@ STQLITE_PRIVATE int sqlite3FixExprList(
}
#endif
-#ifndef STQLITE_OMIT_TRIGGER
-STQLITE_PRIVATE int sqlite3FixTriggerStep(
+#ifndef SQLITE_OMIT_TRIGGER
+SQLITE_PRIVATE int sqlite3FixTriggerStep(
DbFixer *pFix, /* Context of the fixation */
TriggerStep *pStep /* The trigger step be fixed to one database */
){
@@ -43191,7 +43191,7 @@ STQLITE_PRIVATE int sqlite3FixTriggerStep(
** This file contains code used to implement the sqlite3_set_authorizer()
** API. This facility is an optional feature of the library. Embedded
** systems that do not need this facility may omit it by recompiling
-** the library with -DSTQLITE_OMIT_AUTHORIZATION=1
+** the library with -DSQLITE_OMIT_AUTHORIZATION=1
**
** $Id: auth.c,v 1.26 2007/05/14 11:34:47 drh Exp $
*/
@@ -43200,7 +43200,7 @@ STQLITE_PRIVATE int sqlite3FixTriggerStep(
** All of the code in this file may be omitted by defining a single
** macro.
*/
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
/*
** Set or clear the access authorization function.
@@ -43211,36 +43211,36 @@ STQLITE_PRIVATE int sqlite3FixTriggerStep(
** is a copy of the 3rd argument to this routine. The second argument
** to the auth function is one of these constants:
**
-** STQLITE_CREATE_INDEX
-** STQLITE_CREATE_TABLE
-** STQLITE_CREATE_TEMP_INDEX
-** STQLITE_CREATE_TEMP_TABLE
-** STQLITE_CREATE_TEMP_TRIGGER
-** STQLITE_CREATE_TEMP_VIEW
-** STQLITE_CREATE_TRIGGER
-** STQLITE_CREATE_VIEW
-** STQLITE_DELETE
-** STQLITE_DROP_INDEX
-** STQLITE_DROP_TABLE
-** STQLITE_DROP_TEMP_INDEX
-** STQLITE_DROP_TEMP_TABLE
-** STQLITE_DROP_TEMP_TRIGGER
-** STQLITE_DROP_TEMP_VIEW
-** STQLITE_DROP_TRIGGER
-** STQLITE_DROP_VIEW
-** STQLITE_INSERT
-** STQLITE_PRAGMA
-** STQLITE_READ
-** STQLITE_SELECT
-** STQLITE_TRANSACTION
-** STQLITE_UPDATE
+** SQLITE_CREATE_INDEX
+** SQLITE_CREATE_TABLE
+** SQLITE_CREATE_TEMP_INDEX
+** SQLITE_CREATE_TEMP_TABLE
+** SQLITE_CREATE_TEMP_TRIGGER
+** SQLITE_CREATE_TEMP_VIEW
+** SQLITE_CREATE_TRIGGER
+** SQLITE_CREATE_VIEW
+** SQLITE_DELETE
+** SQLITE_DROP_INDEX
+** SQLITE_DROP_TABLE
+** SQLITE_DROP_TEMP_INDEX
+** SQLITE_DROP_TEMP_TABLE
+** SQLITE_DROP_TEMP_TRIGGER
+** SQLITE_DROP_TEMP_VIEW
+** SQLITE_DROP_TRIGGER
+** SQLITE_DROP_VIEW
+** SQLITE_INSERT
+** SQLITE_PRAGMA
+** SQLITE_READ
+** SQLITE_SELECT
+** SQLITE_TRANSACTION
+** SQLITE_UPDATE
**
** The third and fourth arguments to the auth function are the name of
** the table and the column that are being accessed. The auth function
-** should return either STQLITE_OK, STQLITE_DENY, or STQLITE_IGNORE. If
-** STQLITE_OK is returned, it means that access is allowed. STQLITE_DENY
+** should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If
+** SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY
** means that the SQL statement will never-run - the sqlite3_exec() call
-** will return with an error. STQLITE_IGNORE means that the SQL statement
+** will return with an error. SQLITE_IGNORE means that the SQL statement
** should run but attempts to read the specified column will return NULL
** and attempts to write the column will be ignored.
**
@@ -43255,7 +43255,7 @@ int sqlite3_set_authorizer(
db->xAuth = xAuth;
db->pAuthArg = pArg;
sqlite3ExpirePreparedStatements(db);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -43264,9 +43264,9 @@ int sqlite3_set_authorizer(
*/
static void sqliteAuthBadReturnCode(Parse *pParse, int rc){
sqlite3ErrorMsg(pParse, "illegal return value (%d) from the "
- "authorization function - should be STQLITE_OK, STQLITE_IGNORE, "
- "or STQLITE_DENY", rc);
- pParse->rc = STQLITE_ERROR;
+ "authorization function - should be SQLITE_OK, SQLITE_IGNORE, "
+ "or SQLITE_DENY", rc);
+ pParse->rc = SQLITE_ERROR;
}
/*
@@ -43274,11 +43274,11 @@ static void sqliteAuthBadReturnCode(Parse *pParse, int rc){
** is in pTabList or else it is the NEW or OLD table of a trigger.
** Check to see if it is OK to read this particular column.
**
-** If the auth function returns STQLITE_IGNORE, change the TK_COLUMN
-** instruction into a TK_NULL. If the auth function returns STQLITE_DENY,
+** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN
+** instruction into a TK_NULL. If the auth function returns SQLITE_DENY,
** then generate an error.
*/
-STQLITE_PRIVATE void sqlite3AuthRead(
+SQLITE_PRIVATE void sqlite3AuthRead(
Parse *pParse, /* The parser context */
Expr *pExpr, /* The expression to check authorization on */
SrcList *pTabList /* All table that pExpr might refer to */
@@ -43326,30 +43326,30 @@ STQLITE_PRIVATE void sqlite3AuthRead(
}
assert( iDb>=0 && iDb<db->nDb );
zDBase = db->aDb[iDb].zName;
- rc = db->xAuth(db->pAuthArg, STQLITE_READ, pTab->zName, zCol, zDBase,
+ rc = db->xAuth(db->pAuthArg, SQLITE_READ, pTab->zName, zCol, zDBase,
pParse->zAuthContext);
- if( rc==STQLITE_IGNORE ){
+ if( rc==SQLITE_IGNORE ){
pExpr->op = TK_NULL;
- }else if( rc==STQLITE_DENY ){
+ }else if( rc==SQLITE_DENY ){
if( db->nDb>2 || iDb!=0 ){
sqlite3ErrorMsg(pParse, "access to %s.%s.%s is prohibited",
zDBase, pTab->zName, zCol);
}else{
sqlite3ErrorMsg(pParse, "access to %s.%s is prohibited",pTab->zName,zCol);
}
- pParse->rc = STQLITE_AUTH;
- }else if( rc!=STQLITE_OK ){
+ pParse->rc = SQLITE_AUTH;
+ }else if( rc!=SQLITE_OK ){
sqliteAuthBadReturnCode(pParse, rc);
}
}
/*
** Do an authorization check using the code and arguments given. Return
-** either STQLITE_OK (zero) or STQLITE_IGNORE or STQLITE_DENY. If STQLITE_DENY
+** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY
** is returned, then the error count and error message in pParse are
** modified appropriately.
*/
-STQLITE_PRIVATE int sqlite3AuthCheck(
+SQLITE_PRIVATE int sqlite3AuthCheck(
Parse *pParse,
int code,
const char *zArg1,
@@ -43363,18 +43363,18 @@ STQLITE_PRIVATE int sqlite3AuthCheck(
** or if the parser is being invoked from within sqlite3_declare_vtab.
*/
if( db->init.busy || IN_DECLARE_VTAB ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( db->xAuth==0 ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext);
- if( rc==STQLITE_DENY ){
+ if( rc==SQLITE_DENY ){
sqlite3ErrorMsg(pParse, "not authorized");
- pParse->rc = STQLITE_AUTH;
- }else if( rc!=STQLITE_OK && rc!=STQLITE_IGNORE ){
- rc = STQLITE_DENY;
+ pParse->rc = SQLITE_AUTH;
+ }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
+ rc = SQLITE_DENY;
sqliteAuthBadReturnCode(pParse, rc);
}
return rc;
@@ -43385,7 +43385,7 @@ STQLITE_PRIVATE int sqlite3AuthCheck(
** zArg3 argument to authorization callbacks will be zContext until
** popped. Or if pParse==0, this routine is a no-op.
*/
-STQLITE_PRIVATE void sqlite3AuthContextPush(
+SQLITE_PRIVATE void sqlite3AuthContextPush(
Parse *pParse,
AuthContext *pContext,
const char *zContext
@@ -43401,14 +43401,14 @@ STQLITE_PRIVATE void sqlite3AuthContextPush(
** Pop an authorization context that was previously pushed
** by sqlite3AuthContextPush
*/
-STQLITE_PRIVATE void sqlite3AuthContextPop(AuthContext *pContext){
+SQLITE_PRIVATE void sqlite3AuthContextPop(AuthContext *pContext){
if( pContext->pParse ){
pContext->pParse->zAuthContext = pContext->zAuthContext;
pContext->pParse = 0;
}
}
-#endif /* STQLITE_OMIT_AUTHORIZATION */
+#endif /* SQLITE_OMIT_AUTHORIZATION */
/************** End of auth.c ************************************************/
/************** Begin file build.c *******************************************/
@@ -43423,7 +43423,7 @@ STQLITE_PRIVATE void sqlite3AuthContextPop(AuthContext *pContext){
** May you share freely, never taking more than you give.
**
*************************************************************************
-** This file contains C code routines that are called by the STQLite parser
+** This file contains C code routines that are called by the SQLite parser
** when syntax rules are reduced. The routines in this file handle the
** following kinds of SQL syntax:
**
@@ -43443,12 +43443,12 @@ STQLITE_PRIVATE void sqlite3AuthContextPop(AuthContext *pContext){
** This routine is called when a new SQL statement is beginning to
** be parsed. Initialize the pParse structure as needed.
*/
-STQLITE_PRIVATE void sqlite3BeginParse(Parse *pParse, int explainFlag){
+SQLITE_PRIVATE void sqlite3BeginParse(Parse *pParse, int explainFlag){
pParse->explain = explainFlag;
pParse->nVar = 0;
}
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
/*
** The TableLock structure is only used by the sqlite3TableLock() and
** codeTableLocks() functions.
@@ -43470,7 +43470,7 @@ struct TableLock {
** code to make the lock occur is generated by a later call to
** codeTableLocks() which occurs during sqlite3FinishCoding().
*/
-STQLITE_PRIVATE void sqlite3TableLock(
+SQLITE_PRIVATE void sqlite3TableLock(
Parse *pParse, /* Parsing context */
int iDb, /* Index of the database containing the table to lock */
int iTab, /* Root page number of the table to be locked */
@@ -43540,15 +43540,15 @@ static void codeTableLocks(Parse *pParse){
** Note that if an error occurred, it might be the case that
** no VDBE code was generated.
*/
-STQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){
+SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){
sqlite3 *db;
Vdbe *v;
if( sqlite3MallocFailed() ) return;
if( pParse->nested ) return;
if( !pParse->pVdbe ){
- if( pParse->rc==STQLITE_OK && pParse->nErr ){
- pParse->rc = STQLITE_ERROR;
+ if( pParse->rc==SQLITE_OK && pParse->nErr ){
+ pParse->rc = SQLITE_ERROR;
return;
}
}
@@ -43576,7 +43576,7 @@ STQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){
sqlite3VdbeAddOp(v, OP_Transaction, iDb, (mask & pParse->writeMask)!=0);
sqlite3VdbeAddOp(v, OP_VerifyCookie, iDb, pParse->cookieValue[iDb]);
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( pParse->pVirtualLock ){
char *vtab = (char *)pParse->pVirtualLock->pVtab;
sqlite3VdbeOp3(v, OP_VBegin, 0, 0, vtab, P3_VTAB);
@@ -43591,7 +43591,7 @@ STQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){
sqlite3VdbeAddOp(v, OP_Goto, 0, pParse->cookieGoto);
}
-#ifndef STQLITE_OMIT_TRACE
+#ifndef SQLITE_OMIT_TRACE
/* Add a No-op that contains the complete text of the compiled SQL
** statement as its P3 argument. This does not change the functionality
** of the program.
@@ -43599,23 +43599,23 @@ STQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){
** This is used to implement sqlite3_trace().
*/
sqlite3VdbeOp3(v, OP_Noop, 0, 0, pParse->zSql, pParse->zTail-pParse->zSql);
-#endif /* STQLITE_OMIT_TRACE */
+#endif /* SQLITE_OMIT_TRACE */
}
/* Get the VDBE program ready for execution
*/
if( v && pParse->nErr==0 && !sqlite3MallocFailed() ){
-#ifdef STQLITE_DEBUG
- FILE *trace = (db->flags & STQLITE_VdbeTrace)!=0 ? stdout : 0;
+#ifdef SQLITE_DEBUG
+ FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0;
sqlite3VdbeTrace(v, trace);
#endif
sqlite3VdbeMakeReady(v, pParse->nVar, pParse->nMem+3,
pParse->nTab+3, pParse->explain);
- pParse->rc = STQLITE_DONE;
+ pParse->rc = SQLITE_DONE;
pParse->colNamesSet = 0;
- }else if( pParse->rc==STQLITE_OK ){
- pParse->rc = STQLITE_ERROR;
+ }else if( pParse->rc==SQLITE_OK ){
+ pParse->rc = SQLITE_ERROR;
}
pParse->nTab = 0;
pParse->nMem = 0;
@@ -43634,10 +43634,10 @@ STQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){
** outermost parser.
**
** Not everything is nestable. This facility is designed to permit
-** INSERT, UPDATE, and DELETE operations against STQLITE_MASTER. Use
+** INSERT, UPDATE, and DELETE operations against SQLITE_MASTER. Use
** care if you decide to try to use this routine for some other purposes.
*/
-STQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
+SQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
va_list ap;
char *zSql;
# define SAVE_SZ (sizeof(Parse) - offsetof(Parse,nVar))
@@ -43672,7 +43672,7 @@ STQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...)
**
** See also sqlite3LocateTable().
*/
-STQLITE_PRIVATE Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){
+SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){
Table *p = 0;
int i;
assert( zName!=0 );
@@ -43695,12 +43695,12 @@ STQLITE_PRIVATE Table *sqlite3FindTable(sqlite3 *db, const char *zName, const ch
** routine leaves an error message in pParse->zErrMsg where
** sqlite3FindTable() does not.
*/
-STQLITE_PRIVATE Table *sqlite3LocateTable(Parse *pParse, const char *zName, const char *zDbase){
+SQLITE_PRIVATE Table *sqlite3LocateTable(Parse *pParse, const char *zName, const char *zDbase){
Table *p;
/* Read the database schema. If an error occurs, leave an error message
** and code in pParse and return NULL. */
- if( STQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
return 0;
}
@@ -43728,7 +43728,7 @@ STQLITE_PRIVATE Table *sqlite3LocateTable(Parse *pParse, const char *zName, cons
** TEMP first, then MAIN, then any auxiliary databases added
** using the ATTACH command.
*/
-STQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){
+SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){
Index *p = 0;
int i;
for(i=OMIT_TEMPDB; i<db->nDb; i++){
@@ -43775,7 +43775,7 @@ static void sqliteDeleteIndex(Index *p){
** the index hash table and free all memory structures associated
** with the index.
*/
-STQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){
Index *pIndex;
int len;
Hash *pHash = &db->aDb[iDb].pSchema->idxHash;
@@ -43794,7 +43794,7 @@ STQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const cha
}
freeIndex(pIndex);
}
- db->flags |= STQLITE_InternChanges;
+ db->flags |= SQLITE_InternChanges;
}
/*
@@ -43808,7 +43808,7 @@ STQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const cha
** files. If iDb>=2 then reset the internal schema for only the
** single file indicated.
*/
-STQLITE_PRIVATE void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){
+SQLITE_PRIVATE void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){
int i, j;
assert( iDb>=0 && iDb<db->nDb );
@@ -43820,7 +43820,7 @@ STQLITE_PRIVATE void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){
if( iDb>0 ) return;
}
assert( iDb==0 );
- db->flags &= ~STQLITE_InternChanges;
+ db->flags &= ~SQLITE_InternChanges;
/* If one or more of the auxiliary database files has been closed,
** then remove them from the auxiliary database list. We take the
@@ -43859,8 +43859,8 @@ STQLITE_PRIVATE void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){
/*
** This routine is called when a commit occurs.
*/
-STQLITE_PRIVATE void sqlite3CommitInternalChanges(sqlite3 *db){
- db->flags &= ~STQLITE_InternChanges;
+SQLITE_PRIVATE void sqlite3CommitInternalChanges(sqlite3 *db){
+ db->flags &= ~SQLITE_InternChanges;
}
/*
@@ -43893,7 +43893,7 @@ static void sqliteResetColumnNames(Table *pTable){
** memory structures of the indices and foreign keys associated with
** the table.
*/
-STQLITE_PRIVATE void sqlite3DeleteTable(Table *pTable){
+SQLITE_PRIVATE void sqlite3DeleteTable(Table *pTable){
Index *pIndex, *pNext;
FKey *pFKey, *pNextFKey;
@@ -43914,7 +43914,7 @@ STQLITE_PRIVATE void sqlite3DeleteTable(Table *pTable){
sqliteDeleteIndex(pIndex);
}
-#ifndef STQLITE_OMIT_FOREIGN_KEY
+#ifndef SQLITE_OMIT_FOREIGN_KEY
/* Delete all foreign keys associated with this table. The keys
** should have already been unlinked from the pSchema->aFKey hash table
*/
@@ -43932,7 +43932,7 @@ STQLITE_PRIVATE void sqlite3DeleteTable(Table *pTable){
sqliteFree(pTable->zName);
sqliteFree(pTable->zColAff);
sqlite3SelectDelete(pTable->pSelect);
-#ifndef STQLITE_OMIT_CHECK
+#ifndef SQLITE_OMIT_CHECK
sqlite3ExprDelete(pTable->pCheck);
#endif
sqlite3VtabClear(pTable);
@@ -43943,7 +43943,7 @@ STQLITE_PRIVATE void sqlite3DeleteTable(Table *pTable){
** Unlink the given table from the hash tables and the delete the
** table structure with all its indices and foreign keys.
*/
-STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){
Table *p;
FKey *pF1, *pF2;
Db *pDb;
@@ -43954,7 +43954,7 @@ STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const cha
pDb = &db->aDb[iDb];
p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, strlen(zTabName)+1,0);
if( p ){
-#ifndef STQLITE_OMIT_FOREIGN_KEY
+#ifndef SQLITE_OMIT_FOREIGN_KEY
for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){
int nTo = strlen(pF1->zTo) + 1;
pF2 = sqlite3HashFind(&pDb->pSchema->aFKey, pF1->zTo, nTo);
@@ -43970,7 +43970,7 @@ STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const cha
#endif
sqlite3DeleteTable(p);
}
- db->flags |= STQLITE_InternChanges;
+ db->flags |= SQLITE_InternChanges;
}
/*
@@ -43983,7 +43983,7 @@ STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const cha
** are not \000 terminated and are not persistent. The returned string
** is \000 terminated and is persistent.
*/
-STQLITE_PRIVATE char *sqlite3NameFromToken(Token *pName){
+SQLITE_PRIVATE char *sqlite3NameFromToken(Token *pName){
char *zName;
if( pName ){
zName = sqliteStrNDup((char*)pName->z, pName->n);
@@ -43998,7 +43998,7 @@ STQLITE_PRIVATE char *sqlite3NameFromToken(Token *pName){
** Open the sqlite_master table stored in database number iDb for
** writing. The table is opened using cursor 0.
*/
-STQLITE_PRIVATE void sqlite3OpenMasterTable(Parse *p, int iDb){
+SQLITE_PRIVATE void sqlite3OpenMasterTable(Parse *p, int iDb){
Vdbe *v = sqlite3GetVdbe(p);
sqlite3TableLock(p, iDb, MASTER_ROOT, 1, SCHEMA_TABLE(iDb));
sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
@@ -44012,7 +44012,7 @@ STQLITE_PRIVATE void sqlite3OpenMasterTable(Parse *p, int iDb){
** index of the named database in db->aDb[], or -1 if the named db
** does not exist.
*/
-STQLITE_PRIVATE int sqlite3FindDb(sqlite3 *db, Token *pName){
+SQLITE_PRIVATE int sqlite3FindDb(sqlite3 *db, Token *pName){
int i = -1; /* Database number */
int n; /* Number of characters in the name */
Db *pDb; /* A database whose name space is being searched */
@@ -44048,7 +44048,7 @@ STQLITE_PRIVATE int sqlite3FindDb(sqlite3 *db, Token *pName){
** pName2) that stores the unqualified table name. The index of the
** database "xxx" is returned.
*/
-STQLITE_PRIVATE int sqlite3TwoPartName(
+SQLITE_PRIVATE int sqlite3TwoPartName(
Parse *pParse, /* Parsing and code generating context */
Token *pName1, /* The "xxx" in the name "xxx.yyy" or "xxx" */
Token *pName2, /* The "yyy" in the name "xxx.yyy" */
@@ -44081,14 +44081,14 @@ STQLITE_PRIVATE int sqlite3TwoPartName(
** "sqlite_" (in upper, lower or mixed case). This portion of the namespace
** is reserved for internal use.
*/
-STQLITE_PRIVATE int sqlite3CheckObjectName(Parse *pParse, const char *zName){
+SQLITE_PRIVATE int sqlite3CheckObjectName(Parse *pParse, const char *zName){
if( !pParse->db->init.busy && pParse->nested==0
- && (pParse->db->flags & STQLITE_WriteSchema)==0
+ && (pParse->db->flags & SQLITE_WriteSchema)==0
&& 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){
sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s", zName);
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -44107,7 +44107,7 @@ STQLITE_PRIVATE int sqlite3CheckObjectName(Parse *pParse, const char *zName){
** At the end of the CREATE TABLE statement, the sqlite3EndTable() routine
** is called to complete the construction of the new table record.
*/
-STQLITE_PRIVATE void sqlite3StartTable(
+SQLITE_PRIVATE void sqlite3StartTable(
Parse *pParse, /* Parser context */
Token *pName1, /* First part of the name of the table or view */
Token *pName2, /* Second part of the name of the table or view */
@@ -44152,29 +44152,29 @@ STQLITE_PRIVATE void sqlite3StartTable(
pParse->sNameToken = *pName;
zName = sqlite3NameFromToken(pName);
if( zName==0 ) return;
- if( STQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
goto begin_table_error;
}
if( db->init.iDb==1 ) isTemp = 1;
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
assert( (isTemp & 1)==isTemp );
{
int code;
char *zDb = db->aDb[iDb].zName;
- if( sqlite3AuthCheck(pParse, STQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){
goto begin_table_error;
}
if( isView ){
if( !OMIT_TEMPDB && isTemp ){
- code = STQLITE_CREATE_TEMP_VIEW;
+ code = SQLITE_CREATE_TEMP_VIEW;
}else{
- code = STQLITE_CREATE_VIEW;
+ code = SQLITE_CREATE_VIEW;
}
}else{
if( !OMIT_TEMPDB && isTemp ){
- code = STQLITE_CREATE_TEMP_TABLE;
+ code = SQLITE_CREATE_TEMP_TABLE;
}else{
- code = STQLITE_CREATE_TABLE;
+ code = SQLITE_CREATE_TABLE;
}
}
if( !isVirtual && sqlite3AuthCheck(pParse, code, zName, 0, zDb) ){
@@ -44191,7 +44191,7 @@ STQLITE_PRIVATE void sqlite3StartTable(
** collisions.
*/
if( !IN_DECLARE_VTAB ){
- if( STQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
goto begin_table_error;
}
pTable = sqlite3FindTable(db, zName, db->aDb[iDb].zName);
@@ -44209,7 +44209,7 @@ STQLITE_PRIVATE void sqlite3StartTable(
pTable = sqliteMalloc( sizeof(Table) );
if( pTable==0 ){
- pParse->rc = STQLITE_NOMEM;
+ pParse->rc = SQLITE_NOMEM;
pParse->nErr++;
goto begin_table_error;
}
@@ -44224,14 +44224,14 @@ STQLITE_PRIVATE void sqlite3StartTable(
** then record a pointer to this table in the main database structure
** so that INSERT can find the table easily.
*/
-#ifndef STQLITE_OMIT_AUTOINCREMENT
+#ifndef SQLITE_OMIT_AUTOINCREMENT
if( !pParse->nested && strcmp(zName, "sqlite_sequence")==0 ){
pTable->pSchema->pSeqTab = pTable;
}
#endif
/* Begin generating the code that will insert the table record into
- ** the STQLITE_MASTER table. Note in particular that we must go ahead
+ ** the SQLITE_MASTER table. Note in particular that we must go ahead
** and allocate the record number for the table entry now. Before any
** PRIMARY KEY or UNITQUE keywords are parsed. Those keywords will cause
** indices to be created and the table record must come before the
@@ -44243,7 +44243,7 @@ STQLITE_PRIVATE void sqlite3StartTable(
int fileFormat;
sqlite3BeginWriteOperation(pParse, 0, iDb);
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( isVirtual ){
sqlite3VdbeAddOp(v, OP_VBegin, 0, 0);
}
@@ -44255,8 +44255,8 @@ STQLITE_PRIVATE void sqlite3StartTable(
sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 1); /* file_format */
lbl = sqlite3VdbeMakeLabel(v);
sqlite3VdbeAddOp(v, OP_If, 0, lbl);
- fileFormat = (db->flags & STQLITE_LegacyFileFmt)!=0 ?
- 1 : STQLITE_MAX_FILE_FORMAT;
+ fileFormat = (db->flags & SQLITE_LegacyFileFmt)!=0 ?
+ 1 : SQLITE_MAX_FILE_FORMAT;
sqlite3VdbeAddOp(v, OP_Integer, fileFormat, 0);
sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1);
sqlite3VdbeAddOp(v, OP_Integer, ENC(db), 0);
@@ -44271,7 +44271,7 @@ STQLITE_PRIVATE void sqlite3StartTable(
** The rowid value is needed by the code that sqlite3EndTable will
** generate.
*/
-#if !defined(STQLITE_OMIT_VIEW) || !defined(STQLITE_OMIT_VIRTUALTABLE)
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)
if( isView || isVirtual ){
sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
}else
@@ -44318,13 +44318,13 @@ sqlite3UpperToLower[*(unsigned char *)(y)] \
** first to get things going. Then this routine is called for each
** column.
*/
-STQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token *pName){
+SQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token *pName){
Table *p;
int i;
char *z;
Column *pCol;
if( (p = pParse->pNewTable)==0 ) return;
- if( p->nCol+1>STQLITE_MAX_COLUMN ){
+ if( p->nCol+1>SQLITE_MAX_COLUMN ){
sqlite3ErrorMsg(pParse, "too many columns on %s", p->zName);
return;
}
@@ -44354,7 +44354,7 @@ STQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token *pName){
** 'NONE'. If there is a type specified, then sqlite3AddColumnType() will
** be called next to set pCol->affinity correctly.
*/
- pCol->affinity = STQLITE_AFF_NONE;
+ pCol->affinity = SQLITE_AFF_NONE;
p->nCol++;
}
@@ -44364,7 +44364,7 @@ STQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token *pName){
** been seen on a column. This routine sets the notNull flag on
** the column currently under construction.
*/
-STQLITE_PRIVATE void sqlite3AddNotNull(Parse *pParse, int onError){
+SQLITE_PRIVATE void sqlite3AddNotNull(Parse *pParse, int onError){
Table *p;
int i;
if( (p = pParse->pNewTable)==0 ) return;
@@ -44381,25 +44381,25 @@ STQLITE_PRIVATE void sqlite3AddNotNull(Parse *pParse, int onError){
** found, the corresponding affinity is returned. If zType contains
** more than one of the substrings, entries toward the top of
** the table take priority. For example, if zType is 'BLOBINT',
-** STQLITE_AFF_INTEGER is returned.
+** SQLITE_AFF_INTEGER is returned.
**
** Substring | Affinity
** --------------------------------
-** 'INT' | STQLITE_AFF_INTEGER
-** 'CHAR' | STQLITE_AFF_TEXT
-** 'CLOB' | STQLITE_AFF_TEXT
-** 'TEXT' | STQLITE_AFF_TEXT
-** 'BLOB' | STQLITE_AFF_NONE
-** 'REAL' | STQLITE_AFF_REAL
-** 'FLOA' | STQLITE_AFF_REAL
-** 'DOUB' | STQLITE_AFF_REAL
+** 'INT' | SQLITE_AFF_INTEGER
+** 'CHAR' | SQLITE_AFF_TEXT
+** 'CLOB' | SQLITE_AFF_TEXT
+** 'TEXT' | SQLITE_AFF_TEXT
+** 'BLOB' | SQLITE_AFF_NONE
+** 'REAL' | SQLITE_AFF_REAL
+** 'FLOA' | SQLITE_AFF_REAL
+** 'DOUB' | SQLITE_AFF_REAL
**
** If none of the substrings in the above table are found,
-** STQLITE_AFF_NUMERIC is returned.
+** SQLITE_AFF_NUMERIC is returned.
*/
-STQLITE_PRIVATE char sqlite3AffinityType(const Token *pType){
+SQLITE_PRIVATE char sqlite3AffinityType(const Token *pType){
u32 h = 0;
- char aff = STQLITE_AFF_NUMERIC;
+ char aff = SQLITE_AFF_NUMERIC;
const unsigned char *zIn = pType->z;
const unsigned char *zEnd = &pType->z[pType->n];
@@ -44407,27 +44407,27 @@ STQLITE_PRIVATE char sqlite3AffinityType(const Token *pType){
h = (h<<8) + sqlite3UpperToLower[*zIn];
zIn++;
if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){ /* CHAR */
- aff = STQLITE_AFF_TEXT;
+ aff = SQLITE_AFF_TEXT;
}else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){ /* CLOB */
- aff = STQLITE_AFF_TEXT;
+ aff = SQLITE_AFF_TEXT;
}else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){ /* TEXT */
- aff = STQLITE_AFF_TEXT;
+ aff = SQLITE_AFF_TEXT;
}else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b') /* BLOB */
- && (aff==STQLITE_AFF_NUMERIC || aff==STQLITE_AFF_REAL) ){
- aff = STQLITE_AFF_NONE;
-#ifndef STQLITE_OMIT_FLOATING_POINT
+ && (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){
+ aff = SQLITE_AFF_NONE;
+#ifndef SQLITE_OMIT_FLOATING_POINT
}else if( h==(('r'<<24)+('e'<<16)+('a'<<8)+'l') /* REAL */
- && aff==STQLITE_AFF_NUMERIC ){
- aff = STQLITE_AFF_REAL;
+ && aff==SQLITE_AFF_NUMERIC ){
+ aff = SQLITE_AFF_REAL;
}else if( h==(('f'<<24)+('l'<<16)+('o'<<8)+'a') /* FLOA */
- && aff==STQLITE_AFF_NUMERIC ){
- aff = STQLITE_AFF_REAL;
+ && aff==SQLITE_AFF_NUMERIC ){
+ aff = SQLITE_AFF_REAL;
}else if( h==(('d'<<24)+('o'<<16)+('u'<<8)+'b') /* DOUB */
- && aff==STQLITE_AFF_NUMERIC ){
- aff = STQLITE_AFF_REAL;
+ && aff==SQLITE_AFF_NUMERIC ){
+ aff = SQLITE_AFF_REAL;
#endif
}else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){ /* INT */
- aff = STQLITE_AFF_INTEGER;
+ aff = SQLITE_AFF_INTEGER;
break;
}
}
@@ -44444,7 +44444,7 @@ STQLITE_PRIVATE char sqlite3AffinityType(const Token *pType){
** that contains the typename of the column and store that string
** in zType.
*/
-STQLITE_PRIVATE void sqlite3AddColumnType(Parse *pParse, Token *pType){
+SQLITE_PRIVATE void sqlite3AddColumnType(Parse *pParse, Token *pType){
Table *p;
int i;
Column *pCol;
@@ -44468,7 +44468,7 @@ STQLITE_PRIVATE void sqlite3AddColumnType(Parse *pParse, Token *pType){
** This routine is called by the parser while in the middle of
** parsing a CREATE TABLE statement.
*/
-STQLITE_PRIVATE void sqlite3AddDefaultValue(Parse *pParse, Expr *pExpr){
+SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse *pParse, Expr *pExpr){
Table *p;
Column *pCol;
if( (p = pParse->pNewTable)!=0 ){
@@ -44506,12 +44506,12 @@ STQLITE_PRIVATE void sqlite3AddDefaultValue(Parse *pParse, Expr *pExpr){
** If the key is not an INTEGER PRIMARY KEY, then create a unique
** index for the key. No index is created for INTEGER PRIMARY KEYs.
*/
-STQLITE_PRIVATE void sqlite3AddPrimaryKey(
+SQLITE_PRIVATE void sqlite3AddPrimaryKey(
Parse *pParse, /* Parsing context */
ExprList *pList, /* List of field names to be indexed */
int onError, /* What to do with a uniqueness conflict */
int autoInc, /* True if the AUTOINCREMENT keyword is present */
- int sortOrder /* STQLITE_SO_ASC or STQLITE_SO_DESC */
+ int sortOrder /* SQLITE_SO_ASC or SQLITE_SO_DESC */
){
Table *pTab = pParse->pNewTable;
char *zType = 0;
@@ -44543,12 +44543,12 @@ STQLITE_PRIVATE void sqlite3AddPrimaryKey(
zType = pTab->aCol[iCol].zType;
}
if( zType && sqlite3StrICmp(zType, "INTEGER")==0
- && sortOrder==STQLITE_SO_ASC ){
+ && sortOrder==SQLITE_SO_ASC ){
pTab->iPKey = iCol;
pTab->keyConf = onError;
pTab->autoInc = autoInc;
}else if( autoInc ){
-#ifndef STQLITE_OMIT_AUTOINCREMENT
+#ifndef SQLITE_OMIT_AUTOINCREMENT
sqlite3ErrorMsg(pParse, "AUTOINCREMENT is only allowed on an "
"INTEGER PRIMARY KEY");
#endif
@@ -44565,11 +44565,11 @@ primary_key_exit:
/*
** Add a new CHECK constraint to the table currently under construction.
*/
-STQLITE_PRIVATE void sqlite3AddCheckConstraint(
+SQLITE_PRIVATE void sqlite3AddCheckConstraint(
Parse *pParse, /* Parsing context */
Expr *pCheckExpr /* The check expression */
){
-#ifndef STQLITE_OMIT_CHECK
+#ifndef SQLITE_OMIT_CHECK
Table *pTab = pParse->pNewTable;
if( pTab && !IN_DECLARE_VTAB ){
/* The CHECK expression must be duplicated so that tokens refer
@@ -44585,7 +44585,7 @@ STQLITE_PRIVATE void sqlite3AddCheckConstraint(
** Set the collation function of the most recently parsed table column
** to the CollSeq given.
*/
-STQLITE_PRIVATE void sqlite3AddCollateType(Parse *pParse, const char *zType, int nType){
+SQLITE_PRIVATE void sqlite3AddCollateType(Parse *pParse, const char *zType, int nType){
Table *p;
int i;
@@ -44627,7 +44627,7 @@ STQLITE_PRIVATE void sqlite3AddCollateType(Parse *pParse, const char *zType, int
** invokes the collation factory if the named collation cannot be found
** and generates an error message.
*/
-STQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName){
+SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName){
sqlite3 *db = pParse->db;
u8 enc = ENC(db);
u8 initbusy = db->init.busy;
@@ -44665,7 +44665,7 @@ STQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName,
** and the probability of hitting the same cookie value is only
** 1 chance in 2^32. So we're safe enough.
*/
-STQLITE_PRIVATE void sqlite3ChangeCookie(sqlite3 *db, Vdbe *v, int iDb){
+SQLITE_PRIVATE void sqlite3ChangeCookie(sqlite3 *db, Vdbe *v, int iDb){
sqlite3VdbeAddOp(v, OP_Integer, db->aDb[iDb].pSchema->schema_cookie+1, 0);
sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 0);
}
@@ -44781,7 +44781,7 @@ static char *createTableStmt(Table *p, int isTemp){
** "CREATE TABLE ... AS SELECT ..." statement. The column names of
** the new table will match the result set of the SELECT.
*/
-STQLITE_PRIVATE void sqlite3EndTable(
+SQLITE_PRIVATE void sqlite3EndTable(
Parse *pParse, /* Parse context */
Token *pCons, /* The ',' token after the last column defn. */
Token *pEnd, /* The final ')' token in the CREATE TABLE */
@@ -44801,7 +44801,7 @@ STQLITE_PRIVATE void sqlite3EndTable(
iDb = sqlite3SchemaToIndex(db, p->pSchema);
-#ifndef STQLITE_OMIT_CHECK
+#ifndef SQLITE_OMIT_CHECK
/* Resolve names in all CHECK constraint expressions.
*/
if( p->pCheck ){
@@ -44821,7 +44821,7 @@ STQLITE_PRIVATE void sqlite3EndTable(
return;
}
}
-#endif /* !defined(STQLITE_OMIT_CHECK) */
+#endif /* !defined(SQLITE_OMIT_CHECK) */
/* If the db->init.busy is 1 it means we are reading the SQL off the
** "sqlite_master" or "sqlite_temp_master" table on the disk.
@@ -44834,7 +44834,7 @@ STQLITE_PRIVATE void sqlite3EndTable(
}
/* If not initializing, then create a record for the new table
- ** in the STQLITE_MASTER table of the database. The record number
+ ** in the SQLITE_MASTER table of the database. The record number
** for the new table entry should already be on the stack.
**
** If this is a TEMPORARY table, write the entry into the auxiliary
@@ -44860,7 +44860,7 @@ STQLITE_PRIVATE void sqlite3EndTable(
/* A regular table */
zType = "table";
zType2 = "TABLE";
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
}else{
/* A view */
zType = "view";
@@ -44910,7 +44910,7 @@ STQLITE_PRIVATE void sqlite3EndTable(
}
/* A slot for the record has already been allocated in the
- ** STQLITE_MASTER table. We just need to update that slot with all
+ ** SQLITE_MASTER table. We just need to update that slot with all
** the information we've collected. The rowid for the preallocated
** slot is the 2nd item on the stack. The top of the stack is the
** root page for the new table (or a 0 if this is a view).
@@ -44928,7 +44928,7 @@ STQLITE_PRIVATE void sqlite3EndTable(
sqliteFree(zStmt);
sqlite3ChangeCookie(db, v, iDb);
-#ifndef STQLITE_OMIT_AUTOINCREMENT
+#ifndef SQLITE_OMIT_AUTOINCREMENT
/* Check to see if we need to create an sqlite_sequence table for
** keeping track of autoincrement keys.
*/
@@ -44960,7 +44960,7 @@ STQLITE_PRIVATE void sqlite3EndTable(
assert( p==pOld ); /* Malloc must have failed inside HashInsert() */
return;
}
-#ifndef STQLITE_OMIT_FOREIGN_KEY
+#ifndef SQLITE_OMIT_FOREIGN_KEY
for(pFKey=p->pFKey; pFKey; pFKey=pFKey->pNextFrom){
int nTo = strlen(pFKey->zTo) + 1;
pFKey->pNextTo = sqlite3HashFind(&pSchema->aFKey, pFKey->zTo, nTo);
@@ -44969,9 +44969,9 @@ STQLITE_PRIVATE void sqlite3EndTable(
#endif
pParse->pNewTable = 0;
db->nTable++;
- db->flags |= STQLITE_InternChanges;
+ db->flags |= SQLITE_InternChanges;
-#ifndef STQLITE_OMIT_ALTERTABLE
+#ifndef SQLITE_OMIT_ALTERTABLE
if( !p->pSelect ){
const char *zName = (const char *)pParse->sNameToken.z;
int nName;
@@ -44986,11 +44986,11 @@ STQLITE_PRIVATE void sqlite3EndTable(
}
}
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
/*
** The parser calls this routine in order to create a new VIEW
*/
-STQLITE_PRIVATE void sqlite3CreateView(
+SQLITE_PRIVATE void sqlite3CreateView(
Parse *pParse, /* The parsing context */
Token *pBegin, /* The CREATE token that begins the statement */
Token *pName1, /* The token that holds the name of the view */
@@ -45055,19 +45055,19 @@ STQLITE_PRIVATE void sqlite3CreateView(
sEnd.z = &z[n-1];
sEnd.n = 1;
- /* Use sqlite3EndTable() to add the view to the STQLITE_MASTER table */
+ /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */
sqlite3EndTable(pParse, 0, &sEnd, 0);
return;
}
-#endif /* STQLITE_OMIT_VIEW */
+#endif /* SQLITE_OMIT_VIEW */
-#if !defined(STQLITE_OMIT_VIEW) || !defined(STQLITE_OMIT_VIRTUALTABLE)
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)
/*
** The Table structure pTable is really a VIEW. Fill in the names of
** the columns of the view in the pTable structure. Return the number
** of errors. If an error is seen leave an error message in pParse->zErrMsg.
*/
-STQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
+SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
Table *pSelTab; /* A fake table from which we get the result set */
Select *pSel; /* Copy of the SELECT that implements the view */
int nErr = 0; /* Number of errors encountered */
@@ -45075,14 +45075,14 @@ STQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
assert( pTable );
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( sqlite3VtabCallConnect(pParse, pTable) ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
if( IsVirtual(pTable) ) return 0;
#endif
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
/* A positive nCol means the columns names for this view are
** already known.
*/
@@ -45135,12 +45135,12 @@ STQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
} else {
nErr++;
}
-#endif /* STQLITE_OMIT_VIEW */
+#endif /* SQLITE_OMIT_VIEW */
return nErr;
}
-#endif /* !defined(STQLITE_OMIT_VIEW) || !defined(STQLITE_OMIT_VIRTUALTABLE) */
+#endif /* !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) */
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
/*
** Clear the column names from every VIEW in database idx.
*/
@@ -45157,11 +45157,11 @@ static void sqliteViewResetAll(sqlite3 *db, int idx){
}
#else
# define sqliteViewResetAll(A,B)
-#endif /* STQLITE_OMIT_VIEW */
+#endif /* SQLITE_OMIT_VIEW */
/*
** This function is called by the VDBE to adjust the internal schema
-** used by STQLite when the btree layer moves a table root page. The
+** used by SQLite when the btree layer moves a table root page. The
** root-page of a table or index in database iDb has changed from iFrom
** to iTo.
**
@@ -45176,8 +45176,8 @@ static void sqliteViewResetAll(sqlite3 *db, int idx){
** rootpage==iFrom have been converted to have a rootpage of iTo
** in order to be certain that we got the right one.
*/
-#ifndef STQLITE_OMIT_AUTOVACUUM
-STQLITE_PRIVATE void sqlite3RootPageMoved(Db *pDb, int iFrom, int iTo){
+#ifndef SQLITE_OMIT_AUTOVACUUM
+SQLITE_PRIVATE void sqlite3RootPageMoved(Db *pDb, int iFrom, int iTo){
HashElem *pElem;
Hash *pHash;
@@ -45207,7 +45207,7 @@ STQLITE_PRIVATE void sqlite3RootPageMoved(Db *pDb, int iFrom, int iTo){
static void destroyRootPage(Parse *pParse, int iTable, int iDb){
Vdbe *v = sqlite3GetVdbe(pParse);
sqlite3VdbeAddOp(v, OP_Destroy, iTable, iDb);
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/* OP_Destroy pushes an integer onto the stack. If this integer
** is non-zero, then it is the root page number of a table moved to
** location iTable. The following code modifies the sqlite_master table to
@@ -45229,7 +45229,7 @@ static void destroyRootPage(Parse *pParse, int iTable, int iDb){
** is also added (this can happen with an auto-vacuum database).
*/
static void destroyTable(Parse *pParse, Table *pTab){
-#ifdef STQLITE_OMIT_AUTOVACUUM
+#ifdef SQLITE_OMIT_AUTOVACUUM
Index *pIdx;
int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
destroyRootPage(pParse, pTab->tnum, iDb);
@@ -45237,7 +45237,7 @@ static void destroyTable(Parse *pParse, Table *pTab){
destroyRootPage(pParse, pIdx->tnum, iDb);
}
#else
- /* If the database may be auto-vacuum capable (if STQLITE_OMIT_AUTOVACUUM
+ /* If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM
** is not defined), then it is important to call OP_Destroy on the
** table and index root-pages in order, starting with the numerically
** largest root-page number. This guarantees that none of the root-pages
@@ -45285,7 +45285,7 @@ static void destroyTable(Parse *pParse, Table *pTab){
** This routine is called to do the work of a DROP TABLE statement.
** pName is the name of the table to be dropped.
*/
-STQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
+SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
Table *pTab;
Vdbe *v;
sqlite3 *db = pParse->db;
@@ -45305,40 +45305,40 @@ STQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView,
}
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
assert( iDb>=0 && iDb<db->nDb );
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
{
int code;
const char *zTab = SCHEMA_TABLE(iDb);
const char *zDb = db->aDb[iDb].zName;
const char *zArg2 = 0;
- if( sqlite3AuthCheck(pParse, STQLITE_DELETE, zTab, 0, zDb)){
+ if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){
goto exit_drop_table;
}
if( isView ){
if( !OMIT_TEMPDB && iDb==1 ){
- code = STQLITE_DROP_TEMP_VIEW;
+ code = SQLITE_DROP_TEMP_VIEW;
}else{
- code = STQLITE_DROP_VIEW;
+ code = SQLITE_DROP_VIEW;
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
}else if( IsVirtual(pTab) ){
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
goto exit_drop_table;
}
- code = STQLITE_DROP_VTABLE;
+ code = SQLITE_DROP_VTABLE;
zArg2 = pTab->pMod->zName;
#endif
}else{
if( !OMIT_TEMPDB && iDb==1 ){
- code = STQLITE_DROP_TEMP_TABLE;
+ code = SQLITE_DROP_TEMP_TABLE;
}else{
- code = STQLITE_DROP_TABLE;
+ code = SQLITE_DROP_TABLE;
}
}
if( sqlite3AuthCheck(pParse, code, pTab->zName, zArg2, zDb) ){
goto exit_drop_table;
}
- if( sqlite3AuthCheck(pParse, STQLITE_DELETE, pTab->zName, 0, zDb) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
goto exit_drop_table;
}
}
@@ -45348,7 +45348,7 @@ STQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView,
goto exit_drop_table;
}
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
/* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used
** on a table.
*/
@@ -45371,7 +45371,7 @@ STQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView,
Db *pDb = &db->aDb[iDb];
sqlite3BeginWriteOperation(pParse, 0, iDb);
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( IsVirtual(pTab) ){
Vdbe *v = sqlite3GetVdbe(pParse);
if( v ){
@@ -45392,7 +45392,7 @@ STQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView,
pTrigger = pTrigger->pNext;
}
-#ifndef STQLITE_OMIT_AUTOINCREMENT
+#ifndef SQLITE_OMIT_AUTOINCREMENT
/* Remove any entries of the sqlite_sequence table associated with
** the table being dropped. This is done before the table is dropped
** at the btree level, in case the sqlite_sequence table needs to
@@ -45406,7 +45406,7 @@ STQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView,
}
#endif
- /* Drop all STQLITE_MASTER table and index entries that refer to the
+ /* Drop all SQLITE_MASTER table and index entries that refer to the
** table. The program name loops through the master table and deletes
** every row that refers to a table of the same name as the one being
** dropped. Triggers are handled seperately because a trigger can be
@@ -45420,7 +45420,7 @@ STQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView,
destroyTable(pParse, pTab);
}
- /* Remove the table entry from STQLite's internal schema and modify
+ /* Remove the table entry from SQLite's internal schema and modify
** the schema cookie.
*/
if( IsVirtual(pTab) ){
@@ -45453,14 +45453,14 @@ exit_drop_table:
** The foreign key is set for IMMEDIATE processing. A subsequent call
** to sqlite3DeferForeignKey() might change this to DEFERRED.
*/
-STQLITE_PRIVATE void sqlite3CreateForeignKey(
+SQLITE_PRIVATE void sqlite3CreateForeignKey(
Parse *pParse, /* Parsing context */
ExprList *pFromCol, /* Columns in this table that point to other table */
Token *pTo, /* Name of the other table */
ExprList *pToCol, /* Columns in the other table */
int flags /* Conflict resolution algorithms. */
){
-#ifndef STQLITE_OMIT_FOREIGN_KEY
+#ifndef SQLITE_OMIT_FOREIGN_KEY
FKey *pFKey = 0;
Table *p = pParse->pNewTable;
int nByte;
@@ -45547,7 +45547,7 @@ STQLITE_PRIVATE void sqlite3CreateForeignKey(
fk_end:
sqliteFree(pFKey);
-#endif /* !defined(STQLITE_OMIT_FOREIGN_KEY) */
+#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
sqlite3ExprListDelete(pFromCol);
sqlite3ExprListDelete(pToCol);
}
@@ -45559,8 +45559,8 @@ fk_end:
** The behavior of the most recently created foreign key is adjusted
** accordingly.
*/
-STQLITE_PRIVATE void sqlite3DeferForeignKey(Parse *pParse, int isDeferred){
-#ifndef STQLITE_OMIT_FOREIGN_KEY
+SQLITE_PRIVATE void sqlite3DeferForeignKey(Parse *pParse, int isDeferred){
+#ifndef SQLITE_OMIT_FOREIGN_KEY
Table *pTab;
FKey *pFKey;
if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return;
@@ -45589,8 +45589,8 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
KeyInfo *pKey; /* KeyInfo for index */
int iDb = sqlite3SchemaToIndex(pParse->db, pIndex->pSchema);
-#ifndef STQLITE_OMIT_AUTHORIZATION
- if( sqlite3AuthCheck(pParse, STQLITE_REINDEX, pIndex->zName, 0,
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0,
pParse->db->aDb[iDb].zName ) ){
return;
}
@@ -45621,7 +45621,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
sqlite3VdbeAddOp(v, OP_Rowid, iTab, 0);
sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
sqlite3VdbeAddOp(v, OP_IsUnique, iIdx, addr2);
- sqlite3VdbeOp3(v, OP_Halt, STQLITE_CONSTRAINT, OE_Abort,
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, OE_Abort,
"indexed columns are not unique", P3_STATIC);
assert( sqlite3MallocFailed() || addr2==sqlite3VdbeCurrentAddr(v) );
}
@@ -45644,7 +45644,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
** is a primary key or unique-constraint on the most recent column added
** to the table currently under construction.
*/
-STQLITE_PRIVATE void sqlite3CreateIndex(
+SQLITE_PRIVATE void sqlite3CreateIndex(
Parse *pParse, /* All information about this parse */
Token *pName1, /* First part of index name. May be NULL */
Token *pName2, /* Second part of index name. May be NULL */
@@ -45690,7 +45690,7 @@ STQLITE_PRIVATE void sqlite3CreateIndex(
iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName);
if( iDb<0 ) goto exit_create_index;
-#ifndef STQLITE_OMIT_TEMPDB
+#ifndef SQLITE_OMIT_TEMPDB
/* If the index name was unqualified, check if the the table
** is a temp table. If so, set the database to 1.
*/
@@ -45724,13 +45724,13 @@ STQLITE_PRIVATE void sqlite3CreateIndex(
sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
goto exit_create_index;
}
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
if( pTab->pSelect ){
sqlite3ErrorMsg(pParse, "views may not be indexed");
goto exit_create_index;
}
#endif
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( IsVirtual(pTab) ){
sqlite3ErrorMsg(pParse, "virtual tables may not be indexed");
goto exit_create_index;
@@ -45752,13 +45752,13 @@ STQLITE_PRIVATE void sqlite3CreateIndex(
*/
if( pName ){
zName = sqlite3NameFromToken(pName);
- if( STQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index;
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index;
if( zName==0 ) goto exit_create_index;
- if( STQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
goto exit_create_index;
}
if( !db->init.busy ){
- if( STQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index;
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index;
if( sqlite3FindTable(db, zName, 0)!=0 ){
sqlite3ErrorMsg(pParse, "there is already a table named %s", zName);
goto exit_create_index;
@@ -45783,14 +45783,14 @@ STQLITE_PRIVATE void sqlite3CreateIndex(
/* Check for authorization to create an index.
*/
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
{
const char *zDb = pDb->zName;
- if( sqlite3AuthCheck(pParse, STQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){
goto exit_create_index;
}
- i = STQLITE_CREATE_INDEX;
- if( !OMIT_TEMPDB && iDb==1 ) i = STQLITE_CREATE_TEMP_INDEX;
+ i = SQLITE_CREATE_INDEX;
+ if( !OMIT_TEMPDB && iDb==1 ) i = SQLITE_CREATE_TEMP_INDEX;
if( sqlite3AuthCheck(pParse, i, zName, pTab->zName, zDb) ){
goto exit_create_index;
}
@@ -45962,7 +45962,7 @@ STQLITE_PRIVATE void sqlite3CreateIndex(
assert( p==pIndex ); /* Malloc must have failed */
goto exit_create_index;
}
- db->flags |= STQLITE_InternChanges;
+ db->flags |= SQLITE_InternChanges;
if( pTblName!=0 ){
pIndex->tnum = db->init.newTnum;
}
@@ -46073,7 +46073,7 @@ exit_create_index:
** Generate code to make sure the file format number is at least minFormat.
** The generated code will increase the file format number if necessary.
*/
-STQLITE_PRIVATE void sqlite3MinimumFileFormat(Parse *pParse, int iDb, int minFormat){
+SQLITE_PRIVATE void sqlite3MinimumFileFormat(Parse *pParse, int iDb, int minFormat){
Vdbe *v;
v = sqlite3GetVdbe(pParse);
if( v ){
@@ -46103,7 +46103,7 @@ STQLITE_PRIVATE void sqlite3MinimumFileFormat(Parse *pParse, int iDb, int minFor
** how aiRowEst[] should be initialized. The numbers generated here
** are based on typical values found in actual indices.
*/
-STQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
+SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
unsigned *a = pIdx->aiRowEst;
int i;
assert( a!=0 );
@@ -46124,7 +46124,7 @@ STQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
** This routine will drop an existing named index. This routine
** implements the DROP INDEX statement.
*/
-STQLITE_PRIVATE void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists){
+SQLITE_PRIVATE void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists){
Index *pIndex;
Vdbe *v;
sqlite3 *db = pParse->db;
@@ -46134,7 +46134,7 @@ STQLITE_PRIVATE void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExist
goto exit_drop_index;
}
assert( pName->nSrc==1 );
- if( STQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
goto exit_drop_index;
}
pIndex = sqlite3FindIndex(db, pName->a[0].zName, pName->a[0].zDatabase);
@@ -46151,16 +46151,16 @@ STQLITE_PRIVATE void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExist
goto exit_drop_index;
}
iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
{
- int code = STQLITE_DROP_INDEX;
+ int code = SQLITE_DROP_INDEX;
Table *pTab = pIndex->pTable;
const char *zDb = db->aDb[iDb].zName;
const char *zTab = SCHEMA_TABLE(iDb);
- if( sqlite3AuthCheck(pParse, STQLITE_DELETE, zTab, 0, zDb) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
goto exit_drop_index;
}
- if( !OMIT_TEMPDB && iDb ) code = STQLITE_DROP_TEMP_INDEX;
+ if( !OMIT_TEMPDB && iDb ) code = SQLITE_DROP_TEMP_INDEX;
if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){
goto exit_drop_index;
}
@@ -46199,7 +46199,7 @@ exit_drop_index:
** might be the same as the pArray parameter or it might be a different
** pointer if the array was resized.
*/
-STQLITE_PRIVATE void *sqlite3ArrayAllocate(
+SQLITE_PRIVATE void *sqlite3ArrayAllocate(
void *pArray, /* Array of objects. Might be reallocated */
int szEntry, /* Size of each object in the array */
int initSize, /* Suggested initial allocation, in elements */
@@ -46233,7 +46233,7 @@ STQLITE_PRIVATE void *sqlite3ArrayAllocate(
**
** A new IdList is returned, or NULL if malloc() fails.
*/
-STQLITE_PRIVATE IdList *sqlite3IdListAppend(IdList *pList, Token *pToken){
+SQLITE_PRIVATE IdList *sqlite3IdListAppend(IdList *pList, Token *pToken){
int i;
if( pList==0 ){
pList = sqliteMalloc( sizeof(IdList) );
@@ -46259,7 +46259,7 @@ STQLITE_PRIVATE IdList *sqlite3IdListAppend(IdList *pList, Token *pToken){
/*
** Delete an IdList.
*/
-STQLITE_PRIVATE void sqlite3IdListDelete(IdList *pList){
+SQLITE_PRIVATE void sqlite3IdListDelete(IdList *pList){
int i;
if( pList==0 ) return;
for(i=0; i<pList->nId; i++){
@@ -46273,7 +46273,7 @@ STQLITE_PRIVATE void sqlite3IdListDelete(IdList *pList){
** Return the index in pList of the identifier named zId. Return -1
** if not found.
*/
-STQLITE_PRIVATE int sqlite3IdListIndex(IdList *pList, const char *zName){
+SQLITE_PRIVATE int sqlite3IdListIndex(IdList *pList, const char *zName){
int i;
if( pList==0 ) return -1;
for(i=0; i<pList->nId; i++){
@@ -46307,7 +46307,7 @@ STQLITE_PRIVATE int sqlite3IdListIndex(IdList *pList, const char *zName){
**
** Then C is the table name and B is the database name.
*/
-STQLITE_PRIVATE SrcList *sqlite3SrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){
+SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){
struct SrcList_item *pItem;
if( pList==0 ){
pList = sqliteMalloc( sizeof(SrcList) );
@@ -46346,7 +46346,7 @@ STQLITE_PRIVATE SrcList *sqlite3SrcListAppend(SrcList *pList, Token *pTable, Tok
/*
** Assign cursors to all tables in a SrcList
*/
-STQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
+SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
int i;
struct SrcList_item *pItem;
assert(pList || sqlite3MallocFailed() );
@@ -46364,7 +46364,7 @@ STQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
/*
** Delete an entire SrcList including all its substructure.
*/
-STQLITE_PRIVATE void sqlite3SrcListDelete(SrcList *pList){
+SQLITE_PRIVATE void sqlite3SrcListDelete(SrcList *pList){
int i;
struct SrcList_item *pItem;
if( pList==0 ) return;
@@ -46396,7 +46396,7 @@ STQLITE_PRIVATE void sqlite3SrcListDelete(SrcList *pList){
** Return a new SrcList which encodes is the FROM with the new
** term added.
*/
-STQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(
+SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(
SrcList *p, /* The left part of the FROM clause already seen */
Token *pTable, /* Name of the table to add to the FROM clause */
Token *pDatabase, /* Name of the database containing pTable */
@@ -46438,7 +46438,7 @@ STQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(
** in p->a[0] and p->a[1], respectively. The parser initially stores the
** operator with A. This routine shifts that operator over to B.
*/
-STQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList *p){
+SQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList *p){
if( p && p->a ){
int i;
for(i=p->nSrc-1; i>0; i--){
@@ -46451,14 +46451,14 @@ STQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList *p){
/*
** Begin a transaction
*/
-STQLITE_PRIVATE void sqlite3BeginTransaction(Parse *pParse, int type){
+SQLITE_PRIVATE void sqlite3BeginTransaction(Parse *pParse, int type){
sqlite3 *db;
Vdbe *v;
int i;
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
if( pParse->nErr || sqlite3MallocFailed() ) return;
- if( sqlite3AuthCheck(pParse, STQLITE_TRANSACTION, "BEGIN", 0, 0) ) return;
+ if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ) return;
v = sqlite3GetVdbe(pParse);
if( !v ) return;
@@ -46473,13 +46473,13 @@ STQLITE_PRIVATE void sqlite3BeginTransaction(Parse *pParse, int type){
/*
** Commit a transaction
*/
-STQLITE_PRIVATE void sqlite3CommitTransaction(Parse *pParse){
+SQLITE_PRIVATE void sqlite3CommitTransaction(Parse *pParse){
sqlite3 *db;
Vdbe *v;
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
if( pParse->nErr || sqlite3MallocFailed() ) return;
- if( sqlite3AuthCheck(pParse, STQLITE_TRANSACTION, "COMMIT", 0, 0) ) return;
+ if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ) return;
v = sqlite3GetVdbe(pParse);
if( v ){
@@ -46490,13 +46490,13 @@ STQLITE_PRIVATE void sqlite3CommitTransaction(Parse *pParse){
/*
** Rollback a transaction
*/
-STQLITE_PRIVATE void sqlite3RollbackTransaction(Parse *pParse){
+SQLITE_PRIVATE void sqlite3RollbackTransaction(Parse *pParse){
sqlite3 *db;
Vdbe *v;
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
if( pParse->nErr || sqlite3MallocFailed() ) return;
- if( sqlite3AuthCheck(pParse, STQLITE_TRANSACTION, "ROLLBACK", 0, 0) ) return;
+ if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ) return;
v = sqlite3GetVdbe(pParse);
if( v ){
@@ -46508,12 +46508,12 @@ STQLITE_PRIVATE void sqlite3RollbackTransaction(Parse *pParse){
** Make sure the TEMP database is open and available for use. Return
** the number of errors. Leave any error messages in the pParse structure.
*/
-STQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){
+SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){
sqlite3 *db = pParse->db;
if( db->aDb[1].pBt==0 && !pParse->explain ){
- int rc = sqlite3BtreeFactory(db, 0, 0, STQLITE_DEFAULT_CACHE_SIZE,
+ int rc = sqlite3BtreeFactory(db, 0, 0, SQLITE_DEFAULT_CACHE_SIZE,
&db->aDb[1].pBt);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3ErrorMsg(pParse, "unable to open a temporary database "
"file for storing temporary tables");
pParse->rc = rc;
@@ -46521,7 +46521,7 @@ STQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){
}
if( db->flags & !db->autoCommit ){
rc = sqlite3BtreeBeginTrans(db->aDb[1].pBt, 1);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3ErrorMsg(pParse, "unable to get a write lock on "
"the temporary database file");
pParse->rc = rc;
@@ -46555,7 +46555,7 @@ STQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){
** schema on any databases. This can be used to position the OP_Goto
** early in the code, before we know if any database tables will be used.
*/
-STQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
+SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
sqlite3 *db;
Vdbe *v;
int mask;
@@ -46569,7 +46569,7 @@ STQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
if( iDb>=0 ){
assert( iDb<db->nDb );
assert( db->aDb[iDb].pBt!=0 || iDb==1 );
- assert( iDb<STQLITE_MAX_ATTACHED+2 );
+ assert( iDb<SQLITE_MAX_ATTACHED+2 );
mask = 1<<iDb;
if( (pParse->cookieMask & mask)==0 ){
pParse->cookieMask |= mask;
@@ -46599,7 +46599,7 @@ STQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
** iDb==1 then only the temp database is made writable. If iDb>1 then the
** specified auxiliary database and the temp database are made writable.
*/
-STQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){
+SQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){
Vdbe *v = sqlite3GetVdbe(pParse);
if( v==0 ) return;
sqlite3CodeVerifySchema(pParse, iDb);
@@ -46616,7 +46616,7 @@ STQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse *pParse, int setStatement,
** Check to see if pIndex uses the collating sequence pColl. Return
** true if it does and false if it does not.
*/
-#ifndef STQLITE_OMIT_REINDEX
+#ifndef SQLITE_OMIT_REINDEX
static int collationMatch(const char *zColl, Index *pIndex){
int i;
for(i=0; i<pIndex->nColumn; i++){
@@ -46633,7 +46633,7 @@ static int collationMatch(const char *zColl, Index *pIndex){
** Recompute all indices of pTab that use the collating sequence pColl.
** If pColl==0 then recompute all indices of pTab.
*/
-#ifndef STQLITE_OMIT_REINDEX
+#ifndef SQLITE_OMIT_REINDEX
static void reindexTable(Parse *pParse, Table *pTab, char const *zColl){
Index *pIndex; /* An index associated with pTab */
@@ -46652,7 +46652,7 @@ static void reindexTable(Parse *pParse, Table *pTab, char const *zColl){
** indices use the collating sequence pColl. If pColl==0 then recompute
** all indices everywhere.
*/
-#ifndef STQLITE_OMIT_REINDEX
+#ifndef SQLITE_OMIT_REINDEX
static void reindexDatabases(Parse *pParse, char const *zColl){
Db *pDb; /* A single database */
int iDb; /* The database index number */
@@ -46683,8 +46683,8 @@ static void reindexDatabases(Parse *pParse, char const *zColl){
** collating function. Forms 3 and 4 rebuild the named index or all
** indices associated with the named table.
*/
-#ifndef STQLITE_OMIT_REINDEX
-STQLITE_PRIVATE void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
+#ifndef SQLITE_OMIT_REINDEX
+SQLITE_PRIVATE void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
CollSeq *pColl; /* Collating sequence to be reindexed, or NULL */
char *z; /* Name of a table or index */
const char *zDb; /* Name of the database */
@@ -46696,7 +46696,7 @@ STQLITE_PRIVATE void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2)
/* Read the database schema. If an error occurs, leave an error message
** and code in pParse and return NULL. */
- if( STQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
return;
}
@@ -46747,7 +46747,7 @@ STQLITE_PRIVATE void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2)
** sequence), NULL is returned and the state of pParse updated to reflect
** the error.
*/
-STQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){
+SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){
int i;
int nCol = pIdx->nColumn;
int nBytes = sizeof(KeyInfo) + (nCol-1)*sizeof(CollSeq*) + nCol;
@@ -46807,12 +46807,12 @@ static void callCollNeeded(sqlite3 *db, const char *zName, int nName){
db->xCollNeeded(db->pCollNeededArg, db, (int)ENC(db), zExternal);
sqliteFree(zExternal);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
if( db->xCollNeeded16 ){
char const *zExternal;
sqlite3_value *pTmp = sqlite3ValueNew();
- sqlite3ValueSetStr(pTmp, nName, zName, STQLITE_UTF8, STQLITE_STATIC);
- zExternal = sqlite3ValueText(pTmp, STQLITE_UTF16NATIVE);
+ sqlite3ValueSetStr(pTmp, nName, zName, SQLITE_UTF8, SQLITE_STATIC);
+ zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);
if( zExternal ){
db->xCollNeeded16(db->pCollNeededArg, db, (int)ENC(db), zExternal);
}
@@ -46833,16 +46833,16 @@ static int synthCollSeq(sqlite3 *db, CollSeq *pColl){
char *z = pColl->zName;
int n = strlen(z);
int i;
- static const u8 aEnc[] = { STQLITE_UTF16BE, STQLITE_UTF16LE, STQLITE_UTF8 };
+ static const u8 aEnc[] = { SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8 };
for(i=0; i<3; i++){
pColl2 = sqlite3FindCollSeq(db, aEnc[i], z, n, 0);
if( pColl2->xCmp!=0 ){
memcpy(pColl, pColl2, sizeof(CollSeq));
pColl->xDel = 0; /* Do not copy the destructor */
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
/*
@@ -46858,7 +46858,7 @@ static int synthCollSeq(sqlite3 *db, CollSeq *pColl){
** db for collation type name zName, length nName, or NULL, if no collation
** sequence can be found.
*/
-STQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(
+SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(
sqlite3* db,
CollSeq *pColl,
const char *zName,
@@ -46895,7 +46895,7 @@ STQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(
** an equivalent collating sequence that uses a text encoding different
** from the main database is substituted, if one is available.
*/
-STQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *pParse, CollSeq *pColl){
+SQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *pParse, CollSeq *pColl){
if( pColl ){
const char *zName = pColl->zName;
CollSeq *p = sqlite3GetCollSeq(pParse->db, pColl, zName, -1);
@@ -46904,11 +46904,11 @@ STQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *pParse, CollSeq *pColl){
sqlite3ErrorMsg(pParse, "no such collation sequence: %s", zName);
}
pParse->nErr++;
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
assert( p==pColl );
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
@@ -46941,11 +46941,11 @@ static CollSeq *findCollSeqEntry(
if( pColl ){
CollSeq *pDel = 0;
pColl[0].zName = (char*)&pColl[3];
- pColl[0].enc = STQLITE_UTF8;
+ pColl[0].enc = SQLITE_UTF8;
pColl[1].zName = (char*)&pColl[3];
- pColl[1].enc = STQLITE_UTF16LE;
+ pColl[1].enc = SQLITE_UTF16LE;
pColl[2].zName = (char*)&pColl[3];
- pColl[2].enc = STQLITE_UTF16BE;
+ pColl[2].enc = SQLITE_UTF16BE;
memcpy(pColl[0].zName, zName, nName);
pColl[0].zName[nName] = 0;
pDel = sqlite3HashInsert(&db->aCollSeq, pColl[0].zName, nName, pColl);
@@ -46977,7 +46977,7 @@ static CollSeq *findCollSeqEntry(
** if necessary and generates an error message if the collating sequence
** cannot be found.
*/
-STQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(
+SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(
sqlite3 *db,
u8 enc,
const char *zName,
@@ -46990,8 +46990,8 @@ STQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(
}else{
pColl = db->pDfltColl;
}
- assert( STQLITE_UTF8==1 && STQLITE_UTF16LE==2 && STQLITE_UTF16BE==3 );
- assert( enc>=STQLITE_UTF8 && enc<=STQLITE_UTF16BE );
+ assert( SQLITE_UTF8==1 && SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 );
+ assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE );
if( pColl ) pColl += enc-1;
return pColl;
}
@@ -47016,7 +47016,7 @@ STQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(
** number of arguments may be returned even if the eTextRep flag does not
** match that requested.
*/
-STQLITE_PRIVATE FuncDef *sqlite3FindFunction(
+SQLITE_PRIVATE FuncDef *sqlite3FindFunction(
sqlite3 *db, /* An open database */
const char *zName, /* Name of the function. Not null-terminated */
int nName, /* Number of characters in the name */
@@ -47030,7 +47030,7 @@ STQLITE_PRIVATE FuncDef *sqlite3FindFunction(
int bestmatch = 0;
- assert( enc==STQLITE_UTF8 || enc==STQLITE_UTF16LE || enc==STQLITE_UTF16BE );
+ assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
if( nArg<-1 ) nArg = -1;
pFirst = (FuncDef*)sqlite3HashFind(&db->aFunc, zName, nName);
@@ -47061,8 +47061,8 @@ STQLITE_PRIVATE FuncDef *sqlite3FindFunction(
if( enc==p->iPrefEnc ){
match += 2;
}
- else if( (enc==STQLITE_UTF16LE && p->iPrefEnc==STQLITE_UTF16BE) ||
- (enc==STQLITE_UTF16BE && p->iPrefEnc==STQLITE_UTF16LE) ){
+ else if( (enc==SQLITE_UTF16LE && p->iPrefEnc==SQLITE_UTF16BE) ||
+ (enc==SQLITE_UTF16BE && p->iPrefEnc==SQLITE_UTF16LE) ){
match += 1;
}
@@ -47102,7 +47102,7 @@ STQLITE_PRIVATE FuncDef *sqlite3FindFunction(
** pointer itself, it just cleans up subsiduary resources (i.e. the contents
** of the schema hash tables).
*/
-STQLITE_PRIVATE void sqlite3SchemaFree(void *p){
+SQLITE_PRIVATE void sqlite3SchemaFree(void *p){
Hash temp1;
Hash temp2;
HashElem *pElem;
@@ -47110,14 +47110,14 @@ STQLITE_PRIVATE void sqlite3SchemaFree(void *p){
temp1 = pSchema->tblHash;
temp2 = pSchema->trigHash;
- sqlite3HashInit(&pSchema->trigHash, STQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&pSchema->trigHash, SQLITE_HASH_STRING, 0);
sqlite3HashClear(&pSchema->aFKey);
sqlite3HashClear(&pSchema->idxHash);
for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){
sqlite3DeleteTrigger((Trigger*)sqliteHashData(pElem));
}
sqlite3HashClear(&temp2);
- sqlite3HashInit(&pSchema->tblHash, STQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&pSchema->tblHash, SQLITE_HASH_STRING, 0);
for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){
Table *pTab = sqliteHashData(pElem);
sqlite3DeleteTable(pTab);
@@ -47131,7 +47131,7 @@ STQLITE_PRIVATE void sqlite3SchemaFree(void *p){
** Find and return the schema associated with a BTree. Create
** a new one if necessary.
*/
-STQLITE_PRIVATE Schema *sqlite3SchemaGet(Btree *pBt){
+SQLITE_PRIVATE Schema *sqlite3SchemaGet(Btree *pBt){
Schema * p;
if( pBt ){
p = (Schema *)sqlite3BtreeSchema(pBt,sizeof(Schema),sqlite3SchemaFree);
@@ -47139,11 +47139,11 @@ STQLITE_PRIVATE Schema *sqlite3SchemaGet(Btree *pBt){
p = (Schema *)sqliteMalloc(sizeof(Schema));
}
if( p && 0==p->file_format ){
- sqlite3HashInit(&p->tblHash, STQLITE_HASH_STRING, 0);
- sqlite3HashInit(&p->idxHash, STQLITE_HASH_STRING, 0);
- sqlite3HashInit(&p->trigHash, STQLITE_HASH_STRING, 0);
- sqlite3HashInit(&p->aFKey, STQLITE_HASH_STRING, 1);
- p->enc = STQLITE_UTF8;
+ sqlite3HashInit(&p->tblHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&p->idxHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&p->trigHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&p->aFKey, SQLITE_HASH_STRING, 1);
+ p->enc = SQLITE_UTF8;
}
return p;
}
@@ -47170,7 +47170,7 @@ STQLITE_PRIVATE Schema *sqlite3SchemaGet(Btree *pBt){
**
** $Id: complete.c,v 1.3 2006/01/18 15:25:17 danielk1977 Exp $
*/
-#ifndef STQLITE_OMIT_COMPLETE
+#ifndef SQLITE_OMIT_COMPLETE
/*
** This is defined in tokenize.c. We just have to import the definition.
@@ -47238,15 +47238,15 @@ extern const char sqlite3IsIdChar[];
**
** Whitespace never causes a state transition and is always ignored.
**
-** If we compile with STQLITE_OMIT_TRIGGER, all of the computation needed
+** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
** to recognize the end of a trigger can be omitted. All we have to do
** is look for a semicolon that is not part of an string or comment.
*/
-STQLITE_API int sqlite3_complete(const char *zSql){
+SQLITE_API int sqlite3_complete(const char *zSql){
u8 state = 0; /* Current state, using numbers defined in header comment */
u8 token; /* Value of the next token */
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/* A complex statement machine used to detect the end of a CREATE TRIGGER
** statement. This is the normal case.
*/
@@ -47271,7 +47271,7 @@ STQLITE_API int sqlite3_complete(const char *zSql){
/* 0 START: */ { 0, 0, 1, },
/* 1 NORMAL: */ { 0, 1, 1, },
};
-#endif /* STQLITE_OMIT_TRIGGER */
+#endif /* SQLITE_OMIT_TRIGGER */
while( *zSql ){
switch( *zSql ){
@@ -47332,7 +47332,7 @@ STQLITE_API int sqlite3_complete(const char *zSql){
/* Keywords and unquoted identifiers */
int nId;
for(nId=1; IdChar(zSql[nId]); nId++){}
-#ifdef STQLITE_OMIT_TRIGGER
+#ifdef SQLITE_OMIT_TRIGGER
token = tkOTHER;
#else
switch( *zSql ){
@@ -47360,7 +47360,7 @@ STQLITE_API int sqlite3_complete(const char *zSql){
if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){
token = tkEND;
}else
-#ifndef STQLITE_OMIT_EXPLAIN
+#ifndef SQLITE_OMIT_EXPLAIN
if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){
token = tkEXPLAIN;
}else
@@ -47375,7 +47375,7 @@ STQLITE_API int sqlite3_complete(const char *zSql){
break;
}
}
-#endif /* STQLITE_OMIT_TRIGGER */
+#endif /* SQLITE_OMIT_TRIGGER */
zSql += nId-1;
}else{
/* Operators and special symbols */
@@ -47390,28 +47390,28 @@ STQLITE_API int sqlite3_complete(const char *zSql){
return state==0;
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** This routine is the same as the sqlite3_complete() routine described
** above, except that the parameter is required to be UTF-16 encoded, not
** UTF-8.
*/
-STQLITE_API int sqlite3_complete16(const void *zSql){
+SQLITE_API int sqlite3_complete16(const void *zSql){
sqlite3_value *pVal;
char const *zSql8;
int rc = 0;
pVal = sqlite3ValueNew();
- sqlite3ValueSetStr(pVal, -1, zSql, STQLITE_UTF16NATIVE, STQLITE_STATIC);
- zSql8 = sqlite3ValueText(pVal, STQLITE_UTF8);
+ sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
+ zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
if( zSql8 ){
rc = sqlite3_complete(zSql8);
}
sqlite3ValueFree(pVal);
return sqlite3ApiExit(0, rc);
}
-#endif /* STQLITE_OMIT_UTF16 */
-#endif /* STQLITE_OMIT_COMPLETE */
+#endif /* SQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_COMPLETE */
/************** End of complete.c ********************************************/
/************** Begin file delete.c ******************************************/
@@ -47437,7 +47437,7 @@ STQLITE_API int sqlite3_complete16(const void *zSql){
** add an error message to pParse->zErrMsg and return NULL. If all tables
** are found, return a pointer to the last table.
*/
-STQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
+SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
Table *pTab = 0;
int i;
struct SrcList_item *pItem;
@@ -47457,17 +47457,17 @@ STQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
** writable, generate an error message and return 1. If it is
** writable return 0;
*/
-STQLITE_PRIVATE int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){
- if( (pTab->readOnly && (pParse->db->flags & STQLITE_WriteSchema)==0
+SQLITE_PRIVATE int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){
+ if( (pTab->readOnly && (pParse->db->flags & SQLITE_WriteSchema)==0
&& pParse->nested==0)
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
|| (pTab->pMod && pTab->pMod->pModule->xUpdate==0)
#endif
){
sqlite3ErrorMsg(pParse, "table %s may not be modified", pTab->zName);
return 1;
}
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
if( !viewOk && pTab->pSelect ){
sqlite3ErrorMsg(pParse,"cannot modify %s because it is a view",pTab->zName);
return 1;
@@ -47479,7 +47479,7 @@ STQLITE_PRIVATE int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){
/*
** Generate code that will open a table for reading.
*/
-STQLITE_PRIVATE void sqlite3OpenTable(
+SQLITE_PRIVATE void sqlite3OpenTable(
Parse *p, /* Generate code into this VDBE */
int iCur, /* The cursor number of the table */
int iDb, /* The database index in sqlite3.aDb[] */
@@ -47505,7 +47505,7 @@ STQLITE_PRIVATE void sqlite3OpenTable(
** \________/ \________________/
** pTabList pWhere
*/
-STQLITE_PRIVATE void sqlite3DeleteFrom(
+SQLITE_PRIVATE void sqlite3DeleteFrom(
Parse *pParse, /* The parser context */
SrcList *pTabList, /* The table from which we should delete things */
Expr *pWhere /* The WHERE clause. May be null */
@@ -47525,7 +47525,7 @@ STQLITE_PRIVATE void sqlite3DeleteFrom(
int iDb; /* Database number */
int memCnt = 0; /* Memory cell used for change counting */
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
int isView; /* True if attempting to delete from a view */
int triggers_exist = 0; /* True if any triggers exist */
#endif
@@ -47548,14 +47548,14 @@ STQLITE_PRIVATE void sqlite3DeleteFrom(
/* Figure out if we have any triggers and if the table being
** deleted from is a view
*/
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0);
isView = pTab->pSelect!=0;
#else
# define triggers_exist 0
# define isView 0
#endif
-#ifdef STQLITE_OMIT_VIEW
+#ifdef SQLITE_OMIT_VIEW
# undef isView
# define isView 0
#endif
@@ -47566,7 +47566,7 @@ STQLITE_PRIVATE void sqlite3DeleteFrom(
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
assert( iDb<db->nDb );
zDb = db->aDb[iDb].zName;
- if( sqlite3AuthCheck(pParse, STQLITE_DELETE, pTab->zName, 0, zDb) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
goto delete_from_cleanup;
}
@@ -47620,7 +47620,7 @@ STQLITE_PRIVATE void sqlite3DeleteFrom(
/* Initialize the counter of the number of rows deleted, if
** we are counting rows.
*/
- if( db->flags & STQLITE_CountRows ){
+ if( db->flags & SQLITE_CountRows ){
memCnt = pParse->nMem++;
sqlite3VdbeAddOp(v, OP_MemInt, 0, memCnt);
}
@@ -47630,7 +47630,7 @@ STQLITE_PRIVATE void sqlite3DeleteFrom(
** this means that the row change count will be incorrect.
*/
if( pWhere==0 && !triggers_exist && !IsVirtual(pTab) ){
- if( db->flags & STQLITE_CountRows ){
+ if( db->flags & SQLITE_CountRows ){
/* If counting rows deleted, just count the total number of
** entries in the table. */
int endOfLoop = sqlite3VdbeMakeLabel(v);
@@ -47668,7 +47668,7 @@ STQLITE_PRIVATE void sqlite3DeleteFrom(
*/
sqlite3VdbeAddOp(v, IsVirtual(pTab) ? OP_VRowid : OP_Rowid, iCur, 0);
sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0);
- if( db->flags & STQLITE_CountRows ){
+ if( db->flags & SQLITE_CountRows ){
sqlite3VdbeAddOp(v, OP_MemIncr, 1, memCnt);
}
@@ -47727,7 +47727,7 @@ STQLITE_PRIVATE void sqlite3DeleteFrom(
}
/* Delete the row */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( IsVirtual(pTab) ){
pParse->pVirtualLock = pTab;
sqlite3VdbeOp3(v, OP_VUpdate, 0, 1, (const char*)pTab->pVtab, P3_VTAB);
@@ -47771,7 +47771,7 @@ STQLITE_PRIVATE void sqlite3DeleteFrom(
** generating code because of a call to sqlite3NestedParse(), do not
** invoke the callback function.
*/
- if( db->flags & STQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){
+ if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){
sqlite3VdbeAddOp(v, OP_MemLoad, memCnt, 0);
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
sqlite3VdbeSetNumCols(v, 1);
@@ -47805,7 +47805,7 @@ delete_from_cleanup:
** and then generates code to remove both the table record and all index
** entries that point to that record.
*/
-STQLITE_PRIVATE void sqlite3GenerateRowDelete(
+SQLITE_PRIVATE void sqlite3GenerateRowDelete(
sqlite3 *db, /* The database containing the index */
Vdbe *v, /* Generate code into this VDBE */
Table *pTab, /* Table containing the row to be deleted */
@@ -47838,7 +47838,7 @@ STQLITE_PRIVATE void sqlite3GenerateRowDelete(
** 3. The "iCur" cursor must be pointing to the row that is to be
** deleted.
*/
-STQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(
+SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(
Vdbe *v, /* Generate code into this VDBE */
Table *pTab, /* Table containing the row to be deleted */
int iCur, /* Cursor number for the table */
@@ -47860,7 +47860,7 @@ STQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(
** iCur is the index of a cursor open on the pTab table and pointing to
** the entry that needs indexing.
*/
-STQLITE_PRIVATE void sqlite3GenerateIndexKey(
+SQLITE_PRIVATE void sqlite3GenerateIndexKey(
Vdbe *v, /* Generate code into this VDBE */
Index *pIdx, /* The index for which to generate a key */
int iCur /* Cursor number for the pIdx->pTable table */
@@ -47896,7 +47896,7 @@ STQLITE_PRIVATE void sqlite3GenerateIndexKey(
**
*************************************************************************
** This file contains the C functions that implement various SQL
-** functions of STQLite.
+** functions of SQLite.
**
** There is only one exported symbol in this file - the function
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
@@ -47932,9 +47932,9 @@ static void minmaxFunc(
assert( pColl );
assert( mask==-1 || mask==0 );
iBest = 0;
- if( sqlite3_value_type(argv[0])==STQLITE_NULL ) return;
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
for(i=1; i<argc; i++){
- if( sqlite3_value_type(argv[i])==STQLITE_NULL ) return;
+ if( sqlite3_value_type(argv[i])==SQLITE_NULL ) return;
if( (sqlite3MemCompare(argv[iBest], argv[i], pColl)^mask)>=0 ){
iBest = i;
}
@@ -47952,13 +47952,13 @@ static void typeofFunc(
){
const char *z = 0;
switch( sqlite3_value_type(argv[0]) ){
- case STQLITE_NULL: z = "null"; break;
- case STQLITE_INTEGER: z = "integer"; break;
- case STQLITE_TEXT: z = "text"; break;
- case STQLITE_FLOAT: z = "real"; break;
- case STQLITE_BLOB: z = "blob"; break;
+ case SQLITE_NULL: z = "null"; break;
+ case SQLITE_INTEGER: z = "integer"; break;
+ case SQLITE_TEXT: z = "text"; break;
+ case SQLITE_FLOAT: z = "real"; break;
+ case SQLITE_BLOB: z = "blob"; break;
}
- sqlite3_result_text(context, z, -1, STQLITE_STATIC);
+ sqlite3_result_text(context, z, -1, SQLITE_STATIC);
}
@@ -47974,19 +47974,19 @@ static void lengthFunc(
assert( argc==1 );
switch( sqlite3_value_type(argv[0]) ){
- case STQLITE_BLOB:
- case STQLITE_INTEGER:
- case STQLITE_FLOAT: {
+ case SQLITE_BLOB:
+ case SQLITE_INTEGER:
+ case SQLITE_FLOAT: {
sqlite3_result_int(context, sqlite3_value_bytes(argv[0]));
break;
}
- case STQLITE_TEXT: {
+ case SQLITE_TEXT: {
const unsigned char *z = sqlite3_value_text(argv[0]);
if( z==0 ) return;
len = 0;
while( *z ){
len++;
- STQLITE_SKIP_UTF8(z);
+ SQLITE_SKIP_UTF8(z);
}
sqlite3_result_int(context, len);
break;
@@ -48004,7 +48004,7 @@ static void lengthFunc(
static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
assert( argc==1 );
switch( sqlite3_value_type(argv[0]) ){
- case STQLITE_INTEGER: {
+ case SQLITE_INTEGER: {
i64 iVal = sqlite3_value_int64(argv[0]);
if( iVal<0 ){
if( (iVal<<1)==0 ){
@@ -48016,7 +48016,7 @@ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
sqlite3_result_int64(context, iVal);
break;
}
- case STQLITE_NULL: {
+ case SQLITE_NULL: {
sqlite3_result_null(context);
break;
}
@@ -48052,7 +48052,7 @@ static void substrFunc(
assert( argc==3 );
p0type = sqlite3_value_type(argv[0]);
- if( p0type==STQLITE_BLOB ){
+ if( p0type==SQLITE_BLOB ){
len = sqlite3_value_bytes(argv[0]);
z = sqlite3_value_blob(argv[0]);
if( z==0 ) return;
@@ -48062,7 +48062,7 @@ static void substrFunc(
if( z==0 ) return;
len = 0;
for(z2=z; *z2; len++){
- STQLITE_SKIP_UTF8(z2);
+ SQLITE_SKIP_UTF8(z2);
}
}
p1 = sqlite3_value_int(argv[1]);
@@ -48079,18 +48079,18 @@ static void substrFunc(
if( p1+p2>len ){
p2 = len-p1;
}
- if( p0type!=STQLITE_BLOB ){
+ if( p0type!=SQLITE_BLOB ){
while( *z && p1 ){
- STQLITE_SKIP_UTF8(z);
+ SQLITE_SKIP_UTF8(z);
p1--;
}
for(z2=z; *z2 && p2; p2--){
- STQLITE_SKIP_UTF8(z2);
+ SQLITE_SKIP_UTF8(z2);
}
- sqlite3_result_text(context, (char*)z, z2-z, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, (char*)z, z2-z, SQLITE_TRANSIENT);
}else{
if( p2<0 ) p2 = 0;
- sqlite3_result_blob(context, (char*)&z[p1], p2, STQLITE_TRANSIENT);
+ sqlite3_result_blob(context, (char*)&z[p1], p2, SQLITE_TRANSIENT);
}
}
@@ -48103,12 +48103,12 @@ static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
char zBuf[500]; /* larger than the %f representation of the largest double */
assert( argc==1 || argc==2 );
if( argc==2 ){
- if( STQLITE_NULL==sqlite3_value_type(argv[1]) ) return;
+ if( SQLITE_NULL==sqlite3_value_type(argv[1]) ) return;
n = sqlite3_value_int(argv[1]);
if( n>30 ) n = 30;
if( n<0 ) n = 0;
}
- if( sqlite3_value_type(argv[0])==STQLITE_NULL ) return;
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
r = sqlite3_value_double(argv[0]);
sqlite3_snprintf(sizeof(zBuf),zBuf,"%.*f",n,r);
sqlite3AtoF(zBuf, &r);
@@ -48122,7 +48122,7 @@ static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
char *z1;
const char *z2;
int i, n;
- if( argc<1 || STQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
+ if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
z2 = (char*)sqlite3_value_text(argv[0]);
n = sqlite3_value_bytes(argv[0]);
/* Verify that the call to _bytes() does not tqinvalidate the _text() pointer */
@@ -48142,7 +48142,7 @@ static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
char *z1;
const char *z2;
int i, n;
- if( argc<1 || STQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
+ if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
z2 = (char*)sqlite3_value_text(argv[0]);
n = sqlite3_value_bytes(argv[0]);
/* Verify that the call to _bytes() does not tqinvalidate the _text() pointer */
@@ -48171,7 +48171,7 @@ static void ifnullFunc(
){
int i;
for(i=0; i<argc; i++){
- if( STQLITE_NULL!=sqlite3_value_type(argv[i]) ){
+ if( SQLITE_NULL!=sqlite3_value_type(argv[i]) ){
sqlite3_result_value(context, argv[i]);
break;
}
@@ -48209,7 +48209,7 @@ static void randomBlob(
if( n<1 ){
n = 1;
}
- if( n>STQLITE_MAX_LENGTH ){
+ if( n>SQLITE_MAX_LENGTH ){
sqlite3_result_error_toobig(context);
return;
}
@@ -48273,16 +48273,16 @@ static const struct compareInfo globInfo = { '*', '?', '[', 0 };
/* The correct SQL-92 behavior is for the LIKE operator to ignore
** case. Thus 'a' LIKE 'A' would be true. */
static const struct compareInfo likeInfoNorm = { '%', '_', 0, 1 };
-/* If STQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator
+/* If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator
** is case sensitive causing 'a' LIKE 'A' to be false */
static const struct compareInfo likeInfoAlt = { '%', '_', 0, 0 };
/*
** Read a single UTF-8 character and return its value.
*/
-STQLITE_PRIVATE u32 sqlite3ReadUtf8(const unsigned char *z){
+SQLITE_PRIVATE u32 sqlite3ReadUtf8(const unsigned char *z){
u32 c;
- STQLITE_READ_UTF8(z, c);
+ SQLITE_READ_UTF8(z, c);
return c;
}
@@ -48335,20 +48335,20 @@ static int patternCompare(
while( (c=zPattern[1]) == matchAll || c == matchOne ){
if( c==matchOne ){
if( *zString==0 ) return 0;
- STQLITE_SKIP_UTF8(zString);
+ SQLITE_SKIP_UTF8(zString);
}
zPattern++;
}
if( c && esc && sqlite3ReadUtf8(&zPattern[1])==esc ){
u8 const *zTemp = &zPattern[1];
- STQLITE_SKIP_UTF8(zTemp);
+ SQLITE_SKIP_UTF8(zTemp);
c = *zTemp;
}
if( c==0 ) return 1;
if( c==matchSet ){
assert( esc==0 ); /* This is GLOB, not LIKE */
while( *zString && patternCompare(&zPattern[1],zString,pInfo,esc)==0 ){
- STQLITE_SKIP_UTF8(zString);
+ SQLITE_SKIP_UTF8(zString);
}
return *zString!=0;
}else{
@@ -48362,13 +48362,13 @@ static int patternCompare(
}
if( c2==0 ) return 0;
if( patternCompare(&zPattern[1],zString,pInfo,esc) ) return 1;
- STQLITE_SKIP_UTF8(zString);
+ SQLITE_SKIP_UTF8(zString);
}
return 0;
}
}else if( !prevEscape && c==matchOne ){
if( *zString==0 ) return 0;
- STQLITE_SKIP_UTF8(zString);
+ SQLITE_SKIP_UTF8(zString);
zPattern++;
}else if( c==matchSet ){
int prior_c = 0;
@@ -48395,14 +48395,14 @@ static int patternCompare(
}else{
prior_c = c2;
}
- STQLITE_SKIP_UTF8(zPattern);
+ SQLITE_SKIP_UTF8(zPattern);
}
if( c2==0 || (seen ^ invert)==0 ) return 0;
- STQLITE_SKIP_UTF8(zString);
+ SQLITE_SKIP_UTF8(zString);
zPattern++;
}else if( esc && !prevEscape && sqlite3ReadUtf8(zPattern)==esc){
prevEscape = 1;
- STQLITE_SKIP_UTF8(zPattern);
+ SQLITE_SKIP_UTF8(zPattern);
}else{
if( noCase ){
if( sqlite3UpperToLower[c] != sqlite3UpperToLower[*zString] ) return 0;
@@ -48422,7 +48422,7 @@ static int patternCompare(
** just a variation of LIKE) gets called. This is used for testing
** only.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
int sqlite3_like_count = 0;
#endif
@@ -48453,7 +48453,7 @@ static void likeFunc(
/* Limit the length of the LIKE or GLOB pattern to avoid problems
** of deep recursion and N*N behavior in patternCompare().
*/
- if( sqlite3_value_bytes(argv[0])>STQLITE_MAX_LIKE_PATTERN_LENGTH ){
+ if( sqlite3_value_bytes(argv[0])>SQLITE_MAX_LIKE_PATTERN_LENGTH ){
sqlite3_result_error(context, "LIKE or GLOB pattern too complex", -1);
return;
}
@@ -48474,7 +48474,7 @@ static void likeFunc(
}
if( zA && zB ){
struct compareInfo *pInfo = sqlite3_user_data(context);
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
sqlite3_like_count++;
#endif
@@ -48500,14 +48500,14 @@ static void nullifFunc(
/*
** Implementation of the VERSION(*) function. The result is the version
-** of the STQLite library that is running.
+** of the SQLite library that is running.
*/
static void versionFunc(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
- sqlite3_result_text(context, sqlite3_version, -1, STQLITE_STATIC);
+ sqlite3_result_text(context, sqlite3_version, -1, SQLITE_STATIC);
}
/* Array for converting from half-bytes (nybbles) into ASCII hex
@@ -48531,22 +48531,22 @@ static const char hexdigits[] = {
static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
if( argc<1 ) return;
switch( sqlite3_value_type(argv[0]) ){
- case STQLITE_NULL: {
- sqlite3_result_text(context, "NULL", 4, STQLITE_STATIC);
+ case SQLITE_NULL: {
+ sqlite3_result_text(context, "NULL", 4, SQLITE_STATIC);
break;
}
- case STQLITE_INTEGER:
- case STQLITE_FLOAT: {
+ case SQLITE_INTEGER:
+ case SQLITE_FLOAT: {
sqlite3_result_value(context, argv[0]);
break;
}
- case STQLITE_BLOB: {
+ case SQLITE_BLOB: {
char *zText = 0;
char const *zBlob = sqlite3_value_blob(argv[0]);
int nBlob = sqlite3_value_bytes(argv[0]);
assert( zBlob==sqlite3_value_blob(argv[0]) ); /* No encoding change */
- if( 2*nBlob+4>STQLITE_MAX_LENGTH ){
+ if( 2*nBlob+4>SQLITE_MAX_LENGTH ){
sqlite3_result_error_toobig(context);
return;
}
@@ -48563,12 +48563,12 @@ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
zText[(nBlob*2)+3] = '\0';
zText[0] = 'X';
zText[1] = '\'';
- sqlite3_result_text(context, zText, -1, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, zText, -1, SQLITE_TRANSIENT);
sqliteFree(zText);
}
break;
}
- case STQLITE_TEXT: {
+ case SQLITE_TEXT: {
int i,j;
u64 n;
const unsigned char *zArg = sqlite3_value_text(argv[0]);
@@ -48576,7 +48576,7 @@ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
if( zArg==0 ) return;
for(i=0, n=0; zArg[i]; i++){ if( zArg[i]=='\'' ) n++; }
- if( i+n+3>STQLITE_MAX_LENGTH ){
+ if( i+n+3>SQLITE_MAX_LENGTH ){
sqlite3_result_error_toobig(context);
return;
}
@@ -48591,7 +48591,7 @@ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
}
z[j++] = '\'';
z[j] = 0;
- sqlite3_result_text(context, z, j, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, z, j, SQLITE_TRANSIENT);
sqliteFree(z);
}
}
@@ -48612,7 +48612,7 @@ static void hexFunc(
assert( argc==1 );
pBlob = sqlite3_value_blob(argv[0]);
n = sqlite3_value_bytes(argv[0]);
- if( n*2+1>STQLITE_MAX_LENGTH ){
+ if( n*2+1>SQLITE_MAX_LENGTH ){
sqlite3_result_error_toobig(context);
return;
}
@@ -48639,7 +48639,7 @@ static void zeroblobFunc(
i64 n;
assert( argc==1 );
n = sqlite3_value_int64(argv[0]);
- if( n>STQLITE_MAX_LENGTH ){
+ if( n>SQLITE_MAX_LENGTH ){
sqlite3_result_error_toobig(context);
}else{
sqlite3_result_zeroblob(context, n);
@@ -48682,7 +48682,7 @@ static void replaceFunc(
nRep = sqlite3_value_bytes(argv[2]);
assert( zRep==sqlite3_value_text(argv[2]) );
nOut = nStr + 1;
- assert( nOut<STQLITE_MAX_LENGTH );
+ assert( nOut<SQLITE_MAX_LENGTH );
zOut = sqlite3_malloc((int)nOut);
if( zOut==0 ){
return;
@@ -48693,7 +48693,7 @@ static void replaceFunc(
zOut[j++] = zStr[i];
}else{
nOut += nRep - nPattern;
- if( nOut>=STQLITE_MAX_LENGTH ){
+ if( nOut>=SQLITE_MAX_LENGTH ){
sqlite3_result_error_toobig(context);
sqlite3_free(zOut);
return;
@@ -48733,7 +48733,7 @@ static void trimFunc(
const unsigned char **azChar; /* Individual characters in zCharSet */
int nChar; /* Number of characters in zCharSet */
- if( sqlite3_value_type(argv[0])==STQLITE_NULL ){
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ){
return;
}
zIn = sqlite3_value_text(argv[0]);
@@ -48752,7 +48752,7 @@ static void trimFunc(
}else{
const unsigned char *z;
for(z=zCharSet, nChar=0; *z; nChar++){
- STQLITE_SKIP_UTF8(z);
+ SQLITE_SKIP_UTF8(z);
}
if( nChar>0 ){
azChar = sqlite3_malloc( nChar*(sizeof(char*)+1) );
@@ -48762,7 +48762,7 @@ static void trimFunc(
aLen = (unsigned char*)&azChar[nChar];
for(z=zCharSet, nChar=0; *z; nChar++){
azChar[nChar] = z;
- STQLITE_SKIP_UTF8(z);
+ SQLITE_SKIP_UTF8(z);
aLen[nChar] = z - azChar[nChar];
}
}
@@ -48796,10 +48796,10 @@ static void trimFunc(
sqlite3_free(azChar);
}
}
- sqlite3_result_text(context, (char*)zIn, nIn, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
}
-#ifdef STQLITE_SOUNDEX
+#ifdef SQLITE_SOUNDEX
/*
** Compute the soundex encoding of a word.
*/
@@ -48843,14 +48843,14 @@ static void soundexFunc(
zResult[j++] = '0';
}
zResult[j] = 0;
- sqlite3_result_text(context, zResult, 4, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, zResult, 4, SQLITE_TRANSIENT);
}else{
- sqlite3_result_text(context, "?000", 4, STQLITE_STATIC);
+ sqlite3_result_text(context, "?000", 4, SQLITE_STATIC);
}
}
#endif
-#ifndef STQLITE_OMIT_LOAD_EXTENSION
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
/*
** A function that loads a shared-library extension then returns NULL.
*/
@@ -48872,7 +48872,7 @@ static void loadExt(sqlite3_context *context, int argc, sqlite3_value **argv){
}
#endif
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
/*
** This function generates a string of random characters. Used for
** generating test data.
@@ -48911,11 +48911,11 @@ static void randStr(sqlite3_context *context, int argc, sqlite3_value **argv){
zBuf[i] = zSrc[zBuf[i]%(sizeof(zSrc)-1)];
}
zBuf[n] = 0;
- sqlite3_result_text(context, (char*)zBuf, n, STQLITE_TRANSIENT);
+ sqlite3_result_text(context, (char*)zBuf, n, SQLITE_TRANSIENT);
}
-#endif /* STQLITE_TEST */
+#endif /* SQLITE_TEST */
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
/*
** The following two SQL functions are used to test returning a text
** result with a destructor. Function 'test_destructor' takes one argument
@@ -48946,7 +48946,7 @@ static void test_destructor(
test_destructor_count_var++;
assert( nArg==1 );
- if( sqlite3_value_type(argv[0])==STQLITE_NULL ) return;
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
len = sqlite3ValueBytes(argv[0], ENC(db));
zVal = sqliteMalloc(len+3);
zVal[len] = 0;
@@ -48954,14 +48954,14 @@ static void test_destructor(
assert( zVal );
zVal++;
memcpy(zVal, sqlite3ValueText(argv[0], ENC(db)), len);
- if( ENC(db)==STQLITE_UTF8 ){
+ if( ENC(db)==SQLITE_UTF8 ){
sqlite3_result_text(pCtx, zVal, -1, destructor);
-#ifndef STQLITE_OMIT_UTF16
- }else if( ENC(db)==STQLITE_UTF16LE ){
+#ifndef SQLITE_OMIT_UTF16
+ }else if( ENC(db)==SQLITE_UTF16LE ){
sqlite3_result_text16le(pCtx, zVal, -1, destructor);
}else{
sqlite3_result_text16be(pCtx, zVal, -1, destructor);
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
}
}
static void test_destructor_count(
@@ -48971,9 +48971,9 @@ static void test_destructor_count(
){
sqlite3_result_int(pCtx, test_destructor_count_var);
}
-#endif /* STQLITE_TEST */
+#endif /* SQLITE_TEST */
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
/*
** Routines for testing the sqlite3_get_auxdata() and sqlite3_set_auxdata()
** interface.
@@ -49014,9 +49014,9 @@ static void test_auxdata(
}
sqlite3_result_text(pCtx, zRet, 2*nArg-1, free_test_auxdata);
}
-#endif /* STQLITE_TEST */
+#endif /* SQLITE_TEST */
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
/*
** A function to test error reporting from user functions. This function
** returns a copy of it's first argument as an error.
@@ -49028,7 +49028,7 @@ static void test_error(
){
sqlite3_result_error(pCtx, (char*)sqlite3_value_text(argv[0]), 0);
}
-#endif /* STQLITE_TEST */
+#endif /* SQLITE_TEST */
/*
** An instance of the following structure holds the context of a
@@ -49059,9 +49059,9 @@ static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){
assert( argc==1 );
p = sqlite3_aggregate_context(context, sizeof(*p));
type = sqlite3_value_numeric_type(argv[0]);
- if( p && type!=STQLITE_NULL ){
+ if( p && type!=SQLITE_NULL ){
p->cnt++;
- if( type==STQLITE_INTEGER ){
+ if( type==SQLITE_INTEGER ){
i64 v = sqlite3_value_int64(argv[0]);
p->rSum += v;
if( (p->approx|p->overflow)==0 ){
@@ -49119,7 +49119,7 @@ struct CountCtx {
static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){
CountCtx *p;
p = sqlite3_aggregate_context(context, sizeof(*p));
- if( (argc==0 || STQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){
+ if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){
p->n++;
}
}
@@ -49136,7 +49136,7 @@ static void minmaxStep(sqlite3_context *context, int argc, sqlite3_value **argv)
Mem *pArg = (Mem *)argv[0];
Mem *pBest;
- if( sqlite3_value_type(argv[0])==STQLITE_NULL ) return;
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest));
if( !pBest ) return;
@@ -49178,7 +49178,7 @@ static void minMaxFinalize(sqlite3_context *context){
** functions. This should be the only routine in this file with
** external linkage.
*/
-STQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
+SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
static const struct {
char *zName;
signed char nArg;
@@ -49187,52 +49187,52 @@ STQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
u8 needCollSeq;
void (*xFunc)(sqlite3_context*,int,sqlite3_value **);
} aFuncs[] = {
- { "min", -1, 0, STQLITE_UTF8, 1, minmaxFunc },
- { "min", 0, 0, STQLITE_UTF8, 1, 0 },
- { "max", -1, 1, STQLITE_UTF8, 1, minmaxFunc },
- { "max", 0, 1, STQLITE_UTF8, 1, 0 },
- { "typeof", 1, 0, STQLITE_UTF8, 0, typeofFunc },
- { "length", 1, 0, STQLITE_UTF8, 0, lengthFunc },
- { "substr", 3, 0, STQLITE_UTF8, 0, substrFunc },
- { "abs", 1, 0, STQLITE_UTF8, 0, absFunc },
- { "round", 1, 0, STQLITE_UTF8, 0, roundFunc },
- { "round", 2, 0, STQLITE_UTF8, 0, roundFunc },
- { "upper", 1, 0, STQLITE_UTF8, 0, upperFunc },
- { "lower", 1, 0, STQLITE_UTF8, 0, lowerFunc },
- { "coalesce", -1, 0, STQLITE_UTF8, 0, ifnullFunc },
- { "coalesce", 0, 0, STQLITE_UTF8, 0, 0 },
- { "coalesce", 1, 0, STQLITE_UTF8, 0, 0 },
- { "hex", 1, 0, STQLITE_UTF8, 0, hexFunc },
- { "ifnull", 2, 0, STQLITE_UTF8, 1, ifnullFunc },
- { "random", -1, 0, STQLITE_UTF8, 0, randomFunc },
- { "randomblob", 1, 0, STQLITE_UTF8, 0, randomBlob },
- { "nullif", 2, 0, STQLITE_UTF8, 1, nullifFunc },
- { "sqlite_version", 0, 0, STQLITE_UTF8, 0, versionFunc},
- { "quote", 1, 0, STQLITE_UTF8, 0, quoteFunc },
- { "last_insert_rowid", 0, 0xff, STQLITE_UTF8, 0, last_insert_rowid },
- { "changes", 0, 0xff, STQLITE_UTF8, 0, changes },
- { "total_changes", 0, 0xff, STQLITE_UTF8, 0, total_changes },
- { "replace", 3, 0, STQLITE_UTF8, 0, replaceFunc },
- { "ltrim", 1, 1, STQLITE_UTF8, 0, trimFunc },
- { "ltrim", 2, 1, STQLITE_UTF8, 0, trimFunc },
- { "rtrim", 1, 2, STQLITE_UTF8, 0, trimFunc },
- { "rtrim", 2, 2, STQLITE_UTF8, 0, trimFunc },
- { "trim", 1, 3, STQLITE_UTF8, 0, trimFunc },
- { "trim", 2, 3, STQLITE_UTF8, 0, trimFunc },
- { "zeroblob", 1, 0, STQLITE_UTF8, 0, zeroblobFunc },
-#ifdef STQLITE_SOUNDEX
- { "soundex", 1, 0, STQLITE_UTF8, 0, soundexFunc},
-#endif
-#ifndef STQLITE_OMIT_LOAD_EXTENSION
- { "load_extension", 1, 0xff, STQLITE_UTF8, 0, loadExt },
- { "load_extension", 2, 0xff, STQLITE_UTF8, 0, loadExt },
-#endif
-#ifdef STQLITE_TEST
- { "randstr", 2, 0, STQLITE_UTF8, 0, randStr },
- { "test_destructor", 1, 0xff, STQLITE_UTF8, 0, test_destructor},
- { "test_destructor_count", 0, 0, STQLITE_UTF8, 0, test_destructor_count},
- { "test_auxdata", -1, 0, STQLITE_UTF8, 0, test_auxdata},
- { "test_error", 1, 0, STQLITE_UTF8, 0, test_error},
+ { "min", -1, 0, SQLITE_UTF8, 1, minmaxFunc },
+ { "min", 0, 0, SQLITE_UTF8, 1, 0 },
+ { "max", -1, 1, SQLITE_UTF8, 1, minmaxFunc },
+ { "max", 0, 1, SQLITE_UTF8, 1, 0 },
+ { "typeof", 1, 0, SQLITE_UTF8, 0, typeofFunc },
+ { "length", 1, 0, SQLITE_UTF8, 0, lengthFunc },
+ { "substr", 3, 0, SQLITE_UTF8, 0, substrFunc },
+ { "abs", 1, 0, SQLITE_UTF8, 0, absFunc },
+ { "round", 1, 0, SQLITE_UTF8, 0, roundFunc },
+ { "round", 2, 0, SQLITE_UTF8, 0, roundFunc },
+ { "upper", 1, 0, SQLITE_UTF8, 0, upperFunc },
+ { "lower", 1, 0, SQLITE_UTF8, 0, lowerFunc },
+ { "coalesce", -1, 0, SQLITE_UTF8, 0, ifnullFunc },
+ { "coalesce", 0, 0, SQLITE_UTF8, 0, 0 },
+ { "coalesce", 1, 0, SQLITE_UTF8, 0, 0 },
+ { "hex", 1, 0, SQLITE_UTF8, 0, hexFunc },
+ { "ifnull", 2, 0, SQLITE_UTF8, 1, ifnullFunc },
+ { "random", -1, 0, SQLITE_UTF8, 0, randomFunc },
+ { "randomblob", 1, 0, SQLITE_UTF8, 0, randomBlob },
+ { "nullif", 2, 0, SQLITE_UTF8, 1, nullifFunc },
+ { "sqlite_version", 0, 0, SQLITE_UTF8, 0, versionFunc},
+ { "quote", 1, 0, SQLITE_UTF8, 0, quoteFunc },
+ { "last_insert_rowid", 0, 0xff, SQLITE_UTF8, 0, last_insert_rowid },
+ { "changes", 0, 0xff, SQLITE_UTF8, 0, changes },
+ { "total_changes", 0, 0xff, SQLITE_UTF8, 0, total_changes },
+ { "replace", 3, 0, SQLITE_UTF8, 0, replaceFunc },
+ { "ltrim", 1, 1, SQLITE_UTF8, 0, trimFunc },
+ { "ltrim", 2, 1, SQLITE_UTF8, 0, trimFunc },
+ { "rtrim", 1, 2, SQLITE_UTF8, 0, trimFunc },
+ { "rtrim", 2, 2, SQLITE_UTF8, 0, trimFunc },
+ { "trim", 1, 3, SQLITE_UTF8, 0, trimFunc },
+ { "trim", 2, 3, SQLITE_UTF8, 0, trimFunc },
+ { "zeroblob", 1, 0, SQLITE_UTF8, 0, zeroblobFunc },
+#ifdef SQLITE_SOUNDEX
+ { "soundex", 1, 0, SQLITE_UTF8, 0, soundexFunc},
+#endif
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+ { "load_extension", 1, 0xff, SQLITE_UTF8, 0, loadExt },
+ { "load_extension", 2, 0xff, SQLITE_UTF8, 0, loadExt },
+#endif
+#ifdef SQLITE_TEST
+ { "randstr", 2, 0, SQLITE_UTF8, 0, randStr },
+ { "test_destructor", 1, 0xff, SQLITE_UTF8, 0, test_destructor},
+ { "test_destructor_count", 0, 0, SQLITE_UTF8, 0, test_destructor_count},
+ { "test_auxdata", -1, 0, SQLITE_UTF8, 0, test_auxdata},
+ { "test_error", 1, 0, SQLITE_UTF8, 0, test_error},
#endif
};
static const struct {
@@ -49271,19 +49271,19 @@ STQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
}
}
}
-#ifndef STQLITE_OMIT_ALTERTABLE
+#ifndef SQLITE_OMIT_ALTERTABLE
sqlite3AlterFunctions(db);
#endif
-#ifndef STQLITE_OMIT_PARSER
+#ifndef SQLITE_OMIT_PARSER
sqlite3AttachFunctions(db);
#endif
for(i=0; i<sizeof(aAggs)/sizeof(aAggs[0]); i++){
void *pArg = (void*)(int)aAggs[i].argType;
- sqlite3CreateFunc(db, aAggs[i].zName, aAggs[i].nArg, STQLITE_UTF8,
+ sqlite3CreateFunc(db, aAggs[i].zName, aAggs[i].nArg, SQLITE_UTF8,
pArg, 0, aAggs[i].xStep, aAggs[i].xFinalize);
if( aAggs[i].needCollSeq ){
FuncDef *pFunc = sqlite3FindFunction( db, aAggs[i].zName,
- strlen(aAggs[i].zName), aAggs[i].nArg, STQLITE_UTF8, 0);
+ strlen(aAggs[i].zName), aAggs[i].nArg, SQLITE_UTF8, 0);
if( pFunc && aAggs[i].needCollSeq ){
pFunc->needCollSeq = 1;
}
@@ -49292,15 +49292,15 @@ STQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
sqlite3RegisterDateTimeFunctions(db);
if( !sqlite3MallocFailed() ){
int rc = sqlite3_overload_function(db, "MATCH", 2);
- assert( rc==STQLITE_NOMEM || rc==STQLITE_OK );
- if( rc==STQLITE_NOMEM ){
+ assert( rc==SQLITE_NOMEM || rc==SQLITE_OK );
+ if( rc==SQLITE_NOMEM ){
sqlite3FailedMalloc();
}
}
-#ifdef STQLITE_SSE
+#ifdef SQLITE_SSE
(void)sqlite3SseFunctions(db);
#endif
-#ifdef STQLITE_CASE_SENSITIVE_LIKE
+#ifdef SQLITE_CASE_SENSITIVE_LIKE
sqlite3RegisterLikeFunctions(db, 1);
#else
sqlite3RegisterLikeFunctions(db, 0);
@@ -49312,7 +49312,7 @@ STQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
*/
static void setLikeOptFlag(sqlite3 *db, const char *zName, int flagVal){
FuncDef *pDef;
- pDef = sqlite3FindFunction(db, zName, strlen(zName), 2, STQLITE_UTF8, 0);
+ pDef = sqlite3FindFunction(db, zName, strlen(zName), 2, SQLITE_UTF8, 0);
if( pDef ){
pDef->flags = flagVal;
}
@@ -49323,20 +49323,20 @@ static void setLikeOptFlag(sqlite3 *db, const char *zName, int flagVal){
** parameter determines whether or not the LIKE operator is case
** sensitive. GLOB is always case sensitive.
*/
-STQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){
+SQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){
struct compareInfo *pInfo;
if( caseSensitive ){
pInfo = (struct compareInfo*)&likeInfoAlt;
}else{
pInfo = (struct compareInfo*)&likeInfoNorm;
}
- sqlite3CreateFunc(db, "like", 2, STQLITE_UTF8, pInfo, likeFunc, 0, 0);
- sqlite3CreateFunc(db, "like", 3, STQLITE_UTF8, pInfo, likeFunc, 0, 0);
- sqlite3CreateFunc(db, "glob", 2, STQLITE_UTF8,
+ sqlite3CreateFunc(db, "like", 2, SQLITE_UTF8, pInfo, likeFunc, 0, 0);
+ sqlite3CreateFunc(db, "like", 3, SQLITE_UTF8, pInfo, likeFunc, 0, 0);
+ sqlite3CreateFunc(db, "glob", 2, SQLITE_UTF8,
(struct compareInfo*)&globInfo, likeFunc, 0,0);
- setLikeOptFlag(db, "glob", STQLITE_FUNC_LIKE | STQLITE_FUNC_CASE);
+ setLikeOptFlag(db, "glob", SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE);
setLikeOptFlag(db, "like",
- caseSensitive ? (STQLITE_FUNC_LIKE | STQLITE_FUNC_CASE) : STQLITE_FUNC_LIKE);
+ caseSensitive ? (SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE) : SQLITE_FUNC_LIKE);
}
/*
@@ -49346,7 +49346,7 @@ STQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive
** return TRUE. If the function is not a LIKE-style function then
** return FALSE.
*/
-STQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
+SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
FuncDef *pDef;
if( pExpr->op!=TK_FUNCTION || !pExpr->pList ){
return 0;
@@ -49355,8 +49355,8 @@ STQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNoca
return 0;
}
pDef = sqlite3FindFunction(db, (char*)pExpr->token.z, pExpr->token.n, 2,
- STQLITE_UTF8, 0);
- if( pDef==0 || (pDef->flags & STQLITE_FUNC_LIKE)==0 ){
+ SQLITE_UTF8, 0);
+ if( pDef==0 || (pDef->flags & SQLITE_FUNC_LIKE)==0 ){
return 0;
}
@@ -49368,7 +49368,7 @@ STQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNoca
assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll );
assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne );
assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet );
- *pIsNocase = (pDef->flags & STQLITE_FUNC_CASE)==0;
+ *pIsNocase = (pDef->flags & SQLITE_FUNC_CASE)==0;
return 1;
}
@@ -49386,7 +49386,7 @@ STQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNoca
**
*************************************************************************
** This file contains C code routines that are called by the parser
-** to handle INSERT statements in STQLite.
+** to handle INSERT statements in SQLite.
**
** $Id: insert.c,v 1.187 2007/06/26 10:38:55 danielk1977 Exp $
*/
@@ -49404,7 +49404,7 @@ STQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNoca
** 'd' INTEGER
** 'e' REAL
*/
-STQLITE_PRIVATE void sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
+SQLITE_PRIVATE void sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
if( !pIdx->zColAff ){
/* The first time a column affinity string for a particular index is
** required, it is allocated and populated here. It is then stored as
@@ -49443,7 +49443,7 @@ STQLITE_PRIVATE void sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
** 'd' INTEGER
** 'e' REAL
*/
-STQLITE_PRIVATE void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){
+SQLITE_PRIVATE void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){
/* The first time a column affinity string for a particular table
** is required, it is allocated and populated here. It is then
** stored as a member of the Table structure for subsequent use.
@@ -49493,7 +49493,7 @@ static int selectReadsTable(Select *p, Schema *pSchema, int iTab){
return 0;
}
-#ifndef STQLITE_OMIT_AUTOINCREMENT
+#ifndef SQLITE_OMIT_AUTOINCREMENT
/*
** Write out code to initialize the autoincrement logic. This code
** looks up the current autoincrement value in the sqlite_sequence
@@ -49586,13 +49586,13 @@ static void autoIncEnd(
}
#else
/*
-** If STQLITE_OMIT_AUTOINCREMENT is defined, then the three routines
+** If SQLITE_OMIT_AUTOINCREMENT is defined, then the three routines
** above are all no-ops
*/
# define autoIncBegin(A,B,C) (0)
# define autoIncStep(A,B)
# define autoIncEnd(A,B,C,D)
-#endif /* STQLITE_OMIT_AUTOINCREMENT */
+#endif /* SQLITE_OMIT_AUTOINCREMENT */
/* Forward declaration */
@@ -49692,7 +49692,7 @@ static int xferOptimization(
** end the loop
** cleanup
*/
-STQLITE_PRIVATE void sqlite3Insert(
+SQLITE_PRIVATE void sqlite3Insert(
Parse *pParse, /* Parser context */
SrcList *pTabList, /* Name of table into which we are inserting */
ExprList *pList, /* List of values to be inserted */
@@ -49726,7 +49726,7 @@ STQLITE_PRIVATE void sqlite3Insert(
int nHidden = 0;
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
int isView; /* True if attempting to insert into a view */
int triggers_exist = 0; /* True if there are FOR EACH ROW triggers */
#endif
@@ -49749,21 +49749,21 @@ STQLITE_PRIVATE void sqlite3Insert(
assert( iDb<db->nDb );
pDb = &db->aDb[iDb];
zDb = pDb->zName;
- if( sqlite3AuthCheck(pParse, STQLITE_INSERT, pTab->zName, 0, zDb) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){
goto insert_cleanup;
}
/* Figure out if we have any triggers and if the table being
** inserted into is a view
*/
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_INSERT, 0);
isView = pTab->pSelect!=0;
#else
# define triggers_exist 0
# define isView 0
#endif
-#ifdef STQLITE_OMIT_VIEW
+#ifdef SQLITE_OMIT_VIEW
# undef isView
# define isView 0
#endif
@@ -49797,7 +49797,7 @@ STQLITE_PRIVATE void sqlite3Insert(
newIdx = pParse->nTab++;
}
-#ifndef STQLITE_OMIT_XFER_OPT
+#ifndef SQLITE_OMIT_XFER_OPT
/* If the statement is of the form
**
** INSERT INTO <table1> SELECT * FROM <table2>;
@@ -49810,7 +49810,7 @@ STQLITE_PRIVATE void sqlite3Insert(
assert( pList==0 );
goto insert_cleanup;
}
-#endif /* STQLITE_OMIT_XFER_OPT */
+#endif /* SQLITE_OMIT_XFER_OPT */
/* If this is an AUTOINCREMENT table, look up the sequence number in the
** sqlite_sequence table and store it in memory cell counterMem. Also
@@ -49973,7 +49973,7 @@ STQLITE_PRIVATE void sqlite3Insert(
/* Initialize the count of rows to be inserted
*/
- if( db->flags & STQLITE_CountRows ){
+ if( db->flags & SQLITE_CountRows ){
iCntMem = pParse->nMem++;
sqlite3VdbeAddOp(v, OP_MemInt, 0, iCntMem);
}
@@ -50156,7 +50156,7 @@ STQLITE_PRIVATE void sqlite3Insert(
/* Generate code to check constraints and generate index keys and
** do the insertion.
*/
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( IsVirtual(pTab) ){
pParse->pVirtualLock = pTab;
sqlite3VdbeOp3(v, OP_VUpdate, 1, pTab->nCol+2,
@@ -50174,7 +50174,7 @@ STQLITE_PRIVATE void sqlite3Insert(
/* Update the count of rows that are inserted
*/
- if( (db->flags & STQLITE_CountRows)!=0 ){
+ if( (db->flags & SQLITE_CountRows)!=0 ){
sqlite3VdbeAddOp(v, OP_MemIncr, 1, iCntMem);
}
@@ -50226,7 +50226,7 @@ STQLITE_PRIVATE void sqlite3Insert(
** generating code because of a call to sqlite3NestedParse(), do not
** invoke the callback function.
*/
- if( db->flags & STQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){
+ if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){
sqlite3VdbeAddOp(v, OP_MemLoad, iCntMem, 0);
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
sqlite3VdbeSetNumCols(v, 1);
@@ -50277,15 +50277,15 @@ insert_cleanup:
** --------------- ---------- ----------------------------------------
** any ROLLBACK The current transaction is rolled back and
** sqlite3_exec() returns immediately with a
-** return code of STQLITE_CONSTRAINT.
+** return code of SQLITE_CONSTRAINT.
**
** any ABORT Back out changes from the current command
** only (do not do a complete rollback) then
** cause sqlite3_exec() to return immediately
-** with STQLITE_CONSTRAINT.
+** with SQLITE_CONSTRAINT.
**
** any FAIL Sqlite_exec() returns immediately with a
-** return code of STQLITE_CONSTRAINT. The
+** return code of SQLITE_CONSTRAINT. The
** transaction is not rolled back and any
** prior changes are retained.
**
@@ -50319,7 +50319,7 @@ insert_cleanup:
** is still pointing at the same entry after the routine returns.
** Without the isUpdate flag, the "base" cursor might be moved.
*/
-STQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
+SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
Parse *pParse, /* The parser context */
Table *pTab, /* the table into which we are inserting */
int base, /* Index of a read/write cursor pointing at pTab */
@@ -50371,7 +50371,7 @@ STQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
case OE_Abort:
case OE_Fail: {
char *zMsg = 0;
- sqlite3VdbeAddOp(v, OP_Halt, STQLITE_CONSTRAINT, onError);
+ sqlite3VdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError);
sqlite3SetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName,
" may not be NULL", (char*)0);
sqlite3VdbeChangeP3(v, -1, zMsg, P3_DYNAMIC);
@@ -50393,8 +50393,8 @@ STQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
/* Test all CHECK constraints
*/
-#ifndef STQLITE_OMIT_CHECK
- if( pTab->pCheck && (pParse->db->flags & STQLITE_IgnoreChecks)==0 ){
+#ifndef SQLITE_OMIT_CHECK
+ if( pTab->pCheck && (pParse->db->flags & SQLITE_IgnoreChecks)==0 ){
int allOk = sqlite3VdbeMakeLabel(v);
assert( pParse->ckOffset==0 );
pParse->ckOffset = nCol;
@@ -50406,11 +50406,11 @@ STQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
sqlite3VdbeAddOp(v, OP_Pop, nCol+1+hasTwoRowids, 0);
sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest);
}else{
- sqlite3VdbeAddOp(v, OP_Halt, STQLITE_CONSTRAINT, onError);
+ sqlite3VdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError);
}
sqlite3VdbeResolveLabel(v, allOk);
}
-#endif /* !defined(STQLITE_OMIT_CHECK) */
+#endif /* !defined(SQLITE_OMIT_CHECK) */
/* If we have an INTEGER PRIMARY KEY, make sure the primary key
** of the new record does not previously exist. Except, if this
@@ -50439,7 +50439,7 @@ STQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
case OE_Rollback:
case OE_Abort:
case OE_Fail: {
- sqlite3VdbeOp3(v, OP_Halt, STQLITE_CONSTRAINT, onError,
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError,
"PRIMARY KEY must be unique", P3_STATIC);
break;
}
@@ -50537,7 +50537,7 @@ STQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
}
sqlite3_snprintf(sizeof(zErrMsg)-n1, &zErrMsg[n1],
pIdx->nColumn>1 ? " are not unique" : " is not unique");
- sqlite3VdbeOp3(v, OP_Halt, STQLITE_CONSTRAINT, onError, zErrMsg, 0);
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, zErrMsg, 0);
break;
}
case OE_Ignore: {
@@ -50573,7 +50573,7 @@ STQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
** The arguments to this routine should be the same as the first six
** arguments to sqlite3GenerateConstraintChecks.
*/
-STQLITE_PRIVATE void sqlite3CompleteInsertion(
+SQLITE_PRIVATE void sqlite3CompleteInsertion(
Parse *pParse, /* The parser context */
Table *pTab, /* the table into which we are inserting */
int base, /* Index of a read/write cursor pointing at pTab */
@@ -50599,7 +50599,7 @@ STQLITE_PRIVATE void sqlite3CompleteInsertion(
}
sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0);
sqlite3TableAffinityStr(v, pTab);
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
if( newIdx>=0 ){
sqlite3VdbeAddOp(v, OP_Dup, 1, 0);
sqlite3VdbeAddOp(v, OP_Dup, 1, 0);
@@ -50630,7 +50630,7 @@ STQLITE_PRIVATE void sqlite3CompleteInsertion(
** indices of that table. The "base" parameter is the cursor number used
** for the table. Indices are opened on subsequent cursors.
*/
-STQLITE_PRIVATE void sqlite3OpenTableAndIndices(
+SQLITE_PRIVATE void sqlite3OpenTableAndIndices(
Parse *pParse, /* Parsing context */
Table *pTab, /* Table to be opened */
int base, /* Cursor number assigned to the table */
@@ -50659,7 +50659,7 @@ STQLITE_PRIVATE void sqlite3OpenTableAndIndices(
}
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
/*
** The following global variable is incremented whenever the
** transfer optimization is used. This is used for testing
@@ -50667,10 +50667,10 @@ STQLITE_PRIVATE void sqlite3OpenTableAndIndices(
** is happening when it is suppose to.
*/
int sqlite3_xferopt_count;
-#endif /* STQLITE_TEST */
+#endif /* SQLITE_TEST */
-#ifndef STQLITE_OMIT_XFER_OPT
+#ifndef SQLITE_OMIT_XFER_OPT
/*
** Check to collation names to see if they are compatible.
*/
@@ -50780,7 +50780,7 @@ static int xferOptimization(
if( pDest->pTrigger ){
return 0; /* tab1 must not have triggers */
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( pDest->isVirtual ){
return 0; /* tab1 must not be a virtual table */
}
@@ -50843,7 +50843,7 @@ static int xferOptimization(
if( pSrc==pDest ){
return 0; /* tab1 and tab2 may not be the same table */
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( pSrc->isVirtual ){
return 0; /* tab2 must not be a virtual table */
}
@@ -50879,7 +50879,7 @@ static int xferOptimization(
return 0; /* pDestIdx has no corresponding index in pSrc */
}
}
-#ifndef STQLITE_OMIT_CHECK
+#ifndef SQLITE_OMIT_CHECK
if( pDest->pCheck && !sqlite3ExprCompare(pSrc->pCheck, pDest->pCheck) ){
return 0; /* Tables have different CHECK constraints. Ticket #2252 */
}
@@ -50893,7 +50893,7 @@ static int xferOptimization(
** * We can conditionally do the transfer if the destination
** table is empty.
*/
-#ifdef STQLITE_TEST
+#ifdef SQLITE_TEST
sqlite3_xferopt_count++;
#endif
iDbSrc = sqlite3SchemaToIndex(pParse->db, pSrc->pSchema);
@@ -50925,7 +50925,7 @@ static int xferOptimization(
addr1 = sqlite3VdbeAddOp(v, OP_Rowid, iSrc, 0);
sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
addr2 = sqlite3VdbeAddOp(v, OP_NotExists, iDest, 0);
- sqlite3VdbeOp3(v, OP_Halt, STQLITE_CONSTRAINT, onError,
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError,
"PRIMARY KEY must be unique", P3_STATIC);
sqlite3VdbeJumpHere(v, addr2);
autoIncStep(pParse, counterMem);
@@ -50968,7 +50968,7 @@ static int xferOptimization(
sqlite3VdbeAddOp(v, OP_Close, iSrc, 0);
sqlite3VdbeAddOp(v, OP_Close, iDest, 0);
if( emptyDestTest ){
- sqlite3VdbeAddOp(v, OP_Halt, STQLITE_OK, 0);
+ sqlite3VdbeAddOp(v, OP_Halt, SQLITE_OK, 0);
sqlite3VdbeJumpHere(v, emptyDestTest);
sqlite3VdbeAddOp(v, OP_Close, iDest, 0);
return 0;
@@ -50976,7 +50976,7 @@ static int xferOptimization(
return 1;
}
}
-#endif /* STQLITE_OMIT_XFER_OPT */
+#endif /* SQLITE_OMIT_XFER_OPT */
/************** End of insert.c **********************************************/
/************** Begin file legacy.c ******************************************/
@@ -50991,9 +50991,9 @@ static int xferOptimization(
** May you share freely, never taking more than you give.
**
*************************************************************************
-** Main file for the STQLite library. The routines in this file
+** Main file for the SQLite library. The routines in this file
** implement the programmer interface to the library. Routines in
-** other files are for internal use by STQLite and should not be
+** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: legacy.c,v 1.18 2007/05/04 13:15:56 drh Exp $
@@ -51001,7 +51001,7 @@ static int xferOptimization(
/*
-** Execute SQL code. Return one of the STQLITE_ success/failure
+** Execute SQL code. Return one of the SQLITE_ success/failure
** codes. Also write an error message into memory obtained from
** malloc() and make *pzErrMsg point to that message.
**
@@ -51010,14 +51010,14 @@ static int xferOptimization(
** argument to xCallback(). If xCallback=NULL then no callback
** is invoked, even for queries.
*/
-STQLITE_API int sqlite3_exec(
+SQLITE_API int sqlite3_exec(
sqlite3 *db, /* The database on which the SQL executes */
const char *zSql, /* The SQL to be executed */
sqlite3_callback xCallback, /* Invoke this callback routine */
void *pArg, /* First argument to xCallback() */
char **pzErrMsg /* Write error messages here */
){
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
const char *zLeftover;
sqlite3_stmt *pStmt = 0;
char **azCols = 0;
@@ -51025,15 +51025,15 @@ STQLITE_API int sqlite3_exec(
int nRetry = 0;
int nCallback;
- if( zSql==0 ) return STQLITE_OK;
- while( (rc==STQLITE_OK || (rc==STQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){
+ if( zSql==0 ) return SQLITE_OK;
+ while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){
int nCol;
char **azVals = 0;
pStmt = 0;
rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover);
- assert( rc==STQLITE_OK || pStmt==0 );
- if( rc!=STQLITE_OK ){
+ assert( rc==SQLITE_OK || pStmt==0 );
+ if( rc!=SQLITE_OK ){
continue;
}
if( !pStmt ){
@@ -51055,30 +51055,30 @@ STQLITE_API int sqlite3_exec(
rc = sqlite3_step(pStmt);
/* Invoke the callback function if required */
- if( xCallback && (STQLITE_ROW==rc ||
- (STQLITE_DONE==rc && !nCallback && db->flags&STQLITE_NullCallback)) ){
+ if( xCallback && (SQLITE_ROW==rc ||
+ (SQLITE_DONE==rc && !nCallback && db->flags&SQLITE_NullCallback)) ){
if( 0==nCallback ){
for(i=0; i<nCol; i++){
azCols[i] = (char *)sqlite3_column_name(pStmt, i);
}
nCallback++;
}
- if( rc==STQLITE_ROW ){
+ if( rc==SQLITE_ROW ){
azVals = &azCols[nCol];
for(i=0; i<nCol; i++){
azVals[i] = (char *)sqlite3_column_text(pStmt, i);
}
}
if( xCallback(pArg, nCol, azVals, azCols) ){
- rc = STQLITE_ABORT;
+ rc = SQLITE_ABORT;
goto exec_out;
}
}
- if( rc!=STQLITE_ROW ){
+ if( rc!=SQLITE_ROW ){
rc = sqlite3_finalize(pStmt);
pStmt = 0;
- if( rc!=STQLITE_SCHEMA ){
+ if( rc!=SQLITE_SCHEMA ){
nRetry = 0;
zSql = zLeftover;
while( isspace((unsigned char)zSql[0]) ) zSql++;
@@ -51096,7 +51096,7 @@ exec_out:
if( azCols ) sqliteFree(azCols);
rc = sqlite3ApiExit(0, rc);
- if( rc!=STQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){
+ if( rc!=SQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){
int nErrMsg = 1 + strlen(sqlite3_errmsg(db));
*pzErrMsg = sqlite3_malloc(nErrMsg);
if( *pzErrMsg ){
@@ -51124,11 +51124,11 @@ exec_out:
**
*************************************************************************
** This file contains code used to dynamically load extensions into
-** the STQLite library.
+** the SQLite library.
*/
-#ifndef STQLITE_OMIT_LOAD_EXTENSION
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
-#define STQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
+#define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
/************** Include sqlite3ext.h in the middle of loadext.c **************/
/************** Begin file sqlite3ext.h **************************************/
/*
@@ -51142,27 +51142,27 @@ exec_out:
** May you share freely, never taking more than you give.
**
*************************************************************************
-** This header file defines the STQLite interface for use by
+** This header file defines the SQLite interface for use by
** shared libraries that want to be imported as extensions into
-** an STQLite instance. Shared libraries that intend to be loaded
-** as extensions by STQLite should #include this file instead of
+** an SQLite instance. Shared libraries that intend to be loaded
+** as extensions by SQLite should #include this file instead of
** sqlite3.h.
**
** @(#) $Id: sqlite3ext.h,v 1.12 2007/07/20 10:48:36 drh Exp $
*/
-#ifndef _STQLITE3EXT_H_
-#define _STQLITE3EXT_H_
+#ifndef _SQLITE3EXT_H_
+#define _SQLITE3EXT_H_
typedef struct sqlite3_api_routines sqlite3_api_routines;
/*
-** The following structure hold pointers to all of the STQLite API
+** The following structure hold pointers to all of the SQLite API
** routines.
**
** WARNING: In order to maintain backwards compatibility, add new
** interfaces to the end of this structure only. If you insert new
** interfaces in the middle of this structure, then older different
-** versions of STQLite will not be able to load each others shared
+** versions of SQLite will not be able to load each others shared
** libraries!
*/
struct sqlite3_api_routines {
@@ -51293,13 +51293,13 @@ struct sqlite3_api_routines {
** redirected throught the global sqlite3_api structure.
**
** This header file is also used by the loadext.c source file
-** (part of the main STQLite library - not an extension) so that
+** (part of the main SQLite library - not an extension) so that
** it can get access to the sqlite3_api_routines structure
** definition. But the main library does not want to redefine
** the API. So the redefinition macros are only valid if the
-** STQLITE_CORE macros is undefined.
+** SQLITE_CORE macros is undefined.
*/
-#ifndef STQLITE_CORE
+#ifndef SQLITE_CORE
#define sqlite3_aggregate_context sqlite3_api->aggregate_context
#define sqlite3_aggregate_count sqlite3_api->aggregate_count
#define sqlite3_bind_blob sqlite3_api->bind_blob
@@ -51422,22 +51422,22 @@ struct sqlite3_api_routines {
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
#define sqlite3_clear_bindings sqlite3_api->clear_bindings
-#endif /* STQLITE_CORE */
+#endif /* SQLITE_CORE */
-#define STQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api;
-#define STQLITE_EXTENSION_INIT2(v) sqlite3_api = v;
+#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api;
+#define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v;
-#endif /* _STQLITE3EXT_H_ */
+#endif /* _SQLITE3EXT_H_ */
/************** End of sqlite3ext.h ******************************************/
/************** Continuing where we left off in loadext.c ********************/
/*
** Some API routines are omitted when various features are
-** excluded from a build of STQLite. Substitute a NULL pointer
+** excluded from a build of SQLite. Substitute a NULL pointer
** for any missing APIs.
*/
-#ifndef STQLITE_ENABLE_COLUMN_METADATA
+#ifndef SQLITE_ENABLE_COLUMN_METADATA
# define sqlite3_column_database_name 0
# define sqlite3_column_database_name16 0
# define sqlite3_column_table_name 0
@@ -51447,11 +51447,11 @@ struct sqlite3_api_routines {
# define sqlite3_table_column_metadata 0
#endif
-#ifdef STQLITE_OMIT_AUTHORIZATION
+#ifdef SQLITE_OMIT_AUTHORIZATION
# define sqlite3_set_authorizer 0
#endif
-#ifdef STQLITE_OMIT_UTF16
+#ifdef SQLITE_OMIT_UTF16
# define sqlite3_bind_text16 0
# define sqlite3_collation_needed16 0
# define sqlite3_column_decltype16 0
@@ -51476,39 +51476,39 @@ struct sqlite3_api_routines {
# define sqlite3_column_origin_name16 0
#endif
-#ifdef STQLITE_OMIT_COMPLETE
+#ifdef SQLITE_OMIT_COMPLETE
# define sqlite3_complete 0
# define sqlite3_complete16 0
#endif
-#ifdef STQLITE_OMIT_PROGRESS_CALLBACK
+#ifdef SQLITE_OMIT_PROGRESS_CALLBACK
# define sqlite3_progress_handler 0
#endif
-#ifdef STQLITE_OMIT_VIRTUALTABLE
+#ifdef SQLITE_OMIT_VIRTUALTABLE
# define sqlite3_create_module 0
# define sqlite3_create_module_v2 0
# define sqlite3_declare_vtab 0
#endif
-#ifdef STQLITE_OMIT_SHARED_CACHE
+#ifdef SQLITE_OMIT_SHARED_CACHE
# define sqlite3_enable_shared_cache 0
#endif
-#ifdef STQLITE_OMIT_TRACE
+#ifdef SQLITE_OMIT_TRACE
# define sqlite3_profile 0
# define sqlite3_trace 0
#endif
-#ifdef STQLITE_OMIT_GET_TABLE
+#ifdef SQLITE_OMIT_GET_TABLE
# define sqlite3_free_table 0
# define sqlite3_get_table 0
#endif
/*
-** The following structure contains pointers to all STQLite API routines.
+** The following structure contains pointers to all SQLite API routines.
** A pointer to this structure is passed into extensions when they are
-** loaded so that the extension can make calls back into the STQLite
+** loaded so that the extension can make calls back into the SQLite
** library.
**
** When adding new APIs, add them to the bottom of this structure
@@ -51661,12 +51661,12 @@ const sqlite3_api_routines sqlite3_apis = {
};
/*
-** Attempt to load an STQLite extension library contained in the file
+** Attempt to load an SQLite extension library contained in the file
** zFile. The entry point is zProc. zProc may be 0 in which case a
** default entry point name (sqlite3_extension_init) is used. Use
** of the default name is recommended.
**
-** Return STQLITE_OK on success and STQLITE_ERROR if something goes wrong.
+** Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong.
**
** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
** error message text. The calling function should free this memory
@@ -51684,16 +51684,16 @@ int sqlite3_load_extension(
void **aHandle;
/* Ticket #1863. To avoid a creating security problems for older
- ** applications that relink against newer versions of STQLite, the
+ ** applications that relink against newer versions of SQLite, the
** ability to run load_extension is turned off by default. One
** must call sqlite3_enable_load_extension() to turn on extension
** loading. Otherwise you get the following error.
*/
- if( (db->flags & STQLITE_LoadExtension)==0 ){
+ if( (db->flags & SQLITE_LoadExtension)==0 ){
if( pzErrMsg ){
*pzErrMsg = sqlite3_mprintf("not authorized");
}
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
if( zProc==0 ){
@@ -51705,7 +51705,7 @@ int sqlite3_load_extension(
if( pzErrMsg ){
*pzErrMsg = sqlite3_mprintf("unable to open shared library [%s]", zFile);
}
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
sqlite3OsDlsym(handle, zProc);
@@ -51715,21 +51715,21 @@ int sqlite3_load_extension(
zProc, zFile);
}
sqlite3OsDlclose(handle);
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}else if( xInit(db, &zErrmsg, &sqlite3_apis) ){
if( pzErrMsg ){
*pzErrMsg = sqlite3_mprintf("error during initialization: %s", zErrmsg);
}
sqlite3_free(zErrmsg);
sqlite3OsDlclose(handle);
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
/* Append the new shared library handle to the db->aExtension array. */
db->nExtension++;
aHandle = sqliteMalloc(sizeof(handle)*db->nExtension);
if( aHandle==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
if( db->nExtension>0 ){
memcpy(aHandle, db->aExtension, sizeof(handle)*(db->nExtension-1));
@@ -51738,14 +51738,14 @@ int sqlite3_load_extension(
db->aExtension = aHandle;
db->aExtension[db->nExtension-1] = handle;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Call this routine when the database connection is closing in order
** to clean up loaded extensions
*/
-STQLITE_PRIVATE void sqlite3CloseExtensions(sqlite3 *db){
+SQLITE_PRIVATE void sqlite3CloseExtensions(sqlite3 *db){
int i;
for(i=0; i<db->nExtension; i++){
sqlite3OsDlclose(db->aExtension[i]);
@@ -51759,11 +51759,11 @@ STQLITE_PRIVATE void sqlite3CloseExtensions(sqlite3 *db){
*/
int sqlite3_enable_load_extension(sqlite3 *db, int onoff){
if( onoff ){
- db->flags |= STQLITE_LoadExtension;
+ db->flags |= SQLITE_LoadExtension;
}else{
- db->flags &= ~STQLITE_LoadExtension;
+ db->flags &= ~SQLITE_LoadExtension;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -51782,7 +51782,7 @@ static void **aAutoExtension = 0;
*/
int sqlite3_auto_extension(void *xInit){
int i;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
sqlite3OsEnterMutex();
for(i=0; i<nAutoExtension; i++){
if( aAutoExtension[i]==xInit ) break;
@@ -51793,7 +51793,7 @@ int sqlite3_auto_extension(void *xInit){
nAutoExtension*sizeof(aAutoExtension[0]) );
if( aAutoExtension==0 ){
nAutoExtension = 0;
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
}else{
aAutoExtension[nAutoExtension-1] = xInit;
}
@@ -51817,15 +51817,15 @@ void sqlite3_reset_auto_extension(void){
/*
** Load all automatic extensions.
*/
-STQLITE_PRIVATE int sqlite3AutoLoadExtensions(sqlite3 *db){
+SQLITE_PRIVATE int sqlite3AutoLoadExtensions(sqlite3 *db){
int i;
int go = 1;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
if( nAutoExtension==0 ){
/* Common case: early out without every having to acquire a mutex */
- return STQLITE_OK;
+ return SQLITE_OK;
}
for(i=0; go; i++){
char *zErrmsg = 0;
@@ -51839,16 +51839,16 @@ STQLITE_PRIVATE int sqlite3AutoLoadExtensions(sqlite3 *db){
}
sqlite3OsLeaveMutex();
if( xInit && xInit(db, &zErrmsg, &sqlite3_apis) ){
- sqlite3Error(db, STQLITE_ERROR,
+ sqlite3Error(db, SQLITE_ERROR,
"automatic extension loading failed: %s", zErrmsg);
go = 0;
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
}
return rc;
}
-#endif /* STQLITE_OMIT_LOAD_EXTENSION */
+#endif /* SQLITE_OMIT_LOAD_EXTENSION */
/************** End of loadext.c *********************************************/
/************** Begin file pragma.c ******************************************/
@@ -51870,9 +51870,9 @@ STQLITE_PRIVATE int sqlite3AutoLoadExtensions(sqlite3 *db){
/* Ignore this whole file if pragmas are disabled
*/
-#if !defined(STQLITE_OMIT_PRAGMA) && !defined(STQLITE_OMIT_PARSER)
+#if !defined(SQLITE_OMIT_PRAGMA) && !defined(SQLITE_OMIT_PARSER)
-#if defined(STQLITE_DEBUG) || defined(STQLITE_TEST)
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
#endif
/*
@@ -51922,7 +51922,7 @@ static int getLockingMode(const char *z){
return PAGER_LOCKINGMODE_TQUERY;
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
/*
** Interpret the given string as an auto-vacuum mode value.
**
@@ -51937,9 +51937,9 @@ static int getAutoVacuum(const char *z){
i = atoi(z);
return ((i>=0&&i<=2)?i:0);
}
-#endif /* ifndef STQLITE_OMIT_AUTOVACUUM */
+#endif /* ifndef SQLITE_OMIT_AUTOVACUUM */
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
/*
** Interpret the given string as a temp db location. Return 1 for file
** backed temporary databases, 2 for the Red-Black tree in memory database
@@ -51956,9 +51956,9 @@ static int getTempStore(const char *z){
return 0;
}
}
-#endif /* STQLITE_PAGER_PRAGMAS */
+#endif /* SQLITE_PAGER_PRAGMAS */
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
/*
** Invalidate temp storage, either when the temp storage is changed
** from default, or when 'file' and the temp_store_directory has changed
@@ -51969,17 +51969,17 @@ static int invalidateTempStorage(Parse *pParse){
if( !db->autoCommit ){
sqlite3ErrorMsg(pParse, "temporary storage cannot be changed "
"from within a transaction");
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
sqlite3BtreeClose(db->aDb[1].pBt);
db->aDb[1].pBt = 0;
sqlite3ResetInternalSchema(db, 0);
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#endif /* STQLITE_PAGER_PRAGMAS */
+#endif /* SQLITE_PAGER_PRAGMAS */
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
/*
** If the TEMP database is open, close it and mark the database schema
** as needing reloading. This must be done when using the TEMP_STORE
@@ -51988,14 +51988,14 @@ static int invalidateTempStorage(Parse *pParse){
static int changeTempStorage(Parse *pParse, const char *zStorageType){
int ts = getTempStore(zStorageType);
sqlite3 *db = pParse->db;
- if( db->temp_store==ts ) return STQLITE_OK;
- if( invalidateTempStorage( pParse ) != STQLITE_OK ){
- return STQLITE_ERROR;
+ if( db->temp_store==ts ) return SQLITE_OK;
+ if( invalidateTempStorage( pParse ) != SQLITE_OK ){
+ return SQLITE_ERROR;
}
db->temp_store = ts;
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#endif /* STQLITE_PAGER_PRAGMAS */
+#endif /* SQLITE_PAGER_PRAGMAS */
/*
** Generate code to return a single integer value.
@@ -52010,7 +52010,7 @@ static void returnSingleInt(Parse *pParse, const char *zLabel, int value){
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
}
-#ifndef STQLITE_OMIT_FLAG_PRAGMAS
+#ifndef SQLITE_OMIT_FLAG_PRAGMAS
/*
** Check to see if zRight and zLeft refer to a pragma that queries
** or changes one of the flags in db->flags. Return 1 if so and 0 if not.
@@ -52021,27 +52021,27 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
const char *zName; /* Name of the pragma */
int mask; /* Mask for the db->flags value */
} aPragma[] = {
- { "full_column_names", STQLITE_FullColNames },
- { "short_column_names", STQLITE_ShortColNames },
- { "count_changes", STQLITE_CountRows },
- { "empty_result_callbacks", STQLITE_NullCallback },
- { "legacy_file_format", STQLITE_LegacyFileFmt },
- { "fullfsync", STQLITE_FullFSync },
-#ifdef STQLITE_DEBUG
- { "sql_trace", STQLITE_SqlTrace },
- { "vdbe_listing", STQLITE_VdbeListing },
- { "vdbe_trace", STQLITE_VdbeTrace },
-#endif
-#ifndef STQLITE_OMIT_CHECK
- { "ignore_check_constraints", STQLITE_IgnoreChecks },
+ { "full_column_names", SQLITE_FullColNames },
+ { "short_column_names", SQLITE_ShortColNames },
+ { "count_changes", SQLITE_CountRows },
+ { "empty_result_callbacks", SQLITE_NullCallback },
+ { "legacy_file_format", SQLITE_LegacyFileFmt },
+ { "fullfsync", SQLITE_FullFSync },
+#ifdef SQLITE_DEBUG
+ { "sql_trace", SQLITE_SqlTrace },
+ { "vdbe_listing", SQLITE_VdbeListing },
+ { "vdbe_trace", SQLITE_VdbeTrace },
+#endif
+#ifndef SQLITE_OMIT_CHECK
+ { "ignore_check_constraints", SQLITE_IgnoreChecks },
#endif
/* The following is VERY experimental */
- { "writable_schema", STQLITE_WriteSchema|STQLITE_RecoveryMode },
- { "omit_readlock", STQLITE_NoReadlock },
+ { "writable_schema", SQLITE_WriteSchema|SQLITE_RecoveryMode },
+ { "omit_readlock", SQLITE_NoReadlock },
/* TODO: Maybe it shouldn't be possible to change the ReadUncommitted
** flag if there are any active statements. */
- { "read_uncommitted", STQLITE_ReadUncommitted },
+ { "read_uncommitted", SQLITE_ReadUncommitted },
};
int i;
const struct sPragmaType *p;
@@ -52066,7 +52066,7 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
}
return 0;
}
-#endif /* STQLITE_OMIT_FLAG_PRAGMAS */
+#endif /* SQLITE_OMIT_FLAG_PRAGMAS */
/*
** Process a pragma statement.
@@ -52083,7 +52083,7 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
** and pId2 is the id. If the left side is just "id" then pId1 is the
** id and pId2 is any empty string.
*/
-STQLITE_PRIVATE void sqlite3Pragma(
+SQLITE_PRIVATE void sqlite3Pragma(
Parse *pParse,
Token *pId1, /* First part of [database.]id field */
Token *pId2, /* Second part of [database.]id field, or NULL */
@@ -52122,11 +52122,11 @@ STQLITE_PRIVATE void sqlite3Pragma(
}
zDb = ((iDb>0)?pDb->zName:0);
- if( sqlite3AuthCheck(pParse, STQLITE_PRAGMA, zLeft, zRight, zDb) ){
+ if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){
goto pragma_out;
}
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
/*
** PRAGMA [database.]default_cache_size
** PRAGMA [database.]default_cache_size=N
@@ -52160,7 +52160,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "cache_size", P3_STATIC);
addr = sqlite3VdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize);
sqlite3VdbeChangeP1(v, addr, iDb);
- sqlite3VdbeChangeP1(v, addr+5, STQLITE_DEFAULT_CACHE_SIZE);
+ sqlite3VdbeChangeP1(v, addr+5, SQLITE_DEFAULT_CACHE_SIZE);
}else{
int size = atoi(zRight);
if( size<0 ) size = -size;
@@ -52262,7 +52262,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
sqlite3VdbeOp3(v, OP_String8, 0, 0, zRet, 0);
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
}else
-#endif /* STQLITE_OMIT_PAGER_PRAGMAS */
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
/*
** PRAGMA [database.]auto_vacuum
@@ -52270,7 +52270,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
**
** Get or set the (boolean) value of the database 'auto-vacuum' parameter.
*/
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( sqlite3StrICmp(zLeft,"auto_vacuum")==0 ){
Btree *pBt = pDb->pBt;
if( sqlite3ReadSchema(pParse) ){
@@ -52278,7 +52278,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
}
if( !zRight ){
int auto_vacuum =
- pBt ? sqlite3BtreeGetAutoVacuum(pBt) : STQLITE_DEFAULT_AUTOVACUUM;
+ pBt ? sqlite3BtreeGetAutoVacuum(pBt) : SQLITE_DEFAULT_AUTOVACUUM;
returnSingleInt(pParse, "auto_vacuum", auto_vacuum);
}else{
int eAuto = getAutoVacuum(zRight);
@@ -52289,7 +52289,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
** as an auto-vacuum capable db.
*/
int rc = sqlite3BtreeSetAutoVacuum(pBt, eAuto);
- if( rc==STQLITE_OK && (eAuto==1 || eAuto==2) ){
+ if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){
/* When setting the auto_vacuum mode to either "full" or
** "incremental", write the value of meta[6] in the database
** file. Before writing to meta[6], check that meta[3] indicates
@@ -52299,7 +52299,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
{ OP_Transaction, 0, 1, 0}, /* 0 */
{ OP_ReadCookie, 0, 3, 0}, /* 1 */
{ OP_If, 0, 0, 0}, /* 2 */
- { OP_Halt, STQLITE_OK, OE_Abort, 0}, /* 3 */
+ { OP_Halt, SQLITE_OK, OE_Abort, 0}, /* 3 */
{ OP_Integer, 0, 0, 0}, /* 4 */
{ OP_SetCookie, 0, 6, 0}, /* 5 */
};
@@ -52321,7 +52321,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
**
** Do N steps of incremental vacuuming on a database.
*/
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( sqlite3StrICmp(zLeft,"incremental_vacuum")==0 ){
int iLimit, addr;
if( sqlite3ReadSchema(pParse) ){
@@ -52340,7 +52340,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
}else
#endif
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
/*
** PRAGMA [database.]cache_size
** PRAGMA [database.]cache_size=N
@@ -52448,16 +52448,16 @@ STQLITE_PRIVATE void sqlite3Pragma(
}
}
}else
-#endif /* STQLITE_OMIT_PAGER_PRAGMAS */
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
-#ifndef STQLITE_OMIT_FLAG_PRAGMAS
+#ifndef SQLITE_OMIT_FLAG_PRAGMAS
if( flagPragma(pParse, zLeft, zRight) ){
/* The flagPragma() subroutine also generates any necessary code
** there is nothing more to do here */
}else
-#endif /* STQLITE_OMIT_FLAG_PRAGMAS */
+#endif /* SQLITE_OMIT_FLAG_PRAGMAS */
-#ifndef STQLITE_OMIT_SCHEMA_PRAGMAS
+#ifndef SQLITE_OMIT_SCHEMA_PRAGMAS
/*
** PRAGMA table_info(<table>)
**
@@ -52588,9 +52588,9 @@ STQLITE_PRIVATE void sqlite3Pragma(
sqlite3VdbeAddOp(v, OP_Callback, 2, 0);
}
}else
-#endif /* STQLITE_OMIT_SCHEMA_PRAGMAS */
+#endif /* SQLITE_OMIT_SCHEMA_PRAGMAS */
-#ifndef STQLITE_OMIT_FOREIGN_KEY
+#ifndef SQLITE_OMIT_FOREIGN_KEY
if( sqlite3StrICmp(zLeft, "foreign_key_list")==0 && zRight ){
FKey *pFK;
Table *pTab;
@@ -52625,7 +52625,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
}
}
}else
-#endif /* !defined(STQLITE_OMIT_FOREIGN_KEY) */
+#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
#ifndef NDEBUG
if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){
@@ -52648,11 +52648,11 @@ STQLITE_PRIVATE void sqlite3Pragma(
}
}else
-#ifndef STQLITE_INTEGRITY_CHECK_ERROR_MAX
-# define STQLITE_INTEGRITY_CHECK_ERROR_MAX 100
+#ifndef SQLITE_INTEGRITY_CHECK_ERROR_MAX
+# define SQLITE_INTEGRITY_CHECK_ERROR_MAX 100
#endif
-#ifndef STQLITE_OMIT_INTEGRITY_CHECK
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
if( sqlite3StrICmp(zLeft, "integrity_check")==0 ){
int i, j, addr, mxErr;
@@ -52674,11 +52674,11 @@ STQLITE_PRIVATE void sqlite3Pragma(
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "integrity_check", P3_STATIC);
/* Set the maximum error count */
- mxErr = STQLITE_INTEGRITY_CHECK_ERROR_MAX;
+ mxErr = SQLITE_INTEGRITY_CHECK_ERROR_MAX;
if( zRight ){
mxErr = atoi(zRight);
if( mxErr<=0 ){
- mxErr = STQLITE_INTEGRITY_CHECK_ERROR_MAX;
+ mxErr = SQLITE_INTEGRITY_CHECK_ERROR_MAX;
}
}
sqlite3VdbeAddOp(v, OP_MemInt, mxErr, 0);
@@ -52787,9 +52787,9 @@ STQLITE_PRIVATE void sqlite3Pragma(
sqlite3VdbeChangeP1(v, addr+1, mxErr);
sqlite3VdbeJumpHere(v, addr+2);
}else
-#endif /* STQLITE_OMIT_INTEGRITY_CHECK */
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** PRAGMA encoding
** PRAGMA encoding = "utf-8"|"utf-16"|"utf-16le"|"utf-16be"
@@ -52817,14 +52817,14 @@ STQLITE_PRIVATE void sqlite3Pragma(
char *zName;
u8 enc;
} encnames[] = {
- { "UTF-8", STQLITE_UTF8 },
- { "UTF8", STQLITE_UTF8 },
- { "UTF-16le", STQLITE_UTF16LE },
- { "UTF16le", STQLITE_UTF16LE },
- { "UTF-16be", STQLITE_UTF16BE },
- { "UTF16be", STQLITE_UTF16BE },
- { "UTF-16", 0 }, /* STQLITE_UTF16NATIVE */
- { "UTF16", 0 }, /* STQLITE_UTF16NATIVE */
+ { "UTF-8", SQLITE_UTF8 },
+ { "UTF8", SQLITE_UTF8 },
+ { "UTF-16le", SQLITE_UTF16LE },
+ { "UTF16le", SQLITE_UTF16LE },
+ { "UTF-16be", SQLITE_UTF16BE },
+ { "UTF16be", SQLITE_UTF16BE },
+ { "UTF-16", 0 }, /* SQLITE_UTF16NATIVE */
+ { "UTF16", 0 }, /* SQLITE_UTF16NATIVE */
{ 0, 0 }
};
const struct EncName *pEnc;
@@ -52852,7 +52852,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
){
for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){
- ENC(pParse->db) = pEnc->enc ? pEnc->enc : STQLITE_UTF16NATIVE;
+ ENC(pParse->db) = pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE;
break;
}
}
@@ -52862,9 +52862,9 @@ STQLITE_PRIVATE void sqlite3Pragma(
}
}
}else
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
-#ifndef STQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
+#ifndef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
/*
** PRAGMA [database.]schema_version
** PRAGMA [database.]schema_version = <integer>
@@ -52877,17 +52877,17 @@ STQLITE_PRIVATE void sqlite3Pragma(
** the schema-version and the user-version are 32-bit signed integers
** stored in the database header.
**
- ** The schema-cookie is usually only manipulated internally by STQLite. It
- ** is incremented by STQLite whenever the database schema is modified (by
+ ** The schema-cookie is usually only manipulated internally by SQLite. It
+ ** is incremented by SQLite whenever the database schema is modified (by
** creating or dropping a table or index). The schema version is used by
- ** STQLite each time a query is executed to ensure that the internal cache
+ ** SQLite each time a query is executed to ensure that the internal cache
** of the schema used when compiling the SQL query matches the schema of
** the database against which the compiled query is actually executed.
** Subverting this mechanism by using "PRAGMA schema_version" to modify
** the schema-version is potentially dangerous and may lead to program
** crashes or database corruption. Use with caution!
**
- ** The user-version is not used internally by STQLite. It may be used by
+ ** The user-version is not used internally by SQLite. It may be used by
** applications for any purpose.
*/
if( sqlite3StrICmp(zLeft, "schema_version")==0
@@ -52935,9 +52935,9 @@ STQLITE_PRIVATE void sqlite3Pragma(
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLeft, P3_TRANSIENT);
}
}else
-#endif /* STQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */
+#endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */
-#if defined(STQLITE_DEBUG) || defined(STQLITE_TEST)
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
/*
** Report the current state of file logs for all databases
*/
@@ -52968,7 +52968,7 @@ STQLITE_PRIVATE void sqlite3Pragma(
}else
#endif
-#ifdef STQLITE_SSE
+#ifdef SQLITE_SSE
/*
** Check to see if the sqlite_statements table exists. Create it
** if it does not.
@@ -52979,20 +52979,20 @@ STQLITE_PRIVATE void sqlite3Pragma(
}else
#endif
-#if STQLITE_HAS_CODEC
+#if SQLITE_HAS_CODEC
if( sqlite3StrICmp(zLeft, "key")==0 ){
sqlite3_key(db, zRight, strlen(zRight));
}else
#endif
-#if STQLITE_HAS_CODEC || defined(STQLITE_ENABLE_CEROD)
+#if SQLITE_HAS_CODEC || defined(SQLITE_ENABLE_CEROD)
if( sqlite3StrICmp(zLeft, "activate_extensions")==0 ){
-#if STQLITE_HAS_CODEC
+#if SQLITE_HAS_CODEC
if( sqlite3StrNICmp(zRight, "see-", 4)==0 ){
extern void sqlite3_activate_see(const char*);
sqlite3_activate_see(&zRight[4]);
}
#endif
-#ifdef STQLITE_ENABLE_CEROD
+#ifdef SQLITE_ENABLE_CEROD
if( sqlite3StrNICmp(zRight, "cerod-", 6)==0 ){
extern void sqlite3_activate_cerod(const char*);
sqlite3_activate_cerod(&zRight[6]);
@@ -53014,10 +53014,10 @@ STQLITE_PRIVATE void sqlite3Pragma(
** Reset the safety level, in case the fullfsync flag or synchronous
** setting changed.
*/
-#ifndef STQLITE_OMIT_PAGER_PRAGMAS
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
if( db->autoCommit ){
sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level,
- (db->flags&STQLITE_FullFSync)!=0);
+ (db->flags&SQLITE_FullFSync)!=0);
}
#endif
}
@@ -53026,7 +53026,7 @@ pragma_out:
sqliteFree(zRight);
}
-#endif /* STQLITE_OMIT_PRAGMA || STQLITE_OMIT_PARSER */
+#endif /* SQLITE_OMIT_PRAGMA || SQLITE_OMIT_PARSER */
/************** End of pragma.c **********************************************/
/************** Begin file prepare.c *****************************************/
@@ -53057,7 +53057,7 @@ static void corruptSchema(InitData *pData, const char *zExtra){
sqlite3SetString(pData->pzErrMsg, "malformed database schema",
zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0);
}
- pData->rc = STQLITE_CORRUPT;
+ pData->rc = SQLITE_CORRUPT;
}
/*
@@ -53072,16 +53072,16 @@ static void corruptSchema(InitData *pData, const char *zExtra){
** argv[2] = SQL text for the CREATE statement.
**
*/
-STQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
+SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
InitData *pData = (InitData*)pInit;
sqlite3 *db = pData->db;
int iDb = pData->iDb;
- pData->rc = STQLITE_OK;
+ pData->rc = SQLITE_OK;
DbClearProperty(db, iDb, DB_Empty);
if( sqlite3MallocFailed() ){
corruptSchema(pData, 0);
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
assert( argc==3 );
@@ -53104,12 +53104,12 @@ STQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
db->init.newTnum = atoi(argv[1]);
rc = sqlite3_exec(db, argv[2], 0, 0, &zErr);
db->init.iDb = 0;
- assert( rc!=STQLITE_OK || zErr==0 );
- if( STQLITE_OK!=rc ){
+ assert( rc!=SQLITE_OK || zErr==0 );
+ if( SQLITE_OK!=rc ){
pData->rc = rc;
- if( rc==STQLITE_NOMEM ){
+ if( rc==SQLITE_NOMEM ){
sqlite3FailedMalloc();
- }else if( rc!=STQLITE_INTERRUPT ){
+ }else if( rc!=SQLITE_INTERRUPT ){
corruptSchema(pData, zErr);
}
sqlite3_free(zErr);
@@ -53143,7 +53143,7 @@ STQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
** data structures for a single database file. The index of the
** database file is given by iDb. iDb==0 is used for the main
** database. iDb==1 should never be used. iDb>=2 is used for
-** auxiliary databases. Return one of the STQLITE_ error codes to
+** auxiliary databases. Return one of the SQLITE_ error codes to
** indicate success or failure.
*/
static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
@@ -53170,7 +53170,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
" sql text\n"
")"
;
-#ifndef STQLITE_OMIT_TEMPDB
+#ifndef SQLITE_OMIT_TEMPDB
static const char temp_master_schema[] =
"CREATE TEMP TABLE sqlite_temp_master(\n"
" type text,\n"
@@ -53225,10 +53225,10 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
if( !OMIT_TEMPDB && iDb==1 ){
DbSetProperty(db, 1, DB_SchemaLoaded);
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
rc = sqlite3BtreeCursor(pDb->pBt, MASTER_ROOT, 0, 0, 0, &curMain);
- if( rc!=STQLITE_OK && rc!=STQLITE_EMPTY ){
+ if( rc!=SQLITE_OK && rc!=SQLITE_EMPTY ){
sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0);
return rc;
}
@@ -53247,12 +53247,12 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
** meta[8]
** meta[9]
**
- ** Note: The #defined STQLITE_UTF* symbols in sqliteInt.h correspond to
+ ** Note: The #defined SQLITE_UTF* symbols in sqliteInt.h correspond to
** the possible values of meta[4].
*/
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
int i;
- for(i=0; rc==STQLITE_OK && i<sizeof(meta)/sizeof(meta[0]); i++){
+ for(i=0; rc==SQLITE_OK && i<sizeof(meta)/sizeof(meta[0]); i++){
rc = sqlite3BtreeGetMeta(pDb->pBt, i+1, (u32 *)&meta[i]);
}
if( rc ){
@@ -53274,14 +53274,14 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
if( iDb==0 ){
/* If opening the main database, set ENC(db). */
ENC(db) = (u8)meta[4];
- db->pDfltColl = sqlite3FindCollSeq(db, STQLITE_UTF8, "BINARY", 6, 0);
+ db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0);
}else{
/* If opening an attached database, the encoding much match ENC(db) */
if( meta[4]!=ENC(db) ){
sqlite3BtreeCloseCursor(curMain);
sqlite3SetString(pzErrMsg, "attached databases must use the same"
" text encoding as main database", (char*)0);
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
}
}else{
@@ -53290,7 +53290,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
pDb->pSchema->enc = ENC(db);
size = meta[2];
- if( size==0 ){ size = STQLITE_DEFAULT_CACHE_SIZE; }
+ if( size==0 ){ size = SQLITE_DEFAULT_CACHE_SIZE; }
pDb->pSchema->cache_size = size;
sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
@@ -53304,19 +53304,19 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
if( pDb->pSchema->file_format==0 ){
pDb->pSchema->file_format = 1;
}
- if( pDb->pSchema->file_format>STQLITE_MAX_FILE_FORMAT ){
+ if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
sqlite3BtreeCloseCursor(curMain);
sqlite3SetString(pzErrMsg, "unsupported file format", (char*)0);
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
/* Read the schema information out of the schema tables
*/
assert( db->init.busy );
- if( rc==STQLITE_EMPTY ){
+ if( rc==SQLITE_EMPTY ){
/* For an empty database, there is nothing to read */
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}else{
char *zSql;
zSql = sqlite3MPrintf(
@@ -53324,11 +53324,11 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
db->aDb[iDb].zName, zMasterName);
sqlite3SafetyOff(db);
rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0);
- if( rc==STQLITE_ABORT ) rc = initData.rc;
+ if( rc==SQLITE_ABORT ) rc = initData.rc;
sqlite3SafetyOn(db);
sqliteFree(zSql);
-#ifndef STQLITE_OMIT_ANALYZE
- if( rc==STQLITE_OK ){
+#ifndef SQLITE_OMIT_ANALYZE
+ if( rc==SQLITE_OK ){
sqlite3AnalysisLoad(db, iDb);
}
#endif
@@ -53336,11 +53336,11 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
}
if( sqlite3MallocFailed() ){
/* sqlite3SetString(pzErrMsg, "out of memory", (char*)0); */
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
sqlite3ResetInternalSchema(db, 0);
}
- if( rc==STQLITE_OK || (db->flags&STQLITE_RecoveryMode)){
- /* Black magic: If the STQLITE_RecoveryMode flag is set, then consider
+ if( rc==SQLITE_OK || (db->flags&SQLITE_RecoveryMode)){
+ /* Black magic: If the SQLITE_RecoveryMode flag is set, then consider
** the schema loaded, even if errors occured. In this situation the
** current sqlite3_prepare() operation will fail, but the following one
** will attempt to compile the supplied statement against whatever subset
@@ -53349,7 +53349,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
** even when it's contents have been corrupted.
*/
DbSetProperty(db, iDb, DB_SchemaLoaded);
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}
return rc;
}
@@ -53364,14 +53364,14 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
** bit is set in the flags field of the Db structure. If the database
** file was of zero-length, then the DB_Empty flag is also set.
*/
-STQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
+SQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
int i, rc;
int called_initone = 0;
- if( db->init.busy ) return STQLITE_OK;
- rc = STQLITE_OK;
+ if( db->init.busy ) return SQLITE_OK;
+ rc = SQLITE_OK;
db->init.busy = 1;
- for(i=0; rc==STQLITE_OK && i<db->nDb; i++){
+ for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue;
rc = sqlite3InitOne(db, i, pzErrMsg);
if( rc ){
@@ -53384,8 +53384,8 @@ STQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
** for the TEMP database. This is loaded last, as the TEMP database
** schema may contain references to objects in other databases.
*/
-#ifndef STQLITE_OMIT_TEMPDB
- if( rc==STQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){
+#ifndef SQLITE_OMIT_TEMPDB
+ if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){
rc = sqlite3InitOne(db, 1, pzErrMsg);
if( rc ){
sqlite3ResetInternalSchema(db, 1);
@@ -53395,7 +53395,7 @@ STQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
#endif
db->init.busy = 0;
- if( rc==STQLITE_OK && called_initone ){
+ if( rc==SQLITE_OK && called_initone ){
sqlite3CommitInternalChanges(db);
}
@@ -53406,13 +53406,13 @@ STQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
** This routine is a no-op if the database schema is already initialised.
** Otherwise, the schema is loaded. An error code is returned.
*/
-STQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse){
+ int rc = SQLITE_OK;
sqlite3 *db = pParse->db;
if( !db->init.busy ){
rc = sqlite3Init(db, &pParse->zErrMsg);
}
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
pParse->rc = rc;
pParse->nErr++;
}
@@ -53436,9 +53436,9 @@ static int schemaIsValid(sqlite3 *db){
pBt = db->aDb[iDb].pBt;
if( pBt==0 ) continue;
rc = sqlite3BtreeCursor(pBt, MASTER_ROOT, 0, 0, 0, &curTemp);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = sqlite3BtreeGetMeta(pBt, 1, (u32 *)&cookie);
- if( rc==STQLITE_OK && cookie!=db->aDb[iDb].pSchema->schema_cookie ){
+ if( rc==SQLITE_OK && cookie!=db->aDb[iDb].pSchema->schema_cookie ){
allOk = 0;
}
sqlite3BtreeCloseCursor(curTemp);
@@ -53454,7 +53454,7 @@ static int schemaIsValid(sqlite3 *db){
** If the same database is attached more than once, the first
** attached database is returned.
*/
-STQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
+SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
int i = -1000000;
/* If pSchema is NULL, then return -1000000. This happens when code in
@@ -53481,7 +53481,7 @@ STQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
/*
** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
*/
-STQLITE_PRIVATE int sqlite3Prepare(
+SQLITE_PRIVATE int sqlite3Prepare(
sqlite3 *db, /* Database handle. */
const char *zSql, /* UTF-8 encoded SQL statement. */
int nBytes, /* Length of zSql in bytes. */
@@ -53491,7 +53491,7 @@ STQLITE_PRIVATE int sqlite3Prepare(
){
Parse sParse;
char *zErrMsg = 0;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
int i;
/* Assert that malloc() has not failed */
@@ -53500,19 +53500,19 @@ STQLITE_PRIVATE int sqlite3Prepare(
assert( ppStmt );
*ppStmt = 0;
if( sqlite3SafetyOn(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
/* If any attached database schemas are locked, do not proceed with
- ** compilation. Instead return STQLITE_LOCKED immediately.
+ ** compilation. Instead return SQLITE_LOCKED immediately.
*/
for(i=0; i<db->nDb; i++) {
Btree *pBt = db->aDb[i].pBt;
if( pBt && sqlite3BtreeSchemaLocked(pBt) ){
const char *zDb = db->aDb[i].zName;
- sqlite3Error(db, STQLITE_LOCKED, "database schema is locked: %s", zDb);
+ sqlite3Error(db, SQLITE_LOCKED, "database schema is locked: %s", zDb);
sqlite3SafetyOff(db);
- return STQLITE_LOCKED;
+ return SQLITE_LOCKED;
}
}
@@ -53520,8 +53520,8 @@ STQLITE_PRIVATE int sqlite3Prepare(
sParse.db = db;
if( nBytes>=0 && zSql[nBytes]!=0 ){
char *zSqlCopy;
- if( nBytes>STQLITE_MAX_STQL_LENGTH ){
- return STQLITE_TOOBIG;
+ if( nBytes>SQLITE_MAX_SQL_LENGTH ){
+ return SQLITE_TOOBIG;
}
zSqlCopy = sqlite3StrNDup(zSql, nBytes);
if( zSqlCopy ){
@@ -53534,25 +53534,25 @@ STQLITE_PRIVATE int sqlite3Prepare(
}
if( sqlite3MallocFailed() ){
- sParse.rc = STQLITE_NOMEM;
+ sParse.rc = SQLITE_NOMEM;
}
- if( sParse.rc==STQLITE_DONE ) sParse.rc = STQLITE_OK;
+ if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK;
if( sParse.checkSchema && !schemaIsValid(db) ){
- sParse.rc = STQLITE_SCHEMA;
+ sParse.rc = SQLITE_SCHEMA;
}
- if( sParse.rc==STQLITE_SCHEMA ){
+ if( sParse.rc==SQLITE_SCHEMA ){
sqlite3ResetInternalSchema(db, 0);
}
if( sqlite3MallocFailed() ){
- sParse.rc = STQLITE_NOMEM;
+ sParse.rc = SQLITE_NOMEM;
}
if( pzTail ){
*pzTail = sParse.zTail;
}
rc = sParse.rc;
-#ifndef STQLITE_OMIT_EXPLAIN
- if( rc==STQLITE_OK && sParse.pVdbe && sParse.explain ){
+#ifndef SQLITE_OMIT_EXPLAIN
+ if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){
if( sParse.explain==2 ){
sqlite3VdbeSetNumCols(sParse.pVdbe, 3);
sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "order", P3_STATIC);
@@ -53570,13 +53570,13 @@ STQLITE_PRIVATE int sqlite3Prepare(
#endif
if( sqlite3SafetyOff(db) ){
- rc = STQLITE_MISUSE;
+ rc = SQLITE_MISUSE;
}
if( saveSqlFlag ){
sqlite3VdbeSetSql(sParse.pVdbe, zSql, sParse.zTail - zSql);
}
- if( rc!=STQLITE_OK || sqlite3MallocFailed() ){
+ if( rc!=SQLITE_OK || sqlite3MallocFailed() ){
sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe);
assert(!(*ppStmt));
}else{
@@ -53601,7 +53601,7 @@ STQLITE_PRIVATE int sqlite3Prepare(
** Return true if the statement was recompiled successfully.
** Return false if there is an error of some kind.
*/
-STQLITE_PRIVATE int sqlite3Reprepare(Vdbe *p){
+SQLITE_PRIVATE int sqlite3Reprepare(Vdbe *p){
int rc;
sqlite3_stmt *pNew;
const char *zSql;
@@ -53630,12 +53630,12 @@ STQLITE_PRIVATE int sqlite3Reprepare(Vdbe *p){
/*
** Two versions of the official API. Legacy and new use. In the legacy
** version, the original SQL text is not saved in the prepared statement
-** and so if a schema change occurs, STQLITE_SCHEMA is returned by
+** and so if a schema change occurs, SQLITE_SCHEMA is returned by
** sqlite3_step(). In the new version, the original SQL text is retained
** and the statement is automatically recompiled if an schema change
** occurs.
*/
-STQLITE_API int sqlite3_prepare(
+SQLITE_API int sqlite3_prepare(
sqlite3 *db, /* Database handle. */
const char *zSql, /* UTF-8 encoded SQL statement. */
int nBytes, /* Length of zSql in bytes. */
@@ -53655,7 +53655,7 @@ int sqlite3_prepare_v2(
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** Compile the UTF-16 encoded SQL statement zSql into a statement handle.
*/
@@ -53673,10 +53673,10 @@ static int sqlite3Prepare16(
*/
char *zSql8;
const char *zTail8 = 0;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
zSql8 = sqlite3Utf16to8(zSql, nBytes);
if( zSql8 ){
@@ -53699,12 +53699,12 @@ static int sqlite3Prepare16(
/*
** Two versions of the official API. Legacy and new use. In the legacy
** version, the original SQL text is not saved in the prepared statement
-** and so if a schema change occurs, STQLITE_SCHEMA is returned by
+** and so if a schema change occurs, SQLITE_SCHEMA is returned by
** sqlite3_step(). In the new version, the original SQL text is retained
** and the statement is automatically recompiled if an schema change
** occurs.
*/
-STQLITE_API int sqlite3_prepare16(
+SQLITE_API int sqlite3_prepare16(
sqlite3 *db, /* Database handle. */
const void *zSql, /* UTF-8 encoded SQL statement. */
int nBytes, /* Length of zSql in bytes. */
@@ -53723,7 +53723,7 @@ int sqlite3_prepare16_v2(
return sqlite3Prepare16(db,zSql,nBytes,1,ppStmt,pzTail);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
/************** End of prepare.c *********************************************/
/************** Begin file select.c ******************************************/
@@ -53739,7 +53739,7 @@ int sqlite3_prepare16_v2(
**
*************************************************************************
** This file contains C code routines that are called by the parser
-** to handle SELECT statements in STQLite.
+** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.354 2007/07/18 18:17:12 drh Exp $
*/
@@ -53766,7 +53766,7 @@ static void clearSelect(Select *p){
** Allocate a new Select structure and return a pointer to that
** structure.
*/
-STQLITE_PRIVATE Select *sqlite3SelectNew(
+SQLITE_PRIVATE Select *sqlite3SelectNew(
ExprList *pEList, /* which columns to include in the result */
SrcList *pSrc, /* the FROM clause -- which tables to scan */
Expr *pWhere, /* the WHERE clause */
@@ -53814,7 +53814,7 @@ STQLITE_PRIVATE Select *sqlite3SelectNew(
/*
** Delete the given Select structure and all of its substructures.
*/
-STQLITE_PRIVATE void sqlite3SelectDelete(Select *p){
+SQLITE_PRIVATE void sqlite3SelectDelete(Select *p){
if( p ){
clearSelect(p);
sqliteFree(p);
@@ -53838,7 +53838,7 @@ STQLITE_PRIVATE void sqlite3SelectDelete(Select *p){
** If an illegal or unsupported join type is seen, then still return
** a join type, but put an error in the pParse structure.
*/
-STQLITE_PRIVATE int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
+SQLITE_PRIVATE int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
int jointype = 0;
Token *apAll[3];
Token *p;
@@ -53930,7 +53930,7 @@ static void setQuotedToken(Token *p, const char *z){
/*
** Create an expression node for an identifier with the name of zName
*/
-STQLITE_PRIVATE Expr *sqlite3CreateIdExpr(const char *zName){
+SQLITE_PRIVATE Expr *sqlite3CreateIdExpr(const char *zName){
Token dummy;
setToken(&dummy, zName);
return sqlite3Expr(TK_ID, 0, 0, &dummy);
@@ -54262,7 +54262,7 @@ static int selectInnerLoop(
/* In this mode, write each query result to the key of the temporary
** table iParm.
*/
-#ifndef STQLITE_OMIT_COMPOUND_SELECT
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
case SRT_Union: {
sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
if( aff ){
@@ -54301,7 +54301,7 @@ static int selectInnerLoop(
break;
}
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
/* If we are creating a set for an "expr IN (SELECT ...)" construct,
** then there should be a single item on the stack. Write this
** item into the set table with bogus data.
@@ -54352,7 +54352,7 @@ static int selectInnerLoop(
}
break;
}
-#endif /* #ifndef STQLITE_OMIT_SUBTQUERY */
+#endif /* #ifndef SQLITE_OMIT_SUBTQUERY */
/* Send the data to the callback function or to a subroutine. In the
** case of a subroutine, the subroutine itself is responsible for
@@ -54371,7 +54371,7 @@ static int selectInnerLoop(
break;
}
-#if !defined(STQLITE_OMIT_TRIGGER)
+#if !defined(SQLITE_OMIT_TRIGGER)
/* Discard the results. This is used for SELECT statements inside
** the body of a TRIGGER. The purpose of such selects is to call
** user-defined functions that have side effects. We do not care
@@ -54477,7 +54477,7 @@ static void generateSortTail(
sqlite3VdbeAddOp(v, OP_Insert, iParm, OPFLAG_APPEND);
break;
}
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
case SRT_Set: {
assert( nColumn==1 );
sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3);
@@ -54638,7 +54638,7 @@ static const char *columnType(
}
break;
}
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
case TK_SELECT: {
/* The expression is a sub-select. Return the declaration type and
** origin info for the single column in the result set of the SELECT
@@ -54712,7 +54712,7 @@ static void generateColumnNames(
sqlite3 *db = pParse->db;
int fullNames, shortNames;
-#ifndef STQLITE_OMIT_EXPLAIN
+#ifndef SQLITE_OMIT_EXPLAIN
/* If this is an EXPLAIN, skip this step */
if( pParse->explain ){
return;
@@ -54722,8 +54722,8 @@ static void generateColumnNames(
assert( v!=0 );
if( pParse->colNamesSet || v==0 || sqlite3MallocFailed() ) return;
pParse->colNamesSet = 1;
- fullNames = (db->flags & STQLITE_FullColNames)!=0;
- shortNames = (db->flags & STQLITE_ShortColNames)!=0;
+ fullNames = (db->flags & SQLITE_FullColNames)!=0;
+ shortNames = (db->flags & SQLITE_ShortColNames)!=0;
sqlite3VdbeSetNumCols(v, pEList->nExpr);
for(i=0; i<pEList->nExpr; i++){
Expr *p;
@@ -54774,7 +54774,7 @@ static void generateColumnNames(
generateColumnTypes(pParse, pTabList, pEList);
}
-#ifndef STQLITE_OMIT_COMPOUND_SELECT
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
/*
** Name of the connection operator, used for error messages.
*/
@@ -54788,7 +54788,7 @@ static const char *selectOpName(int id){
}
return z;
}
-#endif /* STQLITE_OMIT_COMPOUND_SELECT */
+#endif /* SQLITE_OMIT_COMPOUND_SELECT */
/*
** Forward declaration
@@ -54799,7 +54799,7 @@ static int prepSelectStmt(Parse*, Select*);
** Given a SELECT statement, generate a Table structure that describes
** the result set of that SELECT.
*/
-STQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
+SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
Table *pTab;
int i, j;
ExprList *pEList;
@@ -54943,7 +54943,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
return 0;
}
if( pFrom->zName==0 ){
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
/* A sub-query in the FROM clause of a SELECT */
assert( pFrom->pSelect!=0 );
if( pFrom->zAlias==0 ){
@@ -54971,7 +54971,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
return 1;
}
pTab->nRef++;
-#if !defined(STQLITE_OMIT_VIEW) || !defined (STQLITE_OMIT_VIRTUALTABLE)
+#if !defined(SQLITE_OMIT_VIEW) || !defined (SQLITE_OMIT_VIRTUALTABLE)
if( pTab->pSelect || IsVirtual(pTab) ){
/* We reach here if the named table is a really a view */
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
@@ -55020,8 +55020,8 @@ static int prepSelectStmt(Parse *pParse, Select *p){
struct ExprList_item *a = pEList->a;
ExprList *pNew = 0;
int flags = pParse->db->flags;
- int longNames = (flags & STQLITE_FullColNames)!=0 &&
- (flags & STQLITE_ShortColNames)==0;
+ int longNames = (flags & SQLITE_FullColNames)!=0 &&
+ (flags & SQLITE_ShortColNames)==0;
for(k=0; k<pEList->nExpr; k++){
Expr *pE = a[k].pExpr;
@@ -55124,17 +55124,17 @@ static int prepSelectStmt(Parse *pParse, Select *p){
sqlite3ExprListDelete(pEList);
p->pEList = pNew;
}
- if( p->pEList && p->pEList->nExpr>STQLITE_MAX_COLUMN ){
+ if( p->pEList && p->pEList->nExpr>SQLITE_MAX_COLUMN ){
sqlite3ErrorMsg(pParse, "too many columns in result set");
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
if( sqlite3MallocFailed() ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
}
return rc;
}
-#ifndef STQLITE_OMIT_COMPOUND_SELECT
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
/*
** This routine associates entries in an ORDER BY expression list with
** columns in a result. For each ORDER BY expression, the opcode of
@@ -55223,13 +55223,13 @@ static int matchOrderbyToColumn(
}
return nErr;
}
-#endif /* #ifndef STQLITE_OMIT_COMPOUND_SELECT */
+#endif /* #ifndef SQLITE_OMIT_COMPOUND_SELECT */
/*
** Get a VDBE for the given parser context. Create a new one if necessary.
** If an error occurs, return NULL and leave a message in pParse.
*/
-STQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse *pParse){
+SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse *pParse){
Vdbe *v = pParse->pVdbe;
if( v==0 ){
v = pParse->pVdbe = sqlite3VdbeCreate(pParse->db);
@@ -55323,7 +55323,7 @@ static void createSortingIndex(Parse *pParse, Select *p, ExprList *pOrderBy){
}
}
-#ifndef STQLITE_OMIT_COMPOUND_SELECT
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
/*
** Return the appropriate collating sequence for the iCol-th column of
** the result set for the compound-select statement "p". Return NULL if
@@ -55344,9 +55344,9 @@ static CollSeq *multiSelectCollSeq(Parse *pParse, Select *p, int iCol){
}
return pRet;
}
-#endif /* STQLITE_OMIT_COMPOUND_SELECT */
+#endif /* SQLITE_OMIT_COMPOUND_SELECT */
-#ifndef STQLITE_OMIT_COMPOUND_SELECT
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
/*
** This routine is called to process a query that is really the union
** or intersection of two or more separate queries.
@@ -55374,7 +55374,7 @@ static CollSeq *multiSelectCollSeq(Parse *pParse, Select *p, int iCol){
** So if this routine is called with p equal to the t3 query, then
** pPrior will be the t2 query. p->op will be TK_UNION in this case.
**
-** Notice that because of the way STQLite parses compound SELECTs, the
+** Notice that because of the way SQLite parses compound SELECTs, the
** individual selects always group from left to right.
*/
static int multiSelect(
@@ -55384,7 +55384,7 @@ static int multiSelect(
int iParm, /* / by these two parameters. */
char *aff /* If eDest is SRT_Union, the affinity string */
){
- int rc = STQLITE_OK; /* Success code from a subroutine */
+ int rc = SQLITE_OK; /* Success code from a subroutine */
Select *pPrior; /* Another SELECT immediately to our left */
Vdbe *v; /* Generate code to this VDBE */
int nCol; /* Number of columns in the result set */
@@ -55692,7 +55692,7 @@ static int multiSelect(
nKeyCol = nCol + (pOrderBy ? pOrderBy->nExpr : 0);
pKeyInfo = sqliteMalloc(sizeof(*pKeyInfo)+nKeyCol*(sizeof(CollSeq*) + 1));
if( !pKeyInfo ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto multi_select_end;
}
@@ -55771,9 +55771,9 @@ static int multiSelect(
multi_select_end:
return rc;
}
-#endif /* STQLITE_OMIT_COMPOUND_SELECT */
+#endif /* SQLITE_OMIT_COMPOUND_SELECT */
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
/*
** Scan through the expression pExpr. Replace every reference to
** a column in table number iTable with a copy of the iColumn-th
@@ -55839,9 +55839,9 @@ static void substSelect(Select *p, int iTable, ExprList *pEList){
substExpr(p->pWhere, iTable, pEList);
substSelect(p->pPrior, iTable, pEList);
}
-#endif /* !defined(STQLITE_OMIT_VIEW) */
+#endif /* !defined(SQLITE_OMIT_VIEW) */
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
/*
** This routine attempts to flatten subqueries in order to speed
** execution. It returns 1 if it makes changes and 0 if no flattening
@@ -56108,7 +56108,7 @@ static int flattenSubquery(
sqlite3SelectDelete(pSub);
return 1;
}
-#endif /* STQLITE_OMIT_VIEW */
+#endif /* SQLITE_OMIT_VIEW */
/*
** Analyze the SELECT statement passed in as an argument to see if it
@@ -56242,7 +56242,7 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
sqlite3VdbeAddOp(v, OP_MakeRecord, 1, 0);
seekOp = OP_MoveGt;
}
- if( pIdx->aSortOrder[0]==STQLITE_SO_DESC ){
+ if( pIdx->aSortOrder[0]==SQLITE_SO_DESC ){
/* Ticket #2514: invert the seek operator if we are using
** a descending index. */
if( seekOp==OP_Last ){
@@ -56287,7 +56287,7 @@ static int processOrderGroupBy(
assert( pEList );
if( pOrderBy==0 ) return 0;
- if( pOrderBy->nExpr>STQLITE_MAX_COLUMN ){
+ if( pOrderBy->nExpr>SQLITE_MAX_COLUMN ){
sqlite3ErrorMsg(pParse, "too many terms in %s BY clause", zType);
return 1;
}
@@ -56324,7 +56324,7 @@ static int processOrderGroupBy(
** is a sub-select, then pOuterNC is a pointer to the NameContext
** of the parent SELECT.
*/
-STQLITE_PRIVATE int sqlite3SelectResolve(
+SQLITE_PRIVATE int sqlite3SelectResolve(
Parse *pParse, /* The parser context */
Select *p, /* The SELECT statement being coded. */
NameContext *pOuterNC /* The outer name context. May be NULL. */
@@ -56337,20 +56337,20 @@ STQLITE_PRIVATE int sqlite3SelectResolve(
/* If this routine has run before, return immediately. */
if( p->isResolved ){
assert( !pOuterNC );
- return STQLITE_OK;
+ return SQLITE_OK;
}
p->isResolved = 1;
/* If there have already been errors, do nothing. */
if( pParse->nErr>0 ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
/* Prepare the select statement. This call will allocate all cursors
** required to handle the tables and subqueries in the FROM clause.
*/
if( prepSelectStmt(pParse, p) ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
/* Resolve the expressions in the LIMIT and OFFSET clauses. These
@@ -56360,7 +56360,7 @@ STQLITE_PRIVATE int sqlite3SelectResolve(
sNC.pParse = pParse;
if( sqlite3ExprResolveNames(&sNC, p->pLimit) ||
sqlite3ExprResolveNames(&sNC, p->pOffset) ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
/* Set up the local name-context to pass to ExprResolveNames() to
@@ -56372,11 +56372,11 @@ STQLITE_PRIVATE int sqlite3SelectResolve(
/* Resolve names in the result set. */
pEList = p->pEList;
- if( !pEList ) return STQLITE_ERROR;
+ if( !pEList ) return SQLITE_ERROR;
for(i=0; i<pEList->nExpr; i++){
Expr *pX = pEList->a[i].pExpr;
if( sqlite3ExprResolveNames(&sNC, pX) ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
}
@@ -56395,7 +56395,7 @@ STQLITE_PRIVATE int sqlite3SelectResolve(
*/
if( p->pHaving && !pGroupBy ){
sqlite3ErrorMsg(pParse, "a GROUP BY clause is required before HAVING");
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
/* Add the expression list to the name-context before parsing the
@@ -56409,17 +56409,17 @@ STQLITE_PRIVATE int sqlite3SelectResolve(
sNC.pEList = p->pEList;
if( sqlite3ExprResolveNames(&sNC, p->pWhere) ||
sqlite3ExprResolveNames(&sNC, p->pHaving) ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
if( p->pPrior==0 ){
if( processOrderGroupBy(&sNC, p->pOrderBy, "ORDER") ||
processOrderGroupBy(&sNC, pGroupBy, "GROUP") ){
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
}
if( sqlite3MallocFailed() ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
/* Make sure the GROUP BY clause does not contain aggregate functions.
@@ -56431,7 +56431,7 @@ STQLITE_PRIVATE int sqlite3SelectResolve(
if( ExprHasProperty(pItem->pExpr, EP_Agg) ){
sqlite3ErrorMsg(pParse, "aggregate functions are not allowed in "
"the GROUP BY clause");
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
}
}
@@ -56442,7 +56442,7 @@ STQLITE_PRIVATE int sqlite3SelectResolve(
if( p->pPrior ){
return sqlite3SelectResolve(pParse, p->pPrior, pOuterNC);
}else{
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
@@ -56599,7 +56599,7 @@ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){
** the second element in a three-way join, the parentTab parameter will
** be 1 (the 2nd value of a 0-indexed array.)
*/
-STQLITE_PRIVATE int sqlite3Select(
+SQLITE_PRIVATE int sqlite3Select(
Parse *pParse, /* The parser context */
Select *p, /* The SELECT statement being coded. */
int eDest, /* How to dispose of the results */
@@ -56629,10 +56629,10 @@ STQLITE_PRIVATE int sqlite3Select(
if( p==0 || sqlite3MallocFailed() || pParse->nErr ){
return 1;
}
- if( sqlite3AuthCheck(pParse, STQLITE_SELECT, 0, 0, 0) ) return 1;
+ if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
memset(&sAggInfo, 0, sizeof(sAggInfo));
-#ifndef STQLITE_OMIT_COMPOUND_SELECT
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
/* If there is are a sequence of queries, do the earlier ones first.
*/
if( p->pPrior ){
@@ -56642,7 +56642,7 @@ STQLITE_PRIVATE int sqlite3Select(
for(pLoop=p; pLoop; pLoop=pLoop->pPrior, cnt++){
pLoop->pRightmost = p;
}
- if( STQLITE_MAX_COMPOUND_SELECT>0 && cnt>STQLITE_MAX_COMPOUND_SELECT ){
+ if( SQLITE_MAX_COMPOUND_SELECT>0 && cnt>SQLITE_MAX_COMPOUND_SELECT ){
sqlite3ErrorMsg(pParse, "too many terms in compound SELECT");
return 1;
}
@@ -56680,7 +56680,7 @@ STQLITE_PRIVATE int sqlite3Select(
/* If writing to memory or generating a set
** only a single column may be output.
*/
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
if( checkForMultiColumnSelectError(pParse, eDest, pEList->nExpr) ){
goto select_end;
}
@@ -56699,7 +56699,7 @@ STQLITE_PRIVATE int sqlite3Select(
/* Generate code for all sub-queries in the FROM clause
*/
-#if !defined(STQLITE_OMIT_SUBTQUERY) || !defined(STQLITE_OMIT_VIEW)
+#if !defined(SQLITE_OMIT_SUBTQUERY) || !defined(SQLITE_OMIT_VIEW)
for(i=0; i<pTabList->nSrc; i++){
const char *zSavedAuthContext = 0;
int needRestoreContext;
@@ -56713,11 +56713,11 @@ STQLITE_PRIVATE int sqlite3Select(
}else{
needRestoreContext = 0;
}
-#if STQLITE_MAX_EXPR_DEPTH>0
+#if SQLITE_MAX_EXPR_DEPTH>0
/* Increment Parse.nHeight by the height of the largest expression
** tree refered to by this, the parent select. The child select
** may contain expression trees of at most
- ** (STQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
+ ** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
** more conservative than necessary, but much easier than enforcing
** an exact limit.
*/
@@ -56725,7 +56725,7 @@ STQLITE_PRIVATE int sqlite3Select(
#endif
sqlite3Select(pParse, pItem->pSelect, SRT_EphemTab,
pItem->iCursor, p, i, &isAgg, 0);
-#if STQLITE_MAX_EXPR_DEPTH>0
+#if SQLITE_MAX_EXPR_DEPTH>0
pParse->nHeight -= sqlite3SelectExprHeight(p);
#endif
if( needRestoreContext ){
@@ -56753,7 +56753,7 @@ STQLITE_PRIVATE int sqlite3Select(
/* Check to see if this is a subquery that can be "flattened" into its parent.
** If flattening is a possiblity, do so and return immediately.
*/
-#ifndef STQLITE_OMIT_VIEW
+#ifndef SQLITE_OMIT_VIEW
if( pParent && pParentAgg &&
flattenSubquery(pParent, parentTab, *pParentAgg, isAgg) ){
if( isAgg ) *pParentAgg = 1;
@@ -57097,7 +57097,7 @@ STQLITE_PRIVATE int sqlite3Select(
generateSortTail(pParse, p, v, pEList->nExpr, eDest, iParm);
}
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
/* If this was a subquery, we have now converted the subquery into a
** temporary table. So set the SrcList_item.isPopulated flag to prevent
** this subquery from being evaluated again and to force the use of
@@ -57127,7 +57127,7 @@ select_end:
/* Identify column names if we will be using them in a callback. This
** step is skipped if the output is going to some other destination.
*/
- if( rc==STQLITE_OK && eDest==SRT_Callback ){
+ if( rc==SQLITE_OK && eDest==SRT_Callback ){
generateColumnNames(pParse, pTabList, pEList);
}
@@ -57136,7 +57136,7 @@ select_end:
return rc;
}
-#if defined(STQLITE_DEBUG)
+#if defined(SQLITE_DEBUG)
/*
*******************************************************************************
** The following code is used for testing and debugging only. The code
@@ -57151,7 +57151,7 @@ select_end:
** code base. Then are intended to be called from within the debugger
** or from temporary "printf" statements inserted for debugging.
*/
-STQLITE_PRIVATE void sqlite3PrintExpr(Expr *p){
+SQLITE_PRIVATE void sqlite3PrintExpr(Expr *p){
if( p->token.z && p->token.n>0 ){
sqlite3DebugPrintf("(%.*s", p->token.n, p->token.z);
}else{
@@ -57167,7 +57167,7 @@ STQLITE_PRIVATE void sqlite3PrintExpr(Expr *p){
}
sqlite3DebugPrintf(")");
}
-STQLITE_PRIVATE void sqlite3PrintExprList(ExprList *pList){
+SQLITE_PRIVATE void sqlite3PrintExprList(ExprList *pList){
int i;
for(i=0; i<pList->nExpr; i++){
sqlite3PrintExpr(pList->a[i].pExpr);
@@ -57176,7 +57176,7 @@ STQLITE_PRIVATE void sqlite3PrintExprList(ExprList *pList){
}
}
}
-STQLITE_PRIVATE void sqlite3PrintSelect(Select *p, int indent){
+SQLITE_PRIVATE void sqlite3PrintSelect(Select *p, int indent){
sqlite3DebugPrintf("%*sSELECT(%p) ", indent, "", p);
sqlite3PrintExprList(p->pEList);
sqlite3DebugPrintf("\n");
@@ -57230,7 +57230,7 @@ STQLITE_PRIVATE void sqlite3PrintSelect(Select *p, int indent){
}
/* End of the structure debug printing code
*****************************************************************************/
-#endif /* defined(STQLITE_TEST) || defined(STQLITE_DEBUG) */
+#endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
/************** End of select.c **********************************************/
/************** Begin file table.c *******************************************/
@@ -57253,7 +57253,7 @@ STQLITE_PRIVATE void sqlite3PrintSelect(Select *p, int indent){
** if they are not used.
*/
-#ifndef STQLITE_OMIT_GET_TABLE
+#ifndef SQLITE_OMIT_GET_TABLE
/*
** This structure is used to pass data from sqlite3_get_table() through
@@ -57314,7 +57314,7 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
sqlite3SetString(&p->zErrMsg,
"sqlite3_get_table() called with two or more incompatible queries",
(char*)0);
- p->rc = STQLITE_ERROR;
+ p->rc = SQLITE_ERROR;
return 1;
}
@@ -57337,7 +57337,7 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
return 0;
malloc_failed:
- p->rc = STQLITE_NOMEM;
+ p->rc = SQLITE_NOMEM;
return 1;
}
@@ -57361,7 +57361,7 @@ int sqlite3_get_table(
){
int rc;
TabResult res;
- if( pazResult==0 ){ return STQLITE_ERROR; }
+ if( pazResult==0 ){ return SQLITE_ERROR; }
*pazResult = 0;
if( pnColumn ) *pnColumn = 0;
if( pnRow ) *pnRow = 0;
@@ -57371,16 +57371,16 @@ int sqlite3_get_table(
res.nColumn = 0;
res.nData = 1;
res.nAlloc = 20;
- res.rc = STQLITE_OK;
+ res.rc = SQLITE_OK;
res.azResult = sqlite3_malloc( sizeof(char*)*res.nAlloc );
- if( res.azResult==0 ) return STQLITE_NOMEM;
+ if( res.azResult==0 ) return SQLITE_NOMEM;
res.azResult[0] = 0;
rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg);
if( res.azResult ){
assert( sizeof(res.azResult[0])>= sizeof(res.nData) );
res.azResult[0] = (char*)res.nData;
}
- if( (rc&0xff)==STQLITE_ABORT ){
+ if( (rc&0xff)==SQLITE_ABORT ){
sqlite3_free_table(&res.azResult[1]);
if( res.zErrMsg ){
if( pzErrMsg ){
@@ -57393,7 +57393,7 @@ int sqlite3_get_table(
return res.rc & db->errMask;
}
sqliteFree(res.zErrMsg);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3_free_table(&res.azResult[1]);
return rc & db->errMask;
}
@@ -57402,7 +57402,7 @@ int sqlite3_get_table(
azNew = sqlite3_realloc( res.azResult, sizeof(char*)*(res.nData+1) );
if( azNew==0 ){
sqlite3_free_table(&res.azResult[1]);
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
res.nAlloc = res.nData+1;
res.azResult = azNew;
@@ -57429,7 +57429,7 @@ void sqlite3_free_table(
}
}
-#endif /* STQLITE_OMIT_GET_TABLE */
+#endif /* SQLITE_OMIT_GET_TABLE */
/************** End of table.c ***********************************************/
/************** Begin file trigger.c *****************************************/
@@ -57446,11 +57446,11 @@ void sqlite3_free_table(
*
*/
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
/*
** Delete a linked list of TriggerStep structures.
*/
-STQLITE_PRIVATE void sqlite3DeleteTriggerStep(TriggerStep *pTriggerStep){
+SQLITE_PRIVATE void sqlite3DeleteTriggerStep(TriggerStep *pTriggerStep){
while( pTriggerStep ){
TriggerStep * pTmp = pTriggerStep;
pTriggerStep = pTriggerStep->pNext;
@@ -57473,7 +57473,7 @@ STQLITE_PRIVATE void sqlite3DeleteTriggerStep(TriggerStep *pTriggerStep){
** sqlite3FinishTrigger() function is called to complete the trigger
** construction process.
*/
-STQLITE_PRIVATE void sqlite3BeginTrigger(
+SQLITE_PRIVATE void sqlite3BeginTrigger(
Parse *pParse, /* The parse context of the CREATE TRIGGER statement */
Token *pName1, /* The name of the trigger */
Token *pName2, /* The name of the trigger */
@@ -57545,7 +57545,7 @@ STQLITE_PRIVATE void sqlite3BeginTrigger(
/* Check that the trigger name is not reserved and that no trigger of the
** specified name exists */
zName = sqlite3NameFromToken(pName);
- if( !zName || STQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
goto trigger_cleanup;
}
if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash), zName,strlen(zName)) ){
@@ -57577,16 +57577,16 @@ STQLITE_PRIVATE void sqlite3BeginTrigger(
}
iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
{
- int code = STQLITE_CREATE_TRIGGER;
+ int code = SQLITE_CREATE_TRIGGER;
const char *zDb = db->aDb[iTabDb].zName;
const char *zDbTrig = isTemp ? db->aDb[1].zName : zDb;
- if( iTabDb==1 || isTemp ) code = STQLITE_CREATE_TEMP_TRIGGER;
+ if( iTabDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER;
if( sqlite3AuthCheck(pParse, code, zName, pTab->zName, zDbTrig) ){
goto trigger_cleanup;
}
- if( sqlite3AuthCheck(pParse, STQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){
goto trigger_cleanup;
}
}
@@ -57633,7 +57633,7 @@ trigger_cleanup:
** This routine is called after all of the trigger actions have been parsed
** in order to complete the process of building the trigger.
*/
-STQLITE_PRIVATE void sqlite3FinishTrigger(
+SQLITE_PRIVATE void sqlite3FinishTrigger(
Parse *pParse, /* Parser context */
TriggerStep *pStepList, /* The triggered program */
Token *pAll /* Token that describes the complete CREATE TRIGGER */
@@ -57759,7 +57759,7 @@ static void sqlitePersistTriggerStep(TriggerStep *p){
** The parser calls this routine when it finds a SELECT statement in
** body of a TRIGGER.
*/
-STQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(Select *pSelect){
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(Select *pSelect){
TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));
if( pTriggerStep==0 ) {
sqlite3SelectDelete(pSelect);
@@ -57781,7 +57781,7 @@ STQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(Select *pSelect){
** The parser calls this routine when it sees an INSERT inside the
** body of a trigger.
*/
-STQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
Token *pTableName, /* Name of the table into which we insert */
IdList *pColumn, /* List of columns in pTableName to insert into */
ExprList *pEList, /* The VALUE clause: a list of values to be inserted */
@@ -57815,7 +57815,7 @@ STQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
** a pointer to that trigger step. The parser calls this routine when it
** sees an UPDATE statement inside the body of a CREATE TRIGGER.
*/
-STQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(
Token *pTableName, /* Name of the table to be updated */
ExprList *pEList, /* The SET clause: list of column and new values */
Expr *pWhere, /* The WHERE clause */
@@ -57843,7 +57843,7 @@ STQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(
** a pointer to that trigger step. The parser calls this routine when it
** sees a DELETE statement inside the body of a CREATE TRIGGER.
*/
-STQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(Token *pTableName, Expr *pWhere){
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(Token *pTableName, Expr *pWhere){
TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));
if( pTriggerStep==0 ){
sqlite3ExprDelete(pWhere);
@@ -57862,7 +57862,7 @@ STQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(Token *pTableName, Expr *p
/*
** Recursively delete a Trigger structure
*/
-STQLITE_PRIVATE void sqlite3DeleteTrigger(Trigger *pTrigger){
+SQLITE_PRIVATE void sqlite3DeleteTrigger(Trigger *pTrigger){
if( pTrigger==0 ) return;
sqlite3DeleteTriggerStep(pTrigger->step_list);
sqliteFree(pTrigger->name);
@@ -57881,7 +57881,7 @@ STQLITE_PRIVATE void sqlite3DeleteTrigger(Trigger *pTrigger){
** same job as this routine except it takes a pointer to the trigger
** instead of the trigger name.
**/
-STQLITE_PRIVATE void sqlite3DropTrigger(Parse *pParse, SrcList *pName, int noErr){
+SQLITE_PRIVATE void sqlite3DropTrigger(Parse *pParse, SrcList *pName, int noErr){
Trigger *pTrigger = 0;
int i;
const char *zDb;
@@ -57890,7 +57890,7 @@ STQLITE_PRIVATE void sqlite3DropTrigger(Parse *pParse, SrcList *pName, int noErr
sqlite3 *db = pParse->db;
if( sqlite3MallocFailed() ) goto drop_trigger_cleanup;
- if( STQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
goto drop_trigger_cleanup;
}
@@ -57929,7 +57929,7 @@ static Table *tableOfTrigger(Trigger *pTrigger){
/*
** Drop a trigger given a pointer to that trigger.
*/
-STQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
+SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
Table *pTable;
Vdbe *v;
sqlite3 *db = pParse->db;
@@ -57940,14 +57940,14 @@ STQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
pTable = tableOfTrigger(pTrigger);
assert( pTable );
assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
{
- int code = STQLITE_DROP_TRIGGER;
+ int code = SQLITE_DROP_TRIGGER;
const char *zDb = db->aDb[iDb].zName;
const char *zTab = SCHEMA_TABLE(iDb);
- if( iDb==1 ) code = STQLITE_DROP_TEMP_TRIGGER;
+ if( iDb==1 ) code = SQLITE_DROP_TEMP_TRIGGER;
if( sqlite3AuthCheck(pParse, code, pTrigger->name, pTable->zName, zDb) ||
- sqlite3AuthCheck(pParse, STQLITE_DELETE, zTab, 0, zDb) ){
+ sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
return;
}
}
@@ -57983,7 +57983,7 @@ STQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
/*
** Remove a trigger from the hash tables of the sqlite* pointer.
*/
-STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){
Trigger *pTrigger;
int nName = strlen(zName);
pTrigger = sqlite3HashInsert(&(db->aDb[iDb].pSchema->trigHash),
@@ -58005,7 +58005,7 @@ STQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const c
assert(cc);
}
sqlite3DeleteTrigger(pTrigger);
- db->flags |= STQLITE_InternChanges;
+ db->flags |= SQLITE_InternChanges;
}
}
@@ -58036,7 +58036,7 @@ static int checkColumnOverLap(IdList *pIdList, ExprList *pEList){
** The returned bit vector is some combination of TRIGGER_BEFORE and
** TRIGGER_AFTER.
*/
-STQLITE_PRIVATE int sqlite3TriggersExist(
+SQLITE_PRIVATE int sqlite3TriggersExist(
Parse *pParse, /* Used to check for recursive triggers */
Table *pTab, /* The table the contains the triggers */
int op, /* one of TK_DELETE, TK_INSERT, TK_UPDATE */
@@ -58175,7 +58175,7 @@ static int codeTriggerProgram(
** trigger program(s).
**
*/
-STQLITE_PRIVATE int sqlite3CodeRowTrigger(
+SQLITE_PRIVATE int sqlite3CodeRowTrigger(
Parse *pParse, /* Parse context */
int op, /* One of TK_UPDATE, TK_INSERT, TK_DELETE */
ExprList *pChanges, /* Changes list for any UPDATE OF triggers */
@@ -58213,7 +58213,7 @@ STQLITE_PRIVATE int sqlite3CodeRowTrigger(
else{
sqlite3ErrorMsg(pParse, "recursive triggers not supported (%s)",
p->name);
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
#endif
}
@@ -58259,7 +58259,7 @@ STQLITE_PRIVATE int sqlite3CodeRowTrigger(
}
return 0;
}
-#endif /* !defined(STQLITE_OMIT_TRIGGER) */
+#endif /* !defined(SQLITE_OMIT_TRIGGER) */
/************** End of trigger.c *********************************************/
/************** Begin file update.c ******************************************/
@@ -58280,7 +58280,7 @@ STQLITE_PRIVATE int sqlite3CodeRowTrigger(
** $Id: update.c,v 1.138 2007/06/25 16:29:34 danielk1977 Exp $
*/
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Forward declaration */
static void updateVirtualTable(
Parse *pParse, /* The parsing context */
@@ -58291,7 +58291,7 @@ static void updateVirtualTable(
int *aXRef, /* Mapping from columns of pTab to entries in pChanges */
Expr *pWhere /* WHERE clause of the UPDATE statement */
);
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
/*
** The most recently coded instruction was an OP_Column to retrieve the
@@ -58318,7 +58318,7 @@ static void updateVirtualTable(
** function is capable of transforming these types of expressions into
** sqlite3_value objects.
*/
-STQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){
+SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){
if( pTab && !pTab->pSelect ){
sqlite3_value *pValue;
u8 enc = ENC(sqlite3VdbeDb(v));
@@ -58340,7 +58340,7 @@ STQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){
** \_______/ \________/ \______/ \________________/
* onError pTabList pChanges pWhere
*/
-STQLITE_PRIVATE void sqlite3Update(
+SQLITE_PRIVATE void sqlite3Update(
Parse *pParse, /* The parser context */
SrcList *pTabList, /* The table in which we should change things */
ExprList *pChanges, /* Things to be changed */
@@ -58370,7 +58370,7 @@ STQLITE_PRIVATE void sqlite3Update(
int iDb; /* Database containing the table being updated */
int memCnt = 0; /* Memory cell used for counting rows changed */
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
int isView; /* Trying to update a view */
int triggers_exist = 0; /* True if any row triggers exist */
#endif
@@ -58394,14 +58394,14 @@ STQLITE_PRIVATE void sqlite3Update(
/* Figure out if we have any triggers and if the table being
** updated is a view
*/
-#ifndef STQLITE_OMIT_TRIGGER
+#ifndef SQLITE_OMIT_TRIGGER
triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges);
isView = pTab->pSelect!=0;
#else
# define triggers_exist 0
# define isView 0
#endif
-#ifdef STQLITE_OMIT_VIEW
+#ifdef SQLITE_OMIT_VIEW
# undef isView
# define isView 0
#endif
@@ -58469,14 +58469,14 @@ STQLITE_PRIVATE void sqlite3Update(
goto update_cleanup;
}
}
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
{
int rc;
- rc = sqlite3AuthCheck(pParse, STQLITE_UPDATE, pTab->zName,
+ rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName,
pTab->aCol[j].zName, db->aDb[iDb].zName);
- if( rc==STQLITE_DENY ){
+ if( rc==SQLITE_DENY ){
goto update_cleanup;
- }else if( rc==STQLITE_IGNORE ){
+ }else if( rc==SQLITE_IGNORE ){
aXRef[j] = -1;
}
}
@@ -58526,7 +58526,7 @@ STQLITE_PRIVATE void sqlite3Update(
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
sqlite3BeginWriteOperation(pParse, 1, iDb);
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Virtual tables must be handled separately */
if( IsVirtual(pTab) ){
updateVirtualTable(pParse, pTabList, pTab, pChanges, pRowidExpr, aXRef,
@@ -58576,7 +58576,7 @@ STQLITE_PRIVATE void sqlite3Update(
/* Initialize the count of updated rows
*/
- if( db->flags & STQLITE_CountRows && !pParse->trigStack ){
+ if( db->flags & SQLITE_CountRows && !pParse->trigStack ){
memCnt = pParse->nMem++;
sqlite3VdbeAddOp(v, OP_MemInt, 0, memCnt);
}
@@ -58735,7 +58735,7 @@ STQLITE_PRIVATE void sqlite3Update(
/* Increment the row counter
*/
- if( db->flags & STQLITE_CountRows && !pParse->trigStack){
+ if( db->flags & SQLITE_CountRows && !pParse->trigStack){
sqlite3VdbeAddOp(v, OP_MemIncr, 1, memCnt);
}
@@ -58780,7 +58780,7 @@ STQLITE_PRIVATE void sqlite3Update(
** generating code because of a call to sqlite3NestedParse(), do not
** invoke the callback function.
*/
- if( db->flags & STQLITE_CountRows && !pParse->trigStack && pParse->nested==0 ){
+ if( db->flags & SQLITE_CountRows && !pParse->trigStack && pParse->nested==0 ){
sqlite3VdbeAddOp(v, OP_MemLoad, memCnt, 0);
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
sqlite3VdbeSetNumCols(v, 1);
@@ -58797,7 +58797,7 @@ update_cleanup:
return;
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/*
** Generate code for an UPDATE of a virtual table.
**
@@ -58888,7 +58888,7 @@ static void updateVirtualTable(
/* Cleanup */
sqlite3SelectDelete(pSelect);
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
/************** End of update.c **********************************************/
/************** Begin file vacuum.c ******************************************/
@@ -58906,21 +58906,21 @@ static void updateVirtualTable(
** This file contains code used to implement the VACUUM command.
**
** Most of the code in this file may be omitted by defining the
-** STQLITE_OMIT_VACUUM macro.
+** SQLITE_OMIT_VACUUM macro.
**
** $Id: vacuum.c,v 1.69 2007/03/27 16:19:52 danielk1977 Exp $
*/
-#if !defined(STQLITE_OMIT_VACUUM) && !defined(STQLITE_OMIT_ATTACH)
+#if !defined(SQLITE_OMIT_VACUUM) && !defined(SQLITE_OMIT_ATTACH)
/*
** Execute zSql on database db. Return an error code.
*/
static int execSql(sqlite3 *db, const char *zSql){
sqlite3_stmt *pStmt;
- if( STQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){
+ if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){
return sqlite3_errcode(db);
}
- while( STQLITE_ROW==sqlite3_step(pStmt) ){}
+ while( SQLITE_ROW==sqlite3_step(pStmt) ){}
return sqlite3_finalize(pStmt);
}
@@ -58933,11 +58933,11 @@ static int execExecSql(sqlite3 *db, const char *zSql){
int rc;
rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0);
- if( rc!=STQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) return rc;
- while( STQLITE_ROW==sqlite3_step(pStmt) ){
+ while( SQLITE_ROW==sqlite3_step(pStmt) ){
rc = execSql(db, (char*)sqlite3_column_text(pStmt, 0));
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3_finalize(pStmt);
return rc;
}
@@ -58951,12 +58951,12 @@ static int execExecSql(sqlite3 *db, const char *zSql){
** collapse free space, etc. It is modelled after the VACUUM command
** in PostgreSQL.
**
-** In version 1.0.x of STQLite, the VACUUM command would call
+** In version 1.0.x of SQLite, the VACUUM command would call
** gdbm_reorganize() on all the database tables. But beginning
-** with 2.0.0, STQLite no longer uses GDBM so this command has
+** with 2.0.0, SQLite no longer uses GDBM so this command has
** become a no-op.
*/
-STQLITE_PRIVATE void sqlite3Vacuum(Parse *pParse){
+SQLITE_PRIVATE void sqlite3Vacuum(Parse *pParse){
Vdbe *v = sqlite3GetVdbe(pParse);
if( v ){
sqlite3VdbeAddOp(v, OP_Vacuum, 0, 0);
@@ -58967,8 +58967,8 @@ STQLITE_PRIVATE void sqlite3Vacuum(Parse *pParse){
/*
** This routine implements the OP_Vacuum opcode of the VDBE.
*/
-STQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
- int rc = STQLITE_OK; /* Return code from service routines */
+SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
+ int rc = SQLITE_OK; /* Return code from service routines */
Btree *pMain; /* The database being vacuumed */
Btree *pTemp; /* The temporary database we vacuum into */
char *zSql = 0; /* SQL statements */
@@ -58977,12 +58977,12 @@ STQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
/* Save the current value of the write-schema flag before setting it. */
saved_flags = db->flags;
- db->flags |= STQLITE_WriteSchema | STQLITE_IgnoreChecks;
+ db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks;
if( !db->autoCommit ){
sqlite3SetString(pzErrMsg, "cannot VACUUM from within a transaction",
(char*)0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
goto end_of_vacuum;
}
pMain = db->aDb[0].pBt;
@@ -58997,29 +58997,29 @@ STQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
*/
zSql = "ATTACH '' AS vacuum_db;";
rc = execSql(db, zSql);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
pDb = &db->aDb[db->nDb-1];
assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 );
pTemp = db->aDb[db->nDb-1].pBt;
sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain),
sqlite3BtreeGetReserve(pMain));
if( sqlite3MallocFailed() ){
- rc = STQLITE_NOMEM;
+ rc = SQLITE_NOMEM;
goto end_of_vacuum;
}
assert( sqlite3BtreeGetPageSize(pTemp)==sqlite3BtreeGetPageSize(pMain) );
rc = execSql(db, "PRAGMA vacuum_db.synchronous=OFF");
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
goto end_of_vacuum;
}
-#ifndef STQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
sqlite3BtreeSetAutoVacuum(pTemp, sqlite3BtreeGetAutoVacuum(pMain));
#endif
/* Begin a transaction */
rc = execSql(db, "BEGIN EXCLUSIVE;");
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
/* Query the schema of the main database. Create a mirror schema
** in the temporary database.
@@ -59029,15 +59029,15 @@ STQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
" FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence'"
" AND rootpage>0"
);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
rc = execExecSql(db,
"SELECT 'CREATE INDEX vacuum_db.' || substr(sql,14,100000000)"
" FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ");
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
rc = execExecSql(db,
"SELECT 'CREATE UNITQUE INDEX vacuum_db.' || substr(sql,21,100000000) "
" FROM sqlite_master WHERE sql LIKE 'CREATE UNITQUE INDEX %'");
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
/* Loop through the tables in the main database. For each, do
** an "INSERT INTO vacuum_db.xxx SELECT * FROM xxx;" to copy
@@ -59051,7 +59051,7 @@ STQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
" AND rootpage>0"
);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
/* Copy over the sequence table
*/
@@ -59059,19 +59059,19 @@ STQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
"SELECT 'DELETE FROM vacuum_db.' || quote(name) || ';' "
"FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' "
);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
rc = execExecSql(db,
"SELECT 'INSERT INTO vacuum_db.' || quote(name) "
"|| ' SELECT * FROM ' || quote(name) || ';' "
"FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';"
);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
/* Copy the triggers, views, and virtual tables from the main database
** over to the temporary database. None of these objects has any
** associated storage, so all we have to do is copy their entries
- ** from the STQLITE_MASTER table.
+ ** from the SQLITE_MASTER table.
*/
rc = execSql(db,
"INSERT INTO vacuum_db.sqlite_master "
@@ -59090,7 +59090,7 @@ STQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
** opened for writing. This way, the SQL transaction used to create the
** temporary database never needs to be committed.
*/
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
u32 meta;
int i;
@@ -59113,15 +59113,15 @@ STQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
/* Copy Btree meta values */
for(i=0; i<sizeof(aCopy)/sizeof(aCopy[0]); i+=2){
rc = sqlite3BtreeGetMeta(pMain, aCopy[i], &meta);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
rc = sqlite3BtreeUpdateMeta(pTemp, aCopy[i], meta+aCopy[i+1]);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
}
rc = sqlite3BtreeCopyFile(pMain, pTemp);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
rc = sqlite3BtreeCommit(pTemp);
- if( rc!=STQLITE_OK ) goto end_of_vacuum;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
rc = sqlite3BtreeCommit(pMain);
}
@@ -59150,7 +59150,7 @@ end_of_vacuum:
return rc;
}
-#endif /* STQLITE_OMIT_VACUUM && STQLITE_OMIT_ATTACH */
+#endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
/************** End of vacuum.c **********************************************/
/************** Begin file vtab.c ********************************************/
@@ -59169,7 +59169,7 @@ end_of_vacuum:
**
** $Id: vtab.c,v 1.48 2007/06/26 10:38:55 danielk1977 Exp $
*/
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
static int createModule(
sqlite3 *db, /* Database in which module is registered */
@@ -59194,7 +59194,7 @@ static int createModule(
sqliteFree(pMod);
sqlite3ResetInternalSchema(db, 0);
}
- return sqlite3ApiExit(db, STQLITE_OK);
+ return sqlite3ApiExit(db, SQLITE_OK);
}
@@ -59231,7 +59231,7 @@ int sqlite3_create_module_v2(
** If a disconnect is attempted while a virtual table is locked,
** the disconnect is deferred until all locks have been removed.
*/
-STQLITE_PRIVATE void sqlite3VtabLock(sqlite3_vtab *pVtab){
+SQLITE_PRIVATE void sqlite3VtabLock(sqlite3_vtab *pVtab){
pVtab->nRef++;
}
@@ -59239,12 +59239,12 @@ STQLITE_PRIVATE void sqlite3VtabLock(sqlite3_vtab *pVtab){
** Unlock a virtual table. When the last lock is removed,
** disconnect the virtual table.
*/
-STQLITE_PRIVATE void sqlite3VtabUnlock(sqlite3 *db, sqlite3_vtab *pVtab){
+SQLITE_PRIVATE void sqlite3VtabUnlock(sqlite3 *db, sqlite3_vtab *pVtab){
pVtab->nRef--;
assert(db);
assert(!sqlite3SafetyCheck(db));
if( pVtab->nRef==0 ){
- if( db->magic==STQLITE_MAGIC_BUSY ){
+ if( db->magic==SQLITE_MAGIC_BUSY ){
sqlite3SafetyOff(db);
pVtab->pModule->xDisconnect(pVtab);
sqlite3SafetyOn(db);
@@ -59259,7 +59259,7 @@ STQLITE_PRIVATE void sqlite3VtabUnlock(sqlite3 *db, sqlite3_vtab *pVtab){
** This routine is called, for example, just before deleting the Table
** record.
*/
-STQLITE_PRIVATE void sqlite3VtabClear(Table *p){
+SQLITE_PRIVATE void sqlite3VtabClear(Table *p){
sqlite3_vtab *pVtab = p->pVtab;
if( pVtab ){
assert( p->pMod && p->pMod->pModule );
@@ -59306,7 +59306,7 @@ static void addModuleArgument(Table *pTable, char *zArg){
** statement. The module name has been parsed, but the optional list
** of parameters that follow the module name are still pending.
*/
-STQLITE_PRIVATE void sqlite3VtabBeginParse(
+SQLITE_PRIVATE void sqlite3VtabBeginParse(
Parse *pParse, /* Parsing context */
Token *pName1, /* Name of new table, or database name */
Token *pName2, /* Name of new table or NULL */
@@ -59315,7 +59315,7 @@ STQLITE_PRIVATE void sqlite3VtabBeginParse(
int iDb; /* The database the table is being created in */
Table *pTable; /* The new virtual table */
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
if( sqlite3ThreadDataReadOnly()->useSharedData ){
sqlite3ErrorMsg(pParse, "Cannot use virtual tables in shared-cache mode");
return;
@@ -59337,14 +59337,14 @@ STQLITE_PRIVATE void sqlite3VtabBeginParse(
addModuleArgument(pTable, sqlite3StrDup(pTable->zName));
pParse->sNameToken.n = pModuleName->z + pModuleName->n - pName1->z;
-#ifndef STQLITE_OMIT_AUTHORIZATION
+#ifndef SQLITE_OMIT_AUTHORIZATION
/* Creating a virtual table invokes the authorization callback twice.
** The first invocation, to obtain permission to INSERT a row into the
** sqlite_master table, has already been made by sqlite3StartTable().
** The second call, to obtain permission to create the table, is made now.
*/
if( pTable->azModuleArg ){
- sqlite3AuthCheck(pParse, STQLITE_CREATE_VTABLE, pTable->zName,
+ sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
pTable->azModuleArg[0], pParse->db->aDb[iDb].zName);
}
#endif
@@ -59367,7 +59367,7 @@ static void addArgumentToVtab(Parse *pParse){
** The parser calls this routine after the CREATE VIRTUAL TABLE statement
** has been completely parsed.
*/
-STQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
+SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
Table *pTab; /* The table being constructed */
sqlite3 *db; /* The database connection */
char *zModule; /* The module name of the table: USING modulename */
@@ -59404,7 +59404,7 @@ STQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
zStmt = sqlite3MPrintf("CREATE VIRTUAL TABLE %T", &pParse->sNameToken);
/* A slot for the record has already been allocated in the
- ** STQLITE_MASTER table. We just need to update that slot with all
+ ** SQLITE_MASTER table. We just need to update that slot with all
** the information we've collected.
**
** The top of the stack is the rootpage allocated by sqlite3StartTable().
@@ -59455,7 +59455,7 @@ STQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
** The parser calls this routine when it sees the first token
** of an argument to the module name in a CREATE VIRTUAL TABLE statement.
*/
-STQLITE_PRIVATE void sqlite3VtabArgInit(Parse *pParse){
+SQLITE_PRIVATE void sqlite3VtabArgInit(Parse *pParse){
addArgumentToVtab(pParse);
pParse->sArg.z = 0;
pParse->sArg.n = 0;
@@ -59465,7 +59465,7 @@ STQLITE_PRIVATE void sqlite3VtabArgInit(Parse *pParse){
** The parser calls this routine for each token after the first token
** in an argument to the module name in a CREATE VIRTUAL TABLE statement.
*/
-STQLITE_PRIVATE void sqlite3VtabArgExtend(Parse *pParse, Token *p){
+SQLITE_PRIVATE void sqlite3VtabArgExtend(Parse *pParse, Token *p){
Token *pArg = &pParse->sArg;
if( pArg->z==0 ){
pArg->z = p->z;
@@ -59497,7 +59497,7 @@ static int vtabCallConstructor(
char *zModuleName = sqlite3MPrintf("%s", pTab->zName);
if( !zModuleName ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
assert( !db->pVTab );
@@ -59505,16 +59505,16 @@ static int vtabCallConstructor(
db->pVTab = pTab;
rc = sqlite3SafetyOff(db);
- assert( rc==STQLITE_OK );
+ assert( rc==SQLITE_OK );
rc = xConstruct(db, pMod->pAux, nArg, azArg, &pTab->pVtab, &zErr);
rc2 = sqlite3SafetyOn(db);
pVtab = pTab->pVtab;
- if( rc==STQLITE_OK && pVtab ){
+ if( rc==SQLITE_OK && pVtab ){
pVtab->pModule = pMod->pModule;
pVtab->nRef = 1;
}
- if( STQLITE_OK!=rc ){
+ if( SQLITE_OK!=rc ){
if( zErr==0 ){
*pzErr = sqlite3MPrintf("vtable constructor failed: %s", zModuleName);
}else {
@@ -59524,9 +59524,9 @@ static int vtabCallConstructor(
}else if( db->pVTab ){
const char *zFormat = "vtable constructor did not declare schema: %s";
*pzErr = sqlite3MPrintf(zFormat, pTab->zName);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = rc2;
}
db->pVTab = 0;
@@ -59537,7 +59537,7 @@ static int vtabCallConstructor(
** If so, set the Column.isHidden flag and remove the token from
** the type string.
*/
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
int iCol;
for(iCol=0; iCol<pTab->nCol; iCol++){
char *zType = pTab->aCol[iCol].zType;
@@ -59579,24 +59579,24 @@ static int vtabCallConstructor(
**
** This call is a no-op if table pTab is not a virtual table.
*/
-STQLITE_PRIVATE int sqlite3VtabCallConnect(Parse *pParse, Table *pTab){
+SQLITE_PRIVATE int sqlite3VtabCallConnect(Parse *pParse, Table *pTab){
Module *pMod;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
if( !pTab || !pTab->isVirtual || pTab->pVtab ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
pMod = pTab->pMod;
if( !pMod ){
const char *zModule = pTab->azModuleArg[0];
sqlite3ErrorMsg(pParse, "no such module: %s", zModule);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
} else {
char *zErr = 0;
sqlite3 *db = pParse->db;
rc = vtabCallConstructor(db, pTab, pMod, pMod->pModule->xConnect, &zErr);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3ErrorMsg(pParse, "%s", zErr);
}
sqliteFree(zErr);
@@ -59617,7 +59617,7 @@ static int addToVTrans(sqlite3 *db, sqlite3_vtab *pVtab){
int nBytes = sizeof(sqlite3_vtab *) * (db->nVTrans + ARRAY_INCR);
aVTrans = sqliteRealloc((void *)db->aVTrans, nBytes);
if( !aVTrans ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
memset(&aVTrans[db->nVTrans], 0, sizeof(sqlite3_vtab *)*ARRAY_INCR);
db->aVTrans = aVTrans;
@@ -59626,7 +59626,7 @@ static int addToVTrans(sqlite3 *db, sqlite3_vtab *pVtab){
/* Add pVtab to the end of sqlite3.aVTrans */
db->aVTrans[db->nVTrans++] = pVtab;
sqlite3VtabLock(pVtab);
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -59634,11 +59634,11 @@ static int addToVTrans(sqlite3 *db, sqlite3_vtab *pVtab){
** of the virtual table named zTab in database iDb.
**
** If an error occurs, *pzErr is set to point an an English language
-** description of the error and an STQLITE_XXX error code is returned.
+** description of the error and an SQLITE_XXX error code is returned.
** In this case the caller must call sqliteFree() on *pzErr.
*/
-STQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, char **pzErr){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, char **pzErr){
+ int rc = SQLITE_OK;
Table *pTab;
Module *pMod;
const char *zModule;
@@ -59654,12 +59654,12 @@ STQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab
*/
if( !pMod ){
*pzErr = sqlite3MPrintf("no such module: %s", zModule);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}else{
rc = vtabCallConstructor(db, pTab, pMod, pMod->pModule->xCreate, pzErr);
}
- if( rc==STQLITE_OK && pTab->pVtab ){
+ if( rc==SQLITE_OK && pTab->pVtab ){
rc = addToVTrans(db, pTab->pVtab);
}
@@ -59674,13 +59674,13 @@ STQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab
int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
Parse sParse;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
Table *pTab = db->pVTab;
char *zErr = 0;
if( !pTab ){
- sqlite3Error(db, STQLITE_MISUSE, 0);
- return STQLITE_MISUSE;
+ sqlite3Error(db, SQLITE_MISUSE, 0);
+ return SQLITE_MISUSE;
}
assert(pTab->isVirtual && pTab->nCol==0 && pTab->aCol==0);
@@ -59689,7 +59689,7 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
sParse.db = db;
if(
- STQLITE_OK == sqlite3RunParser(&sParse, zCreateTable, &zErr) &&
+ SQLITE_OK == sqlite3RunParser(&sParse, zCreateTable, &zErr) &&
sParse.pNewTable &&
!sParse.pNewTable->pSelect &&
!sParse.pNewTable->isVirtual
@@ -59700,9 +59700,9 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
sParse.pNewTable->aCol = 0;
db->pVTab = 0;
} else {
- sqlite3Error(db, STQLITE_ERROR, zErr);
+ sqlite3Error(db, SQLITE_ERROR, zErr);
sqliteFree(zErr);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
sParse.declareVtab = 0;
@@ -59721,9 +59721,9 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
**
** This call is a no-op if zTab is not a virtual table.
*/
-STQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab)
+SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab)
{
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
Table *pTab;
pTab = sqlite3FindTable(db, zTab, db->aDb[iDb].zName);
@@ -59731,12 +59731,12 @@ STQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTa
if( pTab->pVtab ){
int (*xDestroy)(sqlite3_vtab *pVTab) = pTab->pMod->pModule->xDestroy;
rc = sqlite3SafetyOff(db);
- assert( rc==STQLITE_OK );
+ assert( rc==SQLITE_OK );
if( xDestroy ){
rc = xDestroy(pTab->pVtab);
}
sqlite3SafetyOn(db);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
pTab->pVtab = 0;
}
}
@@ -59769,21 +59769,21 @@ static void callFinaliser(sqlite3 *db, int offset){
}
/*
-** If argument rc2 is not STQLITE_OK, then return it and do nothing.
+** If argument rc2 is not SQLITE_OK, then return it and do nothing.
** Otherwise, invoke the xSync method of all virtual tables in the
** sqlite3.aVTrans array. Return the error code for the first error
-** that occurs, or STQLITE_OK if all xSync operations are successful.
+** that occurs, or SQLITE_OK if all xSync operations are successful.
*/
-STQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, int rc2){
+SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, int rc2){
int i;
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
int rcsafety;
sqlite3_vtab **aVTrans = db->aVTrans;
- if( rc2!=STQLITE_OK ) return rc2;
+ if( rc2!=SQLITE_OK ) return rc2;
rc = sqlite3SafetyOff(db);
db->aVTrans = 0;
- for(i=0; rc==STQLITE_OK && i<db->nVTrans && aVTrans[i]; i++){
+ for(i=0; rc==SQLITE_OK && i<db->nVTrans && aVTrans[i]; i++){
sqlite3_vtab *pVtab = aVTrans[i];
int (*x)(sqlite3_vtab *);
x = pVtab->pModule->xSync;
@@ -59794,7 +59794,7 @@ STQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, int rc2){
db->aVTrans = aVTrans;
rcsafety = sqlite3SafetyOn(db);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
rc = rcsafety;
}
return rc;
@@ -59804,18 +59804,18 @@ STQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, int rc2){
** Invoke the xRollback method of all virtual tables in the
** sqlite3.aVTrans array. Then clear the array itself.
*/
-STQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db){
+SQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db){
callFinaliser(db, (int)(&((sqlite3_module *)0)->xRollback));
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Invoke the xCommit method of all virtual tables in the
** sqlite3.aVTrans array. Then clear the array itself.
*/
-STQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db){
+SQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db){
callFinaliser(db, (int)(&((sqlite3_module *)0)->xCommit));
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -59826,20 +59826,20 @@ STQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db){
** If the xBegin call is successful, place the sqlite3_vtab pointer
** in the sqlite3.aVTrans array.
*/
-STQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *db, sqlite3_vtab *pVtab){
- int rc = STQLITE_OK;
+SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *db, sqlite3_vtab *pVtab){
+ int rc = SQLITE_OK;
const sqlite3_module *pModule;
/* Special case: If db->aVTrans is NULL and db->nVTrans is greater
** than zero, then this function is being called from within a
** virtual module xSync() callback. It is illegal to write to
- ** virtual module tables in this case, so return STQLITE_LOCKED.
+ ** virtual module tables in this case, so return SQLITE_LOCKED.
*/
if( 0==db->aVTrans && db->nVTrans>0 ){
- return STQLITE_LOCKED;
+ return SQLITE_LOCKED;
}
if( !pVtab ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
pModule = pVtab->pModule;
@@ -59850,13 +59850,13 @@ STQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *db, sqlite3_vtab *pVtab){
/* If pVtab is already in the aVTrans array, return early */
for(i=0; (i<db->nVTrans) && 0!=db->aVTrans[i]; i++){
if( db->aVTrans[i]==pVtab ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
}
/* Invoke the xBegin method */
rc = pModule->xBegin(pVtab);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
return rc;
}
@@ -59876,9 +59876,9 @@ STQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *db, sqlite3_vtab *pVtab){
**
** Return either the pDef argument (indicating no change) or a
** new FuncDef structure that is marked as ephemeral using the
-** STQLITE_FUNC_EPHEM flag.
+** SQLITE_FUNC_EPHEM flag.
*/
-STQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(
+SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(
FuncDef *pDef, /* Function to possibly overload */
int nArg, /* Number of arguments to the function */
Expr *pExpr /* First argument to the function */
@@ -59929,11 +59929,11 @@ STQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(
memcpy(pNew->zName, pDef->zName, strlen(pDef->zName)+1);
pNew->xFunc = xFunc;
pNew->pUserData = pArg;
- pNew->flags |= STQLITE_FUNC_EPHEM;
+ pNew->flags |= SQLITE_FUNC_EPHEM;
return pNew;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
/************** End of vtab.c ************************************************/
/************** Begin file where.c *******************************************/
@@ -59966,7 +59966,7 @@ STQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(
/*
** Trace output macros
*/
-#if defined(STQLITE_TEST) || defined(STQLITE_DEBUG)
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
int sqlite3_where_trace = 0;
# define WHERETRACE(X) if(sqlite3_where_trace) sqlite3DebugPrintf X
#else
@@ -60429,7 +60429,7 @@ static void exprAnalyzeAll(
}
}
-#ifndef STQLITE_OMIT_LIKE_OPTIMIZATION
+#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION
/*
** Check to see if the given expression is a LIKE or GLOB operator that
** can be optimized using inequality constraints. Return TRUE if it is
@@ -60472,8 +60472,8 @@ static int isLikeOrGlob(
*/
pColl = db->pDfltColl;
}
- if( (pColl->type!=STQLITE_COLL_BINARY || noCase) &&
- (pColl->type!=STQLITE_COLL_NOCASE || !noCase) ){
+ if( (pColl->type!=SQLITE_COLL_BINARY || noCase) &&
+ (pColl->type!=SQLITE_COLL_NOCASE || !noCase) ){
return 0;
}
sqlite3DequoteExpr(pRight);
@@ -60486,10 +60486,10 @@ static int isLikeOrGlob(
*pnPattern = cnt;
return 1;
}
-#endif /* STQLITE_OMIT_LIKE_OPTIMIZATION */
+#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/*
** Check to see if the given expression is of the form
**
@@ -60518,7 +60518,7 @@ static int isMatchOfColumn(
}
return 1;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
/*
** If the pBase expression originated in the ON or USING clause of
@@ -60529,7 +60529,7 @@ static void transferJoinMarkings(Expr *pDerived, Expr *pBase){
pDerived->iRightJoinTable = pBase->iRightJoinTable;
}
-#if !defined(STQLITE_OMIT_OR_OPTIMIZATION) && !defined(STQLITE_OMIT_SUBTQUERY)
+#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBTQUERY)
/*
** Return TRUE if the given term of an OR clause can be converted
** into an IN clause. The iCursor and iColumn define the left-hand
@@ -60614,7 +60614,7 @@ static int orTermHasOkDuplicate(WhereClause *pOr, WhereTerm *pOrTerm){
** which the original did not qualify. Either way we are done for. */
return 0;
}
-#endif /* !STQLITE_OMIT_OR_OPTIMIZATION && !STQLITE_OMIT_SUBTQUERY */
+#endif /* !SQLITE_OMIT_OR_OPTIMIZATION && !SQLITE_OMIT_SUBTQUERY */
/*
** The input to this routine is an WhereTerm structure with only the
@@ -60701,7 +60701,7 @@ static void exprAnalyze(
}
}
-#ifndef STQLITE_OMIT_BETWEEN_OPTIMIZATION
+#ifndef SQLITE_OMIT_BETWEEN_OPTIMIZATION
/* If a term is the BETWEEN operator, create two new virtual terms
** that define the range that the BETWEEN implements.
*/
@@ -60723,9 +60723,9 @@ static void exprAnalyze(
}
pTerm->nChild = 2;
}
-#endif /* STQLITE_OMIT_BETWEEN_OPTIMIZATION */
+#endif /* SQLITE_OMIT_BETWEEN_OPTIMIZATION */
-#if !defined(STQLITE_OMIT_OR_OPTIMIZATION) && !defined(STQLITE_OMIT_SUBTQUERY)
+#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBTQUERY)
/* Attempt to convert OR-connected terms into an IN operator so that
** they can make use of indices. Example:
**
@@ -60798,9 +60798,9 @@ static void exprAnalyze(
or_not_possible:
whereClauseClear(&sOr);
}
-#endif /* STQLITE_OMIT_OR_OPTIMIZATION */
+#endif /* SQLITE_OMIT_OR_OPTIMIZATION */
-#ifndef STQLITE_OMIT_LIKE_OPTIMIZATION
+#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION
/* Add constraints to reduce the search space on a LIKE or GLOB
** operator.
*/
@@ -60836,9 +60836,9 @@ or_not_possible:
pTerm->nChild = 2;
}
}
-#endif /* STQLITE_OMIT_LIKE_OPTIMIZATION */
+#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Add a WO_MATCH auxiliary term to the constraint set if the
** current expression is of the form: column MATCH expr.
** This information is used by the xBestIndex methods of
@@ -60871,7 +60871,7 @@ or_not_possible:
pNewTerm->prereqAll = pTerm->prereqAll;
}
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
}
/*
@@ -61071,10 +61071,10 @@ static double estLog(double N){
/*
** Two routines for printing the content of an sqlite3_index_info
** structure. Used for testing and debugging only. If neither
-** STQLITE_TEST or STQLITE_DEBUG are defined, then these routines
+** SQLITE_TEST or SQLITE_DEBUG are defined, then these routines
** are no-ops.
*/
-#if !defined(STQLITE_OMIT_VIRTUALTABLE) && defined(STQLITE_DEBUG)
+#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_DEBUG)
static void TRACE_IDX_INPUTS(sqlite3_index_info *p){
int i;
if( !sqlite3_where_trace ) return;
@@ -61112,7 +61112,7 @@ static void TRACE_IDX_OUTPUTS(sqlite3_index_info *p){
#define TRACE_IDX_OUTPUTS(A)
#endif
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
/*
** Compute the best index for a virtual table.
**
@@ -61214,14 +61214,14 @@ static double bestVirtualIndex(
pIdxCons[j].iTermOffset = i;
pIdxCons[j].op = pTerm->eOperator;
/* The direct assignment in the previous line is possible only because
- ** the WO_ and STQLITE_INDEX_CONSTRAINT_ codes are identical. The
+ ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical. The
** following asserts verify this fact. */
- assert( WO_EQ==STQLITE_INDEX_CONSTRAINT_EQ );
- assert( WO_LT==STQLITE_INDEX_CONSTRAINT_LT );
- assert( WO_LE==STQLITE_INDEX_CONSTRAINT_LE );
- assert( WO_GT==STQLITE_INDEX_CONSTRAINT_GT );
- assert( WO_GE==STQLITE_INDEX_CONSTRAINT_GE );
- assert( WO_MATCH==STQLITE_INDEX_CONSTRAINT_MATCH );
+ assert( WO_EQ==SQLITE_INDEX_CONSTRAINT_EQ );
+ assert( WO_LT==SQLITE_INDEX_CONSTRAINT_LT );
+ assert( WO_LE==SQLITE_INDEX_CONSTRAINT_LE );
+ assert( WO_GT==SQLITE_INDEX_CONSTRAINT_GT );
+ assert( WO_GE==SQLITE_INDEX_CONSTRAINT_GE );
+ assert( WO_MATCH==SQLITE_INDEX_CONSTRAINT_MATCH );
assert( pTerm->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_MATCH) );
j++;
}
@@ -61288,7 +61288,7 @@ static double bestVirtualIndex(
pIdxInfo->idxNum = 0;
pIdxInfo->needToFreeIdxStr = 0;
pIdxInfo->orderByConsumed = 0;
- pIdxInfo->estimatedCost = STQLITE_BIG_DBL / 2.0;
+ pIdxInfo->estimatedCost = SQLITE_BIG_DBL / 2.0;
nOrderBy = pIdxInfo->nOrderBy;
if( pIdxInfo->nOrderBy && !orderByUsable ){
*(int*)&pIdxInfo->nOrderBy = 0;
@@ -61299,8 +61299,8 @@ static double bestVirtualIndex(
TRACE_IDX_INPUTS(pIdxInfo);
rc = pTab->pVtab->pModule->xBestIndex(pTab->pVtab, pIdxInfo);
TRACE_IDX_OUTPUTS(pIdxInfo);
- if( rc!=STQLITE_OK ){
- if( rc==STQLITE_NOMEM ){
+ if( rc!=SQLITE_OK ){
+ if( rc==SQLITE_NOMEM ){
sqlite3FailedMalloc();
}else {
sqlite3ErrorMsg(pParse, "%s", sqlite3ErrStr(rc));
@@ -61313,7 +61313,7 @@ static double bestVirtualIndex(
return pIdxInfo->estimatedCost;
}
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
/*
** Find the best index for accessing a particular table. Return a pointer
@@ -61357,7 +61357,7 @@ static double bestIndex(
double cost; /* Cost of using pProbe */
WHERETRACE(("bestIndex: tbl=%s notReady=%x\n", pSrc->pTab->zName, notReady));
- lowestCost = STQLITE_BIG_DBL;
+ lowestCost = SQLITE_BIG_DBL;
pProbe = pSrc->pTab->pIndex;
/* If the table has no indices and there are no terms in the where
@@ -61648,7 +61648,7 @@ static void codeEqualityTerm(
sqlite3ExprCode(pParse, pX->pRight);
}else if( pX->op==TK_ISNULL ){
sqlite3VdbeAddOp(v, OP_Null, 0, 0);
-#ifndef STQLITE_OMIT_SUBTQUERY
+#ifndef SQLITE_OMIT_SUBTQUERY
}else{
int iTab;
struct InLoop *pIn;
@@ -61752,7 +61752,7 @@ static void codeAllEqualityTerms(
}
}
-#if defined(STQLITE_TEST)
+#if defined(SQLITE_TEST)
/*
** The following variable holds a text description of query plan generated
** by the most recent call to sqlite3WhereBegin(). Each call to WhereBegin
@@ -61762,7 +61762,7 @@ static void codeAllEqualityTerms(
char sqlite3_query_plan[BMS*2*40]; /* Text of the join */
static int nTQPlan = 0; /* Next free slow in _query_plan[] */
-#endif /* STQLITE_TEST */
+#endif /* SQLITE_TEST */
/*
@@ -61877,7 +61877,7 @@ static void whereInfoFree(WhereInfo *pWInfo){
** If the where clause loops cannot be arranged to provide the correct
** output order, then the *ppOrderBy is unchanged.
*/
-STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
+SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
Parse *pParse, /* The parser context */
SrcList *pTabList, /* A list of all tables to be scanned */
Expr *pWhere, /* The WHERE clause */
@@ -61978,7 +61978,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
int once = 0; /* True when first table is seen */
sqlite3_index_info *pIndex; /* Current virtual index */
- lowestCost = STQLITE_BIG_DBL;
+ lowestCost = SQLITE_BIG_DBL;
for(j=iFrom, pTabItem=&pTabList->a[j]; j<pTabList->nSrc; j++, pTabItem++){
int doNotReorder; /* True if this table should not be reordered */
@@ -61990,7 +61990,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
continue;
}
assert( pTabItem->pTab );
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( IsVirtual(pTabItem->pTab) ){
sqlite3_index_info **ppIdxInfo = &pWInfo->a[j].pIdxInfo;
cost = bestVirtualIndex(pParse, &wc, pTabItem, notReady,
@@ -62003,13 +62003,13 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
}
pIdx = 0;
nEq = 0;
- if( (STQLITE_BIG_DBL/2.0)<cost ){
- /* The cost is not allowed to be larger than STQLITE_BIG_DBL (the
+ if( (SQLITE_BIG_DBL/2.0)<cost ){
+ /* The cost is not allowed to be larger than SQLITE_BIG_DBL (the
** inital value of lowestCost in this loop. If it is, then
** the (cost<lowestCost) test below will never be true and
** pLevel->pBestIdx never set.
*/
- cost = (STQLITE_BIG_DBL/2.0);
+ cost = (SQLITE_BIG_DBL/2.0);
}
}else
#endif
@@ -62068,7 +62068,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
int iDb; /* Index of database containing table/index */
int iIdxCur = pLevel->iIdxCur;
-#ifndef STQLITE_OMIT_EXPLAIN
+#ifndef SQLITE_OMIT_EXPLAIN
if( pParse->explain==2 ){
char *zMsg;
struct SrcList_item *pItem = &pTabList->a[pLevel->iFrom];
@@ -62081,7 +62081,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
}else if( pLevel->flags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
zMsg = sqlite3MPrintf("%z USING PRIMARY KEY", zMsg);
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
else if( pLevel->pBestIdx ){
sqlite3_index_info *pBestIdx = pLevel->pBestIdx;
zMsg = sqlite3MPrintf("%z VIRTUAL TABLE INDEX %d:%s", zMsg,
@@ -62093,12 +62093,12 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
}
sqlite3VdbeOp3(v, OP_Explain, i, pLevel->iFrom, zMsg, P3_DYNAMIC);
}
-#endif /* STQLITE_OMIT_EXPLAIN */
+#endif /* SQLITE_OMIT_EXPLAIN */
pTabItem = &pTabList->a[pLevel->iFrom];
pTab = pTabItem->pTab;
iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
if( pTab->isEphem || pTab->pSelect ) continue;
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( pLevel->pBestIdx ){
int iCur = pTabItem->iCursor;
sqlite3VdbeOp3(v, OP_VOpen, iCur, 0, (const char*)pTab->pVtab, P3_VTAB);
@@ -62179,7 +62179,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
VdbeComment((v, "# init LEFT JOIN no-match flag"));
}
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
if( pLevel->pBestIdx ){
/* Case 0: The table is a virtual-table. Use the VFilter and VNext
** to access the data.
@@ -62218,7 +62218,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
pLevel->p1 = iCur;
pLevel->p2 = sqlite3VdbeCurrentAddr(v);
}else
-#endif /* STQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
if( pLevel->flags & WHERE_ROWID_EQ ){
/* Case 1: We can directly reference a single row using an
@@ -62287,7 +62287,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
if( testOp!=OP_Noop ){
sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0);
- sqlite3VdbeAddOp(v, testOp, STQLITE_AFF_NUMERIC|0x100, brk);
+ sqlite3VdbeAddOp(v, testOp, SQLITE_AFF_NUMERIC|0x100, brk);
}
}else if( pLevel->flags & WHERE_COLUMN_RANGE ){
/* Case 3: The WHERE clause term that refers to the right-most
@@ -62328,7 +62328,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
** operator and the top bound is a < or <= operator. For a descending
** index the operators are reversed.
*/
- if( pIdx->aSortOrder[nEq]==STQLITE_SO_ASC ){
+ if( pIdx->aSortOrder[nEq]==SQLITE_SO_ASC ){
topOp = WO_LT|WO_LE;
btmOp = WO_GT|WO_GE;
}else{
@@ -62529,7 +62529,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
}
}
-#ifdef STQLITE_TEST /* For testing and debugging use only */
+#ifdef SQLITE_TEST /* For testing and debugging use only */
/* Record in the query plan information about the current table
** and the index used to access it (if any). If the table itself
** is not used, its name is just '{}'. If no index is used
@@ -62574,7 +62574,7 @@ STQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
}
sqlite3_query_plan[nTQPlan] = 0;
nTQPlan = 0;
-#endif /* STQLITE_TEST // Testing and debugging use only */
+#endif /* SQLITE_TEST // Testing and debugging use only */
/* Record the continuation address in the WhereInfo structure. Then
** clean up and return.
@@ -62594,7 +62594,7 @@ whereBeginNoMem:
** Generate the end of the WHERE loop. See comments on
** sqlite3WhereBegin() for additional information.
*/
-STQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
+SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
Vdbe *v = pWInfo->pParse->pVdbe;
int i;
WhereLevel *pLevel;
@@ -63496,7 +63496,7 @@ static char *yyTracePrompt = 0;
** Outputs:
** None.
*/
-STQLITE_PRIVATE void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
+SQLITE_PRIVATE void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
yyTraceFILE = TraceFILE;
yyTracePrompt = zTracePrompt;
if( yyTraceFILE==0 ) yyTracePrompt = 0;
@@ -63927,7 +63927,7 @@ static void yyGrowStack(yyParser *p){
** A pointer to a parser. This pointer is used in subsequent calls
** to sqlite3Parser and sqlite3ParserFree.
*/
-STQLITE_PRIVATE void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
+SQLITE_PRIVATE void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
yyParser *pParser;
pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
if( pParser ){
@@ -64050,7 +64050,7 @@ static int yy_pop_parser_stack(yyParser *pParser){
** from malloc.
** </ul>
*/
-STQLITE_PRIVATE void sqlite3ParserFree(
+SQLITE_PRIVATE void sqlite3ParserFree(
void *p, /* The parser to be deleted */
void (*freeProc)(void*) /* Function used to reclaim memory */
){
@@ -64569,7 +64569,7 @@ static void yy_reduce(
** without this code, their parser segfaults. I'm not sure what there
** parser is doing to make this happen. This is the second bug report
** from wireshark this week. Clearly they are stressing Lemon in ways
- ** that it has not been previously stressed... (STQLite ticket #2172)
+ ** that it has not been previously stressed... (SQLite ticket #2172)
*/
memset(&yygotominor, 0, sizeof(yygotominor));
@@ -65026,10 +65026,10 @@ static void yy_reduce(
break;
case 146:
case 148:
-{yygotominor.yy46 = STQLITE_SO_ASC;}
+{yygotominor.yy46 = SQLITE_SO_ASC;}
break;
case 147:
-{yygotominor.yy46 = STQLITE_SO_DESC;}
+{yygotominor.yy46 = SQLITE_SO_DESC;}
break;
case 153:
{yygotominor.yy234.pLimit = 0; yygotominor.yy234.pOffset = 0;}
@@ -65048,7 +65048,7 @@ static void yy_reduce(
break;
case 160:
{
- sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy174,STQLITE_MAX_COLUMN,"set list");
+ sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy174,SQLITE_MAX_COLUMN,"set list");
sqlite3Update(pParse,yymsp[-3].minor.yy373,yymsp[-1].minor.yy174,yymsp[0].minor.yy172,yymsp[-4].minor.yy46);
}
break;
@@ -65132,7 +65132,7 @@ static void yy_reduce(
break;
case 187:
{
- if( yymsp[-1].minor.yy174 && yymsp[-1].minor.yy174->nExpr>STQLITE_MAX_FUNCTION_ARG ){
+ if( yymsp[-1].minor.yy174 && yymsp[-1].minor.yy174->nExpr>SQLITE_MAX_FUNCTION_ARG ){
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
}
yygotominor.yy172 = sqlite3ExprFunction(yymsp[-1].minor.yy174, &yymsp[-4].minor.yy0);
@@ -65338,7 +65338,7 @@ static void yy_reduce(
case 233:
{
sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy410, &yymsp[-5].minor.yy410, sqlite3SrcListAppend(0,&yymsp[-3].minor.yy410,0), yymsp[-1].minor.yy174, yymsp[-9].minor.yy46,
- &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, STQLITE_SO_ASC, yymsp[-7].minor.yy46);
+ &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy46);
}
break;
case 234:
@@ -65356,7 +65356,7 @@ static void yy_reduce(
if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)yymsp[-1].minor.yy410.z, yymsp[-1].minor.yy410.n);
}
yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-4].minor.yy174, p, &yymsp[-2].minor.yy410);
- sqlite3ExprListCheckLength(pParse, yygotominor.yy174, STQLITE_MAX_COLUMN, "index");
+ sqlite3ExprListCheckLength(pParse, yygotominor.yy174, SQLITE_MAX_COLUMN, "index");
if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
}
break;
@@ -65368,7 +65368,7 @@ static void yy_reduce(
if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)yymsp[-1].minor.yy410.z, yymsp[-1].minor.yy410.n);
}
yygotominor.yy174 = sqlite3ExprListAppend(0, p, &yymsp[-2].minor.yy410);
- sqlite3ExprListCheckLength(pParse, yygotominor.yy174, STQLITE_MAX_COLUMN, "index");
+ sqlite3ExprListCheckLength(pParse, yygotominor.yy174, SQLITE_MAX_COLUMN, "index");
if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
}
break;
@@ -65661,7 +65661,7 @@ static void yy_accept(
** Outputs:
** None.
*/
-STQLITE_PRIVATE void sqlite3Parser(
+SQLITE_PRIVATE void sqlite3Parser(
void *yyp, /* The parser */
int yymajor, /* The major token code number */
sqlite3ParserTOKENTYPE yyminor /* The value for the token */
@@ -65829,10 +65829,10 @@ STQLITE_PRIVATE void sqlite3Parser(
** to adjust the encoding. Only alphabetic characters and underscores
** need to be translated.
*/
-#ifdef STQLITE_ASCII
+#ifdef SQLITE_ASCII
# define charMap(X) sqlite3UpperToLower[(unsigned char)X]
#endif
-#ifdef STQLITE_EBCDIC
+#ifdef SQLITE_EBCDIC
# define charMap(X) ebcdicToAscii[(unsigned char)X]
const unsigned char ebcdicToAscii[] = {
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
@@ -65977,7 +65977,7 @@ static int keywordCode(const char *z, int n){
}
return TK_ID;
}
-STQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
+SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
return keywordCode((char*)z, n);
}
@@ -65998,10 +65998,10 @@ STQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
**
** Ticket #1066. the SQL standard does not allow '$' in the
** middle of identfiers. But many SQL implementations do.
-** STQLite will allow '$' in identifiers for compatibility.
+** SQLite will allow '$' in identifiers for compatibility.
** But the feature is undocumented.
*/
-#ifdef STQLITE_ASCII
+#ifdef SQLITE_ASCII
const char sqlite3IsIdChar[] = {
/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */
@@ -66013,7 +66013,7 @@ const char sqlite3IsIdChar[] = {
};
#define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && sqlite3IsIdChar[c-0x20]))
#endif
-#ifdef STQLITE_EBCDIC
+#ifdef SQLITE_EBCDIC
const char sqlite3IsIdChar[] = {
/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 4x */
@@ -66171,7 +66171,7 @@ static int getToken(const unsigned char *z, int *tokenType){
}
}
case '.': {
-#ifndef STQLITE_OMIT_FLOATING_POINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
if( !isdigit(z[1]) )
#endif
{
@@ -66185,7 +66185,7 @@ static int getToken(const unsigned char *z, int *tokenType){
case '5': case '6': case '7': case '8': case '9': {
*tokenType = TK_INTEGER;
for(i=0; isdigit(z[i]); i++){}
-#ifndef STQLITE_OMIT_FLOATING_POINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
if( z[i]=='.' ){
i++;
while( isdigit(z[i]) ){ i++; }
@@ -66228,7 +66228,7 @@ static int getToken(const unsigned char *z, int *tokenType){
/* Fall through into the next case if the '#' is not followed by
** a digit. Try to match #AAAA where AAAA is a parameter name. */
}
-#ifndef STQLITE_OMIT_TCL_VARIABLE
+#ifndef SQLITE_OMIT_TCL_VARIABLE
case '$':
#endif
case '@': /* For compatibility with MS SQL Server */
@@ -66238,7 +66238,7 @@ static int getToken(const unsigned char *z, int *tokenType){
for(i=1; (c=z[i])!=0; i++){
if( IdChar(c) ){
n++;
-#ifndef STQLITE_OMIT_TCL_VARIABLE
+#ifndef SQLITE_OMIT_TCL_VARIABLE
}else if( c=='(' && n>0 ){
do{
i++;
@@ -66259,7 +66259,7 @@ static int getToken(const unsigned char *z, int *tokenType){
if( n==0 ) *tokenType = TK_ILLEGAL;
return i;
}
-#ifndef STQLITE_OMIT_BLOB_LITERAL
+#ifndef SQLITE_OMIT_BLOB_LITERAL
case 'x': case 'X': {
if( (c=z[1])=='\'' || c=='"' ){
int delim = c;
@@ -66292,25 +66292,25 @@ static int getToken(const unsigned char *z, int *tokenType){
*tokenType = TK_ILLEGAL;
return 1;
}
-STQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){
+SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){
return getToken(z, tokenType);
}
/*
** The interface to the LEMON-generated parser
*/
-STQLITE_PRIVATE void *sqlite3ParserAlloc(void*(*)(size_t));
-STQLITE_PRIVATE void sqlite3ParserFree(void*, void(*)(void*));
-STQLITE_PRIVATE void sqlite3Parser(void*, int, Token, Parse*);
+SQLITE_PRIVATE void *sqlite3ParserAlloc(void*(*)(size_t));
+SQLITE_PRIVATE void sqlite3ParserFree(void*, void(*)(void*));
+SQLITE_PRIVATE void sqlite3Parser(void*, int, Token, Parse*);
/*
** Run the parser on the given SQL string. The parser structure is
-** passed in. An STQLITE_ status code is returned. If an error occurs
+** passed in. An SQLITE_ status code is returned. If an error occurs
** and pzErrMsg!=NULL then an error message might be written into
** memory obtained from malloc() and *pzErrMsg made to point to that
** error message. Or maybe not.
*/
-STQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
+SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
int nErr = 0;
int i;
void *pEngine;
@@ -66321,11 +66321,11 @@ STQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzE
if( db->activeVdbeCnt==0 ){
db->u1.isInterrupted = 0;
}
- pParse->rc = STQLITE_OK;
+ pParse->rc = SQLITE_OK;
i = 0;
pEngine = sqlite3ParserAlloc((void*(*)(size_t))sqlite3MallocX);
if( pEngine==0 ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
assert( pParse->sLastToken.dyn==0 );
assert( pParse->pNewTable==0 );
@@ -66341,15 +66341,15 @@ STQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzE
assert( pParse->sLastToken.dyn==0 );
pParse->sLastToken.n = getToken((unsigned char*)&zSql[i],&tokenType);
i += pParse->sLastToken.n;
- if( i>STQLITE_MAX_STQL_LENGTH ){
- pParse->rc = STQLITE_TOOBIG;
+ if( i>SQLITE_MAX_SQL_LENGTH ){
+ pParse->rc = SQLITE_TOOBIG;
break;
}
switch( tokenType ){
case TK_SPACE:
case TK_COMMENT: {
if( db->u1.isInterrupted ){
- pParse->rc = STQLITE_INTERRUPT;
+ pParse->rc = SQLITE_INTERRUPT;
sqlite3SetString(pzErrMsg, "interrupt", (char*)0);
goto abort_parse;
}
@@ -66371,7 +66371,7 @@ STQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzE
default: {
sqlite3Parser(pEngine, tokenType, pParse->sLastToken, pParse);
lastTokenParsed = tokenType;
- if( pParse->rc!=STQLITE_OK ){
+ if( pParse->rc!=SQLITE_OK ){
goto abort_parse;
}
break;
@@ -66379,7 +66379,7 @@ STQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzE
}
}
abort_parse:
- if( zSql[i]==0 && nErr==0 && pParse->rc==STQLITE_OK ){
+ if( zSql[i]==0 && nErr==0 && pParse->rc==SQLITE_OK ){
if( lastTokenParsed!=TK_SEMI ){
sqlite3Parser(pEngine, TK_SEMI, pParse->sLastToken, pParse);
pParse->zTail = &zSql[i];
@@ -66388,9 +66388,9 @@ abort_parse:
}
sqlite3ParserFree(pEngine, sqlite3FreeX);
if( sqlite3MallocFailed() ){
- pParse->rc = STQLITE_NOMEM;
+ pParse->rc = SQLITE_NOMEM;
}
- if( pParse->rc!=STQLITE_OK && pParse->rc!=STQLITE_DONE && pParse->zErrMsg==0 ){
+ if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){
sqlite3SetString(&pParse->zErrMsg, sqlite3ErrStr(pParse->rc), (char*)0);
}
if( pParse->zErrMsg ){
@@ -66406,7 +66406,7 @@ abort_parse:
sqlite3VdbeDelete(pParse->pVdbe);
pParse->pVdbe = 0;
}
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
if( pParse->nested==0 ){
sqliteFree(pParse->aTableLock);
pParse->aTableLock = 0;
@@ -66424,8 +66424,8 @@ abort_parse:
sqlite3DeleteTrigger(pParse->pNewTrigger);
sqliteFree(pParse->apVarExpr);
- if( nErr>0 && (pParse->rc==STQLITE_OK || pParse->rc==STQLITE_DONE) ){
- pParse->rc = STQLITE_ERROR;
+ if( nErr>0 && (pParse->rc==SQLITE_OK || pParse->rc==SQLITE_DONE) ){
+ pParse->rc = SQLITE_ERROR;
}
return nErr;
}
@@ -66443,9 +66443,9 @@ abort_parse:
** May you share freely, never taking more than you give.
**
*************************************************************************
-** Main file for the STQLite library. The routines in this file
+** Main file for the SQLite library. The routines in this file
** implement the programmer interface to the library. Routines in
-** other files are for internal use by STQLite and should not be
+** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.377 2007/06/22 15:21:16 danielk1977 Exp $
@@ -66454,13 +66454,13 @@ abort_parse:
/*
** The version of the library
*/
-const char sqlite3_version[] = STQLITE_VERSION;
-STQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; }
-int sqlite3_libversion_number(void){ return STQLITE_VERSION_NUMBER; }
+const char sqlite3_version[] = SQLITE_VERSION;
+SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; }
+int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
/*
** If the following function pointer is not NULL and if
-** STQLITE_ENABLE_IOTRACE is enabled, then messages describing
+** SQLITE_ENABLE_IOTRACE is enabled, then messages describing
** I/O active are written using this function. These messages
** are intended for debugging activity only.
*/
@@ -66498,7 +66498,7 @@ static int binCollFunc(
** Another built-in collating sequence: NOCASE.
**
** This collating sequence is intended to be used for "case independant
-** comparison". STQLite's knowledge of upper and lower case equivalents
+** comparison". SQLite's knowledge of upper and lower case equivalents
** extends only to the 26 characters used in the English language.
**
** At the moment there is only a UTF-8 implementation.
@@ -66526,7 +66526,7 @@ sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){
/*
** Return the number of changes in the most recent call to sqlite3_exec().
*/
-STQLITE_API int sqlite3_changes(sqlite3 *db){
+SQLITE_API int sqlite3_changes(sqlite3 *db){
return db->nChange;
}
@@ -66538,20 +66538,20 @@ int sqlite3_total_changes(sqlite3 *db){
}
/*
-** Close an existing STQLite database
+** Close an existing SQLite database
*/
-STQLITE_API int sqlite3_close(sqlite3 *db){
+SQLITE_API int sqlite3_close(sqlite3 *db){
HashElem *i;
int j;
if( !db ){
- return STQLITE_OK;
+ return SQLITE_OK;
}
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
-#ifdef STQLITE_SSE
+#ifdef SQLITE_SSE
{
extern void sqlite3SseCleanup(sqlite3*);
sqlite3SseCleanup(db);
@@ -66569,15 +66569,15 @@ STQLITE_API int sqlite3_close(sqlite3 *db){
*/
sqlite3VtabRollback(db);
- /* If there are any outstanding VMs, return STQLITE_BUSY. */
+ /* If there are any outstanding VMs, return SQLITE_BUSY. */
if( db->pVdbe ){
- sqlite3Error(db, STQLITE_BUSY,
+ sqlite3Error(db, SQLITE_BUSY,
"Unable to close due to unfinalised statements");
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
}
assert( !sqlite3SafetyCheck(db) );
- /* FIX ME: db->magic may be set to STQLITE_MAGIC_CLOSED if the database
+ /* FIX ME: db->magic may be set to SQLITE_MAGIC_CLOSED if the database
** cannot be opened for some reason. So this routine needs to run in
** that case. But maybe there should be an extra magic value for the
** "failed to open" state.
@@ -66585,9 +66585,9 @@ STQLITE_API int sqlite3_close(sqlite3 *db){
** TODO: Coverage tests do not test the case where this condition is
** true. It's hard to see how to cause it without messing with threads.
*/
- if( db->magic!=STQLITE_MAGIC_CLOSED && sqlite3SafetyOn(db) ){
+ if( db->magic!=SQLITE_MAGIC_CLOSED && sqlite3SafetyOn(db) ){
/* printf("DID NOT CLOSE\n"); fflush(stdout); */
- return STQLITE_ERROR;
+ return SQLITE_ERROR;
}
for(j=0; j<db->nDb; j++){
@@ -66622,7 +66622,7 @@ STQLITE_API int sqlite3_close(sqlite3 *db){
sqliteFree(pColl);
}
sqlite3HashClear(&db->aCollSeq);
-#ifndef STQLITE_OMIT_VIRTUALTABLE
+#ifndef SQLITE_OMIT_VIRTUALTABLE
for(i=sqliteHashFirst(&db->aModule); i; i=sqliteHashNext(i)){
Module *pMod = (Module *)sqliteHashData(i);
if( pMod->xDestroy ){
@@ -66634,13 +66634,13 @@ STQLITE_API int sqlite3_close(sqlite3 *db){
#endif
sqlite3HashClear(&db->aFunc);
- sqlite3Error(db, STQLITE_OK, 0); /* Deallocates any cached error strings. */
+ sqlite3Error(db, SQLITE_OK, 0); /* Deallocates any cached error strings. */
if( db->pErr ){
sqlite3ValueFree(db->pErr);
}
sqlite3CloseExtensions(db);
- db->magic = STQLITE_MAGIC_ERROR;
+ db->magic = SQLITE_MAGIC_ERROR;
/* The temp-database schema is allocated differently from the other schema
** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()).
@@ -66651,13 +66651,13 @@ STQLITE_API int sqlite3_close(sqlite3 *db){
sqliteFree(db->aDb[1].pSchema);
sqliteFree(db);
sqlite3ReleaseThreadData();
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Rollback all database files.
*/
-STQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db){
+SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db){
int i;
int inTrans = 0;
for(i=0; i<db->nDb; i++){
@@ -66670,7 +66670,7 @@ STQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db){
}
}
sqlite3VtabRollback(db);
- if( db->flags&STQLITE_InternChanges ){
+ if( db->flags&SQLITE_InternChanges ){
sqlite3ResetInternalSchema(db, 0);
}
@@ -66684,35 +66684,35 @@ STQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db){
** Return a static string that describes the kind of error specified in the
** argument.
*/
-STQLITE_PRIVATE const char *sqlite3ErrStr(int rc){
+SQLITE_PRIVATE const char *sqlite3ErrStr(int rc){
const char *z;
switch( rc & 0xff ){
- case STQLITE_ROW:
- case STQLITE_DONE:
- case STQLITE_OK: z = "not an error"; break;
- case STQLITE_ERROR: z = "SQL logic error or missing database"; break;
- case STQLITE_PERM: z = "access permission denied"; break;
- case STQLITE_ABORT: z = "callback requested query abort"; break;
- case STQLITE_BUSY: z = "database is locked"; break;
- case STQLITE_LOCKED: z = "database table is locked"; break;
- case STQLITE_NOMEM: z = "out of memory"; break;
- case STQLITE_READONLY: z = "attempt to write a readonly database"; break;
- case STQLITE_INTERRUPT: z = "interrupted"; break;
- case STQLITE_IOERR: z = "disk I/O error"; break;
- case STQLITE_CORRUPT: z = "database disk image is malformed"; break;
- case STQLITE_FULL: z = "database or disk is full"; break;
- case STQLITE_CANTOPEN: z = "unable to open database file"; break;
- case STQLITE_EMPTY: z = "table contains no data"; break;
- case STQLITE_SCHEMA: z = "database schema has changed"; break;
- case STQLITE_TOOBIG: z = "String or BLOB exceeded size limit"; break;
- case STQLITE_CONSTRAINT: z = "constraint failed"; break;
- case STQLITE_MISMATCH: z = "datatype mismatch"; break;
- case STQLITE_MISUSE: z = "library routine called out of sequence";break;
- case STQLITE_NOLFS: z = "kernel lacks large file support"; break;
- case STQLITE_AUTH: z = "authorization denied"; break;
- case STQLITE_FORMAT: z = "auxiliary database format error"; break;
- case STQLITE_RANGE: z = "bind or column index out of range"; break;
- case STQLITE_NOTADB: z = "file is encrypted or is not a database";break;
+ case SQLITE_ROW:
+ case SQLITE_DONE:
+ case SQLITE_OK: z = "not an error"; break;
+ case SQLITE_ERROR: z = "SQL logic error or missing database"; break;
+ case SQLITE_PERM: z = "access permission denied"; break;
+ case SQLITE_ABORT: z = "callback requested query abort"; break;
+ case SQLITE_BUSY: z = "database is locked"; break;
+ case SQLITE_LOCKED: z = "database table is locked"; break;
+ case SQLITE_NOMEM: z = "out of memory"; break;
+ case SQLITE_READONLY: z = "attempt to write a readonly database"; break;
+ case SQLITE_INTERRUPT: z = "interrupted"; break;
+ case SQLITE_IOERR: z = "disk I/O error"; break;
+ case SQLITE_CORRUPT: z = "database disk image is malformed"; break;
+ case SQLITE_FULL: z = "database or disk is full"; break;
+ case SQLITE_CANTOPEN: z = "unable to open database file"; break;
+ case SQLITE_EMPTY: z = "table contains no data"; break;
+ case SQLITE_SCHEMA: z = "database schema has changed"; break;
+ case SQLITE_TOOBIG: z = "String or BLOB exceeded size limit"; break;
+ case SQLITE_CONSTRAINT: z = "constraint failed"; break;
+ case SQLITE_MISMATCH: z = "datatype mismatch"; break;
+ case SQLITE_MISUSE: z = "library routine called out of sequence";break;
+ case SQLITE_NOLFS: z = "kernel lacks large file support"; break;
+ case SQLITE_AUTH: z = "authorization denied"; break;
+ case SQLITE_FORMAT: z = "auxiliary database format error"; break;
+ case SQLITE_RANGE: z = "bind or column index out of range"; break;
+ case SQLITE_NOTADB: z = "file is encrypted or is not a database";break;
default: z = "unknown error"; break;
}
return z;
@@ -66766,9 +66766,9 @@ static int sqliteDefaultBusyCallback(
**
** This routine is called when an operation failed with a lock.
** If this routine returns non-zero, the lock is retried. If it
-** returns 0, the operation aborts with an STQLITE_BUSY error.
+** returns 0, the operation aborts with an SQLITE_BUSY error.
*/
-STQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){
+SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){
int rc;
if( p==0 || p->xFunc==0 || p->nBusy<0 ) return 0;
rc = p->xFunc(p->pArg, p->nBusy);
@@ -66790,15 +66790,15 @@ int sqlite3_busy_handler(
void *pArg
){
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
db->busyHandler.xFunc = xBusy;
db->busyHandler.pArg = pArg;
db->busyHandler.nBusy = 0;
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#ifndef STQLITE_OMIT_PROGRESS_CALLBACK
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
/*
** This routine sets the progress callback for an Sqlite database to the
** given callback function with the given argument. The progress callback will
@@ -66831,7 +66831,7 @@ void sqlite3_progress_handler(
*/
int sqlite3_busy_timeout(sqlite3 *db, int ms){
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
if( ms>0 ){
db->busyTimeout = ms;
@@ -66839,21 +66839,21 @@ int sqlite3_busy_timeout(sqlite3 *db, int ms){
}else{
sqlite3_busy_handler(db, 0, 0);
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
** Cause any pending operation to stop at its earliest opportunity.
*/
-STQLITE_API void sqlite3_interrupt(sqlite3 *db){
- if( db && (db->magic==STQLITE_MAGIC_OPEN || db->magic==STQLITE_MAGIC_BUSY) ){
+SQLITE_API void sqlite3_interrupt(sqlite3 *db){
+ if( db && (db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_BUSY) ){
db->u1.isInterrupted = 1;
}
}
/*
-** Memory allocation routines that use STQLites internal memory
-** memory allocator. Depending on how STQLite is compiled, the
+** Memory allocation routines that use SQLites internal memory
+** memory allocator. Depending on how SQLite is compiled, the
** internal memory allocator might be just an alias for the
** system default malloc/realloc/free. Or the built-in allocator
** might do extra stuff like put sentinals around buffers to
@@ -66861,9 +66861,9 @@ STQLITE_API void sqlite3_interrupt(sqlite3 *db){
**
** Use sqlite3_free() to free memory returned by sqlite3_mprintf().
*/
-STQLITE_API void sqlite3_free(void *p){ if( p ) sqlite3OsFree(p); }
-STQLITE_API void *sqlite3_malloc(int nByte){ return nByte>0 ? sqlite3OsMalloc(nByte) : 0; }
-STQLITE_API void *sqlite3_realloc(void *pOld, int nByte){
+SQLITE_API void sqlite3_free(void *p){ if( p ) sqlite3OsFree(p); }
+SQLITE_API void *sqlite3_malloc(int nByte){ return nByte>0 ? sqlite3OsMalloc(nByte) : 0; }
+SQLITE_API void *sqlite3_realloc(void *pOld, int nByte){
if( pOld ){
if( nByte>0 ){
return sqlite3OsRealloc(pOld, nByte);
@@ -66882,7 +66882,7 @@ STQLITE_API void *sqlite3_realloc(void *pOld, int nByte){
** that if a malloc() fails in sqlite3_create_function(), an error code
** is returned and the mallocFailed flag cleared.
*/
-STQLITE_PRIVATE int sqlite3CreateFunc(
+SQLITE_PRIVATE int sqlite3CreateFunc(
sqlite3 *db,
const char *zFunctionName,
int nArg,
@@ -66896,7 +66896,7 @@ STQLITE_PRIVATE int sqlite3CreateFunc(
int nName;
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
if( zFunctionName==0 ||
(xFunc && (xFinal || xStep)) ||
@@ -66904,46 +66904,46 @@ STQLITE_PRIVATE int sqlite3CreateFunc(
(!xFunc && (!xFinal && xStep)) ||
(nArg<-1 || nArg>127) ||
(255<(nName = strlen(zFunctionName))) ){
- sqlite3Error(db, STQLITE_ERROR, "bad parameters");
- return STQLITE_ERROR;
+ sqlite3Error(db, SQLITE_ERROR, "bad parameters");
+ return SQLITE_ERROR;
}
-#ifndef STQLITE_OMIT_UTF16
- /* If STQLITE_UTF16 is specified as the encoding type, transform this
- ** to one of STQLITE_UTF16LE or STQLITE_UTF16BE using the
- ** STQLITE_UTF16NATIVE macro. STQLITE_UTF16 is not used internally.
+#ifndef SQLITE_OMIT_UTF16
+ /* If SQLITE_UTF16 is specified as the encoding type, transform this
+ ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the
+ ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally.
**
- ** If STQLITE_ANY is specified, add three versions of the function
+ ** If SQLITE_ANY is specified, add three versions of the function
** to the hash table.
*/
- if( enc==STQLITE_UTF16 ){
- enc = STQLITE_UTF16NATIVE;
- }else if( enc==STQLITE_ANY ){
+ if( enc==SQLITE_UTF16 ){
+ enc = SQLITE_UTF16NATIVE;
+ }else if( enc==SQLITE_ANY ){
int rc;
- rc = sqlite3CreateFunc(db, zFunctionName, nArg, STQLITE_UTF8,
+ rc = sqlite3CreateFunc(db, zFunctionName, nArg, SQLITE_UTF8,
pUserData, xFunc, xStep, xFinal);
- if( rc!=STQLITE_OK ) return rc;
- rc = sqlite3CreateFunc(db, zFunctionName, nArg, STQLITE_UTF16LE,
+ if( rc!=SQLITE_OK ) return rc;
+ rc = sqlite3CreateFunc(db, zFunctionName, nArg, SQLITE_UTF16LE,
pUserData, xFunc, xStep, xFinal);
- if( rc!=STQLITE_OK ) return rc;
- enc = STQLITE_UTF16BE;
+ if( rc!=SQLITE_OK ) return rc;
+ enc = SQLITE_UTF16BE;
}
#else
- enc = STQLITE_UTF8;
+ enc = SQLITE_UTF8;
#endif
/* Check if an existing function is being overridden or deleted. If so,
- ** and there are active VMs, then return STQLITE_BUSY. If a function
+ ** and there are active VMs, then return SQLITE_BUSY. If a function
** is being overridden/deleted but there are no active VMs, allow the
** operation to continue but tqinvalidate all precompiled statements.
*/
p = sqlite3FindFunction(db, zFunctionName, nName, nArg, enc, 0);
if( p && p->iPrefEnc==enc && p->nArg==nArg ){
if( db->activeVdbeCnt ){
- sqlite3Error(db, STQLITE_BUSY,
+ sqlite3Error(db, SQLITE_BUSY,
"Unable to delete/modify user-function due to active statements");
assert( !sqlite3MallocFailed() );
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
}else{
sqlite3ExpirePreparedStatements(db);
}
@@ -66958,7 +66958,7 @@ STQLITE_PRIVATE int sqlite3CreateFunc(
p->pUserData = pUserData;
p->nArg = nArg;
}
- return STQLITE_OK;
+ return SQLITE_OK;
}
/*
@@ -66981,7 +66981,7 @@ int sqlite3_create_function(
return sqlite3ApiExit(db, rc);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
int sqlite3_create_function16(
sqlite3 *db,
const void *zFunctionName,
@@ -67023,14 +67023,14 @@ int sqlite3_overload_function(
int nArg
){
int nName = strlen(zName);
- if( sqlite3FindFunction(db, zName, nName, nArg, STQLITE_UTF8, 0)==0 ){
- sqlite3CreateFunc(db, zName, nArg, STQLITE_UTF8,
+ if( sqlite3FindFunction(db, zName, nName, nArg, SQLITE_UTF8, 0)==0 ){
+ sqlite3CreateFunc(db, zName, nArg, SQLITE_UTF8,
0, sqlite3InvalidFunction, 0, 0);
}
- return sqlite3ApiExit(db, STQLITE_OK);
+ return sqlite3ApiExit(db, SQLITE_OK);
}
-#ifndef STQLITE_OMIT_TRACE
+#ifndef SQLITE_OMIT_TRACE
/*
** Register a trace function. The pArg from the previously registered trace
** is returned.
@@ -67039,7 +67039,7 @@ int sqlite3_overload_function(
** trace is a pointer to a function that is invoked at the start of each
** SQL statement.
*/
-STQLITE_API void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
+SQLITE_API void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
void *pOld = db->pTraceArg;
db->xTrace = xTrace;
db->pTraceArg = pArg;
@@ -67053,7 +67053,7 @@ STQLITE_API void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*),
** profile is a pointer to a function that is invoked at the conclusion of
** each SQL statement that is run.
*/
-STQLITE_API void *sqlite3_profile(
+SQLITE_API void *sqlite3_profile(
sqlite3 *db,
void (*xProfile)(void*,const char*,sqlite_uint64),
void *pArg
@@ -67063,7 +67063,7 @@ STQLITE_API void *sqlite3_profile(
db->pProfileArg = pArg;
return pOld;
}
-#endif /* STQLITE_OMIT_TRACE */
+#endif /* SQLITE_OMIT_TRACE */
/*** EXPERIMENTAL ***
**
@@ -67137,7 +67137,7 @@ void *sqlite3_rollback_hook(
** 2 0 memory
** 3 any memory
*/
-STQLITE_PRIVATE int sqlite3BtreeFactory(
+SQLITE_PRIVATE int sqlite3BtreeFactory(
const sqlite3 *db, /* Main database when opening aux otherwise 0 */
const char *zFilename, /* Name of the file containing the BTree database */
int omitJournal, /* if TRUE then do not journal this file */
@@ -67151,14 +67151,14 @@ STQLITE_PRIVATE int sqlite3BtreeFactory(
if( omitJournal ){
btree_flags |= BTREE_OMIT_JOURNAL;
}
- if( db->flags & STQLITE_NoReadlock ){
+ if( db->flags & SQLITE_NoReadlock ){
btree_flags |= BTREE_NO_READLOCK;
}
if( zFilename==0 ){
#if TEMP_STORE==0
/* Do nothing */
#endif
-#ifndef STQLITE_OMIT_MEMORYDB
+#ifndef SQLITE_OMIT_MEMORYDB
#if TEMP_STORE==1
if( db->temp_store==2 ) zFilename = ":memory:";
#endif
@@ -67168,11 +67168,11 @@ STQLITE_PRIVATE int sqlite3BtreeFactory(
#if TEMP_STORE==3
zFilename = ":memory:";
#endif
-#endif /* STQLITE_OMIT_MEMORYDB */
+#endif /* SQLITE_OMIT_MEMORYDB */
}
rc = sqlite3BtreeOpen(zFilename, (sqlite3 *)db, ppBtree, btree_flags);
- if( rc==STQLITE_OK ){
+ if( rc==SQLITE_OK ){
sqlite3BtreeSetBusyHandler(*ppBtree, (void*)&db->busyHandler);
sqlite3BtreeSetCacheSize(*ppBtree, nCache);
}
@@ -67183,14 +67183,14 @@ STQLITE_PRIVATE int sqlite3BtreeFactory(
** Return UTF-8 encoded English language explanation of the most recent
** error.
*/
-STQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
+SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
const char *z;
assert( !sqlite3MallocFailed() );
if( !db ){
- return sqlite3ErrStr(STQLITE_NOMEM);
+ return sqlite3ErrStr(SQLITE_NOMEM);
}
- if( sqlite3SafetyCheck(db) || db->errCode==STQLITE_MISUSE ){
- return sqlite3ErrStr(STQLITE_MISUSE);
+ if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){
+ return sqlite3ErrStr(SQLITE_MISUSE);
}
z = (char*)sqlite3_value_text(db->pErr);
if( z==0 ){
@@ -67199,12 +67199,12 @@ STQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
return z;
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** Return UTF-16 encoded English language explanation of the most recent
** error.
*/
-STQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
+SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
/* Because all the characters in the string are in the tqunicode
** range 0x00-0xFF, if we pad the big-endian string with a
** zero byte, we can obtain the little-endian string with
@@ -67227,32 +67227,32 @@ STQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
const void *z;
assert( !sqlite3MallocFailed() );
if( !db ){
- return (void *)(&outOfMemBe[STQLITE_UTF16NATIVE==STQLITE_UTF16LE?1:0]);
+ return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
}
- if( sqlite3SafetyCheck(db) || db->errCode==STQLITE_MISUSE ){
- return (void *)(&misuseBe[STQLITE_UTF16NATIVE==STQLITE_UTF16LE?1:0]);
+ if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){
+ return (void *)(&misuseBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
}
z = sqlite3_value_text16(db->pErr);
if( z==0 ){
sqlite3ValueSetStr(db->pErr, -1, sqlite3ErrStr(db->errCode),
- STQLITE_UTF8, STQLITE_STATIC);
+ SQLITE_UTF8, SQLITE_STATIC);
z = sqlite3_value_text16(db->pErr);
}
sqlite3ApiExit(0, 0);
return z;
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
/*
-** Return the most recent error code generated by an STQLite routine. If NULL is
+** Return the most recent error code generated by an SQLite routine. If NULL is
** passed to this function, we assume a malloc() failed during sqlite3_open().
*/
-STQLITE_API int sqlite3_errcode(sqlite3 *db){
+SQLITE_API int sqlite3_errcode(sqlite3 *db){
if( !db || sqlite3MallocFailed() ){
- return STQLITE_NOMEM;
+ return SQLITE_NOMEM;
}
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
return db->errCode & db->errMask;
}
@@ -67273,21 +67273,21 @@ static int createCollation(
int enc2;
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
- /* If STQLITE_UTF16 is specified as the encoding type, transform this
- ** to one of STQLITE_UTF16LE or STQLITE_UTF16BE using the
- ** STQLITE_UTF16NATIVE macro. STQLITE_UTF16 is not used internally.
+ /* If SQLITE_UTF16 is specified as the encoding type, transform this
+ ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the
+ ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally.
*/
- enc2 = enc & ~STQLITE_UTF16_ALIGNED;
- if( enc2==STQLITE_UTF16 ){
- enc2 = STQLITE_UTF16NATIVE;
+ enc2 = enc & ~SQLITE_UTF16_ALIGNED;
+ if( enc2==SQLITE_UTF16 ){
+ enc2 = SQLITE_UTF16NATIVE;
}
if( (enc2&~3)!=0 ){
- sqlite3Error(db, STQLITE_ERROR, "unknown encoding");
- return STQLITE_ERROR;
+ sqlite3Error(db, SQLITE_ERROR, "unknown encoding");
+ return SQLITE_ERROR;
}
/* Check if this call is removing or replacing an existing collation
@@ -67297,9 +67297,9 @@ static int createCollation(
pColl = sqlite3FindCollSeq(db, (u8)enc2, zName, strlen(zName), 0);
if( pColl && pColl->xCmp ){
if( db->activeVdbeCnt ){
- sqlite3Error(db, STQLITE_BUSY,
+ sqlite3Error(db, SQLITE_BUSY,
"Unable to delete/modify collation sequence due to active statements");
- return STQLITE_BUSY;
+ return SQLITE_BUSY;
}
sqlite3ExpirePreparedStatements(db);
@@ -67309,7 +67309,7 @@ static int createCollation(
** Also, collation destructor - CollSeq.xDel() - function may need
** to be called.
*/
- if( (pColl->enc & ~STQLITE_UTF16_ALIGNED)==enc2 ){
+ if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){
CollSeq *aColl = sqlite3HashFind(&db->aCollSeq, zName, strlen(zName));
int j;
for(j=0; j<3; j++){
@@ -67329,10 +67329,10 @@ static int createCollation(
pColl->xCmp = xCompare;
pColl->pUser = pCtx;
pColl->xDel = xDel;
- pColl->enc = enc2 | (enc & STQLITE_UTF16_ALIGNED);
+ pColl->enc = enc2 | (enc & SQLITE_UTF16_ALIGNED);
}
- sqlite3Error(db, STQLITE_OK, 0);
- return STQLITE_OK;
+ sqlite3Error(db, SQLITE_OK, 0);
+ return SQLITE_OK;
}
@@ -67356,54 +67356,54 @@ static int openDatabase(
if( db==0 ) goto opendb_out;
db->errMask = 0xff;
db->priorNewRowid = 0;
- db->magic = STQLITE_MAGIC_BUSY;
+ db->magic = SQLITE_MAGIC_BUSY;
db->nDb = 2;
db->aDb = db->aDbStatic;
db->autoCommit = 1;
- db->flags |= STQLITE_ShortColNames
-#if STQLITE_DEFAULT_FILE_FORMAT<4
- | STQLITE_LegacyFileFmt
+ db->flags |= SQLITE_ShortColNames
+#if SQLITE_DEFAULT_FILE_FORMAT<4
+ | SQLITE_LegacyFileFmt
#endif
-#ifdef STQLITE_ENABLE_LOAD_EXTENSION
- | STQLITE_LoadExtension
+#ifdef SQLITE_ENABLE_LOAD_EXTENSION
+ | SQLITE_LoadExtension
#endif
;
- sqlite3HashInit(&db->aFunc, STQLITE_HASH_STRING, 0);
- sqlite3HashInit(&db->aCollSeq, STQLITE_HASH_STRING, 0);
-#ifndef STQLITE_OMIT_VIRTUALTABLE
- sqlite3HashInit(&db->aModule, STQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&db->aFunc, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&db->aCollSeq, SQLITE_HASH_STRING, 0);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ sqlite3HashInit(&db->aModule, SQLITE_HASH_STRING, 0);
#endif
/* Add the default collation sequence BINARY. BINARY works for both UTF-8
** and UTF-16, so add a version for each to avoid any unnecessary
** conversions. The only error that can occur here is a malloc() failure.
*/
- if( createCollation(db, "BINARY", STQLITE_UTF8, 0, binCollFunc, 0) ||
- createCollation(db, "BINARY", STQLITE_UTF16BE, 0, binCollFunc, 0) ||
- createCollation(db, "BINARY", STQLITE_UTF16LE, 0, binCollFunc, 0) ||
- (db->pDfltColl = sqlite3FindCollSeq(db, STQLITE_UTF8, "BINARY", 6, 0))==0
+ if( createCollation(db, "BINARY", SQLITE_UTF8, 0, binCollFunc, 0) ||
+ createCollation(db, "BINARY", SQLITE_UTF16BE, 0, binCollFunc, 0) ||
+ createCollation(db, "BINARY", SQLITE_UTF16LE, 0, binCollFunc, 0) ||
+ (db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0))==0
){
assert( sqlite3MallocFailed() );
- db->magic = STQLITE_MAGIC_CLOSED;
+ db->magic = SQLITE_MAGIC_CLOSED;
goto opendb_out;
}
/* Also add a UTF-8 case-insensitive collation sequence. */
- createCollation(db, "NOCASE", STQLITE_UTF8, 0, nocaseCollatingFunc, 0);
+ createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0);
/* Set flags on the built-in collating sequences */
- db->pDfltColl->type = STQLITE_COLL_BINARY;
- pColl = sqlite3FindCollSeq(db, STQLITE_UTF8, "NOCASE", 6, 0);
+ db->pDfltColl->type = SQLITE_COLL_BINARY;
+ pColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "NOCASE", 6, 0);
if( pColl ){
- pColl->type = STQLITE_COLL_NOCASE;
+ pColl->type = SQLITE_COLL_NOCASE;
}
/* Open the backend database driver */
- rc = sqlite3BtreeFactory(db, zFilename, 0, STQLITE_DEFAULT_CACHE_SIZE,
+ rc = sqlite3BtreeFactory(db, zFilename, 0, SQLITE_DEFAULT_CACHE_SIZE,
&db->aDb[0].pBt);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3Error(db, rc, 0);
- db->magic = STQLITE_MAGIC_CLOSED;
+ db->magic = SQLITE_MAGIC_CLOSED;
goto opendb_out;
}
db->aDb[0].pSchema = sqlite3SchemaGet(db->aDb[0].pBt);
@@ -67415,12 +67415,12 @@ static int openDatabase(
*/
db->aDb[0].zName = "main";
db->aDb[0].safety_level = 3;
-#ifndef STQLITE_OMIT_TEMPDB
+#ifndef SQLITE_OMIT_TEMPDB
db->aDb[1].zName = "temp";
db->aDb[1].safety_level = 1;
#endif
- db->magic = STQLITE_MAGIC_OPEN;
+ db->magic = SQLITE_MAGIC_OPEN;
if( sqlite3MallocFailed() ){
goto opendb_out;
}
@@ -67429,51 +67429,51 @@ static int openDatabase(
** database schema yet. This is delayed until the first time the database
** is accessed.
*/
- sqlite3Error(db, STQLITE_OK, 0);
+ sqlite3Error(db, SQLITE_OK, 0);
sqlite3RegisterBuiltinFunctions(db);
/* Load automatic extensions - extensions that have been registered
** using the sqlite3_automatic_extension() API.
*/
(void)sqlite3AutoLoadExtensions(db);
- if( sqlite3_errcode(db)!=STQLITE_OK ){
+ if( sqlite3_errcode(db)!=SQLITE_OK ){
goto opendb_out;
}
-#ifdef STQLITE_ENABLE_FTS1
+#ifdef SQLITE_ENABLE_FTS1
if( !sqlite3MallocFailed() ){
extern int sqlite3Fts1Init(sqlite3*);
rc = sqlite3Fts1Init(db);
}
#endif
-#ifdef STQLITE_ENABLE_FTS2
- if( !sqlite3MallocFailed() && rc==STQLITE_OK ){
+#ifdef SQLITE_ENABLE_FTS2
+ if( !sqlite3MallocFailed() && rc==SQLITE_OK ){
extern int sqlite3Fts2Init(sqlite3*);
rc = sqlite3Fts2Init(db);
}
#endif
-#ifdef STQLITE_ENABLE_ICU
- if( !sqlite3MallocFailed() && rc==STQLITE_OK ){
+#ifdef SQLITE_ENABLE_ICU
+ if( !sqlite3MallocFailed() && rc==SQLITE_OK ){
extern int sqlite3IcuInit(sqlite3*);
rc = sqlite3IcuInit(db);
}
#endif
sqlite3Error(db, rc, 0);
- /* -DSTQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
- ** mode. -DSTQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
+ /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
+ ** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
** mode. Doing nothing at all also makes NORMAL the default.
*/
-#ifdef STQLITE_DEFAULT_LOCKING_MODE
- db->dfltLockMode = STQLITE_DEFAULT_LOCKING_MODE;
+#ifdef SQLITE_DEFAULT_LOCKING_MODE
+ db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE;
sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt),
- STQLITE_DEFAULT_LOCKING_MODE);
+ SQLITE_DEFAULT_LOCKING_MODE);
#endif
opendb_out:
- if( STQLITE_NOMEM==(rc = sqlite3_errcode(db)) ){
+ if( SQLITE_NOMEM==(rc = sqlite3_errcode(db)) ){
sqlite3_close(db);
db = 0;
}
@@ -67484,36 +67484,36 @@ opendb_out:
/*
** Open a new database handle.
*/
-STQLITE_API int sqlite3_open(
+SQLITE_API int sqlite3_open(
const char *zFilename,
sqlite3 **ppDb
){
return openDatabase(zFilename, ppDb);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** Open a new database handle.
*/
-STQLITE_API int sqlite3_open16(
+SQLITE_API int sqlite3_open16(
const void *zFilename,
sqlite3 **ppDb
){
char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
sqlite3_value *pVal;
assert( zFilename );
assert( ppDb );
*ppDb = 0;
pVal = sqlite3ValueNew();
- sqlite3ValueSetStr(pVal, -1, zFilename, STQLITE_UTF16NATIVE, STQLITE_STATIC);
- zFilename8 = sqlite3ValueText(pVal, STQLITE_UTF8);
+ sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
+ zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
if( zFilename8 ){
rc = openDatabase(zFilename8, ppDb);
- if( rc==STQLITE_OK && *ppDb ){
+ if( rc==SQLITE_OK && *ppDb ){
rc = sqlite3_exec(*ppDb, "PRAGMA encoding = 'UTF-16'", 0, 0, 0);
- if( rc!=STQLITE_OK ){
+ if( rc!=SQLITE_OK ){
sqlite3_close(*ppDb);
*ppDb = 0;
}
@@ -67523,21 +67523,21 @@ STQLITE_API int sqlite3_open16(
return sqlite3ApiExit(0, rc);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
/*
** The following routine destroys a virtual machine that is created by
-** the sqlite3_compile() routine. The integer returned is an STQLITE_
+** the sqlite3_compile() routine. The integer returned is an SQLITE_
** success/failure code that describes the result of executing the virtual
** machine.
**
** This routine sets the error code and string returned by
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
*/
-STQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){
+SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){
int rc;
if( pStmt==0 ){
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}else{
rc = sqlite3VdbeFinalize((Vdbe*)pStmt);
}
@@ -67552,10 +67552,10 @@ STQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){
** This routine sets the error code and string returned by
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
*/
-STQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt){
+SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt){
int rc;
if( pStmt==0 ){
- rc = STQLITE_OK;
+ rc = SQLITE_OK;
}else{
rc = sqlite3VdbeReset((Vdbe*)pStmt);
sqlite3VdbeMakeReady((Vdbe*)pStmt, -1, 0, 0, 0);
@@ -67597,7 +67597,7 @@ int sqlite3_create_collation_v2(
return sqlite3ApiExit(db, rc);
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** Register a new collation sequence with the database handle db.
*/
@@ -67608,7 +67608,7 @@ int sqlite3_create_collation16(
void* pCtx,
int(*xCompare)(void*,int,const void*,int,const void*)
){
- int rc = STQLITE_OK;
+ int rc = SQLITE_OK;
char *zName8;
assert( !sqlite3MallocFailed() );
zName8 = sqlite3Utf16to8(zName, -1);
@@ -67618,7 +67618,7 @@ int sqlite3_create_collation16(
}
return sqlite3ApiExit(db, rc);
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
/*
** Register a collation sequence factory callback with the database handle
@@ -67630,15 +67630,15 @@ int sqlite3_collation_needed(
void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
){
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
db->xCollNeeded = xCollNeeded;
db->xCollNeeded16 = 0;
db->pCollNeededArg = pCollNeededArg;
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#ifndef STQLITE_OMIT_UTF16
+#ifndef SQLITE_OMIT_UTF16
/*
** Register a collation sequence factory callback with the database handle
** db. Replace any previously installed collation sequence factory.
@@ -67649,22 +67649,22 @@ int sqlite3_collation_needed16(
void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
){
if( sqlite3SafetyCheck(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
db->xCollNeeded = 0;
db->xCollNeeded16 = xCollNeeded16;
db->pCollNeededArg = pCollNeededArg;
- return STQLITE_OK;
+ return SQLITE_OK;
}
-#endif /* STQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_UTF16 */
-#ifndef STQLITE_OMIT_GLOBALRECOVER
+#ifndef SQLITE_OMIT_GLOBALRECOVER
/*
** This function is now an anachronism. It used to be used to recover from a
-** malloc() failure, but STQLite now does this automatically.
+** malloc() failure, but SQLite now does this automatically.
*/
int sqlite3_global_recover(){
- return STQLITE_OK;
+ return SQLITE_OK;
}
#endif
@@ -67680,19 +67680,19 @@ int sqlite3_get_autocommit(sqlite3 *db){
return db->autoCommit;
}
-#ifdef STQLITE_DEBUG
+#ifdef SQLITE_DEBUG
/*
-** The following routine is subtituted for constant STQLITE_CORRUPT in
+** The following routine is subtituted for constant SQLITE_CORRUPT in
** debugging builds. This provides a way to set a breakpoint for when
** corruption is first detected.
*/
-STQLITE_PRIVATE int sqlite3Corrupt(void){
- return STQLITE_CORRUPT;
+SQLITE_PRIVATE int sqlite3Corrupt(void){
+ return SQLITE_CORRUPT;
}
#endif
-#ifndef STQLITE_OMIT_SHARED_CACHE
+#ifndef SQLITE_OMIT_SHARED_CACHE
/*
** Enable or disable the shared pager and schema features for the
** current thread.
@@ -67710,13 +67710,13 @@ int sqlite3_enable_shared_cache(int enable){
*/
if( pTd->pBtree && !enable ){
assert( pTd->useSharedData );
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
pTd->useSharedData = enable;
sqlite3ReleaseThreadData();
}
- return sqlite3ApiExit(0, STQLITE_OK);
+ return sqlite3ApiExit(0, SQLITE_OK);
}
#endif
@@ -67736,7 +67736,7 @@ void sqlite3_thread_cleanup(void){
** Return meta information about a specific column of a database table.
** See comment in sqlite3.h (sqlite.h.in) for details.
*/
-#ifdef STQLITE_ENABLE_COLUMN_METADATA
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
int sqlite3_table_column_metadata(
sqlite3 *db, /* Connection handle */
const char *zDbName, /* Database name or NULL */
@@ -67762,10 +67762,10 @@ int sqlite3_table_column_metadata(
/* Ensure the database schema has been loaded */
if( sqlite3SafetyOn(db) ){
- return STQLITE_MISUSE;
+ return SQLITE_MISUSE;
}
rc = sqlite3Init(db, &zErrMsg);
- if( STQLITE_OK!=rc ){
+ if( SQLITE_OK!=rc ){
goto error_out;
}
@@ -67821,7 +67821,7 @@ int sqlite3_table_column_metadata(
error_out:
if( sqlite3SafetyOff(db) ){
- rc = STQLITE_MISUSE;
+ rc = SQLITE_MISUSE;
}
/* Whether the function call succeeded or failed, set the output parameters
@@ -67834,10 +67834,10 @@ error_out:
if( pPrimaryKey ) *pPrimaryKey = primarykey;
if( pAutoinc ) *pAutoinc = autoinc;
- if( STQLITE_OK==rc && !pTab ){
+ if( SQLITE_OK==rc && !pTab ){
sqlite3SetString(&zErrMsg, "no such table column: ", zTableName, ".",
zColumnName, 0);
- rc = STQLITE_ERROR;
+ rc = SQLITE_ERROR;
}
sqlite3Error(db, rc, (zErrMsg?"%s":0), zErrMsg);
sqliteFree(zErrMsg);
@@ -67850,8 +67850,8 @@ error_out:
*/
int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
int i;
- int rc = STQLITE_OK;
- for(i=1; rc==STQLITE_OK && i<=sqlite3_bind_parameter_count(pStmt); i++){
+ int rc = SQLITE_OK;
+ for(i=1; rc==SQLITE_OK && i<=sqlite3_bind_parameter_count(pStmt); i++){
rc = sqlite3_bind_null(pStmt, i);
}
return rc;
@@ -67860,7 +67860,7 @@ int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
/*
** Sleep for a little while. Return the amount of time slept.
*/
-STQLITE_API int sqlite3_sleep(int ms){
+SQLITE_API int sqlite3_sleep(int ms){
return sqlite3OsSleep(ms);
}
@@ -67869,7 +67869,7 @@ STQLITE_API int sqlite3_sleep(int ms){
*/
int sqlite3_extended_result_codes(sqlite3 *db, int onoff){
db->errMask = onoff ? 0xffffffff : 0xff;
- return STQLITE_OK;
+ return SQLITE_OK;
}
/************** End of main.c ************************************************/
diff --git a/amarok/src/sqlite/sqlite3.h b/amarok/src/sqlite/sqlite3.h
index 2c65b1d1..474b8936 100644
--- a/amarok/src/sqlite/sqlite3.h
+++ b/amarok/src/sqlite/sqlite3.h
@@ -9,21 +9,21 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
-** This header file defines the interface that the STQLite library
+** This header file defines the interface that the SQLite library
** presents to client programs. If a C-function, structure, datatype,
** or constant definition does not appear in this file, then it is
-** not a published API of STQLite, is subject to change without
-** notice, and should not be referenced by programs that use STQLite.
+** not a published API of SQLite, is subject to change without
+** notice, and should not be referenced by programs that use SQLite.
**
** Some of the definitions that are in this file are marked as
** "experimental". Experimental interfaces are normally new
-** features recently added to STQLite. 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.
**
-** The official C-language API documentation for STQLite is derived
+** The official C-language API documentation for SQLite is derived
** from comments in this file. This file is the authoritative source
-** on how STQLite interfaces are suppose to operate.
+** on how SQLite interfaces are suppose to operate.
**
** The name of this file under configuration management is "sqlite.h.in".
** The makefile makes some minor changes to this file (such as inserting
@@ -32,8 +32,8 @@
**
** @(#) $Id: sqlite.h.in,v 1.218 2007/07/19 12:41:40 drh Exp $
*/
-#ifndef _STQLITE3_H_
-#define _STQLITE3_H_
+#ifndef _SQLITE3_H_
+#define _SQLITE3_H_
#include <stdarg.h> /* Needed for the definition of va_list */
/*
@@ -47,18 +47,18 @@ extern "C" {
** Make sure these symbols where not defined by some previous header
** file.
*/
-#ifdef STQLITE_VERSION
-# undef STQLITE_VERSION
+#ifdef SQLITE_VERSION
+# undef SQLITE_VERSION
#endif
-#ifdef STQLITE_VERSION_NUMBER
-# undef STQLITE_VERSION_NUMBER
+#ifdef SQLITE_VERSION_NUMBER
+# undef SQLITE_VERSION_NUMBER
#endif
/*
** CAPI3REF: Compile-Time Library Version Numbers
**
-** The version of the STQLite library is contained in the sqlite3.h
-** header file in a #define named STQLITE_VERSION. The STQLITE_VERSION
+** The version of the SQLite library is contained in the sqlite3.h
+** header file in a #define named SQLITE_VERSION. The SQLITE_VERSION
** macro resolves to a string constant.
**
** The format of the version string is "X.Y.Z", where
@@ -66,36 +66,36 @@ extern "C" {
** is the release number. The X.Y.Z might be followed by "alpha" or "beta".
** For example "3.1.1beta".
**
-** The X value is always 3 in STQLite. The X value only changes when
+** The X value is always 3 in SQLite. The X value only changes when
** backwards compatibility is broken and we intend to never break
** backwards compatibility. The Y value only changes when
** there are major feature enhancements that are forwards compatible
** but not backwards compatible. The Z value is incremented with
** each release but resets back to 0 when Y is incremented.
**
-** The STQLITE_VERSION_NUMBER is an integer with the value
+** The SQLITE_VERSION_NUMBER is an integer with the value
** (X*1000000 + Y*1000 + Z). For example, for version "3.1.1beta",
-** STQLITE_VERSION_NUMBER is set to 3001001. To detect if they are using
+** SQLITE_VERSION_NUMBER is set to 3001001. To detect if they are using
** version 3.1.1 or greater at compile time, programs may use the test
-** (STQLITE_VERSION_NUMBER>=3001001).
+** (SQLITE_VERSION_NUMBER>=3001001).
**
** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
*/
-#define STQLITE_VERSION "3.4.1"
-#define STQLITE_VERSION_NUMBER 3004001
+#define SQLITE_VERSION "3.4.1"
+#define SQLITE_VERSION_NUMBER 3004001
/*
** CAPI3REF: Run-Time Library Version Numbers
**
** These routines return values equivalent to the header constants
-** [STQLITE_VERSION] and [STQLITE_VERSION_NUMBER]. The values returned
+** [SQLITE_VERSION] and [SQLITE_VERSION_NUMBER]. The values returned
** by this routines should only be different from the header values
** if you compile your program using an sqlite3.h header from a
-** different version of STQLite that the version of the library you
+** different version of SQLite that the version of the library you
** link against.
**
** The sqlite3_version[] string constant contains the text of the
-** [STQLITE_VERSION] string. The sqlite3_libversion() function returns
+** [SQLITE_VERSION] string. The sqlite3_libversion() function returns
** a poiner to the sqlite3_version[] string constant. The function
** is provided for DLL users who can only access functions and not
** constants within the DLL.
@@ -107,7 +107,7 @@ int sqlite3_libversion_number(void);
/*
** CAPI3REF: Database Connection Handle
**
-** Each open STQLite database is represented by pointer to an instance of the
+** Each open SQLite database is represented by pointer to an instance of the
** opaque structure named "sqlite3". It is useful to think of an sqlite3
** pointer as an object. The [sqlite3_open] interface is its constructor
** and [sqlite3_close] is its destructor. There are many other interfaces
@@ -124,12 +124,12 @@ typedef struct sqlite3 sqlite3;
** Some compilers do not support the "long long" datatype. So we have
** to do compiler-specific typedefs for 64-bit signed and unsigned integers.
**
-** Many STQLite interface functions require a 64-bit integer arguments.
+** Many SQLite interface functions require a 64-bit integer arguments.
** Those interfaces are declared using this typedef.
*/
-#ifdef STQLITE_INT64_TYPE
- typedef STQLITE_INT64_TYPE sqlite_int64;
- typedef unsigned STQLITE_INT64_TYPE sqlite_uint64;
+#ifdef SQLITE_INT64_TYPE
+ typedef SQLITE_INT64_TYPE sqlite_int64;
+ typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
#elif defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 sqlite_int64;
typedef unsigned __int64 sqlite_uint64;
@@ -142,7 +142,7 @@ typedef struct sqlite3 sqlite3;
** If compiling for a processor that lacks floating point support,
** substitute integer for floating-point
*/
-#ifdef STQLITE_OMIT_FLOATING_POINT
+#ifdef SQLITE_OMIT_FLOATING_POINT
# define double sqlite_int64
#endif
@@ -155,7 +155,7 @@ typedef struct sqlite3 sqlite3;
**
** All SQL statements prepared using [sqlite3_prepare_v2()] or
** [sqlite3_prepare16_v2()] must be destroyed using [sqlite3_finalize()]
-** before this routine is called. Otherwise, STQLITE_BUSY is returned and the
+** before this routine is called. Otherwise, SQLITE_BUSY is returned and the
** database connection remains open.
*/
int sqlite3_close(sqlite3 *);
@@ -181,7 +181,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
** invoked once for each row of the query result. This callback
** should normally return 0. If the callback returns a non-zero
** value then the query is aborted, all subsequent SQL statements
-** are skipped and the sqlite3_exec() function returns the STQLITE_ABORT.
+** are skipped and the sqlite3_exec() function returns the SQLITE_ABORT.
**
** The 4th parameter to this interface is an arbitrary pointer that is
** passed through to the callback function as its first parameter.
@@ -206,8 +206,8 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
** message. Use [sqlite3_free()] for this. If errmsg==NULL,
** then no error message is ever written.
**
-** The return value is is STQLITE_OK if there are no errors and
-** some other [STQLITE_OK | return code] if there is an error.
+** The return value is is SQLITE_OK if there are no errors and
+** some other [SQLITE_OK | return code] if there is an error.
** The particular return value depends on the type of error.
**
*/
@@ -221,59 +221,59 @@ int sqlite3_exec(
/*
** CAPI3REF: Result Codes
-** KEYWORDS: STQLITE_OK
+** KEYWORDS: SQLITE_OK
**
-** Many STQLite functions return an integer result code from the set shown
+** Many SQLite functions return an integer result code from the set shown
** above in order to indicates success or failure.
**
-** The result codes above are the only ones returned by STQLite in its
+** The result codes above are the only ones returned by SQLite in its
** default configuration. However, the [sqlite3_extended_result_codes()]
** API can be used to set a database connectoin to return more detailed
** result codes.
**
-** See also: [STQLITE_IOERR_READ | extended result codes]
+** See also: [SQLITE_IOERR_READ | extended result codes]
**
*/
-#define STQLITE_OK 0 /* Successful result */
+#define SQLITE_OK 0 /* Successful result */
/* beginning-of-error-codes */
-#define STQLITE_ERROR 1 /* SQL error or missing database */
-#define STQLITE_INTERNAL 2 /* NOT USED. Internal logic error in STQLite */
-#define STQLITE_PERM 3 /* Access permission denied */
-#define STQLITE_ABORT 4 /* Callback routine requested an abort */
-#define STQLITE_BUSY 5 /* The database file is locked */
-#define STQLITE_LOCKED 6 /* A table in the database is locked */
-#define STQLITE_NOMEM 7 /* A malloc() failed */
-#define STQLITE_READONLY 8 /* Attempt to write a readonly database */
-#define STQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
-#define STQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
-#define STQLITE_CORRUPT 11 /* The database disk image is malformed */
-#define STQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */
-#define STQLITE_FULL 13 /* Insertion failed because database is full */
-#define STQLITE_CANTOPEN 14 /* Unable to open the database file */
-#define STQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */
-#define STQLITE_EMPTY 16 /* Database is empty */
-#define STQLITE_SCHEMA 17 /* The database schema changed */
-#define STQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
-#define STQLITE_CONSTRAINT 19 /* Abort due to contraint violation */
-#define STQLITE_MISMATCH 20 /* Data type mismatch */
-#define STQLITE_MISUSE 21 /* Library used incorrectly */
-#define STQLITE_NOLFS 22 /* Uses OS features not supported on host */
-#define STQLITE_AUTH 23 /* Authorization denied */
-#define STQLITE_FORMAT 24 /* Auxiliary database format error */
-#define STQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
-#define STQLITE_NOTADB 26 /* File opened that is not a database file */
-#define STQLITE_ROW 100 /* sqlite3_step() has another row ready */
-#define STQLITE_DONE 101 /* sqlite3_step() has finished executing */
+#define SQLITE_ERROR 1 /* SQL error or missing database */
+#define SQLITE_INTERNAL 2 /* NOT USED. Internal logic error in SQLite */
+#define SQLITE_PERM 3 /* Access permission denied */
+#define SQLITE_ABORT 4 /* Callback routine requested an abort */
+#define SQLITE_BUSY 5 /* The database file is locked */
+#define SQLITE_LOCKED 6 /* A table in the database is locked */
+#define SQLITE_NOMEM 7 /* A malloc() failed */
+#define SQLITE_READONLY 8 /* Attempt to write a readonly database */
+#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
+#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
+#define SQLITE_CORRUPT 11 /* The database disk image is malformed */
+#define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */
+#define SQLITE_FULL 13 /* Insertion failed because database is full */
+#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
+#define SQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */
+#define SQLITE_EMPTY 16 /* Database is empty */
+#define SQLITE_SCHEMA 17 /* The database schema changed */
+#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
+#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */
+#define SQLITE_MISMATCH 20 /* Data type mismatch */
+#define SQLITE_MISUSE 21 /* Library used incorrectly */
+#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */
+#define SQLITE_AUTH 23 /* Authorization denied */
+#define SQLITE_FORMAT 24 /* Auxiliary database format error */
+#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
+#define SQLITE_NOTADB 26 /* File opened that is not a database file */
+#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
+#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
/* end-of-error-codes */
/*
** CAPI3REF: Extended Result Codes
**
-** In its default configuration, STQLite API routines return one of 26 integer
+** In its default configuration, SQLite API routines return one of 26 integer
** result codes described at result-codes. However, experience has shown that
** many of these result codes are too course-grained. They do not provide as
** much information about problems as users might like. In an effort to
-** address this, newer versions of STQLite (version 3.3.8 and later) include
+** address this, newer versions of SQLite (version 3.3.8 and later) include
** support for additional result codes that provide more detailed information
** about errors. The extended result codes are enabled (or disabled) for
** each database
@@ -282,7 +282,7 @@ int sqlite3_exec(
** Some of the available extended result codes are listed above.
** We expect the number of extended result codes will be expand
** over time. Software that uses extended result codes should expect
-** to see new result codes in future releases of STQLite.
+** to see new result codes in future releases of SQLite.
**
** The symbolic name for an extended result code always contains a related
** primary result code as a prefix. Primary result codes contain a single
@@ -290,42 +290,42 @@ int sqlite3_exec(
** The numeric value of an extended result code can be converted to its
** corresponding primary result code by masking off the lower 8 bytes.
**
-** The STQLITE_OK result code will never be extended. It will always
+** The SQLITE_OK result code will never be extended. It will always
** be exactly zero.
*/
-#define STQLITE_IOERR_READ (STQLITE_IOERR | (1<<8))
-#define STQLITE_IOERR_SHORT_READ (STQLITE_IOERR | (2<<8))
-#define STQLITE_IOERR_WRITE (STQLITE_IOERR | (3<<8))
-#define STQLITE_IOERR_FSYNC (STQLITE_IOERR | (4<<8))
-#define STQLITE_IOERR_DIR_FSYNC (STQLITE_IOERR | (5<<8))
-#define STQLITE_IOERR_TRUNCATE (STQLITE_IOERR | (6<<8))
-#define STQLITE_IOERR_FSTAT (STQLITE_IOERR | (7<<8))
-#define STQLITE_IOERR_UNLOCK (STQLITE_IOERR | (8<<8))
-#define STQLITE_IOERR_RDLOCK (STQLITE_IOERR | (9<<8))
-#define STQLITE_IOERR_DELETE (STQLITE_IOERR | (10<<8))
-#define STQLITE_IOERR_BLOCKED (STQLITE_IOERR | (11<<8))
+#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8))
+#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8))
+#define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8))
+#define SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4<<8))
+#define SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5<<8))
+#define SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6<<8))
+#define SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7<<8))
+#define SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8<<8))
+#define SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9<<8))
+#define SQLITE_IOERR_DELETE (SQLITE_IOERR | (10<<8))
+#define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8))
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
**
** This routine enables or disables the
-** [STQLITE_IOERR_READ | extended result codes] feature.
-** By default, STQLite API routines return one of only 26 integer
-** [STQLITE_OK | result codes]. When extended result codes
+** [SQLITE_IOERR_READ | extended result codes] feature.
+** By default, SQLite API routines return one of only 26 integer
+** [SQLITE_OK | result codes]. When extended result codes
** are enabled by this routine, the repetoire of result codes can be
** much larger and can (hopefully) provide more detailed information
** about the cause of an error.
**
** The second argument is a boolean value that turns extended result
** codes on and off. Extended result codes are off by default for
-** backwards compatibility with older versions of STQLite.
+** backwards compatibility with older versions of SQLite.
*/
int sqlite3_extended_result_codes(sqlite3*, int onoff);
/*
** CAPI3REF: Last Insert Rowid
**
-** Each entry in an STQLite table has a unique 64-bit signed integer key
+** Each entry in an SQLite table has a unique 64-bit signed integer key
** called the "rowid". The rowid is always available as an undeclared
** column named ROWID, OID, or _ROWID_. If the table has a column of
** type INTEGER PRIMARY KEY then that column is another an alias for the
@@ -367,7 +367,7 @@ sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
** then the changes in the inner, recursive call are counted together
** with the changes in the outer call.
**
-** STQLite implements the command "DELETE FROM table" without a WHERE clause
+** SQLite implements the command "DELETE FROM table" without a WHERE clause
** by dropping and recreating the table. (This is much faster than going
** through and deleting individual elements from the table.) Because of
** this optimization, the change count for "DELETE FROM table" will be
@@ -389,7 +389,7 @@ int sqlite3_changes(sqlite3*);
**
** See also the [sqlite3_change()] interface.
**
-** STQLite implements the command "DELETE FROM table" without a WHERE clause
+** SQLite implements the command "DELETE FROM table" without a WHERE clause
** by dropping and recreating the table. (This is much faster than going
** through and deleting individual elements form the table.) Because of
** this optimization, the change count for "DELETE FROM table" will be
@@ -411,7 +411,7 @@ int sqlite3_total_changes(sqlite3*);
** It is safe to call this routine from a thread different from the
** thread that is currently running the database operation.
**
-** The SQL operation that is interrupted will return [STQLITE_INTERRUPT].
+** The SQL operation that is interrupted will return [SQLITE_INTERRUPT].
** If an interrupted operation was an update that is inside an
** explicit transaction, then the entire transaction will be rolled
** back automatically.
@@ -430,7 +430,7 @@ void sqlite3_interrupt(sqlite3*);
** These routines are useful for command-line input to determine if the
** currently entered text forms one or more complete SQL statements or
** if additional input is needed before sending the statements into
-** STQLite for parsing. The algorithm is simple. If the
+** SQLite for parsing. The algorithm is simple. If the
** last token other than spaces and comments is a semicolon, then return
** true. Actually, the algorithm is a little more complicated than that
** in order to deal with triggers, but the basic idea is the same: the
@@ -440,13 +440,13 @@ int sqlite3_complete(const char *sql);
int sqlite3_complete16(const void *sql);
/*
-** CAPI3REF: Register A Callback To Handle STQLITE_BUSY Errors
+** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
**
** This routine identifies a callback function that might be invoked
** whenever an attempt is made to open a database table
** that another thread or process has locked.
-** If the busy callback is NULL, then [STQLITE_BUSY]
-** (or sometimes [STQLITE_IOERR_BLOCKED])
+** If the busy callback is NULL, then [SQLITE_BUSY]
+** (or sometimes [SQLITE_IOERR_BLOCKED])
** is returned immediately upon encountering the lock.
** If the busy callback is not NULL, then the
** callback will be invoked with two arguments. The
@@ -455,14 +455,14 @@ int sqlite3_complete16(const void *sql);
** the handler is the number of times that the busy handler has
** been invoked for this locking event. If the
** busy callback returns 0, then no additional attempts are made to
-** access the database and [STQLITE_BUSY] or [STQLITE_IOERR_BLOCKED] is returned.
+** access the database and [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] is returned.
** If the callback returns non-zero, then another attempt is made to open the
** database for reading and the cycle repeats.
**
** The presence of a busy handler does not guarantee that
** it will be invoked when there is lock contention.
-** If STQLite determines that invoking the busy handler could result in
-** a deadlock, it will return [STQLITE_BUSY] instead.
+** If SQLite determines that invoking the busy handler could result in
+** a deadlock, it will return [SQLITE_BUSY] instead.
** Consider a scenario where one process is holding a read lock that
** it is trying to promote to a reserved lock and
** a second process is holding a reserved lock that it is trying
@@ -470,22 +470,22 @@ int sqlite3_complete16(const void *sql);
** because it is blocked by the second and the second process cannot
** proceed because it is blocked by the first. If both processes
** invoke the busy handlers, neither will make any progress. Therefore,
-** STQLite returns [STQLITE_BUSY] for the first process, hoping that this
+** SQLite returns [SQLITE_BUSY] for the first process, hoping that this
** will induce the first process to release its read lock and allow
** the second process to proceed.
**
** The default busy callback is NULL.
**
-** The [STQLITE_BUSY] error is converted to [STQLITE_IOERR_BLOCKED] when
-** STQLite is in the middle of a large transaction where all the
-** changes will not fit into the in-memory cache. STQLite will
+** The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] when
+** SQLite is in the middle of a large transaction where all the
+** changes will not fit into the in-memory cache. SQLite will
** already hold a RESERVED lock on the database file, but it needs
** to promote this lock to EXCLUSIVE so that it can spill cache
** pages into the database file without harm to concurrent
** readers. If it is unable to promote the lock, then the in-memory
** cache will be left in an inconsistent state and so the error
-** code is promoted from the relatively benign [STQLITE_BUSY] to
-** the more severe [STQLITE_IOERR_BLOCKED]. This error code promotion
+** code is promoted from the relatively benign [SQLITE_BUSY] to
+** the more severe [SQLITE_IOERR_BLOCKED]. This error code promotion
** forces an automatic rollback of the changes. See the
** <a href="http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError">
** CorruptionFollowingBusyError</a> wiki page for a discussion of why
@@ -512,7 +512,7 @@ int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
** table is locked. The handler will sleep multiple times until
** at least "ms" milliseconds of sleeping have been done. After
** "ms" milliseconds of sleeping, the handler returns 0 which
-** causes [sqlite3_step()] to return [STQLITE_BUSY] or [STQLITE_IOERR_BLOCKED].
+** causes [sqlite3_step()] to return [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED].
**
** Calling this routine with an argument less than or equal to zero
** turns off all busy handlers.
@@ -677,7 +677,7 @@ char *sqlite3_snprintf(int,char*,const char*, ...);
/*
** CAPI3REF: Memory Allocation Functions
**
-** STQLite uses its own memory allocator. On some installations, this
+** SQLite uses its own memory allocator. On some installations, this
** memory allocator is identical to the standard malloc()/realloc()/free()
** and can be used interchangable. On others, the implementations are
** different. For maximum portability, it is best not to mix calls
@@ -690,33 +690,33 @@ void sqlite3_free(void*);
/*
** CAPI3REF: Compile-Time Authorization Callbacks
***
-** This routine registers a authorizer callback with the STQLite library.
+** This routine registers a authorizer callback with the SQLite library.
** The authorizer callback is invoked as SQL statements are being compiled
** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],
** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. At various
** points during the compilation process, as logic is being created
** to perform various actions, the authorizer callback is invoked to
** see if those actions are allowed. The authorizer callback should
-** return STQLITE_OK to allow the action, [STQLITE_IGNORE] to disallow the
+** return SQLITE_OK to allow the action, [SQLITE_IGNORE] to disallow the
** specific action but allow the SQL statement to continue to be
-** compiled, or [STQLITE_DENY] to cause the entire SQL statement to be
+** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
** rejected with an error.
**
-** Depending on the action, the [STQLITE_IGNORE] and [STQLITE_DENY] return
+** Depending on the action, the [SQLITE_IGNORE] and [SQLITE_DENY] return
** codes might mean something different or they might mean the same
** thing. If the action is, for example, to perform a delete opertion,
-** then [STQLITE_IGNORE] and [STQLITE_DENY] both cause the statement compilation
+** then [SQLITE_IGNORE] and [SQLITE_DENY] both cause the statement compilation
** to fail with an error. But if the action is to read a specific column
-** from a specific table, then [STQLITE_DENY] will cause the entire
-** statement to fail but [STQLITE_IGNORE] will cause a NULL value to be
+** from a specific table, then [SQLITE_DENY] will cause the entire
+** statement to fail but [SQLITE_IGNORE] will cause a NULL value to be
** read instead of the actual column value.
**
** The first parameter to the authorizer callback is a copy of
** the third parameter to the sqlite3_set_authorizer() interface.
** The second parameter to the callback is an integer
-** [STQLITE_COPY | action code] that specifies the particular action
+** [SQLITE_COPY | action code] that specifies the particular action
** to be authorized. The available action codes are
-** [STQLITE_COPY | documented separately]. The third through sixth
+** [SQLITE_COPY | documented separately]. The third through sixth
** parameters to the callback are strings that contain additional
** details about the action to be authorized.
**
@@ -750,13 +750,13 @@ int sqlite3_set_authorizer(
** CAPI3REF: Authorizer Return Codes
**
** The [sqlite3_set_authorizer | authorizer callback function] must
-** return either [STQLITE_OK] or one of these two constants in order
-** to signal STQLite whether or not the action is permitted. See the
+** return either [SQLITE_OK] or one of these two constants in order
+** to signal SQLite whether or not the action is permitted. See the
** [sqlite3_set_authorizer | authorizer documentation] for additional
** information.
*/
-#define STQLITE_DENY 1 /* Abort the SQL statement with an error */
-#define STQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */
+#define SQLITE_DENY 1 /* Abort the SQL statement with an error */
+#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */
/*
** CAPI3REF: Authorizer Action Codes
@@ -778,38 +778,38 @@ int sqlite3_set_authorizer(
** top-level SQL code.
*/
/******************************************* 3rd ************ 4th ***********/
-#define STQLITE_CREATE_INDEX 1 /* Index Name Table Name */
-#define STQLITE_CREATE_TABLE 2 /* Table Name NULL */
-#define STQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */
-#define STQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */
-#define STQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */
-#define STQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */
-#define STQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */
-#define STQLITE_CREATE_VIEW 8 /* View Name NULL */
-#define STQLITE_DELETE 9 /* Table Name NULL */
-#define STQLITE_DROP_INDEX 10 /* Index Name Table Name */
-#define STQLITE_DROP_TABLE 11 /* Table Name NULL */
-#define STQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */
-#define STQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */
-#define STQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */
-#define STQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */
-#define STQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */
-#define STQLITE_DROP_VIEW 17 /* View Name NULL */
-#define STQLITE_INSERT 18 /* Table Name NULL */
-#define STQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */
-#define STQLITE_READ 20 /* Table Name Column Name */
-#define STQLITE_SELECT 21 /* NULL NULL */
-#define STQLITE_TRANSACTION 22 /* NULL NULL */
-#define STQLITE_UPDATE 23 /* Table Name Column Name */
-#define STQLITE_ATTACH 24 /* Filename NULL */
-#define STQLITE_DETACH 25 /* Database Name NULL */
-#define STQLITE_ALTER_TABLE 26 /* Database Name Table Name */
-#define STQLITE_REINDEX 27 /* Index Name NULL */
-#define STQLITE_ANALYZE 28 /* Table Name NULL */
-#define STQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
-#define STQLITE_DROP_VTABLE 30 /* Table Name Module Name */
-#define STQLITE_FUNCTION 31 /* Function Name NULL */
-#define STQLITE_COPY 0 /* No longer used */
+#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */
+#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */
+#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */
+#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */
+#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */
+#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */
+#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */
+#define SQLITE_CREATE_VIEW 8 /* View Name NULL */
+#define SQLITE_DELETE 9 /* Table Name NULL */
+#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */
+#define SQLITE_DROP_TABLE 11 /* Table Name NULL */
+#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */
+#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */
+#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */
+#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */
+#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */
+#define SQLITE_DROP_VIEW 17 /* View Name NULL */
+#define SQLITE_INSERT 18 /* Table Name NULL */
+#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */
+#define SQLITE_READ 20 /* Table Name Column Name */
+#define SQLITE_SELECT 21 /* NULL NULL */
+#define SQLITE_TRANSACTION 22 /* NULL NULL */
+#define SQLITE_UPDATE 23 /* Table Name Column Name */
+#define SQLITE_ATTACH 24 /* Filename NULL */
+#define SQLITE_DETACH 25 /* Database Name NULL */
+#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */
+#define SQLITE_REINDEX 27 /* Index Name NULL */
+#define SQLITE_ANALYZE 28 /* Table Name NULL */
+#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
+#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
+#define SQLITE_FUNCTION 31 /* Function Name NULL */
+#define SQLITE_COPY 0 /* No longer used */
/*
** CAPI3REF: Tracing And Profiling Functions
@@ -856,7 +856,7 @@ void *sqlite3_profile(sqlite3*,
** If the progress callback returns a result other than 0, then the current
** query is immediately terminated and any database changes rolled back.
** The containing [sqlite3_exec()], [sqlite3_step()], or
-** [sqlite3_get_table()] call returns STQLITE_INTERRUPT. This feature
+** [sqlite3_get_table()] call returns SQLITE_INTERRUPT. This feature
** can be used, for example, to implement the "Cancel" button on a
** progress dialog box in a GUI.
*/
@@ -869,7 +869,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
** encoded for sqlite3_open() and UTF-16 encoded in the native byte order
** for sqlite3_open16(). An [sqlite3*] handle is returned in *ppDb, even
** if an error occurs. If the database is opened (or created) successfully,
-** then STQLITE_OK is returned. Otherwise an error code is returned. The
+** then SQLITE_OK is returned. Otherwise an error code is returned. The
** sqlite3_errmsg() or sqlite3_errmsg16() routines can be used to obtain
** an English language description of the error.
**
@@ -888,18 +888,18 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
*/
int sqlite3_open(
const char *filename, /* Database filename (UTF-8) */
- sqlite3 **ppDb /* OUT: STQLite db handle */
+ sqlite3 **ppDb /* OUT: SQLite db handle */
);
int sqlite3_open16(
const void *filename, /* Database filename (UTF-16) */
- sqlite3 **ppDb /* OUT: STQLite db handle */
+ sqlite3 **ppDb /* OUT: SQLite db handle */
);
/*
** CAPI3REF: Error Codes And Messages
**
** The sqlite3_errcode() interface returns the numeric
-** [STQLITE_OK | result code] or [STQLITE_IOERR_READ | extended result code]
+** [SQLITE_OK | result code] or [SQLITE_IOERR_READ | extended result code]
** for the most recent failed sqlite3_* API call associated
** with [sqlite3] handle 'db'. If a prior API call failed but the
** most recent API call succeeded, the return value from sqlite3_errcode()
@@ -908,7 +908,7 @@ int sqlite3_open16(
** The sqlite3_errmsg() and sqlite3_errmsg16() return English-langauge
** text that describes the error, as either UTF8 or UTF16 respectively.
** Memory to hold the error message string is managed internally. The
-** string may be overwritten or deallocated by subsequent calls to STQLite
+** string may be overwritten or deallocated by subsequent calls to SQLite
** interface functions.
**
** Calls to many sqlite3_* functions set the error code and string returned
@@ -958,7 +958,7 @@ typedef struct sqlite3_stmt sqlite3_stmt;
** To execute an SQL query, it must first be compiled into a byte-code
** program using one of these routines.
**
-** The first argument "db" is an [sqlite3 | STQLite database handle]
+** The first argument "db" is an [sqlite3 | SQLite database handle]
** obtained from a prior call to [sqlite3_open()] or [sqlite3_open16()].
** The second argument "zSql" is the statement to be compiled, encoded
** as either UTF-8 or UTF-16. The sqlite3_prepare() and sqlite3_prepare_v2()
@@ -984,8 +984,8 @@ typedef struct sqlite3_stmt sqlite3_stmt;
** procedure is responsible for deleting the compiled SQL statement
** using [sqlite3_finalize()] after it has finished with it.
**
-** On success, [STQLITE_OK] is returned. Otherwise an
-** [STQLITE_ERROR | error code] is returned.
+** On success, [SQLITE_OK] is returned. Otherwise an
+** [SQLITE_ERROR | error code] is returned.
**
** The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are
** recommended for all new programs. The two older interfaces are retained
@@ -997,23 +997,23 @@ typedef struct sqlite3_stmt sqlite3_stmt;
**
** <ol>
** <li>
-** If the database schema changes, instead of returning [STQLITE_SCHEMA] as it
+** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
** always used to do, [sqlite3_step()] will automatically recompile the SQL
** statement and try to run it again. If the schema has changed in a way
** that makes the statement no longer valid, [sqlite3_step()] will still
-** return [STQLITE_SCHEMA]. But unlike the legacy behavior, [STQLITE_SCHEMA] is
+** return [SQLITE_SCHEMA]. But unlike the legacy behavior, [SQLITE_SCHEMA] is
** now a fatal error. Calling [sqlite3_prepare_v2()] again will not make the
** error go away. Note: use [sqlite3_errmsg()] to find the text of the parsing
-** error that results in an [STQLITE_SCHEMA] return.
+** error that results in an [SQLITE_SCHEMA] return.
** </li>
**
** <li>
** When an error occurs,
** [sqlite3_step()] will return one of the detailed
-** [STQLITE_ERROR | result codes] or
-** [STQLITE_IOERR_READ | extended result codes] such as directly.
+** [SQLITE_ERROR | result codes] or
+** [SQLITE_IOERR_READ | extended result codes] such as directly.
** The legacy behavior was that [sqlite3_step()] would only return a generic
-** [STQLITE_ERROR] result code and you would have to make a second call to
+** [SQLITE_ERROR] result code and you would have to make a second call to
** [sqlite3_reset()] in order to find the underlying cause of the problem.
** With the "v2" prepare interfaces, the underlying reason for the error is
** returned immediately.
@@ -1052,7 +1052,7 @@ int sqlite3_prepare16_v2(
/*
** CAPI3REF: Dynamically Typed Value Object
**
-** STQLite uses dynamic typing for the values it stores. Values can
+** SQLite uses dynamic typing for the values it stores. Values can
** be integers, floating point values, strings, BLOBs, or NULL. When
** passing around values internally, each value is represented as
** an instance of the sqlite3_value object.
@@ -1100,7 +1100,7 @@ typedef struct sqlite3_context sqlite3_context;
** [sqlite3_bind_parameter_name()] API if desired. The index for "?NNN"
** parametes is the value of NNN.
** The NNN value must be between 1 and the compile-time
-** parameter STQLITE_MAX_VARIABLE_NUMBER (default value: 999).
+** parameter SQLITE_MAX_VARIABLE_NUMBER (default value: 999).
** See <a href="limits.html">limits.html</a> for additional information.
**
** The third argument is the value to bind to the parameter.
@@ -1115,10 +1115,10 @@ typedef struct sqlite3_context sqlite3_context;
**
** The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and
** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or
-** text after STQLite has finished with it. If the fifth argument is the
-** special value [STQLITE_STATIC], then the library assumes that the information
+** text after SQLite has finished with it. If the fifth argument is the
+** special value [SQLITE_STATIC], then the library assumes that the information
** is in static, unmanaged space and does not need to be freed. If the
-** fifth argument has the value [STQLITE_TRANSIENT], then STQLite makes its
+** fifth argument has the value [SQLITE_TRANSIENT], then SQLite makes its
** own private copy of the data immediately, before the sqlite3_bind_*()
** routine returns.
**
@@ -1135,10 +1135,10 @@ typedef struct sqlite3_context sqlite3_context;
** Bindings are not cleared by the [sqlite3_reset()] routine.
** Unbound parameters are interpreted as NULL.
**
-** These routines return [STQLITE_OK] on success or an error code if
-** anything goes wrong. [STQLITE_RANGE] is returned if the parameter
-** index is out of range. [STQLITE_NOMEM] is returned if malloc fails.
-** [STQLITE_MISUSE] is returned if these routines are called on a virtual
+** These routines return [SQLITE_OK] on success or an error code if
+** anything goes wrong. [SQLITE_RANGE] is returned if the parameter
+** index is out of range. [SQLITE_NOMEM] is returned if malloc fails.
+** [SQLITE_MISUSE] is returned if these routines are called on a virtual
** machine that is the wrong state or which has already been finalized.
*/
int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
@@ -1263,11 +1263,11 @@ const void *sqlite3_column_name16(sqlite3_stmt*, int N);
** name of the attached database, table and column that query result
** column was extracted from.
**
-** As with all other STQLite APIs, those postfixed with "16" return UTF-16
+** As with all other SQLite APIs, those postfixed with "16" return UTF-16
** encoded strings, the other functions return UTF-8.
**
** These APIs are only available if the library was compiled with the
-** STQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
+** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
*/
const char *sqlite3_column_database_name(sqlite3_stmt*,int);
const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
@@ -1298,9 +1298,9 @@ const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
** result column (i==1), and a NULL pointer for the first result column
** (i==0).
**
-** STQLite uses dynamic run-time typing. So just because a column
+** SQLite uses dynamic run-time typing. So just because a column
** is declared to contain a particular type does not mean that the
-** data stored in that column is of the declared type. STQLite is
+** data stored in that column is of the declared type. SQLite is
** strongly typed, but the typing is dynamic not static. Type
** is associated with individual values, not with the containers
** used to hold those values.
@@ -1324,58 +1324,58 @@ const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
** new "v2" interface is recommended for new applications but the legacy
** interface will continue to be supported.
**
-** In the lagacy interface, the return value will be either [STQLITE_BUSY],
-** [STQLITE_DONE], [STQLITE_ROW], [STQLITE_ERROR], or [STQLITE_MISUSE].
-** With the "v2" interface, any of the other [STQLITE_OK | result code]
-** or [STQLITE_IOERR_READ | extended result code] might be returned as
+** In the lagacy interface, the return value will be either [SQLITE_BUSY],
+** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE].
+** With the "v2" interface, any of the other [SQLITE_OK | result code]
+** or [SQLITE_IOERR_READ | extended result code] might be returned as
** well.
**
-** [STQLITE_BUSY] means that the database engine was unable to acquire the
+** [SQLITE_BUSY] means that the database engine was unable to acquire the
** database locks it needs to do its job. If the statement is a COMMIT
** or occurs outside of an explicit transaction, then you can retry the
** statement. If the statement is not a COMMIT and occurs within a
** explicit transaction then you should rollback the transaction before
** continuing.
**
-** [STQLITE_DONE] means that the statement has finished executing
+** [SQLITE_DONE] means that the statement has finished executing
** successfully. sqlite3_step() should not be called again on this virtual
** machine without first calling [sqlite3_reset()] to reset the virtual
** machine back to its initial state.
**
** If the SQL statement being executed returns any data, then
-** [STQLITE_ROW] is returned each time a new row of data is ready
+** [SQLITE_ROW] is returned each time a new row of data is ready
** for processing by the caller. The values may be accessed using
** the [sqlite3_column_int | column access functions].
** sqlite3_step() is called again to retrieve the next row of data.
**
-** [STQLITE_ERROR] means that a run-time error (such as a constraint
+** [SQLITE_ERROR] means that a run-time error (such as a constraint
** violation) has occurred. sqlite3_step() should not be called again on
** the VM. More information may be found by calling [sqlite3_errmsg()].
** With the legacy interface, a more specific error code (example:
-** [STQLITE_INTERRUPT], [STQLITE_SCHEMA], [STQLITE_CORRUPT], and so forth)
+** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth)
** can be obtained by calling [sqlite3_reset()] on the
** [sqlite_stmt | prepared statement]. In the "v2" interface,
** the more specific error code is returned directly by sqlite3_step().
**
-** [STQLITE_MISUSE] means that the this routine was called inappropriately.
+** [SQLITE_MISUSE] means that the this routine was called inappropriately.
** Perhaps it was called on a [sqlite_stmt | prepared statement] that has
** already been [sqlite3_finalize | finalized] or on one that had
-** previously returned [STQLITE_ERROR] or [STQLITE_DONE]. Or it could
+** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could
** be the case that the same database connection is being used by two or
** more threads at the same moment in time.
**
** <b>Goofy Interface Alert:</b>
** In the legacy interface,
** the sqlite3_step() API always returns a generic error code,
-** [STQLITE_ERROR], following any error other than [STQLITE_BUSY]
-** and [STQLITE_MISUSE]. You must call [sqlite3_reset()] or
+** [SQLITE_ERROR], following any error other than [SQLITE_BUSY]
+** and [SQLITE_MISUSE]. You must call [sqlite3_reset()] or
** [sqlite3_finalize()] in order to find one of the specific
-** [STQLITE_ERROR | result codes] that better describes the error.
+** [SQLITE_ERROR | result codes] that better describes the error.
** We admit that this is a goofy design. The problem has been fixed
** with the "v2" interface. If you prepare all of your SQL statements
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()], then the
-** more specific [STQLITE_ERROR | result codes] are returned directly
+** more specific [SQLITE_ERROR | result codes] are returned directly
** by sqlite3_step(). The use of the "v2" interface is recommended.
*/
int sqlite3_step(sqlite3_stmt*);
@@ -1385,10 +1385,10 @@ int sqlite3_step(sqlite3_stmt*);
**
** Return the number of values in the current row of the result set.
**
-** After a call to [sqlite3_step()] that returns [STQLITE_ROW], this routine
+** After a call to [sqlite3_step()] that returns [SQLITE_ROW], this routine
** will return the same value as the [sqlite3_column_count()] function.
-** After [sqlite3_step()] has returned an [STQLITE_DONE], [STQLITE_BUSY], or
-** a [STQLITE_ERROR | error code], or before [sqlite3_step()] has been
+** After [sqlite3_step()] has returned an [SQLITE_DONE], [SQLITE_BUSY], or
+** a [SQLITE_ERROR | error code], or before [sqlite3_step()] has been
** called on the [sqlite_stmt | prepared statement] for the first time,
** this routine returns zero.
*/
@@ -1397,7 +1397,7 @@ int sqlite3_data_count(sqlite3_stmt *pStmt);
/*
** CAPI3REF: Fundamental Datatypes
**
-** Every value in STQLite has one of five fundamental datatypes:
+** Every value in SQLite has one of five fundamental datatypes:
**
** <ul>
** <li> 64-bit signed integer
@@ -1409,21 +1409,21 @@ int sqlite3_data_count(sqlite3_stmt *pStmt);
**
** These constants are codes for each of those types.
**
-** Note that the STQLITE_TEXT constant was also used in STQLite version 2
+** Note that the SQLITE_TEXT constant was also used in SQLite version 2
** for a completely different meaning. Software that links against both
-** STQLite version 2 and STQLite version 3 should use STQLITE3_TEXT not
-** STQLITE_TEXT.
-*/
-#define STQLITE_INTEGER 1
-#define STQLITE_FLOAT 2
-#define STQLITE_BLOB 4
-#define STQLITE_NULL 5
-#ifdef STQLITE_TEXT
-# undef STQLITE_TEXT
+** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT not
+** SQLITE_TEXT.
+*/
+#define SQLITE_INTEGER 1
+#define SQLITE_FLOAT 2
+#define SQLITE_BLOB 4
+#define SQLITE_NULL 5
+#ifdef SQLITE_TEXT
+# undef SQLITE_TEXT
#else
-# define STQLITE_TEXT 3
+# define SQLITE_TEXT 3
#endif
-#define STQLITE3_TEXT 3
+#define SQLITE3_TEXT 3
/*
** CAPI3REF: Results Values From A Query
@@ -1441,13 +1441,13 @@ int sqlite3_data_count(sqlite3_stmt *pStmt);
** the column index is out of range, the result is undefined.
**
** The sqlite3_column_type() routine returns
-** [STQLITE_INTEGER | datatype code] for the initial data type
-** of the result column. The returned value is one of [STQLITE_INTEGER],
-** [STQLITE_FLOAT], [STQLITE_TEXT], [STQLITE_BLOB], or [STQLITE_NULL]. The value
+** [SQLITE_INTEGER | datatype code] for the initial data type
+** of the result column. The returned value is one of [SQLITE_INTEGER],
+** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. The value
** returned by sqlite3_column_type() is only meaningful if no type
** conversions have occurred as described below. After a type conversion,
** the value returned by sqlite3_column_type() is undefined. Future
-** versions of STQLite may change the behavior of sqlite3_column_type()
+** versions of SQLite may change the behavior of sqlite3_column_type()
** following a type conversion.
**
** If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes()
@@ -1496,7 +1496,7 @@ int sqlite3_data_count(sqlite3_stmt *pStmt);
** </blockquote>
**
** The table above makes reference to standard C library functions atoi()
-** and atof(). STQLite does not really use these functions. It has its
+** and atof(). SQLite does not really use these functions. It has its
** on equavalent internal routines. The atoi() and atof() names are
** used in the table for brevity and because they are familiar to most
** C programmers.
@@ -1559,9 +1559,9 @@ sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
**
** The sqlite3_finalize() function is called to delete a
** [sqlite3_stmt | compiled SQL statement]. If the statement was
-** executed successfully, or not executed at all, then STQLITE_OK is returned.
+** executed successfully, or not executed at all, then SQLITE_OK is returned.
** If execution of the statement failed then an
-** [STQLITE_ERROR | error code] or [STQLITE_IOERR_READ | extended error code]
+** [SQLITE_ERROR | error code] or [SQLITE_IOERR_READ | extended error code]
** is returned.
**
** This routine can be called at any point during the execution of the
@@ -1570,7 +1570,7 @@ sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
** encountering an error or an interrupt. (See [sqlite3_interrupt()].)
** Incomplete updates may be rolled back and transactions cancelled,
** depending on the circumstances, and the
-** [STQLITE_ERROR | result code] returned will be [STQLITE_ABORT].
+** [SQLITE_ERROR | result code] returned will be [SQLITE_ABORT].
*/
int sqlite3_finalize(sqlite3_stmt *pStmt);
@@ -1606,24 +1606,24 @@ int sqlite3_reset(sqlite3_stmt *pStmt);
** The length of the name is limited to 255 bytes, exclusive of the
** zero-terminator. Note that the name length limit is in bytes, not
** characters. Any attempt to create a function with a longer name
-** will result in an STQLITE_ERROR error.
+** will result in an SQLITE_ERROR error.
**
** The third parameter is the number of arguments that the SQL function or
** aggregate takes. If this parameter is negative, then the SQL function or
** aggregate may take any number of arguments.
**
** The fourth parameter, eTextRep, specifies what
-** [STQLITE_UTF8 | text encoding] this SQL function prefers for
+** [SQLITE_UTF8 | text encoding] this SQL function prefers for
** its parameters. Any SQL function implementation should be able to work
** work with UTF-8, UTF-16le, or UTF-16be. But some implementations may be
** more efficient with one encoding than another. It is allowed to
** invoke sqlite_create_function() or sqlite3_create_function16() multiple
** times with the same function but with different values of eTextRep.
-** When multiple implementations of the same function are available, STQLite
+** When multiple implementations of the same function are available, SQLite
** will pick the one that involves the least amount of data conversion.
** If there is only a single implementation which does not care what
** text encoding is used, then the fourth argument should be
-** [STQLITE_ANY].
+** [SQLITE_ANY].
**
** The fifth parameter is an arbitrary pointer. The implementation
** of the function can gain access to this pointer using
@@ -1640,7 +1640,7 @@ int sqlite3_reset(sqlite3_stmt *pStmt);
**
** It is permitted to register multiple implementations of the same
** functions with the same name but with either differing numbers of
-** arguments or differing perferred text encodings. STQLite will use
+** arguments or differing perferred text encodings. SQLite will use
** the implementation most closely matches the way in which the
** SQL function is used.
*/
@@ -1669,14 +1669,14 @@ int sqlite3_create_function16(
** CAPI3REF: Text Encodings
**
** These constant define integer codes that represent the various
-** text encodings supported by STQLite.
+** text encodings supported by SQLite.
*/
-#define STQLITE_UTF8 1
-#define STQLITE_UTF16LE 2
-#define STQLITE_UTF16BE 3
-#define STQLITE_UTF16 4 /* Use native byte order */
-#define STQLITE_ANY 5 /* sqlite3_create_function only */
-#define STQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */
+#define SQLITE_UTF8 1
+#define SQLITE_UTF16LE 2
+#define SQLITE_UTF16BE 3
+#define SQLITE_UTF16 4 /* Use native byte order */
+#define SQLITE_ANY 5 /* sqlite3_create_function only */
+#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */
/*
** CAPI3REF: Obsolete Functions
@@ -1724,7 +1724,7 @@ int sqlite3_global_recover(void);
** such a conversion is possible without loss of information (in order
** words if the value is original a string that looks like a number)
** then it is done. Otherwise no conversion occurs. The
-** [STQLITE_INTEGER | datatype] after conversion is returned.
+** [SQLITE_INTEGER | datatype] after conversion is returned.
**
** Please pay particular attention to the fact that the pointer that
** is returned from [sqlite3_value_blob()], [sqlite3_value_text()], or
@@ -1755,7 +1755,7 @@ int sqlite3_value_numeric_type(sqlite3_value*);
** same aggregate instance) the same buffer is returned. The implementation
** of the aggregate can use the returned buffer to accumulate data.
**
-** The buffer allocated is freed automatically by STQLite whan the aggregate
+** The buffer allocated is freed automatically by SQLite whan the aggregate
** query concludes.
**
** The first parameter should be a copy of the
@@ -1814,18 +1814,18 @@ void sqlite3_set_auxdata(sqlite3_context*, int, void*, void (*)(void*));
**
** These are special value for the destructor that is passed in as the
** final argument to routines like [sqlite3_result_blob()]. If the destructor
-** argument is STQLITE_STATIC, it means that the content pointer is constant
+** argument is SQLITE_STATIC, it means that the content pointer is constant
** and will never change. It does not need to be destroyed. The
-** STQLITE_TRANSIENT value means that the content will likely change in
-** the near future and that STQLite should make its own private copy of
+** SQLITE_TRANSIENT value means that the content will likely change in
+** the near future and that SQLite should make its own private copy of
** the content before returning.
**
** The typedef is necessary to work around problems in certain
** C++ compilers. See ticket #2191.
*/
typedef void (*sqlite3_destructor_type)(void*);
-#define STQLITE_STATIC ((sqlite3_destructor_type)0)
-#define STQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
+#define SQLITE_STATIC ((sqlite3_destructor_type)0)
+#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
/*
** CAPI3REF: Setting The Result Of An SQL Function
@@ -1877,14 +1877,14 @@ void sqlite3_result_zeroblob(sqlite3_context*, int n);
** and a UTF-16 string for sqlite3_create_collation16(). In all cases
** the name is passed as the second function argument.
**
-** The third argument must be one of the constants [STQLITE_UTF8],
-** [STQLITE_UTF16LE] or [STQLITE_UTF16BE], indicating that the user-supplied
+** The third argument must be one of the constants [SQLITE_UTF8],
+** [SQLITE_UTF16LE] or [SQLITE_UTF16BE], indicating that the user-supplied
** routine expects to be passed pointers to strings encoded using UTF-8,
** UTF-16 little-endian or UTF-16 big-endian respectively.
**
** A pointer to the user supplied routine must be passed as the fifth
** argument. If it is NULL, this is the same as deleting the collation
-** sequence (so that STQLite cannot call it anymore). Each time the user
+** sequence (so that SQLite cannot call it anymore). Each time the user
** supplied function is invoked, it is passed a copy of the void* passed as
** the fourth argument to sqlite3_create_collation() or
** sqlite3_create_collation16() as its first parameter.
@@ -1948,8 +1948,8 @@ int sqlite3_create_collation16(
** When the callback is invoked, the first argument passed is a copy
** of the second argument to sqlite3_collation_needed() or
** sqlite3_collation_needed16(). The second argument is the database
-** handle. The third argument is one of [STQLITE_UTF8], [STQLITE_UTF16BE], or
-** [STQLITE_UTF16LE], indicating the most desirable form of the collation
+** handle. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], or
+** [SQLITE_UTF16LE], indicating the most desirable form of the collation
** sequence function required. The fourth parameter is the name of the
** required collation sequence.
**
@@ -1973,7 +1973,7 @@ int sqlite3_collation_needed16(
** called right after sqlite3_open().
**
** The code to implement this API is not available in the public release
-** of STQLite.
+** of SQLite.
*/
int sqlite3_key(
sqlite3 *db, /* Database to be rekeyed */
@@ -1986,7 +1986,7 @@ int sqlite3_key(
** database is decrypted.
**
** The code to implement this API is not available in the public release
-** of STQLite.
+** of SQLite.
*/
int sqlite3_rekey(
sqlite3 *db, /* Database to be rekeyed */
@@ -2011,8 +2011,8 @@ int sqlite3_sleep(int);
**
** If this global variable is made to point to a string which is
** the name of a folder (a.ka. directory), then all temporary files
-** created by STQLite will be placed in that directory. If this variable
-** is NULL pointer, then STQLite does a search for an appropriate temporary
+** created by SQLite will be placed in that directory. If this variable
+** is NULL pointer, then SQLite does a search for an appropriate temporary
** file directory.
**
** Once [sqlite3_open()] has been called, changing this variable will
@@ -2080,7 +2080,7 @@ void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
** The second argument is a pointer to the function to invoke when a
** row is updated, inserted or deleted. The first argument to the callback is
** a copy of the third argument to sqlite3_update_hook(). The second callback
-** argument is one of STQLITE_INSERT, STQLITE_DELETE or STQLITE_UPDATE, depending
+** argument is one of SQLITE_INSERT, SQLITE_DELETE or SQLITE_UPDATE, depending
** on the operation that caused the callback to be invoked. The third and
** fourth arguments to the callback contain pointers to the database and
** table name containing the affected row. The final callback parameter is
@@ -2134,8 +2134,8 @@ void *sqlite3_update_hook(
** cache is enabled, the sqlite3_create_module() API used to register
** virtual tables will always return an error.
**
-** This routine returns [STQLITE_OK] if shared cache was
-** enabled or disabled successfully. An [STQLITE_ERROR | error code]
+** This routine returns [SQLITE_OK] if shared cache was
+** enabled or disabled successfully. An [SQLITE_ERROR | error code]
** is returned otherwise.
**
** Shared cache is disabled by default for backward compatibility.
@@ -2150,7 +2150,7 @@ int sqlite3_enable_shared_cache(int);
** used to cache database pages to improve performance).
**
** This function is not a part of standard builds. It is only created
-** if STQLite is compiled with the STQLITE_ENABLE_MEMORY_MANAGEMENT macro.
+** if SQLite is compiled with the SQLITE_ENABLE_MEMORY_MANAGEMENT macro.
*/
int sqlite3_release_memory(int);
@@ -2158,7 +2158,7 @@ int sqlite3_release_memory(int);
** CAPI3REF: Impose A Limit On Heap Size
**
** Place a "soft" limit on the amount of heap memory that may be allocated by
-** STQLite within the current thread. If an internal allocation is requested
+** SQLite within the current thread. If an internal allocation is requested
** that would exceed the specified limit, [sqlite3_release_memory()] is invoked
** one or more times to free up some space before the allocation is made.
**
@@ -2174,13 +2174,13 @@ int sqlite3_release_memory(int);
** [sqlite3_release_memory()] will only be called when memory is exhaused.
** The default value for the soft heap limit is zero.
**
-** STQLite makes a best effort to honor the soft heap limit. But if it
+** SQLite makes a best effort to honor the soft heap limit. But if it
** is unable to reduce memory usage below the soft limit, execution will
** continue without error or notification. This is why the limit is
** called a "soft" limit. It is advisory only.
**
** This function is only available if the library was compiled with the
-** STQLITE_ENABLE_MEMORY_MANAGEMENT option set.
+** SQLITE_ENABLE_MEMORY_MANAGEMENT option set.
** memory-management has been enabled.
*/
void sqlite3_soft_heap_limit(int);
@@ -2258,11 +2258,11 @@ void sqlite3_thread_cleanup(void);
**
** This function may load one or more schemas from database files. If an
** error occurs during this process, or if the requested table or column
-** cannot be found, an STQLITE error code is returned and an error message
+** cannot be found, an SQLITE error code is returned and an error message
** left in the database handle (to be retrieved using sqlite3_errmsg()).
**
** This API is only available if the library was compiled with the
-** STQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
+** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
*/
int sqlite3_table_column_metadata(
sqlite3 *db, /* Connection handle */
@@ -2279,11 +2279,11 @@ int sqlite3_table_column_metadata(
/*
** CAPI3REF: Load An Extension
**
-** Attempt to load an STQLite extension library contained in the file
+** Attempt to load an SQLite extension library contained in the file
** zFile. The entry point is zProc. zProc may be 0 in which case the
** name of the entry point defaults to "sqlite3_extension_init".
**
-** Return [STQLITE_OK] on success and [STQLITE_ERROR] if something goes wrong.
+** Return [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
**
** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
** error message text. The calling function should free this memory
@@ -2336,7 +2336,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
** Automatic extensions apply across all threads.
**
** This interface is experimental and is subject to change or
-** removal in future releases of STQLite.
+** removal in future releases of SQLite.
*/
int sqlite3_auto_extension(void *xEntryPoint);
@@ -2351,7 +2351,7 @@ int sqlite3_auto_extension(void *xEntryPoint);
** This call disabled automatic extensions in all threads.
**
** This interface is experimental and is subject to change or
-** removal in future releases of STQLite.
+** removal in future releases of SQLite.
*/
void sqlite3_reset_auto_extension(void);
@@ -2443,7 +2443,7 @@ struct sqlite3_module {
** the right-hand side of the corresponding aConstraint[] is evaluated
** and becomes the argvIndex-th entry in argv. If aConstraintUsage[].omit
** is true, then the constraint is assumed to be fully handled by the
-** virtual table and is not checked again by STQLite.
+** virtual table and is not checked again by SQLite.
**
** The idxNum and idxPtr values are recorded and passed into xFilter.
** sqlite3_free() is used to free idxPtr if needToFreeIdxPtr is true.
@@ -2483,21 +2483,21 @@ struct sqlite3_index_info {
int orderByConsumed; /* True if output is already ordered */
double estimatedCost; /* Estimated cost of using this index */
};
-#define STQLITE_INDEX_CONSTRAINT_EQ 2
-#define STQLITE_INDEX_CONSTRAINT_GT 4
-#define STQLITE_INDEX_CONSTRAINT_LE 8
-#define STQLITE_INDEX_CONSTRAINT_LT 16
-#define STQLITE_INDEX_CONSTRAINT_GE 32
-#define STQLITE_INDEX_CONSTRAINT_MATCH 64
+#define SQLITE_INDEX_CONSTRAINT_EQ 2
+#define SQLITE_INDEX_CONSTRAINT_GT 4
+#define SQLITE_INDEX_CONSTRAINT_LE 8
+#define SQLITE_INDEX_CONSTRAINT_LT 16
+#define SQLITE_INDEX_CONSTRAINT_GE 32
+#define SQLITE_INDEX_CONSTRAINT_MATCH 64
/*
-** This routine is used to register a new module name with an STQLite
+** This routine is used to register a new module name with an SQLite
** connection. Module names must be registered before creating new
** virtual tables on the module, or before using preexisting virtual
** tables of the module.
*/
int sqlite3_create_module(
- sqlite3 *db, /* STQLite connection to register module with */
+ sqlite3 *db, /* SQLite connection to register module with */
const char *zName, /* Name of the module */
const sqlite3_module *, /* Methods for the module */
void * /* Client data for xCreate/xConnect */
@@ -2509,7 +2509,7 @@ int sqlite3_create_module(
** even more experimental than the rest of the virtual tables API.
*/
int sqlite3_create_module_v2(
- sqlite3 *db, /* STQLite connection to register module with */
+ sqlite3 *db, /* SQLite connection to register module with */
const char *zName, /* Name of the module */
const sqlite3_module *, /* Methods for the module */
void *, /* Client data for xCreate/xConnect */
@@ -2619,7 +2619,7 @@ typedef struct sqlite3_blob sqlite3_blob;
** read and write access. If it is zero, the blob is opened for read
** access.
**
-** On success, [STQLITE_OK] is returned and the new
+** On success, [SQLITE_OK] is returned and the new
** [sqlite3_blob | blob handle] is written to *ppBlob.
** Otherwise an error code is returned and
** any value written to *ppBlob should not be used by the caller.
@@ -2659,9 +2659,9 @@ int sqlite3_blob_bytes(sqlite3_blob *);
** n bytes of data are copied into buffer
** z from the open blob, starting at offset iOffset.
**
-** On success, STQLITE_OK is returned. Otherwise, an
-** [STQLITE_ERROR | STQLite error code] or an
-** [STQLITE_IOERR_READ | extended error code] is returned.
+** On success, SQLITE_OK is returned. Otherwise, an
+** [SQLITE_ERROR | SQLite error code] or an
+** [SQLITE_IOERR_READ | extended error code] is returned.
*/
int sqlite3_blob_read(sqlite3_blob *, void *z, int n, int iOffset);
@@ -2675,16 +2675,16 @@ int sqlite3_blob_read(sqlite3_blob *, void *z, int n, int iOffset);
**
** If the [sqlite3_blob | blob-handle] passed as the first argument
** was not opened for writing (the flags parameter to [sqlite3_blob_open()]
-*** was zero), this function returns [STQLITE_READONLY].
+*** was zero), this function returns [SQLITE_READONLY].
**
** This function may only modify the contents of the blob, it is
** not possible to increase the size of a blob using this API. If
** offset iOffset is less than n bytes from the end of the blob,
-** [STQLITE_ERROR] is returned and no data is written.
+** [SQLITE_ERROR] is returned and no data is written.
**
-** On success, STQLITE_OK is returned. Otherwise, an
-** [STQLITE_ERROR | STQLite error code] or an
-** [STQLITE_IOERR_READ | extended error code] is returned.
+** On success, SQLITE_OK is returned. Otherwise, an
+** [SQLITE_ERROR | SQLite error code] or an
+** [SQLITE_IOERR_READ | extended error code] is returned.
*/
int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
@@ -2692,7 +2692,7 @@ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
** Undo the hack that converts floating point types to integer for
** builds on processors without floating point support.
*/
-#ifdef STQLITE_OMIT_FLOATING_POINT
+#ifdef SQLITE_OMIT_FLOATING_POINT
# undef double
#endif
diff --git a/amarok/src/statistics.cpp b/amarok/src/statistics.cpp
index 1e1774ca..ae48d512 100644
--- a/amarok/src/statistics.cpp
+++ b/amarok/src/statistics.cpp
@@ -965,7 +965,7 @@ StatisticsDetailedItem::getSQL()
if( itemType() == StatisticsDetailedItem::ALBUM || itemType() == StatisticsDetailedItem::HISTORY )
{
- qb.initSTQLDrag();
+ qb.initSQLDrag();
if ( artist != "0" )
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, artist );
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valAlbumID, album );
@@ -977,7 +977,7 @@ StatisticsDetailedItem::getSQL()
{
const uint artist_id = CollectionDB::instance()->artistID( url() );
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) );
qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
@@ -989,7 +989,7 @@ StatisticsDetailedItem::getSQL()
{
const uint genre_id = CollectionDB::instance()->genreID( url() );
- qb.initSTQLDrag();
+ qb.initSQLDrag();
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valGenreID, TQString::number( genre_id ) );
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName );