~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/ctype-simple.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:
34
34
  Returns the number of bytes required for strnxfrm().
35
35
*/
36
36
 
37
 
size_t my_strnxfrmlen_simple(const CHARSET_INFO * const cs, size_t len)
 
37
size_t my_strnxfrmlen_simple(const charset_info_st * const cs, size_t len)
38
38
{
39
39
  return len * (cs->strxfrm_multiply ? cs->strxfrm_multiply : 1);
40
40
}
47
47
   end buffer must be checked.
48
48
*/
49
49
 
50
 
size_t my_snprintf_8bit(const CHARSET_INFO * const,
 
50
size_t my_snprintf_8bit(const charset_info_st * const,
51
51
                        char* to, size_t n,
52
52
                     const char* fmt, ...)
53
53
{
60
60
}
61
61
 
62
62
 
63
 
long my_strntol_8bit(const CHARSET_INFO * const cs,
 
63
long my_strntol_8bit(const charset_info_st * const cs,
64
64
                     const char *nptr, size_t l, int base,
65
65
                     char **endptr, int *err)
66
66
{
183
183
}
184
184
 
185
185
 
186
 
ulong my_strntoul_8bit(const CHARSET_INFO * const cs,
 
186
ulong my_strntoul_8bit(const charset_info_st * const cs,
187
187
                       const char *nptr, size_t l, int base,
188
188
                       char **endptr, int *err)
189
189
{
297
297
}
298
298
 
299
299
 
300
 
int64_t my_strntoll_8bit(const CHARSET_INFO * const cs,
 
300
int64_t my_strntoll_8bit(const charset_info_st * const cs,
301
301
                          const char *nptr, size_t l, int base,
302
302
                          char **endptr,int *err)
303
303
{
420
420
}
421
421
 
422
422
 
423
 
uint64_t my_strntoull_8bit(const CHARSET_INFO * const cs,
 
423
uint64_t my_strntoull_8bit(const charset_info_st * const cs,
424
424
                           const char *nptr, size_t l, int base,
425
425
                           char **endptr, int *err)
426
426
{
559
559
*/
560
560
 
561
561
 
562
 
double my_strntod_8bit(const CHARSET_INFO * const,
 
562
double my_strntod_8bit(const charset_info_st * const,
563
563
                       char *str, size_t length,
564
564
                       char **end, int *err)
565
565
{
576
576
  Assume len >= 1
577
577
*/
578
578
 
579
 
size_t my_long10_to_str_8bit(const CHARSET_INFO * const,
 
579
size_t my_long10_to_str_8bit(const charset_info_st * const,
580
580
                             char *dst, size_t len, int radix, long int val)
581
581
{
582
582
  char buffer[66];
617
617
}
618
618
 
619
619
 
620
 
size_t my_int64_t10_to_str_8bit(const CHARSET_INFO * const,
 
620
size_t my_int64_t10_to_str_8bit(const charset_info_st * const,
621
621
                                char *dst, size_t len, int radix,
622
622
                                int64_t val)
623
623
{
698
698
  return str++; 
699
699
}
700
700
 
701
 
int my_wildcmp_8bit(const CHARSET_INFO * const cs,
 
701
int my_wildcmp_8bit(const charset_info_st * const cs,
702
702
                    const char *str,const char *str_end,
703
703
                    const char *wildstr,const char *wildend,
704
704
                    int escape, int w_one, int w_many)
795
795
** optimized !
796
796
*/
797
797
 
798
 
bool my_like_range_simple(const CHARSET_INFO * const cs,
 
798
bool my_like_range_simple(const charset_info_st * const cs,
799
799
                             const char *ptr, size_t ptr_length,
800
800
                             char escape, char w_one, char w_many,
801
801
                             size_t res_length,
845
845
}
846
846
 
847
847
 
848
 
size_t my_scan_8bit(const CHARSET_INFO * const cs, const char *str, const char *end, int sq)
 
848
size_t my_scan_8bit(const charset_info_st * const cs, const char *str, const char *end, int sq)
849
849
{
850
850
  const char *str0= str;
851
851
  switch (sq)
871
871
}
872
872
 
873
873
 
874
 
void my_fill_8bit(const CHARSET_INFO * const,
 
874
void my_fill_8bit(const charset_info_st * const,
875
875
                  char *s, size_t l, int fill)
876
876
{
877
877
  memset(s, fill, l);
878
878
}
879
879
 
880
880
 
881
 
size_t my_numchars_8bit(const CHARSET_INFO * const,
 
881
size_t my_numchars_8bit(const charset_info_st * const,
882
882
                        const char *b, const char *e)
883
883
{
884
884
  return (size_t) (e - b);
885
885
}
886
886
 
887
887
 
888
 
size_t my_numcells_8bit(const CHARSET_INFO * const,
 
888
size_t my_numcells_8bit(const charset_info_st * const,
889
889
                        const char *b, const char *e)
890
890
{
891
891
  return (size_t) (e - b);
892
892
}
893
893
 
894
894
 
895
 
size_t my_charpos_8bit(const CHARSET_INFO * const,
 
895
size_t my_charpos_8bit(const charset_info_st * const,
896
896
                       const char *, const char *, size_t pos)
897
897
{
898
898
  return pos;
899
899
}
900
900
 
901
901
 
902
 
size_t my_well_formed_len_8bit(const CHARSET_INFO * const,
 
902
size_t my_well_formed_len_8bit(const charset_info_st * const,
903
903
                               const char *start, const char *end,
904
904
                               size_t nchars, int *error)
905
905
{
909
909
}
910
910
 
911
911
 
912
 
size_t my_lengthsp_8bit(const CHARSET_INFO * const,
 
912
size_t my_lengthsp_8bit(const charset_info_st * const,
913
913
                        const char *ptr, size_t length)
914
914
{
915
915
  const char *end;
918
918
}
919
919
 
920
920
 
921
 
uint32_t my_instr_simple(const CHARSET_INFO * const cs,
 
921
uint32_t my_instr_simple(const charset_info_st * const cs,
922
922
                     const char *b, size_t b_length,
923
923
                     const char *s, size_t s_length,
924
924
                     my_match_t *match, uint32_t nmatch)
1002
1002
  return res;
1003
1003
}
1004
1004
 
1005
 
static bool create_fromuni(CHARSET_INFO *cs, cs_alloc_func alloc)
 
1005
static bool create_fromuni(charset_info_st *cs, cs_alloc_func alloc)
1006
1006
{
1007
1007
  uni_idx       idx[PLANE_NUM];
1008
1008
  int           i,n;
1081
1081
  return false;
1082
1082
}
1083
1083
 
1084
 
bool my_cset_init_8bit(CHARSET_INFO *cs, cs_alloc_func alloc)
 
1084
bool my_cset_init_8bit(charset_info_st *cs, cs_alloc_func alloc)
1085
1085
{
1086
1086
  cs->caseup_multiply= 1;
1087
1087
  cs->casedn_multiply= 1;
1089
1089
  return create_fromuni(cs, alloc);
1090
1090
}
1091
1091
 
1092
 
static void set_max_sort_char(CHARSET_INFO *cs)
 
1092
static void set_max_sort_char(charset_info_st *cs)
1093
1093
{
1094
1094
  unsigned char max_char;
1095
1095
  uint32_t  i;
1108
1108
  }
1109
1109
}
1110
1110
 
1111
 
bool my_coll_init_simple(CHARSET_INFO *cs, cs_alloc_func)
 
1111
bool my_coll_init_simple(charset_info_st *cs, cs_alloc_func)
1112
1112
{
1113
1113
  set_max_sort_char(cs);
1114
1114
  return false;
1115
1115
}
1116
1116
 
1117
1117
 
1118
 
int64_t my_strtoll10_8bit(const CHARSET_INFO * const,
 
1118
int64_t my_strtoll10_8bit(const charset_info_st * const,
1119
1119
                          const char *nptr, char **endptr, int *error)
1120
1120
{
1121
1121
  return internal::my_strtoll10(nptr, endptr, error);
1122
1122
}
1123
1123
 
1124
1124
 
1125
 
int my_mb_ctype_8bit(const CHARSET_INFO * const cs, int *ctype,
 
1125
int my_mb_ctype_8bit(const charset_info_st * const cs, int *ctype,
1126
1126
                   const unsigned char *s, const unsigned char *e)
1127
1127
{
1128
1128
  if (s >= e)
1224
1224
*/
1225
1225
 
1226
1226
uint64_t
1227
 
my_strntoull10rnd_8bit(const CHARSET_INFO * const,
 
1227
my_strntoull10rnd_8bit(const charset_info_st * const,
1228
1228
                       const char *str, size_t length, int unsigned_flag,
1229
1229
                       char **endptr, int *error)
1230
1230
{
1502
1502
 
1503
1503
 
1504
1504
 
1505
 
bool my_propagate_simple(const CHARSET_INFO * const, const unsigned char *,
 
1505
bool my_propagate_simple(const charset_info_st * const, const unsigned char *,
1506
1506
                         size_t)
1507
1507
{
1508
1508
  return 1;
1509
1509
}
1510
1510
 
1511
1511
 
1512
 
bool my_propagate_complex(const CHARSET_INFO * const, const unsigned char *,
 
1512
bool my_propagate_complex(const charset_info_st * const, const unsigned char *,
1513
1513
                          size_t)
1514
1514
{
1515
1515
  return 0;
1636
1636
 
1637
1637
 
1638
1638
size_t
1639
 
my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO * const cs,
 
1639
my_strxfrm_pad_desc_and_reverse(const charset_info_st * const cs,
1640
1640
                                unsigned char *str, unsigned char *frmend, unsigned char *strend,
1641
1641
                                uint32_t nweights, uint32_t flags, uint32_t level)
1642
1642
{