~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/charset_info.h

  • Committer: Monty Taylor
  • Date: 2011-02-11 22:57:37 UTC
  • mto: (2165.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110211225737-zb9chwaonvklf94d
Provide pkg-config files and also stick drizzle plugin files in a place
where we don't conflict with our tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <sys/types.h>
24
24
#include <cstddef>
25
25
 
26
 
#include <drizzled/visibility.h>
 
26
#include "drizzled/visibility.h"
27
27
 
28
28
namespace drizzled
29
29
{
163
163
/* See strings/CHARSET_INFO.txt for information about this structure  */
164
164
typedef struct my_collation_handler_st
165
165
{
166
 
  bool (*init)(struct charset_info_st *, unsigned char *(*alloc)(size_t));
 
166
  bool (*init)(struct charset_info_st *, void *(*alloc)(size_t));
167
167
  /* Collation routines */
168
168
  int     (*strnncoll)(const struct charset_info_st * const,
169
169
                       const unsigned char *, size_t, const unsigned char *, size_t, bool);
214
214
/* See strings/CHARSET_INFO.txt about information on this structure  */
215
215
typedef struct my_charset_handler_st
216
216
{
217
 
  bool (*init)(struct charset_info_st *, unsigned char *(*alloc)(size_t));
 
217
  bool (*init)(struct charset_info_st *, void *(*alloc)(size_t));
218
218
  /* Multibyte routines */
219
219
  uint32_t    (*ismbchar)(const struct charset_info_st * const, const char *, const char *);
220
220
  uint32_t    (*mbcharlen)(const struct charset_info_st * const, uint32_t c);
439
439
size_t my_charpos_8bit(const CHARSET_INFO * const, const char *b, const char *e, size_t pos);
440
440
size_t my_well_formed_len_8bit(const CHARSET_INFO * const, const char *b, const char *e,
441
441
                             size_t pos, int *error);
442
 
typedef unsigned char *(*cs_alloc_func)(size_t);
 
442
typedef  void *(*cs_alloc_func)(size_t);
443
443
bool my_coll_init_simple(CHARSET_INFO *cs, cs_alloc_func alloc);
444
444
bool my_cset_init_8bit(CHARSET_INFO *cs, cs_alloc_func alloc);
445
445
uint32_t my_mbcharlen_8bit(const CHARSET_INFO * const, uint32_t c);
686
686
  return (c | 64);
687
687
}
688
688
 
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;
 
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);
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, reinterpret_cast<const char*>(b), reinterpret_cast<const char*>(e), num);
 
824
  return (cs->cset->charpos(cs, (const char*) b, (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,