diff options
Diffstat (limited to 'include/m_ctype.h')
-rw-r--r-- | include/m_ctype.h | 75 |
1 files changed, 40 insertions, 35 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index 88c3418fc0d..e5f1c4fc3c0 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -111,7 +111,7 @@ typedef struct my_collation_handler_st uchar *, uint, const uchar *, uint); my_bool (*like_range)(struct charset_info_st *, const char *s, uint s_length, - int w_prefix, int w_one, int w_many, + pchar w_prefix, pchar w_one, pchar w_many, uint res_length, char *min_str, char *max_str, uint *min_len, uint *max_len); @@ -135,6 +135,7 @@ typedef struct my_collation_handler_st extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler; extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; +extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; typedef struct my_charset_handler_st @@ -144,7 +145,7 @@ typedef struct my_charset_handler_st 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); - uint (*wellformedlen)(struct charset_info_st *, + uint (*well_formed_len)(struct charset_info_st *, const char *b,const char *e, uint nchars); uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length); @@ -210,7 +211,8 @@ typedef struct charset_info_st uint strxfrm_multiply; uint mbminlen; uint mbmaxlen; - char max_sort_char; /* For LIKE optimization */ + uint16 min_sort_char; + uint16 max_sort_char; /* For LIKE optimization */ MY_CHARSET_HANDLER *cset; MY_COLLATION_HANDLER *coll; @@ -237,13 +239,13 @@ extern CHARSET_INFO my_charset_tis620_thai_ci; extern CHARSET_INFO my_charset_tis620_bin; extern CHARSET_INFO my_charset_ucs2_general_ci; extern CHARSET_INFO my_charset_ucs2_bin; +extern CHARSET_INFO my_charset_ucs2_general_uca; extern CHARSET_INFO my_charset_ujis_japanese_ci; extern CHARSET_INFO my_charset_ujis_bin; extern CHARSET_INFO my_charset_utf8_general_ci; extern CHARSET_INFO my_charset_utf8_bin; extern CHARSET_INFO my_charset_cp1250_czech_ci; - /* declarations for simple charsets */ extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *, uint); @@ -300,11 +302,18 @@ void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill); my_bool my_like_range_simple(CHARSET_INFO *cs, const char *ptr, uint ptr_length, - int escape, int w_one, int w_many, + pbool escape, pbool w_one, pbool w_many, uint res_length, char *min_str, char *max_str, uint *min_length, uint *max_length); +my_bool my_like_range_ucs2(CHARSET_INFO *cs, + const char *ptr, uint ptr_length, + pbool escape, pbool w_one, pbool w_many, + uint res_length, + char *min_str, char *max_str, + uint *min_length, uint *max_length); + int my_wildcmp_8bit(CHARSET_INFO *, const char *str,const char *str_end, @@ -313,7 +322,7 @@ int my_wildcmp_8bit(CHARSET_INFO *, uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); -uint my_wellformedlen_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); +uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); int my_mbcharlen_8bit(CHARSET_INFO *, uint c); @@ -330,7 +339,7 @@ int my_wildcmp_mb(CHARSET_INFO *, int escape, int w_one, int w_many); uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); -uint my_wellformedlen_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); +uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_instr_mb(struct charset_info_st *, const char *b, uint b_length, const char *s, uint s_length, @@ -340,23 +349,14 @@ uint my_instr_mb(struct charset_info_st *, extern my_bool my_parse_charset_xml(const char *bug, uint len, int (*add)(CHARSET_INFO *cs)); -#undef _U -#undef _L -#undef _NMR -#undef _SPC -#undef _PNT -#undef _CTR -#undef _B -#undef _X - -#define _U 01 /* Upper case */ -#define _L 02 /* Lower case */ -#define _NMR 04 /* Numeral (digit) */ -#define _SPC 010 /* Spacing character */ -#define _PNT 020 /* Punctuation */ -#define _CTR 040 /* Control character */ -#define _B 0100 /* Blank */ -#define _X 0200 /* heXadecimal digit */ +#define _MY_U 01 /* Upper case */ +#define _MY_L 02 /* Lower case */ +#define _MY_NMR 04 /* Numeral (digit) */ +#define _MY_SPC 010 /* Spacing character */ +#define _MY_PNT 020 /* Punctuation */ +#define _MY_CTR 040 /* Control character */ +#define _MY_B 0100 /* Blank */ +#define _MY_X 0200 /* heXadecimal digit */ #define my_isascii(c) (!((c) & ~0177)) @@ -365,22 +365,23 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len, #define my_toprint(c) ((c) | 64) #define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)]) #define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)]) -#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L)) -#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _U) -#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _L) -#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _NMR) -#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _X) -#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L | _NMR)) -#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _SPC) -#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _PNT) -#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR | _B)) -#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR)) -#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _CTR) +#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L)) +#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U) +#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L) +#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR) +#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X) +#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR)) +#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC) +#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT) +#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B)) +#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR)) +#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR) /* Some macros that should be cleaned up a little */ #define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_') #define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_') +#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT) #define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM) #define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d))) #define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d))) @@ -391,7 +392,11 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len, #define use_mb(s) ((s)->cset->ismbchar != NULL) #define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b))) +#ifdef USE_MB #define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a))) +#else +#define my_mbcharlen(s, a) 1 +#endif #define my_caseup(s, a, l) ((s)->cset->caseup((s), (a), (l))) #define my_casedn(s, a, l) ((s)->cset->casedn((s), (a), (l))) |