Index: src/alter.c ================================================================== --- src/alter.c +++ src/alter.c @@ -127,11 +127,11 @@ }while( token==TK_SPACE ); zParent = sqlite4DbStrNDup(db, (const char *)z, n); if( zParent==0 ) break; sqlite4Dequote(zParent); - if( 0==sqlite4StrICmp((const char *)zOld, zParent) ){ + if( 0==sqlite4_stricmp((const char *)zOld, zParent) ){ char *zOut = sqlite4MPrintf(db, "%s%.*s\"%w\"", (zOutput?zOutput:""), z-zInput, zInput, (const char *)zNew ); sqlite4DbFree(db, zOutput); zOutput = zOut; @@ -379,11 +379,11 @@ ** in pParse->zErr (system tables may not be altered) and returns non-zero. ** ** Or, if zName is not a system table, zero is returned. */ static int isSystemTable(Parse *pParse, const char *zName){ - if( sqlite4Strlen30(zName)>6 && 0==sqlite4StrNICmp(zName, "sqlite_", 7) ){ + if( sqlite4Strlen30(zName)>6 && 0==sqlite4_strnicmp(zName, "sqlite_", 7) ){ sqlite4ErrorMsg(pParse, "table %s may not be altered", zName); return 1; } return 0; } Index: src/attach.c ================================================================== --- src/attach.c +++ src/attach.c @@ -100,11 +100,11 @@ goto attach_error; } for(i=0; inDb; i++){ char *z = db->aDb[i].zName; assert( z && zName ); - if( sqlite4StrICmp(z, zName)==0 ){ + if( sqlite4_stricmp(z, zName)==0 ){ zErrDyn = sqlite4MPrintf(db, "database %s is already in use", zName); goto attach_error; } } @@ -218,11 +218,11 @@ if( zName==0 ) zName = ""; for(i=0; inDb; i++){ pDb = &db->aDb[i]; if( pDb->pKV==0 ) continue; - if( sqlite4StrICmp(pDb->zName, zName)==0 ) break; + if( sqlite4_stricmp(pDb->zName, zName)==0 ) break; } if( i>=db->nDb ){ sqlite4_snprintf(zErr,sizeof(zErr), "no such database: %s", zName); goto detach_error; @@ -420,11 +420,11 @@ if( NEVER(pList==0) ) return 0; zDb = pFix->zDb; for(i=0, pItem=pList->a; inSrc; i++, pItem++){ if( pItem->zDatabase==0 ){ pItem->zDatabase = sqlite4DbStrDup(pFix->pParse->db, zDb); - }else if( sqlite4StrICmp(pItem->zDatabase,zDb)!=0 ){ + }else if( sqlite4_stricmp(pItem->zDatabase,zDb)!=0 ){ sqlite4ErrorMsg(pFix->pParse, "%s %T cannot reference objects in database %s", pFix->zType, pFix->pName, pItem->zDatabase); return 1; } Index: src/build.c ================================================================== --- src/build.c +++ src/build.c @@ -215,11 +215,11 @@ assert( zName!=0 ); nName = sqlite4Strlen30(zName); /* All mutexes are required for schema access. Make sure we hold them. */ for(i=OMIT_TEMPDB; inDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ - if( zDatabase!=0 && sqlite4StrICmp(zDatabase, db->aDb[j].zName) ) continue; + if( zDatabase!=0 && sqlite4_stricmp(zDatabase, db->aDb[j].zName) ) continue; p = sqlite4HashFind(&db->aDb[j].pSchema->tblHash, zName, nName); if( p ) break; } return p; } @@ -280,11 +280,11 @@ /* All mutexes are required for schema access. Make sure we hold them. */ for(i=OMIT_TEMPDB; inDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ Schema *pSchema = db->aDb[j].pSchema; assert( pSchema ); - if( zDb && sqlite4StrICmp(zDb, db->aDb[j].zName) ) continue; + if( zDb && sqlite4_stricmp(zDb, db->aDb[j].zName) ) continue; p = sqlite4HashFind(&pSchema->idxHash, zName, nName); if( p ) break; } return p; } @@ -548,11 +548,11 @@ if( zName ){ Db *pDb; int n = sqlite4Strlen30(zName); for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){ if( (!OMIT_TEMPDB || i!=1 ) && n==sqlite4Strlen30(pDb->zName) && - 0==sqlite4StrICmp(pDb->zName, zName) ){ + 0==sqlite4_stricmp(pDb->zName, zName) ){ break; } } } return i; @@ -627,11 +627,11 @@ ** is reserved for internal use. */ int sqlite4CheckObjectName(Parse *pParse, const char *zName){ if( !pParse->db->init.busy && pParse->nested==0 && (pParse->db->flags & SQLITE4_WriteSchema)==0 - && 0==sqlite4StrNICmp(zName, "sqlite_", 7) ){ + && 0==sqlite4_strnicmp(zName, "sqlite_", 7) ){ sqlite4ErrorMsg(pParse, "object name reserved for internal use: %s", zName); return SQLITE4_ERROR; } return SQLITE4_OK; } @@ -838,20 +838,20 @@ return; } /* ** This macro is used to compare two strings in a case-insensitive manner. -** It is slightly faster than calling sqlite4StrICmp() directly, but +** It is slightly faster than calling sqlite4_stricmp() directly, but ** produces larger code. ** ** WARNING: This macro is not compatible with the strcmp() family. It ** returns true if the two strings are equal, otherwise false. */ #define STRICMP(x, y) (\ sqlite4UpperToLower[*(unsigned char *)(x)]== \ sqlite4UpperToLower[*(unsigned char *)(y)] \ -&& sqlite4StrICmp((x)+1,(y)+1)==0 ) +&& sqlite4_stricmp((x)+1,(y)+1)==0 ) /* ** Add a new column to the table currently being constructed. ** ** The parser calls this routine once for each column declaration @@ -1064,11 +1064,11 @@ pTab->aCol[iCol].isPrimKey = 1; pTab->aCol[iCol].notNull = 1; }else{ for(i=0; inExpr; i++){ for(iCol=0; iColnCol; iCol++){ - if( sqlite4StrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ){ + if( sqlite4_stricmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ){ break; } } if( iColnCol ){ pTab->aCol[iCol].isPrimKey = i+1; @@ -1081,11 +1081,11 @@ pParse, 0, 0, 0, pList, onError, 0, 0, sortOrder, 0, 1 ); if( iCol>=0 && iColnCol && (zType = pTab->aCol[iCol].zType)!=0 - && sqlite4StrICmp(zType, "INTEGER")==0 + && sqlite4_stricmp(zType, "INTEGER")==0 && sortOrder==SQLITE4_SO_ASC && pPk ){ pPk->fIndex |= IDX_IntPK; assert( autoInc==0 || autoInc==1 ); @@ -2045,12 +2045,12 @@ if( sqlite4AuthCheck(pParse, SQLITE4_DELETE, pTab->zName, 0, zDb) ){ goto exit_drop_table; } } #endif - if( sqlite4StrNICmp(pTab->zName, "sqlite_", 7)==0 - && sqlite4StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){ + if( sqlite4_strnicmp(pTab->zName, "sqlite_", 7)==0 + && sqlite4_strnicmp(pTab->zName, "sqlite_stat", 11)!=0 ){ sqlite4ErrorMsg(pParse, "table %s may not be dropped", pTab->zName); goto exit_drop_table; } #ifndef SQLITE4_OMIT_VIEW @@ -2158,11 +2158,11 @@ pFKey->aCol[0].iFrom = p->nCol-1; }else{ for(i=0; inCol; j++){ - if( sqlite4StrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ + if( sqlite4_stricmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ pFKey->aCol[i].iFrom = j; break; } } if( j>=p->nCol ){ @@ -2361,11 +2361,11 @@ assert( pParse->nErr==0 ); /* TODO: We will need to reinstate this block when sqlite_master is ** modified to use an implicit primary key. */ #if 0 - if( sqlite4StrNICmp(pTab->zName, "sqlite_", 7)==0 + if( sqlite4_strnicmp(pTab->zName, "sqlite_", 7)==0 && memcmp(&pTab->zName[7],"altertab_",9)!=0 ){ sqlite4ErrorMsg(pParse, "table %s may not be indexed", pTab->zName); goto exit_create_index; } #endif @@ -2726,11 +2726,11 @@ const char *zColName = pListItem->zName; Column *pTabCol; char *zColl; /* Collation sequence name */ for(j=0, pTabCol=pTab->aCol; jnCol; j++, pTabCol++){ - if( sqlite4StrICmp(zColName, pTabCol->zName)==0 ) break; + if( sqlite4_stricmp(zColName, pTabCol->zName)==0 ) break; } if( j>=pTab->nCol ){ sqlite4ErrorMsg(pParse, "table %s has no column named %s", pTab->zName, zColName); pParse->checkSchema = 1; @@ -2794,11 +2794,11 @@ const char *z1; const char *z2; if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break; z1 = pIdx->azColl[k]; z2 = pIndex->azColl[k]; - if( z1!=z2 && sqlite4StrICmp(z1, z2) ) break; + if( z1!=z2 && sqlite4_stricmp(z1, z2) ) break; } if( k==pIdx->nColumn ){ if( pIdx->onError!=pIndex->onError ){ /* This constraint creates the same index as a previous ** constraint specified somewhere in the CREATE TABLE statement. @@ -3090,11 +3090,11 @@ */ int sqlite4IdListIndex(IdList *pList, const char *zName){ int i; if( pList==0 ) return -1; for(i=0; inId; i++){ - if( sqlite4StrICmp(pList->a[i].zName, zName)==0 ) return i; + if( sqlite4_stricmp(pList->a[i].zName, zName)==0 ) return i; } return -1; } /* @@ -3513,11 +3513,11 @@ void sqlite4CodeVerifyNamedSchema(Parse *pParse, const char *zDb){ sqlite4 *db = pParse->db; int i; for(i=0; inDb; i++){ Db *pDb = &db->aDb[i]; - if( pDb->pKV && (!zDb || 0==sqlite4StrICmp(zDb, pDb->zName)) ){ + if( pDb->pKV && (!zDb || 0==sqlite4_stricmp(zDb, pDb->zName)) ){ sqlite4CodeVerifySchema(pParse, i); } } } @@ -3596,11 +3596,11 @@ int i; assert( zColl!=0 ); for(i=0; inColumn; i++){ const char *z = pIndex->azColl[i]; assert( z!=0 ); - if( 0==sqlite4StrICmp(z, zColl) ){ + if( 0==sqlite4_stricmp(z, zColl) ){ return 1; } } return 0; } Index: src/callback.c ================================================================== --- src/callback.c +++ src/callback.c @@ -268,11 +268,11 @@ int nFunc /* Number of bytes in zFunc */ ){ FuncDef *p; if( nFunc<0 ) nFunc = sqlite4Strlen30(zFunc); for(p=pFuncTab->pFirst; p; p=p->pNextName){ - if( sqlite4StrNICmp(p->zName, zFunc, nFunc)==0 && p->zName[nFunc]==0 ){ + if( sqlite4_strnicmp(p->zName, zFunc, nFunc)==0 && p->zName[nFunc]==0 ){ return p; } } return 0; } @@ -297,11 +297,11 @@ if( pFuncTab->pFirst==0 ){ pFuncTab->pFirst = pDef; pFuncTab->pLast = pDef; pFuncTab->pSame = pDef; }else if( isBuiltIn - && sqlite4StrICmp(pDef->zName, pFuncTab->pLast->zName)==0 ){ + && sqlite4_stricmp(pDef->zName, pFuncTab->pLast->zName)==0 ){ assert( pFuncTab->pSame->pSameName==0 || pFuncTab->pSame->pSameName==pDef ); pFuncTab->pSame->pSameName = pDef; pFuncTab->pSame = pDef; }else if( !isBuiltIn && (pOther=functionSearch(pFuncTab,pDef->zName,-1))!=0 ){ pDef->pSameName = pOther->pSameName; Index: src/complete.c ================================================================== --- src/complete.c +++ src/complete.c @@ -198,35 +198,35 @@ #ifdef SQLITE4_OMIT_TRIGGER token = tkOTHER; #else switch( *zSql ){ case 'c': case 'C': { - if( nId==6 && sqlite4StrNICmp(zSql, "create", 6)==0 ){ + if( nId==6 && sqlite4_strnicmp(zSql, "create", 6)==0 ){ token = tkCREATE; }else{ token = tkOTHER; } break; } case 't': case 'T': { - if( nId==7 && sqlite4StrNICmp(zSql, "trigger", 7)==0 ){ + if( nId==7 && sqlite4_strnicmp(zSql, "trigger", 7)==0 ){ token = tkTRIGGER; - }else if( nId==4 && sqlite4StrNICmp(zSql, "temp", 4)==0 ){ + }else if( nId==4 && sqlite4_strnicmp(zSql, "temp", 4)==0 ){ token = tkTEMP; - }else if( nId==9 && sqlite4StrNICmp(zSql, "temporary", 9)==0 ){ + }else if( nId==9 && sqlite4_strnicmp(zSql, "temporary", 9)==0 ){ token = tkTEMP; }else{ token = tkOTHER; } break; } case 'e': case 'E': { - if( nId==3 && sqlite4StrNICmp(zSql, "end", 3)==0 ){ + if( nId==3 && sqlite4_strnicmp(zSql, "end", 3)==0 ){ token = tkEND; }else #ifndef SQLITE4_OMIT_EXPLAIN - if( nId==7 && sqlite4StrNICmp(zSql, "explain", 7)==0 ){ + if( nId==7 && sqlite4_strnicmp(zSql, "explain", 7)==0 ){ token = tkEXPLAIN; }else #endif { token = tkOTHER; Index: src/ctime.c ================================================================== --- src/ctime.c +++ src/ctime.c @@ -344,17 +344,17 @@ ** The name can optionally begin with "SQLITE4_" but the "SQLITE4_" prefix ** is not required for a match. */ int sqlite4_compileoption_used(const char *zOptName){ int i, n; - if( sqlite4StrNICmp(zOptName, "SQLITE4_", 8)==0 ) zOptName += 8; + if( sqlite4_strnicmp(zOptName, "SQLITE4_", 8)==0 ) zOptName += 8; n = sqlite4Strlen30(zOptName); /* Since ArraySize(azCompileOpt) is normally in single digits, a ** linear search is adequate. No need for a binary search. */ for(i=0; iiJD = (sqlite4_int64)(r*86400000.0 + 0.5); p->validJD = 1; return 0; Index: src/fkey.c ================================================================== --- src/fkey.c +++ src/fkey.c @@ -239,15 +239,15 @@ ** unusable. Bail out early in this case. */ zDfltColl = pParent->aCol[iCol].zColl; if( !zDfltColl ){ zDfltColl = "BINARY"; } - if( sqlite4StrICmp(pIdx->azColl[i], zDfltColl) ) break; + if( sqlite4_stricmp(pIdx->azColl[i], zDfltColl) ) break; zIdxCol = pParent->aCol[iCol].zName; for(j=0; jaCol[j].zCol, zIdxCol)==0 ){ + if( sqlite4_stricmp(pFKey->aCol[j].zCol, zIdxCol)==0 ){ if( aiCol ) aiCol[i] = pFKey->aCol[j].iFrom; break; } } if( j==nCol ) break; @@ -866,11 +866,11 @@ for(i=0; inCol; i++){ char *zKey = p->aCol[i].zCol; int iKey; for(iKey=0; iKeynCol; iKey++){ Column *pCol = &pTab->aCol[iKey]; - if( (zKey ? !sqlite4StrICmp(pCol->zName, zKey) : pCol->isPrimKey) ){ + if( (zKey ? !sqlite4_stricmp(pCol->zName, zKey) : pCol->isPrimKey) ){ if( aChange[iKey]>=0 ) return 1; } } } } Index: src/fts5.c ================================================================== --- src/fts5.c +++ src/fts5.c @@ -718,11 +718,11 @@ /* Check if this first primitive is a column name or not. */ if( pParse->next.eType==TOKEN_COLON ){ int iCol; for(iCol=0; iColnCol; iCol++){ - if( sqlite4StrNICmp(pParse->azCol[iCol], t.z, t.n)==0 ) break; + if( sqlite4_strnicmp(pParse->azCol[iCol], t.z, t.n)==0 ) break; } if( iCol==pParse->nCol ){ pParse->zErr = sqlite4MPrintf(pParse->db, "fts5: no such column: %.*s", t.n, t.z ); @@ -1034,11 +1034,11 @@ ** if it exists, or NULL otherwise. */ static Fts5Tokenizer *fts5FindTokenizer(sqlite4 *db, const char *zName){ Fts5Tokenizer *p; for(p=db->pTokenizer; p; p=p->pNext){ - if( 0==sqlite4StrICmp(zName, p->zName) ) break; + if( 0==sqlite4_stricmp(zName, p->zName) ) break; } return p; } static void fts5TokenizerCreate( @@ -1149,11 +1149,11 @@ int i; for(i=0; pParse->nErr==0 && inExpr; i++){ char *zArg = pArgs->a[i].zName; char *zVal = pArgs->a[i].pExpr->u.zToken; - if( zArg && sqlite4StrICmp(zArg, "tokenizer")==0 ){ + if( zArg && sqlite4_stricmp(zArg, "tokenizer")==0 ){ /* zVal is the name of the tokenizer to use. Any subsequent arguments ** that do not contain assignment operators (=) are also passed to ** the tokenizer. Figure out how many bytes of space are required for ** all. */ int j; Index: src/hash.c ================================================================== --- src/hash.c +++ src/hash.c @@ -27,11 +27,11 @@ } return h; } static int strCmp(const char *z1, const char *z2, int n){ - return sqlite4StrNICmp(z1, z2, n); + return sqlite4_strnicmp(z1, z2, n); } static unsigned int binHash(const char *z, int nKey){ int h = 0; assert( nKey>=0 ); Index: src/insert.c ================================================================== --- src/insert.c +++ src/insert.c @@ -781,11 +781,11 @@ pColumn->a[i].idx = -1; } for(i=0; inId; i++){ char *zTest = pColumn->a[i].zName; for(j=0; jnCol; j++){ - if( sqlite4StrICmp(zTest, pTab->aCol[j].zName)==0 ){ + if( sqlite4_stricmp(zTest, pTab->aCol[j].zName)==0 ){ pColumn->a[i].idx = j; break; } } if( j==pTab->nCol ){ @@ -1537,11 +1537,11 @@ return z2==0; } if( z2==0 ){ return 0; } - return sqlite4StrICmp(z1, z2)==0; + return sqlite4_stricmp(z1, z2)==0; } /* ** Check to see if index pSrc is compatible as a source of data Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -2012,11 +2012,11 @@ sqlite4_mutex_enter(db->mutex); /* Find the named key-value store */ for(i=0; inDb; i++){ Db *pDb = &db->aDb[i]; - if( pDb->pKV && (0==zDbName || 0==sqlite4StrICmp(zDbName, pDb->zName)) ){ + if( pDb->pKV && (0==zDbName || 0==sqlite4_stricmp(zDbName, pDb->zName)) ){ pKV = pDb->pKV; break; } } Index: src/pragma.c ================================================================== --- src/pragma.c +++ src/pragma.c @@ -26,11 +26,11 @@ if( sqlite4Isdigit(*z) ){ return (u8)sqlite4Atoi(z); } n = sqlite4Strlen30(z); for(i=0; izName)==0 ){ + if( sqlite4_stricmp(zLeft, p->zName)==0 ){ sqlite4 *db = pParse->db; Vdbe *v; v = sqlite4GetVdbe(pParse); assert( v!=0 ); /* Already allocated by sqlite4Pragma() */ if( ALWAYS(v) ){ @@ -222,28 +222,28 @@ /* The flagPragma() subroutine also generates any necessary code ** there is nothing more to do here */ }else #endif /* SQLITE4_OMIT_FLAG_PRAGMAS */ - if( sqlite4StrICmp(zLeft, "lsm_flush")==0 ){ + if( sqlite4_stricmp(zLeft, "lsm_flush")==0 ){ sqlite4_kvstore_control(db, zDb, SQLITE4_KVCTRL_LSM_FLUSH, 0); }else - if( sqlite4StrICmp(zLeft, "lsm_checkpoint")==0 ){ + if( sqlite4_stricmp(zLeft, "lsm_checkpoint")==0 ){ sqlite4_kvstore_control(db, zDb, SQLITE4_KVCTRL_LSM_CHECKPOINT, 0); }else - if( sqlite4StrICmp(zLeft, "lsm_merge")==0 ){ + if( sqlite4_stricmp(zLeft, "lsm_merge")==0 ){ int nPage = zRight ? sqlite4Atoi(zRight) : 1000; sqlite4_kvstore_control(db, zDb, SQLITE4_KVCTRL_LSM_MERGE, &nPage); returnSingleInt(pParse, "nWrite", (sqlite4_int64)nPage); }else /* ** PRAGMA fts_check() */ - if( sqlite4StrICmp(zLeft, "fts_check")==0 && zRight ){ + if( sqlite4_stricmp(zLeft, "fts_check")==0 && zRight ){ int iCksum1; int iCksum2; Index *pIdx; Table *pTab; Vdbe *v = sqlite4GetVdbe(pParse); @@ -315,11 +315,11 @@ ** name: Column name ** type: Column declaration type. ** notnull: True if 'NOT NULL' is part of column declaration ** dflt_value: The default value for the column, if any. */ - if( sqlite4StrICmp(zLeft, "table_info")==0 && zRight ){ + if( sqlite4_stricmp(zLeft, "table_info")==0 && zRight ){ Table *pTab; if( sqlite4ReadSchema(pParse) ) goto pragma_out; pTab = sqlite4FindTable(db, zRight, zDb); if( pTab ){ int i; @@ -353,11 +353,11 @@ sqlite4VdbeAddOp2(v, OP_ResultRow, 1, 6); } } }else - if( sqlite4StrICmp(zLeft, "index_info")==0 && zRight ){ + if( sqlite4_stricmp(zLeft, "index_info")==0 && zRight ){ Index *pIdx; Table *pTab; if( sqlite4ReadSchema(pParse) ) goto pragma_out; pIdx = sqlite4FindIndex(db, zRight, zDb); if( pIdx ){ @@ -377,11 +377,11 @@ sqlite4VdbeAddOp2(v, OP_ResultRow, 1, 3); } } }else - if( sqlite4StrICmp(zLeft, "index_list")==0 && zRight ){ + if( sqlite4_stricmp(zLeft, "index_list")==0 && zRight ){ Index *pIdx; Table *pTab; if( sqlite4ReadSchema(pParse) ) goto pragma_out; pTab = sqlite4FindTable(db, zRight, zDb); if( pTab ){ @@ -404,11 +404,11 @@ } } } }else - if( sqlite4StrICmp(zLeft, "database_list")==0 ){ + if( sqlite4_stricmp(zLeft, "database_list")==0 ){ int i; if( sqlite4ReadSchema(pParse) ) goto pragma_out; sqlite4VdbeSetNumCols(v, 3); pParse->nMem = 3; sqlite4VdbeSetColName(v, 0, COLNAME_NAME, "seq", SQLITE4_STATIC); @@ -423,11 +423,11 @@ "filename", 0); sqlite4VdbeAddOp2(v, OP_ResultRow, 1, 3); } }else - if( sqlite4StrICmp(zLeft, "collation_list")==0 ){ + if( sqlite4_stricmp(zLeft, "collation_list")==0 ){ int i = 0; HashElem *p; sqlite4VdbeSetNumCols(v, 2); pParse->nMem = 2; sqlite4VdbeSetColName(v, 0, COLNAME_NAME, "seq", SQLITE4_STATIC); @@ -440,11 +440,11 @@ } }else #endif /* SQLITE4_OMIT_SCHEMA_PRAGMAS */ #ifndef SQLITE4_OMIT_FOREIGN_KEY - if( sqlite4StrICmp(zLeft, "foreign_key_list")==0 && zRight ){ + if( sqlite4_stricmp(zLeft, "foreign_key_list")==0 && zRight ){ FKey *pFK; Table *pTab; if( sqlite4ReadSchema(pParse) ) goto pragma_out; pTab = sqlite4FindTable(db, zRight, zDb); if( pTab ){ @@ -486,11 +486,11 @@ } }else #endif /* !defined(SQLITE4_OMIT_FOREIGN_KEY) */ #ifndef NDEBUG - if( sqlite4StrICmp(zLeft, "parser_trace")==0 ){ + if( sqlite4_stricmp(zLeft, "parser_trace")==0 ){ if( zRight ){ if( sqlite4GetBoolean(zRight) ){ sqlite4ParserTrace(stderr, "parser: "); }else{ sqlite4ParserTrace(0, 0); @@ -500,11 +500,11 @@ #endif /* Reinstall the LIKE and GLOB functions. The variant of LIKE ** used will be case sensitive or not depending on the RHS. */ - if( sqlite4StrICmp(zLeft, "case_sensitive_like")==0 ){ + if( sqlite4_stricmp(zLeft, "case_sensitive_like")==0 ){ if( zRight ){ sqlite4RegisterLikeFunctions(db, sqlite4GetBoolean(zRight)); } }else @@ -534,11 +534,11 @@ ** ** In the second form this pragma sets the text encoding to be used in ** new database files created using this database handle. It is only ** useful if invoked immediately after the main database i */ - if( sqlite4StrICmp(zLeft, "encoding")==0 ){ + if( sqlite4_stricmp(zLeft, "encoding")==0 ){ static const struct EncName { char *zName; u8 enc; } encnames[] = { { "UTF8", SQLITE4_UTF8 }, @@ -571,11 +571,11 @@ if( !(DbHasProperty(db, 0, DB_SchemaLoaded)) || DbHasProperty(db, 0, DB_Empty) ){ for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ - if( 0==sqlite4StrICmp(zRight, pEnc->zName) ){ + if( 0==sqlite4_stricmp(zRight, pEnc->zName) ){ ENC(pParse->db) = pEnc->enc ? pEnc->enc : SQLITE4_UTF16NATIVE; break; } } if( !pEnc->zName ){ @@ -592,11 +592,11 @@ ** PRAGMA compile_options ** ** Return the names of all compile-time options used in this build, ** one option per row. */ - if( sqlite4StrICmp(zLeft, "compile_options")==0 ){ + if( sqlite4_stricmp(zLeft, "compile_options")==0 ){ int i = 0; const char *zOpt; sqlite4VdbeSetNumCols(v, 1); pParse->nMem = 1; sqlite4VdbeSetColName(v, 0, COLNAME_NAME, "compile_option", SQLITE4_STATIC); @@ -611,21 +611,21 @@ /* ** PRAGMA kvdump ** ** Print an ascii rendering of the complete content of the database file. */ - if( sqlite4StrICmp(zLeft, "kvdump")==0 ){ + if( sqlite4_stricmp(zLeft, "kvdump")==0 ){ sqlite4KVStoreDump(db->aDb[0].pKV); }else #endif /* SQLITE4_OMIT_COMPILEOPTION_DIAGS */ /* ** PRAGMA integrity_check ** ** Check that for each table, the content of any auxilliary indexes are ** consistent with the primary key index. */ - if( sqlite4StrICmp(zLeft, "integrity_check")==0 ){ + if( sqlite4_stricmp(zLeft, "integrity_check")==0 ){ const int baseCsr = 1; /* Base cursor for OpenAllIndexes() call */ const int regErrcnt = 1; /* Register containing error count */ const int regErrstr = 2; /* Register containing error string */ const int regTmp = 3; /* Register for tmp use */ @@ -783,11 +783,11 @@ ** PRAGMA shrink_memory ** ** This pragma attempts to free as much memory as possible from the ** current database connection. */ - if( sqlite4StrICmp(zLeft, "shrink_memory")==0 ){ + if( sqlite4_stricmp(zLeft, "shrink_memory")==0 ){ sqlite4_db_release_memory(db); }else {/* Empty ELSE clause */} Index: src/resolve.c ================================================================== --- src/resolve.c +++ src/resolve.c @@ -107,11 +107,11 @@ */ static int nameInUsingClause(IdList *pUsing, const char *zCol){ if( pUsing ){ int k; for(k=0; knId; k++){ - if( sqlite4StrICmp(pUsing->a[k].zName, zCol)==0 ) return 1; + if( sqlite4_stricmp(pUsing->a[k].zName, zCol)==0 ) return 1; } } return 0; } @@ -119,11 +119,11 @@ ** Return true if table pTab has an implicit primary key, and zCol points ** to a column name that resolves to the implicit primary key (i.e. "rowid"). */ int isRowidReference(Table *pTab, const char *zCol){ int ret = 0; - if( 0==sqlite4StrICmp(zCol, "ROWID") ){ + if( 0==sqlite4_stricmp(zCol, "ROWID") ){ /* If the call to FindPrimaryKey() returns NULL, then pTab must be a ** sub-select or a view. Neither of these have an IPK. */ Index *pPk = sqlite4FindPrimaryKey(pTab, 0); if( pPk && pPk->aiColumn[0]==-1 ) ret = 1; } @@ -200,17 +200,17 @@ iDb = sqlite4SchemaToIndex(db, pTab->pSchema); assert( pTab->nCol>0 ); if( zTab ){ if( pItem->zAlias ){ char *zTabName = pItem->zAlias; - if( sqlite4StrICmp(zTabName, zTab)!=0 ) continue; + if( sqlite4_stricmp(zTabName, zTab)!=0 ) continue; }else{ char *zTabName = pTab->zName; - if( NEVER(zTabName==0) || sqlite4StrICmp(zTabName, zTab)!=0 ){ + if( NEVER(zTabName==0) || sqlite4_stricmp(zTabName, zTab)!=0 ){ continue; } - if( zDb!=0 && sqlite4StrICmp(db->aDb[iDb].zName, zDb)!=0 ){ + if( zDb!=0 && sqlite4_stricmp(db->aDb[iDb].zName, zDb)!=0 ){ continue; } } } if( 0==(cntTab++) ){ @@ -218,11 +218,11 @@ pExpr->pTab = pTab; pSchema = pTab->pSchema; pMatch = pItem; } for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ - if( sqlite4StrICmp(pCol->zName, zCol)==0 ){ + if( sqlite4_stricmp(pCol->zName, zCol)==0 ){ /* If there has been exactly one prior match and this match ** is for the right-hand table of a NATURAL JOIN or is in a ** USING clause, then skip this match. */ if( cnt==1 ){ @@ -247,14 +247,14 @@ */ if( zDb==0 && zTab!=0 && cnt==0 && pParse->pTriggerTab!=0 ){ int op = pParse->eTriggerOp; Table *pTab = 0; assert( op==TK_DELETE || op==TK_UPDATE || op==TK_INSERT ); - if( op!=TK_DELETE && sqlite4StrICmp("new",zTab) == 0 ){ + if( op!=TK_DELETE && sqlite4_stricmp("new",zTab) == 0 ){ pExpr->iTable = 1; pTab = pParse->pTriggerTab; - }else if( op!=TK_INSERT && sqlite4StrICmp("old",zTab)==0 ){ + }else if( op!=TK_INSERT && sqlite4_stricmp("old",zTab)==0 ){ pExpr->iTable = 0; pTab = pParse->pTriggerTab; } if( pTab ){ @@ -261,11 +261,11 @@ int iCol; pSchema = pTab->pSchema; cntTab++; for(iCol=0; iColnCol; iCol++){ Column *pCol = &pTab->aCol[iCol]; - if( sqlite4StrICmp(pCol->zName, zCol)==0 ){ + if( sqlite4_stricmp(pCol->zName, zCol)==0 ){ break; } } if( iCol>=pTab->nCol && isRowidReference(pTab, zCol) ){ iCol = -1; /* IMP: R-44911-55124 */ @@ -313,11 +313,11 @@ ** resolved by the time the WHERE clause is resolved. */ if( cnt==0 && (pEList = pNC->pEList)!=0 && zTab==0 ){ for(j=0; jnExpr; j++){ char *zAs = pEList->a[j].zName; - if( zAs!=0 && sqlite4StrICmp(zAs, zCol)==0 ){ + if( zAs!=0 && sqlite4_stricmp(zAs, zCol)==0 ){ Expr *pOrig; assert( pExpr->pLeft==0 && pExpr->pRight==0 ); assert( pExpr->x.pList==0 ); assert( pExpr->x.pSelect==0 ); pOrig = pEList->a[j].pExpr; @@ -449,12 +449,12 @@ } zLhs = pExpr->u.zToken; for(i=0; inSrc; i++){ pItem = &pSrc->a[i]; - if( pItem->zAlias && sqlite4StrICmp(zLhs, pItem->zAlias)==0 ) break; - if( pItem->zAlias==0 && sqlite4StrICmp(zLhs, pItem->zName)==0 ) break; + if( pItem->zAlias && sqlite4_stricmp(zLhs, pItem->zAlias)==0 ) break; + if( pItem->zAlias==0 && sqlite4_stricmp(zLhs, pItem->zName)==0 ) break; } if( i==pSrc->nSrc ){ sqlite4ErrorMsg(pParse, "no such table: %s", zLhs); return; } @@ -478,12 +478,12 @@ } zLhs = pLeft->u.zToken; for(i=0; inSrc; i++){ pItem = &pSrc->a[i]; - if( pItem->zAlias && sqlite4StrICmp(zLhs, pItem->zAlias)==0 ) break; - if( pItem->zAlias==0 && sqlite4StrICmp(zLhs, pItem->zName)==0 ) break; + if( pItem->zAlias && sqlite4_stricmp(zLhs, pItem->zAlias)==0 ) break; + if( pItem->zAlias==0 && sqlite4_stricmp(zLhs, pItem->zName)==0 ) break; } if( i==pSrc->nSrc ){ sqlite4ErrorMsg(pParse, "no such table: %s", zLhs); return; @@ -719,11 +719,11 @@ if( pE->op==TK_ID ){ char *zCol = pE->u.zToken; for(i=0; inExpr; i++){ char *zAs = pEList->a[i].zName; - if( zAs!=0 && sqlite4StrICmp(zAs, zCol)==0 ){ + if( zAs!=0 && sqlite4_stricmp(zAs, zCol)==0 ){ return i+1; } } } return 0; Index: src/select.c ================================================================== --- src/select.c +++ src/select.c @@ -150,11 +150,11 @@ apAll[2] = pC; for(i=0; i<3 && apAll[i]; i++){ p = apAll[i]; for(j=0; jn==aKeyword[j].nChar - && sqlite4StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){ + && sqlite4_strnicmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){ jointype |= aKeyword[j].code; break; } } testcase( j==0 || j==1 || j==2 || j==3 || j==4 || j==5 || j==6 ); @@ -187,11 +187,11 @@ ** is not contained in the table. */ static int columnIndex(Table *pTab, const char *zCol){ int i; for(i=0; inCol; i++){ - if( sqlite4StrICmp(pTab->aCol[i].zName, zCol)==0 ) return i; + if( sqlite4_stricmp(pTab->aCol[i].zName, zCol)==0 ) return i; } return -1; } /* @@ -1323,11 +1323,11 @@ /* Make sure the column name is unique. If the name is not unique, ** append a integer to the name so that it becomes unique. */ nName = sqlite4Strlen30(zName); for(j=cnt=0; jx.pList; if( pEList==0 || pEList->nExpr!=1 ) return 0; if( pEList->a[0].pExpr->op!=TK_AGG_COLUMN ) return WHERE_ORDERBY_NORMAL; assert( !ExprHasProperty(pExpr, EP_IntValue) ); - if( sqlite4StrICmp(pExpr->u.zToken,"min")==0 ){ + if( sqlite4_stricmp(pExpr->u.zToken,"min")==0 ){ return WHERE_ORDERBY_MIN; - }else if( sqlite4StrICmp(pExpr->u.zToken,"max")==0 ){ + }else if( sqlite4_stricmp(pExpr->u.zToken,"max")==0 ){ return WHERE_ORDERBY_MAX; } return WHERE_ORDERBY_NORMAL; } @@ -3142,11 +3142,11 @@ if( pFrom->pTab && pFrom->zIndex ){ Table *pTab = pFrom->pTab; char *zIndex = pFrom->zIndex; Index *pIdx; for(pIdx=pTab->pIndex; - pIdx && sqlite4StrICmp(pIdx->zName, zIndex); + pIdx && sqlite4_stricmp(pIdx->zName, zIndex); pIdx=pIdx->pNext ); if( !pIdx ){ sqlite4ErrorMsg(pParse, "no such index: %s", zIndex, 0); pParse->checkSchema = 1; @@ -3319,11 +3319,11 @@ char *zTabName = pFrom->zAlias; if( zTabName==0 ){ zTabName = pTab->zName; } if( db->mallocFailed ) break; - if( zTName && sqlite4StrICmp(zTName, zTabName)!=0 ){ + if( zTName && sqlite4_stricmp(zTName, zTabName)!=0 ){ continue; } tableSeen = 1; for(j=0; jnCol; j++){ Expr *pExpr, *pRight; Index: src/sqliteInt.h ================================================================== --- src/sqliteInt.h +++ src/sqliteInt.h @@ -2553,12 +2553,10 @@ /* ** Internal function prototypes */ int sqlite4Strlen30(const char*); -#define sqlite4StrICmp sqlite4_stricmp -#define sqlite4StrNICmp sqlite4_strnicmp int sqlite4MallocInit(sqlite4_env*); void sqlite4MallocEnd(sqlite4_env*); void *sqlite4Malloc(sqlite4_env*, int); void *sqlite4MallocZero(sqlite4_env*, int); Index: src/trigger.c ================================================================== --- src/trigger.c +++ src/trigger.c @@ -55,11 +55,11 @@ if( pTmpSchema!=pTab->pSchema ){ HashElem *p; for(p=sqliteHashFirst(&pTmpSchema->trigHash); p; p=sqliteHashNext(p)){ Trigger *pTrig = (Trigger *)sqliteHashData(p); if( pTrig->pTabSchema==pTab->pSchema - && 0==sqlite4StrICmp(pTrig->table, pTab->zName) + && 0==sqlite4_stricmp(pTrig->table, pTab->zName) ){ pTrig->pNext = (pList ? pList : pTab->pTrigger); pList = pTrig; } } @@ -188,11 +188,11 @@ } goto trigger_cleanup; } /* Do not create a trigger on a system table */ - if( sqlite4StrNICmp(pTab->zName, "sqlite_", 7)==0 ){ + if( sqlite4_strnicmp(pTab->zName, "sqlite_", 7)==0 ){ sqlite4ErrorMsg(pParse, "cannot create trigger on system table"); pParse->nErr++; goto trigger_cleanup; } @@ -500,11 +500,11 @@ zDb = pName->a[0].zDatabase; zName = pName->a[0].zName; nName = sqlite4Strlen30(zName); for(i=OMIT_TEMPDB; inDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ - if( zDb && sqlite4StrICmp(db->aDb[j].zName, zDb) ) continue; + if( zDb && sqlite4_stricmp(db->aDb[j].zName, zDb) ) continue; pTrigger = sqlite4HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName); if( pTrigger ) break; } if( !pTrigger ){ if( !noErr ){ Index: src/update.c ================================================================== --- src/update.c +++ src/update.c @@ -210,11 +210,11 @@ goto update_cleanup; } /* Resolve the column name on the left of the assignment */ for(j=0; jnCol; j++){ - if( sqlite4StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ) break; + if( sqlite4_stricmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ) break; } if( j==pTab->nCol ){ sqlite4ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName); pParse->checkSchema = 1; goto update_cleanup; Index: src/vdbe.c ================================================================== --- src/vdbe.c +++ src/vdbe.c @@ -2448,11 +2448,11 @@ ** number. For example, to commit or rollback the top level transaction ** iSave==2. */ iSave = db->nSavepoint+1; for(pSave=db->pSavepoint; pSave; pSave=pSave->pNext){ if( zSave ){ - if( pSave->zName && 0==sqlite4StrICmp(zSave, pSave->zName) ) break; + if( pSave->zName && 0==sqlite4_stricmp(zSave, pSave->zName) ) break; }else{ if( pSave->pNext==0 ) break; } iSave--; } Index: src/where.c ================================================================== --- src/where.c +++ src/where.c @@ -770,11 +770,11 @@ ExprList *pList; if( pExpr->op!=TK_FUNCTION ){ return 0; } - if( sqlite4StrICmp(pExpr->u.zToken,"match")!=0 ){ + if( sqlite4_stricmp(pExpr->u.zToken,"match")!=0 ){ return 0; } pList = pExpr->x.pList; if( pList->nExpr!=2 ){ return 0; @@ -1456,11 +1456,11 @@ && p->iColumn==pIdx->aiColumn[iCol] && p->iTable==iBase ){ CollSeq *pColl = sqlite4ExprCollSeq(pParse, p); assert( pColl || p->iColumn==-1 ); - if( 0==pColl || 0==sqlite4StrICmp(pColl->zName, zColl) ){ + if( 0==pColl || 0==sqlite4_stricmp(pColl->zName, zColl) ){ return i; } } } Index: test/test_main.c ================================================================== --- test/test_main.c +++ test/test_main.c @@ -1706,22 +1706,22 @@ */ static void testFunc(sqlite4_context *context, int argc, sqlite4_value **argv){ while( argc>=2 ){ const char *zArg0 = (char*)sqlite4_value_text(argv[0]); if( zArg0 ){ - if( 0==sqlite4StrICmp(zArg0, "int") ){ + if( 0==sqlite4_stricmp(zArg0, "int") ){ sqlite4_result_int(context, sqlite4_value_int(argv[1])); - }else if( sqlite4StrICmp(zArg0,"int64")==0 ){ + }else if( sqlite4_stricmp(zArg0,"int64")==0 ){ sqlite4_result_int64(context, sqlite4_value_int64(argv[1])); - }else if( sqlite4StrICmp(zArg0,"string")==0 ){ + }else if( sqlite4_stricmp(zArg0,"string")==0 ){ sqlite4_result_text(context, (char*)sqlite4_value_text(argv[1]), -1, SQLITE4_TRANSIENT); - }else if( sqlite4StrICmp(zArg0,"double")==0 ){ + }else if( sqlite4_stricmp(zArg0,"double")==0 ){ sqlite4_result_double(context, sqlite4_value_double(argv[1])); - }else if( sqlite4StrICmp(zArg0,"null")==0 ){ + }else if( sqlite4_stricmp(zArg0,"null")==0 ){ sqlite4_result_null(context); - }else if( sqlite4StrICmp(zArg0,"value")==0 ){ + }else if( sqlite4_stricmp(zArg0,"value")==0 ){ sqlite4_result_value(context, argv[sqlite4_value_int(argv[1])]); }else{ goto error_out; } }else{ Index: test/test_utf.c ================================================================== --- test/test_utf.c +++ test/test_utf.c @@ -101,11 +101,11 @@ { 0, 0 } }; struct EncName *pEnc; char *z = Tcl_GetString(pObj); for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ - if( 0==sqlite4StrICmp(z, pEnc->zName) ){ + if( 0==sqlite4_stricmp(z, pEnc->zName) ){ break; } } if( !pEnc->enc ){ Tcl_AppendResult(interp, "No such encoding: ", z, 0); Index: tool/mkkeywordhash.c ================================================================== --- tool/mkkeywordhash.c +++ tool/mkkeywordhash.c @@ -574,11 +574,11 @@ printf(" h = ((charMap(z[0])*4) ^\n" " (charMap(z[n-1])*3) ^\n" " n) %% %d;\n", bestSize); printf(" for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){\n"); printf(" if( aLen[i]==n &&" - " sqlite4StrNICmp(&zText[aOffset[i]],z,n)==0 ){\n"); + " sqlite4_strnicmp(&zText[aOffset[i]],z,n)==0 ){\n"); for(i=0; i