summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbar@bar.mysql.r18.ru <>2003-04-01 15:52:09 +0500
committerbar@bar.mysql.r18.ru <>2003-04-01 15:52:09 +0500
commitca1a736296f7b6f7d134ca786fb1f2ebd570125b (patch)
treee150b071b41bd913be7a617346c394420d40ce95
parentd5030a05411a26dfda750a8545fdef3d6ed7065b (diff)
downloadmariadb-git-ca1a736296f7b6f7d134ca786fb1f2ebd570125b.tar.gz
mbcharlen() is now used instead of ismbhead(). The last one has been removed.
-rw-r--r--include/m_ctype.h3
-rw-r--r--mysys/charset.c2
-rw-r--r--sql/sql_lex.cc10
-rw-r--r--sql/sql_load.cc4
-rw-r--r--strings/ctype-big5.c6
-rw-r--r--strings/ctype-bin.c1
-rw-r--r--strings/ctype-czech.c1
-rw-r--r--strings/ctype-euc_kr.c6
-rw-r--r--strings/ctype-extra.c1
-rw-r--r--strings/ctype-gb2312.c6
-rw-r--r--strings/ctype-gbk.c14
-rw-r--r--strings/ctype-latin1.c2
-rw-r--r--strings/ctype-mb.c2
-rw-r--r--strings/ctype-sjis.c6
-rw-r--r--strings/ctype-tis620.c1
-rw-r--r--strings/ctype-ujis.c6
-rw-r--r--strings/ctype-utf8.c13
-rw-r--r--strings/ctype-win1250ch.c1
18 files changed, 13 insertions, 72 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h
index cf61c2e49e3..e28d5687983 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -131,7 +131,6 @@ typedef struct charset_info_st
/* Multibyte routines */
uint mbmaxlen;
int (*ismbchar)(struct charset_info_st *, const char *, const char *);
- my_bool (*ismbhead)(struct charset_info_st *, uint);
int (*mbcharlen)(struct charset_info_st *, uint);
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
@@ -328,7 +327,6 @@ uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
#define use_mb(s) ((s)->ismbchar != NULL)
#define my_ismbchar(s, a, b) ((s)->ismbchar((s), (a), (b)))
-#define my_ismbhead(s, a) ((s)->ismbhead((s), (a)))
#define my_mbcharlen(s, a) ((s)->mbcharlen((s),(a)))
#define my_caseup(s, a, l) ((s)->caseup((s), (a), (l)))
@@ -336,7 +334,6 @@ uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
#define my_caseup_str(s, a) ((s)->caseup_str((s), (a)))
#define my_casedn_str(s, a) ((s)->casedn_str((s), (a)))
#define my_strcasecmp(s, a, b) ((s)->strcasecmp((s), (a), (b)))
-#define my_strncasecmp(s, a, b, l) ((s)->strncasecmp((s), (a), (b), (l)))
#define my_strntol(s, a, b, c, d, e) ((s)->strntol((s),(a),(b),(c),(d),(e)))
#define my_strntoul(s, a, b, c, d, e) ((s)->strntoul((s),(a),(b),(c),(d),(e)))
diff --git a/mysys/charset.c b/mysys/charset.c
index 1f8c20f45f0..097c35caa56 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -72,7 +72,7 @@ static void init_state_maps(CHARSET_INFO *cs)
else if (my_isdigit(cs,i))
state_map[i]=(uchar) MY_LEX_NUMBER_IDENT;
#if defined(USE_MB) && defined(USE_MB_IDENT)
- else if (use_mb(cs) && my_ismbhead(cs, i))
+ else if (use_mb(cs) && (my_mbcharlen(cs, i)>1))
state_map[i]=(uchar) MY_LEX_IDENT;
#endif
else if (!my_isgraph(cs,i))
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index a5bed692293..88375b9469b 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -495,7 +495,7 @@ int yylex(void *arg, void *yythd)
#if defined(USE_MB) && defined(USE_MB_IDENT)
if (use_mb(cs))
{
- if (my_ismbhead(cs, yyGetLast()))
+ if (my_mbcharlen(cs, yyGetLast()) > 1)
{
int l = my_ismbchar(cs,
(const char *)lex->ptr-1,
@@ -508,7 +508,7 @@ int yylex(void *arg, void *yythd)
}
while (ident_map[c=yyGet()])
{
- if (my_ismbhead(cs, c))
+ if (my_mbcharlen(cs, c) > 1)
{
int l;
if ((l = my_ismbchar(cs,
@@ -604,7 +604,7 @@ int yylex(void *arg, void *yythd)
#if defined(USE_MB) && defined(USE_MB_IDENT)
if (use_mb(cs))
{
- if (my_ismbhead(cs, yyGetLast()))
+ if (my_mbcharlen(cs, yyGetLast()) > 1)
{
int l = my_ismbchar(cs,
(const char *)lex->ptr-1,
@@ -618,7 +618,7 @@ int yylex(void *arg, void *yythd)
}
while (ident_map[c=yyGet()])
{
- if (my_ismbhead(cs, c))
+ if (my_mbcharlen(cs, c) > 1)
{
int l;
if ((l = my_ismbchar(cs,
@@ -650,7 +650,7 @@ int yylex(void *arg, void *yythd)
{
while ((c=yyGet()) && c != delim && c != (uchar) NAMES_SEP_CHAR)
{
- if (my_ismbhead(cs, c))
+ if (my_mbcharlen(cs, c) > 1)
{
int l;
if ((l = my_ismbchar(cs,
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 4f5b19e6f49..3c43c3d9e3a 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -702,7 +702,7 @@ int READ_INFO::read_field()
chr = GET;
#ifdef USE_MB
if (use_mb(read_charset) &&
- my_ismbhead(read_charset, chr) &&
+ (my_mbcharlen(read_charset, chr) >1 )&&
to+my_mbcharlen(read_charset, chr) <= end_of_buff)
{
uchar* p = (uchar*)to;
@@ -884,7 +884,7 @@ int READ_INFO::next_line()
{
int chr = GET;
#ifdef USE_MB
- if (use_mb(read_charset) && my_ismbhead(read_charset, chr))
+ if (use_mb(read_charset) && (my_mbcharlen(read_charset, chr) >1 ))
{
for (int i=1;
chr != my_b_EOF && i<my_mbcharlen(read_charset, chr);
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 43d6f1a8e13..7be631bbe05 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -399,11 +399,6 @@ static int ismbchar_big5(CHARSET_INFO *cs __attribute__((unused)),
return (isbig5head(*(p)) && (e)-(p)>1 && isbig5tail(*((p)+1))? 2: 0);
}
-static my_bool ismbhead_big5(CHARSET_INFO *cs __attribute__((unused)), uint c)
-{
- return isbig5head(c);
-}
-
static int mbcharlen_big5(CHARSET_INFO *cs __attribute__((unused)), uint c)
{
return (isbig5head(c)? 2: 0);
@@ -6253,7 +6248,6 @@ CHARSET_INFO my_charset_big5 =
my_wildcmp_mb,
2, /* mbmaxlen */
ismbchar_big5,
- ismbhead_big5,
mbcharlen_big5,
my_numchars_mb,
my_charpos_mb,
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index 568165896ca..77152db845c 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -284,7 +284,6 @@ CHARSET_INFO my_charset_bin =
my_wildcmp_bin, /* wildcmp */
1, /* mbmaxlen */
NULL, /* ismbchar */
- NULL, /* ismbhead */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 0ff7718b6d8..9da2103fda3 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -627,7 +627,6 @@ CHARSET_INFO my_charset_czech =
my_wildcmp_8bit,
1, /* mbmaxlen */
NULL, /* ismbchar */
- NULL, /* ismbhead */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 5b1240e1a92..0766cd40040 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -191,11 +191,6 @@ static int ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
0);
}
-static my_bool ismbhead_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c)
-{
- return (iseuc_kr(c));
-}
-
static int mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (iseuc_kr(c) ? 2 : 0);
@@ -8661,7 +8656,6 @@ CHARSET_INFO my_charset_euc_kr =
my_wildcmp_mb, /* wildcmp */
2, /* mbmaxlen */
ismbchar_euc_kr,
- ismbhead_euc_kr,
mbcharlen_euc_kr,
my_numchars_mb,
my_charpos_mb,
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index 60934d5ff55..40d2b7ab1da 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -42,7 +42,6 @@ CHARSET_INFO compiled_charsets[] = {
NULL,
NULL,
NULL,
- NULL,
NULL, /* mb_wc */
NULL, /* wc_mb */
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 4d0fdda5c6e..ec495be5e84 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -172,11 +172,6 @@ static int ismbchar_gb2312(CHARSET_INFO *cs __attribute__((unused)),
return (isgb2312head(*(p)) && (e)-(p)>1 && isgb2312tail(*((p)+1))? 2: 0);
}
-static my_bool ismbhead_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c)
-{
- return isgb2312head(c);
-}
-
static int mbcharlen_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (isgb2312head(c)? 2:0);
@@ -5711,7 +5706,6 @@ CHARSET_INFO my_charset_gb2312 =
my_wildcmp_mb, /* wildcmp */
2, /* mbmaxlen */
ismbchar_gb2312,
- ismbhead_gb2312,
mbcharlen_gb2312,
my_numchars_mb,
my_charpos_mb,
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index c39ef62b97c..7673f4e6c23 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -2619,7 +2619,7 @@ int my_strnncollsp_gbk(CHARSET_INFO * cs,
}
-int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
uchar * dest, uint len,
const uchar * src, uint srclen)
{
@@ -2661,7 +2661,7 @@ int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
#define max_sort_char ((uchar) 255)
-extern my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
+static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr,uint ptr_length,
int escape, int w_one, int w_many,
uint res_length, char *min_str,char *max_str,
@@ -2713,18 +2713,13 @@ extern my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
}
-int ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)),
+static int ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
return (isgbkhead(*(p)) && (e)-(p)>1 && isgbktail(*((p)+1))? 2: 0);
}
-my_bool ismbhead_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c)
-{
- return isgbkhead(c);
-}
-
-int mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c)
+static int mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (isgbkhead(c)? 2:0);
}
@@ -9908,7 +9903,6 @@ CHARSET_INFO my_charset_gbk =
my_wildcmp_mb, /* wildcmp */
2, /* mbmaxlen */
ismbchar_gbk,
- ismbhead_gbk,
mbcharlen_gbk,
my_numchars_mb,
my_charpos_mb,
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index d626d7c4464..8b3e2c5e3a9 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -197,7 +197,6 @@ CHARSET_INFO my_charset_latin1 =
my_wildcmp_8bit, /* wildcmp */
1, /* mbmaxlen */
NULL, /* ismbchar */
- NULL, /* ismbhead */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
@@ -451,7 +450,6 @@ CHARSET_INFO my_charset_latin1_de =
my_wildcmp_8bit, /* wildcmp */
1, /* mbmaxlen */
NULL, /* ismbchar */
- NULL, /* ismbhead */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 625dbbae751..3d1abe95675 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -107,7 +107,7 @@ int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t)
if (*s++ != *t++)
return 1;
}
- else if (my_ismbhead(cs, *t))
+ else if (my_mbcharlen(cs, *t) > 1)
return 1;
else if (map[(uchar) *s++] != map[(uchar) *t++])
return 1;
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 5fc0d3f069a..b2b1a40bdcc 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -189,11 +189,6 @@ static int ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)),
return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0);
}
-static my_bool ismbhead_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c)
-{
- return issjishead((uchar) c);
-}
-
static int mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (issjishead((uchar) c) ? 2: 0);
@@ -4495,7 +4490,6 @@ CHARSET_INFO my_charset_sjis =
my_wildcmp_mb, /* wildcmp */
2, /* mbmaxlen */
ismbchar_sjis,
- ismbhead_sjis,
mbcharlen_sjis,
my_numchars_mb,
my_charpos_mb,
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index d08faa2e6c6..9da7b02ed31 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -718,7 +718,6 @@ CHARSET_INFO my_charset_tis620 =
my_wildcmp_8bit, /* wildcmp */
1, /* mbmaxlen */
NULL, /* ismbchar */
- NULL, /* ismbhead */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 88f0f67ec1b..de73608293c 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -194,11 +194,6 @@ static int ismbchar_ujis(CHARSET_INFO *cs __attribute__((unused)),
0);
}
-static my_bool ismbhead_ujis(CHARSET_INFO *cs __attribute__((unused)),uint c)
-{
- return (isujis(c) || isujis_ss2(c) || isujis_ss3(c));
-}
-
static int mbcharlen_ujis(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (isujis(c)? 2: isujis_ss2(c)? 2: isujis_ss3(c)? 3: 0);
@@ -8452,7 +8447,6 @@ CHARSET_INFO my_charset_ujis =
my_wildcmp_mb, /* wildcmp */
3, /* mbmaxlen */
ismbchar_ujis,
- ismbhead_ujis,
mbcharlen_ujis,
my_numchars_mb,
my_charpos_mb,
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 0f784fe26c0..69500f6d3d6 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1929,11 +1929,6 @@ static int my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e)
return (res>1) ? res : 0;
}
-static my_bool my_ismbhead_utf8(CHARSET_INFO *cs __attribute__((unused)) , uint ch)
-{
- return ( ch >= 0xc2 );
-}
-
static int my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)) , uint c)
{
if (c < 0x80)
@@ -1977,7 +1972,6 @@ CHARSET_INFO my_charset_utf8 =
my_wildcmp_mb, /* wildcmp */
3, /* mbmaxlen */
my_ismbchar_utf8, /* ismbchar */
- my_ismbhead_utf8, /* ismbhead */
my_mbcharlen_utf8, /* mbcharlen */
my_numchars_mb,
my_charpos_mb,
@@ -2325,12 +2319,6 @@ static int my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return 2;
}
-static my_bool my_ismbhead_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
- uint ch __attribute__((unused)))
-{
- return 1;
-}
-
static int my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
uint c __attribute__((unused)))
{
@@ -3059,7 +3047,6 @@ CHARSET_INFO my_charset_ucs2 =
my_wildcmp_mb, /* wildcmp */
2, /* mbmaxlen */
my_ismbchar_ucs2, /* ismbchar */
- my_ismbhead_ucs2, /* ismbhead */
my_mbcharlen_ucs2, /* mbcharlen */
my_numchars_ucs2,
my_charpos_ucs2,
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index dea4a096006..9dad5ccac31 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -662,7 +662,6 @@ CHARSET_INFO my_charset_win1250ch =
my_wildcmp_8bit, /* wildcmp */
1, /* mbmaxlen */
NULL, /* ismbchar */
- NULL, /* ismbhead */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,