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

Side by Side Diff: third_party/sqlite/src/ext/fts3/fts3_tokenize_vtab.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
OLDNEW
1 /* 1 /*
2 ** 2013 Apr 22 2 ** 2013 Apr 22
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 Fts3Hash *pHash, 78 Fts3Hash *pHash,
79 const char *zName, 79 const char *zName,
80 const sqlite3_tokenizer_module **pp, 80 const sqlite3_tokenizer_module **pp,
81 char **pzErr 81 char **pzErr
82 ){ 82 ){
83 sqlite3_tokenizer_module *p; 83 sqlite3_tokenizer_module *p;
84 int nName = (int)strlen(zName); 84 int nName = (int)strlen(zName);
85 85
86 p = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, zName, nName+1); 86 p = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, zName, nName+1);
87 if( !p ){ 87 if( !p ){
88 *pzErr = sqlite3_mprintf("unknown tokenizer: %s", zName); 88 sqlite3Fts3ErrMsg(pzErr, "unknown tokenizer: %s", zName);
89 return SQLITE_ERROR; 89 return SQLITE_ERROR;
90 } 90 }
91 91
92 *pp = p; 92 *pp = p;
93 return SQLITE_OK; 93 return SQLITE_OK;
94 } 94 }
95 95
96 /* 96 /*
97 ** The second argument, argv[], is an array of pointers to nul-terminated 97 ** The second argument, argv[], is an array of pointers to nul-terminated
98 ** strings. This function makes a copy of the array and strings into a 98 ** strings. This function makes a copy of the array and strings into a
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 ** argv[3]: first argument (tokenizer name) 156 ** argv[3]: first argument (tokenizer name)
157 */ 157 */
158 static int fts3tokConnectMethod( 158 static int fts3tokConnectMethod(
159 sqlite3 *db, /* Database connection */ 159 sqlite3 *db, /* Database connection */
160 void *pHash, /* Hash table of tokenizers */ 160 void *pHash, /* Hash table of tokenizers */
161 int argc, /* Number of elements in argv array */ 161 int argc, /* Number of elements in argv array */
162 const char * const *argv, /* xCreate/xConnect argument array */ 162 const char * const *argv, /* xCreate/xConnect argument array */
163 sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ 163 sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */
164 char **pzErr /* OUT: sqlite3_malloc'd error message */ 164 char **pzErr /* OUT: sqlite3_malloc'd error message */
165 ){ 165 ){
166 Fts3tokTable *pTab; 166 Fts3tokTable *pTab = 0;
167 const sqlite3_tokenizer_module *pMod = 0; 167 const sqlite3_tokenizer_module *pMod = 0;
168 sqlite3_tokenizer *pTok = 0; 168 sqlite3_tokenizer *pTok = 0;
169 int rc; 169 int rc;
170 char **azDequote = 0; 170 char **azDequote = 0;
171 int nDequote; 171 int nDequote;
172 172
173 rc = sqlite3_declare_vtab(db, FTS3_TOK_SCHEMA); 173 rc = sqlite3_declare_vtab(db, FTS3_TOK_SCHEMA);
174 if( rc!=SQLITE_OK ) return rc; 174 if( rc!=SQLITE_OK ) return rc;
175 175
176 nDequote = argc-3; 176 nDequote = argc-3;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 0, /* xRelease */ 445 0, /* xRelease */
446 0 /* xRollbackTo */ 446 0 /* xRollbackTo */
447 }; 447 };
448 int rc; /* Return code */ 448 int rc; /* Return code */
449 449
450 rc = sqlite3_create_module(db, "fts3tokenize", &fts3tok_module, (void*)pHash); 450 rc = sqlite3_create_module(db, "fts3tokenize", &fts3tok_module, (void*)pHash);
451 return rc; 451 return rc;
452 } 452 }
453 453
454 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ 454 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
OLDNEW
« no previous file with comments | « third_party/sqlite/src/ext/fts3/fts3_term.c ('k') | third_party/sqlite/src/ext/fts3/fts3_tokenizer.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698