~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/charset_info.h

  • Committer: Brian Aker
  • Date: 2011-02-12 23:46:17 UTC
  • mfrom: (2160.1.1 old-style-casts)
  • Revision ID: brian@tangent.org-20110212234617-n5klc1stln6qywea
Merge in Olaf's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
686
686
  return (c | 64);
687
687
}
688
688
 
689
 
inline static char my_toupper(const charset_info_st *s, char c)
690
 
{
691
 
  return (char)(s->to_upper[(unsigned char)c]);
692
 
}
693
 
 
694
 
inline static char my_tolower(const charset_info_st *s, char c)
695
 
{
696
 
  return (char)(s->to_lower[(unsigned char)c]);
697
 
}
698
 
 
699
 
inline static bool my_isalpha(const charset_info_st *s, char c)
700
 
{
701
 
  return ((s->ctype+1)[(unsigned char)c] & (_MY_U | _MY_L));
702
 
}
703
 
 
704
 
inline static bool my_isupper(const charset_info_st *s, char c)
705
 
{
706
 
  return ((s->ctype+1)[(unsigned char)c] & _MY_U);
707
 
}
708
 
 
709
 
inline static bool my_islower(const charset_info_st *s, char c)
710
 
{
711
 
  return ((s->ctype+1)[(unsigned char)c] & _MY_L);
712
 
}
713
 
 
714
 
inline static bool my_isdigit(const charset_info_st *s, char c)
715
 
{
716
 
  return ((s->ctype+1)[(unsigned char)c] & _MY_NMR);
717
 
}
718
 
 
719
 
inline static bool my_isxdigit(const charset_info_st *s, char c)
720
 
{
721
 
  return ((s->ctype+1)[(unsigned char)c] & _MY_X);
722
 
}
723
 
 
724
 
inline static bool my_isalnum(const charset_info_st *s, char c) 
725
 
{
726
 
  return ((s->ctype+1)[(unsigned char)c] & (_MY_U | _MY_L | _MY_NMR));
727
 
}
728
 
 
729
 
inline static bool my_isspace(const charset_info_st *s, char c)
730
 
{
731
 
  return ((s->ctype+1)[(unsigned char)c] & _MY_SPC);
732
 
}
733
 
 
734
 
inline static bool my_ispunct(const charset_info_st *s, char c)  
735
 
{
736
 
  return ((s->ctype+1)[(unsigned char)c] & _MY_PNT);
737
 
}
738
 
 
739
 
inline static bool my_isprint(const charset_info_st *s, char c)  
740
 
{
741
 
  return ((s->ctype+1)[(unsigned char)c] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B));
742
 
}
743
 
 
744
 
inline static bool my_isgraph(const charset_info_st *s, char c)
745
 
{
746
 
  return ((s->ctype+1)[(unsigned char)c] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR));
747
 
}
748
 
 
749
 
inline static bool my_iscntrl(const charset_info_st *s, char c)  
750
 
{
751
 
  return ((s->ctype+1)[(unsigned char)c] & _MY_CTR);
 
689
inline static char my_toupper(const charset_info_st *s, unsigned char c)
 
690
{
 
691
  return s->to_upper[c];
 
692
}
 
693
 
 
694
inline static char my_tolower(const charset_info_st *s, unsigned char c)
 
695
{
 
696
  return s->to_lower[c];
 
697
}
 
698
 
 
699
inline static bool my_isalpha(const charset_info_st *s, unsigned char c)
 
700
{
 
701
  return (s->ctype+1)[c] & (_MY_U | _MY_L);
 
702
}
 
703
 
 
704
inline static bool my_isupper(const charset_info_st *s, unsigned char c)
 
705
{
 
706
  return (s->ctype+1)[c] & _MY_U;
 
707
}
 
708
 
 
709
inline static bool my_islower(const charset_info_st *s, unsigned char c)
 
710
{
 
711
  return (s->ctype+1)[c] & _MY_L;
 
712
}
 
713
 
 
714
inline static bool my_isdigit(const charset_info_st *s, unsigned char c)
 
715
{
 
716
  return (s->ctype+1)[c] & _MY_NMR;
 
717
}
 
718
 
 
719
inline static bool my_isxdigit(const charset_info_st *s, unsigned char c)
 
720
{
 
721
  return (s->ctype+1)[c] & _MY_X;
 
722
}
 
723
 
 
724
inline static bool my_isalnum(const charset_info_st *s, unsigned char c) 
 
725
{
 
726
  return (s->ctype+1)[c] & (_MY_U | _MY_L | _MY_NMR);
 
727
}
 
728
 
 
729
inline static bool my_isspace(const charset_info_st *s, unsigned char c)
 
730
{
 
731
  return (s->ctype+1)[c] & _MY_SPC;
 
732
}
 
733
 
 
734
inline static bool my_ispunct(const charset_info_st *s, unsigned char c)  
 
735
{
 
736
  return (s->ctype+1)[c] & _MY_PNT;
 
737
}
 
738
 
 
739
inline static bool my_isprint(const charset_info_st *s, unsigned char c)  
 
740
{
 
741
  return (s->ctype+1)[c] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B);
 
742
}
 
743
 
 
744
inline static bool my_isgraph(const charset_info_st *s, unsigned char c)
 
745
{
 
746
  return (s->ctype+1)[c] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR);
 
747
}
 
748
 
 
749
inline static bool my_iscntrl(const charset_info_st *s, unsigned char c)  
 
750
{
 
751
  return (s->ctype+1)[c] & _MY_CTR;
752
752
}
753
753
 
754
754
/* Some macros that should be cleaned up a little */
755
755
inline static bool my_isvar(const charset_info_st *s, char c)
756
756
{
757
 
  return (my_isalnum(s,c) || (c) == '_');
 
757
  return my_isalnum(s,c) || (c) == '_';
758
758
}
759
759
 
760
760
inline static bool my_isvar_start(const charset_info_st *s, char c)
761
761
{
762
 
  return (my_isalpha(s,c) || (c) == '_');
 
762
  return my_isalpha(s,c) || (c) == '_';
763
763
}
764
764
 
765
765
inline static bool my_binary_compare(const charset_info_st *s)
766
766
{
767
 
  return (s->state  & MY_CS_BINSORT);
 
767
  return s->state  & MY_CS_BINSORT;
768
768
}
769
769
 
770
770
inline static bool use_strnxfrm(const charset_info_st *s)
771
771
{
772
 
  return (s->state & MY_CS_STRNXFRM);
 
772
  return s->state & MY_CS_STRNXFRM;
773
773
}
774
774
 
775
775
inline static size_t my_strnxfrm(const charset_info_st *cs, 
821
821
inline static size_t my_charpos(const charset_info_st *cs, 
822
822
                                const CHAR_T *b, const CHAR_T* e, size_t num)
823
823
{
824
 
  return (cs->cset->charpos(cs, (const char*) b, (const char *)e, num));
 
824
  return cs->cset->charpos(cs, reinterpret_cast<const char*>(b), reinterpret_cast<const char*>(e), num);
825
825
}
826
826
 
827
827
inline static bool use_mb(const charset_info_st *cs)
828
828
{
829
 
  return (cs->cset->ismbchar != NULL);
 
829
  return cs->cset->ismbchar != NULL;
830
830
}
831
831
 
832
832
inline static unsigned int  my_ismbchar(const charset_info_st *cs, const char *a, const char *b)
833
833
{
834
 
  return (cs->cset->ismbchar(cs, a, b));
 
834
  return cs->cset->ismbchar(cs, a, b);
835
835
}
836
836
 
837
837
inline static unsigned int my_mbcharlen(const charset_info_st *cs, uint32_t c)
838
838
{
839
 
  return (cs->cset->mbcharlen(cs, c));
 
839
  return cs->cset->mbcharlen(cs, c);
840
840
}
841
841
 
842
842
 
843
843
inline static size_t my_caseup_str(const charset_info_st *cs, char *src)
844
844
{
845
 
  return (cs->cset->caseup_str(cs, src));
 
845
  return cs->cset->caseup_str(cs, src);
846
846
}
847
847
 
848
848
inline static size_t my_casedn_str(const charset_info_st *cs, char *src)
849
849
{
850
 
  return (cs->cset->casedn_str(cs, src));
 
850
  return cs->cset->casedn_str(cs, src);
851
851
}
852
852
 
853
853
inline static long my_strntol(const charset_info_st *cs,