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

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

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « third_party/sqlite/src/ext/fts1/fts1.c ('k') | third_party/sqlite/src/ext/fts3/fts3.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <assert.h> 8 #include <assert.h>
9 #if !defined(__APPLE__) 9 #if !defined(__APPLE__)
10 #include <malloc.h> 10 #include <malloc.h>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 int n = (int) strcspn(c->pCurrent, t->zDelim); 131 int n = (int) strcspn(c->pCurrent, t->zDelim);
132 if( n>0 ){ 132 if( n>0 ){
133 if( n+1>c->nTokenAllocated ){ 133 if( n+1>c->nTokenAllocated ){
134 c->zToken = realloc(c->zToken, n+1); 134 c->zToken = realloc(c->zToken, n+1);
135 } 135 }
136 for(ii=0; ii<n; ii++){ 136 for(ii=0; ii<n; ii++){
137 /* TODO(shess) This needs expansion to handle UTF-8 137 /* TODO(shess) This needs expansion to handle UTF-8
138 ** case-insensitivity. 138 ** case-insensitivity.
139 */ 139 */
140 char ch = c->pCurrent[ii]; 140 char ch = c->pCurrent[ii];
141 c->zToken[ii] = (unsigned char)ch<0x80 ? tolower(ch) : ch; 141 c->zToken[ii] = (unsigned char)ch<0x80 ? tolower((unsigned char)ch):ch;
142 } 142 }
143 c->zToken[n] = '\0'; 143 c->zToken[n] = '\0';
144 *ppToken = c->zToken; 144 *ppToken = c->zToken;
145 *pnBytes = n; 145 *pnBytes = n;
146 *piStartOffset = (int) (c->pCurrent-c->pInput); 146 *piStartOffset = (int) (c->pCurrent-c->pInput);
147 *piEndOffset = *piStartOffset+n; 147 *piEndOffset = *piStartOffset+n;
148 *piPosition = c->iToken++; 148 *piPosition = c->iToken++;
149 c->pCurrent += n + 1; 149 c->pCurrent += n + 1;
150 150
151 return SQLITE_OK; 151 return SQLITE_OK;
(...skipping 13 matching lines...) Expand all
165 simpleOpen, 165 simpleOpen,
166 simpleClose, 166 simpleClose,
167 simpleNext, 167 simpleNext,
168 }; 168 };
169 169
170 void get_simple_tokenizer_module( 170 void get_simple_tokenizer_module(
171 sqlite3_tokenizer_module **ppModule 171 sqlite3_tokenizer_module **ppModule
172 ){ 172 ){
173 *ppModule = &simpleTokenizerModule; 173 *ppModule = &simpleTokenizerModule;
174 } 174 }
OLDNEW
« no previous file with comments | « third_party/sqlite/src/ext/fts1/fts1.c ('k') | third_party/sqlite/src/ext/fts3/fts3.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698