~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzleclient/libdrizzle.c

  • 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:
54
54
 
55
55
#include <stdlib.h>
56
56
#include <string.h>
57
 
 
58
 
/* Borrowed from libicu header */
59
 
 
60
 
#define U8_IS_SINGLE(c) (((c)&0x80)==0)
61
 
#define U8_LENGTH(c) \
62
 
    ((uint32_t)(c)<=0x7f ? 1 : \
63
 
        ((uint32_t)(c)<=0x7ff ? 2 : \
64
 
            ((uint32_t)(c)<=0xd7ff ? 3 : \
65
 
                ((uint32_t)(c)<=0xdfff || (uint32_t)(c)>0x10ffff ? 0 : \
66
 
                    ((uint32_t)(c)<=0xffff ? 3 : 4)\
67
 
                ) \
68
 
            ) \
69
 
        ) \
70
 
    )
 
57
#include <mystrings/utf8.h>
71
58
 
72
59
 
73
60
#undef net_buffer_length