~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/param.cc

  • Committer: Monty Taylor
  • Date: 2009-02-04 01:51:06 UTC
  • mto: (779.7.3 devel)
  • mto: This revision was merged to the branch mainline in revision 832.
  • Revision ID: mordred@inaugust.com-20090204015106-iksn2vqirlmir0ty
Split out U8_ macros into their own header and added the IBM copyright notice to them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/item/param.h>
27
27
#include CMATH_H
28
28
#include <drizzled/sql_string.h>
 
29
#include <mystrings/utf8.h>
29
30
 
30
31
Item *Item_param::safe_charset_converter(const CHARSET_INFO * const tocs)
31
32
{
536
537
}
537
538
 
538
539
 
539
 
/* Borrowed from libicu header */
540
 
 
541
 
#define U8_IS_SINGLE(c) (((c)&0x80)==0)
542
 
#define U8_LENGTH(c) \
543
 
    ((uint32_t)(c)<=0x7f ? 1 : \
544
 
        ((uint32_t)(c)<=0x7ff ? 2 : \
545
 
            ((uint32_t)(c)<=0xd7ff ? 3 : \
546
 
                ((uint32_t)(c)<=0xdfff || (uint32_t)(c)>0x10ffff ? 0 : \
547
 
                    ((uint32_t)(c)<=0xffff ? 3 : 4)\
548
 
                ) \
549
 
            ) \
550
 
        ) \
551
 
    )
552
540
 
553
541
/*
554
542
  Add escape characters to a string (blob?) to make it suitable for a insert