Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: third_party/sqlite/src/ext/fts1/fts1_tokenizer1.c

Issue 6823057: Cleanup SQLite 3.6.18 import. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 ** The author disclaims copyright to this source code. 2 ** The author disclaims copyright to this source code.
3 ** 3 **
4 ************************************************************************* 4 *************************************************************************
5 ** Implementation of the "simple" full-text-search tokenizer. 5 ** Implementation of the "simple" full-text-search tokenizer.
6 */ 6 */
7 7
8 /* 8 /*
9 ** The code in this file is only compiled if: 9 ** The code in this file is only compiled if:
10 ** 10 **
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if( n>c->nTokenAllocated ){ 175 if( n>c->nTokenAllocated ){
176 c->nTokenAllocated = n+20; 176 c->nTokenAllocated = n+20;
177 c->pToken = realloc(c->pToken, c->nTokenAllocated); 177 c->pToken = realloc(c->pToken, c->nTokenAllocated);
178 if( c->pToken==NULL ) return SQLITE_NOMEM; 178 if( c->pToken==NULL ) return SQLITE_NOMEM;
179 } 179 }
180 for(i=0; i<n; i++){ 180 for(i=0; i<n; i++){
181 /* TODO(shess) This needs expansion to handle UTF-8 181 /* TODO(shess) This needs expansion to handle UTF-8
182 ** case-insensitivity. 182 ** case-insensitivity.
183 */ 183 */
184 unsigned char ch = p[iStartOffset+i]; 184 unsigned char ch = p[iStartOffset+i];
185 c->pToken[i] = (ch>='A' && ch<='Z') ? (ch-'A'+'a') : ch; 185 c->pToken[i] = ch<0x80 ? tolower(ch) : ch;
186 } 186 }
187 *ppToken = c->pToken; 187 *ppToken = c->pToken;
188 *pnBytes = n; 188 *pnBytes = n;
189 *piStartOffset = iStartOffset; 189 *piStartOffset = iStartOffset;
190 *piEndOffset = c->iOffset; 190 *piEndOffset = c->iOffset;
191 *piPosition = c->iToken++; 191 *piPosition = c->iToken++;
192 192
193 return SQLITE_OK; 193 return SQLITE_OK;
194 } 194 }
195 } 195 }
(...skipping 16 matching lines...) Expand all
212 ** Allocate a new simple tokenizer. Return a pointer to the new 212 ** Allocate a new simple tokenizer. Return a pointer to the new
213 ** tokenizer in *ppModule 213 ** tokenizer in *ppModule
214 */ 214 */
215 void sqlite3Fts1SimpleTokenizerModule( 215 void sqlite3Fts1SimpleTokenizerModule(
216 sqlite3_tokenizer_module const**ppModule 216 sqlite3_tokenizer_module const**ppModule
217 ){ 217 ){
218 *ppModule = &simpleTokenizerModule; 218 *ppModule = &simpleTokenizerModule;
219 } 219 }
220 220
221 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) */ 221 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) */
OLDNEW
« no previous file with comments | « third_party/sqlite/src/ext/fts1/fts1.c ('k') | third_party/sqlite/src/ext/fts1/simple_tokenizer.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698