SQLite4
Check-in [b6d0a62048]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change all occurrences of sqlite4StrICmp to sqlite4_stricmp and change sqlite4StrNICmp to sqlite4_strnicmp.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b6d0a6204839d1e787c24531aef66bcf79209699
User & Date: drh 2013-01-31 05:36:26
Context
2013-01-31
05:58
Add the definition of sqlite4_stricmp() to sqlite.h.in. Avoid multiple declarations the u8 and similar typedefs in the amalgmation. check-in: d966049dd6 user: drh tags: trunk
05:36
Change all occurrences of sqlite4StrICmp to sqlite4_stricmp and change sqlite4StrNICmp to sqlite4_strnicmp. check-in: b6d0a62048 user: drh tags: trunk
05:27
Publish routines sqlite4_stricmp() and sqlite4_strnicmp() that do simple unicode case folding. Use these routines for all internal case-insensitive string comparisons. check-in: 19e9278b9c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

   125    125           z += n;
   126    126           n = sqlite4GetToken(z, &token);
   127    127         }while( token==TK_SPACE );
   128    128   
   129    129         zParent = sqlite4DbStrNDup(db, (const char *)z, n);
   130    130         if( zParent==0 ) break;
   131    131         sqlite4Dequote(zParent);
   132         -      if( 0==sqlite4StrICmp((const char *)zOld, zParent) ){
          132  +      if( 0==sqlite4_stricmp((const char *)zOld, zParent) ){
   133    133           char *zOut = sqlite4MPrintf(db, "%s%.*s\"%w\"", 
   134    134               (zOutput?zOutput:""), z-zInput, zInput, (const char *)zNew
   135    135           );
   136    136           sqlite4DbFree(db, zOutput);
   137    137           zOutput = zOut;
   138    138           zInput = &z[n];
   139    139         }
................................................................................
   377    377   ** (either with ALTER TABLE ... RENAME TO or ALTER TABLE ... ADD COLUMN).
   378    378   ** If the table is a system table, this function leaves an error message
   379    379   ** in pParse->zErr (system tables may not be altered) and returns non-zero.
   380    380   **
   381    381   ** Or, if zName is not a system table, zero is returned.
   382    382   */
   383    383   static int isSystemTable(Parse *pParse, const char *zName){
   384         -  if( sqlite4Strlen30(zName)>6 && 0==sqlite4StrNICmp(zName, "sqlite_", 7) ){
          384  +  if( sqlite4Strlen30(zName)>6 && 0==sqlite4_strnicmp(zName, "sqlite_", 7) ){
   385    385       sqlite4ErrorMsg(pParse, "table %s may not be altered", zName);
   386    386       return 1;
   387    387     }
   388    388     return 0;
   389    389   }
   390    390   
   391    391   /*

Changes to src/attach.c.

    98     98     if( db->pSavepoint ){
    99     99       zErrDyn = sqlite4MPrintf(db, "cannot ATTACH database within transaction");
   100    100       goto attach_error;
   101    101     }
   102    102     for(i=0; i<db->nDb; i++){
   103    103       char *z = db->aDb[i].zName;
   104    104       assert( z && zName );
   105         -    if( sqlite4StrICmp(z, zName)==0 ){
          105  +    if( sqlite4_stricmp(z, zName)==0 ){
   106    106         zErrDyn = sqlite4MPrintf(db, "database %s is already in use", zName);
   107    107         goto attach_error;
   108    108       }
   109    109     }
   110    110   
   111    111     /* Allocate the new entry in the db->aDb[] array and initialise the schema
   112    112     ** hash tables.
................................................................................
   216    216   
   217    217     UNUSED_PARAMETER(NotUsed);
   218    218   
   219    219     if( zName==0 ) zName = "";
   220    220     for(i=0; i<db->nDb; i++){
   221    221       pDb = &db->aDb[i];
   222    222       if( pDb->pKV==0 ) continue;
   223         -    if( sqlite4StrICmp(pDb->zName, zName)==0 ) break;
          223  +    if( sqlite4_stricmp(pDb->zName, zName)==0 ) break;
   224    224     }
   225    225   
   226    226     if( i>=db->nDb ){
   227    227       sqlite4_snprintf(zErr,sizeof(zErr), "no such database: %s", zName);
   228    228       goto detach_error;
   229    229     }
   230    230     if( i<2 ){
................................................................................
   418    418     SrcListItem *pItem;
   419    419   
   420    420     if( NEVER(pList==0) ) return 0;
   421    421     zDb = pFix->zDb;
   422    422     for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
   423    423       if( pItem->zDatabase==0 ){
   424    424         pItem->zDatabase = sqlite4DbStrDup(pFix->pParse->db, zDb);
   425         -    }else if( sqlite4StrICmp(pItem->zDatabase,zDb)!=0 ){
          425  +    }else if( sqlite4_stricmp(pItem->zDatabase,zDb)!=0 ){
   426    426         sqlite4ErrorMsg(pFix->pParse,
   427    427            "%s %T cannot reference objects in database %s",
   428    428            pFix->zType, pFix->pName, pItem->zDatabase);
   429    429         return 1;
   430    430       }
   431    431   #if !defined(SQLITE4_OMIT_VIEW) || !defined(SQLITE4_OMIT_TRIGGER)
   432    432       if( sqlite4FixSelect(pFix, pItem->pSelect) ) return 1;

Changes to src/build.c.

   213    213     int i;
   214    214     int nName;
   215    215     assert( zName!=0 );
   216    216     nName = sqlite4Strlen30(zName);
   217    217     /* All mutexes are required for schema access.  Make sure we hold them. */
   218    218     for(i=OMIT_TEMPDB; i<db->nDb; i++){
   219    219       int j = (i<2) ? i^1 : i;   /* Search TEMP before MAIN */
   220         -    if( zDatabase!=0 && sqlite4StrICmp(zDatabase, db->aDb[j].zName) ) continue;
          220  +    if( zDatabase!=0 && sqlite4_stricmp(zDatabase, db->aDb[j].zName) ) continue;
   221    221       p = sqlite4HashFind(&db->aDb[j].pSchema->tblHash, zName, nName);
   222    222       if( p ) break;
   223    223     }
   224    224     return p;
   225    225   }
   226    226   
   227    227   /*
................................................................................
   278    278     int i;
   279    279     int nName = sqlite4Strlen30(zName);
   280    280     /* All mutexes are required for schema access.  Make sure we hold them. */
   281    281     for(i=OMIT_TEMPDB; i<db->nDb; i++){
   282    282       int j = (i<2) ? i^1 : i;  /* Search TEMP before MAIN */
   283    283       Schema *pSchema = db->aDb[j].pSchema;
   284    284       assert( pSchema );
   285         -    if( zDb && sqlite4StrICmp(zDb, db->aDb[j].zName) ) continue;
          285  +    if( zDb && sqlite4_stricmp(zDb, db->aDb[j].zName) ) continue;
   286    286       p = sqlite4HashFind(&pSchema->idxHash, zName, nName);
   287    287       if( p ) break;
   288    288     }
   289    289     return p;
   290    290   }
   291    291   
   292    292   /*
................................................................................
   546    546   int sqlite4FindDbName(sqlite4 *db, const char *zName){
   547    547     int i = -1;         /* Database number */
   548    548     if( zName ){
   549    549       Db *pDb;
   550    550       int n = sqlite4Strlen30(zName);
   551    551       for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){
   552    552         if( (!OMIT_TEMPDB || i!=1 ) && n==sqlite4Strlen30(pDb->zName) && 
   553         -          0==sqlite4StrICmp(pDb->zName, zName) ){
          553  +          0==sqlite4_stricmp(pDb->zName, zName) ){
   554    554           break;
   555    555         }
   556    556       }
   557    557     }
   558    558     return i;
   559    559   }
   560    560   
................................................................................
   625    625   ** trigger). All names are legal except those that begin with the string
   626    626   ** "sqlite_" (in upper, lower or mixed case). This portion of the namespace
   627    627   ** is reserved for internal use.
   628    628   */
   629    629   int sqlite4CheckObjectName(Parse *pParse, const char *zName){
   630    630     if( !pParse->db->init.busy && pParse->nested==0 
   631    631             && (pParse->db->flags & SQLITE4_WriteSchema)==0
   632         -          && 0==sqlite4StrNICmp(zName, "sqlite_", 7) ){
          632  +          && 0==sqlite4_strnicmp(zName, "sqlite_", 7) ){
   633    633       sqlite4ErrorMsg(pParse, "object name reserved for internal use: %s", zName);
   634    634       return SQLITE4_ERROR;
   635    635     }
   636    636     return SQLITE4_OK;
   637    637   }
   638    638   
   639    639   /*
................................................................................
   836    836   begin_table_error:
   837    837     sqlite4DbFree(db, zName);
   838    838     return;
   839    839   }
   840    840   
   841    841   /*
   842    842   ** This macro is used to compare two strings in a case-insensitive manner.
   843         -** It is slightly faster than calling sqlite4StrICmp() directly, but
          843  +** It is slightly faster than calling sqlite4_stricmp() directly, but
   844    844   ** produces larger code.
   845    845   **
   846    846   ** WARNING: This macro is not compatible with the strcmp() family. It
   847    847   ** returns true if the two strings are equal, otherwise false.
   848    848   */
   849    849   #define STRICMP(x, y) (\
   850    850   sqlite4UpperToLower[*(unsigned char *)(x)]==   \
   851    851   sqlite4UpperToLower[*(unsigned char *)(y)]     \
   852         -&& sqlite4StrICmp((x)+1,(y)+1)==0 )
          852  +&& sqlite4_stricmp((x)+1,(y)+1)==0 )
   853    853   
   854    854   /*
   855    855   ** Add a new column to the table currently being constructed.
   856    856   **
   857    857   ** The parser calls this routine once for each column declaration
   858    858   ** in a CREATE TABLE statement.  sqlite4StartTable() gets called
   859    859   ** first to get things going.  Then this routine is called for each
................................................................................
  1062   1062     if( pList==0 ){
  1063   1063       iCol = pTab->nCol - 1;
  1064   1064       pTab->aCol[iCol].isPrimKey = 1;
  1065   1065       pTab->aCol[iCol].notNull = 1;
  1066   1066     }else{
  1067   1067       for(i=0; i<pList->nExpr; i++){
  1068   1068         for(iCol=0; iCol<pTab->nCol; iCol++){
  1069         -        if( sqlite4StrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ){
         1069  +        if( sqlite4_stricmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ){
  1070   1070             break;
  1071   1071           }
  1072   1072         }
  1073   1073         if( iCol<pTab->nCol ){
  1074   1074           pTab->aCol[iCol].isPrimKey = i+1;
  1075   1075           pTab->aCol[iCol].notNull = 1;
  1076   1076         }
................................................................................
  1079   1079     }
  1080   1080     pPk = sqlite4CreateIndex(
  1081   1081        pParse, 0, 0, 0, pList, onError, 0, 0, sortOrder, 0, 1
  1082   1082     );
  1083   1083   
  1084   1084     if( iCol>=0 && iCol<pTab->nCol
  1085   1085      && (zType = pTab->aCol[iCol].zType)!=0
  1086         -   && sqlite4StrICmp(zType, "INTEGER")==0
         1086  +   && sqlite4_stricmp(zType, "INTEGER")==0
  1087   1087      && sortOrder==SQLITE4_SO_ASC
  1088   1088      && pPk
  1089   1089     ){
  1090   1090       pPk->fIndex |= IDX_IntPK;
  1091   1091       assert( autoInc==0 || autoInc==1 );
  1092   1092       pTab->tabFlags |= (-autoInc)&TF_Autoincrement;
  1093   1093     }else if( autoInc ){
................................................................................
  2043   2043         goto exit_drop_table;
  2044   2044       }
  2045   2045       if( sqlite4AuthCheck(pParse, SQLITE4_DELETE, pTab->zName, 0, zDb) ){
  2046   2046         goto exit_drop_table;
  2047   2047       }
  2048   2048     }
  2049   2049   #endif
  2050         -  if( sqlite4StrNICmp(pTab->zName, "sqlite_", 7)==0 
  2051         -    && sqlite4StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){
         2050  +  if( sqlite4_strnicmp(pTab->zName, "sqlite_", 7)==0 
         2051  +    && sqlite4_strnicmp(pTab->zName, "sqlite_stat", 11)!=0 ){
  2052   2052       sqlite4ErrorMsg(pParse, "table %s may not be dropped", pTab->zName);
  2053   2053       goto exit_drop_table;
  2054   2054     }
  2055   2055   
  2056   2056   #ifndef SQLITE4_OMIT_VIEW
  2057   2057     /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used
  2058   2058     ** on a table.
................................................................................
  2156   2156     pFKey->nCol = nCol;
  2157   2157     if( pFromCol==0 ){
  2158   2158       pFKey->aCol[0].iFrom = p->nCol-1;
  2159   2159     }else{
  2160   2160       for(i=0; i<nCol; i++){
  2161   2161         int j;
  2162   2162         for(j=0; j<p->nCol; j++){
  2163         -        if( sqlite4StrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){
         2163  +        if( sqlite4_stricmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){
  2164   2164             pFKey->aCol[i].iFrom = j;
  2165   2165             break;
  2166   2166           }
  2167   2167         }
  2168   2168         if( j>=p->nCol ){
  2169   2169           sqlite4ErrorMsg(pParse, 
  2170   2170             "unknown column \"%s\" in foreign key definition", 
................................................................................
  2359   2359     if( !pTab || db->mallocFailed ) return 0;
  2360   2360     assert( db->aDb[iDb].pSchema==pTab->pSchema );
  2361   2361     assert( pParse->nErr==0 );
  2362   2362   
  2363   2363     /* TODO: We will need to reinstate this block when sqlite_master is 
  2364   2364     ** modified to use an implicit primary key.  */
  2365   2365   #if 0
  2366         -  if( sqlite4StrNICmp(pTab->zName, "sqlite_", 7)==0 
         2366  +  if( sqlite4_strnicmp(pTab->zName, "sqlite_", 7)==0 
  2367   2367          && memcmp(&pTab->zName[7],"altertab_",9)!=0 ){
  2368   2368       sqlite4ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
  2369   2369       goto exit_create_index;
  2370   2370     }
  2371   2371   #endif
  2372   2372   
  2373   2373     /* Verify that this is not an attempt to create an index on a view or
................................................................................
  2724   2724     */
  2725   2725     for(i=0, pListItem=pList->a; i<pList->nExpr; i++, pListItem++){
  2726   2726       const char *zColName = pListItem->zName;
  2727   2727       Column *pTabCol;
  2728   2728       char *zColl;                   /* Collation sequence name */
  2729   2729   
  2730   2730       for(j=0, pTabCol=pTab->aCol; j<pTab->nCol; j++, pTabCol++){
  2731         -      if( sqlite4StrICmp(zColName, pTabCol->zName)==0 ) break;
         2731  +      if( sqlite4_stricmp(zColName, pTabCol->zName)==0 ) break;
  2732   2732       }
  2733   2733       if( j>=pTab->nCol ){
  2734   2734         sqlite4ErrorMsg(pParse, "table %s has no column named %s",
  2735   2735           pTab->zName, zColName);
  2736   2736         pParse->checkSchema = 1;
  2737   2737         goto exit_create_index;
  2738   2738       }
................................................................................
  2792   2792         if( pIdx->nColumn!=pIndex->nColumn ) continue;
  2793   2793         for(k=0; k<pIdx->nColumn; k++){
  2794   2794           const char *z1;
  2795   2795           const char *z2;
  2796   2796           if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break;
  2797   2797           z1 = pIdx->azColl[k];
  2798   2798           z2 = pIndex->azColl[k];
  2799         -        if( z1!=z2 && sqlite4StrICmp(z1, z2) ) break;
         2799  +        if( z1!=z2 && sqlite4_stricmp(z1, z2) ) break;
  2800   2800         }
  2801   2801         if( k==pIdx->nColumn ){
  2802   2802           if( pIdx->onError!=pIndex->onError ){
  2803   2803             /* This constraint creates the same index as a previous
  2804   2804             ** constraint specified somewhere in the CREATE TABLE statement.
  2805   2805             ** However the ON CONFLICT clauses are different. If both this 
  2806   2806             ** constraint and the previous equivalent constraint have explicit
................................................................................
  3088   3088   ** Return the index in pList of the identifier named zId.  Return -1
  3089   3089   ** if not found.
  3090   3090   */
  3091   3091   int sqlite4IdListIndex(IdList *pList, const char *zName){
  3092   3092     int i;
  3093   3093     if( pList==0 ) return -1;
  3094   3094     for(i=0; i<pList->nId; i++){
  3095         -    if( sqlite4StrICmp(pList->a[i].zName, zName)==0 ) return i;
         3095  +    if( sqlite4_stricmp(pList->a[i].zName, zName)==0 ) return i;
  3096   3096     }
  3097   3097     return -1;
  3098   3098   }
  3099   3099   
  3100   3100   /*
  3101   3101   ** Expand the space allocated for the given SrcList object by
  3102   3102   ** creating nExtra new slots beginning at iStart.  iStart is zero based.
................................................................................
  3511   3511   ** attached database. Otherwise, invoke it for the database named zDb only.
  3512   3512   */
  3513   3513   void sqlite4CodeVerifyNamedSchema(Parse *pParse, const char *zDb){
  3514   3514     sqlite4 *db = pParse->db;
  3515   3515     int i;
  3516   3516     for(i=0; i<db->nDb; i++){
  3517   3517       Db *pDb = &db->aDb[i];
  3518         -    if( pDb->pKV && (!zDb || 0==sqlite4StrICmp(zDb, pDb->zName)) ){
         3518  +    if( pDb->pKV && (!zDb || 0==sqlite4_stricmp(zDb, pDb->zName)) ){
  3519   3519         sqlite4CodeVerifySchema(pParse, i);
  3520   3520       }
  3521   3521     }
  3522   3522   }
  3523   3523   
  3524   3524   /*
  3525   3525   ** Generate VDBE code that prepares for doing an operation that
................................................................................
  3594   3594   #ifndef SQLITE4_OMIT_REINDEX
  3595   3595   static int collationMatch(const char *zColl, Index *pIndex){
  3596   3596     int i;
  3597   3597     assert( zColl!=0 );
  3598   3598     for(i=0; i<pIndex->nColumn; i++){
  3599   3599       const char *z = pIndex->azColl[i];
  3600   3600       assert( z!=0 );
  3601         -    if( 0==sqlite4StrICmp(z, zColl) ){
         3601  +    if( 0==sqlite4_stricmp(z, zColl) ){
  3602   3602         return 1;
  3603   3603       }
  3604   3604     }
  3605   3605     return 0;
  3606   3606   }
  3607   3607   #endif
  3608   3608   

Changes to src/callback.c.

   266    266     FuncDefTable *pFuncTab,  /* Lookup table to search */
   267    267     const char *zFunc,       /* Name of function */
   268    268     int nFunc                /* Number of bytes in zFunc */
   269    269   ){
   270    270     FuncDef *p;
   271    271     if( nFunc<0 ) nFunc = sqlite4Strlen30(zFunc);
   272    272     for(p=pFuncTab->pFirst; p; p=p->pNextName){
   273         -    if( sqlite4StrNICmp(p->zName, zFunc, nFunc)==0 && p->zName[nFunc]==0 ){
          273  +    if( sqlite4_strnicmp(p->zName, zFunc, nFunc)==0 && p->zName[nFunc]==0 ){
   274    274         return p;
   275    275       }
   276    276     }
   277    277     return 0;
   278    278   }
   279    279   
   280    280   /*
................................................................................
   295    295     assert( pDef->pSameName==0 || isBuiltIn );
   296    296     assert( pDef->pNextName==0 || isBuiltIn );
   297    297     if( pFuncTab->pFirst==0 ){
   298    298       pFuncTab->pFirst = pDef;
   299    299       pFuncTab->pLast = pDef;
   300    300       pFuncTab->pSame = pDef;
   301    301     }else if( isBuiltIn
   302         -            && sqlite4StrICmp(pDef->zName, pFuncTab->pLast->zName)==0 ){
          302  +            && sqlite4_stricmp(pDef->zName, pFuncTab->pLast->zName)==0 ){
   303    303       assert( pFuncTab->pSame->pSameName==0 || pFuncTab->pSame->pSameName==pDef );
   304    304       pFuncTab->pSame->pSameName = pDef;
   305    305       pFuncTab->pSame = pDef;
   306    306     }else if( !isBuiltIn && (pOther=functionSearch(pFuncTab,pDef->zName,-1))!=0 ){
   307    307       pDef->pSameName = pOther->pSameName;
   308    308       pOther->pSameName = pDef;
   309    309     }else{

Changes to src/complete.c.

   196    196             int nId;
   197    197             for(nId=1; IdChar(zSql[nId]); nId++){}
   198    198   #ifdef SQLITE4_OMIT_TRIGGER
   199    199             token = tkOTHER;
   200    200   #else
   201    201             switch( *zSql ){
   202    202               case 'c': case 'C': {
   203         -              if( nId==6 && sqlite4StrNICmp(zSql, "create", 6)==0 ){
          203  +              if( nId==6 && sqlite4_strnicmp(zSql, "create", 6)==0 ){
   204    204                   token = tkCREATE;
   205    205                 }else{
   206    206                   token = tkOTHER;
   207    207                 }
   208    208                 break;
   209    209               }
   210    210               case 't': case 'T': {
   211         -              if( nId==7 && sqlite4StrNICmp(zSql, "trigger", 7)==0 ){
          211  +              if( nId==7 && sqlite4_strnicmp(zSql, "trigger", 7)==0 ){
   212    212                   token = tkTRIGGER;
   213         -              }else if( nId==4 && sqlite4StrNICmp(zSql, "temp", 4)==0 ){
          213  +              }else if( nId==4 && sqlite4_strnicmp(zSql, "temp", 4)==0 ){
   214    214                   token = tkTEMP;
   215         -              }else if( nId==9 && sqlite4StrNICmp(zSql, "temporary", 9)==0 ){
          215  +              }else if( nId==9 && sqlite4_strnicmp(zSql, "temporary", 9)==0 ){
   216    216                   token = tkTEMP;
   217    217                 }else{
   218    218                   token = tkOTHER;
   219    219                 }
   220    220                 break;
   221    221               }
   222    222               case 'e':  case 'E': {
   223         -              if( nId==3 && sqlite4StrNICmp(zSql, "end", 3)==0 ){
          223  +              if( nId==3 && sqlite4_strnicmp(zSql, "end", 3)==0 ){
   224    224                   token = tkEND;
   225    225                 }else
   226    226   #ifndef SQLITE4_OMIT_EXPLAIN
   227         -              if( nId==7 && sqlite4StrNICmp(zSql, "explain", 7)==0 ){
          227  +              if( nId==7 && sqlite4_strnicmp(zSql, "explain", 7)==0 ){
   228    228                   token = tkEXPLAIN;
   229    229                 }else
   230    230   #endif
   231    231                 {
   232    232                   token = tkOTHER;
   233    233                 }
   234    234                 break;

Changes to src/ctime.c.

   342    342   ** was used and false if not.
   343    343   **
   344    344   ** The name can optionally begin with "SQLITE4_" but the "SQLITE4_" prefix
   345    345   ** is not required for a match.
   346    346   */
   347    347   int sqlite4_compileoption_used(const char *zOptName){
   348    348     int i, n;
   349         -  if( sqlite4StrNICmp(zOptName, "SQLITE4_", 8)==0 ) zOptName += 8;
          349  +  if( sqlite4_strnicmp(zOptName, "SQLITE4_", 8)==0 ) zOptName += 8;
   350    350     n = sqlite4Strlen30(zOptName);
   351    351   
   352    352     /* Since ArraySize(azCompileOpt) is normally in single digits, a
   353    353     ** linear search is adequate.  No need for a binary search. */
   354    354     for(i=0; i<ArraySize(azCompileOpt); i++){
   355         -    if(   (sqlite4StrNICmp(zOptName, azCompileOpt[i], n)==0)
          355  +    if(   (sqlite4_strnicmp(zOptName, azCompileOpt[i], n)==0)
   356    356          && ( (azCompileOpt[i][n]==0) || (azCompileOpt[i][n]=='=') ) ) return 1;
   357    357     }
   358    358     return 0;
   359    359   }
   360    360   
   361    361   /*
   362    362   ** Return the N-th compile-time option string.  If N is out of range,

Changes to src/date.c.

   324    324     DateTime *p
   325    325   ){
   326    326     double r;
   327    327     if( parseYyyyMmDd(zDate,p)==0 ){
   328    328       return 0;
   329    329     }else if( parseHhMmSs(zDate, p)==0 ){
   330    330       return 0;
   331         -  }else if( sqlite4StrICmp(zDate,"now")==0){
          331  +  }else if( sqlite4_stricmp(zDate,"now")==0){
   332    332       return setDateTimeToCurrent(context, p);
   333    333     }else if( sqlite4AtoF(zDate, &r, sqlite4Strlen30(zDate), SQLITE4_UTF8) ){
   334    334       p->iJD = (sqlite4_int64)(r*86400000.0 + 0.5);
   335    335       p->validJD = 1;
   336    336       return 0;
   337    337     }
   338    338     return 1;

Changes to src/fkey.c.

   237    237             /* If the index uses a collation sequence that is different from
   238    238             ** the default collation sequence for the column, this index is
   239    239             ** unusable. Bail out early in this case.  */
   240    240             zDfltColl = pParent->aCol[iCol].zColl;
   241    241             if( !zDfltColl ){
   242    242               zDfltColl = "BINARY";
   243    243             }
   244         -          if( sqlite4StrICmp(pIdx->azColl[i], zDfltColl) ) break;
          244  +          if( sqlite4_stricmp(pIdx->azColl[i], zDfltColl) ) break;
   245    245   
   246    246             zIdxCol = pParent->aCol[iCol].zName;
   247    247             for(j=0; j<nCol; j++){
   248         -            if( sqlite4StrICmp(pFKey->aCol[j].zCol, zIdxCol)==0 ){
          248  +            if( sqlite4_stricmp(pFKey->aCol[j].zCol, zIdxCol)==0 ){
   249    249                 if( aiCol ) aiCol[i] = pFKey->aCol[j].iFrom;
   250    250                 break;
   251    251               }
   252    252             }
   253    253             if( j==nCol ) break;
   254    254           }
   255    255           if( i==nCol ) break;      /* pIdx is usable */
................................................................................
   864    864         /* Check if any parent key columns are being modified. */
   865    865         for(p=sqlite4FkReferences(pTab); p; p=p->pNextTo){
   866    866           for(i=0; i<p->nCol; i++){
   867    867             char *zKey = p->aCol[i].zCol;
   868    868             int iKey;
   869    869             for(iKey=0; iKey<pTab->nCol; iKey++){
   870    870               Column *pCol = &pTab->aCol[iKey];
   871         -            if( (zKey ? !sqlite4StrICmp(pCol->zName, zKey) : pCol->isPrimKey) ){
          871  +            if( (zKey ? !sqlite4_stricmp(pCol->zName, zKey) : pCol->isPrimKey) ){
   872    872                 if( aChange[iKey]>=0 ) return 1;
   873    873               }
   874    874             }
   875    875           }
   876    876         }
   877    877       }
   878    878     }

Changes to src/fts5.c.

   716    716       }
   717    717       pPhrase->iCol = -1;
   718    718   
   719    719       /* Check if this first primitive is a column name or not. */
   720    720       if( pParse->next.eType==TOKEN_COLON ){
   721    721         int iCol;
   722    722         for(iCol=0; iCol<pParse->nCol; iCol++){
   723         -        if( sqlite4StrNICmp(pParse->azCol[iCol], t.z, t.n)==0 ) break;
          723  +        if( sqlite4_strnicmp(pParse->azCol[iCol], t.z, t.n)==0 ) break;
   724    724         }
   725    725         if( iCol==pParse->nCol ){
   726    726           pParse->zErr = sqlite4MPrintf(pParse->db, 
   727    727               "fts5: no such column: %.*s", t.n, t.z
   728    728           );
   729    729           rc = SQLITE4_ERROR;
   730    730           goto token_or_phrase_out;
................................................................................
  1032   1032   /*
  1033   1033   ** Search for the Fts5Tokenizer object named zName. Return a pointer to it
  1034   1034   ** if it exists, or NULL otherwise.
  1035   1035   */
  1036   1036   static Fts5Tokenizer *fts5FindTokenizer(sqlite4 *db, const char *zName){
  1037   1037     Fts5Tokenizer *p;
  1038   1038     for(p=db->pTokenizer; p; p=p->pNext){
  1039         -    if( 0==sqlite4StrICmp(zName, p->zName) ) break;
         1039  +    if( 0==sqlite4_stricmp(zName, p->zName) ) break;
  1040   1040     }
  1041   1041     return p;
  1042   1042   }
  1043   1043   
  1044   1044   static void fts5TokenizerCreate(
  1045   1045     Parse *pParse, 
  1046   1046     Fts5Index *pFts, 
................................................................................
  1147   1147   
  1148   1148     if( pArgs ){
  1149   1149       int i;
  1150   1150       for(i=0; pParse->nErr==0 && i<pArgs->nExpr; i++){
  1151   1151         char *zArg = pArgs->a[i].zName;
  1152   1152         char *zVal = pArgs->a[i].pExpr->u.zToken;
  1153   1153   
  1154         -      if( zArg && sqlite4StrICmp(zArg, "tokenizer")==0 ){
         1154  +      if( zArg && sqlite4_stricmp(zArg, "tokenizer")==0 ){
  1155   1155           /* zVal is the name of the tokenizer to use. Any subsequent arguments
  1156   1156            ** that do not contain assignment operators (=) are also passed to
  1157   1157            ** the tokenizer. Figure out how many bytes of space are required for
  1158   1158            ** all.  */
  1159   1159           int j;
  1160   1160           char *pSpace;
  1161   1161           int nByte = sqlite4Strlen30(zVal) + 1;

Changes to src/hash.c.

    25     25       h = (h<<3) ^ h ^ sqlite4UpperToLower[(unsigned char)*z++];
    26     26       nKey--;
    27     27     }
    28     28     return h;
    29     29   }
    30     30   
    31     31   static int strCmp(const char *z1, const char *z2, int n){
    32         -  return sqlite4StrNICmp(z1, z2, n);
           32  +  return sqlite4_strnicmp(z1, z2, n);
    33     33   }
    34     34   
    35     35   static unsigned int binHash(const char *z, int nKey){
    36     36     int h = 0;
    37     37     assert( nKey>=0 );
    38     38     while( nKey > 0  ){
    39     39       h = (h<<3) ^ h ^ ((unsigned char)*z++);

Changes to src/insert.c.

   779    779     if( pColumn ){
   780    780       for(i=0; i<pColumn->nId; i++){
   781    781         pColumn->a[i].idx = -1;
   782    782       }
   783    783       for(i=0; i<pColumn->nId; i++){
   784    784         char *zTest = pColumn->a[i].zName;
   785    785         for(j=0; j<pTab->nCol; j++){
   786         -        if( sqlite4StrICmp(zTest, pTab->aCol[j].zName)==0 ){
          786  +        if( sqlite4_stricmp(zTest, pTab->aCol[j].zName)==0 ){
   787    787             pColumn->a[i].idx = j;
   788    788             break;
   789    789           }
   790    790         }
   791    791         if( j==pTab->nCol ){
   792    792           sqlite4ErrorMsg(pParse, "table %S has no column named %s",
   793    793                 pTabList, 0, pColumn->a[i].zName);
................................................................................
  1535   1535   static int xferCompatibleCollation(const char *z1, const char *z2){
  1536   1536     if( z1==0 ){
  1537   1537       return z2==0;
  1538   1538     }
  1539   1539     if( z2==0 ){
  1540   1540       return 0;
  1541   1541     }
  1542         -  return sqlite4StrICmp(z1, z2)==0;
         1542  +  return sqlite4_stricmp(z1, z2)==0;
  1543   1543   }
  1544   1544   
  1545   1545   
  1546   1546   /*
  1547   1547   ** Check to see if index pSrc is compatible as a source of data
  1548   1548   ** for index pDest in an insert transfer optimization.  The rules
  1549   1549   ** for a compatible index:

Changes to src/main.c.

  2010   2010     int i;
  2011   2011   
  2012   2012     sqlite4_mutex_enter(db->mutex);
  2013   2013   
  2014   2014     /* Find the named key-value store */
  2015   2015     for(i=0; i<db->nDb; i++){
  2016   2016       Db *pDb = &db->aDb[i];
  2017         -    if( pDb->pKV && (0==zDbName || 0==sqlite4StrICmp(zDbName, pDb->zName)) ){
         2017  +    if( pDb->pKV && (0==zDbName || 0==sqlite4_stricmp(zDbName, pDb->zName)) ){
  2018   2018         pKV = pDb->pKV;
  2019   2019         break;
  2020   2020       }
  2021   2021     }
  2022   2022   
  2023   2023     /* If the named key-value store was located, invoke its xControl() method. */
  2024   2024     if( pKV ){

Changes to src/pragma.c.

    24     24     static const u8 iValue[] =  {1, 0, 0, 0, 1, 1};
    25     25     int i, n;
    26     26     if( sqlite4Isdigit(*z) ){
    27     27       return (u8)sqlite4Atoi(z);
    28     28     }
    29     29     n = sqlite4Strlen30(z);
    30     30     for(i=0; i<ArraySize(iLength); i++){
    31         -    if( iLength[i]==n && sqlite4StrNICmp(&zText[iOffset[i]],z,n)==0 ){
           31  +    if( iLength[i]==n && sqlite4_strnicmp(&zText[iOffset[i]],z,n)==0 ){
    32     32         return iValue[i];
    33     33       }
    34     34     }
    35     35     return 1;
    36     36   }
    37     37   
    38     38   /* The sqlite4GetBoolean() function is used by other modules but the
................................................................................
    89     89   #if !defined(SQLITE4_OMIT_FOREIGN_KEY) && !defined(SQLITE4_OMIT_TRIGGER)
    90     90       { "foreign_keys",             SQLITE4_ForeignKeys },
    91     91   #endif
    92     92     };
    93     93     int i, j;
    94     94     const struct sPragmaType *p;
    95     95     for(i=0, p=aPragma; i<ArraySize(aPragma); i++, p++){
    96         -    if( sqlite4StrICmp(zLeft, p->zName)==0 ){
           96  +    if( sqlite4_stricmp(zLeft, p->zName)==0 ){
    97     97         sqlite4 *db = pParse->db;
    98     98         Vdbe *v;
    99     99         v = sqlite4GetVdbe(pParse);
   100    100         assert( v!=0 );  /* Already allocated by sqlite4Pragma() */
   101    101         if( ALWAYS(v) ){
   102    102           if( zRight==0 ){
   103    103             returnSingleInt(pParse, p->zName, (db->flags & p->mask)!=0 );
................................................................................
   220    220   #ifndef SQLITE4_OMIT_FLAG_PRAGMAS
   221    221     if( flagPragma(pParse, zLeft, zRight) ){
   222    222       /* The flagPragma() subroutine also generates any necessary code
   223    223       ** there is nothing more to do here */
   224    224     }else
   225    225   #endif /* SQLITE4_OMIT_FLAG_PRAGMAS */
   226    226   
   227         -  if( sqlite4StrICmp(zLeft, "lsm_flush")==0 ){
          227  +  if( sqlite4_stricmp(zLeft, "lsm_flush")==0 ){
   228    228       sqlite4_kvstore_control(db, zDb, SQLITE4_KVCTRL_LSM_FLUSH, 0);
   229    229     }else
   230    230   
   231         -  if( sqlite4StrICmp(zLeft, "lsm_checkpoint")==0 ){
          231  +  if( sqlite4_stricmp(zLeft, "lsm_checkpoint")==0 ){
   232    232       sqlite4_kvstore_control(db, zDb, SQLITE4_KVCTRL_LSM_CHECKPOINT, 0);
   233    233     }else
   234    234   
   235         -  if( sqlite4StrICmp(zLeft, "lsm_merge")==0 ){
          235  +  if( sqlite4_stricmp(zLeft, "lsm_merge")==0 ){
   236    236       int nPage = zRight ? sqlite4Atoi(zRight) : 1000;
   237    237       sqlite4_kvstore_control(db, zDb, SQLITE4_KVCTRL_LSM_MERGE, &nPage);
   238    238       returnSingleInt(pParse, "nWrite", (sqlite4_int64)nPage);
   239    239     }else
   240    240   
   241    241     /*
   242    242     **   PRAGMA fts_check(<index>)
   243    243     */
   244         -  if( sqlite4StrICmp(zLeft, "fts_check")==0 && zRight ){
          244  +  if( sqlite4_stricmp(zLeft, "fts_check")==0 && zRight ){
   245    245       int iCksum1;
   246    246       int iCksum2;
   247    247       Index *pIdx;
   248    248       Table *pTab;
   249    249       Vdbe *v = sqlite4GetVdbe(pParse);
   250    250       if( v==0 || sqlite4ReadSchema(pParse) ) goto pragma_out;
   251    251   
................................................................................
   313    313     **
   314    314     ** cid:        Column id (numbered from left to right, starting at 0)
   315    315     ** name:       Column name
   316    316     ** type:       Column declaration type.
   317    317     ** notnull:    True if 'NOT NULL' is part of column declaration
   318    318     ** dflt_value: The default value for the column, if any.
   319    319     */
   320         -  if( sqlite4StrICmp(zLeft, "table_info")==0 && zRight ){
          320  +  if( sqlite4_stricmp(zLeft, "table_info")==0 && zRight ){
   321    321       Table *pTab;
   322    322       if( sqlite4ReadSchema(pParse) ) goto pragma_out;
   323    323       pTab = sqlite4FindTable(db, zRight, zDb);
   324    324       if( pTab ){
   325    325         int i;
   326    326         int nHidden = 0;
   327    327         Column *pCol;
................................................................................
   351    351           }
   352    352           sqlite4VdbeAddOp2(v, OP_Integer, pCol->isPrimKey, 6);
   353    353           sqlite4VdbeAddOp2(v, OP_ResultRow, 1, 6);
   354    354         }
   355    355       }
   356    356     }else
   357    357   
   358         -  if( sqlite4StrICmp(zLeft, "index_info")==0 && zRight ){
          358  +  if( sqlite4_stricmp(zLeft, "index_info")==0 && zRight ){
   359    359       Index *pIdx;
   360    360       Table *pTab;
   361    361       if( sqlite4ReadSchema(pParse) ) goto pragma_out;
   362    362       pIdx = sqlite4FindIndex(db, zRight, zDb);
   363    363       if( pIdx ){
   364    364         int i;
   365    365         pTab = pIdx->pTable;
................................................................................
   375    375           assert( pTab->nCol>cnum );
   376    376           sqlite4VdbeAddOp4(v, OP_String8, 0, 3, 0, pTab->aCol[cnum].zName, 0);
   377    377           sqlite4VdbeAddOp2(v, OP_ResultRow, 1, 3);
   378    378         }
   379    379       }
   380    380     }else
   381    381   
   382         -  if( sqlite4StrICmp(zLeft, "index_list")==0 && zRight ){
          382  +  if( sqlite4_stricmp(zLeft, "index_list")==0 && zRight ){
   383    383       Index *pIdx;
   384    384       Table *pTab;
   385    385       if( sqlite4ReadSchema(pParse) ) goto pragma_out;
   386    386       pTab = sqlite4FindTable(db, zRight, zDb);
   387    387       if( pTab ){
   388    388         v = sqlite4GetVdbe(pParse);
   389    389         pIdx = pTab->pIndex;
................................................................................
   402    402             ++i;
   403    403             pIdx = pIdx->pNext;
   404    404           }
   405    405         }
   406    406       }
   407    407     }else
   408    408   
   409         -  if( sqlite4StrICmp(zLeft, "database_list")==0 ){
          409  +  if( sqlite4_stricmp(zLeft, "database_list")==0 ){
   410    410       int i;
   411    411       if( sqlite4ReadSchema(pParse) ) goto pragma_out;
   412    412       sqlite4VdbeSetNumCols(v, 3);
   413    413       pParse->nMem = 3;
   414    414       sqlite4VdbeSetColName(v, 0, COLNAME_NAME, "seq", SQLITE4_STATIC);
   415    415       sqlite4VdbeSetColName(v, 1, COLNAME_NAME, "name", SQLITE4_STATIC);
   416    416       sqlite4VdbeSetColName(v, 2, COLNAME_NAME, "file", SQLITE4_STATIC);
................................................................................
   421    421         sqlite4VdbeAddOp4(v, OP_String8, 0, 2, 0, db->aDb[i].zName, 0);
   422    422         sqlite4VdbeAddOp4(v, OP_String8, 0, 3, 0,
   423    423                              "filename", 0);
   424    424         sqlite4VdbeAddOp2(v, OP_ResultRow, 1, 3);
   425    425       }
   426    426     }else
   427    427   
   428         -  if( sqlite4StrICmp(zLeft, "collation_list")==0 ){
          428  +  if( sqlite4_stricmp(zLeft, "collation_list")==0 ){
   429    429       int i = 0;
   430    430       HashElem *p;
   431    431       sqlite4VdbeSetNumCols(v, 2);
   432    432       pParse->nMem = 2;
   433    433       sqlite4VdbeSetColName(v, 0, COLNAME_NAME, "seq", SQLITE4_STATIC);
   434    434       sqlite4VdbeSetColName(v, 1, COLNAME_NAME, "name", SQLITE4_STATIC);
   435    435       for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){
................................................................................
   438    438         sqlite4VdbeAddOp4(v, OP_String8, 0, 2, 0, pColl->zName, 0);
   439    439         sqlite4VdbeAddOp2(v, OP_ResultRow, 1, 2);
   440    440       }
   441    441     }else
   442    442   #endif /* SQLITE4_OMIT_SCHEMA_PRAGMAS */
   443    443   
   444    444   #ifndef SQLITE4_OMIT_FOREIGN_KEY
   445         -  if( sqlite4StrICmp(zLeft, "foreign_key_list")==0 && zRight ){
          445  +  if( sqlite4_stricmp(zLeft, "foreign_key_list")==0 && zRight ){
   446    446       FKey *pFK;
   447    447       Table *pTab;
   448    448       if( sqlite4ReadSchema(pParse) ) goto pragma_out;
   449    449       pTab = sqlite4FindTable(db, zRight, zDb);
   450    450       if( pTab ){
   451    451         v = sqlite4GetVdbe(pParse);
   452    452         pFK = pTab->pFKey;
................................................................................
   484    484           }
   485    485         }
   486    486       }
   487    487     }else
   488    488   #endif /* !defined(SQLITE4_OMIT_FOREIGN_KEY) */
   489    489   
   490    490   #ifndef NDEBUG
   491         -  if( sqlite4StrICmp(zLeft, "parser_trace")==0 ){
          491  +  if( sqlite4_stricmp(zLeft, "parser_trace")==0 ){
   492    492       if( zRight ){
   493    493         if( sqlite4GetBoolean(zRight) ){
   494    494           sqlite4ParserTrace(stderr, "parser: ");
   495    495         }else{
   496    496           sqlite4ParserTrace(0, 0);
   497    497         }
   498    498       }
   499    499     }else
   500    500   #endif
   501    501   
   502    502     /* Reinstall the LIKE and GLOB functions.  The variant of LIKE
   503    503     ** used will be case sensitive or not depending on the RHS.
   504    504     */
   505         -  if( sqlite4StrICmp(zLeft, "case_sensitive_like")==0 ){
          505  +  if( sqlite4_stricmp(zLeft, "case_sensitive_like")==0 ){
   506    506       if( zRight ){
   507    507         sqlite4RegisterLikeFunctions(db, sqlite4GetBoolean(zRight));
   508    508       }
   509    509     }else
   510    510   
   511    511   #ifndef SQLITE4_INTEGRITY_CHECK_ERROR_MAX
   512    512   # define SQLITE4_INTEGRITY_CHECK_ERROR_MAX 100
................................................................................
   532    532     ** the main database has not been initialized and/or created when ATTACH
   533    533     ** is executed, this is done before the ATTACH operation.
   534    534     **
   535    535     ** In the second form this pragma sets the text encoding to be used in
   536    536     ** new database files created using this database handle. It is only
   537    537     ** useful if invoked immediately after the main database i
   538    538     */
   539         -  if( sqlite4StrICmp(zLeft, "encoding")==0 ){
          539  +  if( sqlite4_stricmp(zLeft, "encoding")==0 ){
   540    540       static const struct EncName {
   541    541         char *zName;
   542    542         u8 enc;
   543    543       } encnames[] = {
   544    544         { "UTF8",     SQLITE4_UTF8        },
   545    545         { "UTF-8",    SQLITE4_UTF8        },  /* Must be element [1] */
   546    546         { "UTF-16le", SQLITE4_UTF16LE     },  /* Must be element [2] */
................................................................................
   569    569         ** already exists, it will be created to use the new encoding value.
   570    570         */
   571    571         if( 
   572    572           !(DbHasProperty(db, 0, DB_SchemaLoaded)) || 
   573    573           DbHasProperty(db, 0, DB_Empty) 
   574    574         ){
   575    575           for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
   576         -          if( 0==sqlite4StrICmp(zRight, pEnc->zName) ){
          576  +          if( 0==sqlite4_stricmp(zRight, pEnc->zName) ){
   577    577               ENC(pParse->db) = pEnc->enc ? pEnc->enc : SQLITE4_UTF16NATIVE;
   578    578               break;
   579    579             }
   580    580           }
   581    581           if( !pEnc->zName ){
   582    582             sqlite4ErrorMsg(pParse, "unsupported encoding: %s", zRight);
   583    583           }
................................................................................
   590    590   #ifndef SQLITE4_OMIT_COMPILEOPTION_DIAGS
   591    591     /*
   592    592     **   PRAGMA compile_options
   593    593     **
   594    594     ** Return the names of all compile-time options used in this build,
   595    595     ** one option per row.
   596    596     */
   597         -  if( sqlite4StrICmp(zLeft, "compile_options")==0 ){
          597  +  if( sqlite4_stricmp(zLeft, "compile_options")==0 ){
   598    598       int i = 0;
   599    599       const char *zOpt;
   600    600       sqlite4VdbeSetNumCols(v, 1);
   601    601       pParse->nMem = 1;
   602    602       sqlite4VdbeSetColName(v, 0, COLNAME_NAME, "compile_option", SQLITE4_STATIC);
   603    603       while( (zOpt = sqlite4_compileoption_get(i++))!=0 ){
   604    604         sqlite4VdbeAddOp4(v, OP_String8, 0, 1, 0, zOpt, 0);
................................................................................
   609    609   
   610    610   #ifdef SQLITE4_DEBUG
   611    611     /*
   612    612     **   PRAGMA kvdump
   613    613     **
   614    614     ** Print an ascii rendering of the complete content of the database file.
   615    615     */
   616         -  if( sqlite4StrICmp(zLeft, "kvdump")==0 ){
          616  +  if( sqlite4_stricmp(zLeft, "kvdump")==0 ){
   617    617       sqlite4KVStoreDump(db->aDb[0].pKV);
   618    618     }else
   619    619   #endif /* SQLITE4_OMIT_COMPILEOPTION_DIAGS */
   620    620     /*
   621    621     **   PRAGMA integrity_check
   622    622     **
   623    623     ** Check that for each table, the content of any auxilliary indexes are 
   624    624     ** consistent with the primary key index.
   625    625     */
   626         -  if( sqlite4StrICmp(zLeft, "integrity_check")==0 ){
          626  +  if( sqlite4_stricmp(zLeft, "integrity_check")==0 ){
   627    627       const int baseCsr = 1;        /* Base cursor for OpenAllIndexes() call */
   628    628   
   629    629       const int regErrcnt = 1;      /* Register containing error count */
   630    630       const int regErrstr = 2;      /* Register containing error string */
   631    631       const int regTmp = 3;         /* Register for tmp use */
   632    632       const int regRowcnt1 = 4;     /* Register containing row count (from PK) */
   633    633       const int regRowcnt2 = 5;     /* Register containing error count */
................................................................................
   781    781   
   782    782     /*
   783    783     **  PRAGMA shrink_memory
   784    784     **
   785    785     ** This pragma attempts to free as much memory as possible from the
   786    786     ** current database connection.
   787    787     */
   788         -  if( sqlite4StrICmp(zLeft, "shrink_memory")==0 ){
          788  +  if( sqlite4_stricmp(zLeft, "shrink_memory")==0 ){
   789    789       sqlite4_db_release_memory(db);
   790    790     }else
   791    791   
   792    792    
   793    793     {/* Empty ELSE clause */}
   794    794   pragma_out:
   795    795     sqlite4DbFree(db, zLeft);
   796    796     sqlite4DbFree(db, zRight);
   797    797   }
   798    798   
   799    799   #endif /* SQLITE4_OMIT_PRAGMA */

Changes to src/resolve.c.

   105    105   ** Return FALSE if the USING clause is NULL or if it does not contain
   106    106   ** zCol.
   107    107   */
   108    108   static int nameInUsingClause(IdList *pUsing, const char *zCol){
   109    109     if( pUsing ){
   110    110       int k;
   111    111       for(k=0; k<pUsing->nId; k++){
   112         -      if( sqlite4StrICmp(pUsing->a[k].zName, zCol)==0 ) return 1;
          112  +      if( sqlite4_stricmp(pUsing->a[k].zName, zCol)==0 ) return 1;
   113    113       }
   114    114     }
   115    115     return 0;
   116    116   }
   117    117   
   118    118   /*
   119    119   ** Return true if table pTab has an implicit primary key, and zCol points
   120    120   ** to a column name that resolves to the implicit primary key (i.e. "rowid").
   121    121   */
   122    122   int isRowidReference(Table *pTab, const char *zCol){
   123    123     int ret = 0;
   124         -  if( 0==sqlite4StrICmp(zCol, "ROWID") ){
          124  +  if( 0==sqlite4_stricmp(zCol, "ROWID") ){
   125    125       /* If the call to FindPrimaryKey() returns NULL, then pTab must be a
   126    126       ** sub-select or a view. Neither of these have an IPK.  */
   127    127       Index *pPk = sqlite4FindPrimaryKey(pTab, 0);
   128    128       if( pPk && pPk->aiColumn[0]==-1 ) ret = 1;
   129    129     }
   130    130     return ret;
   131    131   }
................................................................................
   198    198           pTab = pItem->pTab;
   199    199           assert( pTab!=0 && pTab->zName!=0 );
   200    200           iDb = sqlite4SchemaToIndex(db, pTab->pSchema);
   201    201           assert( pTab->nCol>0 );
   202    202           if( zTab ){
   203    203             if( pItem->zAlias ){
   204    204               char *zTabName = pItem->zAlias;
   205         -            if( sqlite4StrICmp(zTabName, zTab)!=0 ) continue;
          205  +            if( sqlite4_stricmp(zTabName, zTab)!=0 ) continue;
   206    206             }else{
   207    207               char *zTabName = pTab->zName;
   208         -            if( NEVER(zTabName==0) || sqlite4StrICmp(zTabName, zTab)!=0 ){
          208  +            if( NEVER(zTabName==0) || sqlite4_stricmp(zTabName, zTab)!=0 ){
   209    209                 continue;
   210    210               }
   211         -            if( zDb!=0 && sqlite4StrICmp(db->aDb[iDb].zName, zDb)!=0 ){
          211  +            if( zDb!=0 && sqlite4_stricmp(db->aDb[iDb].zName, zDb)!=0 ){
   212    212                 continue;
   213    213               }
   214    214             }
   215    215           }
   216    216           if( 0==(cntTab++) ){
   217    217             pExpr->iTable = pItem->iCursor;
   218    218             pExpr->pTab = pTab;
   219    219             pSchema = pTab->pSchema;
   220    220             pMatch = pItem;
   221    221           }
   222    222           for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){
   223         -          if( sqlite4StrICmp(pCol->zName, zCol)==0 ){
          223  +          if( sqlite4_stricmp(pCol->zName, zCol)==0 ){
   224    224               /* If there has been exactly one prior match and this match
   225    225               ** is for the right-hand table of a NATURAL JOIN or is in a 
   226    226               ** USING clause, then skip this match.
   227    227               */
   228    228               if( cnt==1 ){
   229    229                 if( pItem->jointype & JT_NATURAL ) continue;
   230    230                 if( nameInUsingClause(pItem->pUsing, zCol) ) continue;
................................................................................
   245    245       /* If we have not already resolved the name, then maybe 
   246    246       ** it is a new.* or old.* trigger argument reference
   247    247       */
   248    248       if( zDb==0 && zTab!=0 && cnt==0 && pParse->pTriggerTab!=0 ){
   249    249         int op = pParse->eTriggerOp;
   250    250         Table *pTab = 0;
   251    251         assert( op==TK_DELETE || op==TK_UPDATE || op==TK_INSERT );
   252         -      if( op!=TK_DELETE && sqlite4StrICmp("new",zTab) == 0 ){
          252  +      if( op!=TK_DELETE && sqlite4_stricmp("new",zTab) == 0 ){
   253    253           pExpr->iTable = 1;
   254    254           pTab = pParse->pTriggerTab;
   255         -      }else if( op!=TK_INSERT && sqlite4StrICmp("old",zTab)==0 ){
          255  +      }else if( op!=TK_INSERT && sqlite4_stricmp("old",zTab)==0 ){
   256    256           pExpr->iTable = 0;
   257    257           pTab = pParse->pTriggerTab;
   258    258         }
   259    259   
   260    260         if( pTab ){ 
   261    261           int iCol;
   262    262           pSchema = pTab->pSchema;
   263    263           cntTab++;
   264    264           for(iCol=0; iCol<pTab->nCol; iCol++){
   265    265             Column *pCol = &pTab->aCol[iCol];
   266         -          if( sqlite4StrICmp(pCol->zName, zCol)==0 ){
          266  +          if( sqlite4_stricmp(pCol->zName, zCol)==0 ){
   267    267               break;
   268    268             }
   269    269           }
   270    270           if( iCol>=pTab->nCol && isRowidReference(pTab, zCol) ){
   271    271             iCol = -1;        /* IMP: R-44911-55124 */
   272    272           }
   273    273           if( iCol<pTab->nCol ){
................................................................................
   311    311       ** forms the result set entry ("a+b" in the example) and return immediately.
   312    312       ** Note that the expression in the result set should have already been
   313    313       ** resolved by the time the WHERE clause is resolved.
   314    314       */
   315    315       if( cnt==0 && (pEList = pNC->pEList)!=0 && zTab==0 ){
   316    316         for(j=0; j<pEList->nExpr; j++){
   317    317           char *zAs = pEList->a[j].zName;
   318         -        if( zAs!=0 && sqlite4StrICmp(zAs, zCol)==0 ){
          318  +        if( zAs!=0 && sqlite4_stricmp(zAs, zCol)==0 ){
   319    319             Expr *pOrig;
   320    320             assert( pExpr->pLeft==0 && pExpr->pRight==0 );
   321    321             assert( pExpr->x.pList==0 );
   322    322             assert( pExpr->x.pSelect==0 );
   323    323             pOrig = pEList->a[j].pExpr;
   324    324             if( !pNC->allowAgg && ExprHasProperty(pOrig, EP_Agg) ){
   325    325               sqlite4ErrorMsg(pParse, "misuse of aliased aggregate %s", zAs);
................................................................................
   447    447       sqlite4ErrorMsg(pParse, "first argument xxx must be a table name");
   448    448       return;
   449    449     }
   450    450     zLhs = pExpr->u.zToken;
   451    451   
   452    452     for(i=0; i<pSrc->nSrc; i++){
   453    453       pItem = &pSrc->a[i];
   454         -    if( pItem->zAlias && sqlite4StrICmp(zLhs, pItem->zAlias)==0 ) break;
   455         -    if( pItem->zAlias==0 && sqlite4StrICmp(zLhs, pItem->zName)==0 ) break;
          454  +    if( pItem->zAlias && sqlite4_stricmp(zLhs, pItem->zAlias)==0 ) break;
          455  +    if( pItem->zAlias==0 && sqlite4_stricmp(zLhs, pItem->zName)==0 ) break;
   456    456     }
   457    457     if( i==pSrc->nSrc ){
   458    458       sqlite4ErrorMsg(pParse, "no such table: %s", zLhs);
   459    459       return;
   460    460     }
   461    461   
   462    462     pExpr->op = TK_NULL;
................................................................................
   476    476       sqlite4ErrorMsg(pParse, "lhs of MATCH operator must be a table name");
   477    477       return;
   478    478     }
   479    479     zLhs = pLeft->u.zToken;
   480    480   
   481    481     for(i=0; i<pSrc->nSrc; i++){
   482    482       pItem = &pSrc->a[i];
   483         -    if( pItem->zAlias && sqlite4StrICmp(zLhs, pItem->zAlias)==0 ) break;
   484         -    if( pItem->zAlias==0 && sqlite4StrICmp(zLhs, pItem->zName)==0 ) break;
          483  +    if( pItem->zAlias && sqlite4_stricmp(zLhs, pItem->zAlias)==0 ) break;
          484  +    if( pItem->zAlias==0 && sqlite4_stricmp(zLhs, pItem->zName)==0 ) break;
   485    485     }
   486    486   
   487    487     if( i==pSrc->nSrc ){
   488    488       sqlite4ErrorMsg(pParse, "no such table: %s", zLhs);
   489    489       return;
   490    490     }
   491    491   
................................................................................
   717    717   
   718    718     UNUSED_PARAMETER(pParse);
   719    719   
   720    720     if( pE->op==TK_ID ){
   721    721       char *zCol = pE->u.zToken;
   722    722       for(i=0; i<pEList->nExpr; i++){
   723    723         char *zAs = pEList->a[i].zName;
   724         -      if( zAs!=0 && sqlite4StrICmp(zAs, zCol)==0 ){
          724  +      if( zAs!=0 && sqlite4_stricmp(zAs, zCol)==0 ){
   725    725           return i+1;
   726    726         }
   727    727       }
   728    728     }
   729    729     return 0;
   730    730   }
   731    731   

Changes to src/select.c.

   148    148     apAll[0] = pA;
   149    149     apAll[1] = pB;
   150    150     apAll[2] = pC;
   151    151     for(i=0; i<3 && apAll[i]; i++){
   152    152       p = apAll[i];
   153    153       for(j=0; j<ArraySize(aKeyword); j++){
   154    154         if( p->n==aKeyword[j].nChar 
   155         -          && sqlite4StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){
          155  +          && sqlite4_strnicmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){
   156    156           jointype |= aKeyword[j].code;
   157    157           break;
   158    158         }
   159    159       }
   160    160       testcase( j==0 || j==1 || j==2 || j==3 || j==4 || j==5 || j==6 );
   161    161       if( j>=ArraySize(aKeyword) ){
   162    162         jointype |= JT_ERROR;
................................................................................
   185    185   /*
   186    186   ** Return the index of a column in a table.  Return -1 if the column
   187    187   ** is not contained in the table.
   188    188   */
   189    189   static int columnIndex(Table *pTab, const char *zCol){
   190    190     int i;
   191    191     for(i=0; i<pTab->nCol; i++){
   192         -    if( sqlite4StrICmp(pTab->aCol[i].zName, zCol)==0 ) return i;
          192  +    if( sqlite4_stricmp(pTab->aCol[i].zName, zCol)==0 ) return i;
   193    193     }
   194    194     return -1;
   195    195   }
   196    196   
   197    197   /*
   198    198   ** Search the first N tables in pSrc, from left to right, looking for a
   199    199   ** table that has a column named zCol.  
................................................................................
  1321   1321       }
  1322   1322   
  1323   1323       /* Make sure the column name is unique.  If the name is not unique,
  1324   1324       ** append a integer to the name so that it becomes unique.
  1325   1325       */
  1326   1326       nName = sqlite4Strlen30(zName);
  1327   1327       for(j=cnt=0; j<i; j++){
  1328         -      if( sqlite4StrICmp(aCol[j].zName, zName)==0 ){
         1328  +      if( sqlite4_stricmp(aCol[j].zName, zName)==0 ){
  1329   1329           char *zNewName;
  1330   1330           zName[nName] = 0;
  1331   1331           zNewName = sqlite4MPrintf(db, "%s:%d", zName, ++cnt);
  1332   1332           sqlite4DbFree(db, zName);
  1333   1333           zName = zNewName;
  1334   1334           j = -1;
  1335   1335           if( zName==0 ) break;
................................................................................
  3119   3119     pExpr = pEList->a[0].pExpr;
  3120   3120     if( pExpr->op!=TK_AGG_FUNCTION ) return 0;
  3121   3121     if( NEVER(ExprHasProperty(pExpr, EP_xIsSelect)) ) return 0;
  3122   3122     pEList = pExpr->x.pList;
  3123   3123     if( pEList==0 || pEList->nExpr!=1 ) return 0;
  3124   3124     if( pEList->a[0].pExpr->op!=TK_AGG_COLUMN ) return WHERE_ORDERBY_NORMAL;
  3125   3125     assert( !ExprHasProperty(pExpr, EP_IntValue) );
  3126         -  if( sqlite4StrICmp(pExpr->u.zToken,"min")==0 ){
         3126  +  if( sqlite4_stricmp(pExpr->u.zToken,"min")==0 ){
  3127   3127       return WHERE_ORDERBY_MIN;
  3128         -  }else if( sqlite4StrICmp(pExpr->u.zToken,"max")==0 ){
         3128  +  }else if( sqlite4_stricmp(pExpr->u.zToken,"max")==0 ){
  3129   3129       return WHERE_ORDERBY_MAX;
  3130   3130     }
  3131   3131     return WHERE_ORDERBY_NORMAL;
  3132   3132   }
  3133   3133   
  3134   3134   /*
  3135   3135   ** If the source-list item passed as an argument was augmented with an
................................................................................
  3140   3140   */
  3141   3141   int sqlite4IndexedByLookup(Parse *pParse, SrcListItem *pFrom){
  3142   3142     if( pFrom->pTab && pFrom->zIndex ){
  3143   3143       Table *pTab = pFrom->pTab;
  3144   3144       char *zIndex = pFrom->zIndex;
  3145   3145       Index *pIdx;
  3146   3146       for(pIdx=pTab->pIndex; 
  3147         -        pIdx && sqlite4StrICmp(pIdx->zName, zIndex); 
         3147  +        pIdx && sqlite4_stricmp(pIdx->zName, zIndex); 
  3148   3148           pIdx=pIdx->pNext
  3149   3149       );
  3150   3150       if( !pIdx ){
  3151   3151         sqlite4ErrorMsg(pParse, "no such index: %s", zIndex, 0);
  3152   3152         pParse->checkSchema = 1;
  3153   3153         return SQLITE4_ERROR;
  3154   3154       }
................................................................................
  3317   3317           for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
  3318   3318             Table *pTab = pFrom->pTab;
  3319   3319             char *zTabName = pFrom->zAlias;
  3320   3320             if( zTabName==0 ){
  3321   3321               zTabName = pTab->zName;
  3322   3322             }
  3323   3323             if( db->mallocFailed ) break;
  3324         -          if( zTName && sqlite4StrICmp(zTName, zTabName)!=0 ){
         3324  +          if( zTName && sqlite4_stricmp(zTName, zTabName)!=0 ){
  3325   3325               continue;
  3326   3326             }
  3327   3327             tableSeen = 1;
  3328   3328             for(j=0; j<pTab->nCol; j++){
  3329   3329               Expr *pExpr, *pRight;
  3330   3330               char *zName = pTab->aCol[j].zName;
  3331   3331               char *zColname;  /* The computed column name */

Changes to src/sqliteInt.h.

  2551   2551   # define sqlite4Tolower(x)   tolower((unsigned char)(x))
  2552   2552   #endif
  2553   2553   
  2554   2554   /*
  2555   2555   ** Internal function prototypes
  2556   2556   */
  2557   2557   int sqlite4Strlen30(const char*);
  2558         -#define sqlite4StrICmp sqlite4_stricmp
  2559         -#define sqlite4StrNICmp sqlite4_strnicmp
  2560   2558   
  2561   2559   int sqlite4MallocInit(sqlite4_env*);
  2562   2560   void sqlite4MallocEnd(sqlite4_env*);
  2563   2561   void *sqlite4Malloc(sqlite4_env*, int);
  2564   2562   void *sqlite4MallocZero(sqlite4_env*, int);
  2565   2563   void *sqlite4DbMallocZero(sqlite4*, int);
  2566   2564   void *sqlite4DbMallocRaw(sqlite4*, int);

Changes to src/trigger.c.

    53     53     }
    54     54   
    55     55     if( pTmpSchema!=pTab->pSchema ){
    56     56       HashElem *p;
    57     57       for(p=sqliteHashFirst(&pTmpSchema->trigHash); p; p=sqliteHashNext(p)){
    58     58         Trigger *pTrig = (Trigger *)sqliteHashData(p);
    59     59         if( pTrig->pTabSchema==pTab->pSchema
    60         -       && 0==sqlite4StrICmp(pTrig->table, pTab->zName) 
           60  +       && 0==sqlite4_stricmp(pTrig->table, pTab->zName) 
    61     61         ){
    62     62           pTrig->pNext = (pList ? pList : pTab->pTrigger);
    63     63           pList = pTrig;
    64     64         }
    65     65       }
    66     66     }
    67     67   
................................................................................
   186    186         assert( !db->init.busy );
   187    187         sqlite4CodeVerifySchema(pParse, iDb);
   188    188       }
   189    189       goto trigger_cleanup;
   190    190     }
   191    191   
   192    192     /* Do not create a trigger on a system table */
   193         -  if( sqlite4StrNICmp(pTab->zName, "sqlite_", 7)==0 ){
          193  +  if( sqlite4_strnicmp(pTab->zName, "sqlite_", 7)==0 ){
   194    194       sqlite4ErrorMsg(pParse, "cannot create trigger on system table");
   195    195       pParse->nErr++;
   196    196       goto trigger_cleanup;
   197    197     }
   198    198   
   199    199     /* INSTEAD of triggers are only for views and views only support INSTEAD
   200    200     ** of triggers.
................................................................................
   498    498   
   499    499     assert( pName->nSrc==1 );
   500    500     zDb = pName->a[0].zDatabase;
   501    501     zName = pName->a[0].zName;
   502    502     nName = sqlite4Strlen30(zName);
   503    503     for(i=OMIT_TEMPDB; i<db->nDb; i++){
   504    504       int j = (i<2) ? i^1 : i;  /* Search TEMP before MAIN */
   505         -    if( zDb && sqlite4StrICmp(db->aDb[j].zName, zDb) ) continue;
          505  +    if( zDb && sqlite4_stricmp(db->aDb[j].zName, zDb) ) continue;
   506    506       pTrigger = sqlite4HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName);
   507    507       if( pTrigger ) break;
   508    508     }
   509    509     if( !pTrigger ){
   510    510       if( !noErr ){
   511    511         sqlite4ErrorMsg(pParse, "no such trigger: %S", pName, 0);
   512    512       }else{

Changes to src/update.c.

   208    208       /* Resolve any names in the expression for this assignment */
   209    209       if( sqlite4ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){
   210    210         goto update_cleanup;
   211    211       }
   212    212   
   213    213       /* Resolve the column name on the left of the assignment */
   214    214       for(j=0; j<pTab->nCol; j++){
   215         -      if( sqlite4StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ) break;
          215  +      if( sqlite4_stricmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ) break;
   216    216       }
   217    217       if( j==pTab->nCol ){
   218    218         sqlite4ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName);
   219    219         pParse->checkSchema = 1;
   220    220         goto update_cleanup;
   221    221       }
   222    222       aXRef[j] = i;

Changes to src/vdbe.c.

  2446   2446       ** commit or rollback to. This block sets variable pSave to point
  2447   2447       ** to the Savepoint object and iSave to the kvstore layer transaction
  2448   2448       ** number. For example, to commit or rollback the top level transaction
  2449   2449       ** iSave==2.  */
  2450   2450       iSave = db->nSavepoint+1;
  2451   2451       for(pSave=db->pSavepoint; pSave; pSave=pSave->pNext){
  2452   2452         if( zSave ){
  2453         -        if( pSave->zName && 0==sqlite4StrICmp(zSave, pSave->zName) ) break;
         2453  +        if( pSave->zName && 0==sqlite4_stricmp(zSave, pSave->zName) ) break;
  2454   2454         }else{
  2455   2455           if( pSave->pNext==0 ) break;
  2456   2456         }
  2457   2457         iSave--;
  2458   2458       }
  2459   2459   
  2460   2460       if( pSave==0 ){

Changes to src/where.c.

   768    768     Expr *pExpr      /* Test this expression */
   769    769   ){
   770    770     ExprList *pList;
   771    771   
   772    772     if( pExpr->op!=TK_FUNCTION ){
   773    773       return 0;
   774    774     }
   775         -  if( sqlite4StrICmp(pExpr->u.zToken,"match")!=0 ){
          775  +  if( sqlite4_stricmp(pExpr->u.zToken,"match")!=0 ){
   776    776       return 0;
   777    777     }
   778    778     pList = pExpr->x.pList;
   779    779     if( pList->nExpr!=2 ){
   780    780       return 0;
   781    781     }
   782    782     if( pList->a[1].pExpr->op != TK_COLUMN ){
................................................................................
  1454   1454       Expr *p = pList->a[i].pExpr;
  1455   1455       if( p->op==TK_COLUMN
  1456   1456        && p->iColumn==pIdx->aiColumn[iCol]
  1457   1457        && p->iTable==iBase
  1458   1458       ){
  1459   1459         CollSeq *pColl = sqlite4ExprCollSeq(pParse, p);
  1460   1460         assert( pColl || p->iColumn==-1 );
  1461         -      if( 0==pColl || 0==sqlite4StrICmp(pColl->zName, zColl) ){
         1461  +      if( 0==pColl || 0==sqlite4_stricmp(pColl->zName, zColl) ){
  1462   1462           return i;
  1463   1463         }
  1464   1464       }
  1465   1465     }
  1466   1466   
  1467   1467     return -1;
  1468   1468   }

Changes to test/test_main.c.

  1704   1704   ** The following routine is a user-defined SQL function whose purpose
  1705   1705   ** is to test the sqlite_set_result() API.
  1706   1706   */
  1707   1707   static void testFunc(sqlite4_context *context, int argc, sqlite4_value **argv){
  1708   1708     while( argc>=2 ){
  1709   1709       const char *zArg0 = (char*)sqlite4_value_text(argv[0]);
  1710   1710       if( zArg0 ){
  1711         -      if( 0==sqlite4StrICmp(zArg0, "int") ){
         1711  +      if( 0==sqlite4_stricmp(zArg0, "int") ){
  1712   1712           sqlite4_result_int(context, sqlite4_value_int(argv[1]));
  1713         -      }else if( sqlite4StrICmp(zArg0,"int64")==0 ){
         1713  +      }else if( sqlite4_stricmp(zArg0,"int64")==0 ){
  1714   1714           sqlite4_result_int64(context, sqlite4_value_int64(argv[1]));
  1715         -      }else if( sqlite4StrICmp(zArg0,"string")==0 ){
         1715  +      }else if( sqlite4_stricmp(zArg0,"string")==0 ){
  1716   1716           sqlite4_result_text(context, (char*)sqlite4_value_text(argv[1]), -1,
  1717   1717               SQLITE4_TRANSIENT);
  1718         -      }else if( sqlite4StrICmp(zArg0,"double")==0 ){
         1718  +      }else if( sqlite4_stricmp(zArg0,"double")==0 ){
  1719   1719           sqlite4_result_double(context, sqlite4_value_double(argv[1]));
  1720         -      }else if( sqlite4StrICmp(zArg0,"null")==0 ){
         1720  +      }else if( sqlite4_stricmp(zArg0,"null")==0 ){
  1721   1721           sqlite4_result_null(context);
  1722         -      }else if( sqlite4StrICmp(zArg0,"value")==0 ){
         1722  +      }else if( sqlite4_stricmp(zArg0,"value")==0 ){
  1723   1723           sqlite4_result_value(context, argv[sqlite4_value_int(argv[1])]);
  1724   1724         }else{
  1725   1725           goto error_out;
  1726   1726         }
  1727   1727       }else{
  1728   1728         goto error_out;
  1729   1729       }

Changes to test/test_utf.c.

    99     99       { "UTF16BE", SQLITE4_UTF16BE },
   100    100       { "UTF16", SQLITE4_UTF16 },
   101    101       { 0, 0 }
   102    102     };
   103    103     struct EncName *pEnc;
   104    104     char *z = Tcl_GetString(pObj);
   105    105     for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
   106         -    if( 0==sqlite4StrICmp(z, pEnc->zName) ){
          106  +    if( 0==sqlite4_stricmp(z, pEnc->zName) ){
   107    107         break;
   108    108       }
   109    109     }
   110    110     if( !pEnc->enc ){
   111    111       Tcl_AppendResult(interp, "No such encoding: ", z, 0);
   112    112     }
   113    113     if( pEnc->enc==SQLITE4_UTF16 ){

Changes to tool/mkkeywordhash.c.

   572    572     printf("  int h, i;\n");
   573    573     printf("  if( n<2 ) return TK_ID;\n");
   574    574     printf("  h = ((charMap(z[0])*4) ^\n"
   575    575            "      (charMap(z[n-1])*3) ^\n"
   576    576            "      n) %% %d;\n", bestSize);
   577    577     printf("  for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){\n");
   578    578     printf("    if( aLen[i]==n &&"
   579         -                   " sqlite4StrNICmp(&zText[aOffset[i]],z,n)==0 ){\n");
          579  +                   " sqlite4_strnicmp(&zText[aOffset[i]],z,n)==0 ){\n");
   580    580     for(i=0; i<nKeyword; i++){
   581    581       printf("      testcase( i==%d ); /* %s */\n",
   582    582              i, aKeywordTable[i].zOrigName);
   583    583     }
   584    584     printf("      return aCode[i];\n");
   585    585     printf("    }\n");
   586    586     printf("  }\n");