1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Remove all vestiges of ctype.h from FTS3.

FossilOrigin-Name: b8b465ed2c56b23b50334680a2a940885b1ac530
This commit is contained in:
drh
2010-08-06 19:00:12 +00:00
parent cb79e5137c
commit c78db070a3
7 changed files with 28 additions and 20 deletions

View File

@ -78,7 +78,6 @@ int sqlite3_fts3_enable_parentheses = 0;
#define SQLITE_FTS3_DEFAULT_NEAR_PARAM 10
#include "fts3Int.h"
#include <ctype.h>
#include <string.h>
#include <assert.h>
@ -104,7 +103,7 @@ struct ParseContext {
** negative values).
*/
static int fts3isspace(char c){
return (c&0x80)==0 ? isspace(c) : 0;
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f';
}
/*

View File

@ -30,7 +30,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "fts3_tokenizer.h"

View File

@ -16,7 +16,6 @@
#include "fts3Int.h"
#include <string.h>
#include <assert.h>
#include <ctype.h>
/*

View File

@ -32,7 +32,6 @@
#include "fts3Int.h"
#include <assert.h>
#include <ctype.h>
#include <string.h>
/*

View File

@ -30,7 +30,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "fts3_tokenizer.h"
@ -53,6 +52,9 @@ typedef struct simple_tokenizer_cursor {
static int simpleDelim(simple_tokenizer *t, unsigned char c){
return c<0x80 && t->delim[c];
}
static int fts3_isalnum(int x){
return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z');
}
/*
** Create a new tokenizer instance.
@ -87,7 +89,7 @@ static int simpleCreate(
/* Mark non-alphanumeric ASCII characters as delimiters */
int i;
for(i=1; i<0x80; i++){
t->delim[i] = !isalnum(i) ? -1 : 0;
t->delim[i] = !fts3_isalnum(i) ? -1 : 0;
}
}
@ -193,7 +195,7 @@ static int simpleNext(
** case-insensitivity.
*/
unsigned char ch = p[iStartOffset+i];
c->pToken[i] = (char)(ch<0x80 ? tolower(ch) : ch);
c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch);
}
*ppToken = c->pToken;
*pnBytes = n;