~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/ctype-mb.cc

  • Committer: Andrew Hutchings
  • Date: 2011-03-29 20:45:43 UTC
  • mfrom: (2257 drizzle)
  • mto: (2257.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2258.
  • Revision ID: andrew@linuxjedi.co.uk-20110329204543-ssex0nuo8knncgwx
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
{
27
27
 
28
28
 
29
 
size_t my_caseup_str_mb(const CHARSET_INFO * const  cs, char *str)
 
29
size_t my_caseup_str_mb(const charset_info_st * const  cs, char *str)
30
30
{
31
31
  uint32_t l;
32
32
  unsigned char *map= cs->to_upper;
47
47
}
48
48
 
49
49
 
50
 
size_t my_casedn_str_mb(const CHARSET_INFO * const  cs, char *str)
 
50
size_t my_casedn_str_mb(const charset_info_st * const  cs, char *str)
51
51
{
52
52
  uint32_t l;
53
53
  unsigned char *map= cs->to_lower;
68
68
}
69
69
 
70
70
 
71
 
size_t my_caseup_mb(const CHARSET_INFO * const  cs, char *src, size_t srclen,
 
71
size_t my_caseup_mb(const charset_info_st * const  cs, char *src, size_t srclen,
72
72
                    char *dst, size_t dstlen)
73
73
{
74
74
#ifdef NDEBUG
94
94
}
95
95
 
96
96
 
97
 
size_t my_casedn_mb(const CHARSET_INFO * const  cs, char *src, size_t srclen,
 
97
size_t my_casedn_mb(const charset_info_st * const  cs, char *src, size_t srclen,
98
98
                    char *dst, size_t dstlen)
99
99
{
100
100
#ifdef NDEBUG
124
124
  my_strcasecmp_mb() returns 0 if strings are equal, non-zero otherwise.
125
125
 */
126
126
 
127
 
int my_strcasecmp_mb(const CHARSET_INFO * const  cs,const char *s, const char *t)
 
127
int my_strcasecmp_mb(const charset_info_st * const  cs,const char *s, const char *t)
128
128
{
129
129
  uint32_t l;
130
130
  unsigned char *map=cs->to_upper;
164
164
  return (unsigned char) cs->sort_order[(unsigned char) c];
165
165
}
166
166
    
167
 
int my_wildcmp_mb(const CHARSET_INFO * const cs,
 
167
int my_wildcmp_mb(const charset_info_st * const cs,
168
168
                  const char *str,const char *str_end,
169
169
                  const char *wildstr,const char *wildend,
170
170
                  int escape, int w_one, int w_many)
272
272
}
273
273
 
274
274
 
275
 
size_t my_numchars_mb(const CHARSET_INFO * const cs,
 
275
size_t my_numchars_mb(const charset_info_st * const cs,
276
276
                      const char *pos, const char *end)
277
277
{
278
278
  size_t count= 0;
286
286
}
287
287
 
288
288
 
289
 
size_t my_charpos_mb(const CHARSET_INFO * const cs,
 
289
size_t my_charpos_mb(const charset_info_st * const cs,
290
290
                     const char *pos, const char *end, size_t length)
291
291
{
292
292
  const char *start= pos;
301
301
}
302
302
 
303
303
 
304
 
size_t my_well_formed_len_mb(const CHARSET_INFO * const cs, const char *b, const char *e,
 
304
size_t my_well_formed_len_mb(const charset_info_st * const cs, const char *b, const char *e,
305
305
                             size_t pos, int *error)
306
306
{
307
307
  const char *b_start= b;
323
323
}
324
324
 
325
325
 
326
 
uint32_t my_instr_mb(const CHARSET_INFO * const cs,
 
326
uint32_t my_instr_mb(const charset_info_st * const cs,
327
327
                 const char *b, size_t b_length,
328
328
                 const char *s, size_t s_length,
329
329
                 my_match_t *match, uint32_t nmatch)
380
380
 
381
381
/* BINARY collations handlers for MB charsets */
382
382
 
383
 
int my_strnncoll_mb_bin(const CHARSET_INFO * const,
 
383
int my_strnncoll_mb_bin(const charset_info_st * const,
384
384
                        const unsigned char *s, size_t slen,
385
385
                        const unsigned char *t, size_t tlen,
386
386
                        bool t_is_prefix)
416
416
    0 if strings are equal
417
417
*/
418
418
 
419
 
int my_strnncollsp_mb_bin(const CHARSET_INFO * const,
 
419
int my_strnncollsp_mb_bin(const charset_info_st * const,
420
420
                          const unsigned char *a, size_t a_length,
421
421
                          const unsigned char *b, size_t b_length,
422
422
                          bool diff_if_only_endspace_difference)
495
495
  cp932, euckr, gb2312, sjis, eucjpms, ujis.
496
496
*/
497
497
size_t
498
 
my_strnxfrm_mb(const CHARSET_INFO * const cs,
 
498
my_strnxfrm_mb(const charset_info_st * const cs,
499
499
               unsigned char *dst, size_t dstlen, uint32_t nweights,
500
500
               const unsigned char *src, size_t srclen, uint32_t flags)
501
501
{
570
570
}
571
571
 
572
572
 
573
 
int my_strcasecmp_mb_bin(const CHARSET_INFO * const,
 
573
int my_strcasecmp_mb_bin(const charset_info_st * const,
574
574
                         const char *s, const char *t)
575
575
{
576
576
  return strcmp(s,t);
577
577
}
578
578
 
579
579
 
580
 
void my_hash_sort_mb_bin(const CHARSET_INFO * const,
 
580
void my_hash_sort_mb_bin(const charset_info_st * const,
581
581
                         const unsigned char *key, size_t len,
582
582
                         uint32_t *nr1, uint32_t *nr2)
583
583
{
614
614
        create a buffer with multibyte representation of the max_sort_char
615
615
        character, and copy it into max_str in a loop.
616
616
*/
617
 
static void pad_max_char(const CHARSET_INFO * const cs, char *str, char *end)
 
617
static void pad_max_char(const charset_info_st * const cs, char *str, char *end)
618
618
{
619
619
  char buf[10];
620
620
  char buflen;
668
668
** optimized !
669
669
*/
670
670
 
671
 
bool my_like_range_mb(const CHARSET_INFO * const cs,
 
671
bool my_like_range_mb(const charset_info_st * const cs,
672
672
                         const char *ptr,size_t ptr_length,
673
673
                         char escape, char w_one, char w_many,
674
674
                         size_t res_length,
800
800
}
801
801
 
802
802
 
803
 
int my_wildcmp_mb_bin(const CHARSET_INFO * const cs,
 
803
int my_wildcmp_mb_bin(const charset_info_st * const cs,
804
804
                      const char *str,const char *str_end,
805
805
                      const char *wildstr,const char *wildend,
806
806
                      int escape, int w_one, int w_many)
1119
1119
};
1120
1120
 
1121
1121
 
1122
 
size_t my_numcells_mb(const CHARSET_INFO * const cs, const char *b, const char *e)
 
1122
size_t my_numcells_mb(const charset_info_st * const cs, const char *b, const char *e)
1123
1123
{
1124
1124
  my_wc_t wc;
1125
1125
  size_t clen= 0;
1149
1149
 
1150
1150
 
1151
1151
 
1152
 
int my_mb_ctype_mb(const CHARSET_INFO * const cs, int *ctype,
 
1152
int my_mb_ctype_mb(const charset_info_st * const cs, int *ctype,
1153
1153
                   const unsigned char *s, const unsigned char *e)
1154
1154
{
1155
1155
  my_wc_t wc;